xunge/DecIR huggingface dataset:
char get_hexdigit(int number) {
  const char lookup[] = "0123456789abcdef";
  return lookup[number];
}


x86 assembly (clang, -O0):
<get_hexdigit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    0xef2(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xeef(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xeed(%rip),%al
mov    %al,-0x10(%rbp)
movslq -0x4(%rbp),%rax
movsbl -0x20(%rbp,%rax,1),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_hexdigit>:
movslq %edi,%rax
lea    0xef6(%rip),%rcx
mov    (%rax,%rcx,1),%al
ret

LLVM IR (-O0):
@__const.get_hexdigit.lookup = [17 x i8] c"0123456789abcdef\00"
define signext i8 @get_hexdigit(i32 %0) {
%2 = alloca i32
%3 = alloca [17 x i8]
store i32 %0, i32* %2
%4 = bitcast [17 x i8]* %3 to i8*
%5 = load i32, i32* %2
%6 = sext i32 %5 to i64
%7 = getelementptr inbounds [17 x i8], [17 x i8]* %3, i64 0, i64 %6
%8 = load i8, i8* %7
ret i8 %8
}

LLVM IR (-O2):
@__const.get_hexdigit.lookup = [17 x i8] c"0123456789abcdef\00"
define signext i8 @get_hexdigit(i32 %0) {
%2 = sext i32 %0 to i64
%3 = getelementptr inbounds [17 x i8], [17 x i8]* @__const.get_hexdigit.lookup, i64 0, i64 %2
%4 = load i8, i8* %3
ret i8 %4
}
void cpybig(int *x, int *y) {
  int i;
  for (i = 0; i <= y[0]; i++)
    x[i] = y[i];
}


x86 assembly (clang, -O0):
<cpybig>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0x10(%rbp),%rcx
cmp    (%rcx),%eax
jg     1146 <cpybig+0x46>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1113 <cpybig+0x13>
pop    %rbp
ret

x86 assembly (clang, -O2):
<cpybig>:
mov    (%rsi),%eax
test   %eax,%eax
js     1124 <cpybig+0x24>
mov    %eax,(%rdi)
cmpl   $0x0,(%rsi)
jle    1124 <cpybig+0x24>
xor    %eax,%eax
nop
mov    0x4(%rsi,%rax,4),%ecx
mov    %ecx,0x4(%rdi,%rax,4)
movslq (%rsi),%rcx
add    $0x1,%rax
cmp    %rcx,%rax
jl     1110 <cpybig+0x10>
ret

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

LLVM IR (-O2):
define void @cpybig(i32* nocapture writeonly %0, i32* nocapture %1) {
%3 = load i32, i32* %1
%4 = icmp slt i32 %3, 0
br i1 %4, label %17, label %5
5: ; preds = %2
store i32 %3, i32* %0
%6 = load i32, i32* %1
%7 = icmp sgt i32 %6, 0
br i1 %7, label %8, label %17
8: ; preds = %5, %8
%9 = phi i64 [ %13, %8 ], [ 1, %5 ]
%10 = getelementptr inbounds i32, i32* %1, i64 %9
%11 = load i32, i32* %10
%12 = getelementptr inbounds i32, i32* %0, i64 %9
store i32 %11, i32* %12
%13 = add nuw nsw i64 %9, 1
%14 = load i32, i32* %1
%15 = sext i32 %14 to i64
%16 = icmp slt i64 %9, %15
br i1 %16, label %8, label %17
17: ; preds = %8, %5, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_wifidirect_cfg_capability_usage(void) {
  printf(
      "Usage : wifidirect_capability [<DeviceCapability> <GroupCapability>]\n");
  printf("For 'set' both DeviceCapability and GroupCapability should be "
         "provided.\n");
  printf("If no parameter is specified,'get' is performed.\n");
  return;
}


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

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

LLVM IR (-O0):
@.str = [70 x i8] c"Usage : wifidirect_capability [<DeviceCapability> <GroupCapability>]\0A\00"
@.str.1 = [73 x i8] c"For 'set' both DeviceCapability and GroupCapability should be provided.\0A\00"
@.str.2 = [50 x i8] c"If no parameter is specified,'get' is performed.\0A\00"
define void @print_wifidirect_cfg_capability_usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([70 x i8], [70 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([73 x i8], [73 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [69 x i8] c"Usage : wifidirect_capability [<DeviceCapability> <GroupCapability>]\00"
@str.3 = [72 x i8] c"For 'set' both DeviceCapability and GroupCapability should be provided.\00"
@str.4 = [49 x i8] c"If no parameter is specified,'get' is performed.\00"
define void @print_wifidirect_cfg_capability_usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([69 x i8], [69 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([72 x i8], [72 x i8]* @str.3, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([49 x i8], [49 x i8]* @str.4, i64 0, i64 0))
ret void
}
void delay_ms(unsigned int ms) {
  unsigned int i = 1000;
  while (ms--) {
    while (i--)
      ;
  }
}


x86 assembly (clang, -O0):
<delay_ms>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x3e8,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x4(%rbp)
cmp    $0x0,%eax
je     1145 <delay_ms+0x45>
jmp    1127 <delay_ms+0x27>
mov    -0x8(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x8(%rbp)
cmp    $0x0,%eax
je     1140 <delay_ms+0x40>
jmp    1127 <delay_ms+0x27>
jmp    110e <delay_ms+0xe>
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @delay_ms(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ runAllTests_sort();
int main(void) {
  runAllTests_sort();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @runAllTests_sort()
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ int64_t;

/* Variables and functions */
int /*<<< orphan*/ memcpy(int /*<<< orphan*/ *, char const *, int);
int64_t read_int6(const char *buf) {
  int64_t tmp = 0;
  memcpy(&tmp, buf, 6);
  return tmp;
}


x86 assembly (clang, -O0):
<read_int6>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdi
mov    $0x6,%edx
call   1030 <memcpy@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_int6>:
push   %rax
mov    %rdi,%rsi
movl   $0x0,0x4(%rsp)
lea    0x4(%rsp),%rdi
mov    $0x6,%edx
call   1030 <memcpy@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @read_int6(i8* %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
store i32 0, i32* %2
%4 = call i32 @memcpy(i32* %2, i8* %0, i32 6)
%5 = load i32, i32* %2
ret i32 %5
}
/* Type definitions */
struct timeval {
  scalar_t__ tv_usec;
  scalar_t__ tv_sec;
};

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


x86 assembly (clang, -O0):
<util_timestamp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
cvtsi2sdq -0x8(%rbp),%xmm0
cvtsi2sdq -0x10(%rbp),%xmm1
movsd  0xec7(%rip),%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<util_timestamp>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
cvtsi2sdq 0x10(%rsp),%xmm1
cvtsi2sdq 0x8(%rsp),%xmm0
divsd  0xeca(%rip),%xmm0
addsd  %xmm1,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timeval = type { i64, i64 }
define double @util_timestamp() {
%1 = alloca %struct.timeval
%2 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%3 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%4 = load i64, i64* %3
%5 = sitofp i64 %4 to double
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%7 = load i64, i64* %6
%8 = sitofp i64 %7 to double
%9 = fdiv double %8, 1.000000e+06
%10 = fadd double %5, %9
ret double %10
}

LLVM IR (-O2):
%struct.timeval = type { i64, i64 }
define double @util_timestamp() {
%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 1
%5 = load i64, i64* %4
%6 = sitofp i64 %5 to double
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%8 = load i64, i64* %7
%9 = sitofp i64 %8 to double
%10 = fdiv double %9, 1.000000e+06
%11 = fadd double %10, %6
ret double %11
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_context_set_default_source() {
  printf("NOT IMPLEMENTED:"
         "pa_context_set_default_source"
         "\n");
}


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

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

LLVM IR (-O0):
@.str = [47 x i8] c"NOT IMPLEMENTED:pa_context_set_default_source\0A\00"
define i32 @pa_context_set_default_source() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [46 x i8] c"NOT IMPLEMENTED:pa_context_set_default_source\00"
define i32 @pa_context_set_default_source() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([46 x i8], [46 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
int get(int a[1000], int pos) {
  int tmp = a[pos];
  return tmp;
}


x86 assembly (clang, -O0):
<get>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get>:
movslq %esi,%rax
mov    (%rdi,%rax,4),%eax
ret

LLVM IR (-O0):
define i32 @get(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%6 = load i32*, i32** %3
%7 = load i32, i32* %4
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i32, i32* %6, i64 %8
%10 = load i32, i32* %9
store i32 %10, i32* %5
%11 = load i32, i32* %5
ret i32 %11
}

LLVM IR (-O2):
define i32 @get(i32* nocapture %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = getelementptr inbounds i32, i32* %0, i64 %3
%5 = load i32, i32* %4
ret i32 %5
}
int isgraph(int c) {
  return (c >= 0x21 && c <= 0x7E) || (c >= 0xA1 && c <= 0xFF);
}


x86 assembly (clang, -O0):
<isgraph>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x21,-0x4(%rbp)
jl     1120 <isgraph+0x20>
mov    $0x1,%al
cmpl   $0x7e,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jle    1145 <isgraph+0x45>
xor    %eax,%eax
cmpl   $0xa1,-0x4(%rbp)
mov    %al,-0x6(%rbp)
jl     113f <isgraph+0x3f>
cmpl   $0xff,-0x4(%rbp)
setle  %al
mov    %al,-0x6(%rbp)
mov    -0x6(%rbp),%al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isgraph>:
lea    -0x21(%rdi),%eax
cmp    $0x5e,%eax
setb   %al
add    $0xffffff5f,%edi
cmp    $0x5f,%edi
setb   %cl
or     %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @isgraph(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 33
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 126
br i1 %7, label %16, label %8
8: ; preds = %5, %1
%9 = load i32, i32* %2
%10 = icmp sge i32 %9, 161
br i1 %10, label %11, label %14
11: ; preds = %8
%12 = load i32, i32* %2
%13 = icmp sle i32 %12, 255
br label %14
14: ; preds = %11, %8
%15 = phi i1 [ false, %8 ], [ %13, %11 ]
br label %16
16: ; preds = %14, %5
%17 = phi i1 [ true, %5 ], [ %15, %14 ]
%18 = zext i1 %17 to i32
ret i32 %18
}

LLVM IR (-O2):
define i32 @isgraph(i32 %0) {
%2 = add i32 %0, -33
%3 = icmp ult i32 %2, 94
%4 = add i32 %0, -161
%5 = icmp ult i32 %4, 95
%6 = or i1 %3, %5
%7 = zext i1 %6 to i32
ret i32 %7
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ SEEK_SET;
int /*<<< orphan*/ fseek(int /*<<< orphan*/ *, int, int /*<<< orphan*/);
int /*<<< orphan*/ fwrite(short *, int, int, int /*<<< orphan*/ *);
int fatCorrupted(int fatPos, FILE *file) {
  fseek(file, fatPos + 10, SEEK_SET);
  short cl[3] = {255, 255, 255};
  fwrite(cl, sizeof(short), 3, file);
  return 1;
}


x86 assembly (clang, -O0):
<fatCorrupted>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x4(%rbp),%esi
add    $0xa,%esi
mov    0x2ea0(%rip),%rax
mov    (%rax),%edx
call   1030 <fseek@plt>
mov    0xeb3(%rip),%eax
mov    %eax,-0x16(%rbp)
mov    0xead(%rip),%ax
mov    %ax,-0x12(%rbp)
lea    -0x16(%rbp),%rdi
mov    -0x10(%rbp),%rcx
mov    $0x2,%esi
mov    $0x3,%edx
call   1040 <fwrite@plt>
mov    $0x1,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fatCorrupted>:
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%rbx
lea    0xa(%rdi),%esi
mov    0x2eae(%rip),%rax
mov    (%rax),%edx
mov    %rbx,%rdi
call   1030 <fseek@plt>
movzwl 0xec1(%rip),%eax
mov    %ax,0xc(%rsp)
mov    0xeb2(%rip),%eax
mov    %eax,0x8(%rsp)
lea    0x8(%rsp),%rdi
mov    $0x2,%esi
mov    $0x3,%edx
mov    %rbx,%rcx
call   1040 <fwrite@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@SEEK_SET = global i32 0
@__const.fatCorrupted.cl = [3 x i16] [i16 255, i16 255, i16 255]
define i32 @fatCorrupted(i32 %0, i32* %1) {
%3 = alloca i32
%4 = alloca i32*
%5 = alloca [3 x i16]
store i32 %0, i32* %3
store i32* %1, i32** %4
%6 = load i32*, i32** %4
%7 = load i32, i32* %3
%8 = add nsw i32 %7, 10
%9 = load i32, i32* @SEEK_SET
%10 = call i32 @fseek(i32* %6, i32 %8, i32 %9)
%11 = bitcast [3 x i16]* %5 to i8*
%12 = getelementptr inbounds [3 x i16], [3 x i16]* %5, i64 0, i64 0
%13 = load i32*, i32** %4
%14 = call i32 @fwrite(i16* %12, i32 2, i32 3, i32* %13)
ret i32 1
}

LLVM IR (-O2):
@SEEK_SET = global i32 0
@__const.fatCorrupted.cl = [3 x i16] [i16 255, i16 255, i16 255]
define i32 @fatCorrupted(i32 %0, i32* nocapture %1) {
%3 = alloca [3 x i16]
%4 = add nsw i32 %0, 10
%5 = load i32, i32* @SEEK_SET
%6 = tail call i32 @fseek(i32* %1, i32 %4, i32 %5)
%7 = bitcast [3 x i16]* %3 to i8*
%8 = getelementptr inbounds [3 x i16], [3 x i16]* %3, i64 0, i64 0
%9 = call i32 @fwrite(i16* %8, i32 2, i32 3, i32* %1)
ret i32 1
}
int maximum(int a, int b, int c) {
  int k;
  if (a <= b)
    k = b;
  else
    k = a;
  if (k <= c)
    return (c);
  else
    return (k);
}


x86 assembly (clang, -O0):
<maximum>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jg     1124 <maximum+0x24>
mov    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
jmp    112a <maximum+0x2a>
mov    -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x10(%rbp),%eax
jg     1141 <maximum+0x41>
mov    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1147 <maximum+0x47>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<maximum>:
mov    %esi,%eax
cmp    %esi,%edi
cmovg  %edi,%eax
cmp    %edx,%eax
cmovle %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @maximum(i32 %0, i32 %1, i32 %2) {
%4 = icmp sgt i32 %0, %1
%5 = select i1 %4, i32 %0, i32 %1
%6 = icmp sgt i32 %5, %2
%7 = select i1 %6, i32 %5, i32 %2
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ ft_freechar2(char **);
int free_split(char ***tmp, int ret) {
  if (tmp && *tmp)
    ft_freechar2(*tmp);
  *tmp = NULL;
  return (ret);
}


x86 assembly (clang, -O0):
<free_split>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1144 <free_split+0x34>
mov    -0x8(%rbp),%rax
cmpq   $0x0,(%rax)
je     1144 <free_split+0x34>
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
call   1030 <ft_freechar2@plt>
mov    -0x8(%rbp),%rax
movq   $0x0,(%rax)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_split>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
test   %rdi,%rdi
je     112a <free_split+0x1a>
mov    (%rbx),%rdi
test   %rdi,%rdi
je     112a <free_split+0x1a>
call   1030 <ft_freechar2@plt>
movq   $0x0,(%rbx)
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @free_split(i8*** %0, i32 returned %1) {
%3 = icmp eq i8*** %0, null
br i1 %3, label %9, label %4
4: ; preds = %2
%5 = load i8**, i8*** %0
%6 = icmp eq i8** %5, null
br i1 %6, label %9, label %7
7: ; preds = %4
%8 = tail call i32 @ft_freechar2(i8** %5)
br label %9
9: ; preds = %7, %4, %2
store i8** null, i8*** %0
ret i32 %1
}
long main() {
  double dub;
  dub = 5;
  dub = -dub;
  dub = +dub;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movsd  0xef4(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

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

LLVM IR (-O0):
define i64 @main() {
%1 = alloca i64
%2 = alloca double
store double 5.000000e+00, double* %2
%3 = load double, double* %2
%4 = fneg double %3
store double %4, double* %2
%5 = load double, double* %2
store double %5, double* %2
%6 = load i64, i64* %1
ret i64 %6
}

LLVM IR (-O2):
define i64 @main() {
ret i64 undef
}
/* Variables and functions */
float fastlog2(float);
float fastlog(float x) { return 0.69314718f * fastlog2(x); }


x86 assembly (clang, -O0):
<fastlog>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <fastlog2@plt>
movaps %xmm0,%xmm1
movss  0xece(%rip),%xmm0
mulss  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fastlog>:
push   %rax
call   1030 <fastlog2@plt>
mulss  0xee2(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @fastlog(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call float @fastlog2(float %3)
%5 = fmul float 0x3FE62E4300000000, %4
ret float %5
}

LLVM IR (-O2):
define float @fastlog(float %0) {
%2 = tail call float @fastlog2(float %0)
%3 = fmul float %2, 0x3FE62E4300000000
ret float %3
}
/* Variables and functions */
int /*<<< orphan*/ print_wrong_lib_msg();
void _Jv_RegisterClasses() { print_wrong_lib_msg(); }


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

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

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

LLVM IR (-O2):
define void @_Jv_RegisterClasses() {
%1 = tail call i32 (...) @print_wrong_lib_msg()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void die(char *reason, int exit_code) {
  fprintf(stderr, "%s\n", reason);
  exit(exit_code);
}


x86 assembly (clang, -O0):
<die>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    0x2eaa(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xebd(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0xc(%rbp),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<die>:
push   %rbx
mov    %esi,%ebx
mov    %rdi,%rdx
mov    0x2eb3(%rip),%rax
mov    (%rax),%edi
lea    0xeca(%rip),%rsi
call   1030 <fprintf@plt>
mov    %ebx,%edi
call   1040 <exit@plt>

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

LLVM IR (-O2):
@stderr = global i32 0
@.str = [4 x i8] c"%s\0A\00"
define void @die(i8* %0, i32 %1) {
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
%5 = tail call i32 @exit(i32 %1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ strlcpy(char *, char const *, size_t);
int strlen(char const *);
char *xmalloc(size_t);
char *xstrndup(const char *str, size_t size) {
  size_t len;
  char *cp;
  len = strlen(str) + 1;
  if (size < len)
    len = size;
  cp = xmalloc(len);
  strlcpy(cp, str, len);
  return cp;
}


x86 assembly (clang, -O0):
<xstrndup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
add    $0x1,%eax
cltq
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
jae    1168 <xstrndup+0x38>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <xmalloc@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1050 <strlcpy@plt>
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xstrndup>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r15
mov    %rdi,%r14
call   1030 <strlen@plt>
add    $0x1,%eax
movslq %eax,%rbx
cmp    %r15,%rbx
cmova  %r15,%rbx
mov    %rbx,%rdi
call   1040 <xmalloc@plt>
mov    %rax,%r15
mov    %rax,%rdi
mov    %r14,%rsi
mov    %rbx,%rdx
call   1050 <strlcpy@plt>
mov    %r15,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i8* @xstrndup(i8* %0, i64 %1) {
%3 = tail call i32 @strlen(i8* %0)
%4 = add nsw i32 %3, 1
%5 = sext i32 %4 to i64
%6 = icmp ugt i64 %5, %1
%7 = select i1 %6, i64 %1, i64 %5
%8 = tail call i8* @xmalloc(i64 %7)
%9 = tail call i32 @strlcpy(i8* %8, i8* %0, i64 %7)
ret i8* %8
}
/* Variables and functions */
int /*<<< orphan*/ print(char *, int);
void signal_handler(int sig) { print("signal_handler: sig=%d\n", sig); }


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

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

LLVM IR (-O0):
@.str = [24 x i8] c"signal_handler: sig=%d\0A\00"
define void @signal_handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @print(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 %3)
ret void
}

LLVM IR (-O2):
@.str = [24 x i8] c"signal_handler: sig=%d\0A\00"
define void @signal_handler(i32 %0) {
%2 = tail call i32 @print(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
/* Variables and functions */
int exp(double);
double cosh(double x) { return (exp(x) + exp(-x)) / 2; }


x86 assembly (clang, -O0):
<cosh>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <exp@plt>
mov    %eax,-0xc(%rbp)
movsd  -0x8(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
call   1030 <exp@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cvtsi2sd %eax,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cosh>:
push   %rbx
sub    $0x10,%rsp
movaps %xmm0,(%rsp)
call   1030 <exp@plt>
mov    %eax,%ebx
movaps (%rsp),%xmm0
xorps  0xed5(%rip),%xmm0
call   1030 <exp@plt>
add    %ebx,%eax
mov    %eax,%ecx
shr    $0x1f,%ecx
add    %eax,%ecx
sar    %ecx
xorps  %xmm0,%xmm0
cvtsi2sd %ecx,%xmm0
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define double @cosh(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call i32 @exp(double %3)
%5 = load double, double* %2
%6 = fneg double %5
%7 = call i32 @exp(double %6)
%8 = add nsw i32 %4, %7
%9 = sdiv i32 %8, 2
%10 = sitofp i32 %9 to double
ret double %10
}

LLVM IR (-O2):
define double @cosh(double %0) {
%2 = tail call i32 @exp(double %0)
%3 = fneg double %0
%4 = tail call i32 @exp(double %3)
%5 = add nsw i32 %4, %2
%6 = sdiv i32 %5, 2
%7 = sitofp i32 %6 to double
ret double %7
}
/* Variables and functions */
int /*<<< orphan*/ print_foo();
int main() {
  print_foo();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @print_foo()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ strcmp(char const *, char const *);
int match(const char *a, const char *b) {
  if (a == b)
    return 1;
  if (!a || !b)
    return 0;
  return !strcmp(a, b);
}


x86 assembly (clang, -O0):
<match>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
jne    113a <match+0x2a>
movl   $0x1,-0x4(%rbp)
jmp    1179 <match+0x69>
cmpq   $0x0,-0x10(%rbp)
je     1150 <match+0x40>
cmpq   $0x0,-0x18(%rbp)
jne    115c <match+0x4c>
movl   $0x0,-0x4(%rbp)
jmp    1179 <match+0x69>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<match>:
cmp    %rsi,%rdi
je     1135 <match+0x25>
xor    %eax,%eax
test   %rdi,%rdi
je     1134 <match+0x24>
test   %rsi,%rsi
je     1134 <match+0x24>
push   %rax
call   1030 <strcmp@plt>
mov    %eax,%ecx
xor    %eax,%eax
test   %ecx,%ecx
sete   %al
add    $0x8,%rsp
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @match(i8* %0, i8* %1) {
%3 = icmp eq i8* %0, %1
br i1 %3, label %12, label %4
4: ; preds = %2
%5 = icmp ne i8* %0, null
%6 = icmp ne i8* %1, null
%7 = and i1 %5, %6
br i1 %7, label %8, label %12
8: ; preds = %4
%9 = tail call i32 @strcmp(i8* %0, i8* %1)
%10 = icmp eq i32 %9, 0
%11 = zext i1 %10 to i32
br label %12
12: ; preds = %4, %2, %8
%13 = phi i32 [ %11, %8 ], [ 1, %2 ], [ 0, %4 ]
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ sscanf(char *, char *, char *);
char *get_flag(char *flag, char *map_result) {
  sscanf(map_result, "%*s%s", flag);
  return flag;
}


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

x86 assembly (clang, -O2):
<get_flag>:
push   %rbx
mov    %rsi,%rax
mov    %rdi,%rbx
lea    0xee2(%rip),%rsi
mov    %rax,%rdi
mov    %rbx,%rdx
call   1030 <sscanf@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"%*s%s\00"
define i8* @get_flag(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 @sscanf(i8* %5, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %6)
%8 = load i8*, i8** %3
ret i8* %8
}

LLVM IR (-O2):
@.str = [6 x i8] c"%*s%s\00"
define i8* @get_flag(i8* returned %0, i8* nocapture %1) {
%3 = tail call i32 @sscanf(i8* %1, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %0)
ret i8* %0
}
float funciondoble(float b) {
  float a;
  a = 2 * b;
  return a;
}


x86 assembly (clang, -O0):
<funciondoble>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  0xeef(%rip),%xmm0
mulss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<funciondoble>:
addss  %xmm0,%xmm0
ret

LLVM IR (-O0):
define float @funciondoble(float %0) {
%2 = alloca float
%3 = alloca float
store float %0, float* %2
%4 = load float, float* %2
%5 = fmul float 2.000000e+00, %4
store float %5, float* %3
%6 = load float, float* %3
ret float %6
}

LLVM IR (-O2):
define float @funciondoble(float %0) {
%2 = fmul float %0, 2.000000e+00
ret float %2
}
/* Variables and functions */
int /*<<< orphan*/ sscanf(char *, char *, char *);
char *get_pos(char *pos_temp, char *map_result) {
  sscanf(map_result, "%*s%*s%s", pos_temp);
  return pos_temp;
}


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

x86 assembly (clang, -O2):
<get_pos>:
push   %rbx
mov    %rsi,%rax
mov    %rdi,%rbx
lea    0xee2(%rip),%rsi
mov    %rax,%rdi
mov    %rbx,%rdx
call   1030 <sscanf@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [9 x i8] c"%*s%*s%s\00"
define i8* @get_pos(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 @sscanf(i8* %5, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* %6)
%8 = load i8*, i8** %3
ret i8* %8
}

LLVM IR (-O2):
@.str = [9 x i8] c"%*s%*s%s\00"
define i8* @get_pos(i8* returned %0, i8* nocapture %1) {
%3 = tail call i32 @sscanf(i8* %1, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* %0)
ret i8* %0
}
void P_memoryinit() {}


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

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

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

LLVM IR (-O2):
define void @P_memoryinit() {
ret void
}
__attribute__((always_)) int BUZZZ_NULL_FUNC(void) { return (0); }


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

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

LLVM IR (-O0):
define i32 @BUZZZ_NULL_FUNC() {
ret i32 0
}

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

/* Variables and functions */
int /*<<< orphan*/ *fopen(char const *, char *);
int /*<<< orphan*/ *stderr;
FILE *verifierFichierErreur(const char *nom_fichier) {
  FILE *fichier = NULL;
  if (nom_fichier != NULL)
    fichier = fopen(nom_fichier, "w+");
  else
    fichier = stderr;
  return fichier;
}


x86 assembly (clang, -O0):
<verifierFichierErreur>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1148 <verifierFichierErreur+0x38>
mov    -0x8(%rbp),%rdi
lea    0xec6(%rip),%rsi
call   1030 <fopen@plt>
mov    %rax,-0x10(%rbp)
jmp    1156 <verifierFichierErreur+0x46>
mov    0x2e91(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<verifierFichierErreur>:
test   %rdi,%rdi
je     1121 <verifierFichierErreur+0x11>
lea    0xee4(%rip),%rsi
jmp    1030 <fopen@plt>
mov    0x2eb8(%rip),%rax
mov    (%rax),%rax
ret

LLVM IR (-O0):
@.str = [3 x i8] c"w+\00"
@stderr = global i32* null
define i32* @verifierFichierErreur(i8* %0) {
%2 = alloca i8*
%3 = alloca i32*
store i8* %0, i8** %2
store i32* null, i32** %3
%4 = load i8*, i8** %2
%5 = icmp ne i8* %4, null
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load i8*, i8** %2
%8 = call i32* @fopen(i8* %7, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
store i32* %8, i32** %3
br label %11
9: ; preds = %1
%10 = load i32*, i32** @stderr
store i32* %10, i32** %3
br label %11
11: ; preds = %9, %6
%12 = load i32*, i32** %3
ret i32* %12
}

LLVM IR (-O2):
@.str = [3 x i8] c"w+\00"
@stderr = global i32* null
define i32* @verifierFichierErreur(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
br label %7
5: ; preds = %1
%6 = load i32*, i32** @stderr
br label %7
7: ; preds = %5, %3
%8 = phi i32* [ %4, %3 ], [ %6, %5 ]
ret i32* %8
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ strlen(char const *);
int write(int, char const *, int /*<<< orphan*/);
int fputs(const char *s, FILE *stream) {
  return write(((int)stream), s, strlen(s));
}


x86 assembly (clang, -O0):
<fputs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x1c(%rbp),%edi
mov    -0x18(%rbp),%rsi
mov    %eax,%edx
call   1030 <write@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @fputs(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 = ptrtoint i32* %5 to i32
%7 = load i8*, i8** %3
%8 = load i8*, i8** %3
%9 = call i32 @strlen(i8* %8)
%10 = call i32 @write(i32 %6, i8* %7, i32 %9)
ret i32 %10
}

LLVM IR (-O2):
define i32 @fputs(i8* %0, i32* %1) {
%3 = ptrtoint i32* %1 to i64
%4 = trunc i64 %3 to i32
%5 = tail call i32 @strlen(i8* %0)
%6 = tail call i32 @write(i32 %4, i8* %0, i32 %5)
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ free(unsigned long long *);
void C_Utils_free_ulonglong_ptr(unsigned long long *item) { free(item); }


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

x86 assembly (clang, -O2):
<C_Utils_free_ulonglong_ptr>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @C_Utils_free_ulonglong_ptr(i64* nocapture %0) {
%2 = tail call i32 @free(i64* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_SUCCESS;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ test_basic();
int /*<<< orphan*/ test_nist_api();
int /*<<< orphan*/ test_nist_api_KAT();
int main(void) {
  test_basic();
  test_nist_api();
  test_nist_api_KAT();
  printf("\n\n!!!Hello onboard security!!!\n");
  exit(EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1070 <test_basic@plt>
mov    $0x0,%al
call   1050 <test_nist_api@plt>
mov    $0x0,%al
call   1040 <test_nist_api_KAT@plt>
lea    0xe85(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e59(%rip),%rax
mov    (%rax),%edi
call   1060 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1070 <test_basic@plt>
xor    %eax,%eax
call   1050 <test_nist_api@plt>
xor    %eax,%eax
call   1040 <test_nist_api_KAT@plt>
lea    0xe93(%rip),%rdi
call   1030 <puts@plt>
mov    0x2e67(%rip),%rax
mov    (%rax),%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@.str = [32 x i8] c"\0A\0A!!!Hello onboard security!!!\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @test_basic()
%3 = call i32 (...) @test_nist_api()
%4 = call i32 (...) @test_nist_api_KAT()
%5 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
%6 = load i32, i32* @EXIT_SUCCESS
%7 = call i32 @exit(i32 %6)
unreachable
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
@str = [31 x i8] c"\0A\0A!!!Hello onboard security!!!\00"
define i32 @main() {
%1 = tail call i32 (...) @test_basic()
%2 = tail call i32 (...) @test_nist_api()
%3 = tail call i32 (...) @test_nist_api_KAT()
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @str, i64 0, i64 0))
%5 = load i32, i32* @EXIT_SUCCESS
%6 = tail call i32 @exit(i32 %5)
unreachable
}
int iso_week_days(yday, wday)
int yday;
int wday;
{
  int big_enough_multiple_of_7 = (-(-366) / 7 + 2) * 7;
  return (yday - (yday - wday + 4 + big_enough_multiple_of_7) % 7 + 4 - 1);
}


x86 assembly (clang, -O0):
<iso_week_days>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x17a,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
sub    -0x8(%rbp),%eax
add    $0x4,%eax
add    -0xc(%rbp),%eax
mov    $0x7,%ecx
cltd
idiv   %ecx
mov    -0x10(%rbp),%eax
sub    %edx,%eax
add    $0x4,%eax
sub    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<iso_week_days>:
mov    %edi,%eax
sub    %esi,%eax
mov    %eax,%ecx
add    $0x17e,%ecx
movslq %ecx,%rcx
imul   $0xffffffff92492493,%rcx,%rdx
shr    $0x20,%rdx
add    %edx,%eax
add    $0x17e,%eax
mov    %eax,%edx
shr    $0x1f,%edx
sar    $0x2,%eax
add    %edx,%eax
lea    0x0(,%rax,8),%edx
sub    %eax,%edx
sub    %ecx,%edx
lea    (%rdi,%rdx,1),%eax
add    $0x3,%eax
ret

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

LLVM IR (-O2):
define i32 @iso_week_days(i32 %0, i32 %1) {
%3 = add i32 %0, 382
%4 = sub i32 %3, %1
%5 = srem i32 %4, 7
%6 = add i32 %0, 3
%7 = sub i32 %6, %5
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int /*<<< orphan*/);
void bar(void) {
  int x;
  printf("%d\n", x++);
}


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define void @bar() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 undef)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_antcfg_usage(void) {
  printf("\nUsage : antcfg [<TX_MODE> <RX_MODE>]\n");
  printf("\n         MODE    : 1       - Antenna A");
  printf("\n                   2       - Antenna B");
  printf("\n                   3       - Antenna A+B");
  printf("\n                   empty   - Get current antenna settings\n");
  return;
}


x86 assembly (clang, -O0):
<print_antcfg_usage>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
lea    0xf00(%rip),%rdi
call   1030 <printf@plt>
lea    0xf1c(%rip),%rdi
call   1030 <printf@plt>
lea    0xf38(%rip),%rdi
call   1030 <printf@plt>
lea    0xf56(%rip),%rdi
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_antcfg_usage>:
push   %rax
lea    0xf52(%rip),%rdi
call   1030 <puts@plt>
lea    0xecc(%rip),%rdi
call   1040 <printf@plt>
lea    0xee8(%rip),%rdi
call   1040 <printf@plt>
lea    0xf04(%rip),%rdi
call   1040 <printf@plt>
lea    0xf48(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [39 x i8] c"\0AUsage : antcfg [<TX_MODE> <RX_MODE>]\0A\00"
@.str.1 = [40 x i8] c"\0A MODE : 1 - Antenna A\00"
@.str.2 = [40 x i8] c"\0A 2 - Antenna B\00"
@.str.3 = [42 x i8] c"\0A 3 - Antenna A+B\00"
@.str.4 = [60 x i8] c"\0A empty - Get current antenna settings\0A\00"
define void @print_antcfg_usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.3, i64 0, i64 0))
%5 = call i32 @printf(i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str.4, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str.1 = [40 x i8] c"\0A MODE : 1 - Antenna A\00"
@.str.2 = [40 x i8] c"\0A 2 - Antenna B\00"
@.str.3 = [42 x i8] c"\0A 3 - Antenna A+B\00"
@str = [38 x i8] c"\0AUsage : antcfg [<TX_MODE> <RX_MODE>]\00"
@str.5 = [59 x i8] c"\0A empty - Get current antenna settings\00"
define void @print_antcfg_usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @.str.2, i64 0, i64 0))
%4 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @.str.3, i64 0, i64 0))
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([59 x i8], [59 x i8]* @str.5, i64 0, i64 0))
ret void
}