xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ putchar(char);
int /*<<< orphan*/ show_data(int *);
void show_move(int *data) {
  putchar('(');
  show_data(data);
  printf(")\n");
}


x86 assembly (clang, -O0):
<show_move>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x28,%edi
call   1040 <putchar@plt>
mov    -0x8(%rbp),%rdi
call   1030 <show_data@plt>
lea    0xeaa(%rip),%rdi
call   1050 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<show_move>:
push   %rbx
mov    %rdi,%rbx
mov    $0x28,%edi
call   1040 <putchar@plt>
mov    %rbx,%rdi
call   1030 <show_data@plt>
lea    0xeb3(%rip),%rdi
pop    %rbx
jmp    1050 <puts@plt>

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

LLVM IR (-O2):
@str = [2 x i8] c")\00"
define void @show_move(i32* %0) {
%2 = tail call i32 @putchar(i8 signext 40)
%3 = tail call i32 @show_data(i32* %0)
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str, i64 0, i64 0))
ret void
}
__attribute__((no, noclone)) void fn2() { __builtin_printf("4"); }


x86 assembly (clang, -O0):
<fn2>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<fn2>:
mov    $0x34,%edi
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"4\00"
define void @fn2() {
%1 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
define void @fn2() {
%1 = tail call i32 @putchar(i32 52)
ret void
}
/* Variables and functions */
int read(int, char *, int);
int _read(int fd, char *buffer, int count) { return read(fd, buffer, count); }


x86 assembly (clang, -O0):
<_read>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <read@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_read>:
jmp    1030 <read@plt>

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

LLVM IR (-O2):
define i32 @_read(i32 %0, i8* nocapture %1, i32 %2) {
%4 = tail call i32 @read(i32 %0, i8* %1, i32 %2)
ret i32 %4
}
double QuinticEaseOut(double p) {
  double f = (p - 1);
  return f * f * f * f * f + 1;
}


x86 assembly (clang, -O0):
<QuinticEaseOut>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xeea(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
mulsd  -0x10(%rbp),%xmm0
mulsd  -0x10(%rbp),%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xebc(%rip),%xmm1
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<QuinticEaseOut>:
addsd  0xef8(%rip),%xmm0
movapd %xmm0,%xmm1
mulsd  %xmm0,%xmm1
mulsd  %xmm0,%xmm1
mulsd  %xmm0,%xmm1
mulsd  %xmm1,%xmm0
addsd  0xee4(%rip),%xmm0
ret

LLVM IR (-O0):
define double @QuinticEaseOut(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %2
%4 = load double, double* %2
%5 = fsub double %4, 1.000000e+00
store double %5, double* %3
%6 = load double, double* %3
%7 = load double, double* %3
%8 = fmul double %6, %7
%9 = load double, double* %3
%10 = fmul double %8, %9
%11 = load double, double* %3
%12 = fmul double %10, %11
%13 = load double, double* %3
%14 = call double @llvm.fmuladd.f64(double %12, double %13, double 1.000000e+00)
ret double %14
}

LLVM IR (-O2):
define double @QuinticEaseOut(double %0) {
%2 = fadd double %0, -1.000000e+00
%3 = fmul double %2, %2
%4 = fmul double %2, %3
%5 = fmul double %2, %4
%6 = tail call double @llvm.fmuladd.f64(double %5, double %2, double 1.000000e+00)
ret double %6
}
void *func(void *arg) { return arg; }


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

x86 assembly (clang, -O2):
<func>:
mov    %rdi,%rax
ret

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

LLVM IR (-O2):
define i8* @func(i8* readnone returned %0) {
ret i8* %0
}
void __attribute__((weak)) wdt_stop(void) { return; }


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

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

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

LLVM IR (-O2):
define weak void @wdt_stop() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ put8(char);
void jmp_imm_short(char saut) {
  put8(0xEB);
  put8(saut);
}


x86 assembly (clang, -O0):
<jmp_imm_short>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    $0xffffffeb,%edi
call   1030 <put8@plt>
movsbl -0x1(%rbp),%edi
call   1030 <put8@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<jmp_imm_short>:
push   %rbx
mov    %edi,%ebx
mov    $0xffffffeb,%edi
call   1030 <put8@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1030 <put8@plt>

LLVM IR (-O0):
define void @jmp_imm_short(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = call i32 @put8(i8 signext -21)
%4 = load i8, i8* %2
%5 = call i32 @put8(i8 signext %4)
ret void
}

LLVM IR (-O2):
define void @jmp_imm_short(i8 signext %0) {
%2 = tail call i32 @put8(i8 signext -21)
%3 = tail call i32 @put8(i8 signext %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ WARN_ON(int);
int gpio_get_value_cansleep(unsigned gpio) {
  WARN_ON(1);
  return 0;
}


x86 assembly (clang, -O0):
<gpio_get_value_cansleep>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x1,%edi
call   1030 <WARN_ON@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gpio_get_value_cansleep>:
push   %rax
mov    $0x1,%edi
call   1030 <WARN_ON@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @gpio_get_value_cansleep(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @WARN_ON(i32 1)
ret i32 0
}

LLVM IR (-O2):
define i32 @gpio_get_value_cansleep(i32 %0) {
%2 = tail call i32 @WARN_ON(i32 1)
ret i32 0
}
/* Type definitions */
typedef int time_t;

/* Variables and functions */
int days(int, int);
int hours(int, int);
int mins(time_t t1, time_t t2) {
  return (t2 - t1 - (days(t1, t2) * 86400) - (hours(t1, t2) * 3600)) / 60;
}


x86 assembly (clang, -O0):
<mins>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
sub    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <days@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
imul   $0x15180,%ecx,%ecx
sub    %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1040 <hours@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
imul   $0xe10,%ecx,%ecx
sub    %ecx,%eax
mov    $0x3c,%ecx
cltd
idiv   %ecx
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mins>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %esi,%r14d
mov    %edi,%r15d
mov    %esi,%ebx
sub    %edi,%ebx
call   1030 <days@plt>
imul   $0xfffeae80,%eax,%ebp
add    %ebx,%ebp
mov    %r15d,%edi
mov    %r14d,%esi
call   1040 <hours@plt>
imul   $0xfffff1f0,%eax,%eax
add    %ebp,%eax
cltq
imul   $0xffffffff88888889,%rax,%rcx
shr    $0x20,%rcx
add    %ecx,%eax
mov    %eax,%ecx
shr    $0x1f,%ecx
sar    $0x5,%eax
add    %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @mins(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 = sub nsw i32 %5, %6
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = call i32 @days(i32 %8, i32 %9)
%11 = mul nsw i32 %10, 86400
%12 = sub nsw i32 %7, %11
%13 = load i32, i32* %3
%14 = load i32, i32* %4
%15 = call i32 @hours(i32 %13, i32 %14)
%16 = mul nsw i32 %15, 3600
%17 = sub nsw i32 %12, %16
%18 = sdiv i32 %17, 60
ret i32 %18
}

LLVM IR (-O2):
define i32 @mins(i32 %0, i32 %1) {
%3 = sub i32 %1, %0
%4 = tail call i32 @days(i32 %0, i32 %1)
%5 = mul i32 %4, -86400
%6 = add i32 %3, %5
%7 = tail call i32 @hours(i32 %0, i32 %1)
%8 = mul i32 %7, -3600
%9 = add i32 %6, %8
%10 = sdiv i32 %9, 60
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, char *);
int main(void) {
  char name[40];
  printf("What's your name? ");
  scanf("%s", name);
  printf("Hello, %s. %s\n", name, "You are an extraordinary human being.");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x30(%rbp),%rsi
lea    0xecb(%rip),%rdi
call   1040 <scanf@plt>
lea    -0x30(%rbp),%rsi
lea    0xebe(%rip),%rdi
lea    0xec6(%rip),%rdx
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x30,%rsp
lea    0xed4(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xed9(%rip),%rdi
mov    %rsp,%rbx
mov    %rbx,%rsi
call   1040 <scanf@plt>
lea    0xeca(%rip),%rdi
lea    0xed2(%rip),%rdx
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [19 x i8] c"What's your name? \00"
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [15 x i8] c"Hello, %s. %s\0A\00"
@.str.3 = [38 x i8] c"You are an extraordinary human being.\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [40 x i8]
store i32 0, i32* %1
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%4 = getelementptr inbounds [40 x i8], [40 x i8]* %2, i64 0, i64 0
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %4)
%6 = getelementptr inbounds [40 x i8], [40 x i8]* %2, i64 0, i64 0
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0), i8* %6, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.3, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [19 x i8] c"What's your name? \00"
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [15 x i8] c"Hello, %s. %s\0A\00"
@.str.3 = [38 x i8] c"You are an extraordinary human being.\00"
define i32 @main() {
%1 = alloca [40 x i8]
%2 = getelementptr inbounds [40 x i8], [40 x i8]* %1, i64 0, i64 0
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %2)
%5 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0), i8* %2, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.3, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ va_list;

/* Variables and functions */
int /*<<< orphan*/ vprintf(char *, int /*<<< orphan*/);
void stdoutLogger(char *format, va_list ap) { vprintf(format, ap); }


x86 assembly (clang, -O0):
<stdoutLogger>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <vprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stdoutLogger>:
jmp    1030 <vprintf@plt>

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

LLVM IR (-O2):
define void @stdoutLogger(i8* nocapture %0, i32 %1) {
%3 = tail call i32 @vprintf(i8* %0, i32 %1)
ret void
}
/* Variables and functions */
int __VERIFIER_nondet_int();
int main() {
  int x;
  x = __VERIFIER_nondet_int();
  while (x > 1) {
    x = 2 * x;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
jle    1141 <main+0x31>
mov    -0x8(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1129 <main+0x19>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_int@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 (...) @__VERIFIER_nondet_int()
store i32 %3, i32* %2
br label %4
4: ; preds = %7, %0
%5 = load i32, i32* %2
%6 = icmp sgt i32 %5, 1
br i1 %6, label %7, label %10
7: ; preds = %4
%8 = load i32, i32* %2
%9 = mul nsw i32 2, %8
store i32 %9, i32* %2
br label %4
10: ; preds = %4
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @__VERIFIER_nondet_int()
ret i32 0
}
void EVP_add_cipher(void) {}


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

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

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

LLVM IR (-O2):
define void @EVP_add_cipher() {
ret void
}
int is_leap_year(int year) {
  if ((year % 4 == 0 && year % 100 != 0) || year % 400 == 0)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<is_leap_year>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    112f <is_leap_year+0x2f>
mov    -0x8(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1143 <is_leap_year+0x43>
mov    -0x8(%rbp),%eax
mov    $0x190,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    114f <is_leap_year+0x4f>
movl   $0x1,-0x4(%rbp)
jmp    1156 <is_leap_year+0x56>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_leap_year>:
test   $0x3,%dil
sete   %al
imul   $0xc28f5c29,%edi,%ecx
add    $0x51eb850,%ecx
mov    %ecx,%edx
ror    $0x2,%edx
cmp    $0x28f5c29,%edx
setae  %dl
and    %al,%dl
ror    $0x4,%ecx
cmp    $0xa3d70b,%ecx
setb   %al
or     %dl,%al
movzbl %al,%eax
ret

LLVM IR (-O0):
define i32 @is_leap_year(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = srem i32 %4, 4
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %11
7: ; preds = %1
%8 = load i32, i32* %3
%9 = srem i32 %8, 100
%10 = icmp ne i32 %9, 0
br i1 %10, label %15, label %11
11: ; preds = %7, %1
%12 = load i32, i32* %3
%13 = srem i32 %12, 400
%14 = icmp eq i32 %13, 0
br i1 %14, label %15, label %16
15: ; preds = %11, %7
store i32 1, i32* %2
br label %17
16: ; preds = %11
store i32 0, i32* %2
br label %17
17: ; preds = %16, %15
%18 = load i32, i32* %2
ret i32 %18
}

LLVM IR (-O2):
define i32 @is_leap_year(i32 %0) {
%2 = and i32 %0, 3
%3 = icmp eq i32 %2, 0
%4 = srem i32 %0, 100
%5 = icmp ne i32 %4, 0
%6 = and i1 %3, %5
%7 = srem i32 %0, 400
%8 = icmp eq i32 %7, 0
%9 = or i1 %8, %6
%10 = zext i1 %9 to i32
ret i32 %10
}
int test_imm_A2int32_reg(int val) { return ((val) & (0xA2 << 0)) ? -20 : -40; }


x86 assembly (clang, -O0):
<test_imm_A2int32_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
and    $0xa2,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_A2int32_reg>:
test   $0xa2,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_A2int32_reg(i32 %0) {
%2 = and i32 %0, 162
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
bool checkDistinct(long *alreadyGeneratedList, long fn, long listSize) {
  long listIndex = 0;
  while (listIndex < listSize) {
    if (alreadyGeneratedList[listIndex] == fn) {
      return true;
    }
    listIndex++;
  }
  return false;
}


x86 assembly (clang, -O0):
<checkDistinct>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
movq   $0x0,-0x28(%rbp)
mov    -0x28(%rbp),%rax
cmp    -0x20(%rbp),%rax
jge    1159 <checkDistinct+0x59>
mov    -0x10(%rbp),%rax
mov    -0x28(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
cmp    -0x18(%rbp),%rax
jne    1148 <checkDistinct+0x48>
movl   $0x1,-0x4(%rbp)
jmp    1160 <checkDistinct+0x60>
mov    -0x28(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x28(%rbp)
jmp    1118 <checkDistinct+0x18>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<checkDistinct>:
test   %rdx,%rdx
jle    111f <checkDistinct+0x1f>
xor    %eax,%eax
nopw   0x0(%rax,%rax,1)
cmp    %rsi,(%rdi,%rax,8)
je     1122 <checkDistinct+0x22>
add    $0x1,%rax
cmp    %rax,%rdx
jne    1110 <checkDistinct+0x10>
xor    %eax,%eax
ret
mov    $0x1,%eax
ret

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

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


x86 assembly (clang, -O0):
<get_start_time>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_start_time>:
movq   $0x0,(%rdi)
ret

LLVM IR (-O0):
define void @get_start_time(double* %0) {
%2 = alloca double*
store double* %0, double** %2
%3 = load double*, double** %2
store double 0.000000e+00, double* %3
ret void
}

LLVM IR (-O2):
define void @get_start_time(double* nocapture writeonly %0) {
store double 0.000000e+00, double* %0
ret void
}
void plfit_error_handler_ignore(const char *reason, const char *file, int line,
                                int plfit_errno) {}


x86 assembly (clang, -O0):
<plfit_error_handler_ignore>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @plfit_error_handler_ignore(i8* nocapture %0, i8* nocapture %1, i32 %2, i32 %3) {
ret void
}
int yaffs_verify_file_sane(struct yaffs_obj *in) {
  (void)in;
  return 1;
}


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

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

LLVM IR (-O0):
%struct.yaffs_obj = type opaque
define i32 @yaffs_verify_file_sane(%struct.yaffs_obj* %0) {
%2 = alloca %struct.yaffs_obj*
store %struct.yaffs_obj* %0, %struct.yaffs_obj** %2
%3 = load %struct.yaffs_obj*, %struct.yaffs_obj** %2
ret i32 1
}

LLVM IR (-O2):
%struct.yaffs_obj = type opaque
define i32 @yaffs_verify_file_sane(%struct.yaffs_obj* nocapture readnone %0) {
ret i32 1
}
void gtk_widget_modify_style() {}


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

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

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

LLVM IR (-O2):
define void @gtk_widget_modify_style() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, char *);
void usage(int argc, char *argv[]) {
  printf("usage: %s [-s] <fin> <fout>\n", argv[0]);
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    (%rsi),%rsi
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [29 x i8] c"usage: %s [-s] <fin> <fout>\0A\00"
define void @usage(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = load i8**, i8*** %4
%6 = getelementptr inbounds i8*, i8** %5, i64 0
%7 = load i8*, i8** %6
%8 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i8* %7)
%9 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [29 x i8] c"usage: %s [-s] <fin> <fout>\0A\00"
define void @usage(i32 %0, i8** nocapture %1) {
%3 = load i8*, i8** %1
%4 = tail call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = tail call i32 @exit(i32 1)
unreachable
}
const char *cmx_atomic_implementation_name(void) {
  static const char *name = "ia32-assembler";
  return name;
}


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

x86 assembly (clang, -O2):
<cmx_atomic_implementation_name>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@cmx_atomic_implementation_name.name = internal global i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i32 0, i32 0)
@.str = [15 x i8] c"ia32-assembler\00"
define i8* @cmx_atomic_implementation_name() {
%1 = load i8*, i8** @cmx_atomic_implementation_name.name
ret i8* %1
}

LLVM IR (-O2):
@.str = [15 x i8] c"ia32-assembler\00"
define i8* @cmx_atomic_implementation_name() {
ret i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0)
}
/* Type definitions */
struct json_object {
  int dummy;
};

/* Variables and functions */
char *json_object_get_string(struct json_object *);
struct json_object *json_object_object_get(struct json_object *, char *);
char *jsonrpc_request_method(struct json_object *request) {
  struct json_object *value;
  value = json_object_object_get(request, "method");
  return json_object_get_string(value);
}


x86 assembly (clang, -O0):
<jsonrpc_request_method>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xec9(%rip),%rsi
call   1040 <json_object_object_get@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <json_object_get_string@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<jsonrpc_request_method>:
push   %rax
lea    0xed8(%rip),%rsi
call   1040 <json_object_object_get@plt>
mov    %rax,%rdi
pop    %rax
jmp    1030 <json_object_get_string@plt>

LLVM IR (-O0):
%struct.json_object = type { i32 }
@.str = [7 x i8] c"method\00"
define i8* @jsonrpc_request_method(%struct.json_object* %0) {
%2 = alloca %struct.json_object*
%3 = alloca %struct.json_object*
store %struct.json_object* %0, %struct.json_object** %2
%4 = load %struct.json_object*, %struct.json_object** %2
%5 = call %struct.json_object* @json_object_object_get(%struct.json_object* %4, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
store %struct.json_object* %5, %struct.json_object** %3
%6 = load %struct.json_object*, %struct.json_object** %3
%7 = call i8* @json_object_get_string(%struct.json_object* %6)
ret i8* %7
}

LLVM IR (-O2):
%struct.json_object = type { i32 }
@.str = [7 x i8] c"method\00"
define i8* @jsonrpc_request_method(%struct.json_object* %0) {
%2 = tail call %struct.json_object* @json_object_object_get(%struct.json_object* %0, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%3 = tail call i8* @json_object_get_string(%struct.json_object* %2)
ret i8* %3
}
/* Variables and functions */
char *strcpy(char *, char const *);
scalar_t__ strlen(char const *);
char *xmalloc(scalar_t__);
char *xstrdup(const char *str) {
  char *dup = xmalloc(strlen(str) + 1);
  return strcpy(dup, str);
}


x86 assembly (clang, -O0):
<xstrdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rdi
add    $0x1,%rdi
call   1050 <xmalloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xstrdup>:
push   %rbx
mov    %rdi,%rbx
call   1040 <strlen@plt>
lea    0x1(%rax),%rdi
call   1050 <xmalloc@plt>
mov    %rax,%rdi
mov    %rbx,%rsi
pop    %rbx
jmp    1030 <strcpy@plt>

LLVM IR (-O0):
define i8* @xstrdup(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @strlen(i8* %4)
%6 = add nsw i64 %5, 1
%7 = call i8* @xmalloc(i64 %6)
store i8* %7, i8** %3
%8 = load i8*, i8** %3
%9 = load i8*, i8** %2
%10 = call i8* @strcpy(i8* %8, i8* %9)
ret i8* %10
}

LLVM IR (-O2):
define i8* @xstrdup(i8* nocapture %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add nsw i64 %2, 1
%4 = tail call i8* @xmalloc(i64 %3)
%5 = tail call i8* @strcpy(i8* dereferenceable(1) %4, i8* dereferenceable(1) %0)
ret i8* %4
}
/* Type definitions */
typedef int /*<<< orphan*/ ssize_t;

/* Variables and functions */
int /*<<< orphan*/ strlen(char const *);
ssize_t a_strlen(const char *s) { return s ? strlen(s) : 0; }


x86 assembly (clang, -O0):
<a_strlen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1138 <a_strlen+0x28>
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0xc(%rbp)
jmp    1142 <a_strlen+0x32>
xor    %eax,%eax
mov    %eax,-0xc(%rbp)
jmp    1142 <a_strlen+0x32>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @a_strlen(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @strlen(i8* %0)
br label %5
5: ; preds = %1, %3
%6 = phi i32 [ %4, %3 ], [ 0, %1 ]
ret i32 %6
}
/* Variables and functions */
int COMM_send_bytes(int, void *, int /*<<< orphan*/);
int /*<<< orphan*/ free(char *);
scalar_t__ malloc(int);
int /*<<< orphan*/ sprintf(char *, char *, int);
int /*<<< orphan*/ strlen(char *);
int COMM_send_int(int sock, int value) {
  char *msg = (char *)malloc(20 * sizeof(char));
  int ret;
  sprintf(msg, "%d", value);
  ret = COMM_send_bytes(sock, (void *)msg, strlen(msg));
  free(msg);
  return ret;
}


x86 assembly (clang, -O0):
<COMM_send_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0x14,%edi
call   1060 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%edx
lea    0xe86(%rip),%rsi
call   1070 <sprintf@plt>
mov    -0x4(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <strlen@plt>
mov    -0x24(%rbp),%edi
mov    -0x20(%rbp),%rsi
mov    %eax,%edx
call   1040 <COMM_send_bytes@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
mov    -0x14(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<COMM_send_int>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%ebx
mov    %edi,%r14d
mov    $0x14,%edi
call   1060 <malloc@plt>
mov    %rax,%rbp
lea    0xe93(%rip),%rsi
mov    %rax,%rdi
mov    %ebx,%edx
call   1070 <sprintf@plt>
mov    %rbp,%rdi
call   1050 <strlen@plt>
mov    %r14d,%edi
mov    %rbp,%rsi
mov    %eax,%edx
call   1040 <COMM_send_bytes@plt>
mov    %eax,%ebx
mov    %rbp,%rdi
call   1030 <free@plt>
mov    %ebx,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
define i32 @COMM_send_int(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%7 = call i64 @malloc(i32 20)
%8 = inttoptr i64 %7 to i8*
store i8* %8, i8** %5
%9 = load i8*, i8** %5
%10 = load i32, i32* %4
%11 = call i32 @sprintf(i8* %9, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %10)
%12 = load i32, i32* %3
%13 = load i8*, i8** %5
%14 = load i8*, i8** %5
%15 = call i32 @strlen(i8* %14)
%16 = call i32 @COMM_send_bytes(i32 %12, i8* %13, i32 %15)
store i32 %16, i32* %6
%17 = load i8*, i8** %5
%18 = call i32 @free(i8* %17)
%19 = load i32, i32* %6
ret i32 %19
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @COMM_send_int(i32 %0, i32 %1) {
%3 = tail call i64 @malloc(i32 20)
%4 = inttoptr i64 %3 to i8*
%5 = tail call i32 @sprintf(i8* dereferenceable(1) %4, i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %1)
%6 = tail call i32 @strlen(i8* %4)
%7 = tail call i32 @COMM_send_bytes(i32 %0, i8* %4, i32 %6)
%8 = tail call i32 @free(i8* %4)
ret i32 %7
}
void ft_striter(char *c, void (*f)(char *)) {
  while (*c) {
    (*f)(c);
    c++;
  }
}


x86 assembly (clang, -O0):
<ft_striter>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1138 <ft_striter+0x38>
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rdi
call   *%rax
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1110 <ft_striter+0x10>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_striter>:
push   %r14
push   %rbx
push   %rax
cmpb   $0x0,(%rdi)
je     1120 <ft_striter+0x20>
mov    %rsi,%r14
mov    %rdi,%rbx
nop
mov    %rbx,%rdi
call   *%r14
cmpb   $0x0,0x1(%rbx)
lea    0x1(%rbx),%rbx
jne    1110 <ft_striter+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @ft_striter(i8* %0, void (i8*)* %1) {
%3 = alloca i8*
%4 = alloca void (i8*)*
store i8* %0, i8** %3
store void (i8*)* %1, void (i8*)** %4
br label %5
5: ; preds = %9, %2
%6 = load i8*, i8** %3
%7 = load i8, i8* %6
%8 = icmp ne i8 %7, 0
br i1 %8, label %9, label %14
9: ; preds = %5
%10 = load void (i8*)*, void (i8*)** %4
%11 = load i8*, i8** %3
%12 = load i8*, i8** %3
%13 = getelementptr inbounds i8, i8* %12, i32 1
store i8* %13, i8** %3
br label %5
14: ; preds = %5
ret void
}

LLVM IR (-O2):
define void @ft_striter(i8* %0, void (i8*)* nocapture %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %10, label %5
5: ; preds = %2, %5
%6 = phi i8* [ %7, %5 ], [ %0, %2 ]
tail call void %1(i8* %6)
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = load i8, i8* %7
%9 = icmp eq i8 %8, 0
br i1 %9, label %10, label %5
10: ; preds = %5, %2
ret void
}
int test_imm_FCint16_reg(short val) {
  return ((val) & (0xFC << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_FCint16_reg>:
test   $0xfc,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_FCint16_reg(i16 signext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = sext i16 %3 to i32
%5 = and i32 %4, 252
%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_FCint16_reg(i16 signext %0) {
%2 = and i16 %0, 252
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Type definitions */
typedef scalar_t__ uint32_t;

/* Variables and functions */
void UARTIntClear(uint32_t ui32Base, uint32_t ui32IntFlags) {
  ;
  (*((volatile uint32_t *)(ui32Base + 0x00000044))) = ui32IntFlags;
}


x86 assembly (clang, -O0):
<UARTIntClear>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,0x44(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<UARTIntClear>:
mov    %rsi,0x44(%rdi)
ret

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

LLVM IR (-O2):
define void @UARTIntClear(i64 %0, i64 %1) {
%3 = add nsw i64 %0, 68
%4 = inttoptr i64 %3 to i64*
store volatile i64 %1, i64* %4
ret void
}
int test(int x) {
  union {
    int i;
    double d;
  } a;
  a.d = 0;
  a.i = 1;
  return x >> a.i;
}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x10(%rbp)
movl   $0x1,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x10(%rbp),%ecx
sar    %cl,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test>:
mov    %edi,%eax
sar    %eax
ret

LLVM IR (-O0):
%union.anon = type { double }
define i32 @test(i32 %0) {
%2 = alloca i32
%3 = alloca %union.anon
store i32 %0, i32* %2
%4 = bitcast %union.anon* %3 to double*
store double 0.000000e+00, double* %4
%5 = bitcast %union.anon* %3 to i32*
store i32 1, i32* %5
%6 = load i32, i32* %2
%7 = bitcast %union.anon* %3 to i32*
%8 = load i32, i32* %7
%9 = ashr i32 %6, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @test(i32 %0) {
%2 = ashr i32 %0, 1
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_mutex_t;

/* Variables and functions */
int /*<<< orphan*/ free(void *);
int pthread_mutex_destroy(int /*<<< orphan*/ *);
void OsCloseMutex(void *mtx) {
  int status;
  status = pthread_mutex_destroy((pthread_mutex_t *)mtx);
  if (status != 0) {
    return;
  }
  free(mtx);
}


x86 assembly (clang, -O0):
<OsCloseMutex>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <pthread_mutex_destroy@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     1147 <OsCloseMutex+0x27>
jmp    1150 <OsCloseMutex+0x30>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<OsCloseMutex>:
push   %rbx
mov    %rdi,%rbx
call   1040 <pthread_mutex_destroy@plt>
test   %eax,%eax
je     112f <OsCloseMutex+0xf>
pop    %rbx
ret
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @OsCloseMutex(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = bitcast i8* %4 to i32*
%6 = call i32 @pthread_mutex_destroy(i32* %5)
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %10
9: ; preds = %1
br label %13
10: ; preds = %1
%11 = load i8*, i8** %2
%12 = call i32 @free(i8* %11)
br label %13
13: ; preds = %10, %9
ret void
}

LLVM IR (-O2):
define void @OsCloseMutex(i8* %0) {
%2 = bitcast i8* %0 to i32*
%3 = tail call i32 @pthread_mutex_destroy(i32* %2)
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = tail call i32 @free(i8* %0)
br label %7
7: ; preds = %1, %5
ret void
}
int separateur(char c) { return (c == ' ' || c == '\t' || c == '\n'); }


x86 assembly (clang, -O0):
<separateur>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x20,%ecx
mov    %al,-0x2(%rbp)
je     113b <separateur+0x3b>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x9,%ecx
mov    %al,-0x2(%rbp)
je     113b <separateur+0x3b>
movsbl -0x1(%rbp),%eax
cmp    $0xa,%eax
sete   %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<separateur>:
mov    $0x1,%eax
cmp    $0x9,%dil
je     1111 <separateur+0x11>
cmp    $0x20,%dil
jne    1112 <separateur+0x12>
ret
xor    %eax,%eax
cmp    $0xa,%dil
sete   %al
ret

LLVM IR (-O0):
define i32 @separateur(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp eq i32 %4, 32
br i1 %5, label %14, label %6
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp eq i32 %8, 9
br i1 %9, label %14, label %10
10: ; preds = %6
%11 = load i8, i8* %2
%12 = sext i8 %11 to i32
%13 = icmp eq i32 %12, 10
br label %14
14: ; preds = %10, %6, %1
%15 = phi i1 [ true, %6 ], [ true, %1 ], [ %13, %10 ]
%16 = zext i1 %15 to i32
ret i32 %16
}

LLVM IR (-O2):
define i32 @separateur(i8 signext %0) {
switch i8 %0, label %2 [
i8 32, label %5
i8 9, label %5
]
2: ; preds = %1
%3 = icmp eq i8 %0, 10
%4 = zext i1 %3 to i32
br label %5
5: ; preds = %1, %1, %2
%6 = phi i32 [ 1, %1 ], [ %4, %2 ], [ 1, %1 ]
ret i32 %6
}
const char *get_ver(void) { return "v0.1.0"; }


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

x86 assembly (clang, -O2):
<get_ver>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [7 x i8] c"v0.1.0\00"
define i8* @get_ver() {
ret i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [7 x i8] c"v0.1.0\00"
define i8* @get_ver() {
ret i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0)
}
int tgaGetWidth(const unsigned char *buffer) {
  return (buffer[12] & 0xFF) | (buffer[13] & 0xFF) << 8;
}


x86 assembly (clang, -O0):
<tgaGetWidth>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl 0xc(%rax),%eax
and    $0xff,%eax
mov    -0x8(%rbp),%rcx
movzbl 0xd(%rcx),%ecx
and    $0xff,%ecx
shl    $0x8,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<tgaGetWidth>:
movzwl 0xc(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @tgaGetWidth(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 12
%5 = load i8, i8* %4
%6 = zext i8 %5 to i32
%7 = and i32 %6, 255
%8 = load i8*, i8** %2
%9 = getelementptr inbounds i8, i8* %8, i64 13
%10 = load i8, i8* %9
%11 = zext i8 %10 to i32
%12 = and i32 %11, 255
%13 = shl i32 %12, 8
%14 = or i32 %7, %13
ret i32 %14
}

LLVM IR (-O2):
define i32 @tgaGetWidth(i8* nocapture %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 12
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = getelementptr inbounds i8, i8* %0, i64 13
%6 = load i8, i8* %5
%7 = zext i8 %6 to i32
%8 = shl nuw nsw i32 %7, 8
%9 = or i32 %8, %4
ret i32 %9
}
int x31_process_synack(struct mypacket *packet) { return 0; }


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

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

LLVM IR (-O0):
%struct.mypacket = type opaque
define i32 @x31_process_synack(%struct.mypacket* %0) {
%2 = alloca %struct.mypacket*
store %struct.mypacket* %0, %struct.mypacket** %2
ret i32 0
}

LLVM IR (-O2):
%struct.mypacket = type opaque
define i32 @x31_process_synack(%struct.mypacket* nocapture readnone %0) {
ret i32 0
}
void acpi_early_processor_set_pdc(void) {}


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

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

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

LLVM IR (-O2):
define void @acpi_early_processor_set_pdc() {
ret void
}
/* Type definitions */
struct node_operations {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ printf(char *, void *);
void standing_enter(void *node, void *object, struct node_operations *ops) {
  printf("standing_enter %p\n", node);
}


x86 assembly (clang, -O0):
<standing_enter>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xed1(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<standing_enter>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
%struct.node_operations = type { i32 }
@.str = [19 x i8] c"standing_enter %p\0A\00"
define void @standing_enter(i8* %0, i8* nocapture readnone %1, %struct.node_operations* nocapture readnone %2) {
%4 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
void *malloc(size_t);
int /*<<< orphan*/ memset(void *, int /*<<< orphan*/, size_t);
void *zalloc(size_t n) {
  void *p;
  if (n == 0) {
    return (NULL);
  }
  if ((p = malloc(n)) != NULL) {
    (void)memset(p, 0, n);
  }
  return (p);
}


x86 assembly (clang, -O0):
<zalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1144 <zalloc+0x24>
movq   $0x0,-0x8(%rbp)
jmp    1172 <zalloc+0x52>
mov    -0x10(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
je     116a <zalloc+0x4a>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rdx
xor    %esi,%esi
call   1030 <memset@plt>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<zalloc>:
push   %r14
push   %rbx
push   %rax
test   %rdi,%rdi
je     1148 <zalloc+0x28>
mov    %rdi,%rbx
call   1040 <malloc@plt>
test   %rax,%rax
je     1148 <zalloc+0x28>
mov    %rax,%r14
mov    %rax,%rdi
xor    %esi,%esi
mov    %rbx,%rdx
call   1030 <memset@plt>
jmp    114b <zalloc+0x2b>
xor    %r14d,%r14d
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @zalloc(i64 %0) {
%2 = icmp eq i64 %0, 0
br i1 %2, label %8, label %3
3: ; preds = %1
%4 = tail call i8* @malloc(i64 %0)
%5 = icmp eq i8* %4, null
br i1 %5, label %8, label %6
6: ; preds = %3
%7 = tail call i32 @memset(i8* %4, i32 0, i64 %0)
br label %8
8: ; preds = %3, %6, %1
%9 = phi i8* [ null, %1 ], [ %4, %6 ], [ null, %3 ]
ret i8* %9
}
int tabpos(int col, int tabstops[]) {
  if (col > 72)
    return 1;
  else
    return tabstops[col];
}


x86 assembly (clang, -O0):
<tabpos>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x48,-0x8(%rbp)
jle    1121 <tabpos+0x21>
movl   $0x1,-0x4(%rbp)
jmp    112f <tabpos+0x2f>
mov    -0x10(%rbp),%rax
movslq -0x8(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<tabpos>:
mov    $0x1,%eax
cmp    $0x48,%edi
jg     1110 <tabpos+0x10>
movslq %edi,%rax
mov    (%rsi,%rax,4),%eax
ret

LLVM IR (-O0):
define i32 @tabpos(i32 %0, i32* %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32*
store i32 %0, i32* %4
store i32* %1, i32** %5
%6 = load i32, i32* %4
%7 = icmp sgt i32 %6, 72
br i1 %7, label %8, label %9
8: ; preds = %2
store i32 1, i32* %3
br label %15
9: ; preds = %2
%10 = load i32*, i32** %5
%11 = load i32, i32* %4
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds i32, i32* %10, i64 %12
%14 = load i32, i32* %13
store i32 %14, i32* %3
br label %15
15: ; preds = %9, %8
%16 = load i32, i32* %3
ret i32 %16
}

LLVM IR (-O2):
define i32 @tabpos(i32 %0, i32* nocapture %1) {
%3 = icmp sgt i32 %0, 72
br i1 %3, label %8, label %4
4: ; preds = %2
%5 = sext i32 %0 to i64
%6 = getelementptr inbounds i32, i32* %1, i64 %5
%7 = load i32, i32* %6
br label %8
8: ; preds = %2, %4
%9 = phi i32 [ %7, %4 ], [ 1, %2 ]
ret i32 %9
}
void caller_1_1_1_1_2_1_1() {}


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

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

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

LLVM IR (-O2):
define void @caller_1_1_1_1_2_1_1() {
ret void
}
int test_imm_E8uint16_reg(unsigned short val) {
  return ((val) & (0xE8 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_E8uint16_reg>:
test   $0xe8,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_E8uint16_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, 232
%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_E8uint16_reg(i16 zeroext %0) {
%2 = and i16 %0, 232
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ test1(int, unsigned int);
int /*<<< orphan*/ test2(int);
int main(void) {
  test1(6, 128U);
  test2(1);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x6,%edi
mov    $0x80,%esi
call   1030 <test1@plt>
mov    $0x1,%edi
call   1040 <test2@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x6,%edi
mov    $0x80,%esi
call   1030 <test1@plt>
mov    $0x1,%edi
call   1040 <test2@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 @test1(i32 6, i32 128)
%2 = call i32 @test2(i32 1)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @test1(i32 6, i32 128)
%2 = tail call i32 @test2(i32 1)
ret i32 0
}
void option_unset2option_unset_unit_option_unset() {}


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

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

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

LLVM IR (-O2):
define void @option_unset2option_unset_unit_option_unset() {
ret void
}