xunge/DecIR huggingface dataset:
int sign(int x) {
  int ultimate = x >> 31;
  int ret = ultimate | (!!x);
  return ret;
}


x86 assembly (clang, -O0):
<sign>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x1f,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmpl   $0x0,-0x4(%rbp)
setne  %cl
xor    $0xff,%cl
xor    $0xff,%cl
and    $0x1,%cl
movzbl %cl,%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sign>:
mov    %edi,%ecx
sar    $0x1f,%ecx
xor    %eax,%eax
test   %edi,%edi
setne  %al
or     %ecx,%eax
ret

LLVM IR (-O0):
define i32 @sign(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
%5 = load i32, i32* %2
%6 = ashr i32 %5, 31
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = load i32, i32* %2
%9 = icmp ne i32 %8, 0
%10 = xor i1 %9, true
%11 = xor i1 %10, true
%12 = zext i1 %11 to i32
%13 = or i32 %7, %12
store i32 %13, i32* %4
%14 = load i32, i32* %4
ret i32 %14
}

LLVM IR (-O2):
define i32 @sign(i32 %0) {
%2 = ashr i32 %0, 31
%3 = icmp ne i32 %0, 0
%4 = zext i1 %3 to i32
%5 = or i32 %2, %4
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ GLfloat;
typedef int /*<<< orphan*/ GLenum;

/* Variables and functions */
int /*<<< orphan*/ glGetFloatv(int /*<<< orphan*/, int /*<<< orphan*/ *);
void GetFloatv(GLenum pname, GLfloat *params) { glGetFloatv(pname, params); }


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

x86 assembly (clang, -O2):
<GetFloatv>:
jmp    1030 <glGetFloatv@plt>

LLVM IR (-O0):
define void @GetFloatv(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 @glGetFloatv(i32 %5, i32* %6)
ret void
}

LLVM IR (-O2):
define void @GetFloatv(i32 %0, i32* %1) {
%3 = tail call i32 @glGetFloatv(i32 %0, i32* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ esc(char *);
int /*<<< orphan*/ padding(int);
void vt52cud1(void) {
  esc("B");
  padding(5);
}


x86 assembly (clang, -O0):
<vt52cud1>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1040 <esc@plt>
mov    $0x5,%edi
call   1030 <padding@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<vt52cud1>:
push   %rax
lea    0xed8(%rip),%rdi
call   1040 <esc@plt>
mov    $0x5,%edi
pop    %rax
jmp    1030 <padding@plt>

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

LLVM IR (-O2):
@.str = [2 x i8] c"B\00"
define void @vt52cud1() {
%1 = tail call i32 @esc(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @padding(i32 5)
ret void
}
int do_616() { return 616; }


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

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

LLVM IR (-O0):
define i32 @do_616() {
ret i32 616
}

LLVM IR (-O2):
define i32 @do_616() {
ret i32 616
}
/* Type definitions */
struct timeval {
  int tv_sec;
  int tv_usec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
long event_time_now(void) {
  struct timeval tv;
  gettimeofday(&tv, NULL);
  return (1000000 * tv.tv_sec + tv.tv_usec) / 1000;
}


x86 assembly (clang, -O0):
<event_time_now>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x8(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
imul   $0xf4240,-0x8(%rbp),%eax
add    -0x4(%rbp),%eax
mov    $0x3e8,%ecx
cltd
idiv   %ecx
cltq
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<event_time_now>:
push   %rax
mov    %rsp,%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
imul   $0xf4240,(%rsp),%eax
add    0x4(%rsp),%eax
cltq
imul   $0x10624dd3,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x26,%rax
add    %ecx,%eax
cltq
pop    %rcx
ret

LLVM IR (-O0):
%struct.timeval = type { i32, i32 }
define i64 @event_time_now() {
%1 = alloca %struct.timeval
%2 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%3 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%4 = load i32, i32* %3
%5 = mul nsw i32 1000000, %4
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%7 = load i32, i32* %6
%8 = add nsw i32 %5, %7
%9 = sdiv i32 %8, 1000
%10 = sext i32 %9 to i64
ret i64 %10
}

LLVM IR (-O2):
%struct.timeval = type { i32, i32 }
define i64 @event_time_now() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%5 = load i32, i32* %4
%6 = mul nsw i32 %5, 1000000
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%8 = load i32, i32* %7
%9 = add nsw i32 %6, %8
%10 = sdiv i32 %9, 1000
%11 = sext i32 %10 to i64
ret i64 %11
}
char getc(void) {
  unsigned int *base;
  char c;
  base = (unsigned int *)0xF0300000;
  while ((*(base + 0) & 1) == 0)
    ;
  c = *(base + 1);
  return c;
}


x86 assembly (clang, -O0):
<getc>:
push   %rbp
mov    %rsp,%rbp
mov    $0xf0300000,%eax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
and    $0x1,%eax
cmp    $0x0,%eax
jne    1124 <getc+0x24>
jmp    110d <getc+0xd>
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%eax
mov    %al,-0x9(%rbp)
movsbl -0x9(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getc>:
mov    $0xf0300000,%eax
testb  $0x1,(%rax)
jne    1112 <getc+0x12>
nopw   0x0(%rax,%rax,1)
jmp    1110 <getc+0x10>
mov    0x4(%rax),%al
ret

LLVM IR (-O0):
define signext i8 @getc() {
%1 = alloca i32*
%2 = alloca i8
store i32* inttoptr (i64 4029677568 to i32*), i32** %1
br label %3
3: ; preds = %9, %0
%4 = load i32*, i32** %1
%5 = getelementptr inbounds i32, i32* %4, i64 0
%6 = load i32, i32* %5
%7 = and i32 %6, 1
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %10
9: ; preds = %3
br label %3
10: ; preds = %3
%11 = load i32*, i32** %1
%12 = getelementptr inbounds i32, i32* %11, i64 1
%13 = load i32, i32* %12
%14 = trunc i32 %13 to i8
store i8 %14, i8* %2
%15 = load i8, i8* %2
ret i8 %15
}

LLVM IR (-O2):
define signext i8 @getc() {
%1 = load i32, i32* inttoptr (i64 4029677568 to i32*)
%2 = and i32 %1, 1
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %5
4: ; preds = %0, %4
br label %4
5: ; preds = %0
%6 = load i32, i32* inttoptr (i64 4029677572 to i32*)
%7 = trunc i32 %6 to i8
ret i8 %7
}
/* Variables and functions */
int /*<<< orphan*/ init(int, char **);
int main(int argc, char **argv) {
  if (argc < 2)
    return 1;
  else
    init(argc, argv);
}


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)
cmpl   $0x2,-0x8(%rbp)
jge    113c <main+0x2c>
movl   $0x1,-0x4(%rbp)
jmp    1148 <main+0x38>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <init@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
mov    $0x1,%eax
cmp    $0x2,%edi
jl     1126 <main+0x16>
push   %rax
call   1030 <init@plt>
xor    %eax,%eax
add    $0x8,%rsp
ret

LLVM IR (-O0):
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 = load i32, i32* %4
%7 = icmp slt i32 %6, 2
br i1 %7, label %8, label %9
8: ; preds = %2
store i32 1, i32* %3
br label %13
9: ; preds = %2
%10 = load i32, i32* %4
%11 = load i8**, i8*** %5
%12 = call i32 @init(i32 %10, i8** %11)
br label %13
13: ; preds = %8, %9
%14 = load i32, i32* %3
ret i32 %14
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = icmp slt i32 %0, 2
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i32 @init(i32 %0, i8** %1)
br label %6
6: ; preds = %2, %4
%7 = phi i32 [ 0, %4 ], [ 1, %2 ]
ret i32 %7
}
Help() {}


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

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

LLVM IR (-O0):
define i32 @Help() {
%1 = alloca i32
%2 = load i32, i32* %1
ret i32 %2
}

LLVM IR (-O2):
define i32 @Help() {
ret i32 undef
}
int time_pitch_sort(const void *a, const void *b) {
  double *a1, *b1;
  a1 = (double *)a;
  b1 = (double *)b;
  if (*a1 > *b1)
    return 1;
  if (*a1 == *b1)
    return 0;
  if (*a1 < *b1)
    return -1;
  return 0;
}


x86 assembly (clang, -O0):
<time_pitch_sort>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x28(%rbp),%rax
ucomisd (%rax),%xmm0
jbe    113e <time_pitch_sort+0x3e>
movl   $0x1,-0x4(%rbp)
jmp    1193 <time_pitch_sort+0x93>
mov    -0x20(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x28(%rbp),%rax
ucomisd (%rax),%xmm0
jne    1166 <time_pitch_sort+0x66>
jp     1166 <time_pitch_sort+0x66>
movl   $0x0,-0x4(%rbp)
jmp    1193 <time_pitch_sort+0x93>
mov    -0x20(%rbp),%rax
movsd  (%rax),%xmm1
mov    -0x28(%rbp),%rax
movsd  (%rax),%xmm0
ucomisd %xmm1,%xmm0
jbe    118c <time_pitch_sort+0x8c>
movl   $0xffffffff,-0x4(%rbp)
jmp    1193 <time_pitch_sort+0x93>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<time_pitch_sort>:
movsd  (%rdi),%xmm0
movsd  (%rsi),%xmm1
mov    $0x1,%eax
ucomisd %xmm1,%xmm0
ja     111d <time_pitch_sort+0x1d>
xor    %eax,%eax
ucomisd %xmm1,%xmm0
jne    111e <time_pitch_sort+0x1e>
jp     111e <time_pitch_sort+0x1e>
ret
xor    %eax,%eax
ucomisd %xmm0,%xmm1
seta   %al
neg    %eax
ret

LLVM IR (-O0):
define i32 @time_pitch_sort(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca double*
%7 = alloca double*
store i8* %0, i8** %4
store i8* %1, i8** %5
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to double*
store double* %9, double** %6
%10 = load i8*, i8** %5
%11 = bitcast i8* %10 to double*
store double* %11, double** %7
%12 = load double*, double** %6
%13 = load double, double* %12
%14 = load double*, double** %7
%15 = load double, double* %14
%16 = fcmp ogt double %13, %15
br i1 %16, label %17, label %18
17: ; preds = %2
store i32 1, i32* %3
br label %33
18: ; preds = %2
%19 = load double*, double** %6
%20 = load double, double* %19
%21 = load double*, double** %7
%22 = load double, double* %21
%23 = fcmp oeq double %20, %22
br i1 %23, label %24, label %25
24: ; preds = %18
store i32 0, i32* %3
br label %33
25: ; preds = %18
%26 = load double*, double** %6
%27 = load double, double* %26
%28 = load double*, double** %7
%29 = load double, double* %28
%30 = fcmp olt double %27, %29
br i1 %30, label %31, label %32
31: ; preds = %25
store i32 -1, i32* %3
br label %33
32: ; preds = %25
store i32 0, i32* %3
br label %33
33: ; preds = %32, %31, %24, %17
%34 = load i32, i32* %3
ret i32 %34
}

LLVM IR (-O2):
define i32 @time_pitch_sort(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to double*
%4 = bitcast i8* %1 to double*
%5 = load double, double* %3
%6 = load double, double* %4
%7 = fcmp ogt double %5, %6
br i1 %7, label %13, label %8
8: ; preds = %2
%9 = fcmp oeq double %5, %6
br i1 %9, label %13, label %10
10: ; preds = %8
%11 = fcmp olt double %5, %6
%12 = sext i1 %11 to i32
br label %13
13: ; preds = %10, %8, %2
%14 = phi i32 [ 1, %2 ], [ 0, %8 ], [ %12, %10 ]
ret i32 %14
}
int fun602() { return 602; }


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

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

LLVM IR (-O0):
define i32 @fun602() {
ret i32 602
}

LLVM IR (-O2):
define i32 @fun602() {
ret i32 602
}
char int_to_leds_m$leds$yellow_on(void) {
  char result;
  result = leds$leds$yellow_on();
  return result;
}


x86 assembly (clang, -O0):
<int_to_leds_m$leds$yellow_on>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <leds$leds$yellow_on@plt>
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<int_to_leds_m$leds$yellow_on>:
push   %rax
xor    %eax,%eax
call   1030 <leds$leds$yellow_on@plt>
pop    %rcx
ret

LLVM IR (-O0):
define signext i8 @"int_to_leds_m$leds$yellow_on"() {
%1 = alloca i8
%2 = call i32 (...) @"leds$leds$yellow_on"()
%3 = trunc i32 %2 to i8
store i8 %3, i8* %1
%4 = load i8, i8* %1
ret i8 %4
}

LLVM IR (-O2):
define signext i8 @"int_to_leds_m$leds$yellow_on"() {
%1 = tail call i32 (...) @"leds$leds$yellow_on"()
%2 = trunc i32 %1 to i8
ret i8 %2
}
/* Variables and functions */
void *memmove(void *dest, const void *src, size_t n) { return dest; }


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

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

LLVM IR (-O0):
define i8* @memmove(i8* %0, i8* %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
store i8* %0, i8** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%7 = load i8*, i8** %4
ret i8* %7
}

LLVM IR (-O2):
define i8* @memmove(i8* readnone returned %0, i8* nocapture readnone %1, i64 %2) {
ret i8* %0
}
/* Type definitions */
struct stat {
  int dummy;
};

/* Variables and functions */
int __lxstat(int, char const *, struct stat *);
int ___lxstat(int ver, const char *path, struct stat *sb) {
  return __lxstat(ver, path, sb);
}


x86 assembly (clang, -O0):
<___lxstat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <__lxstat@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<___lxstat>:
jmp    1030 <__lxstat@plt>

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

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @___lxstat(i32 %0, i8* %1, %struct.stat* %2) {
%4 = tail call i32 @__lxstat(i32 %0, i8* %1, %struct.stat* %2)
ret i32 %4
}
void MFS_Shutdown(fd) {
  fsync(fd);
  close(fd);
  exit(0);
}


x86 assembly (clang, -O0):
<MFS_Shutdown>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x0,%al
call   1040 <fsync@plt>
mov    -0x4(%rbp),%edi
mov    $0x0,%al
call   1030 <close@plt>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<MFS_Shutdown>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1040 <fsync@plt>
mov    %ebx,%edi
xor    %eax,%eax
call   1030 <close@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
define void @MFS_Shutdown(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 (i32, ...) bitcast (i32 (...)* @fsync to i32 (i32, ...)*)(i32 %3)
%5 = load i32, i32* %2
%6 = call i32 (i32, ...) bitcast (i32 (...)* @close to i32 (i32, ...)*)(i32 %5)
unreachable
}

LLVM IR (-O2):
define void @MFS_Shutdown(i32 %0) {
%2 = tail call i32 (i32, ...) bitcast (i32 (...)* @fsync to i32 (i32, ...)*)(i32 %0)
%3 = tail call i32 (i32, ...) bitcast (i32 (...)* @close to i32 (i32, ...)*)(i32 %0)
tail call void @exit(i32 0)
unreachable
}
/* Type definitions */
typedef scalar_t__ uint32_t;
typedef int uint16_t;

/* Variables and functions */
void USBHostPwrEnable(uint32_t ui32Base) {
  ;
  (*((volatile uint16_t *)(ui32Base + 0x00000400))) |= 0x00000004;
}


x86 assembly (clang, -O0):
<USBHostPwrEnable>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x400(%rax),%ecx
or     $0x4,%ecx
mov    %ecx,0x400(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<USBHostPwrEnable>:
orl    $0x4,0x400(%rdi)
ret

LLVM IR (-O0):
define void @USBHostPwrEnable(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = add nsw i64 %3, 1024
%5 = inttoptr i64 %4 to i32*
%6 = load volatile i32, i32* %5
%7 = or i32 %6, 4
store volatile i32 %7, i32* %5
ret void
}

LLVM IR (-O2):
define void @USBHostPwrEnable(i64 %0) {
%2 = add nsw i64 %0, 1024
%3 = inttoptr i64 %2 to i32*
%4 = load volatile i32, i32* %3
%5 = or i32 %4, 4
store volatile i32 %5, i32* %3
ret void
}
/* Variables and functions */
short CiSetLom(unsigned char, int /*<<< orphan*/);
short int CiSJA1000ClearLom(unsigned char chan) { return CiSetLom(chan, 0); }


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
xor    %esi,%esi
movzbl -0x1(%rbp),%edi
call   1030 <CiSetLom@plt>
cwtl
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
xor    %esi,%esi
jmp    1030 <CiSetLom@plt>

LLVM IR (-O0):
define signext i16 @CiSJA1000ClearLom(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = call signext i16 @CiSetLom(i8 zeroext %3, i32 0)
ret i16 %4
}

LLVM IR (-O2):
define signext i16 @CiSJA1000ClearLom(i8 zeroext %0) {
%2 = tail call signext i16 @CiSetLom(i8 zeroext %0, i32 0)
ret i16 %2
}
/* Type definitions */
typedef char *uint64_t;
typedef char *int64_t;

/* Variables and functions */
int64_t syscall3(uint64_t msg, uint64_t arg1, uint64_t arg2, uint64_t arg3) {
  __asm__ __volatile__("syscall"
                       : "=a"(msg), "=D"(arg1), "=S"(arg2), "=d"(arg3)
                       : "a"(msg), "D"(arg1), "S"(arg2), "d"(arg3)
                       : "r8", "r9", "r10", "r11", "%rcx", "memory");
  return msg;
}


x86 assembly (clang, -O0):
<syscall3>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
syscall
mov    %rax,-0x8(%rbp)
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<syscall3>:
mov    %rdi,%rax
mov    %rsi,%rdi
mov    %rdx,%rsi
mov    %rcx,%rdx
syscall
ret

LLVM IR (-O0):
define i8* @syscall3(i8* %0, i8* %1, i8* %2, i8* %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
store i8* %0, i8** %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store i8* %3, i8** %8
%9 = load i8*, i8** %5
%10 = load i8*, i8** %6
%11 = load i8*, i8** %7
%12 = load i8*, i8** %8
%13 = call { i8*, i8*, i8*, i8* } asm sideeffect "syscall", "={ax},={di},={si},={dx},{ax},{di},{si},{dx},~{r8},~{r9},~{r10},~{r11},~{rcx},~{memory},~{dirflag},~{fpsr},~{flags}"(i8* %9, i8* %10, i8* %11, i8* %12)
%14 = extractvalue { i8*, i8*, i8*, i8* } %13, 0
%15 = extractvalue { i8*, i8*, i8*, i8* } %13, 1
%16 = extractvalue { i8*, i8*, i8*, i8* } %13, 2
%17 = extractvalue { i8*, i8*, i8*, i8* } %13, 3
store i8* %14, i8** %5
store i8* %15, i8** %6
store i8* %16, i8** %7
store i8* %17, i8** %8
%18 = load i8*, i8** %5
ret i8* %18
}

LLVM IR (-O2):
define i8* @syscall3(i8* %0, i8* %1, i8* %2, i8* %3) {
%5 = tail call { i8*, i8*, i8*, i8* } asm sideeffect "syscall", "={ax},={di},={si},={dx},{ax},{di},{si},{dx},~{r8},~{r9},~{r10},~{r11},~{rcx},~{memory},~{dirflag},~{fpsr},~{flags}"(i8* %0, i8* %1, i8* %2, i8* %3)
%6 = extractvalue { i8*, i8*, i8*, i8* } %5, 0
ret i8* %6
}
/* Variables and functions */
int __ocml_isnan_f64(double);
int __isnan(double x) { return __ocml_isnan_f64(x); }


x86 assembly (clang, -O0):
<__isnan>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <__ocml_isnan_f64@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__isnan>:
jmp    1030 <__ocml_isnan_f64@plt>

LLVM IR (-O0):
define i32 @__isnan(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call i32 @__ocml_isnan_f64(double %3)
ret i32 %4
}

LLVM IR (-O2):
define i32 @__isnan(double %0) {
%2 = tail call i32 @__ocml_isnan_f64(double %0)
ret i32 %2
}
void init_sockets() {}


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

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

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

LLVM IR (-O2):
define void @init_sockets() {
ret void
}
int foo(int i) { return 42 + i; }


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x2a,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
lea    0x2a(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @foo(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add nsw i32 42, %3
ret i32 %4
}

LLVM IR (-O2):
define i32 @foo(i32 %0) {
%2 = add nsw i32 %0, 42
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ ssize_t;

/* Variables and functions */
int /*<<< orphan*/ ft_strlen(char *const);
int /*<<< orphan*/ write(int, char *const, int /*<<< orphan*/);
void ft_putstr_fd(int fd, char *const str) {
  ssize_t ret;
  ret = write(fd, str, ft_strlen(str));
  (void)ret;
}


x86 assembly (clang, -O0):
<ft_putstr_fd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <ft_strlen@plt>
mov    -0x24(%rbp),%edi
mov    -0x20(%rbp),%rsi
mov    %eax,%edx
call   1030 <write@plt>
mov    %eax,-0x14(%rbp)
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_putstr_fd>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
mov    %rsi,%rdi
call   1040 <ft_strlen@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %eax,%edx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <write@plt>

LLVM IR (-O0):
define void @ft_putstr_fd(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i32
store i32 %0, i32* %3
store i8* %1, i8** %4
%6 = load i32, i32* %3
%7 = load i8*, i8** %4
%8 = load i8*, i8** %4
%9 = call i32 @ft_strlen(i8* %8)
%10 = call i32 @write(i32 %6, i8* %7, i32 %9)
store i32 %10, i32* %5
%11 = load i32, i32* %5
ret void
}

LLVM IR (-O2):
define void @ft_putstr_fd(i32 %0, i8* %1) {
%3 = tail call i32 @ft_strlen(i8* %1)
%4 = tail call i32 @write(i32 %0, i8* %1, i32 %3)
ret void
}
/* Type definitions */
struct tsm_utf8_mach {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct tsm_utf8_mach *);
void tsm_utf8_mach_free(struct tsm_utf8_mach *mach) {
  if (!mach)
    return;
  free(mach);
}


x86 assembly (clang, -O0):
<tsm_utf8_mach_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    112c <tsm_utf8_mach_free+0x1c>
jmp    1135 <tsm_utf8_mach_free+0x25>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.tsm_utf8_mach = type { i32 }
define void @tsm_utf8_mach_free(%struct.tsm_utf8_mach* %0) {
%2 = alloca %struct.tsm_utf8_mach*
store %struct.tsm_utf8_mach* %0, %struct.tsm_utf8_mach** %2
%3 = load %struct.tsm_utf8_mach*, %struct.tsm_utf8_mach** %2
%4 = icmp ne %struct.tsm_utf8_mach* %3, null
br i1 %4, label %6, label %5
5: ; preds = %1
br label %9
6: ; preds = %1
%7 = load %struct.tsm_utf8_mach*, %struct.tsm_utf8_mach** %2
%8 = call i32 @free(%struct.tsm_utf8_mach* %7)
br label %9
9: ; preds = %6, %5
ret void
}

LLVM IR (-O2):
%struct.tsm_utf8_mach = type { i32 }
define void @tsm_utf8_mach_free(%struct.tsm_utf8_mach* %0) {
%2 = icmp eq %struct.tsm_utf8_mach* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @free(%struct.tsm_utf8_mach* %0)
br label %5
5: ; preds = %1, %3
ret void
}
reg0indreg1_set(r0, r1, x0, x1, p0, p1) int r0, r1;
int *p0, *p1;
{ r0 = (*p1); }


x86 assembly (clang, -O0):
<reg0indreg1_set>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8,-0x20(%rbp)
mov    %r9,-0x28(%rbp)
mov    -0x28(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @reg0indreg1_set(i32 %0, i32 %1, i32 %2, i32 %3, i32* %4, i32* %5) {
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32*
%13 = alloca i32*
store i32 %0, i32* %8
store i32 %1, i32* %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store i32* %4, i32** %12
store i32* %5, i32** %13
%14 = load i32*, i32** %13
%15 = load i32, i32* %14
store i32 %15, i32* %8
%16 = load i32, i32* %7
ret i32 %16
}

LLVM IR (-O2):
define i32 @reg0indreg1_set(i32 %0, i32 %1, i32 %2, i32 %3, i32* nocapture readnone %4, i32* nocapture readnone %5) {
ret i32 undef
}
/* Type definitions */
typedef int uint16_t;
struct pcg_state_setseq_32 {
  int dummy;
};

/* Variables and functions */
int pcg_setseq_32_xsh_rr_16_random_r(struct pcg_state_setseq_32 *);
uint16_t pcg_setseq_32_xsh_rr_16_boundedrand_r(struct pcg_state_setseq_32 *rng,
                                               uint16_t bound) {
  uint16_t threshold = ((uint16_t)(-bound)) % bound;
  for (;;) {
    uint16_t r = pcg_setseq_32_xsh_rr_16_random_r(rng);
    if (r >= threshold)
      return r % bound;
  }
}


x86 assembly (clang, -O0):
<pcg_setseq_32_xsh_rr_16_boundedrand_r>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
xor    %eax,%eax
sub    -0xc(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <pcg_setseq_32_xsh_rr_16_random_r@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x10(%rbp),%eax
jl     1152 <pcg_setseq_32_xsh_rr_16_boundedrand_r+0x42>
mov    -0x14(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    %edx,%eax
add    $0x20,%rsp
pop    %rbp
ret
jmp    112b <pcg_setseq_32_xsh_rr_16_boundedrand_r+0x1b>

x86 assembly (clang, -O2):
<pcg_setseq_32_xsh_rr_16_boundedrand_r>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
call   1030 <pcg_setseq_32_xsh_rr_16_random_r@plt>
test   %eax,%eax
js     1120 <pcg_setseq_32_xsh_rr_16_boundedrand_r+0x10>
cltd
idiv   %ebp
mov    %edx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
%struct.pcg_state_setseq_32 = type { i32 }
define i32 @pcg_setseq_32_xsh_rr_16_boundedrand_r(%struct.pcg_state_setseq_32* %0, i32 %1) {
%3 = alloca %struct.pcg_state_setseq_32*
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store %struct.pcg_state_setseq_32* %0, %struct.pcg_state_setseq_32** %3
store i32 %1, i32* %4
%7 = load i32, i32* %4
%8 = sub nsw i32 0, %7
%9 = load i32, i32* %4
%10 = srem i32 %8, %9
store i32 %10, i32* %5
br label %11
11: ; preds = %21, %2
%12 = load %struct.pcg_state_setseq_32*, %struct.pcg_state_setseq_32** %3
%13 = call i32 @pcg_setseq_32_xsh_rr_16_random_r(%struct.pcg_state_setseq_32* %12)
store i32 %13, i32* %6
%14 = load i32, i32* %6
%15 = load i32, i32* %5
%16 = icmp sge i32 %14, %15
br i1 %16, label %17, label %21
17: ; preds = %11
%18 = load i32, i32* %6
%19 = load i32, i32* %4
%20 = srem i32 %18, %19
ret i32 %20
21: ; preds = %11
br label %11
}

LLVM IR (-O2):
%struct.pcg_state_setseq_32 = type { i32 }
define i32 @pcg_setseq_32_xsh_rr_16_boundedrand_r(%struct.pcg_state_setseq_32* %0, i32 %1) {
br label %3
3: ; preds = %3, %2
%4 = tail call i32 @pcg_setseq_32_xsh_rr_16_random_r(%struct.pcg_state_setseq_32* %0)
%5 = icmp sgt i32 %4, -1
br i1 %5, label %6, label %3
6: ; preds = %3
%7 = srem i32 %4, %1
ret i32 %7
}
/* Type definitions */
struct chunk {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(int /*<<< orphan*/);
int /*<<< orphan*/ header_chunk(struct chunk *);
void header_free(struct chunk *chunk) { free(header_chunk(chunk)); }


x86 assembly (clang, -O0):
<header_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <header_chunk@plt>
mov    %eax,%edi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<header_free>:
push   %rax
call   1040 <header_chunk@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <free@plt>

LLVM IR (-O0):
%struct.chunk = type { i32 }
define void @header_free(%struct.chunk* %0) {
%2 = alloca %struct.chunk*
store %struct.chunk* %0, %struct.chunk** %2
%3 = load %struct.chunk*, %struct.chunk** %2
%4 = call i32 @header_chunk(%struct.chunk* %3)
%5 = call i32 @free(i32 %4)
ret void
}

LLVM IR (-O2):
%struct.chunk = type { i32 }
define void @header_free(%struct.chunk* %0) {
%2 = tail call i32 @header_chunk(%struct.chunk* %0)
%3 = tail call i32 @free(i32 %2)
ret void
}
unsigned int __read_4_sw(void *ptr) {
  unsigned int data = *(unsigned int *)ptr;
  unsigned int swap;
  swap = ((data & 0xffULL) << 24) | ((data & (0xffULL << 8)) << 8) |
         ((data & (0xffULL << 16)) >> 8) | ((data & (0xffULL << 24)) >> 24);
  return swap;
}


x86 assembly (clang, -O0):
<__read_4_sw>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
and    $0xff,%rax
shl    $0x18,%rax
mov    -0xc(%rbp),%ecx
and    $0xff00,%rcx
shl    $0x8,%rcx
or     %rcx,%rax
mov    -0xc(%rbp),%ecx
and    $0xff0000,%rcx
shr    $0x8,%rcx
or     %rcx,%rax
mov    -0xc(%rbp),%ecx
movabs $0xff000000,%rdx
and    %rdx,%rcx
shr    $0x18,%rcx
or     %rcx,%rax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__read_4_sw>:
mov    (%rdi),%eax
bswap  %eax
ret

LLVM IR (-O0):
define i32 @__read_4_sw(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i32
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = bitcast i8* %5 to i32*
%7 = load i32, i32* %6
store i32 %7, i32* %3
%8 = load i32, i32* %3
%9 = zext i32 %8 to i64
%10 = and i64 %9, 255
%11 = shl i64 %10, 24
%12 = load i32, i32* %3
%13 = zext i32 %12 to i64
%14 = and i64 %13, 65280
%15 = shl i64 %14, 8
%16 = or i64 %11, %15
%17 = load i32, i32* %3
%18 = zext i32 %17 to i64
%19 = and i64 %18, 16711680
%20 = lshr i64 %19, 8
%21 = or i64 %16, %20
%22 = load i32, i32* %3
%23 = zext i32 %22 to i64
%24 = and i64 %23, 4278190080
%25 = lshr i64 %24, 24
%26 = or i64 %21, %25
%27 = trunc i64 %26 to i32
store i32 %27, i32* %4
%28 = load i32, i32* %4
ret i32 %28
}

LLVM IR (-O2):
define i32 @__read_4_sw(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
%4 = tail call i32 @llvm.bswap.i32(i32 %3)
ret i32 %4
}
int isqrt(int c) {
  int n = 0;
  while (n * n < c) {
    n++;
  }
  return n;
}


x86 assembly (clang, -O0):
<isqrt>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
imul   -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    112c <isqrt+0x2c>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    110e <isqrt+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isqrt>:
mov    $0xffffffff,%eax
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%eax
mov    %eax,%ecx
imul   %eax,%ecx
cmp    %edi,%ecx
jl     1110 <isqrt+0x10>
ret

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

LLVM IR (-O2):
define i32 @isqrt(i32 %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i32 [ 0, %1 ], [ %6, %2 ]
%4 = mul nsw i32 %3, %3
%5 = icmp slt i32 %4, %0
%6 = add nuw nsw i32 %3, 1
br i1 %5, label %2, label %7
7: ; preds = %2
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int f1(int x) {
  printf("f1 received: %d\n", x);
  return x + 1;
}


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

x86 assembly (clang, -O2):
<f1>:
push   %rbx
mov    %edi,%ebx
lea    0xee6(%rip),%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
add    $0x1,%ebx
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [17 x i8] c"f1 received: %d\0A\00"
define i32 @f1(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %0)
%3 = add nsw i32 %0, 1
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int a;
  scanf("%d", &a);
  printf(a % 2 == 0 ? "even" : "odd");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
lea    0xeb7(%rip),%rdi
lea    0xeab(%rip),%rax
cmp    $0x0,%edx
cmove  %rax,%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
testb  $0x1,0x4(%rsp)
lea    0xec5(%rip),%rax
lea    0xec3(%rip),%rdi
cmove  %rax,%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [5 x i8] c"even\00"
@.str.2 = [4 x i8] c"odd\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%4 = load i32, i32* %2
%5 = srem i32 %4, 2
%6 = icmp eq i32 %5, 0
%7 = zext i1 %6 to i64
%8 = select i1 %6, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0)
%9 = call i32 @printf(i8* %8)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [5 x i8] c"even\00"
@.str.2 = [4 x i8] c"odd\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = and i32 %4, 1
%6 = icmp eq i32 %5, 0
%7 = select i1 %6, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0)
%8 = call i32 @printf(i8* dereferenceable(1) %7)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ addcpu();
int /*<<< orphan*/ printf(char *);
int main(void) {
  printf(" --- CPU --- \n");
  addcpu();
  return 0;
}


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

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

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

LLVM IR (-O2):
@str = [14 x i8] c" --- CPU --- \00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (...) @addcpu()
ret i32 0
}
int BooleanString(const char *s) { return s[0] != '\0'; }


x86 assembly (clang, -O0):
<BooleanString>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
setne  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<BooleanString>:
xor    %eax,%eax
cmpb   $0x0,(%rdi)
setne  %al
ret

LLVM IR (-O0):
define i32 @BooleanString(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 0
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = icmp ne i32 %6, 0
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @BooleanString(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp ne i8 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void print_usage(char *exec_name) {
  printf("Usage: %s <info file>\n", exec_name);
}


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

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

LLVM IR (-O0):
@.str = [23 x i8] c"Usage: %s <info file>\0A\00"
define void @print_usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [23 x i8] c"Usage: %s <info file>\0A\00"
define void @print_usage(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ strtrim_left(char *);
char *strtrim_right(int /*<<< orphan*/);
char *strtrim(char *p) { return strtrim_right(strtrim_left(p)); }


x86 assembly (clang, -O0):
<strtrim>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strtrim_left@plt>
mov    %eax,%edi
call   1030 <strtrim_right@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strtrim>:
push   %rax
call   1040 <strtrim_left@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <strtrim_right@plt>

LLVM IR (-O0):
define i8* @strtrim(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @strtrim_left(i8* %3)
%5 = call i8* @strtrim_right(i32 %4)
ret i8* %5
}

LLVM IR (-O2):
define i8* @strtrim(i8* %0) {
%2 = tail call i32 @strtrim_left(i8* %0)
%3 = tail call i8* @strtrim_right(i32 %2)
ret i8* %3
}
/* Variables and functions */
void *android_realloc(void *, size_t);
void *_android_array_realloc(void *block, size_t itemSize, size_t count) {
  return android_realloc(block, itemSize * count);
}


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

x86 assembly (clang, -O2):
<_android_array_realloc>:
imul   %rdx,%rsi
jmp    1030 <android_realloc@plt>

LLVM IR (-O0):
define i8* @_android_array_realloc(i8* %0, i64 %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i64
store i8* %0, i8** %4
store i64 %1, i64* %5
store i64 %2, i64* %6
%7 = load i8*, i8** %4
%8 = load i64, i64* %5
%9 = load i64, i64* %6
%10 = mul i64 %8, %9
%11 = call i8* @android_realloc(i8* %7, i64 %10)
ret i8* %11
}

LLVM IR (-O2):
define i8* @_android_array_realloc(i8* %0, i64 %1, i64 %2) {
%4 = mul i64 %2, %1
%5 = tail call i8* @android_realloc(i8* %0, i64 %4)
ret i8* %5
}
/* Variables and functions */
int abs(int);
int ezs_greatest_common_divisor(int, int);
int ezs_lowest_common_multiple(int a, int b) {
  return abs(a * b) / ezs_greatest_common_divisor(a, b);
}


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

x86 assembly (clang, -O2):
<ezs_lowest_common_multiple>:
push   %rbx
mov    %esi,%eax
imul   %edi,%eax
mov    %eax,%ebx
neg    %ebx
cmovs  %eax,%ebx
call   1030 <ezs_greatest_common_divisor@plt>
mov    %eax,%ecx
mov    %ebx,%eax
cltd
idiv   %ecx
pop    %rbx
ret

LLVM IR (-O0):
define i32 @ezs_lowest_common_multiple(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 = mul nsw i32 %5, %6
%8 = call i32 @abs(i32 %7)
%9 = load i32, i32* %3
%10 = load i32, i32* %4
%11 = call i32 @ezs_greatest_common_divisor(i32 %9, i32 %10)
%12 = sdiv i32 %8, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @ezs_lowest_common_multiple(i32 %0, i32 %1) {
%3 = mul nsw i32 %1, %0
%4 = tail call i32 @llvm.abs.i32(i32 %3, i1 true)
%5 = tail call i32 @ezs_greatest_common_divisor(i32 %0, i32 %1)
%6 = sdiv i32 %4, %5
ret i32 %6
}
void RTAvllU32Insert(void) {}


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

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

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

LLVM IR (-O2):
define void @RTAvllU32Insert() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ test_num_parser();
int main(int argc, char **argv) {
  test_num_parser();
  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)
mov    $0x0,%al
call   1030 <test_num_parser@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
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 (...) @test_num_parser()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @test_num_parser()
ret i32 0
}
/* Variables and functions */
scalar_t__ malloc(unsigned int);
int /*<<< orphan*/ memcpy(unsigned char *, unsigned char const *, unsigned int);
unsigned char *mem_assign(const unsigned char *value, unsigned int len) {
  unsigned char *p = (unsigned char *)malloc(len);
  if (!p)
    return NULL;
  memcpy(p, value, len);
  return p;
}


x86 assembly (clang, -O0):
<mem_assign>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x14(%rbp),%edi
call   1040 <malloc@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    1153 <mem_assign+0x33>
movq   $0x0,-0x8(%rbp)
jmp    116b <mem_assign+0x4b>
mov    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <memcpy@plt>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mem_assign>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%ebp
mov    %rdi,%r14
mov    %esi,%edi
call   1040 <malloc@plt>
test   %rax,%rax
je     1147 <mem_assign+0x27>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
mov    %ebp,%edx
call   1030 <memcpy@plt>
jmp    1149 <mem_assign+0x29>
xor    %ebx,%ebx
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define i8* @mem_assign(i8* %0, i32 %1) {
%3 = tail call i64 @malloc(i32 %1)
%4 = inttoptr i64 %3 to i8*
%5 = icmp eq i64 %3, 0
br i1 %5, label %8, label %6
6: ; preds = %2
%7 = tail call i32 @memcpy(i8* %4, i8* %0, i32 %1)
br label %8
8: ; preds = %2, %6
%9 = phi i8* [ %4, %6 ], [ null, %2 ]
ret i8* %9
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  unsigned int keycode;
};
struct TYPE_4__ {
  TYPE_1__ xkey;
};
typedef TYPE_2__ XEvent;

/* Variables and functions */
void set_XEvent_xkey_keycode(void *_p, unsigned _v) {
  ((XEvent *)_p)->xkey.keycode = (unsigned)_v;
}


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

x86 assembly (clang, -O2):
<set_XEvent_xkey_keycode>:
mov    %esi,(%rdi)
ret

LLVM IR (-O0):
%struct.TYPE_4__ = type { %struct.TYPE_3__ }
%struct.TYPE_3__ = type { i32 }
define void @set_XEvent_xkey_keycode(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to %struct.TYPE_4__*
%8 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %7, i32 0, i32 0
%9 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %8, i32 0, i32 0
store i32 %5, i32* %9
ret void
}

LLVM IR (-O2):
define void @set_XEvent_xkey_keycode(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
store i32 %1, i32* %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ util_random(int, char *);
int ILibStun_GetNextPeriodicInterval(int minVal, int maxVal) {
  char i;
  float v;
  util_random(1, (char *)&i);
  v = (float)i / (float)255;
  v = (v * (float)maxVal) + (minVal);
  return (int)v;
}


x86 assembly (clang, -O0):
<ILibStun_GetNextPeriodicInterval>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0x1,%edi
lea    -0x9(%rbp),%rsi
call   1030 <util_random@plt>
movsbl -0x9(%rbp),%eax
cvtsi2ss %eax,%xmm0
movss  0xec4(%rip),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x10(%rbp),%xmm0
cvtsi2ssl -0x8(%rbp),%xmm2
cvtsi2ssl -0x4(%rbp),%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0x10(%rbp)
cvttss2si -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ILibStun_GetNextPeriodicInterval>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
lea    0x7(%rsp),%rsi
mov    $0x1,%edi
call   1030 <util_random@plt>
movsbl 0x7(%rsp),%eax
cvtsi2ss %eax,%xmm0
divss  0xec9(%rip),%xmm0
cvtsi2ss %ebx,%xmm1
cvtsi2ss %ebp,%xmm2
mulss  %xmm0,%xmm1
addss  %xmm1,%xmm2
cvttss2si %xmm2,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @ILibStun_GetNextPeriodicInterval(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8
%6 = alloca float
store i32 %0, i32* %3
store i32 %1, i32* %4
%7 = call i32 @util_random(i32 1, i8* %5)
%8 = load i8, i8* %5
%9 = sitofp i8 %8 to float
%10 = fdiv float %9, 2.550000e+02
store float %10, float* %6
%11 = load float, float* %6
%12 = load i32, i32* %4
%13 = sitofp i32 %12 to float
%14 = load i32, i32* %3
%15 = sitofp i32 %14 to float
%16 = call float @llvm.fmuladd.f32(float %11, float %13, float %15)
store float %16, float* %6
%17 = load float, float* %6
%18 = fptosi float %17 to i32
ret i32 %18
}

LLVM IR (-O2):
define i32 @ILibStun_GetNextPeriodicInterval(i32 %0, i32 %1) {
%3 = alloca i8
%4 = call i32 @util_random(i32 1, i8* %3)
%5 = load i8, i8* %3
%6 = sitofp i8 %5 to float
%7 = fdiv float %6, 2.550000e+02
%8 = sitofp i32 %1 to float
%9 = sitofp i32 %0 to float
%10 = call float @llvm.fmuladd.f32(float %7, float %8, float %9)
%11 = fptosi float %10 to i32
ret i32 %11
}