xunge/DecIR huggingface dataset:
int hash_func(int data) { return (data & ((1 << 16) - 1)); }


x86 assembly (clang, -O0):
<hash_func>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash_func>:
movzwl %di,%eax
ret

LLVM IR (-O0):
define i32 @hash_func(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 65535
ret i32 %4
}

LLVM IR (-O2):
define i32 @hash_func(i32 %0) {
%2 = and i32 %0, 65535
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ frm(char *);
scalar_t__ gets(char *);
main() {
  char line[100];
  while (gets(line))
    frm(line);
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x70(%rbp),%rdi
call   1030 <gets@plt>
cmp    $0x0,%rax
je     1150 <main+0x30>
lea    -0x70(%rbp),%rdi
call   1040 <frm@plt>
jmp    112f <main+0xf>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x70,%rsp
mov    %rsp,%rdi
call   1030 <gets@plt>
test   %rax,%rax
je     1155 <main+0x35>
mov    %rsp,%rbx
cs nopw 0x0(%rax,%rax,1)
nop
mov    %rbx,%rdi
call   1040 <frm@plt>
mov    %rbx,%rdi
call   1030 <gets@plt>
test   %rax,%rax
jne    1140 <main+0x20>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca [100 x i8]
store i32 0, i32* %1
br label %3
3: ; preds = %7, %0
%4 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%5 = call i64 @gets(i8* %4)
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %3
%8 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%9 = call i32 @frm(i8* %8)
br label %3
10: ; preds = %3
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca [100 x i8]
%2 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%3 = call i64 @gets(i8* %2)
%4 = icmp eq i64 %3, 0
br i1 %4, label %9, label %5
5: ; preds = %0, %5
%6 = call i32 @frm(i8* %2)
%7 = call i64 @gets(i8* %2)
%8 = icmp eq i64 %7, 0
br i1 %8, label %9, label %5
9: ; preds = %5, %0
ret i32 0
}
void databack(const char *data) { (void)data; }


x86 assembly (clang, -O0):
<databack>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<databack>:
ret

LLVM IR (-O0):
define void @databack(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
ret void
}

LLVM IR (-O2):
define void @databack(i8* nocapture %0) {
ret void
}
void set_excalibur_att(void) {}


x86 assembly (clang, -O0):
<set_excalibur_att>:
push   %rbp
mov    %rsp,%rbp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_excalibur_att>:
ret

LLVM IR (-O0):
define void @set_excalibur_att() {
ret void
}

LLVM IR (-O2):
define void @set_excalibur_att() {
ret void
}
/* Variables and functions */
int countSegments(char *);
int /*<<< orphan*/ printf(char *, char *, int);
void test(char *s) { printf("seg(`%s`) = %d\n", s, countSegments(s)); }


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <countSegments@plt>
mov    -0x10(%rbp),%rsi
mov    %eax,%edx
lea    0xeb6(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test>:
push   %rbx
mov    %rdi,%rbx
call   1040 <countSegments@plt>
lea    0xed0(%rip),%rdi
mov    %rbx,%rsi
mov    %eax,%edx
pop    %rbx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"seg(`%s`) = %d\0A\00"
define void @test(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @countSegments(i8* %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* %3, i32 %5)
ret void
}

LLVM IR (-O2):
@.str = [16 x i8] c"seg(`%s`) = %d\0A\00"
define void @test(i8* %0) {
%2 = tail call i32 @countSegments(i8* %0)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %2)
ret void
}
void exprGetVersion(int *major, int *minor) {
  *major = 2;
  *minor = 7;
}


x86 assembly (clang, -O0):
<exprGetVersion>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movl   $0x2,(%rax)
mov    -0x10(%rbp),%rax
movl   $0x7,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<exprGetVersion>:
movl   $0x2,(%rdi)
movl   $0x7,(%rsi)
ret

LLVM IR (-O0):
define void @exprGetVersion(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
store i32* %0, i32** %3
store i32* %1, i32** %4
%5 = load i32*, i32** %3
store i32 2, i32* %5
%6 = load i32*, i32** %4
store i32 7, i32* %6
ret void
}

LLVM IR (-O2):
define void @exprGetVersion(i32* nocapture writeonly %0, i32* nocapture writeonly %1) {
store i32 2, i32* %0
store i32 7, i32* %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void primero(int arg) { printf("Estudiantes matriculados en SO %d\n", arg); }


x86 assembly (clang, -O0):
<primero>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xedb(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<primero>:
mov    %edi,%esi
lea    0xee7(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [35 x i8] c"Estudiantes matriculados en SO %d\0A\00"
define void @primero(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i32 %3)
ret void
}

LLVM IR (-O2):
@.str = [35 x i8] c"Estudiantes matriculados en SO %d\0A\00"
define void @primero(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ divide(int *, int, int /*<<< orphan*/, int /*<<< orphan*/,
                          int, int /*<<< orphan*/);
scalar_t__ malloc(int);
int *twiddle_twiddle(int length) {
  int *ptr = (int *)malloc(sizeof(int) * length * length);
  if (ptr == NULL)
    return NULL;
  divide(ptr, length, 0, 0, length, 0);
  return ptr;
}


x86 assembly (clang, -O0):
<twiddle_twiddle>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0xc(%rbp)
movslq -0xc(%rbp),%rax
shl    $0x2,%rax
movslq -0xc(%rbp),%rcx
imul   %rcx,%rax
mov    %eax,%edi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    115e <twiddle_twiddle+0x3e>
movq   $0x0,-0x8(%rbp)
jmp    117f <twiddle_twiddle+0x5f>
mov    -0x18(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0xc(%rbp),%r8d
xor    %r9d,%r9d
mov    %r9d,%edx
mov    %r9d,%ecx
call   1030 <divide@plt>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<twiddle_twiddle>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebp
imul   %edi,%edi
shl    $0x2,%edi
call   1040 <malloc@plt>
test   %rax,%rax
je     114e <twiddle_twiddle+0x2e>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %ebp,%esi
xor    %edx,%edx
xor    %ecx,%ecx
mov    %ebp,%r8d
xor    %r9d,%r9d
call   1030 <divide@plt>
jmp    1150 <twiddle_twiddle+0x30>
xor    %ebx,%ebx
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32* @twiddle_twiddle(i32 %0) {
%2 = alloca i32*
%3 = alloca i32
%4 = alloca i32*
store i32 %0, i32* %3
%5 = load i32, i32* %3
%6 = sext i32 %5 to i64
%7 = mul i64 4, %6
%8 = load i32, i32* %3
%9 = sext i32 %8 to i64
%10 = mul i64 %7, %9
%11 = trunc i64 %10 to i32
%12 = call i64 @malloc(i32 %11)
%13 = inttoptr i64 %12 to i32*
store i32* %13, i32** %4
%14 = load i32*, i32** %4
%15 = icmp eq i32* %14, null
br i1 %15, label %16, label %17
16: ; preds = %1
store i32* null, i32** %2
br label %23
17: ; preds = %1
%18 = load i32*, i32** %4
%19 = load i32, i32* %3
%20 = load i32, i32* %3
%21 = call i32 @divide(i32* %18, i32 %19, i32 0, i32 0, i32 %20, i32 0)
%22 = load i32*, i32** %4
store i32* %22, i32** %2
br label %23
23: ; preds = %17, %16
%24 = load i32*, i32** %2
ret i32* %24
}

LLVM IR (-O2):
define i32* @twiddle_twiddle(i32 %0) {
%2 = shl i32 %0, 2
%3 = mul i32 %2, %0
%4 = tail call i64 @malloc(i32 %3)
%5 = inttoptr i64 %4 to i32*
%6 = icmp eq i64 %4, 0
br i1 %6, label %9, label %7
7: ; preds = %1
%8 = tail call i32 @divide(i32* %5, i32 %0, i32 0, i32 0, i32 %0, i32 0)
br label %9
9: ; preds = %1, %7
%10 = phi i32* [ %5, %7 ], [ null, %1 ]
ret i32* %10
}
int c_2_h(char c) {
  int res = 0;
  if ((c >= '0') && (c <= '9')) {
    res = c - '0';
  }
  if ((c >= 'A') && (c <= 'F')) {
    res = c - 'A' + 10;
  }
  if ((c >= 'a') && (c <= 'f')) {
    res = c - 'a' + 10;
  }
  return res;
}


x86 assembly (clang, -O0):
<c_2_h>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movl   $0x0,-0x8(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x30,%eax
jl     1135 <c_2_h+0x35>
movsbl -0x1(%rbp),%eax
cmp    $0x39,%eax
jg     1135 <c_2_h+0x35>
movsbl -0x1(%rbp),%eax
sub    $0x30,%eax
mov    %eax,-0x8(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x41,%eax
jl     115c <c_2_h+0x5c>
movsbl -0x1(%rbp),%eax
cmp    $0x46,%eax
jg     115c <c_2_h+0x5c>
movsbl -0x1(%rbp),%eax
sub    $0x41,%eax
add    $0xa,%eax
mov    %eax,-0x8(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x61,%eax
jl     1183 <c_2_h+0x83>
movsbl -0x1(%rbp),%eax
cmp    $0x66,%eax
jg     1183 <c_2_h+0x83>
movsbl -0x1(%rbp),%eax
sub    $0x61,%eax
add    $0xa,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<c_2_h>:
lea    -0x30(%rdi),%eax
lea    -0x30(%rdi),%ecx
xor    %edx,%edx
cmp    $0xa,%al
cmovb  %ecx,%edx
lea    -0x41(%rdi),%eax
lea    -0x37(%rdi),%ecx
cmp    $0x6,%al
cmovae %edx,%ecx
lea    -0x61(%rdi),%edx
lea    -0x57(%rdi),%eax
cmp    $0x6,%dl
cmovae %ecx,%eax
ret

LLVM IR (-O0):
define i32 @c_2_h(i8 signext %0) {
%2 = alloca i8
%3 = alloca i32
store i8 %0, i8* %2
store i32 0, i32* %3
%4 = load i8, i8* %2
%5 = sext i8 %4 to i32
%6 = icmp sge i32 %5, 48
br i1 %6, label %7, label %15
7: ; preds = %1
%8 = load i8, i8* %2
%9 = sext i8 %8 to i32
%10 = icmp sle i32 %9, 57
br i1 %10, label %11, label %15
11: ; preds = %7
%12 = load i8, i8* %2
%13 = sext i8 %12 to i32
%14 = sub nsw i32 %13, 48
store i32 %14, i32* %3
br label %15
15: ; preds = %11, %7, %1
%16 = load i8, i8* %2
%17 = sext i8 %16 to i32
%18 = icmp sge i32 %17, 65
br i1 %18, label %19, label %28
19: ; preds = %15
%20 = load i8, i8* %2
%21 = sext i8 %20 to i32
%22 = icmp sle i32 %21, 70
br i1 %22, label %23, label %28
23: ; preds = %19
%24 = load i8, i8* %2
%25 = sext i8 %24 to i32
%26 = sub nsw i32 %25, 65
%27 = add nsw i32 %26, 10
store i32 %27, i32* %3
br label %28
28: ; preds = %23, %19, %15
%29 = load i8, i8* %2
%30 = sext i8 %29 to i32
%31 = icmp sge i32 %30, 97
br i1 %31, label %32, label %41
32: ; preds = %28
%33 = load i8, i8* %2
%34 = sext i8 %33 to i32
%35 = icmp sle i32 %34, 102
br i1 %35, label %36, label %41
36: ; preds = %32
%37 = load i8, i8* %2
%38 = sext i8 %37 to i32
%39 = sub nsw i32 %38, 97
%40 = add nsw i32 %39, 10
store i32 %40, i32* %3
br label %41
41: ; preds = %36, %32, %28
%42 = load i32, i32* %3
ret i32 %42
}

LLVM IR (-O2):
define i32 @c_2_h(i8 signext %0) {
%2 = sext i8 %0 to i32
%3 = add i8 %0, -48
%4 = icmp ult i8 %3, 10
%5 = add nsw i32 %2, -48
%6 = select i1 %4, i32 %5, i32 0
%7 = add i8 %0, -65
%8 = icmp ult i8 %7, 6
%9 = add nsw i32 %2, -55
%10 = select i1 %8, i32 %9, i32 %6
%11 = add i8 %0, -97
%12 = icmp ult i8 %11, 6
%13 = add nsw i32 %2, -87
%14 = select i1 %12, i32 %13, i32 %10
ret i32 %14
}
/* Variables and functions */
int bmp085_i2c_Begin();
unsigned int bmp085_i2c_Read_Int(int, int);
int /*<<< orphan*/ bmp085_i2c_Write_Byte(int, int, int);
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ usleep(int);
unsigned int bmp085_ReadUT() {
  unsigned int ut = 0;
  int fd = bmp085_i2c_Begin();
  bmp085_i2c_Write_Byte(fd, 0xF4, 0x2E);
  usleep(5000);
  ut = bmp085_i2c_Read_Int(fd, 0xF6);
  close(fd);
  return ut;
}


x86 assembly (clang, -O0):
<bmp085_ReadUT>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1050 <bmp085_i2c_Begin@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
mov    $0xf4,%esi
mov    $0x2e,%edx
call   1030 <bmp085_i2c_Write_Byte@plt>
mov    $0x1388,%edi
call   1070 <usleep@plt>
mov    -0x8(%rbp),%edi
mov    $0xf6,%esi
call   1060 <bmp085_i2c_Read_Int@plt>
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%edi
call   1040 <close@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bmp085_ReadUT>:
push   %rbp
push   %rbx
push   %rax
xor    %eax,%eax
call   1050 <bmp085_i2c_Begin@plt>
mov    %eax,%ebx
mov    %eax,%edi
mov    $0xf4,%esi
mov    $0x2e,%edx
call   1030 <bmp085_i2c_Write_Byte@plt>
mov    $0x1388,%edi
call   1070 <usleep@plt>
mov    %ebx,%edi
mov    $0xf6,%esi
call   1060 <bmp085_i2c_Read_Int@plt>
mov    %eax,%ebp
mov    %ebx,%edi
call   1040 <close@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @bmp085_ReadUT() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 (...) @bmp085_i2c_Begin()
store i32 %3, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @bmp085_i2c_Write_Byte(i32 %4, i32 244, i32 46)
%6 = call i32 @usleep(i32 5000)
%7 = load i32, i32* %2
%8 = call i32 @bmp085_i2c_Read_Int(i32 %7, i32 246)
store i32 %8, i32* %1
%9 = load i32, i32* %2
%10 = call i32 @close(i32 %9)
%11 = load i32, i32* %1
ret i32 %11
}

LLVM IR (-O2):
define i32 @bmp085_ReadUT() {
%1 = tail call i32 (...) @bmp085_i2c_Begin()
%2 = tail call i32 @bmp085_i2c_Write_Byte(i32 %1, i32 244, i32 46)
%3 = tail call i32 @usleep(i32 5000)
%4 = tail call i32 @bmp085_i2c_Read_Int(i32 %1, i32 246)
%5 = tail call i32 @close(i32 %1)
ret i32 %4
}
double morgan_1974(double annual_pmm) {
  double result;
  result = (((annual_pmm * 9.28) - 8838.0) * 75.0) / 1000.0;
  return result;
}


x86 assembly (clang, -O0):
<morgan_1974>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xefa(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xef6(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  0xeda(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xec6(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<morgan_1974>:
mulsd  0xef8(%rip),%xmm0
addsd  0xef8(%rip),%xmm0
mulsd  0xef8(%rip),%xmm0
divsd  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define double @morgan_1974(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %2
%4 = load double, double* %2
%5 = call double @llvm.fmuladd.f64(double %4, double 9.280000e+00, double -8.838000e+03)
%6 = fmul double %5, 7.500000e+01
%7 = fdiv double %6, 1.000000e+03
store double %7, double* %3
%8 = load double, double* %3
ret double %8
}

LLVM IR (-O2):
define double @morgan_1974(double %0) {
%2 = tail call double @llvm.fmuladd.f64(double %0, double 9.280000e+00, double -8.838000e+03)
%3 = fmul double %2, 7.500000e+01
%4 = fdiv double %3, 1.000000e+03
ret double %4
}
/* Variables and functions */
scalar_t__ EOF;
scalar_t__ getchar();
int /*<<< orphan*/ printf(char *, double);
int main() {
  double nc;
  for (nc = 0; getchar() != EOF; ++nc)
    ;
  printf("%.0f\n", nc);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x10(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
mov    0x2ea3(%rip),%rcx
cmp    (%rcx),%rax
je     116a <main+0x4a>
jmp    1153 <main+0x33>
movsd  0xea5(%rip),%xmm0
addsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
jmp    1137 <main+0x17>
movsd  -0x10(%rbp),%xmm0
lea    0xe92(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
xor    %eax,%eax
call   1040 <getchar@plt>
mov    0x2eb5(%rip),%rbx
xorpd  %xmm0,%xmm0
cmp    (%rbx),%rax
je     1160 <main+0x40>
xorpd  %xmm0,%xmm0
addsd  0xeb8(%rip),%xmm0
movsd  %xmm0,0x8(%rsp)
xor    %eax,%eax
call   1040 <getchar@plt>
movsd  0x8(%rsp),%xmm0
cmp    (%rbx),%rax
jne    1140 <main+0x20>
lea    0xea1(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@EOF = global i64 0
@.str = [6 x i8] c"%.0f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
store i32 0, i32* %1
store double 0.000000e+00, double* %2
br label %3
3: ; preds = %8, %0
%4 = call i64 (...) @getchar()
%5 = load i64, i64* @EOF
%6 = icmp ne i64 %4, %5
br i1 %6, label %7, label %11
7: ; preds = %3
br label %8
8: ; preds = %7
%9 = load double, double* %2
%10 = fadd double %9, 1.000000e+00
store double %10, double* %2
br label %3
11: ; preds = %3
%12 = load double, double* %2
%13 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), double %12)
%14 = load i32, i32* %1
ret i32 %14
}

LLVM IR (-O2):
@EOF = global i64 0
@.str = [6 x i8] c"%.0f\0A\00"
define i32 @main() {
%1 = tail call i64 (...) @getchar()
%2 = load i64, i64* @EOF
%3 = icmp eq i64 %1, %2
br i1 %3, label %10, label %4
4: ; preds = %0, %4
%5 = phi double [ %6, %4 ], [ 0.000000e+00, %0 ]
%6 = fadd double %5, 1.000000e+00
%7 = tail call i64 (...) @getchar()
%8 = load i64, i64* @EOF
%9 = icmp eq i64 %7, %8
br i1 %9, label %10, label %4
10: ; preds = %4, %0
%11 = phi double [ 0.000000e+00, %0 ], [ %6, %4 ]
%12 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), double %11)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ println(char *);
int main() {
  println("Hello World\n");
  println("This is a C wrapper!\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
call   1030 <println@plt>
lea    0xedb(%rip),%rdi
call   1030 <println@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <println@plt>
lea    0xee9(%rip),%rdi
call   1030 <println@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [13 x i8] c"Hello World\0A\00"
@.str.1 = [22 x i8] c"This is a C wrapper!\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @println(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @println(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [13 x i8] c"Hello World\0A\00"
@.str.1 = [22 x i8] c"This is a C wrapper!\0A\00"
define i32 @main() {
%1 = tail call i32 @println(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @println(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
void *malloc(size_t);
void *mymalloc(size_t newsize) {
  void *rv;
  if (newsize > 0)
    rv = malloc(newsize);
  else
    rv = (void *)0;
  return rv;
}


x86 assembly (clang, -O0):
<mymalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jbe    1139 <mymalloc+0x29>
mov    -0x8(%rbp),%rdi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
jmp    1141 <mymalloc+0x31>
movq   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mymalloc>:
test   %rdi,%rdi
je     111a <mymalloc+0xa>
jmp    1030 <malloc@plt>
xor    %eax,%eax
ret

LLVM IR (-O0):
define i8* @mymalloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = icmp ugt i64 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load i64, i64* %2
%8 = call i8* @malloc(i64 %7)
store i8* %8, i8** %3
br label %10
9: ; preds = %1
store i8* null, i8** %3
br label %10
10: ; preds = %9, %6
%11 = load i8*, i8** %3
ret i8* %11
}

LLVM IR (-O2):
define noalias i8* @mymalloc(i64 %0) {
%2 = icmp eq i64 %0, 0
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i8* @malloc(i64 %0)
br label %5
5: ; preds = %1, %3
%6 = phi i8* [ %4, %3 ], [ null, %1 ]
ret i8* %6
}
/* Variables and functions */
int /*<<< orphan*/ print_int(int);
int /*<<< orphan*/ print_string(char *);
void main(void) {
  int num;
  num = '1';
  print_string("Should get 49, since '1' is equal to 49\n");
  print_int(num);
  print_string("\n");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x31,-0x4(%rbp)
lea    0xeca(%rip),%rdi
call   1030 <print_string@plt>
mov    -0x4(%rbp),%edi
call   1040 <print_int@plt>
lea    0xedd(%rip),%rdi
call   1030 <print_string@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <print_string@plt>
mov    $0x31,%edi
call   1040 <print_int@plt>
lea    0xee9(%rip),%rdi
pop    %rax
jmp    1030 <print_string@plt>

LLVM IR (-O0):
@.str = [41 x i8] c"Should get 49, since '1' is equal to 49\0A\00"
@.str.1 = [2 x i8] c"\0A\00"
define void @main() {
%1 = alloca i32
store i32 49, i32* %1
%2 = call i32 @print_string(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
%4 = call i32 @print_int(i32 %3)
%5 = call i32 @print_string(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [41 x i8] c"Should get 49, since '1' is equal to 49\0A\00"
@.str.1 = [2 x i8] c"\0A\00"
define void @main() {
%1 = tail call i32 @print_string(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @print_int(i32 49)
%3 = tail call i32 @print_string(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ const __m128i;

/* Variables and functions */
int /*<<< orphan*/ const _mm_clmulepi64_si128(int /*<<< orphan*/ const,
                                              int /*<<< orphan*/ const, int);
int /*<<< orphan*/ const _mm_cvtsi64_si128(unsigned int);
int /*<<< orphan*/ const _mm_xor_si128(int /*<<< orphan*/ const,
                                       int /*<<< orphan*/ const);
__attribute__((always_)) __m128i fastreduction64_si128_for_small_A(__m128i A) {
  const __m128i C =
      _mm_cvtsi64_si128((1U << 4) + (1U << 3) + (1U << 1) + (1U << 0));
  __m128i Q2 = _mm_clmulepi64_si128(A, C, 0x01);
  const __m128i final = _mm_xor_si128(Q2, A);
  return final;
}


x86 assembly (clang, -O0):
<fastreduction64_si128_for_small_A>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x1b,%edi
call   1040 <_mm_cvtsi64_si128@plt>
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    $0x1,%edx
call   1030 <_mm_clmulepi64_si128@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%edi
mov    -0x4(%rbp),%esi
call   1050 <_mm_xor_si128@plt>
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fastreduction64_si128_for_small_A>:
push   %rbx
mov    %edi,%ebx
mov    $0x1b,%edi
call   1040 <_mm_cvtsi64_si128@plt>
mov    %ebx,%edi
mov    %eax,%esi
mov    $0x1,%edx
call   1030 <_mm_clmulepi64_si128@plt>
mov    %eax,%edi
mov    %ebx,%esi
pop    %rbx
jmp    1050 <_mm_xor_si128@plt>

LLVM IR (-O0):
define i32 @fastreduction64_si128_for_small_A(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %2
%6 = call i32 @_mm_cvtsi64_si128(i32 27)
store i32 %6, i32* %3
%7 = load i32, i32* %2
%8 = load i32, i32* %3
%9 = call i32 @_mm_clmulepi64_si128(i32 %7, i32 %8, i32 1)
store i32 %9, i32* %4
%10 = load i32, i32* %4
%11 = load i32, i32* %2
%12 = call i32 @_mm_xor_si128(i32 %10, i32 %11)
store i32 %12, i32* %5
%13 = load i32, i32* %5
ret i32 %13
}

LLVM IR (-O2):
define i32 @fastreduction64_si128_for_small_A(i32 %0) {
%2 = tail call i32 @_mm_cvtsi64_si128(i32 27)
%3 = tail call i32 @_mm_clmulepi64_si128(i32 %0, i32 %2, i32 1)
%4 = tail call i32 @_mm_xor_si128(i32 %3, i32 %0)
ret i32 %4
}
void s3c6400_default_sdhci1(void) {}


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
pop    %rbp
ret

x86 assembly (clang, -O2):
ret

LLVM IR (-O0):
define void @s3c6400_default_sdhci1() {
ret void
}

LLVM IR (-O2):
define void @s3c6400_default_sdhci1() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _s2warn(char *, char *);
unsigned int ss2ctt_(int *width, int *height) {
  _s2warn("ss2ctt", "function not available from FORTRAN");
  return 0;
}


x86 assembly (clang, -O0):
<ss2ctt_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xed9(%rip),%rdi
lea    0xed9(%rip),%rsi
call   1030 <_s2warn@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ss2ctt_>:
push   %rax
lea    0xee8(%rip),%rdi
lea    0xee8(%rip),%rsi
call   1030 <_s2warn@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [7 x i8] c"ss2ctt\00"
@.str.1 = [36 x i8] c"function not available from FORTRAN\00"
define i32 @ss2ctt_(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
store i32* %0, i32** %3
store i32* %1, i32** %4
%5 = call i32 @_s2warn(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [7 x i8] c"ss2ctt\00"
@.str.1 = [36 x i8] c"function not available from FORTRAN\00"
define i32 @ss2ctt_(i32* nocapture readnone %0, i32* nocapture readnone %1) {
%3 = tail call i32 @_s2warn(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
int main() { return sizeof(signed long); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    $0x8,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
mov    $0x8,%eax
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
ret i32 8
}

LLVM IR (-O2):
define i32 @main() {
ret i32 8
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
char *fgets(char *, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/ *);
int /*<<< orphan*/ rewind(int /*<<< orphan*/ *);
int /*<<< orphan*/ *stdout;
int /*<<< orphan*/ *tmpfile();
void test_tmpfile() {
  char buffer[256];
  FILE *pFile;
  pFile = tmpfile();
  fputs("hello world", pFile);
  rewind(pFile);
  fputs(fgets(buffer, 256, pFile), stdout);
  fclose(pFile);
}


x86 assembly (clang, -O0):
<test_tmpfile>:
push   %rbp
mov    %rsp,%rbp
sub    $0x110,%rsp
mov    $0x0,%al
call   1070 <tmpfile@plt>
mov    %rax,-0x108(%rbp)
mov    -0x108(%rbp),%rsi
lea    0xe89(%rip),%rdi
call   1050 <fputs@plt>
mov    -0x108(%rbp),%rdi
call   1040 <rewind@plt>
lea    -0x100(%rbp),%rdi
mov    -0x108(%rbp),%rdx
mov    $0x100,%esi
call   1060 <fgets@plt>
mov    %rax,%rdi
mov    0x2e36(%rip),%rax
mov    (%rax),%rsi
call   1050 <fputs@plt>
mov    -0x108(%rbp),%rdi
call   1030 <fclose@plt>
add    $0x110,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_tmpfile>:
push   %rbx
sub    $0x100,%rsp
xor    %eax,%eax
call   1070 <tmpfile@plt>
mov    %rax,%rbx
lea    0xe87(%rip),%rdi
mov    $0xb,%esi
mov    $0x1,%edx
mov    %rax,%rcx
call   1080 <fwrite@plt>
mov    %rbx,%rdi
call   1040 <rewind@plt>
mov    %rsp,%rdi
mov    $0x100,%esi
mov    %rbx,%rdx
call   1060 <fgets@plt>
mov    0x2e36(%rip),%rcx
mov    (%rcx),%rsi
mov    %rax,%rdi
call   1050 <fputs@plt>
mov    %rbx,%rdi
call   1030 <fclose@plt>
add    $0x100,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [12 x i8] c"hello world\00"
@stdout = global i32* null
define void @test_tmpfile() {
%1 = alloca [256 x i8]
%2 = alloca i32*
%3 = call i32* (...) @tmpfile()
store i32* %3, i32** %2
%4 = load i32*, i32** %2
%5 = call i32 @fputs(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32* %4)
%6 = load i32*, i32** %2
%7 = call i32 @rewind(i32* %6)
%8 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%9 = load i32*, i32** %2
%10 = call i8* @fgets(i8* %8, i32 256, i32* %9)
%11 = load i32*, i32** @stdout
%12 = call i32 @fputs(i8* %10, i32* %11)
%13 = load i32*, i32** %2
%14 = call i32 @fclose(i32* %13)
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"hello world\00"
@stdout = global i32* null
define void @test_tmpfile() {
%1 = alloca [256 x i8]
%2 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%3 = tail call i32* (...) @tmpfile()
%4 = tail call i64 @fwrite(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i64 11, i64 1, i32* %3)
%5 = tail call i32 @rewind(i32* %3)
%6 = call i8* @fgets(i8* %2, i32 256, i32* %3)
%7 = load i32*, i32** @stdout
%8 = call i32 @fputs(i8* %6, i32* %7)
%9 = call i32 @fclose(i32* %3)
ret void
}
void av_opt_set_defaults() {}


x86 assembly (clang, -O0):
<av_opt_set_defaults>:
push   %rbp
mov    %rsp,%rbp
pop    %rbp
ret

x86 assembly (clang, -O2):
<av_opt_set_defaults>:
ret

LLVM IR (-O0):
define void @av_opt_set_defaults() {
ret void
}

LLVM IR (-O2):
define void @av_opt_set_defaults() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ __off_t;

/* Variables and functions */
int /*<<< orphan*/ lseek64(int, int /*<<< orphan*/, int);
__off_t lseek(int fildes, __off_t offset, int whence) {
  return lseek64(fildes, offset, whence);
}


x86 assembly (clang, -O0):
<lseek>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
call   1030 <lseek64@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lseek>:
jmp    1030 <lseek64@plt>

LLVM IR (-O0):
define i32 @lseek(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = call i32 @lseek64(i32 %7, i32 %8, i32 %9)
ret i32 %10
}

LLVM IR (-O2):
define i32 @lseek(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @lseek64(i32 %0, i32 %1, i32 %2)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ end_dd();
int /*<<< orphan*/ start_p();
void start_dl() {
  end_dd();
  start_p();
}


x86 assembly (clang, -O0):
<start_dl>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <end_dd@plt>
mov    $0x0,%al
call   1030 <start_p@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<start_dl>:
push   %rax
xor    %eax,%eax
call   1040 <end_dd@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <start_p@plt>

LLVM IR (-O0):
define void @start_dl() {
%1 = call i32 (...) @end_dd()
%2 = call i32 (...) @start_p()
ret void
}

LLVM IR (-O2):
define void @start_dl() {
%1 = tail call i32 (...) @end_dd()
%2 = tail call i32 (...) @start_p()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ check_O(int /*<<< orphan*/ *);
int /*<<< orphan*/ check_V(int /*<<< orphan*/ *);
int check_E(FILE *src) {
  if (!check_V(src)) {
    goto error;
  }
  if (!check_O(src)) {
    goto error;
  }
  if (!check_V(src)) {
    goto error;
  }
  return 1;
error:
  return 0;
}


x86 assembly (clang, -O0):
<check_E>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <check_V@plt>
cmp    $0x0,%eax
jne    1143 <check_E+0x23>
jmp    117d <check_E+0x5d>
mov    -0x10(%rbp),%rdi
call   1040 <check_O@plt>
cmp    $0x0,%eax
jne    115a <check_E+0x3a>
jmp    117d <check_E+0x5d>
mov    -0x10(%rbp),%rdi
call   1030 <check_V@plt>
cmp    $0x0,%eax
jne    1171 <check_E+0x51>
jmp    117d <check_E+0x5d>
movl   $0x1,-0x4(%rbp)
jmp    1184 <check_E+0x64>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_E>:
push   %rbx
mov    %rdi,%rbx
call   1030 <check_V@plt>
test   %eax,%eax
je     114e <check_E+0x2e>
mov    %rbx,%rdi
call   1040 <check_O@plt>
test   %eax,%eax
je     114e <check_E+0x2e>
mov    %rbx,%rdi
call   1030 <check_V@plt>
mov    %eax,%ecx
mov    $0x1,%eax
test   %ecx,%ecx
je     114e <check_E+0x2e>
pop    %rbx
ret
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @check_E(i32* %0) {
%2 = alloca i32
%3 = alloca i32*
store i32* %0, i32** %3
%4 = load i32*, i32** %3
%5 = call i32 @check_V(i32* %4)
%6 = icmp ne i32 %5, 0
br i1 %6, label %8, label %7
7: ; preds = %1
br label %19
8: ; preds = %1
%9 = load i32*, i32** %3
%10 = call i32 @check_O(i32* %9)
%11 = icmp ne i32 %10, 0
br i1 %11, label %13, label %12
12: ; preds = %8
br label %19
13: ; preds = %8
%14 = load i32*, i32** %3
%15 = call i32 @check_V(i32* %14)
%16 = icmp ne i32 %15, 0
br i1 %16, label %18, label %17
17: ; preds = %13
br label %19
18: ; preds = %13
store i32 1, i32* %2
br label %20
19: ; preds = %17, %12, %7
store i32 0, i32* %2
br label %20
20: ; preds = %19, %18
%21 = load i32, i32* %2
ret i32 %21
}

LLVM IR (-O2):
define i32 @check_E(i32* %0) {
%2 = tail call i32 @check_V(i32* %0)
%3 = icmp eq i32 %2, 0
br i1 %3, label %10, label %4
4: ; preds = %1
%5 = tail call i32 @check_O(i32* %0)
%6 = icmp eq i32 %5, 0
br i1 %6, label %10, label %7
7: ; preds = %4
%8 = tail call i32 @check_V(i32* %0)
%9 = icmp eq i32 %8, 0
br i1 %9, label %10, label %11
10: ; preds = %7, %4, %1
br label %11
11: ; preds = %7, %10
%12 = phi i32 [ 0, %10 ], [ 1, %7 ]
ret i32 %12
}
/* Variables and functions */
int SEGGER_RTT_Read(int /*<<< orphan*/, char *, int);
int SEGGER_RTT_GetKey(void) {
  char c;
  int r;
  r = SEGGER_RTT_Read(0, &c, 1);
  if (r == 1) {
    return (int)(unsigned char)c;
  }
  return -1;
}


x86 assembly (clang, -O0):
<SEGGER_RTT_GetKey>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xor    %edi,%edi
lea    -0x5(%rbp),%rsi
mov    $0x1,%edx
call   1030 <SEGGER_RTT_Read@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x1,-0xc(%rbp)
jne    1141 <SEGGER_RTT_GetKey+0x31>
movzbl -0x5(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1148 <SEGGER_RTT_GetKey+0x38>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SEGGER_RTT_GetKey>:
push   %rax
lea    0x7(%rsp),%rsi
xor    %edi,%edi
mov    $0x1,%edx
call   1030 <SEGGER_RTT_Read@plt>
cmp    $0x1,%eax
movzbl 0x7(%rsp),%ecx
mov    $0xffffffff,%eax
cmove  %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @SEGGER_RTT_GetKey() {
%1 = alloca i32
%2 = alloca i8
%3 = alloca i32
%4 = call i32 @SEGGER_RTT_Read(i32 0, i8* %2, i32 1)
store i32 %4, i32* %3
%5 = load i32, i32* %3
%6 = icmp eq i32 %5, 1
br i1 %6, label %7, label %10
7: ; preds = %0
%8 = load i8, i8* %2
%9 = zext i8 %8 to i32
store i32 %9, i32* %1
br label %11
10: ; preds = %0
store i32 -1, i32* %1
br label %11
11: ; preds = %10, %7
%12 = load i32, i32* %1
ret i32 %12
}

LLVM IR (-O2):
define i32 @SEGGER_RTT_GetKey() {
%1 = alloca i8
%2 = call i32 @SEGGER_RTT_Read(i32 0, i8* %1, i32 1)
%3 = icmp eq i32 %2, 1
%4 = load i8, i8* %1
%5 = zext i8 %4 to i32
%6 = select i1 %3, i32 %5, i32 -1
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ ati_test_for_card_disappeared();
int aty_ld_le32(int);
void wait_for_fifo(unsigned short entries) {
  ati_test_for_card_disappeared();
  while ((aty_ld_le32(0x0310) & 0xffff) > ((unsigned)(0x8000 >> entries)))
    ;
}


x86 assembly (clang, -O0):
<wait_for_fifo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    $0x0,%al
call   1040 <ati_test_for_card_disappeared@plt>
mov    $0x310,%edi
call   1030 <aty_ld_le32@plt>
and    $0xffff,%eax
movzwl -0x2(%rbp),%ecx
mov    $0x8000,%edx
sar    %cl,%edx
mov    %edx,%ecx
cmp    %ecx,%eax
jbe    115f <wait_for_fifo+0x3f>
jmp    1136 <wait_for_fifo+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wait_for_fifo>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
xor    %eax,%eax
call   1040 <ati_test_for_card_disappeared@plt>
mov    $0x8000,%ebp
mov    %ebx,%ecx
shr    %cl,%ebp
cs nopw 0x0(%rax,%rax,1)
nop
mov    $0x310,%edi
call   1030 <aty_ld_le32@plt>
movzwl %ax,%eax
cmp    %ebp,%eax
ja     1140 <wait_for_fifo+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define void @wait_for_fifo(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = call i32 (...) @ati_test_for_card_disappeared()
br label %4
4: ; preds = %11, %1
%5 = call i32 @aty_ld_le32(i32 784)
%6 = and i32 %5, 65535
%7 = load i16, i16* %2
%8 = zext i16 %7 to i32
%9 = ashr i32 32768, %8
%10 = icmp ugt i32 %6, %9
br i1 %10, label %11, label %12
11: ; preds = %4
br label %4
12: ; preds = %4
ret void
}

LLVM IR (-O2):
define void @wait_for_fifo(i16 zeroext %0) {
%2 = tail call i32 (...) @ati_test_for_card_disappeared()
%3 = zext i16 %0 to i32
%4 = lshr i32 32768, %3
br label %5
5: ; preds = %5, %1
%6 = tail call i32 @aty_ld_le32(i32 784)
%7 = and i32 %6, 65535
%8 = icmp ugt i32 %7, %4
br i1 %8, label %5, label %9
9: ; preds = %5
ret void
}
long long zssz() { return 0x0000ffffffff0000LL; }


x86 assembly (clang, -O0):
<zssz>:
push   %rbp
mov    %rsp,%rbp
movabs $0xffffffff0000,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<zssz>:
movabs $0xffffffff0000,%rax
ret

LLVM IR (-O0):
define i64 @zssz() {
ret i64 281474976645120
}

LLVM IR (-O2):
define i64 @zssz() {
ret i64 281474976645120
}
/* Variables and functions */
int /*<<< orphan*/ assem_debug(char *);
int /*<<< orphan*/ output_byte(int);
void emit_popa(void) {
  assem_debug("popa");
  output_byte(0x61);
}


x86 assembly (clang, -O0):
<emit_popa>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <assem_debug@plt>
mov    $0x61,%edi
call   1040 <output_byte@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<emit_popa>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <assem_debug@plt>
mov    $0x61,%edi
pop    %rax
jmp    1040 <output_byte@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"popa\00"
define void @emit_popa() {
%1 = call i32 @assem_debug(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @output_byte(i32 97)
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"popa\00"
define void @emit_popa() {
%1 = tail call i32 @assem_debug(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @output_byte(i32 97)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uid_t;

/* Variables and functions */
int /*<<< orphan*/ geteuid();
int /*<<< orphan*/ setuid(int /*<<< orphan*/);
void no_suid(void) {
  uid_t uid;
  uid = geteuid();
  setuid(0);
  setuid(uid);
}


x86 assembly (clang, -O0):
<no_suid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <geteuid@plt>
mov    %eax,-0x4(%rbp)
xor    %edi,%edi
call   1040 <setuid@plt>
mov    -0x4(%rbp),%edi
call   1040 <setuid@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<no_suid>:
push   %rbx
xor    %eax,%eax
call   1030 <geteuid@plt>
mov    %eax,%ebx
xor    %edi,%edi
call   1040 <setuid@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1040 <setuid@plt>

LLVM IR (-O0):
define void @no_suid() {
%1 = alloca i32
%2 = call i32 (...) @geteuid()
store i32 %2, i32* %1
%3 = call i32 @setuid(i32 0)
%4 = load i32, i32* %1
%5 = call i32 @setuid(i32 %4)
ret void
}

LLVM IR (-O2):
define void @no_suid() {
%1 = tail call i32 (...) @geteuid()
%2 = tail call i32 @setuid(i32 0)
%3 = tail call i32 @setuid(i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
void greeting(void *arg) {
  static int i = 0;
  fprintf(stderr, "Hi! %d\n", i++);
}


x86 assembly (clang, -O0):
<greeting>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
mov    0x2f01(%rip),%edx
mov    %edx,%eax
add    $0x1,%eax
mov    %eax,0x2ef6(%rip)
lea    0xec3(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<greeting>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
mov    0x2f0d(%rip),%edx
lea    0x1(%rdx),%eax
mov    %eax,0x2f04(%rip)
lea    0xed1(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@greeting.i = internal global i32 0
@stderr = global i32 0
@.str = [8 x i8] c"Hi! %d\0A\00"
define void @greeting(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i32, i32* @greeting.i
%5 = add nsw i32 %4, 1
store i32 %5, i32* @greeting.i
%6 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %4)
ret void
}

LLVM IR (-O2):
@greeting.i = internal unnamed_addr global i32 0
@stderr = global i32 0
@.str = [8 x i8] c"Hi! %d\0A\00"
define void @greeting(i8* nocapture readnone %0) {
%2 = load i32, i32* @stderr
%3 = load i32, i32* @greeting.i
%4 = add nsw i32 %3, 1
store i32 %4, i32* @greeting.i
%5 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %3)
ret void
}
void __aeabi_unwind_cpp_pr2(void) { (void)0; }


x86 assembly (clang, -O0):
<__aeabi_unwind_cpp_pr2>:
push   %rbp
mov    %rsp,%rbp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__aeabi_unwind_cpp_pr2>:
ret

LLVM IR (-O0):
define void @__aeabi_unwind_cpp_pr2() {
ret void
}

LLVM IR (-O2):
define void @__aeabi_unwind_cpp_pr2() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ strlen(char const *);
int /*<<< orphan*/ strncmp(char const *, char const *, int /*<<< orphan*/);
int pre_match(const char *buf, const char *str) {
  return !strncmp(buf, str, strlen(str));
}


x86 assembly (clang, -O0):
<pre_match>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    %eax,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pre_match>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1040 <strlen@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %eax,%edx
call   1030 <strncmp@plt>
xor    %ecx,%ecx
test   %eax,%eax
sete   %cl
mov    %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @pre_match(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = load i8*, i8** %4
%8 = call i32 @strlen(i8* %7)
%9 = call i32 @strncmp(i8* %5, i8* %6, i32 %8)
%10 = icmp ne i32 %9, 0
%11 = xor i1 %10, true
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @pre_match(i8* %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %1)
%4 = tail call i32 @strncmp(i8* %0, i8* %1, i32 %3)
%5 = icmp eq i32 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}
void ff_hevc_put_hevc_bi_qpel_h24_10_sse4() {}


x86 assembly (clang, -O0):
<ff_hevc_put_hevc_bi_qpel_h24_10_sse4>:
push   %rbp
mov    %rsp,%rbp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ff_hevc_put_hevc_bi_qpel_h24_10_sse4>:
ret

LLVM IR (-O0):
define void @ff_hevc_put_hevc_bi_qpel_h24_10_sse4() {
ret void
}

LLVM IR (-O2):
define void @ff_hevc_put_hevc_bi_qpel_h24_10_sse4() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Swap(int *, int *);
int /*<<< orphan*/ printf(char *, int, int);
main() {
  int a = 1, b = 2;
  Swap(&a, &b);
  printf("%d %d\n", a, b);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x1,-0x4(%rbp)
movl   $0x2,-0x8(%rbp)
lea    -0x4(%rbp),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <Swap@plt>
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xeb0(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0x1,0x4(%rsp)
movl   $0x2,(%rsp)
lea    0x4(%rsp),%rdi
mov    %rsp,%rsi
call   1040 <Swap@plt>
mov    0x4(%rsp),%esi
mov    (%rsp),%edx
lea    0xeb5(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [7 x i8] c"%d %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 1, i32* %1
store i32 2, i32* %2
%3 = call i32 @Swap(i32* %1, i32* %2)
%4 = load i32, i32* %1
%5 = load i32, i32* %2
%6 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %4, i32 %5)
ret i32 0
}

LLVM IR (-O2):
@.str = [7 x i8] c"%d %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
store i32 1, i32* %1
%4 = bitcast i32* %2 to i8*
store i32 2, i32* %2
%5 = call i32 @Swap(i32* %1, i32* %2)
%6 = load i32, i32* %1
%7 = load i32, i32* %2
%8 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %6, i32 %7)
ret i32 0
}
void free_int_mat(int **mat, int dim1) {
  int i;
  for (i = 0; i < dim1; i++) {
    free(mat[i]);
  }
  free(mat);
  return;
}


x86 assembly (clang, -O0):
<free_int_mat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1151 <free_int_mat+0x41>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <free@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <free_int_mat+0x16>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_int_mat>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
test   %esi,%esi
jle    1142 <free_int_mat+0x32>
mov    %esi,%r15d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    (%r14,%rbx,8),%rdi
call   1030 <free@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <free_int_mat+0x20>
mov    %r14,%rdi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @free_int_mat(i32** %0, i32 %1) {
%3 = alloca i32**
%4 = alloca i32
%5 = alloca i32
store i32** %0, i32*** %3
store i32 %1, i32* %4
store i32 0, i32* %5
br label %6
6: ; preds = %17, %2
%7 = load i32, i32* %5
%8 = load i32, i32* %4
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %20
10: ; preds = %6
%11 = load i32**, i32*** %3
%12 = load i32, i32* %5
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i32*, i32** %11, i64 %13
%15 = load i32*, i32** %14
%16 = bitcast i32* %15 to i8*
br label %17
17: ; preds = %10
%18 = load i32, i32* %5
%19 = add nsw i32 %18, 1
store i32 %19, i32* %5
br label %6
20: ; preds = %6
%21 = load i32**, i32*** %3
%22 = bitcast i32** %21 to i8*
ret void
}

LLVM IR (-O2):
define void @free_int_mat(i32** nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i32*, i32** %0, i64 %7
%9 = bitcast i32** %8 to i8**
%10 = load i8*, i8** %9
tail call void @free(i8* %10)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
%14 = bitcast i32** %0 to i8*
tail call void @free(i8* %14)
ret void
}