xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, char *);
void trap(char arg[]) {
  printf("TRAP (%s)\n", arg);
  exit(1);
}


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

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

LLVM IR (-O0):
@.str = [11 x i8] c"TRAP (%s)\0A\00"
define void @trap(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [11 x i8] c"TRAP (%s)\0A\00"
define void @trap(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Type definitions */
typedef int /*<<< orphan*/ GLubyte;

/* Variables and functions */
int /*<<< orphan*/ vmwPutPixel(int, int, int, int /*<<< orphan*/ *);
int vmwDrawHLine(int x, int y, int run, int color, GLubyte *target) {
  int i;
  for (i = 0; i < run; i++) {
    vmwPutPixel(x + i, y, color, target);
  }
  return 0;
}


x86 assembly (clang, -O0):
<vmwDrawHLine>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    115e <vmwDrawHLine+0x4e>
mov    -0x4(%rbp),%edi
add    -0x1c(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x18(%rbp),%rcx
call   1030 <vmwPutPixel@plt>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    112f <vmwDrawHLine+0x1f>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vmwDrawHLine>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
test   %edx,%edx
jle    1148 <vmwDrawHLine+0x38>
mov    %r8,%r14
mov    %ecx,%r15d
mov    %edx,%ebx
mov    %esi,%r12d
mov    %edi,%ebp
nopl   0x0(%rax)
mov    %ebp,%edi
mov    %r12d,%esi
mov    %r15d,%edx
mov    %r14,%rcx
call   1030 <vmwPutPixel@plt>
add    $0x1,%ebp
add    $0xffffffff,%ebx
jne    1130 <vmwDrawHLine+0x20>
xor    %eax,%eax
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @vmwDrawHLine(i32 %0, i32 %1, i32 %2, i32 %3, i32* %4) {
%6 = icmp sgt i32 %2, 0
br i1 %6, label %7, label %13
7: ; preds = %5, %7
%8 = phi i32 [ %11, %7 ], [ 0, %5 ]
%9 = add nsw i32 %8, %0
%10 = tail call i32 @vmwPutPixel(i32 %9, i32 %1, i32 %3, i32* %4)
%11 = add nuw nsw i32 %8, 1
%12 = icmp eq i32 %11, %2
br i1 %12, label %13, label %7
13: ; preds = %7, %5
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ cpc_key_press(int);
int /*<<< orphan*/ cpc_key_unpress(int);
void Joy_Cursor_Fire3(int value) {
  if (value) {
    cpc_key_press(0x17);
  } else {
    cpc_key_unpress(0x17);
  };
}


x86 assembly (clang, -O0):
<Joy_Cursor_Fire3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1144 <Joy_Cursor_Fire3+0x24>
mov    $0x17,%edi
call   1030 <cpc_key_press@plt>
jmp    114e <Joy_Cursor_Fire3+0x2e>
mov    $0x17,%edi
call   1040 <cpc_key_unpress@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Joy_Cursor_Fire3>:
test   %edi,%edi
je     112e <Joy_Cursor_Fire3+0xe>
mov    $0x17,%edi
jmp    1030 <cpc_key_press@plt>
mov    $0x17,%edi
jmp    1040 <cpc_key_unpress@plt>

LLVM IR (-O0):
define void @Joy_Cursor_Fire3(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ne i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = call i32 @cpc_key_press(i32 23)
br label %9
7: ; preds = %1
%8 = call i32 @cpc_key_unpress(i32 23)
br label %9
9: ; preds = %7, %5
ret void
}

LLVM IR (-O2):
define void @Joy_Cursor_Fire3(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @cpc_key_press(i32 23)
br label %7
5: ; preds = %1
%6 = tail call i32 @cpc_key_unpress(i32 23)
br label %7
7: ; preds = %5, %3
ret void
}
/* Variables and functions */
int rand();
int random(int a, int b) { return a + rand() % (b - a + 1); }


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

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

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

LLVM IR (-O2):
define i32 @random(i32 %0, i32 %1) {
%3 = tail call i32 (...) @rand()
%4 = sub i32 1, %0
%5 = add i32 %4, %1
%6 = srem i32 %3, %5
%7 = add nsw i32 %6, %0
ret i32 %7
}
/* Type definitions */
struct gdbserv {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ gdbserv_output_char(struct gdbserv *, int /*<<< orphan*/);
int /*<<< orphan*/ gdbserv_to_hex(int);
void gdbserv_output_nibble(struct gdbserv *gdbserv, int h) {
  gdbserv_output_char(gdbserv, gdbserv_to_hex(h));
}


x86 assembly (clang, -O0):
<gdbserv_output_nibble>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%edi
call   1030 <gdbserv_to_hex@plt>
mov    -0x18(%rbp),%rdi
mov    %eax,%esi
call   1040 <gdbserv_output_char@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gdbserv_output_nibble>:
push   %rbx
mov    %rdi,%rbx
mov    %esi,%edi
call   1030 <gdbserv_to_hex@plt>
mov    %rbx,%rdi
mov    %eax,%esi
pop    %rbx
jmp    1040 <gdbserv_output_char@plt>

LLVM IR (-O0):
%struct.gdbserv = type { i32 }
define void @gdbserv_output_nibble(%struct.gdbserv* %0, i32 %1) {
%3 = alloca %struct.gdbserv*
%4 = alloca i32
store %struct.gdbserv* %0, %struct.gdbserv** %3
store i32 %1, i32* %4
%5 = load %struct.gdbserv*, %struct.gdbserv** %3
%6 = load i32, i32* %4
%7 = call i32 @gdbserv_to_hex(i32 %6)
%8 = call i32 @gdbserv_output_char(%struct.gdbserv* %5, i32 %7)
ret void
}

LLVM IR (-O2):
%struct.gdbserv = type { i32 }
define void @gdbserv_output_nibble(%struct.gdbserv* %0, i32 %1) {
%3 = tail call i32 @gdbserv_to_hex(i32 %1)
%4 = tail call i32 @gdbserv_output_char(%struct.gdbserv* %0, i32 %3)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, char const *,
                           char const *, char const *);
void icon_print(FILE *out, const char *alt, const char *icon,
                const char *title) {
  fprintf(
      out,
      "<img alt=\"%s\" title=\"%s\" src=\"/img/19x19/%s.gif\" width=\"19\" "
      "height=\"19\" border=\"0\" align=\"middle\" hspace=\"0\" vspace=\"0\">",
      alt, title, icon);
}


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

x86 assembly (clang, -O2):
<icon_print>:
mov    %rdx,%r8
mov    %rsi,%rdx
lea    0xee3(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@.str = [121 x i8] c"<img alt=\22%s\22 title=\22%s\22 src=\22/img/19x19/%s.gif\22 width=\2219\22 height=\2219\22 border=\220\22 align=\22middle\22 hspace=\220\22 vspace=\220\22>\00"
define void @icon_print(i32* %0, i8* %1, i8* %2, i8* %3) {
%5 = alloca i32*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
store i32* %0, i32** %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store i8* %3, i8** %8
%9 = load i32*, i32** %5
%10 = load i8*, i8** %6
%11 = load i8*, i8** %8
%12 = load i8*, i8** %7
%13 = call i32 @fprintf(i32* %9, i8* getelementptr inbounds ([121 x i8], [121 x i8]* @.str, i64 0, i64 0), i8* %10, i8* %11, i8* %12)
ret void
}

LLVM IR (-O2):
@.str = [121 x i8] c"<img alt=\22%s\22 title=\22%s\22 src=\22/img/19x19/%s.gif\22 width=\2219\22 height=\2219\22 border=\220\22 align=\22middle\22 hspace=\220\22 vspace=\220\22>\00"
define void @icon_print(i32* nocapture %0, i8* %1, i8* %2, i8* %3) {
%5 = tail call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([121 x i8], [121 x i8]* @.str, i64 0, i64 0), i8* %1, i8* %3, i8* %2)
ret void
}
void setnonblocking(int sock) {}


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

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

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

LLVM IR (-O2):
define void @setnonblocking(i32 %0) {
ret void
}
int init_ressources(void) { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @init_ressources() {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ mat4d_rotateAxisVec_new(double *, double, double *);
int /*<<< orphan*/ vec3d_set(double *, double, double, double);
void mat4d_rotateAxis_new(double result[16], double degrees, double axisX,
                          double axisY, double axisZ) {
  double vec[3];
  vec3d_set(vec, axisX, axisY, axisZ);
  mat4d_rotateAxisVec_new(result, degrees, vec);
}


x86 assembly (clang, -O0):
<mat4d_rotateAxis_new>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  %xmm2,-0x20(%rbp)
movsd  %xmm3,-0x28(%rbp)
lea    -0x40(%rbp),%rdi
movsd  -0x18(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
movsd  -0x28(%rbp),%xmm2
call   1030 <vec3d_set@plt>
mov    -0x8(%rbp),%rdi
movsd  -0x10(%rbp),%xmm0
lea    -0x40(%rbp),%rsi
call   1040 <mat4d_rotateAxisVec_new@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mat4d_rotateAxis_new>:
push   %r14
push   %rbx
sub    $0x28,%rsp
movsd  %xmm0,0x8(%rsp)
mov    %rdi,%rbx
lea    0x10(%rsp),%r14
mov    %r14,%rdi
movaps %xmm1,%xmm0
movaps %xmm2,%xmm1
movaps %xmm3,%xmm2
call   1030 <vec3d_set@plt>
mov    %rbx,%rdi
movsd  0x8(%rsp),%xmm0
mov    %r14,%rsi
call   1040 <mat4d_rotateAxisVec_new@plt>
add    $0x28,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @mat4d_rotateAxis_new(double* %0, double %1, double %2, double %3, double %4) {
%6 = alloca double*
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = alloca double
%11 = alloca [3 x double]
store double* %0, double** %6
store double %1, double* %7
store double %2, double* %8
store double %3, double* %9
store double %4, double* %10
%12 = getelementptr inbounds [3 x double], [3 x double]* %11, i64 0, i64 0
%13 = load double, double* %8
%14 = load double, double* %9
%15 = load double, double* %10
%16 = call i32 @vec3d_set(double* %12, double %13, double %14, double %15)
%17 = load double*, double** %6
%18 = load double, double* %7
%19 = getelementptr inbounds [3 x double], [3 x double]* %11, i64 0, i64 0
%20 = call i32 @mat4d_rotateAxisVec_new(double* %17, double %18, double* %19)
ret void
}

LLVM IR (-O2):
define void @mat4d_rotateAxis_new(double* %0, double %1, double %2, double %3, double %4) {
%6 = alloca [3 x double]
%7 = bitcast [3 x double]* %6 to i8*
%8 = getelementptr inbounds [3 x double], [3 x double]* %6, i64 0, i64 0
%9 = call i32 @vec3d_set(double* %8, double %2, double %3, double %4)
%10 = call i32 @mat4d_rotateAxisVec_new(double* %0, double %1, double* %8)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ tlGroupUnload(unsigned int);
void tlGroupsUnload(unsigned int n, unsigned int *groups) {
  unsigned int i;
  for (i = 0; i < n; i++)
    tlGroupUnload(groups[i]);
}


x86 assembly (clang, -O0):
<tlGroupsUnload>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x4(%rbp),%eax
jae    114f <tlGroupsUnload+0x3f>
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%ecx
mov    (%rax,%rcx,4),%edi
call   1030 <tlGroupUnload@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1126 <tlGroupsUnload+0x16>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tlGroupsUnload>:
push   %r15
push   %r14
push   %rbx
test   %edi,%edi
je     1142 <tlGroupsUnload+0x32>
mov    %rsi,%r14
mov    %edi,%r15d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    (%r14,%rbx,4),%edi
call   1030 <tlGroupUnload@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <tlGroupsUnload+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @tlGroupsUnload(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 = %17, %2
%7 = load i32, i32* %5
%8 = load i32, i32* %3
%9 = icmp ult i32 %7, %8
br i1 %9, label %10, label %20
10: ; preds = %6
%11 = load i32*, i32** %4
%12 = load i32, i32* %5
%13 = zext i32 %12 to i64
%14 = getelementptr inbounds i32, i32* %11, i64 %13
%15 = load i32, i32* %14
%16 = call i32 @tlGroupUnload(i32 %15)
br label %17
17: ; preds = %10
%18 = load i32, i32* %5
%19 = add i32 %18, 1
store i32 %19, i32* %5
br label %6
20: ; preds = %6
ret void
}

LLVM IR (-O2):
define void @tlGroupsUnload(i32 %0, i32* nocapture %1) {
%3 = icmp eq i32 %0, 0
br i1 %3, label %13, label %4
4: ; preds = %2
%5 = zext i32 %0 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i32, i32* %1, i64 %7
%9 = load i32, i32* %8
%10 = tail call i32 @tlGroupUnload(i32 %9)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
unsigned int evpd_ascii_len(int /*<<< orphan*/ *);
unsigned evpd_ascii_post_data_len(uint8_t *evpd_body, unsigned full_data_len) {
  return full_data_len - 4 - 2 - evpd_ascii_len(evpd_body);
}


x86 assembly (clang, -O0):
<evpd_ascii_post_data_len>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
sub    $0x4,%eax
sub    $0x2,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <evpd_ascii_len@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
sub    %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<evpd_ascii_post_data_len>:
push   %rbx
mov    %esi,%ebx
call   1030 <evpd_ascii_len@plt>
sub    %eax,%ebx
add    $0xfffffffa,%ebx
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @evpd_ascii_post_data_len(i32* %0, i32 %1) {
%3 = add i32 %1, -6
%4 = tail call i32 @evpd_ascii_len(i32* %0)
%5 = sub i32 %3, %4
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ bpf_trace_printk(char *);
int kprobe__sys_clone(void *ctx) {
  bpf_trace_printk("Hello, World!\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [15 x i8] c"Hello, World!\0A\00"
define i32 @kprobe__sys_clone(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @bpf_trace_printk(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [15 x i8] c"Hello, World!\0A\00"
define i32 @kprobe__sys_clone(i8* nocapture readnone %0) {
%2 = tail call i32 @bpf_trace_printk(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
int test_imm_8Eint64_midword_mem(long long *val) {
  return ((*val >> 16) & (0x8E << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_8Eint64_midword_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdx
sar    $0x10,%rdx
and    $0x8e,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_8Eint64_midword_mem>:
testb  $0x8e,0x2(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_8Eint64_midword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 9306112
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
void itracku_exit(void) {}


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

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

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

LLVM IR (-O2):
define void @itracku_exit() {
ret void
}
int test_imm_C9uint64_lowword_mem(unsigned long long *val) {
  return ((*val) & (0xC9 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_C9uint64_lowword_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdx
and    $0xc9,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_C9uint64_lowword_mem>:
testb  $0xc9,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_C9uint64_lowword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 201
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ write(int, char *, int);
void test_handler(int signo) {
  write(1, "caught SIGCHLD\n", 15);
  return;
}


x86 assembly (clang, -O0):
<test_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x1,%edi
lea    0xed9(%rip),%rsi
mov    $0xf,%edx
call   1030 <write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_handler>:
lea    0xee9(%rip),%rsi
mov    $0x1,%edi
mov    $0xf,%edx
jmp    1030 <write@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"caught SIGCHLD\0A\00"
define void @test_handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @write(i32 1, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 15)
ret void
}

LLVM IR (-O2):
@.str = [16 x i8] c"caught SIGCHLD\0A\00"
define void @test_handler(i32 %0) {
%2 = tail call i32 @write(i32 1, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 15)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ key_t;

/* Variables and functions */
void *shmat(int, long, int /*<<< orphan*/);
int shmget(int /*<<< orphan*/, size_t, int);
void *shmem_open(key_t key, size_t mem_size_bytes) {
  void *rv;
  int h;
  h = shmget(key, mem_size_bytes, 0644);
  if (h == -1)
    return 0L;
  rv = shmat(h, 0L, 0);
  if (rv == (void *)-1)
    return 0L;
  return rv;
}


x86 assembly (clang, -O0):
<shmem_open>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0xc(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0xc(%rbp),%edi
mov    -0x18(%rbp),%rsi
mov    $0x1a4,%edx
call   1040 <shmget@plt>
mov    %eax,-0x24(%rbp)
cmpl   $0xffffffff,-0x24(%rbp)
jne    115a <shmem_open+0x3a>
movq   $0x0,-0x8(%rbp)
jmp    1192 <shmem_open+0x72>
mov    -0x24(%rbp),%edi
xor    %eax,%eax
mov    %eax,%esi
xor    %edx,%edx
call   1030 <shmat@plt>
mov    %rax,-0x20(%rbp)
mov    $0xffffffffffffffff,%rax
cmp    %rax,-0x20(%rbp)
jne    118a <shmem_open+0x6a>
movq   $0x0,-0x8(%rbp)
jmp    1192 <shmem_open+0x72>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<shmem_open>:
push   %rbx
mov    $0x1a4,%edx
call   1040 <shmget@plt>
cmp    $0xffffffff,%eax
je     1147 <shmem_open+0x27>
xor    %ebx,%ebx
mov    %eax,%edi
xor    %esi,%esi
xor    %edx,%edx
call   1030 <shmat@plt>
cmp    $0xffffffffffffffff,%rax
cmove  %rbx,%rax
pop    %rbx
ret
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @shmem_open(i32 %0, i64 %1) {
%3 = tail call i32 @shmget(i32 %0, i64 %1, i32 420)
%4 = icmp eq i32 %3, -1
br i1 %4, label %9, label %5
5: ; preds = %2
%6 = tail call i8* @shmat(i32 %3, i64 0, i32 0)
%7 = icmp eq i8* %6, inttoptr (i64 -1 to i8*)
%8 = select i1 %7, i8* null, i8* %6
br label %9
9: ; preds = %5, %2
%10 = phi i8* [ null, %2 ], [ %8, %5 ]
ret i8* %10
}
/* Type definitions */
typedef int /*<<< orphan*/ wchar_t;

/* Variables and functions */
size_t wcslen(int /*<<< orphan*/ *);
size_t ISandBox_wcslen(wchar_t *str) { return wcslen(str); }


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

x86 assembly (clang, -O2):
<ISandBox_wcslen>:
jmp    1030 <wcslen@plt>

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

LLVM IR (-O2):
define i64 @ISandBox_wcslen(i32* nocapture %0) {
%2 = tail call i64 @wcslen(i32* %0)
ret i64 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void parsePort(char *arg) { printf("Port is : %s\n", arg); }


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

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

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

LLVM IR (-O2):
@.str = [14 x i8] c"Port is : %s\0A\00"
define void @parsePort(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ print_all(char *, char, int /*<<< orphan*/, char *);
int main(void) {
  print_all("ceis", 'H', 0, "lberton");
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
mov    $0x48,%esi
xor    %edx,%edx
lea    0xed1(%rip),%rcx
call   1030 <print_all@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
lea    0xee6(%rip),%rcx
mov    $0x48,%esi
xor    %edx,%edx
call   1030 <print_all@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"ceis\00"
@.str.1 = [8 x i8] c"lberton\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @print_all(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8 signext 72, i32 0, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [5 x i8] c"ceis\00"
@.str.1 = [8 x i8] c"lberton\00"
define i32 @main() {
%1 = tail call i32 @print_all(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8 signext 72, i32 0, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
struct EC {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(void *);
void delete_ec(struct EC *ec) { free((void *)ec); }


x86 assembly (clang, -O0):
<delete_ec>:
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):
<delete_ec>:
jmp    1030 <free@plt>

LLVM IR (-O0):
%struct.EC = type { i32 }
define void @delete_ec(%struct.EC* %0) {
%2 = alloca %struct.EC*
store %struct.EC* %0, %struct.EC** %2
%3 = load %struct.EC*, %struct.EC** %2
%4 = bitcast %struct.EC* %3 to i8*
%5 = call i32 @free(i8* %4)
ret void
}

LLVM IR (-O2):
%struct.EC = type { i32 }
define void @delete_ec(%struct.EC* nocapture %0) {
%2 = bitcast %struct.EC* %0 to i8*
%3 = tail call i32 @free(i8* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ print(char *);
void func5() {
  print("Filter false sensors");
  print("flickering");
}


x86 assembly (clang, -O0):
<func5>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <print@plt>
lea    0xeee(%rip),%rdi
call   1030 <print@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [21 x i8] c"Filter false sensors\00"
@.str.1 = [11 x i8] c"flickering\00"
define void @func5() {
%1 = call i32 @print(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @print(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [21 x i8] c"Filter false sensors\00"
@.str.1 = [11 x i8] c"flickering\00"
define void @func5() {
%1 = tail call i32 @print(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @print(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ permute(int *, int);
int main(int argc, char *argv[]) {
  int arr[] = {2, 2, 3};
  permute(arr, 3);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0xed3(%rip),%rax
mov    %rax,-0x1c(%rbp)
mov    0xed1(%rip),%eax
mov    %eax,-0x14(%rbp)
lea    -0x1c(%rbp),%rdi
mov    $0x3,%esi
call   1030 <permute@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
mov    0xeee(%rip),%eax
mov    %eax,0x10(%rsp)
mov    0xedb(%rip),%rax
mov    %rax,0x8(%rsp)
lea    0x8(%rsp),%rdi
mov    $0x3,%esi
call   1030 <permute@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.main.arr = [3 x i32] [i32 2, i32 2, i32 3]
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [3 x i32]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = bitcast [3 x i32]* %6 to i8*
%8 = getelementptr inbounds [3 x i32], [3 x i32]* %6, i64 0, i64 0
%9 = call i32 @permute(i32* %8, i32 3)
ret i32 0
}

LLVM IR (-O2):
@__const.main.arr = [3 x i32] [i32 2, i32 2, i32 3]
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [3 x i32]
%4 = bitcast [3 x i32]* %3 to i8*
%5 = getelementptr inbounds [3 x i32], [3 x i32]* %3, i64 0, i64 0
%6 = call i32 @permute(i32* %5, i32 3)
ret i32 0
}
int x39_process_request(struct mypacket *packet) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.mypacket = type opaque
define i32 @x39_process_request(%struct.mypacket* nocapture readnone %0) {
ret i32 0
}
int st_ptrhash(char *x, int size) {
  return ((int)((unsigned long)(x) >> 2) % size);
}


x86 assembly (clang, -O0):
<st_ptrhash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
shr    $0x2,%rax
cltd
idivl  -0xc(%rbp)
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<st_ptrhash>:
mov    %rdi,%rax
shr    $0x2,%rax
cltd
idiv   %esi
mov    %edx,%eax
ret

LLVM IR (-O0):
define i32 @st_ptrhash(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 = ptrtoint i8* %5 to i64
%7 = lshr i64 %6, 2
%8 = trunc i64 %7 to i32
%9 = load i32, i32* %4
%10 = srem i32 %8, %9
ret i32 %10
}

LLVM IR (-O2):
define i32 @st_ptrhash(i8* %0, i32 %1) {
%3 = ptrtoint i8* %0 to i64
%4 = lshr i64 %3, 2
%5 = trunc i64 %4 to i32
%6 = srem i32 %5, %1
ret i32 %6
}
const char *type_name(unsigned t) {
  if (t)
    return "UINT";
  else
    return "unsigned";
}


x86 assembly (clang, -O0):
<type_name>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     1121 <type_name+0x21>
lea    0xee8(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    112c <type_name+0x2c>
lea    0xedd(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<type_name>:
test   %edi,%edi
lea    0xefc(%rip),%rcx
lea    0xef0(%rip),%rax
cmove  %rcx,%rax
ret

LLVM IR (-O0):
@.str = [5 x i8] c"UINT\00"
@.str.1 = [9 x i8] c"unsigned\00"
define i8* @type_name(i32 %0) {
%2 = alloca i8*
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp ne i32 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %1
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8** %2
br label %8
7: ; preds = %1
store i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i8** %2
br label %8
8: ; preds = %7, %6
%9 = load i8*, i8** %2
ret i8* %9
}

LLVM IR (-O2):
@.str = [5 x i8] c"UINT\00"
@.str.1 = [9 x i8] c"unsigned\00"
define i8* @type_name(i32 %0) {
%2 = icmp eq i32 %0, 0
%3 = select i1 %2, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0)
ret i8* %3
}
/* Variables and functions */
int munmap(void *, size_t);
__attribute__((weak)) int __real_munmap(void *addr, size_t len) {
  return munmap(addr, len);
}


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

x86 assembly (clang, -O2):
<__real_munmap>:
jmp    1030 <munmap@plt>

LLVM IR (-O0):
define weak i32 @__real_munmap(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 i32 @munmap(i8* %5, i64 %6)
ret i32 %7
}

LLVM IR (-O2):
define weak i32 @__real_munmap(i8* %0, i64 %1) {
%3 = tail call i32 @munmap(i8* %0, i64 %1)
ret i32 %3
}
int video_get_window_pos(int *x0, int *y0) {
  *x0 = 0;
  *y0 = 0;
  return 1;
}


x86 assembly (clang, -O0):
<video_get_window_pos>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movl   $0x0,(%rax)
mov    -0x10(%rbp),%rax
movl   $0x0,(%rax)
mov    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<video_get_window_pos>:
movl   $0x0,(%rdi)
movl   $0x0,(%rsi)
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @video_get_window_pos(i32* nocapture writeonly %0, i32* nocapture writeonly %1) {
store i32 0, i32* %0
store i32 0, i32* %1
ret i32 1
}
float Q_recip(float in) { return (float)(1.0f / in); }


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

x86 assembly (clang, -O2):
<Q_recip>:
movss  0xef8(%rip),%xmm1
divss  %xmm0,%xmm1
movaps %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @Q_recip(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fdiv float 1.000000e+00, %3
ret float %4
}

LLVM IR (-O2):
define float @Q_recip(float %0) {
%2 = fdiv float 1.000000e+00, %0
ret float %2
}
/* Variables and functions */
int /*<<< orphan*/ i2cInit();
int /*<<< orphan*/ i2cSetBitrate(int);
void initI2c(void) {
  i2cInit();
  i2cSetBitrate(100);
}


x86 assembly (clang, -O0):
<initI2c>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <i2cInit@plt>
mov    $0x64,%edi
call   1040 <i2cSetBitrate@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<initI2c>:
push   %rax
xor    %eax,%eax
call   1030 <i2cInit@plt>
mov    $0x64,%edi
pop    %rax
jmp    1040 <i2cSetBitrate@plt>

LLVM IR (-O0):
define void @initI2c() {
%1 = call i32 (...) @i2cInit()
%2 = call i32 @i2cSetBitrate(i32 100)
ret void
}

LLVM IR (-O2):
define void @initI2c() {
%1 = tail call i32 (...) @i2cInit()
%2 = tail call i32 @i2cSetBitrate(i32 100)
ret void
}
/* Variables and functions */
int foo();
int main(void) {
  int a = foo();
  if (a == 1) {
    return 0;
  } else {
    return 1;
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <foo@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
jne    113f <main+0x2f>
movl   $0x0,-0x4(%rbp)
jmp    1146 <main+0x36>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <foo@plt>
xor    %ecx,%ecx
cmp    $0x1,%eax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @foo()
%2 = icmp ne i32 %1, 1
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int double_to_bits(double);
int isinf(double x) {
  unsigned long exponent = (double_to_bits(x) >> 52) & 0x7ff;
  unsigned long mantissa = double_to_bits(x) & 0xffffffffffffful;
  return exponent == 2047 && mantissa == 0;
}


x86 assembly (clang, -O0):
<isinf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <double_to_bits@plt>
mov    $0x34,%ecx
sar    %cl,%eax
and    $0x7ff,%eax
cltq
mov    %rax,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <double_to_bits@plt>
cltq
movabs $0xfffffffffffff,%rcx
and    %rcx,%rax
mov    %rax,-0x18(%rbp)
xor    %eax,%eax
cmpq   $0x7ff,-0x10(%rbp)
mov    %al,-0x19(%rbp)
jne    1174 <isinf+0x64>
cmpq   $0x0,-0x18(%rbp)
sete   %al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isinf>:
push   %rax
movsd  %xmm0,(%rsp)
call   1030 <double_to_bits@plt>
movsd  (%rsp),%xmm0
pop    %rax
jmp    1030 <double_to_bits@plt>

LLVM IR (-O0):
define i32 @isinf(double %0) {
%2 = alloca double
%3 = alloca i64
%4 = alloca i64
store double %0, double* %2
%5 = load double, double* %2
%6 = call i32 @double_to_bits(double %5)
%7 = ashr i32 %6, 52
%8 = and i32 %7, 2047
%9 = sext i32 %8 to i64
store i64 %9, i64* %3
%10 = load double, double* %2
%11 = call i32 @double_to_bits(double %10)
%12 = sext i32 %11 to i64
%13 = and i64 %12, 4503599627370495
store i64 %13, i64* %4
%14 = load i64, i64* %3
%15 = icmp eq i64 %14, 2047
br i1 %15, label %16, label %19
16: ; preds = %1
%17 = load i64, i64* %4
%18 = icmp eq i64 %17, 0
br label %19
19: ; preds = %16, %1
%20 = phi i1 [ false, %1 ], [ %18, %16 ]
%21 = zext i1 %20 to i32
ret i32 %21
}

LLVM IR (-O2):
define i32 @isinf(double %0) {
%2 = tail call i32 @double_to_bits(double %0)
%3 = tail call i32 @double_to_bits(double %0)
ret i32 poison
}
/* Variables and functions */
double ceil(double);
double _ceil(double in1) { return ceil(in1); }


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

x86 assembly (clang, -O2):
<_ceil>:
jmp    1030 <ceil@plt>

LLVM IR (-O0):
define double @_ceil(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call double @llvm.ceil.f64(double %3)
ret double %4
}

LLVM IR (-O2):
define double @_ceil(double %0) {
%2 = tail call double @llvm.ceil.f64(double %0)
ret double %2
}
int isenter(char chr) {
  if (chr == 0x0A)
    return (1);
  else if (chr == 0x0D)
    return (1);
  else
    return (0);
}


x86 assembly (clang, -O0):
<isenter>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0xa,%eax
jne    1123 <isenter+0x23>
movl   $0x1,-0x4(%rbp)
jmp    1143 <isenter+0x43>
movsbl -0x5(%rbp),%eax
cmp    $0xd,%eax
jne    113c <isenter+0x3c>
movl   $0x1,-0x4(%rbp)
jmp    1143 <isenter+0x43>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isenter>:
cmp    $0xa,%dil
sete   %al
cmp    $0xd,%dil
sete   %cl
or     %al,%cl
movzbl %cl,%eax
ret

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

LLVM IR (-O2):
define i32 @isenter(i8 signext %0) {
%2 = icmp eq i8 %0, 10
%3 = icmp eq i8 %0, 13
%4 = or i1 %2, %3
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ DrawLine(double, double);
int /*<<< orphan*/ MovePen(double, double);
void DrawBox(double x, double y, double width, double height) {
  MovePen(x, y);
  DrawLine(0, height);
  DrawLine(width, 0);
  DrawLine(0, -height);
  DrawLine(-width, 0);
}


x86 assembly (clang, -O0):
<DrawBox>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
call   1040 <MovePen@plt>
movsd  -0x20(%rbp),%xmm1
xorps  %xmm0,%xmm0
call   1030 <DrawLine@plt>
movsd  -0x18(%rbp),%xmm0
xorps  %xmm1,%xmm1
call   1030 <DrawLine@plt>
movsd  -0x20(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
xorps  %xmm0,%xmm0
call   1030 <DrawLine@plt>
movsd  -0x18(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
xorps  %xmm1,%xmm1
call   1030 <DrawLine@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<DrawBox>:
sub    $0x28,%rsp
movaps %xmm3,(%rsp)
movaps %xmm2,0x10(%rsp)
call   1040 <MovePen@plt>
xorps  %xmm0,%xmm0
movaps (%rsp),%xmm1
call   1030 <DrawLine@plt>
xorps  %xmm1,%xmm1
movaps 0x10(%rsp),%xmm0
call   1030 <DrawLine@plt>
movaps (%rsp),%xmm1
xorps  0xeaa(%rip),%xmm1
xorps  %xmm0,%xmm0
call   1030 <DrawLine@plt>
movaps 0x10(%rsp),%xmm0
xorps  0xe96(%rip),%xmm0
xorps  %xmm1,%xmm1
add    $0x28,%rsp
jmp    1030 <DrawLine@plt>

LLVM IR (-O0):
define void @DrawBox(double %0, double %1, double %2, double %3) {
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
store double %0, double* %5
store double %1, double* %6
store double %2, double* %7
store double %3, double* %8
%9 = load double, double* %5
%10 = load double, double* %6
%11 = call i32 @MovePen(double %9, double %10)
%12 = load double, double* %8
%13 = call i32 @DrawLine(double 0.000000e+00, double %12)
%14 = load double, double* %7
%15 = call i32 @DrawLine(double %14, double 0.000000e+00)
%16 = load double, double* %8
%17 = fneg double %16
%18 = call i32 @DrawLine(double 0.000000e+00, double %17)
%19 = load double, double* %7
%20 = fneg double %19
%21 = call i32 @DrawLine(double %20, double 0.000000e+00)
ret void
}

LLVM IR (-O2):
define void @DrawBox(double %0, double %1, double %2, double %3) {
%5 = tail call i32 @MovePen(double %0, double %1)
%6 = tail call i32 @DrawLine(double 0.000000e+00, double %3)
%7 = tail call i32 @DrawLine(double %2, double 0.000000e+00)
%8 = fneg double %3
%9 = tail call i32 @DrawLine(double 0.000000e+00, double %8)
%10 = fneg double %2
%11 = tail call i32 @DrawLine(double %10, double 0.000000e+00)
ret void
}
void create_firenze() { return; }


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

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

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

LLVM IR (-O2):
define void @create_firenze() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;
typedef scalar_t__ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ a_or(int *, scalar_t__);
void a_or_64(volatile uint64_t *p, uint64_t v) {
  union {
    uint64_t v;
    uint32_t r[2];
  } u = {v};
  if (u.r[0])
    a_or((int *)p, u.r[0]);
  if (u.r[1])
    a_or((int *)p + 1, u.r[1]);
}


x86 assembly (clang, -O0):
<a_or_64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     113d <a_or_64+0x2d>
mov    -0x8(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1030 <a_or@plt>
cmpq   $0x0,-0x18(%rbp)
je     1159 <a_or_64+0x49>
mov    -0x8(%rbp),%rdi
add    $0x4,%rdi
mov    -0x18(%rbp),%rsi
call   1030 <a_or@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<a_or_64>:
test   %esi,%esi
je     111b <a_or_64+0xb>
mov    %esi,%esi
jmp    1030 <a_or@plt>
ret

LLVM IR (-O0):
%union.anon = type { [2 x i64] }
define void @a_or_64(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca %union.anon
store i32* %0, i32** %3
store i32 %1, i32* %4
%6 = bitcast %union.anon* %5 to i32*
%7 = load i32, i32* %4
store i32 %7, i32* %6
%8 = bitcast %union.anon* %5 to [2 x i64]*
%9 = getelementptr inbounds [2 x i64], [2 x i64]* %8, i64 0, i64 0
%10 = load i64, i64* %9
%11 = icmp ne i64 %10, 0
br i1 %11, label %12, label %18
12: ; preds = %2
%13 = load i32*, i32** %3
%14 = bitcast %union.anon* %5 to [2 x i64]*
%15 = getelementptr inbounds [2 x i64], [2 x i64]* %14, i64 0, i64 0
%16 = load i64, i64* %15
%17 = call i32 @a_or(i32* %13, i64 %16)
br label %18
18: ; preds = %12, %2
%19 = bitcast %union.anon* %5 to [2 x i64]*
%20 = getelementptr inbounds [2 x i64], [2 x i64]* %19, i64 0, i64 1
%21 = load i64, i64* %20
%22 = icmp ne i64 %21, 0
br i1 %22, label %23, label %30
23: ; preds = %18
%24 = load i32*, i32** %3
%25 = getelementptr inbounds i32, i32* %24, i64 1
%26 = bitcast %union.anon* %5 to [2 x i64]*
%27 = getelementptr inbounds [2 x i64], [2 x i64]* %26, i64 0, i64 1
%28 = load i64, i64* %27
%29 = call i32 @a_or(i32* %25, i64 %28)
br label %30
30: ; preds = %23, %18
ret void
}

LLVM IR (-O2):
define void @a_or_64(i32* %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %7, label %4
4: ; preds = %2
%5 = zext i32 %1 to i64
%6 = tail call i32 @a_or(i32* %0, i64 %5)
br label %7
7: ; preds = %2, %4
ret void
}
/* Variables and functions */
int max(int /*<<< orphan*/, scalar_t__);
scalar_t__ strlen(char const *);
const char *strright(const char *str, int n) {
  return str + max(0, strlen(str) - n);
}


x86 assembly (clang, -O0):
<strright>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,%rsi
movslq -0xc(%rbp),%rax
sub    %rax,%rsi
xor    %edi,%edi
call   1040 <max@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strright>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
call   1030 <strlen@plt>
movslq %ebp,%rcx
sub    %rcx,%rax
xor    %edi,%edi
mov    %rax,%rsi
call   1040 <max@plt>
cltq
add    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i8* @strright(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %3
%7 = call i64 @strlen(i8* %6)
%8 = load i32, i32* %4
%9 = sext i32 %8 to i64
%10 = sub nsw i64 %7, %9
%11 = call i32 @max(i32 0, i64 %10)
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds i8, i8* %5, i64 %12
ret i8* %13
}

LLVM IR (-O2):
define i8* @strright(i8* %0, i32 %1) {
%3 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%4 = sext i32 %1 to i64
%5 = sub nsw i64 %3, %4
%6 = tail call i32 @max(i32 0, i64 %5)
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds i8, i8* %0, i64 %7
ret i8* %8
}