xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ print_error(char *, void const *const, void const *const);
int values_equal_display_error(const void *const left,
                               const void *const right) {
  const int equal = left == right;
  if (!equal) {
    print_error("0x%x != 0x%x\n", left, right);
  }
  return equal;
}


x86 assembly (clang, -O0):
<values_equal_display_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jne    1151 <values_equal_display_error+0x41>
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
lea    0xeb4(%rip),%rdi
call   1030 <print_error@plt>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<values_equal_display_error>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
cmp    %rsi,%rdi
je     1131 <values_equal_display_error+0x21>
lea    0xeda(%rip),%rdi
mov    %rbx,%rsi
mov    %r14,%rdx
call   1030 <print_error@plt>
xor    %eax,%eax
cmp    %r14,%rbx
sete   %al
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [14 x i8] c"0x%x != 0x%x\0A\00"
define i32 @values_equal_display_error(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
%7 = load i8*, i8** %4
%8 = icmp eq i8* %6, %7
%9 = zext i1 %8 to i32
store i32 %9, i32* %5
%10 = load i32, i32* %5
%11 = icmp ne i32 %10, 0
br i1 %11, label %16, label %12
12: ; preds = %2
%13 = load i8*, i8** %3
%14 = load i8*, i8** %4
%15 = call i32 @print_error(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* %13, i8* %14)
br label %16
16: ; preds = %12, %2
%17 = load i32, i32* %5
ret i32 %17
}

LLVM IR (-O2):
@.str = [14 x i8] c"0x%x != 0x%x\0A\00"
define i32 @values_equal_display_error(i8* %0, i8* %1) {
%3 = icmp eq i8* %0, %1
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i32 @print_error(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1)
br label %6
6: ; preds = %4, %2
%7 = zext i1 %3 to i32
ret i32 %7
}
/* Variables and functions */
int Clip255(int);
int AddSubtractComponentHalf(int a, int b) { return Clip255(a + (a - b) / 2); }


x86 assembly (clang, -O0):
<AddSubtractComponentHalf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x4(%rbp),%eax
sub    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
add    %eax,%edi
call   1030 <Clip255@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<AddSubtractComponentHalf>:
mov    %edi,%eax
sub    %esi,%eax
mov    %eax,%ecx
shr    $0x1f,%ecx
add    %eax,%ecx
sar    %ecx
add    %ecx,%edi
jmp    1030 <Clip255@plt>

LLVM IR (-O0):
define i32 @AddSubtractComponentHalf(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
%6 = load i32, i32* %3
%7 = load i32, i32* %4
%8 = sub nsw i32 %6, %7
%9 = sdiv i32 %8, 2
%10 = add nsw i32 %5, %9
%11 = call i32 @Clip255(i32 %10)
ret i32 %11
}

LLVM IR (-O2):
define i32 @AddSubtractComponentHalf(i32 %0, i32 %1) {
%3 = sub nsw i32 %0, %1
%4 = sdiv i32 %3, 2
%5 = add nsw i32 %4, %0
%6 = tail call i32 @Clip255(i32 %5)
ret i32 %6
}
/* Type definitions */
struct theft_mt {
  int dummy;
};

/* Variables and functions */
int genrand64_int64(struct theft_mt *);
double theft_mt_random_double(struct theft_mt *mt) {
  return (genrand64_int64(mt) >> 11) * (1.0 / 9007199254740991.0);
}


x86 assembly (clang, -O0):
<theft_mt_random_double>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <genrand64_int64@plt>
sar    $0xb,%eax
cvtsi2sd %eax,%xmm0
movsd  0xecc(%rip),%xmm1
mulsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<theft_mt_random_double>:
push   %rax
call   1030 <genrand64_int64@plt>
sar    $0xb,%eax
cvtsi2sd %eax,%xmm0
mulsd  0xedb(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
%struct.theft_mt = type { i32 }
define double @theft_mt_random_double(%struct.theft_mt* %0) {
%2 = alloca %struct.theft_mt*
store %struct.theft_mt* %0, %struct.theft_mt** %2
%3 = load %struct.theft_mt*, %struct.theft_mt** %2
%4 = call i32 @genrand64_int64(%struct.theft_mt* %3)
%5 = ashr i32 %4, 11
%6 = sitofp i32 %5 to double
%7 = fmul double %6, 0x3CA0000000000001
ret double %7
}

LLVM IR (-O2):
%struct.theft_mt = type { i32 }
define double @theft_mt_random_double(%struct.theft_mt* %0) {
%2 = tail call i32 @genrand64_int64(%struct.theft_mt* %0)
%3 = ashr i32 %2, 11
%4 = sitofp i32 %3 to double
%5 = fmul double %4, 0x3CA0000000000001
ret double %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int print_hello(int argc, char *argv[]) {
  printf("Hello world!\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [14 x i8] c"Hello world!\0A\00"
define i32 @print_hello(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [13 x i8] c"Hello world!\00"
define i32 @print_hello(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ __cleanup_after_resume();
void pthread_sched_resume() { __cleanup_after_resume(); }


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

x86 assembly (clang, -O2):
<pthread_sched_resume>:
xor    %eax,%eax
jmp    1030 <__cleanup_after_resume@plt>

LLVM IR (-O0):
define void @pthread_sched_resume() {
%1 = call i32 (...) @__cleanup_after_resume()
ret void
}

LLVM IR (-O2):
define void @pthread_sched_resume() {
%1 = tail call i32 (...) @__cleanup_after_resume()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, unsigned int);
int /*<<< orphan*/ puts(char const *);
void Log3(const char *prompt, unsigned p1, unsigned p2, unsigned p3) {
  puts(prompt);
  printf("\tparameter 1: %u\n", p1);
  printf("\tparameter 2: %u\n", p2);
  printf("\tparameter 3: %u\n", p3);
}


x86 assembly (clang, -O0):
<Log3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <puts@plt>
mov    -0xc(%rbp),%esi
lea    0xeb8(%rip),%rdi
call   1040 <printf@plt>
mov    -0x10(%rbp),%esi
lea    0xebb(%rip),%rdi
call   1040 <printf@plt>
mov    -0x14(%rbp),%esi
lea    0xebe(%rip),%rdi
call   1040 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Log3>:
push   %rbp
push   %r14
push   %rbx
mov    %ecx,%r14d
mov    %edx,%ebp
mov    %esi,%ebx
call   1030 <puts@plt>
lea    0xec9(%rip),%rdi
mov    %ebx,%esi
call   1040 <printf@plt>
lea    0xecd(%rip),%rdi
mov    %ebp,%esi
call   1040 <printf@plt>
lea    0xed1(%rip),%rdi
mov    %r14d,%esi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [18 x i8] c"\09parameter 1: %u\0A\00"
@.str.1 = [18 x i8] c"\09parameter 2: %u\0A\00"
@.str.2 = [18 x i8] c"\09parameter 3: %u\0A\00"
define void @Log3(i8* %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i8* %0, i8** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i8*, i8** %5
%10 = call i32 @puts(i8* %9)
%11 = load i32, i32* %6
%12 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %11)
%13 = load i32, i32* %7
%14 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i32 %13)
%15 = load i32, i32* %8
%16 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0), i32 %15)
ret void
}

LLVM IR (-O2):
@.str = [18 x i8] c"\09parameter 1: %u\0A\00"
@.str.1 = [18 x i8] c"\09parameter 2: %u\0A\00"
@.str.2 = [18 x i8] c"\09parameter 3: %u\0A\00"
define void @Log3(i8* nocapture %0, i32 %1, i32 %2, i32 %3) {
%5 = tail call i32 @puts(i8* dereferenceable(1) %0)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %1)
%7 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i32 %2)
%8 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0), i32 %3)
ret void
}
unsigned long int powerup(unsigned long int n) {
  unsigned long int m;
  while (m = n, n &= (n - 1))
    ;
  return m * 2;
}


x86 assembly (clang, -O0):
<powerup>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
sub    $0x1,%rax
and    -0x8(%rbp),%rax
mov    %rax,-0x8(%rbp)
cmp    $0x0,%rax
je     112f <powerup+0x2f>
jmp    1108 <powerup+0x8>
mov    -0x10(%rbp),%rax
shl    $0x1,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<powerup>:
mov    %rdi,%rax
add    $0xffffffffffffffff,%rdi
and    %rax,%rdi
jne    1100 <powerup>
add    %rax,%rax
ret

LLVM IR (-O0):
define i64 @powerup(i64 %0) {
%2 = alloca i64
%3 = alloca i64
store i64 %0, i64* %2
br label %4
4: ; preds = %11, %1
%5 = load i64, i64* %2
store i64 %5, i64* %3
%6 = load i64, i64* %2
%7 = sub i64 %6, 1
%8 = load i64, i64* %2
%9 = and i64 %8, %7
store i64 %9, i64* %2
%10 = icmp ne i64 %9, 0
br i1 %10, label %11, label %12
11: ; preds = %4
br label %4
12: ; preds = %4
%13 = load i64, i64* %3
%14 = mul i64 %13, 2
ret i64 %14
}

LLVM IR (-O2):
define i64 @powerup(i64 %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ %0, %1 ], [ %5, %2 ]
%4 = add i64 %3, -1
%5 = and i64 %4, %3
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %2
7: ; preds = %2
%8 = shl i64 %3, 1
ret i64 %8
}
/* Variables and functions */
int c(void *);
int b(void *arg) { return c(arg) + 1; }


x86 assembly (clang, -O0):
<b>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <c@plt>
add    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<b>:
push   %rax
call   1030 <c@plt>
add    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @b(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @c(i8* %3)
%5 = add nsw i32 %4, 1
ret i32 %5
}

LLVM IR (-O2):
define i32 @b(i8* %0) {
%2 = tail call i32 @c(i8* %0)
%3 = add nsw i32 %2, 1
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ F_GETFL;
int /*<<< orphan*/ F_SETFL;
int O_NONBLOCK;
int fcntl(int, int /*<<< orphan*/, ...);
int ab_manage(int fd) {
  int fl = fcntl(fd, F_GETFL);
  if (fl == -1) {
    return fl;
  }
  return fcntl(fd, F_SETFL, fl | O_NONBLOCK);
}


x86 assembly (clang, -O0):
<ab_manage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
mov    0x2eab(%rip),%rax
mov    (%rax),%esi
mov    $0x0,%al
call   1030 <fcntl@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0xffffffff,-0xc(%rbp)
jne    1146 <ab_manage+0x36>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1168 <ab_manage+0x58>
mov    -0x8(%rbp),%edi
mov    0x2e88(%rip),%rax
mov    (%rax),%esi
mov    -0xc(%rbp),%edx
mov    0x2e8c(%rip),%rax
or     (%rax),%edx
mov    $0x0,%al
call   1030 <fcntl@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ab_manage>:
push   %rbx
mov    %edi,%ebx
mov    0x2eb6(%rip),%rax
mov    (%rax),%esi
xor    %eax,%eax
call   1030 <fcntl@plt>
cmp    $0xffffffff,%eax
je     1146 <ab_manage+0x36>
mov    0x2ea9(%rip),%rcx
mov    (%rcx),%esi
mov    0x2eb0(%rip),%rcx
or     (%rcx),%eax
mov    %ebx,%edi
mov    %eax,%edx
xor    %eax,%eax
pop    %rbx
jmp    1030 <fcntl@plt>
mov    $0xffffffff,%eax
pop    %rbx
ret

LLVM IR (-O0):
@F_GETFL = global i32 0
@F_SETFL = global i32 0
@O_NONBLOCK = global i32 0
define i32 @ab_manage(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
%5 = load i32, i32* %3
%6 = load i32, i32* @F_GETFL
%7 = call i32 (i32, i32, ...) @fcntl(i32 %5, i32 %6)
store i32 %7, i32* %4
%8 = load i32, i32* %4
%9 = icmp eq i32 %8, -1
br i1 %9, label %10, label %12
10: ; preds = %1
%11 = load i32, i32* %4
store i32 %11, i32* %2
br label %19
12: ; preds = %1
%13 = load i32, i32* %3
%14 = load i32, i32* @F_SETFL
%15 = load i32, i32* %4
%16 = load i32, i32* @O_NONBLOCK
%17 = or i32 %15, %16
%18 = call i32 (i32, i32, ...) @fcntl(i32 %13, i32 %14, i32 %17)
store i32 %18, i32* %2
br label %19
19: ; preds = %12, %10
%20 = load i32, i32* %2
ret i32 %20
}

LLVM IR (-O2):
@F_GETFL = global i32 0
@F_SETFL = global i32 0
@O_NONBLOCK = global i32 0
define i32 @ab_manage(i32 %0) {
%2 = load i32, i32* @F_GETFL
%3 = tail call i32 (i32, i32, ...) @fcntl(i32 %0, i32 %2)
%4 = icmp eq i32 %3, -1
br i1 %4, label %10, label %5
5: ; preds = %1
%6 = load i32, i32* @F_SETFL
%7 = load i32, i32* @O_NONBLOCK
%8 = or i32 %7, %3
%9 = tail call i32 (i32, i32, ...) @fcntl(i32 %0, i32 %6, i32 %8)
br label %10
10: ; preds = %1, %5
%11 = phi i32 [ %9, %5 ], [ -1, %1 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int factorial(int numero) {
  printf("%d", numero);
  if (numero < 2) {
    return 1;
  } else {
    return numero * factorial(numero - 1);
  }
}


x86 assembly (clang, -O0):
<factorial>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xecb(%rip),%rdi
call   1040 <printf@plt>
cmpl   $0x2,-0x8(%rbp)
jge    1150 <factorial+0x30>
movl   $0x1,-0x4(%rbp)
jmp    116c <factorial+0x4c>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
call   1030 <factorial@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
imul   %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<factorial>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %edi,%ebx
lea    0xee0(%rip),%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
mov    $0x1,%ebp
cmp    $0x2,%ebx
jl     115a <factorial+0x4a>
mov    $0x1,%ebp
lea    0xec3(%rip),%r14
nopl   (%rax)
lea    -0x1(%rbx),%r15d
imul   %ebx,%ebp
mov    %r14,%rdi
mov    %r15d,%esi
call   1030 <printf@plt>
cmp    $0x2,%ebx
mov    %r15d,%ebx
ja     1140 <factorial+0x30>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
define i32 @factorial(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = load i32, i32* %3
%7 = icmp slt i32 %6, 2
br i1 %7, label %8, label %9
8: ; preds = %1
store i32 1, i32* %2
br label %15
9: ; preds = %1
%10 = load i32, i32* %3
%11 = load i32, i32* %3
%12 = sub nsw i32 %11, 1
%13 = call i32 @factorial(i32 %12)
%14 = mul nsw i32 %10, %13
store i32 %14, i32* %2
br label %15
15: ; preds = %9, %8
%16 = load i32, i32* %2
ret i32 %16
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @factorial(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %0)
%3 = icmp slt i32 %0, 2
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i32 [ %7, %4 ], [ %0, %1 ]
%6 = phi i32 [ %8, %4 ], [ 1, %1 ]
%7 = add nsw i32 %5, -1
%8 = mul nsw i32 %5, %6
%9 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %7)
%10 = icmp ult i32 %5, 3
br i1 %10, label %11, label %4
11: ; preds = %4, %1
%12 = phi i32 [ 1, %1 ], [ %8, %4 ]
ret i32 %12
}
int binarydigits(int div, int dis) {
  int numit;
  numit = 0;
  do {
    ++numit;
    div /= dis;
  } while (div != 1);
  ++numit;
  return numit;
}


x86 assembly (clang, -O0):
<binarydigits>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%ecx
mov    -0x4(%rbp),%eax
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
cmpl   $0x1,-0x4(%rbp)
jne    1111 <binarydigits+0x11>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<binarydigits>:
mov    %edi,%eax
mov    $0x1,%ecx
nopw   0x0(%rax,%rax,1)
cltd
idiv   %esi
add    $0x1,%ecx
cmp    $0x1,%eax
jne    1110 <binarydigits+0x10>
mov    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @binarydigits(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 = %12, %2
%7 = load i32, i32* %5
%8 = add nsw i32 %7, 1
store i32 %8, i32* %5
%9 = load i32, i32* %4
%10 = load i32, i32* %3
%11 = sdiv i32 %10, %9
store i32 %11, i32* %3
br label %12
12: ; preds = %6
%13 = load i32, i32* %3
%14 = icmp ne i32 %13, 1
br i1 %14, label %6, label %15
15: ; preds = %12
%16 = load i32, i32* %5
%17 = add nsw i32 %16, 1
store i32 %17, i32* %5
%18 = load i32, i32* %5
ret i32 %18
}

LLVM IR (-O2):
define i32 @binarydigits(i32 %0, i32 %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i32 [ %0, %2 ], [ %7, %3 ]
%5 = phi i32 [ 0, %2 ], [ %6, %3 ]
%6 = add nuw nsw i32 %5, 1
%7 = sdiv i32 %4, %1
%8 = icmp eq i32 %7, 1
br i1 %8, label %9, label %3
9: ; preds = %3
%10 = add nuw nsw i32 %5, 2
ret i32 %10
}
/* Variables and functions */
int bar();
int new_foo() { return 1000 + bar(); }


x86 assembly (clang, -O0):
<new_foo>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <bar@plt>
add    $0x3e8,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<new_foo>:
push   %rax
xor    %eax,%eax
call   1030 <bar@plt>
add    $0x3e8,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @new_foo() {
%1 = call i32 (...) @bar()
%2 = add nsw i32 1000, %1
ret i32 %2
}

LLVM IR (-O2):
define i32 @new_foo() {
%1 = tail call i32 (...) @bar()
%2 = add nsw i32 %1, 1000
ret i32 %2
}
int check_userInput(char *ciphertext_user) {
  unsigned char *ciphertext_data = userInput_to_data(ciphertext_user);
  const unsigned char *cleartext = public_decrypt(ciphertext_data);
  free(ciphertext_data);
  int result = verify_rsa(cleartext);
  free((char *)cleartext);
  return (result);
}


x86 assembly (clang, -O0):
<check_userInput>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1050 <userInput_to_data@plt>
cltq
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x0,%al
call   1040 <public_decrypt@plt>
cltq
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
mov    -0x18(%rbp),%rdi
mov    $0x0,%al
call   1060 <verify_rsa@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
mov    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_userInput>:
push   %r14
push   %rbx
push   %rax
xor    %eax,%eax
call   1050 <userInput_to_data@plt>
movslq %eax,%rbx
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <public_decrypt@plt>
movslq %eax,%r14
mov    %rbx,%rdi
call   1030 <free@plt>
mov    %r14,%rdi
xor    %eax,%eax
call   1060 <verify_rsa@plt>
mov    %eax,%ebx
mov    %r14,%rdi
call   1030 <free@plt>
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @check_userInput(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
store i8* %0, i8** %2
%6 = load i8*, i8** %2
%7 = call i32 (i8*, ...) bitcast (i32 (...)* @userInput_to_data to i32 (i8*, ...)*)(i8* %6)
%8 = sext i32 %7 to i64
%9 = inttoptr i64 %8 to i8*
store i8* %9, i8** %3
%10 = load i8*, i8** %3
%11 = call i32 (i8*, ...) bitcast (i32 (...)* @public_decrypt to i32 (i8*, ...)*)(i8* %10)
%12 = sext i32 %11 to i64
%13 = inttoptr i64 %12 to i8*
store i8* %13, i8** %4
%14 = load i8*, i8** %3
%15 = load i8*, i8** %4
%16 = call i32 (i8*, ...) bitcast (i32 (...)* @verify_rsa to i32 (i8*, ...)*)(i8* %15)
store i32 %16, i32* %5
%17 = load i8*, i8** %4
%18 = load i32, i32* %5
ret i32 %18
}

LLVM IR (-O2):
define i32 @check_userInput(i8* %0) {
%2 = tail call i32 (i8*, ...) bitcast (i32 (...)* @userInput_to_data to i32 (i8*, ...)*)(i8* %0)
%3 = sext i32 %2 to i64
%4 = inttoptr i64 %3 to i8*
%5 = tail call i32 (i8*, ...) bitcast (i32 (...)* @public_decrypt to i32 (i8*, ...)*)(i8* %4)
%6 = sext i32 %5 to i64
%7 = inttoptr i64 %6 to i8*
tail call void @free(i8* %4)
%8 = tail call i32 (i8*, ...) bitcast (i32 (...)* @verify_rsa to i32 (i8*, ...)*)(i8* %7)
tail call void @free(i8* %7)
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ bbm_word_read(void *, unsigned short, int, unsigned short *);
int fc8300_probe(void *handle, unsigned short devid) {
  unsigned short ver;
  bbm_word_read(handle, devid, 0x0026, &ver);
  return (ver == 0x8300) ? 0 : 1;
}


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %si,%ax
mov    %rdi,-0x8(%rbp)
mov    %ax,-0xa(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x26,%edx
lea    -0xc(%rbp),%rcx
movzwl -0xa(%rbp),%esi
call   1030 <bbm_word_read@plt>
movzwl -0xc(%rbp),%edx
mov    $0x1,%eax
xor    %ecx,%ecx
cmp    $0x8300,%edx
cmove  %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
push   %rax
lea    0x6(%rsp),%rcx
mov    $0x26,%edx
call   1030 <bbm_word_read@plt>
movzwl 0x6(%rsp),%ecx
xor    %eax,%eax
cmp    $0x8300,%ecx
setne  %al
pop    %rcx
ret

LLVM IR (-O0):
define i32 @fc8300_probe(i8* %0, i16 zeroext %1) {
%3 = alloca i8*
%4 = alloca i16
%5 = alloca i16
store i8* %0, i8** %3
store i16 %1, i16* %4
%6 = load i8*, i8** %3
%7 = load i16, i16* %4
%8 = call i32 @bbm_word_read(i8* %6, i16 zeroext %7, i32 38, i16* %5)
%9 = load i16, i16* %5
%10 = zext i16 %9 to i32
%11 = icmp eq i32 %10, 33536
%12 = zext i1 %11 to i64
%13 = select i1 %11, i32 0, i32 1
ret i32 %13
}

LLVM IR (-O2):
define i32 @fc8300_probe(i8* %0, i16 zeroext %1) {
%3 = alloca i16
%4 = bitcast i16* %3 to i8*
%5 = call i32 @bbm_word_read(i8* %0, i16 zeroext %1, i32 38, i16* %3)
%6 = load i16, i16* %3
%7 = icmp ne i16 %6, -32000
%8 = zext i1 %7 to i32
ret i32 %8
}
/* Variables and functions */
int firstMissingPositive(int *, int);
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char *argv[]) {
  int a[] = {1, 1};
  int res = firstMissingPositive(a, 4);
  printf("%d\n", res);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0xec3(%rip),%rax
mov    %rax,-0x18(%rbp)
lea    -0x18(%rbp),%rdi
mov    $0x4,%esi
call   1040 <firstMissingPositive@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%esi
lea    0xeac(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movabs $0x100000001,%rax
mov    %rax,(%rsp)
mov    %rsp,%rdi
mov    $0x4,%esi
call   1040 <firstMissingPositive@plt>
lea    0xebd(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i64
%4 = bitcast i64* %3 to i8*
store i64 4294967297, i64* %3
%5 = bitcast i64* %3 to i32*
%6 = call i32 @firstMissingPositive(i32* %5, i32 4)
%7 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %6)
ret i32 0
}
/* Variables and functions */
scalar_t__ stdout;
void *c_stdout(void) { return (void *)stdout; }


x86 assembly (clang, -O0):
<c_stdout>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ed5(%rip),%rax
mov    (%rax),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<c_stdout>:
mov    0x2ed9(%rip),%rax
mov    (%rax),%rax
ret

LLVM IR (-O0):
@stdout = global i64 0
define i8* @c_stdout() {
%1 = load i64, i64* @stdout
%2 = inttoptr i64 %1 to i8*
ret i8* %2
}

LLVM IR (-O2):
@stdout = global i64 0
define i8* @c_stdout() {
%1 = load i64, i64* @stdout
%2 = inttoptr i64 %1 to i8*
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, long, long);
int /*<<< orphan*/ scanf(char *, long *);
void f(long x) {
  long y;
  scanf("%d", &y);
  printf("%d %d\n", x, y);
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xecd(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
lea    0xeb8(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
lea    0xed1(%rip),%rdi
lea    0x8(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x8(%rsp),%rdx
lea    0xebe(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [7 x i8] c"%d %d\0A\00"
define void @f(i64 %0) {
%2 = alloca i64
%3 = bitcast i64* %2 to i8*
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i64* %2)
%5 = load i64, i64* %2
%6 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i64 %0, i64 %5)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
void ASRT_PrintFailInt(int expected, int actual) {
  printf("\n  Expected: %d, Actual: %d", expected, actual);
}


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

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

LLVM IR (-O0):
@.str = [28 x i8] c"\0A Expected: %d, Actual: %d\00"
define void @ASRT_PrintFailInt(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
%6 = load i32, i32* %4
%7 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i32 %5, i32 %6)
ret void
}

LLVM IR (-O2):
@.str = [28 x i8] c"\0A Expected: %d, Actual: %d\00"
define void @ASRT_PrintFailInt(i32 %0, i32 %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1)
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t TimerPrescaleGet(uint32_t ui32Base, uint32_t ui32Timer) {
  ;

  ;
  return ((ui32Timer == 0x000000FF)
              ? (*((volatile unsigned long *)(ui32Base + 0x00000038)))
              : (*((volatile unsigned long *)(ui32Base + 0x0000003C))));
}


x86 assembly (clang, -O0):
<TimerPrescaleGet>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0xff,-0x8(%rbp)
jne    112b <TimerPrescaleGet+0x2b>
mov    -0x4(%rbp),%eax
add    $0x38,%eax
cltq
mov    (%rax),%rax
mov    %rax,-0x10(%rbp)
jmp    113a <TimerPrescaleGet+0x3a>
mov    -0x4(%rbp),%eax
add    $0x3c,%eax
cltq
mov    (%rax),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<TimerPrescaleGet>:
xor    %eax,%eax
cmp    $0xff,%esi
setne  %al
lea    0x38(,%rax,4),%eax
movslq %edi,%rcx
mov    (%rax,%rcx,1),%rax
ret

LLVM IR (-O0):
define i32 @TimerPrescaleGet(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = icmp eq i32 %5, 255
br i1 %6, label %7, label %13
7: ; preds = %2
%8 = load i32, i32* %3
%9 = add nsw i32 %8, 56
%10 = sext i32 %9 to i64
%11 = inttoptr i64 %10 to i64*
%12 = load volatile i64, i64* %11
br label %19
13: ; preds = %2
%14 = load i32, i32* %3
%15 = add nsw i32 %14, 60
%16 = sext i32 %15 to i64
%17 = inttoptr i64 %16 to i64*
%18 = load volatile i64, i64* %17
br label %19
19: ; preds = %13, %7
%20 = phi i64 [ %12, %7 ], [ %18, %13 ]
%21 = trunc i64 %20 to i32
ret i32 %21
}

LLVM IR (-O2):
define i32 @TimerPrescaleGet(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 255
%4 = select i1 %3, i32 56, i32 60
%5 = add nsw i32 %4, %0
%6 = sext i32 %5 to i64
%7 = inttoptr i64 %6 to i64*
%8 = load volatile i64, i64* %7
%9 = trunc i64 %8 to i32
ret i32 %9
}
/* Type definitions */
typedef int uint8_t;
typedef int uint16_t;
typedef int int8_t;

/* Variables and functions */
int readWord(int, int, int *);
int8_t readBitW(uint8_t devAddr, uint8_t regAddr, uint8_t bitNum,
                uint16_t *data) {
  uint16_t b;
  uint8_t count = readWord(devAddr, regAddr, &b);
  *data = b & (1 << bitNum);
  return count;
}


x86 assembly (clang, -O0):
<readBitW>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %rcx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
lea    -0x1c(%rbp),%rdx
call   1030 <readWord@plt>
mov    %eax,-0x20(%rbp)
mov    -0x1c(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0xc(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
mov    -0x24(%rbp),%ecx
and    %eax,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x20(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<readBitW>:
push   %rbp
push   %rbx
push   %rax
mov    %rcx,%rbx
mov    %edx,%ebp
lea    0x4(%rsp),%rdx
call   1030 <readWord@plt>
mov    $0x1,%edx
mov    %ebp,%ecx
shl    %cl,%edx
and    0x4(%rsp),%edx
mov    %edx,(%rbx)
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @readBitW(i32 %0, i32 %1, i32 %2, i32* %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32*
%9 = alloca i32
%10 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32* %3, i32** %8
%11 = load i32, i32* %5
%12 = load i32, i32* %6
%13 = call i32 @readWord(i32 %11, i32 %12, i32* %9)
store i32 %13, i32* %10
%14 = load i32, i32* %9
%15 = load i32, i32* %7
%16 = shl i32 1, %15
%17 = and i32 %14, %16
%18 = load i32*, i32** %8
store i32 %17, i32* %18
%19 = load i32, i32* %10
ret i32 %19
}

LLVM IR (-O2):
define i32 @readBitW(i32 %0, i32 %1, i32 %2, i32* nocapture writeonly %3) {
%5 = alloca i32
%6 = bitcast i32* %5 to i8*
%7 = call i32 @readWord(i32 %0, i32 %1, i32* %5)
%8 = load i32, i32* %5
%9 = shl nuw i32 1, %2
%10 = and i32 %8, %9
store i32 %10, i32* %3
ret i32 %7
}
void avpriv_get_trc_function_from_trc() {}


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

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

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

LLVM IR (-O2):
define void @avpriv_get_trc_function_from_trc() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void csv_cstate_table_header(__attribute__((unused)) void *report_data) {
  printf("C-State Table\n");
  printf("cluster,core,cpu,C-state,min (us),max (us),avg (us),total "
         "(us),hits,over,under\n");
}


x86 assembly (clang, -O0):
<csv_cstate_table_header>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rdi
call   1030 <printf@plt>
lea    0xee0(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<csv_cstate_table_header>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xeea(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"C-State Table\0A\00"
@.str.1 = [80 x i8] c"cluster,core,cpu,C-state,min (us),max (us),avg (us),total (us),hits,over,under\0A\00"
define void @csv_cstate_table_header(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([80 x i8], [80 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [14 x i8] c"C-State Table\00"
@str.2 = [79 x i8] c"cluster,core,cpu,C-state,min (us),max (us),avg (us),total (us),hits,over,under\00"
define void @csv_cstate_table_header(i8* nocapture readnone %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([79 x i8], [79 x i8]* @str.2, i64 0, i64 0))
ret void
}
int fun245() { return 245; }


x86 assembly (clang, -O0):
<fun245>:
push   %rbp
mov    %rsp,%rbp
mov    $0xf5,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @fun245() {
ret i32 245
}

LLVM IR (-O2):
define i32 @fun245() {
ret i32 245
}
int test_imm_EBuint16_reg(unsigned short val) {
  return ((val) & (-0xEB << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_EBuint16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%edx
and    $0xffffff15,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_EBuint16_reg>:
test   $0xff15,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_EBuint16_reg(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = zext i16 %3 to i32
%5 = and i32 %4, -235
%6 = icmp ne i32 %5, 0
%7 = zext i1 %6 to i64
%8 = select i1 %6, i32 -20, i32 -40
ret i32 %8
}

LLVM IR (-O2):
define i32 @test_imm_EBuint16_reg(i16 zeroext %0) {
%2 = and i16 %0, -235
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int pms_set_wakeup_timers(int /*<<< orphan*/);
int pms_disable_wakeup_timers(void) { return pms_set_wakeup_timers(0); }


x86 assembly (clang, -O0):
<pms_disable_wakeup_timers>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <pms_set_wakeup_timers@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<pms_disable_wakeup_timers>:
xor    %edi,%edi
jmp    1030 <pms_set_wakeup_timers@plt>

LLVM IR (-O0):
define i32 @pms_disable_wakeup_timers() {
%1 = call i32 @pms_set_wakeup_timers(i32 0)
ret i32 %1
}

LLVM IR (-O2):
define i32 @pms_disable_wakeup_timers() {
%1 = tail call i32 @pms_set_wakeup_timers(i32 0)
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ foo(void *);
int g1(int x) {
  if (!--x)
    foo((void *)0);
  return x;
}


x86 assembly (clang, -O0):
<g1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x4(%rbp)
cmp    $0x0,%eax
jne    1136 <g1+0x26>
xor    %eax,%eax
mov    %eax,%edi
call   1030 <foo@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<g1>:
push   %rbx
mov    %edi,%ebx
add    $0xffffffff,%ebx
jne    111f <g1+0xf>
xor    %edi,%edi
call   1030 <foo@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @g1(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add nsw i32 %3, -1
store i32 %4, i32* %2
%5 = icmp ne i32 %4, 0
br i1 %5, label %8, label %6
6: ; preds = %1
%7 = call i32 @foo(i8* null)
br label %8
8: ; preds = %6, %1
%9 = load i32, i32* %2
ret i32 %9
}

LLVM IR (-O2):
define i32 @g1(i32 %0) {
%2 = add nsw i32 %0, -1
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @foo(i8* null)
br label %6
6: ; preds = %4, %1
ret i32 %2
}
/* Variables and functions */
int _ada_use_c2phc(int, int *, int *, double *, int /*<<< orphan*/);
int copy_multprec_target_solutions_to_container(void) {
  int *a, *b, fail;
  double *c;
  fail = _ada_use_c2phc(285, a, b, c, 0);
  return fail;
}


x86 assembly (clang, -O0):
<copy_multprec_target_solutions_to_container>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x11d,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<copy_multprec_target_solutions_to_container>:
mov    $0x11d,%edi
xor    %r8d,%r8d
jmp    1030 <_ada_use_c2phc@plt>

LLVM IR (-O0):
define i32 @copy_multprec_target_solutions_to_container() {
%1 = alloca i32*
%2 = alloca i32*
%3 = alloca i32
%4 = alloca double*
%5 = load i32*, i32** %1
%6 = load i32*, i32** %2
%7 = load double*, double** %4
%8 = call i32 @_ada_use_c2phc(i32 285, i32* %5, i32* %6, double* %7, i32 0)
store i32 %8, i32* %3
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
define i32 @copy_multprec_target_solutions_to_container() {
%1 = tail call i32 @_ada_use_c2phc(i32 285, i32* undef, i32* undef, double* undef, i32 0)
ret i32 %1
}
int ddebug_remove_module(const char *mod) { return 0; }


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

x86 assembly (clang, -O2):
<ddebug_remove_module>:
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @ddebug_remove_module(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
ret i32 0
}

LLVM IR (-O2):
define i32 @ddebug_remove_module(i8* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int enter_scope();
int /*<<< orphan*/ set_act_func(char *);
int enter_function_scope(char *func_id) {
  if (!set_act_func(func_id))
    return enter_scope();
  else
    return 99;
}


x86 assembly (clang, -O0):
<enter_function_scope>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <set_act_func@plt>
cmp    $0x0,%eax
jne    114d <enter_function_scope+0x2d>
mov    $0x0,%al
call   1040 <enter_scope@plt>
mov    %eax,-0x4(%rbp)
jmp    1154 <enter_function_scope+0x34>
movl   $0x63,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<enter_function_scope>:
push   %rax
call   1030 <set_act_func@plt>
test   %eax,%eax
je     1131 <enter_function_scope+0x11>
mov    $0x63,%eax
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
jmp    1040 <enter_scope@plt>

LLVM IR (-O0):
define i32 @enter_function_scope(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = call i32 @set_act_func(i8* %4)
%6 = icmp ne i32 %5, 0
br i1 %6, label %9, label %7
7: ; preds = %1
%8 = call i32 (...) @enter_scope()
store i32 %8, i32* %2
br label %10
9: ; preds = %1
store i32 99, i32* %2
br label %10
10: ; preds = %9, %7
%11 = load i32, i32* %2
ret i32 %11
}

LLVM IR (-O2):
define i32 @enter_function_scope(i8* %0) {
%2 = tail call i32 @set_act_func(i8* %0)
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 (...) @enter_scope()
br label %6
6: ; preds = %1, %4
%7 = phi i32 [ %5, %4 ], [ 99, %1 ]
ret i32 %7
}
void jz_writel(unsigned int address, unsigned int value) {
  *((volatile unsigned int *)address) = value;
}


x86 assembly (clang, -O0):
<jz_writel>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%ecx
mov    -0x4(%rbp),%eax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<jz_writel>:
mov    %edi,%eax
mov    %esi,(%rax)
ret

LLVM IR (-O0):
define void @jz_writel(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i32, i32* %3
%7 = zext i32 %6 to i64
%8 = inttoptr i64 %7 to i32*
store volatile i32 %5, i32* %8
ret void
}

LLVM IR (-O2):
define void @jz_writel(i32 %0, i32 %1) {
%3 = zext i32 %0 to i64
%4 = inttoptr i64 %3 to i32*
store volatile i32 %1, i32* %4
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ renderChirpData();
int main(int argc, const char *argv[]) {
  printf("Hello, World!\n");
  renderChirpData();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xec3(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1030 <renderChirpData@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@str = [14 x i8] c"Hello, World!\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 (...) @renderChirpData()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ io_out8(int, int);
void inthandler20(int *esp) {
  io_out8(0x0020, 0x60);
  return;
}


x86 assembly (clang, -O0):
<inthandler20>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x20,%edi
mov    $0x60,%esi
call   1030 <io_out8@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<inthandler20>:
mov    $0x20,%edi
mov    $0x60,%esi
jmp    1030 <io_out8@plt>

LLVM IR (-O0):
define void @inthandler20(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = call i32 @io_out8(i32 32, i32 96)
ret void
}

LLVM IR (-O2):
define void @inthandler20(i32* nocapture readnone %0) {
%2 = tail call i32 @io_out8(i32 32, i32 96)
ret void
}
/* Variables and functions */
int get_data_payload();
int is_splittable_message(int length) { return (get_data_payload() < length); }


x86 assembly (clang, -O0):
<is_splittable_message>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <get_data_payload@plt>
cmp    -0x4(%rbp),%eax
setl   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_splittable_message>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <get_data_payload@plt>
xor    %ecx,%ecx
cmp    %ebx,%eax
setl   %cl
mov    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @is_splittable_message(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @get_data_payload()
%4 = load i32, i32* %2
%5 = icmp slt i32 %3, %4
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @is_splittable_message(i32 %0) {
%2 = tail call i32 (...) @get_data_payload()
%3 = icmp slt i32 %2, %0
%4 = zext i1 %3 to i32
ret i32 %4
}
unsigned short _control87(unsigned short newcw, unsigned short mask) {
  unsigned short cw;
}


x86 assembly (clang, -O0):
<_control87>:
push   %rbp
mov    %rsp,%rbp
mov    %si,%ax
mov    %di,%cx
mov    %cx,-0x4(%rbp)
mov    %ax,-0x6(%rbp)
movzwl -0x2(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define zeroext i16 @_control87(i16 zeroext %0, i16 zeroext %1) {
%3 = alloca i16
%4 = alloca i16
%5 = alloca i16
%6 = alloca i16
store i16 %0, i16* %4
store i16 %1, i16* %5
%7 = load i16, i16* %3
ret i16 %7
}

LLVM IR (-O2):
define zeroext i16 @_control87(i16 zeroext %0, i16 zeroext %1) {
ret i16 undef
}
main() {
  int a;
  int i;
  int s1, s2, s3;
  i = 100;
  a = 0;
  while (i < 1000) {
    s1 = i / 100;
    s2 = i / 10 % 10;
    s3 = i % 10;
    if (s1 < s2 && s2 > s3)
      a = a + 1;
    i = i + 1;
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x64,-0xc(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x3e8,-0xc(%rbp)
jge    1187 <main+0x87>
mov    -0xc(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,-0x14(%rbp)
mov    -0xc(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,-0x18(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    1179 <main+0x79>
mov    -0x14(%rbp),%eax
cmp    -0x18(%rbp),%eax
jle    1179 <main+0x79>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1119 <main+0x19>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 0, i32* %1
store i32 100, i32* %3
store i32 0, i32* %2
br label %7
7: ; preds = %28, %0
%8 = load i32, i32* %3
%9 = icmp slt i32 %8, 1000
br i1 %9, label %10, label %31
10: ; preds = %7
%11 = load i32, i32* %3
%12 = sdiv i32 %11, 100
store i32 %12, i32* %4
%13 = load i32, i32* %3
%14 = sdiv i32 %13, 10
%15 = srem i32 %14, 10
store i32 %15, i32* %5
%16 = load i32, i32* %3
%17 = srem i32 %16, 10
store i32 %17, i32* %6
%18 = load i32, i32* %4
%19 = load i32, i32* %5
%20 = icmp slt i32 %18, %19
br i1 %20, label %21, label %28
21: ; preds = %10
%22 = load i32, i32* %5
%23 = load i32, i32* %6
%24 = icmp sgt i32 %22, %23
br i1 %24, label %25, label %28
25: ; preds = %21
%26 = load i32, i32* %2
%27 = add nsw i32 %26, 1
store i32 %27, i32* %2
br label %28
28: ; preds = %25, %21, %10
%29 = load i32, i32* %3
%30 = add nsw i32 %29, 1
store i32 %30, i32* %3
br label %7
31: ; preds = %7
%32 = load i32, i32* %1
ret i32 %32
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}