xunge/DecIR huggingface dataset:
unsigned char base_for_binary(unsigned char b) {
  if (b == 0b0001)
    return 'a';
  if (b == 0b0010)
    return 'c';
  if (b == 0b0100)
    return 'g';
  if (b == 0b1000)
    return 't';
  return '\0';
}


x86 assembly (clang, -O0):
<base_for_binary>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x2(%rbp)
movzbl -0x2(%rbp),%eax
cmp    $0x1,%eax
jne    1120 <base_for_binary+0x20>
movb   $0x61,-0x1(%rbp)
jmp    1166 <base_for_binary+0x66>
movzbl -0x2(%rbp),%eax
cmp    $0x2,%eax
jne    1136 <base_for_binary+0x36>
movb   $0x63,-0x1(%rbp)
jmp    1166 <base_for_binary+0x66>
movzbl -0x2(%rbp),%eax
cmp    $0x4,%eax
jne    114c <base_for_binary+0x4c>
movb   $0x67,-0x1(%rbp)
jmp    1166 <base_for_binary+0x66>
movzbl -0x2(%rbp),%eax
cmp    $0x8,%eax
jne    1162 <base_for_binary+0x62>
movb   $0x74,-0x1(%rbp)
jmp    1166 <base_for_binary+0x66>
movb   $0x0,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<base_for_binary>:
add    $0xff,%dil
movzbl %dil,%edx
lea    0x0(,%rdx,8),%ecx
movabs $0x7400000067006361,%rax
shr    %cl,%rax
xor    %ecx,%ecx
cmp    $0x8,%dl
cmovae %ecx,%eax
ret

LLVM IR (-O0):
define zeroext i8 @base_for_binary(i8 zeroext %0) {
%2 = alloca i8
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = zext i8 %4 to i32
%6 = icmp eq i32 %5, 1
br i1 %6, label %7, label %8
7: ; preds = %1
store i8 97, i8* %2
br label %24
8: ; preds = %1
%9 = load i8, i8* %3
%10 = zext i8 %9 to i32
%11 = icmp eq i32 %10, 2
br i1 %11, label %12, label %13
12: ; preds = %8
store i8 99, i8* %2
br label %24
13: ; preds = %8
%14 = load i8, i8* %3
%15 = zext i8 %14 to i32
%16 = icmp eq i32 %15, 4
br i1 %16, label %17, label %18
17: ; preds = %13
store i8 103, i8* %2
br label %24
18: ; preds = %13
%19 = load i8, i8* %3
%20 = zext i8 %19 to i32
%21 = icmp eq i32 %20, 8
br i1 %21, label %22, label %23
22: ; preds = %18
store i8 116, i8* %2
br label %24
23: ; preds = %18
store i8 0, i8* %2
br label %24
24: ; preds = %23, %22, %17, %12, %7
%25 = load i8, i8* %2
ret i8 %25
}

LLVM IR (-O2):
define zeroext i8 @base_for_binary(i8 zeroext %0) {
%2 = add i8 %0, -1
%3 = icmp ult i8 %2, 8
%4 = zext i8 %2 to i64
%5 = shl nuw nsw i64 %4, 3
%6 = lshr i64 8358680910127719265, %5
%7 = trunc i64 %6 to i8
%8 = select i1 %3, i8 %7, i8 0
ret i8 %8
}
/* Type definitions */
struct t_gui_completion {
  int dummy;
};

/* Variables and functions */
char const *gui_completion_get_string(struct t_gui_completion *, char const *);
const char *hook_completion_get_string(struct t_gui_completion *completion,
                                       const char *property) {
  return gui_completion_get_string(completion, property);
}


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

x86 assembly (clang, -O2):
<hook_completion_get_string>:
jmp    1030 <gui_completion_get_string@plt>

LLVM IR (-O0):
%struct.t_gui_completion = type { i32 }
define i8* @hook_completion_get_string(%struct.t_gui_completion* %0, i8* %1) {
%3 = alloca %struct.t_gui_completion*
%4 = alloca i8*
store %struct.t_gui_completion* %0, %struct.t_gui_completion** %3
store i8* %1, i8** %4
%5 = load %struct.t_gui_completion*, %struct.t_gui_completion** %3
%6 = load i8*, i8** %4
%7 = call i8* @gui_completion_get_string(%struct.t_gui_completion* %5, i8* %6)
ret i8* %7
}

LLVM IR (-O2):
%struct.t_gui_completion = type { i32 }
define i8* @hook_completion_get_string(%struct.t_gui_completion* %0, i8* %1) {
%3 = tail call i8* @gui_completion_get_string(%struct.t_gui_completion* %0, i8* %1)
ret i8* %3
}
void Scan_Player_Net(int Player) {}


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

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

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

LLVM IR (-O2):
define void @Scan_Player_Net(i32 %0) {
ret void
}
/* Variables and functions */
long double __infer_nondet_long_double();
long double fdiml(long double x, long double y) {
  return __infer_nondet_long_double();
}


x86 assembly (clang, -O0):
<fdiml>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
fldt   0x20(%rbp)
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fstpt  -0x20(%rbp)
xor    %eax,%eax
call   1030 <__infer_nondet_long_double@plt>
fld    %st(0)
fstp   %st(0)
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define x86_fp80 @fdiml(x86_fp80 %0, x86_fp80 %1) {
%3 = alloca x86_fp80
%4 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %3
store x86_fp80 %1, x86_fp80* %4
%5 = call x86_fp80 (...) @__infer_nondet_long_double()
ret x86_fp80 %5
}

LLVM IR (-O2):
define x86_fp80 @fdiml(x86_fp80 %0, x86_fp80 %1) {
%3 = tail call x86_fp80 (...) @__infer_nondet_long_double()
ret x86_fp80 %3
}
/* Type definitions */
struct cvmx_shmem_dscptr {
  int dummy;
};

/* Variables and functions */
int __cvmx_shmem_close_standalone(struct cvmx_shmem_dscptr *, int);
int cvmx_shmem_close(struct cvmx_shmem_dscptr *dscptr, int remove) {
  int ret;
  ret = __cvmx_shmem_close_standalone(dscptr, remove);
  return ret;
}


x86 assembly (clang, -O0):
<cvmx_shmem_close>:
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 <__cvmx_shmem_close_standalone@plt>
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cvmx_shmem_close>:
jmp    1030 <__cvmx_shmem_close_standalone@plt>

LLVM IR (-O0):
%struct.cvmx_shmem_dscptr = type { i32 }
define i32 @cvmx_shmem_close(%struct.cvmx_shmem_dscptr* %0, i32 %1) {
%3 = alloca %struct.cvmx_shmem_dscptr*
%4 = alloca i32
%5 = alloca i32
store %struct.cvmx_shmem_dscptr* %0, %struct.cvmx_shmem_dscptr** %3
store i32 %1, i32* %4
%6 = load %struct.cvmx_shmem_dscptr*, %struct.cvmx_shmem_dscptr** %3
%7 = load i32, i32* %4
%8 = call i32 @__cvmx_shmem_close_standalone(%struct.cvmx_shmem_dscptr* %6, i32 %7)
store i32 %8, i32* %5
%9 = load i32, i32* %5
ret i32 %9
}

LLVM IR (-O2):
%struct.cvmx_shmem_dscptr = type { i32 }
define i32 @cvmx_shmem_close(%struct.cvmx_shmem_dscptr* %0, i32 %1) {
%3 = tail call i32 @__cvmx_shmem_close_standalone(%struct.cvmx_shmem_dscptr* %0, i32 %1)
ret i32 %3
}
/* Type definitions */
struct stat {
  int dummy;
};

/* Variables and functions */
int stat(char const *, struct stat *);
int fileExist(const char *filename) {
  struct stat buffer;
  int exist = stat(filename, &buffer);
  if (exist == 0)
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<fileExist>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1030 <stat@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
jne    1142 <fileExist+0x32>
movl   $0x1,-0x4(%rbp)
jmp    1149 <fileExist+0x39>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fileExist>:
push   %rax
mov    %rsp,%rsi
call   1030 <stat@plt>
xor    %ecx,%ecx
test   %eax,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @fileExist(i8* nocapture %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i32 @stat(i8* %0, %struct.stat* %2)
%5 = icmp eq i32 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}
double floor(double x) {
  int xi = (int)x;
  return x < xi ? xi - 1 : xi;
}


x86 assembly (clang, -O0):
<floor>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
cvttsd2si -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
movsd  -0x8(%rbp),%xmm1
cvtsi2sdl -0xc(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    1133 <floor+0x33>
mov    -0xc(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1139 <floor+0x39>
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cvtsi2sd %eax,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<floor>:
cvttsd2si %xmm0,%eax
cvttpd2dq %xmm0,%xmm1
cvtdq2pd %xmm1,%xmm1
xor    %ecx,%ecx
ucomisd %xmm0,%xmm1
seta   %cl
sub    %ecx,%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
ret

LLVM IR (-O0):
define double @floor(double %0) {
%2 = alloca double
%3 = alloca i32
store double %0, double* %2
%4 = load double, double* %2
%5 = fptosi double %4 to i32
store i32 %5, i32* %3
%6 = load double, double* %2
%7 = load i32, i32* %3
%8 = sitofp i32 %7 to double
%9 = fcmp olt double %6, %8
br i1 %9, label %10, label %13
10: ; preds = %1
%11 = load i32, i32* %3
%12 = sub nsw i32 %11, 1
br label %15
13: ; preds = %1
%14 = load i32, i32* %3
br label %15
15: ; preds = %13, %10
%16 = phi i32 [ %12, %10 ], [ %14, %13 ]
%17 = sitofp i32 %16 to double
ret double %17
}

LLVM IR (-O2):
define double @floor(double %0) {
%2 = fptosi double %0 to i32
%3 = sitofp i32 %2 to double
%4 = fcmp ogt double %3, %0
%5 = sext i1 %4 to i32
%6 = add nsw i32 %5, %2
%7 = sitofp i32 %6 to double
ret double %7
}
void Swapc(char **a, char **b) {
  char *t = *a;
  *a = *b;
  *b = t;
}


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

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

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

LLVM IR (-O2):
define void @Swapc(i8** nocapture %0, i8** nocapture %1) {
%3 = load i8*, i8** %0
%4 = load i8*, i8** %1
store i8* %4, i8** %0
store i8* %3, i8** %1
ret void
}
void byteswap(char *data, int datalen) {
  char tmp, *dest = data + datalen - 1;
  if (datalen < 2)
    return;
  while (dest > data) {
    tmp = *dest;
    *dest-- = *data;
    *data++ = tmp;
  }
}


x86 assembly (clang, -O0):
<byteswap>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
add    %rcx,%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x18(%rbp)
cmpl   $0x2,-0xc(%rbp)
jge    112d <byteswap+0x2d>
jmp    1179 <byteswap+0x79>
jmp    1132 <byteswap+0x32>
mov    -0x18(%rbp),%rax
cmp    -0x8(%rbp),%rax
jbe    1179 <byteswap+0x79>
mov    -0x18(%rbp),%rax
mov    (%rax),%al
mov    %al,-0xd(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%cl
mov    -0x18(%rbp),%rax
mov    %rax,%rdx
add    $0xffffffffffffffff,%rdx
mov    %rdx,-0x18(%rbp)
mov    %cl,(%rax)
mov    -0xd(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %cl,(%rax)
jmp    1132 <byteswap+0x32>
pop    %rbp
ret

x86 assembly (clang, -O2):
<byteswap>:
cmp    $0x2,%esi
jl     113c <byteswap+0x3c>
movslq %esi,%rax
add    %rdi,%rax
add    $0xffffffffffffffff,%rax
cmp    %rdi,%rax
jbe    113c <byteswap+0x3c>
add    $0x1,%rdi
nopl   0x0(%rax,%rax,1)
movzbl (%rax),%ecx
movzbl -0x1(%rdi),%edx
mov    %dl,(%rax)
mov    %cl,-0x1(%rdi)
add    $0xffffffffffffffff,%rax
lea    0x1(%rdi),%rcx
cmp    %rdi,%rax
mov    %rcx,%rdi
ja     1120 <byteswap+0x20>
ret

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

LLVM IR (-O2):
define void @byteswap(i8* %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = icmp sgt i32 %1, 1
%6 = getelementptr inbounds i8, i8* %4, i64 -1
%7 = icmp ugt i8* %6, %0
%8 = select i1 %5, i1 %7, i1 false
br i1 %8, label %9, label %17
9: ; preds = %2, %9
%10 = phi i8* [ %15, %9 ], [ %6, %2 ]
%11 = phi i8* [ %14, %9 ], [ %0, %2 ]
%12 = load i8, i8* %10
%13 = load i8, i8* %11
store i8 %13, i8* %10
%14 = getelementptr inbounds i8, i8* %11, i64 1
store i8 %12, i8* %11
%15 = getelementptr inbounds i8, i8* %10, i64 -1
%16 = icmp ugt i8* %15, %14
br i1 %16, label %9, label %17
17: ; preds = %9, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void sig(int num) { printf("you pressed ctrl+c\n"); }


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

x86 assembly (clang, -O2):
<sig>:
lea    0xee9(%rip),%rdi
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [20 x i8] c"you pressed ctrl+c\0A\00"
define void @sig(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [19 x i8] c"you pressed ctrl+c\00"
define void @sig(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str, i64 0, i64 0))
ret void
}
void DefaultIntHandler(void) {
  while (1) {
  }
}


x86 assembly (clang, -O0):
<DefaultIntHandler>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <DefaultIntHandler+0x9>
jmp    1109 <DefaultIntHandler+0x9>

x86 assembly (clang, -O2):
<DefaultIntHandler>:
jmp    1100 <DefaultIntHandler>

LLVM IR (-O0):
define void @DefaultIntHandler() {
br label %1
1: ; preds = %0, %1
br label %1
}

LLVM IR (-O2):
define void @DefaultIntHandler() {
br label %1
1: ; preds = %0, %1
br label %1
}
/* Variables and functions */
int rand();
volatile int random_range(int min, int max) {
  volatile int r = 0;
  r = rand() % (max + 1 - min) + min;
  return r;
}


x86 assembly (clang, -O0):
<random_range>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
mov    -0x8(%rbp),%ecx
add    $0x1,%ecx
sub    -0x4(%rbp),%ecx
cltd
idiv   %ecx
add    -0x4(%rbp),%edx
mov    %edx,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<random_range>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
movl   $0x0,0x4(%rsp)
xor    %eax,%eax
call   1030 <rand@plt>
sub    %ebp,%ebx
add    $0x1,%ebx
cltd
idiv   %ebx
add    %ebp,%edx
mov    %edx,0x4(%rsp)
mov    0x4(%rsp),%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @random_range(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
store volatile i32 0, i32* %5
%6 = call i32 (...) @rand()
%7 = load i32, i32* %4
%8 = add nsw i32 %7, 1
%9 = load i32, i32* %3
%10 = sub nsw i32 %8, %9
%11 = srem i32 %6, %10
%12 = load i32, i32* %3
%13 = add nsw i32 %11, %12
store volatile i32 %13, i32* %5
%14 = load volatile i32, i32* %5
ret i32 %14
}

LLVM IR (-O2):
define i32 @random_range(i32 %0, i32 %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
store volatile i32 0, i32* %3
%5 = tail call i32 (...) @rand()
%6 = sub i32 1, %0
%7 = add i32 %6, %1
%8 = srem i32 %5, %7
%9 = add nsw i32 %8, %0
store volatile i32 %9, i32* %3
%10 = load volatile i32, i32* %3
ret i32 %10
}
char bissex(int annee) {
  if (!(annee & 0x0003)) {
    if (annee % 100 == 0) {
      if (annee % 400 == 0)
        return 1;
    } else
      return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<bissex>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
and    $0x3,%eax
cmp    $0x0,%eax
jne    115a <bissex+0x5a>
mov    -0x8(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    114c <bissex+0x4c>
mov    -0x8(%rbp),%eax
mov    $0x190,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1147 <bissex+0x47>
movb   $0x1,-0x1(%rbp)
jmp    115e <bissex+0x5e>
jmp    1155 <bissex+0x55>
movb   $0x1,-0x1(%rbp)
jmp    115e <bissex+0x5e>
jmp    115a <bissex+0x5a>
movb   $0x0,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bissex>:
test   $0x3,%dil
jne    1140 <bissex+0x40>
imul   $0xc28f5c29,%edi,%ecx
add    $0x51eb850,%ecx
ror    $0x2,%ecx
mov    $0x1,%al
cmp    $0x28f5c28,%ecx
ja     1142 <bissex+0x42>
movslq %edi,%rcx
imul   $0x51eb851f,%rcx,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x27,%rcx
add    %edx,%ecx
imul   $0x190,%ecx,%ecx
sub    %ecx,%edi
je     1142 <bissex+0x42>
xor    %eax,%eax
ret

LLVM IR (-O0):
define signext i8 @bissex(i32 %0) {
%2 = alloca i8
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = and i32 %4, 3
%6 = icmp ne i32 %5, 0
br i1 %6, label %19, label %7
7: ; preds = %1
%8 = load i32, i32* %3
%9 = srem i32 %8, 100
%10 = icmp eq i32 %9, 0
br i1 %10, label %11, label %17
11: ; preds = %7
%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
store i8 1, i8* %2
br label %20
16: ; preds = %11
br label %18
17: ; preds = %7
store i8 1, i8* %2
br label %20
18: ; preds = %16
br label %19
19: ; preds = %18, %1
store i8 0, i8* %2
br label %20
20: ; preds = %19, %17, %15
%21 = load i8, i8* %2
ret i8 %21
}

LLVM IR (-O2):
define signext i8 @bissex(i32 %0) {
%2 = and i32 %0, 3
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %10
4: ; preds = %1
%5 = srem i32 %0, 100
%6 = icmp ne i32 %5, 0
%7 = srem i32 %0, 400
%8 = icmp eq i32 %7, 0
%9 = or i1 %6, %8
br i1 %9, label %11, label %10
10: ; preds = %4, %1
br label %11
11: ; preds = %4, %10
%12 = phi i8 [ 0, %10 ], [ 1, %4 ]
ret i8 %12
}
/* Variables and functions */
int /*<<< orphan*/ lcd_send_byte(int /*<<< orphan*/, int);
void lcd_cursor_vb(short visible, short blink) {
  lcd_send_byte(0, 0xC | (visible << 1) | blink);
}


x86 assembly (clang, -O0):
<lcd_cursor_vb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %si,%ax
mov    %di,%cx
mov    %cx,-0x2(%rbp)
mov    %ax,-0x4(%rbp)
movswl -0x2(%rbp),%esi
shl    $0x1,%esi
or     $0xc,%esi
movswl -0x4(%rbp),%eax
or     %eax,%esi
xor    %edi,%edi
call   1030 <lcd_send_byte@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lcd_cursor_vb>:
lea    (%rdi,%rdi,1),%eax
or     %eax,%esi
or     $0xc,%esi
xor    %edi,%edi
jmp    1030 <lcd_send_byte@plt>

LLVM IR (-O0):
define void @lcd_cursor_vb(i16 signext %0, i16 signext %1) {
%3 = alloca i16
%4 = alloca i16
store i16 %0, i16* %3
store i16 %1, i16* %4
%5 = load i16, i16* %3
%6 = sext i16 %5 to i32
%7 = shl i32 %6, 1
%8 = or i32 12, %7
%9 = load i16, i16* %4
%10 = sext i16 %9 to i32
%11 = or i32 %8, %10
%12 = call i32 @lcd_send_byte(i32 0, i32 %11)
ret void
}

LLVM IR (-O2):
define void @lcd_cursor_vb(i16 signext %0, i16 signext %1) {
%3 = sext i16 %0 to i32
%4 = shl nsw i32 %3, 1
%5 = or i16 %1, 12
%6 = sext i16 %5 to i32
%7 = or i32 %4, %6
%8 = tail call i32 @lcd_send_byte(i32 0, i32 %7)
ret void
}
/* Variables and functions */
int ZLIBH_inflate(unsigned char *, unsigned char const *);
int ZLIBH_decompress(char *dest, const char *compressed) {
  const unsigned char *ip = (const unsigned char *)compressed;
  unsigned char *op = (unsigned char *)dest;
  int input_used_so_far;
  input_used_so_far = ZLIBH_inflate(op, ip);
  return input_used_so_far;
}


x86 assembly (clang, -O0):
<ZLIBH_decompress>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <ZLIBH_inflate@plt>
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ZLIBH_decompress>:
jmp    1030 <ZLIBH_inflate@plt>

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

LLVM IR (-O2):
define i32 @ZLIBH_decompress(i8* %0, i8* %1) {
%3 = tail call i32 @ZLIBH_inflate(i8* %0, i8* %1)
ret i32 %3
}
int return_int_negative_one() { return -1; }


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

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

LLVM IR (-O0):
define i32 @return_int_negative_one() {
ret i32 -1
}

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

/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
void oferror(FILE *f) {
  printf("file error\n");
  exit(2);
}


x86 assembly (clang, -O0):
<oferror>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xecd(%rip),%rdi
call   1030 <printf@plt>
mov    $0x2,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<oferror>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
mov    $0x2,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"file error\0A\00"
define void @oferror(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @exit(i32 2)
unreachable
}

LLVM IR (-O2):
@str = [11 x i8] c"file error\00"
define void @oferror(i32* nocapture readnone %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 2)
unreachable
}
/* Variables and functions */
char getchar();
int /*<<< orphan*/ getline(char **, size_t *, int /*<<< orphan*/);
int /*<<< orphan*/ stdin;
char getcharnow(void) {
  static char *garbage = NULL;
  static size_t garbage_len;
  char c = getchar();
  getline(&garbage, &garbage_len, stdin);
  return c;
}


x86 assembly (clang, -O0):
<getcharnow>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <getchar@plt>
mov    %al,-0x1(%rbp)
mov    0x2eaf(%rip),%rax
mov    (%rax),%edx
lea    0x2ef6(%rip),%rdi
lea    0x2ef7(%rip),%rsi
call   1040 <getline@plt>
movsbl -0x1(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getcharnow>:
push   %rbx
xor    %eax,%eax
call   1030 <getchar@plt>
mov    %eax,%ebx
mov    0x2eb7(%rip),%rax
mov    (%rax),%edx
lea    0x2efe(%rip),%rdi
lea    0x2eff(%rip),%rsi
call   1040 <getline@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@getcharnow.garbage = internal global i8* null
@getcharnow.garbage_len = internal global i64 0
@stdin = global i32 0
define signext i8 @getcharnow() {
%1 = alloca i8
%2 = call signext i8 (...) @getchar()
store i8 %2, i8* %1
%3 = load i32, i32* @stdin
%4 = call i32 @getline(i8** @getcharnow.garbage, i64* @getcharnow.garbage_len, i32 %3)
%5 = load i8, i8* %1
ret i8 %5
}

LLVM IR (-O2):
@getcharnow.garbage = internal global i8* null
@getcharnow.garbage_len = internal global i64 0
@stdin = global i32 0
define signext i8 @getcharnow() {
%1 = tail call signext i8 (...) @getchar()
%2 = load i32, i32* @stdin
%3 = tail call i32 @getline(i8** @getcharnow.garbage, i64* @getcharnow.garbage_len, i32 %2)
ret i8 %1
}
/* Variables and functions */
int foo();
int __attribute__((no_instrument_function)) no_instrument(void) {
  return foo();
}


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

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

LLVM IR (-O0):
define i32 @no_instrument() {
%1 = call i32 (...) @foo()
ret i32 %1
}

LLVM IR (-O2):
define i32 @no_instrument() {
%1 = tail call i32 (...) @foo()
ret i32 %1
}
/* Variables and functions */
size_t codesize(size_t argc) {
  if (argc <= 6) {
    return (argc * 10) + 7 + 1;
  } else {
    return 8 + 60 + ((argc - 6) * 16) + 7 + 2;
  }
}


x86 assembly (clang, -O0):
<codesize>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
cmpq   $0x6,-0x10(%rbp)
ja     1129 <codesize+0x29>
imul   $0xa,-0x10(%rbp),%rax
add    $0x7,%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1145 <codesize+0x45>
mov    -0x10(%rbp),%rax
sub    $0x6,%rax
shl    $0x4,%rax
add    $0x44,%rax
add    $0x7,%rax
add    $0x2,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<codesize>:
mov    %rdi,%rcx
shl    $0x4,%rcx
add    $0xffffffffffffffed,%rcx
cmp    $0x7,%rdi
lea    (%rdi,%rdi,4),%rax
lea    0x8(%rax,%rax,1),%rax
cmovae %rcx,%rax
ret

LLVM IR (-O0):
define i64 @codesize(i64 %0) {
%2 = alloca i64
%3 = alloca i64
store i64 %0, i64* %3
%4 = load i64, i64* %3
%5 = icmp ule i64 %4, 6
br i1 %5, label %6, label %11
6: ; preds = %1
%7 = load i64, i64* %3
%8 = mul i64 %7, 10
%9 = add i64 %8, 7
%10 = add i64 %9, 1
store i64 %10, i64* %2
br label %18
11: ; preds = %1
%12 = load i64, i64* %3
%13 = sub i64 %12, 6
%14 = mul i64 %13, 16
%15 = add i64 68, %14
%16 = add i64 %15, 7
%17 = add i64 %16, 2
store i64 %17, i64* %2
br label %18
18: ; preds = %11, %6
%19 = load i64, i64* %2
ret i64 %19
}

LLVM IR (-O2):
define i64 @codesize(i64 %0) {
%2 = icmp ult i64 %0, 7
%3 = mul i64 %0, 10
%4 = add i64 %3, 8
%5 = shl i64 %0, 4
%6 = add i64 %5, -19
%7 = select i1 %2, i64 %4, i64 %6
ret i64 %7
}
/* Variables and functions */
int abs(int);
int isreach_pawn(int, int);
int isreach_silver(int dx, int dy) {
  if (abs(dx) == abs(dy) && abs(dx) == 1)
    return 1;
  else
    return isreach_pawn(dx, dy);
}


x86 assembly (clang, -O0):
<isreach_silver>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <abs@plt>
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%edi
call   1030 <abs@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
cmp    %ecx,%eax
jne    116b <isreach_silver+0x4b>
mov    -0x8(%rbp),%edi
call   1030 <abs@plt>
cmp    $0x1,%eax
jne    116b <isreach_silver+0x4b>
movl   $0x1,-0x4(%rbp)
jmp    1179 <isreach_silver+0x59>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1040 <isreach_pawn@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isreach_silver>:
mov    %edi,%ecx
neg    %ecx
cmovs  %edi,%ecx
mov    %esi,%eax
neg    %eax
cmovs  %esi,%eax
cmp    $0x1,%ecx
jne    112e <isreach_silver+0x1e>
cmp    $0x1,%eax
jne    112e <isreach_silver+0x1e>
mov    $0x1,%eax
ret
jmp    1030 <isreach_pawn@plt>

LLVM IR (-O0):
define i32 @isreach_silver(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 = call i32 @abs(i32 %6)
%8 = load i32, i32* %5
%9 = call i32 @abs(i32 %8)
%10 = icmp eq i32 %7, %9
br i1 %10, label %11, label %16
11: ; preds = %2
%12 = load i32, i32* %4
%13 = call i32 @abs(i32 %12)
%14 = icmp eq i32 %13, 1
br i1 %14, label %15, label %16
15: ; preds = %11
store i32 1, i32* %3
br label %20
16: ; preds = %11, %2
%17 = load i32, i32* %4
%18 = load i32, i32* %5
%19 = call i32 @isreach_pawn(i32 %17, i32 %18)
store i32 %19, i32* %3
br label %20
20: ; preds = %16, %15
%21 = load i32, i32* %3
ret i32 %21
}

LLVM IR (-O2):
define i32 @isreach_silver(i32 %0, i32 %1) {
%3 = tail call i32 @llvm.abs.i32(i32 %0, i1 true)
%4 = tail call i32 @llvm.abs.i32(i32 %1, i1 true)
%5 = icmp eq i32 %3, 1
%6 = icmp eq i32 %4, 1
%7 = and i1 %5, %6
br i1 %7, label %10, label %8
8: ; preds = %2
%9 = tail call i32 @isreach_pawn(i32 %0, i32 %1)
br label %10
10: ; preds = %2, %8
%11 = phi i32 [ %9, %8 ], [ 1, %2 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
void *realloc(void *, size_t const);
void *expr_realloc(void *maddr, const size_t segsize) {
  maddr = realloc(maddr, segsize);
  if (maddr == NULL) {
    printf("ERROR: no memory! Exiting...\n");
    exit(1);
  }
  return maddr;
}


x86 assembly (clang, -O0):
<expr_realloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <realloc@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1172 <expr_realloc+0x42>
lea    0xe9d(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<expr_realloc>:
push   %rax
call   1040 <realloc@plt>
test   %rax,%rax
je     113d <expr_realloc+0xd>
pop    %rcx
ret
lea    0xebc(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [30 x i8] c"ERROR: no memory! Exiting...\0A\00"
define i8* @expr_realloc(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i8*, i8** %3
%6 = load i64, i64* %4
%7 = call i8* @realloc(i8* %5, i64 %6)
store i8* %7, i8** %3
%8 = load i8*, i8** %3
%9 = icmp eq i8* %8, null
br i1 %9, label %10, label %13
10: ; preds = %2
%11 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
%12 = call i32 @exit(i32 1)
unreachable
13: ; preds = %2
%14 = load i8*, i8** %3
ret i8* %14
}

LLVM IR (-O2):
@str = [29 x i8] c"ERROR: no memory! Exiting...\00"
define noalias i8* @expr_realloc(i8* nocapture %0, i64 %1) {
%3 = tail call i8* @realloc(i8* %0, i64 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %8
5: ; preds = %2
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @str, i64 0, i64 0))
%7 = tail call i32 @exit(i32 1)
unreachable
8: ; preds = %2
ret i8* %3
}
double to_radians(const double x) {
  return ((x) * (3.141592653589793)) / 180.0;
}


x86 assembly (clang, -O0):
<to_radians>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  0xef7(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  0xee2(%rip),%xmm1
divsd  %xmm1,%xmm0
pop    %rbp
ret

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

LLVM IR (-O0):
define double @to_radians(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fmul double %3, 0x400921FB54442D18
%5 = fdiv double %4, 1.800000e+02
ret double %5
}

LLVM IR (-O2):
define double @to_radians(double %0) {
%2 = fmul double %0, 0x400921FB54442D18
%3 = fdiv double %2, 1.800000e+02
ret double %3
}
/* Type definitions */
typedef int /*<<< orphan*/ reqbuf;

/* Variables and functions */
int ph_rpc(char *);
int /*<<< orphan*/ snprintf(char *, int, char *, unsigned long, int,
                            char const *);
int phLinePlaceCall(int vlid, const char *uri, void *userData, int rcid) {
  char reqbuf[1000];
  snprintf(reqbuf, sizeof(reqbuf), "CALL VLID=%d UDATA=%08lx RCID=%d TO=%s",
           (unsigned long)userData, rcid, uri);
  return ph_rpc(reqbuf);
}


x86 assembly (clang, -O0):
<phLinePlaceCall>:
push   %rbp
mov    %rsp,%rbp
sub    $0x410,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
lea    -0x410(%rbp),%rdi
mov    -0x18(%rbp),%rcx
mov    -0x1c(%rbp),%r8d
mov    -0x10(%rbp),%r9
mov    $0x3e8,%esi
lea    0xea8(%rip),%rdx
call   1030 <snprintf@plt>
lea    -0x410(%rbp),%rdi
call   1040 <ph_rpc@plt>
add    $0x410,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<phLinePlaceCall>:
push   %rbx
sub    $0x3f0,%rsp
mov    %ecx,%r8d
mov    %rdx,%rcx
mov    %rsi,%r9
lea    0xec8(%rip),%rdx
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x3e8,%esi
call   1030 <snprintf@plt>
mov    %rbx,%rdi
call   1040 <ph_rpc@plt>
add    $0x3f0,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [39 x i8] c"CALL VLID=%d UDATA=%08lx RCID=%d TO=%s\00"
define i32 @phLinePlaceCall(i32 %0, i8* %1, i8* %2, i32 %3) {
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i32
%9 = alloca [1000 x i8]
store i32 %0, i32* %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store i32 %3, i32* %8
%10 = getelementptr inbounds [1000 x i8], [1000 x i8]* %9, i64 0, i64 0
%11 = load i8*, i8** %7
%12 = ptrtoint i8* %11 to i64
%13 = load i32, i32* %8
%14 = load i8*, i8** %6
%15 = call i32 @snprintf(i8* %10, i32 1000, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i64 %12, i32 %13, i8* %14)
%16 = getelementptr inbounds [1000 x i8], [1000 x i8]* %9, i64 0, i64 0
%17 = call i32 @ph_rpc(i8* %16)
ret i32 %17
}

LLVM IR (-O2):
@.str = [39 x i8] c"CALL VLID=%d UDATA=%08lx RCID=%d TO=%s\00"
define i32 @phLinePlaceCall(i32 %0, i8* %1, i8* %2, i32 %3) {
%5 = alloca [1000 x i8]
%6 = getelementptr inbounds [1000 x i8], [1000 x i8]* %5, i64 0, i64 0
%7 = ptrtoint i8* %2 to i64
%8 = call i32 @snprintf(i8* %6, i32 1000, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i64 %7, i32 %3, i8* %1)
%9 = call i32 @ph_rpc(i8* %6)
ret i32 %9
}
int fun528() { return 528; }


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

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

LLVM IR (-O0):
define i32 @fun528() {
ret i32 528
}

LLVM IR (-O2):
define i32 @fun528() {
ret i32 528
}
int fib_rec(int n) {
  if (n <= 1) {
    return n;
  } else {
    return fib_rec(n - 1) + fib_rec(n - 2);
  }
}


x86 assembly (clang, -O0):
<fib_rec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
jg     1130 <fib_rec+0x20>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1153 <fib_rec+0x43>
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
call   1030 <fib_rec@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
sub    $0x2,%edi
call   1030 <fib_rec@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fib_rec>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
xor    %ebp,%ebp
cmp    $0x2,%edi
jge    1120 <fib_rec+0x10>
mov    %ebx,%ecx
jmp    1144 <fib_rec+0x34>
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
lea    -0x1(%rbx),%edi
call   1030 <fib_rec@plt>
lea    -0x2(%rbx),%ecx
add    %eax,%ebp
cmp    $0x3,%ebx
mov    %ecx,%ebx
ja     1130 <fib_rec+0x20>
add    %ecx,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @fib_rec(i32 %0) {
%2 = icmp slt i32 %0, 2
br i1 %2, label %11, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %8, %3 ], [ %0, %1 ]
%5 = phi i32 [ %9, %3 ], [ 0, %1 ]
%6 = add nsw i32 %4, -1
%7 = tail call i32 @fib_rec(i32 %6)
%8 = add nsw i32 %4, -2
%9 = add nsw i32 %7, %5
%10 = icmp ult i32 %4, 4
br i1 %10, label %11, label %3
11: ; preds = %3, %1
%12 = phi i32 [ 0, %1 ], [ %9, %3 ]
%13 = phi i32 [ %0, %1 ], [ %8, %3 ]
%14 = add nsw i32 %13, %12
ret i32 %14
}
/* Type definitions */
typedef int /*<<< orphan*/ va_list;

/* Variables and functions */
double atof(char *);
char *get_next_arg(int /*<<< orphan*/ *, char *);
double get_next_argd(va_list *t, char *opt) {
  char *tmp = get_next_arg(t, opt);
  return atof(tmp);
}


x86 assembly (clang, -O0):
<get_next_argd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <get_next_arg@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <atof@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_next_argd>:
push   %rax
call   1040 <get_next_arg@plt>
mov    %rax,%rdi
pop    %rax
jmp    1030 <atof@plt>

LLVM IR (-O0):
define double @get_next_argd(i32* %0, i8* %1) {
%3 = alloca i32*
%4 = alloca i8*
%5 = alloca i8*
store i32* %0, i32** %3
store i8* %1, i8** %4
%6 = load i32*, i32** %3
%7 = load i8*, i8** %4
%8 = call i8* @get_next_arg(i32* %6, i8* %7)
store i8* %8, i8** %5
%9 = load i8*, i8** %5
%10 = call double @atof(i8* %9)
ret double %10
}

LLVM IR (-O2):
define double @get_next_argd(i32* %0, i8* %1) {
%3 = tail call i8* @get_next_arg(i32* %0, i8* %1)
%4 = tail call double @atof(i8* %3)
ret double %4
}
int calc_pof2_exp(int pof2) { return (__builtin_clz(pof2) ^ 31U); }


x86 assembly (clang, -O0):
<calc_pof2_exp>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
bsr    %eax,%eax
xor    $0x1f,%eax
xor    $0x1f,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<calc_pof2_exp>:
bsr    %edi,%eax
ret

LLVM IR (-O0):
define i32 @calc_pof2_exp(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @llvm.ctlz.i32(i32 %3, i1 true)
%5 = xor i32 %4, 31
ret i32 %5
}

LLVM IR (-O2):
define i32 @calc_pof2_exp(i32 %0) {
%2 = tail call i32 @llvm.ctlz.i32(i32 %0, i1 true)
%3 = xor i32 %2, 31
ret i32 %3
}
/* Type definitions */
typedef scalar_t__ uint8_t;

/* Variables and functions */
void WidgetMutexInit(uint8_t *pi8Mutex) {
  ;
  *pi8Mutex = 0;
}


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

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

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

LLVM IR (-O2):
define void @WidgetMutexInit(i64* nocapture writeonly %0) {
store i64 0, i64* %0
ret void
}
/* Variables and functions */
float expf(float);
void __hv_exp_f(float bIn, float *bOut) { *bOut = expf(bIn); }


x86 assembly (clang, -O0):
<__hv_exp_f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
mov    %rdi,-0x10(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <expf@plt>
mov    -0x10(%rbp),%rax
movss  %xmm0,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__hv_exp_f>:
push   %rbx
mov    %rdi,%rbx
call   1030 <expf@plt>
movss  %xmm0,(%rbx)
pop    %rbx
ret

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

LLVM IR (-O2):
define void @__hv_exp_f(float %0, float* nocapture writeonly %1) {
%3 = tail call float @expf(float %0)
store float %3, float* %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EX_USAGE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  (void)fprintf(stderr, "usage: mkdir [-pv] [-m mode] directory ...\n");
  exit(EX_USAGE);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2ea8(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    0x2eb0(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2eab(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [44 x i8] c"usage: mkdir [-pv] [-m mode] directory ...\0A\00"
@EX_USAGE = global i32 0
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @EX_USAGE
%4 = call i32 @exit(i32 %3)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [44 x i8] c"usage: mkdir [-pv] [-m mode] directory ...\0A\00"
@EX_USAGE = global i32 0
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @EX_USAGE
%4 = tail call i32 @exit(i32 %3)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ write_instr(int);
void eval_eq(void) { write_instr(0x17); }


x86 assembly (clang, -O0):
<eval_eq>:
push   %rbp
mov    %rsp,%rbp
mov    $0x17,%edi
call   1030 <write_instr@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<eval_eq>:
mov    $0x17,%edi
jmp    1030 <write_instr@plt>

LLVM IR (-O0):
define void @eval_eq() {
%1 = call i32 @write_instr(i32 23)
ret void
}

LLVM IR (-O2):
define void @eval_eq() {
%1 = tail call i32 @write_instr(i32 23)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ strncpy(char *, char *, int);
void getGraphNameFromFileName(char *fn, char *buf) {
  strncpy(buf, fn, 120 - 1);
}


x86 assembly (clang, -O0):
<getGraphNameFromFileName>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    $0x77,%edx
call   1030 <strncpy@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getGraphNameFromFileName>:
mov    %rdi,%rax
mov    %rsi,%rdi
mov    %rax,%rsi
mov    $0x77,%edx
jmp    1030 <strncpy@plt>

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

LLVM IR (-O2):
define void @getGraphNameFromFileName(i8* %0, i8* %1) {
%3 = tail call i32 @strncpy(i8* %1, i8* %0, i32 119)
ret void
}
/* Variables and functions */
int check_arg_count(int, int /*<<< orphan*/);
int /*<<< orphan*/ killchar();
int /*<<< orphan*/ report_count(int);
int /*<<< orphan*/ report_int(int /*<<< orphan*/);
void cmd_killchar(int nargs, char **args) {
  if (check_arg_count(nargs, 0) == 1)
    return;
  report_count(1);
  report_int(killchar());
}


x86 assembly (clang, -O0):
<cmd_killchar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
xor    %esi,%esi
call   1030 <check_arg_count@plt>
cmp    $0x1,%eax
jne    1167 <cmd_killchar+0x27>
jmp    117f <cmd_killchar+0x3f>
mov    $0x1,%edi
call   1040 <report_count@plt>
mov    $0x0,%al
call   1050 <killchar@plt>
mov    %eax,%edi
call   1060 <report_int@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmd_killchar>:
push   %rax
xor    %esi,%esi
call   1030 <check_arg_count@plt>
cmp    $0x1,%eax
jne    114f <cmd_killchar+0xf>
pop    %rax
ret
mov    $0x1,%edi
call   1040 <report_count@plt>
xor    %eax,%eax
call   1050 <killchar@plt>
mov    %eax,%edi
pop    %rax
jmp    1060 <report_int@plt>

LLVM IR (-O0):
define void @cmd_killchar(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = load i32, i32* %3
%6 = call i32 @check_arg_count(i32 %5, i32 0)
%7 = icmp eq i32 %6, 1
br i1 %7, label %8, label %9
8: ; preds = %2
br label %13
9: ; preds = %2
%10 = call i32 @report_count(i32 1)
%11 = call i32 (...) @killchar()
%12 = call i32 @report_int(i32 %11)
br label %13
13: ; preds = %9, %8
ret void
}

LLVM IR (-O2):
define void @cmd_killchar(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @check_arg_count(i32 %0, i32 0)
%4 = icmp eq i32 %3, 1
br i1 %4, label %9, label %5
5: ; preds = %2
%6 = tail call i32 @report_count(i32 1)
%7 = tail call i32 (...) @killchar()
%8 = tail call i32 @report_int(i32 %7)
br label %9
9: ; preds = %2, %5
ret void
}
/* Variables and functions */
double sqrt(int);
double wurzel(int zahl) { return sqrt(zahl); }


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

x86 assembly (clang, -O2):
<wurzel>:
jmp    1030 <sqrt@plt>

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

LLVM IR (-O2):
define double @wurzel(i32 %0) {
%2 = tail call double @sqrt(i32 %0)
ret double %2
}
unsigned char numberof_encoder(int number) {
  int coded_number;
  coded_number = (unsigned char)(0xC2 + number * 4);
  if (coded_number > 0xfe)
    coded_number = 0xfe;
  return coded_number;
}


x86 assembly (clang, -O0):
<numberof_encoder>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x2,%eax
add    $0xc2,%eax
movzbl %al,%eax
mov    %eax,-0x8(%rbp)
cmpl   $0xfe,-0x8(%rbp)
jle    112c <numberof_encoder+0x2c>
movl   $0xfe,-0x8(%rbp)
mov    -0x8(%rbp),%eax
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<numberof_encoder>:
lea    0x0(,%rdi,4),%eax
add    $0xc2,%al
ret

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

LLVM IR (-O2):
define zeroext i8 @numberof_encoder(i32 %0) {
%2 = trunc i32 %0 to i8
%3 = shl i8 %2, 2
%4 = add i8 %3, -62
ret i8 %4
}
int assemble2le(char *p) { return (p[0] | (p[1] << 8)); }


x86 assembly (clang, -O0):
<assemble2le>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
mov    -0x8(%rbp),%rcx
movsbl 0x1(%rcx),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<assemble2le>:
movsbl (%rdi),%ecx
movsbl 0x1(%rdi),%eax
shl    $0x8,%eax
or     %ecx,%eax
ret

LLVM IR (-O0):
define i32 @assemble2le(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 = load i8*, i8** %2
%8 = getelementptr inbounds i8, i8* %7, i64 1
%9 = load i8, i8* %8
%10 = sext i8 %9 to i32
%11 = shl i32 %10, 8
%12 = or i32 %6, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @assemble2le(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = sext i8 %2 to i32
%4 = getelementptr inbounds i8, i8* %0, i64 1
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = shl nsw i32 %6, 8
%8 = or i32 %7, %3
ret i32 %8
}