xunge/DecIR huggingface dataset:
void adjust(char **s) {
  char *t;
  t = *s;
  while (*t && (*t != ':')) {
    t++;
  }
  if (*t) {
    t++;
  }
  *s = t;
}


x86 assembly (clang, -O0):
<adjust>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x11(%rbp)
je     1138 <adjust+0x38>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x3a,%eax
setne  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    1148 <adjust+0x48>
jmp    1159 <adjust+0x59>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1113 <adjust+0x13>
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1172 <adjust+0x72>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<adjust>:
mov    (%rdi),%rax
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movzbl (%rax),%ecx
test   %cl,%cl
je     1122 <adjust+0x22>
cmp    $0x3a,%cl
je     1122 <adjust+0x22>
add    $0x1,%rax
jmp    1110 <adjust+0x10>
cmp    $0x1,%cl
sbb    $0xffffffffffffffff,%rax
mov    %rax,(%rdi)
ret

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

LLVM IR (-O2):
define void @adjust(i8** nocapture %0) {
%2 = load i8*, i8** %0
br label %3
3: ; preds = %6, %1
%4 = phi i8* [ %2, %1 ], [ %7, %6 ]
%5 = load i8, i8* %4
switch i8 %5, label %6 [
i8 0, label %8
i8 58, label %8
]
6: ; preds = %3
%7 = getelementptr inbounds i8, i8* %4, i64 1
br label %3
8: ; preds = %3, %3
%9 = icmp ne i8 %5, 0
%10 = zext i1 %9 to i64
%11 = getelementptr i8, i8* %4, i64 %10
store i8* %11, i8** %0
ret void
}
/* Type definitions */
struct stat {
  unsigned int st_uid;
};

/* Variables and functions */
int EXIT_FAILURE;
int EXIT_SUCCESS;
int do_user(unsigned int userid, struct stat attr) {
  if (userid == attr.st_uid) {
    return EXIT_SUCCESS;
  }
  return EXIT_FAILURE;
}


x86 assembly (clang, -O0):
<do_user>:
push   %rbp
mov    %rsp,%rbp
mov    %esi,-0x8(%rbp)
mov    %edi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jne    1127 <do_user+0x27>
mov    0x2ebb(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1133 <do_user+0x33>
mov    0x2eb2(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_user>:
cmp    %esi,%edi
jne    110e <do_user+0xe>
mov    0x2ecd(%rip),%rax
mov    (%rax),%eax
ret
mov    0x2ecb(%rip),%rax
mov    (%rax),%eax
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
@EXIT_SUCCESS = global i32 0
@EXIT_FAILURE = global i32 0
define i32 @do_user(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca %struct.stat
%5 = alloca i32
%6 = getelementptr inbounds %struct.stat, %struct.stat* %4, i32 0, i32 0
store i32 %1, i32* %6
store i32 %0, i32* %5
%7 = load i32, i32* %5
%8 = getelementptr inbounds %struct.stat, %struct.stat* %4, i32 0, i32 0
%9 = load i32, i32* %8
%10 = icmp eq i32 %7, %9
br i1 %10, label %11, label %13
11: ; preds = %2
%12 = load i32, i32* @EXIT_SUCCESS
store i32 %12, i32* %3
br label %15
13: ; preds = %2
%14 = load i32, i32* @EXIT_FAILURE
store i32 %14, i32* %3
br label %15
15: ; preds = %13, %11
%16 = load i32, i32* %3
ret i32 %16
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
@EXIT_FAILURE = global i32 0
define i32 @do_user(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, %1
%4 = load i32, i32* @EXIT_SUCCESS
%5 = load i32, i32* @EXIT_FAILURE
%6 = select i1 %3, i32 %4, i32 %5
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ xip_fpo_lessequal_flt(int *, float, float);
int xil_fpo_lessequal_flt(float a, float b) {
  int res_int;
  xip_fpo_lessequal_flt(&res_int, a, b);
  return res_int;
}


x86 assembly (clang, -O0):
<xil_fpo_lessequal_flt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
lea    -0xc(%rbp),%rdi
call   1030 <xip_fpo_lessequal_flt@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xil_fpo_lessequal_flt>:
push   %rax
lea    0x4(%rsp),%rdi
call   1030 <xip_fpo_lessequal_flt@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @xil_fpo_lessequal_flt(float %0, float %1) {
%3 = alloca float
%4 = alloca float
%5 = alloca i32
store float %0, float* %3
store float %1, float* %4
%6 = load float, float* %3
%7 = load float, float* %4
%8 = call i32 @xip_fpo_lessequal_flt(i32* %5, float %6, float %7)
%9 = load i32, i32* %5
ret i32 %9
}

LLVM IR (-O2):
define i32 @xil_fpo_lessequal_flt(float %0, float %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = call i32 @xip_fpo_lessequal_flt(i32* %3, float %0, float %1)
%6 = load i32, i32* %3
ret i32 %6
}
/* Variables and functions */
scalar_t__ wait(int /*<<< orphan*/ *);
void sigchild_handler(int a) {
  while (wait(NULL) > 0)
    ;
}


x86 assembly (clang, -O0):
<sigchild_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1030 <wait@plt>
cmp    $0x0,%rax
jle    1133 <sigchild_handler+0x23>
jmp    111b <sigchild_handler+0xb>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sigchild_handler>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %edi,%edi
call   1030 <wait@plt>
test   %rax,%rax
jg     1120 <sigchild_handler+0x10>
pop    %rax
ret

LLVM IR (-O0):
define void @sigchild_handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
br label %3
3: ; preds = %6, %1
%4 = call i64 @wait(i32* null)
%5 = icmp sgt i64 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %3
br label %3
7: ; preds = %3
ret void
}

LLVM IR (-O2):
define void @sigchild_handler(i32 %0) {
br label %2
2: ; preds = %2, %1
%3 = tail call i64 @wait(i32* null)
%4 = icmp sgt i64 %3, 0
br i1 %4, label %2, label %5
5: ; preds = %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int main() {
  int j;
  for (j = 0; j <= 255; j++) {
    printf("%c * %d\n", j, j);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0xff,-0x8(%rbp)
jg     1153 <main+0x43>
mov    -0x8(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xec0(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <main+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
xor    %ebx,%ebx
lea    0xee3(%rip),%r14
nopl   (%rax)
mov    %r14,%rdi
mov    %ebx,%esi
mov    %ebx,%edx
call   1030 <printf@plt>
add    $0x1,%ebx
cmp    $0x100,%ebx
jne    1120 <main+0x10>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [9 x i8] c"%c * %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
br label %3
3: ; preds = %10, %0
%4 = load i32, i32* %2
%5 = icmp sle i32 %4, 255
br i1 %5, label %6, label %13
6: ; preds = %3
%7 = load i32, i32* %2
%8 = load i32, i32* %2
%9 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %7, i32 %8)
br label %10
10: ; preds = %6
%11 = load i32, i32* %2
%12 = add nsw i32 %11, 1
store i32 %12, i32* %2
br label %3
13: ; preds = %3
ret i32 0
}

LLVM IR (-O2):
@.str = [9 x i8] c"%c * %d\0A\00"
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 0, %0 ], [ %4, %1 ]
%3 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %2, i32 %2)
%4 = add nuw nsw i32 %2, 1
%5 = icmp eq i32 %4, 256
br i1 %5, label %6, label %1
6: ; preds = %1
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, long);
int main() {
  register long esp __asm__("esp");
  printf("%8.8lx\n", esp);
}


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

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

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

LLVM IR (-O2):
@.str = [8 x i8] c"%8.8lx\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i64 undef)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ lib_h(int, void (*)(int));
void lib_g(int i, ...) { lib_h(i + 1, &lib_g); }


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

x86 assembly (clang, -O2):
<lib_g>:
add    $0x1,%edi
mov    0x2ebe(%rip),%rsi
jmp    1030 <lib_h@plt>

LLVM IR (-O0):
define void @lib_g(i32 %0, ...) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add nsw i32 %3, 1
%5 = call i32 @lib_h(i32 %4, void (i32)* bitcast (void (i32, ...)* @lib_g to void (i32)*))
ret void
}

LLVM IR (-O2):
define void @lib_g(i32 %0, ...) {
%2 = add nsw i32 %0, 1
%3 = tail call i32 @lib_h(i32 %2, void (i32)* bitcast (void (i32, ...)* @lib_g to void (i32)*))
ret void
}
void none_finish(void) {}


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

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

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

LLVM IR (-O2):
define void @none_finish() {
ret void
}
float DIV(float x, float y) { return x / y; }


x86 assembly (clang, -O0):
<DIV>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
divss  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<DIV>:
divss  %xmm1,%xmm0
ret

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

LLVM IR (-O2):
define float @DIV(float %0, float %1) {
%3 = fdiv float %0, %1
ret float %3
}
unsigned long b_file_write(unsigned long handle, const void *buf,
                           unsigned long count) {
  unsigned long tlong;
  asm volatile("call *0x00100088"
               : "=c"(tlong)
               : "a"(handle), "S"(buf), "c"(count));
  return tlong;
}


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

x86 assembly (clang, -O2):
<b_file_write>:
mov    %rdx,%rcx
mov    %rdi,%rax
call   *0x100088
mov    %rcx,%rax
ret

LLVM IR (-O0):
define i64 @b_file_write(i64 %0, i8* %1, i64 %2) {
%4 = alloca i64
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i64
store i64 %0, i64* %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%8 = load i64, i64* %4
%9 = load i8*, i8** %5
%10 = load i64, i64* %6
%11 = call i64 asm sideeffect "call *0x00100088", "={cx},{ax},{si},{cx},~{dirflag},~{fpsr},~{flags}"(i64 %8, i8* %9, i64 %10)
store i64 %11, i64* %7
%12 = load i64, i64* %7
ret i64 %12
}

LLVM IR (-O2):
define i64 @b_file_write(i64 %0, i8* %1, i64 %2) {
%4 = tail call i64 asm sideeffect "call *0x00100088", "={cx},{ax},{si},{cx},~{dirflag},~{fpsr},~{flags}"(i64 %0, i8* %1, i64 %2)
ret i64 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ arc4random_buf(int /*<<< orphan*/ *, int);
uint32_t arc4random(void) {
  uint32_t v;
  arc4random_buf(&v, sizeof v);
  return v;
}


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

x86 assembly (clang, -O2):
<arc4random>:
push   %rax
lea    0x4(%rsp),%rdi
mov    $0x4,%esi
call   1030 <arc4random_buf@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @arc4random() {
%1 = alloca i32
%2 = call i32 @arc4random_buf(i32* %1, i32 4)
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
define i32 @arc4random() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @arc4random_buf(i32* %1, i32 4)
%4 = load i32, i32* %1
ret i32 %4
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, int);
void sprint_add_data(char *str, uint8_t data) {
  sprintf(str,
          "ADD   A, #"
          "0x%02X"
          "                  ",
          data);
}


x86 assembly (clang, -O0):
<sprint_add_data>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
lea    0xed3(%rip),%rsi
call   1030 <sprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sprint_add_data>:
mov    %esi,%edx
lea    0xee7(%rip),%rsi
jmp    1030 <sprintf@plt>

LLVM IR (-O0):
@.str = [35 x i8] c"ADD A,x%02X \00"
define void @sprint_add_data(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = load i32, i32* %4
%7 = call i32 @sprintf(i8* %5, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i32 %6)
ret void
}

LLVM IR (-O2):
@.str = [35 x i8] c"ADD A,x%02X \00"
define void @sprint_add_data(i8* nocapture writeonly %0, i32 %1) {
%3 = tail call i32 @sprintf(i8* dereferenceable(1) %0, i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i32 %1)
ret void
}
/* Variables and functions */
void Reserved_Handler33(void) {
  while (1)
    ;
}


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

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

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

LLVM IR (-O2):
define void @Reserved_Handler33() {
br label %1
1: ; preds = %0, %1
br label %1
}
/* Variables and functions */
char *converter(char *);
int /*<<< orphan*/ xfree(char *);
char *cet_convert_string(char *str) {
  char *res;
  if (str == NULL)
    return NULL;
  else if (*str == '\0')
    return str;
  res = converter(str);
  xfree(str);
  return res;
}


x86 assembly (clang, -O0):
<cet_convert_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1144 <cet_convert_string+0x24>
movq   $0x0,-0x8(%rbp)
jmp    1184 <cet_convert_string+0x64>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    1161 <cet_convert_string+0x41>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1184 <cet_convert_string+0x64>
jmp    1166 <cet_convert_string+0x46>
mov    -0x10(%rbp),%rdi
call   1040 <converter@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <xfree@plt>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cet_convert_string>:
push   %r14
push   %rbx
push   %rax
test   %rdi,%rdi
je     1149 <cet_convert_string+0x29>
mov    %rdi,%rbx
cmpb   $0x0,(%rdi)
je     114b <cet_convert_string+0x2b>
mov    %rbx,%rdi
call   1040 <converter@plt>
mov    %rax,%r14
mov    %rbx,%rdi
call   1030 <xfree@plt>
mov    %r14,%rax
jmp    114e <cet_convert_string+0x2e>
xor    %ebx,%ebx
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @cet_convert_string(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %9, label %3
3: ; preds = %1
%4 = load i8, i8* %0
%5 = icmp eq i8 %4, 0
br i1 %5, label %9, label %6
6: ; preds = %3
%7 = tail call i8* @converter(i8* %0)
%8 = tail call i32 @xfree(i8* %0)
br label %9
9: ; preds = %3, %1, %6
%10 = phi i8* [ %7, %6 ], [ null, %1 ], [ %0, %3 ]
ret i8* %10
}
const char *ey_engine_action_name(int action) {
  switch (action) {
  case 0:
    return "PASS";
  case 1:
    return "DROP";
  default:
    return "UNKOWN";
  }
}


x86 assembly (clang, -O0):
<ey_engine_action_name>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
test   %eax,%eax
je     112b <ey_engine_action_name+0x2b>
jmp    111a <ey_engine_action_name+0x1a>
mov    -0x10(%rbp),%eax
sub    $0x1,%eax
je     113b <ey_engine_action_name+0x3b>
jmp    114b <ey_engine_action_name+0x4b>
lea    0xece(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1156 <ey_engine_action_name+0x56>
lea    0xec3(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1156 <ey_engine_action_name+0x56>
lea    0xeb8(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ey_engine_action_name>:
cmp    $0x1,%edi
lea    0xefb(%rip),%rax
lea    0xef9(%rip),%rcx
cmove  %rax,%rcx
test   %edi,%edi
lea    0xee2(%rip),%rax
cmovne %rcx,%rax
ret

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

LLVM IR (-O2):
@.str = [5 x i8] c"PASS\00"
@.str.1 = [5 x i8] c"DROP\00"
@.str.2 = [7 x i8] c"UNKOWN\00"
define i8* @ey_engine_action_name(i32 %0) {
%2 = icmp eq i32 %0, 1
%3 = select i1 %2, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0)
%4 = icmp eq i32 %0, 0
%5 = select i1 %4, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %3
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ level2(int);
int omp_get_active_level();
int omp_get_level();
int omp_get_num_threads();
int omp_get_thread_num();
int /*<<< orphan*/ printf(char *, int, int, int, int);
void level1() {
#pragma omp parallel num_threads(2)
  {
#pragma omp critical
    printf("L1: thread %d / %d, level %d (nested regions %d)\n",
           omp_get_thread_num(), omp_get_num_threads(), omp_get_active_level(),
           omp_get_level());
    level2(omp_get_thread_num());
  }
}


x86 assembly (clang, -O0):
<level1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <omp_get_thread_num@plt>
mov    %eax,-0xc(%rbp)
mov    $0x0,%al
call   1050 <omp_get_num_threads@plt>
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1080 <omp_get_active_level@plt>
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1060 <omp_get_level@plt>
mov    -0xc(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    -0x4(%rbp),%ecx
mov    %eax,%r8d
lea    0xe60(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1030 <omp_get_thread_num@plt>
mov    %eax,%edi
call   1070 <level2@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<level1>:
push   %rbp
push   %r14
push   %rbx
xor    %eax,%eax
call   1030 <omp_get_thread_num@plt>
mov    %eax,%r14d
xor    %eax,%eax
call   1050 <omp_get_num_threads@plt>
mov    %eax,%ebp
xor    %eax,%eax
call   1080 <omp_get_active_level@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1060 <omp_get_level@plt>
lea    0xe72(%rip),%rdi
mov    %r14d,%esi
mov    %ebp,%edx
mov    %ebx,%ecx
mov    %eax,%r8d
call   1040 <printf@plt>
xor    %eax,%eax
call   1030 <omp_get_thread_num@plt>
mov    %eax,%edi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1070 <level2@plt>

LLVM IR (-O0):
@.str = [50 x i8] c"L1: thread %d / %d, level %d (nested regions %d)\0A\00"
define void @level1() {
%1 = call i32 (...) @omp_get_thread_num()
%2 = call i32 (...) @omp_get_num_threads()
%3 = call i32 (...) @omp_get_active_level()
%4 = call i32 (...) @omp_get_level()
%5 = call i32 @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str, i64 0, i64 0), i32 %1, i32 %2, i32 %3, i32 %4)
%6 = call i32 (...) @omp_get_thread_num()
%7 = call i32 @level2(i32 %6)
ret void
}

LLVM IR (-O2):
@.str = [50 x i8] c"L1: thread %d / %d, level %d (nested regions %d)\0A\00"
define void @level1() {
%1 = tail call i32 (...) @omp_get_thread_num()
%2 = tail call i32 (...) @omp_get_num_threads()
%3 = tail call i32 (...) @omp_get_active_level()
%4 = tail call i32 (...) @omp_get_level()
%5 = tail call i32 @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str, i64 0, i64 0), i32 %1, i32 %2, i32 %3, i32 %4)
%6 = tail call i32 (...) @omp_get_thread_num()
%7 = tail call i32 @level2(i32 %6)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
float unpack_ieee754(int /*<<< orphan*/, int, int);
int /*<<< orphan*/ unpack_uint32_t(unsigned char const **, int /*<<< orphan*/ *,
                                   int);
void unpack_float(const unsigned char **bp, float *dst, int endian) {
  uint32_t ieee754_encoded_val = 0;
  unpack_uint32_t(bp, &ieee754_encoded_val, endian);
  *dst = (unpack_ieee754((ieee754_encoded_val), 32, 8));
}


x86 assembly (clang, -O0):
<unpack_float>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%edx
lea    -0x18(%rbp),%rsi
call   1040 <unpack_uint32_t@plt>
mov    -0x18(%rbp),%edi
mov    $0x20,%esi
mov    $0x8,%edx
call   1030 <unpack_ieee754@plt>
mov    -0x10(%rbp),%rax
movss  %xmm0,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<unpack_float>:
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%rbx
movl   $0x0,0xc(%rsp)
lea    0xc(%rsp),%rsi
call   1040 <unpack_uint32_t@plt>
mov    0xc(%rsp),%edi
mov    $0x20,%esi
mov    $0x8,%edx
call   1030 <unpack_ieee754@plt>
movss  %xmm0,(%rbx)
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @unpack_float(i8** %0, float* %1, i32 %2) {
%4 = alloca i8**
%5 = alloca float*
%6 = alloca i32
%7 = alloca i32
store i8** %0, i8*** %4
store float* %1, float** %5
store i32 %2, i32* %6
store i32 0, i32* %7
%8 = load i8**, i8*** %4
%9 = load i32, i32* %6
%10 = call i32 @unpack_uint32_t(i8** %8, i32* %7, i32 %9)
%11 = load i32, i32* %7
%12 = call float @unpack_ieee754(i32 %11, i32 32, i32 8)
%13 = load float*, float** %5
store float %12, float* %13
ret void
}

LLVM IR (-O2):
define void @unpack_float(i8** %0, float* nocapture writeonly %1, i32 %2) {
%4 = alloca i32
%5 = bitcast i32* %4 to i8*
store i32 0, i32* %4
%6 = call i32 @unpack_uint32_t(i8** %0, i32* %4, i32 %2)
%7 = load i32, i32* %4
%8 = call float @unpack_ieee754(i32 %7, i32 32, i32 8)
store float %8, float* %1
ret void
}
/* Type definitions */
typedef int uint8_t;
typedef int uint32_t;
typedef int int32_t;

/* Variables and functions */
int32_t psf_get_le24(uint8_t *ptr, int offset) {
  int32_t value;
  value = ((uint32_t)ptr[offset + 2]) << 24;
  value += ptr[offset + 1] << 16;
  value += ptr[offset] << 8;
  return value;
}


x86 assembly (clang, -O0):
<psf_get_le24>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
add    $0x2,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%eax
shl    $0x18,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%eax
shl    $0x10,%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
shl    $0x8,%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<psf_get_le24>:
movslq %esi,%rcx
mov    0x8(%rdi,%rcx,4),%edx
shl    $0x18,%edx
mov    (%rdi,%rcx,4),%eax
mov    0x4(%rdi,%rcx,4),%ecx
shl    $0x10,%ecx
add    %edx,%ecx
shl    $0x8,%eax
add    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @psf_get_le24(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 = add nsw i32 %7, 2
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds i32, i32* %6, i64 %9
%11 = load i32, i32* %10
%12 = shl i32 %11, 24
store i32 %12, i32* %5
%13 = load i32*, i32** %3
%14 = load i32, i32* %4
%15 = add nsw i32 %14, 1
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds i32, i32* %13, i64 %16
%18 = load i32, i32* %17
%19 = shl i32 %18, 16
%20 = load i32, i32* %5
%21 = add nsw i32 %20, %19
store i32 %21, i32* %5
%22 = load i32*, i32** %3
%23 = load i32, i32* %4
%24 = sext i32 %23 to i64
%25 = getelementptr inbounds i32, i32* %22, i64 %24
%26 = load i32, i32* %25
%27 = shl i32 %26, 8
%28 = load i32, i32* %5
%29 = add nsw i32 %28, %27
store i32 %29, i32* %5
%30 = load i32, i32* %5
ret i32 %30
}

LLVM IR (-O2):
define i32 @psf_get_le24(i32* nocapture %0, i32 %1) {
%3 = add nsw i32 %1, 2
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds i32, i32* %0, i64 %4
%6 = load i32, i32* %5
%7 = shl i32 %6, 24
%8 = add nsw i32 %1, 1
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds i32, i32* %0, i64 %9
%11 = load i32, i32* %10
%12 = shl i32 %11, 16
%13 = add nsw i32 %12, %7
%14 = sext i32 %1 to i64
%15 = getelementptr inbounds i32, i32* %0, i64 %14
%16 = load i32, i32* %15
%17 = shl i32 %16, 8
%18 = add nsw i32 %13, %17
ret i32 %18
}
char _Locale_mon_decimal_point(struct _Locale_monetary *__DUMMY_PAR) {
  return '.';
}


x86 assembly (clang, -O0):
<_Locale_mon_decimal_point>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    $0x2e,%al
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_Locale_mon_decimal_point>:
mov    $0x2e,%al
ret

LLVM IR (-O0):
%struct._Locale_monetary = type opaque
define signext i8 @_Locale_mon_decimal_point(%struct._Locale_monetary* %0) {
%2 = alloca %struct._Locale_monetary*
store %struct._Locale_monetary* %0, %struct._Locale_monetary** %2
ret i8 46
}

LLVM IR (-O2):
%struct._Locale_monetary = type opaque
define signext i8 @_Locale_mon_decimal_point(%struct._Locale_monetary* nocapture readnone %0) {
ret i8 46
}
/* Variables and functions */
int /*<<< orphan*/ notimplemented(char *);
void __svgalib_driverplanar256_nothing(void) {
  {
    notimplemented("planar 256 color mode primitive");
    return;
  };
}


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

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

LLVM IR (-O0):
@.str = [32 x i8] c"planar 256 color mode primitive\00"
define void @__svgalib_driverplanar256_nothing() {
%1 = call i32 @notimplemented(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [32 x i8] c"planar 256 color mode primitive\00"
define void @__svgalib_driverplanar256_nothing() {
%1 = tail call i32 @notimplemented(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
struct timeval {
  scalar_t__ tv_usec;
  scalar_t__ tv_sec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
double ms_time(void) {
  static struct timeval tod;
  gettimeofday(&tod, NULL);
  return ((double)tod.tv_sec * 1000.0 + (double)tod.tv_usec / 1000.0);
}


x86 assembly (clang, -O0):
<ms_time>:
push   %rbp
mov    %rsp,%rbp
lea    0x2f15(%rip),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
cvtsi2sdq 0x2f0b(%rip),%xmm0
cvtsi2sdq 0x2efa(%rip),%xmm1
movsd  0xec2(%rip),%xmm2
divsd  %xmm2,%xmm1
movsd  0xeb6(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<ms_time>:
push   %rax
lea    0x2f18(%rip),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
cvtsi2sdq 0x2f10(%rip),%xmm0
cvtsi2sdq 0x2eff(%rip),%xmm1
movsd  0xec7(%rip),%xmm2
divsd  %xmm2,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
%struct.timeval = type { i64, i64 }
@ms_time.tod = internal global %struct.timeval zeroinitializer
define double @ms_time() {
%1 = call i32 @gettimeofday(%struct.timeval* @ms_time.tod, i32* null)
%2 = load i64, i64* getelementptr inbounds (%struct.timeval, %struct.timeval* @ms_time.tod, i32 0, i32 1)
%3 = sitofp i64 %2 to double
%4 = load i64, i64* getelementptr inbounds (%struct.timeval, %struct.timeval* @ms_time.tod, i32 0, i32 0)
%5 = sitofp i64 %4 to double
%6 = fdiv double %5, 1.000000e+03
%7 = call double @llvm.fmuladd.f64(double %3, double 1.000000e+03, double %6)
ret double %7
}

LLVM IR (-O2):
%struct.timeval = type { i64, i64 }
@ms_time.tod = internal global %struct.timeval zeroinitializer
define double @ms_time() {
%1 = tail call i32 @gettimeofday(%struct.timeval* @ms_time.tod, i32* null)
%2 = load i64, i64* getelementptr inbounds (%struct.timeval, %struct.timeval* @ms_time.tod, i64 0, i32 1)
%3 = sitofp i64 %2 to double
%4 = load i64, i64* getelementptr inbounds (%struct.timeval, %struct.timeval* @ms_time.tod, i64 0, i32 0)
%5 = sitofp i64 %4 to double
%6 = fdiv double %5, 1.000000e+03
%7 = tail call double @llvm.fmuladd.f64(double %3, double 1.000000e+03, double %6)
ret double %7
}
void rop3_228_0_1(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  unsigned char stk3;
  stk3 = T ^ S;
  stk2 = *D & stk3;
  stk1 = S ^ stk2;
  *D = (stk1 & S) | (stk1 & (~T)) | (T & (~S) & *D);
}


x86 assembly (clang, -O0):
<rop3_228_0_1>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
movzbl -0xa(%rbp),%eax
movzbl -0x9(%rbp),%ecx
xor    %ecx,%eax
mov    %al,-0xd(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
movzbl -0xd(%rbp),%ecx
and    %ecx,%eax
mov    %al,-0xc(%rbp)
movzbl -0x9(%rbp),%eax
movzbl -0xc(%rbp),%ecx
xor    %ecx,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
movzbl -0x9(%rbp),%ecx
and    %ecx,%eax
movzbl -0xb(%rbp),%ecx
movzbl -0xa(%rbp),%edx
xor    $0xffffffff,%edx
and    %edx,%ecx
or     %ecx,%eax
movzbl -0xa(%rbp),%ecx
movzbl -0x9(%rbp),%edx
xor    $0xffffffff,%edx
and    %edx,%ecx
mov    -0x8(%rbp),%rdx
movzbl (%rdx),%edx
and    %edx,%ecx
or     %ecx,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rop3_228_0_1>:
mov    %edx,%eax
xor    %sil,%al
mov    (%rdi),%r8b
and    %r8b,%al
xor    %sil,%al
mov    %edx,%ecx
not    %cl
or     %sil,%cl
and    %al,%cl
not    %sil
and    %dl,%sil
and    %r8b,%sil
or     %cl,%sil
mov    %sil,(%rdi)
ret

LLVM IR (-O0):
define void @rop3_228_0_1(i8* %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
%9 = alloca i8
store i8* %0, i8** %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%10 = load i8, i8* %6
%11 = zext i8 %10 to i32
%12 = load i8, i8* %5
%13 = zext i8 %12 to i32
%14 = xor i32 %11, %13
%15 = trunc i32 %14 to i8
store i8 %15, i8* %9
%16 = load i8*, i8** %4
%17 = load i8, i8* %16
%18 = zext i8 %17 to i32
%19 = load i8, i8* %9
%20 = zext i8 %19 to i32
%21 = and i32 %18, %20
%22 = trunc i32 %21 to i8
store i8 %22, i8* %8
%23 = load i8, i8* %5
%24 = zext i8 %23 to i32
%25 = load i8, i8* %8
%26 = zext i8 %25 to i32
%27 = xor i32 %24, %26
%28 = trunc i32 %27 to i8
store i8 %28, i8* %7
%29 = load i8, i8* %7
%30 = zext i8 %29 to i32
%31 = load i8, i8* %5
%32 = zext i8 %31 to i32
%33 = and i32 %30, %32
%34 = load i8, i8* %7
%35 = zext i8 %34 to i32
%36 = load i8, i8* %6
%37 = zext i8 %36 to i32
%38 = xor i32 %37, -1
%39 = and i32 %35, %38
%40 = or i32 %33, %39
%41 = load i8, i8* %6
%42 = zext i8 %41 to i32
%43 = load i8, i8* %5
%44 = zext i8 %43 to i32
%45 = xor i32 %44, -1
%46 = and i32 %42, %45
%47 = load i8*, i8** %4
%48 = load i8, i8* %47
%49 = zext i8 %48 to i32
%50 = and i32 %46, %49
%51 = or i32 %40, %50
%52 = trunc i32 %51 to i8
%53 = load i8*, i8** %4
store i8 %52, i8* %53
ret void
}

LLVM IR (-O2):
define void @rop3_228_0_1(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = xor i8 %2, %1
%5 = load i8, i8* %0
%6 = and i8 %5, %4
%7 = xor i8 %6, %1
%8 = xor i8 %2, -1
%9 = or i8 %8, %1
%10 = and i8 %7, %9
%11 = xor i8 %1, -1
%12 = and i8 %11, %2
%13 = and i8 %12, %5
%14 = or i8 %10, %13
store i8 %14, i8* %0
ret void
}
/* Variables and functions */
int japi_loadimage(char *);
int j_loadimage(char *arg0) { return (japi_loadimage(arg0)); }


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

x86 assembly (clang, -O2):
<j_loadimage>:
jmp    1030 <japi_loadimage@plt>

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

LLVM IR (-O2):
define i32 @j_loadimage(i8* %0) {
%2 = tail call i32 @japi_loadimage(i8* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void usage() {
  printf("Usage: ucwiki [OPTIONS]\n");
  printf("       -i\t: input directory\n");
  printf("       -o\t: output directory\n");
}


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

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

LLVM IR (-O0):
@.str = [25 x i8] c"Usage: ucwiki [OPTIONS]\0A\00"
@.str.1 = [29 x i8] c" -i\09: input directory\0A\00"
@.str.2 = [30 x i8] c" -o\09: output directory\0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [24 x i8] c"Usage: ucwiki [OPTIONS]\00"
@str.3 = [28 x i8] c" -i\09: input directory\00"
@str.4 = [29 x i8] c" -o\09: output directory\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str.3, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @str.4, i64 0, i64 0))
ret void
}
void call4029(void *arg) {
  void (*fn)(void) = arg;
  fn();
}


x86 assembly (clang, -O0):
<call4029>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
call   *-0x10(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<call4029>:
jmp    *%rdi

LLVM IR (-O0):
define void @call4029(i8* %0) {
%2 = alloca i8*
%3 = alloca void ()*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = bitcast i8* %4 to void ()*
store void ()* %5, void ()** %3
%6 = load void ()*, void ()** %3
ret void
}

LLVM IR (-O2):
define void @call4029(i8* nocapture %0) {
%2 = bitcast i8* %0 to void ()*
tail call void %2()
ret void
}
/* Variables and functions */
int IFF_NO_PI;
int IFF_TUN;
int __tuntap_create(char *, int);
int tundev_create(char *tundev_name) {
  return __tuntap_create(tundev_name, IFF_TUN | IFF_NO_PI);
}


x86 assembly (clang, -O0):
<tundev_create>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2eb9(%rip),%rax
mov    (%rax),%esi
mov    0x2ea0(%rip),%rax
or     (%rax),%esi
call   1030 <__tuntap_create@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tundev_create>:
mov    0x2ec9(%rip),%rax
mov    0x2eb2(%rip),%rcx
mov    (%rcx),%esi
or     (%rax),%esi
jmp    1030 <__tuntap_create@plt>

LLVM IR (-O0):
@IFF_TUN = global i32 0
@IFF_NO_PI = global i32 0
define i32 @tundev_create(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i32, i32* @IFF_TUN
%5 = load i32, i32* @IFF_NO_PI
%6 = or i32 %4, %5
%7 = call i32 @__tuntap_create(i8* %3, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
@IFF_TUN = global i32 0
@IFF_NO_PI = global i32 0
define i32 @tundev_create(i8* %0) {
%2 = load i32, i32* @IFF_TUN
%3 = load i32, i32* @IFF_NO_PI
%4 = or i32 %3, %2
%5 = tail call i32 @__tuntap_create(i8* %0, i32 %4)
ret i32 %5
}
int getent(char *cp, char *name) {
  (void)cp;
  (void)name;
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @getent(i8* nocapture readnone %0, i8* nocapture readnone %1) {
ret i32 0
}
int f3(char *x) {
  int i = 2;
  if (x)
    return x[i - 1];
  return x[i + 1];
}


x86 assembly (clang, -O0):
<f3>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
movl   $0x2,-0x14(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1133 <f3+0x33>
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%eax
mov    %eax,-0x4(%rbp)
jmp    1147 <f3+0x47>
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f3>:
lea    0x1(%rdi),%rax
test   %rdi,%rdi
mov    $0x3,%ecx
cmovne %rax,%rcx
movsbl (%rcx),%eax
ret

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

LLVM IR (-O2):
define i32 @f3(i8* %0) {
%2 = icmp eq i8* %0, null
%3 = getelementptr inbounds i8, i8* %0, i64 1
%4 = select i1 %2, i8* inttoptr (i64 3 to i8*), i8* %3
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, char *);
int main() {
  char szName[128];
  printf("What is your name? ");
  scanf("%s", szName);
  printf("Hello %s!\n", szName);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x80,%rsp
lea    0xed1(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xed7(%rip),%rdi
mov    %rsp,%rbx
mov    %rbx,%rsi
call   1040 <scanf@plt>
lea    0xec8(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x80,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [20 x i8] c"What is your name? \00"
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [11 x i8] c"Hello %s!\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [128 x i8]
store i32 0, i32* %1
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%4 = getelementptr inbounds [128 x i8], [128 x i8]* %2, i64 0, i64 0
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %4)
%6 = getelementptr inbounds [128 x i8], [128 x i8]* %2, i64 0, i64 0
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), i8* %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [20 x i8] c"What is your name? \00"
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [11 x i8] c"Hello %s!\0A\00"
define i32 @main() {
%1 = alloca [128 x i8]
%2 = getelementptr inbounds [128 x i8], [128 x i8]* %1, i64 0, i64 0
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %2)
%5 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), i8* %2)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
void sigHandler(int sig) { exit(3); }


x86 assembly (clang, -O0):
<sigHandler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x3,%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<sigHandler>:
push   %rax
mov    $0x3,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
define void @sigHandler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @exit(i32 3)
unreachable
}

LLVM IR (-O2):
define void @sigHandler(i32 %0) {
%2 = tail call i32 @exit(i32 3)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ isspace(char const);
size_t wordlen(const char *s) {
  size_t len = 0;
  while (*s && !isspace(*s)) {
    len++;
    s++;
  }
  return len;
}


x86 assembly (clang, -O0):
<wordlen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x11(%rbp)
je     1150 <wordlen+0x40>
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <isspace@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    1160 <wordlen+0x50>
jmp    117d <wordlen+0x6d>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1124 <wordlen+0x14>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wordlen>:
push   %r14
push   %rbx
push   %rax
mov    (%rdi),%al
test   %al,%al
je     113c <wordlen+0x2c>
mov    %rdi,%r14
xor    %ebx,%ebx
nop
movsbl %al,%edi
call   1030 <isspace@plt>
test   %eax,%eax
jne    113e <wordlen+0x2e>
movzbl 0x1(%r14,%rbx,1),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <wordlen+0x10>
jmp    113e <wordlen+0x2e>
xor    %ebx,%ebx
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i64 @wordlen(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
store i8* %0, i8** %2
store i64 0, i64* %3
br label %4
4: ; preds = %17, %1
%5 = load i8*, i8** %2
%6 = load i8, i8* %5
%7 = sext i8 %6 to i32
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %15
9: ; preds = %4
%10 = load i8*, i8** %2
%11 = load i8, i8* %10
%12 = call i32 @isspace(i8 signext %11)
%13 = icmp ne i32 %12, 0
%14 = xor i1 %13, true
br label %15
15: ; preds = %9, %4
%16 = phi i1 [ false, %4 ], [ %14, %9 ]
br i1 %16, label %17, label %22
17: ; preds = %15
%18 = load i64, i64* %3
%19 = add i64 %18, 1
store i64 %19, i64* %3
%20 = load i8*, i8** %2
%21 = getelementptr inbounds i8, i8* %20, i32 1
store i8* %21, i8** %2
br label %4
22: ; preds = %15
%23 = load i64, i64* %3
ret i64 %23
}

LLVM IR (-O2):
define i64 @wordlen(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %15, label %4
4: ; preds = %1, %10
%5 = phi i8 [ %13, %10 ], [ %2, %1 ]
%6 = phi i64 [ %11, %10 ], [ 0, %1 ]
%7 = phi i8* [ %12, %10 ], [ %0, %1 ]
%8 = tail call i32 @isspace(i8 signext %5)
%9 = icmp eq i32 %8, 0
br i1 %9, label %10, label %15
10: ; preds = %4
%11 = add i64 %6, 1
%12 = getelementptr inbounds i8, i8* %7, i64 1
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %4
15: ; preds = %4, %10, %1
%16 = phi i64 [ 0, %1 ], [ %11, %10 ], [ %6, %4 ]
ret i64 %16
}
void test2(int a) {
  int *p = &a;
  int b = 2;
  __asm__("movl $5, %0 \n"
          "movl $6, %1 \n"
          : "=m"(*p), "=m"(b)
          :);
  assert(a == 5);
  assert(b == 6);
}


x86 assembly (clang, -O0):
<test2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
lea    -0x4(%rbp),%rax
mov    %rax,-0x10(%rbp)
movl   $0x2,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movl   $0x5,(%rax)
movl   $0x6,-0x14(%rbp)
cmpl   $0x5,-0x4(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
mov    $0x0,%al
call   1030 <assert@plt>
cmpl   $0x6,-0x14(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
mov    $0x0,%al
call   1030 <assert@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test2>:
push   %rax
mov    %edi,0x4(%rsp)
movl   $0x2,(%rsp)
movl   $0x5,0x4(%rsp)
movl   $0x6,(%rsp)
xor    %edi,%edi
cmpl   $0x5,0x4(%rsp)
sete   %dil
xor    %eax,%eax
call   1030 <assert@plt>
xor    %edi,%edi
cmpl   $0x6,(%rsp)
sete   %dil
xor    %eax,%eax
call   1030 <assert@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @test2(i32 %0) {
%2 = alloca i32
%3 = alloca i32*
%4 = alloca i32
store i32 %0, i32* %2
store i32* %2, i32** %3
store i32 2, i32* %4
%5 = load i32*, i32** %3
%6 = load i32, i32* %2
%7 = icmp eq i32 %6, 5
%8 = zext i1 %7 to i32
%9 = call i32 (i32, ...) bitcast (i32 (...)* @assert to i32 (i32, ...)*)(i32 %8)
%10 = load i32, i32* %4
%11 = icmp eq i32 %10, 6
%12 = zext i1 %11 to i32
%13 = call i32 (i32, ...) bitcast (i32 (...)* @assert to i32 (i32, ...)*)(i32 %12)
ret void
}

LLVM IR (-O2):
define void @test2(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = bitcast i32* %3 to i8*
store i32 2, i32* %3
%5 = load i32, i32* %2
%6 = icmp eq i32 %5, 5
%7 = zext i1 %6 to i32
%8 = call i32 (i32, ...) bitcast (i32 (...)* @assert to i32 (i32, ...)*)(i32 %7)
%9 = load i32, i32* %3
%10 = icmp eq i32 %9, 6
%11 = zext i1 %10 to i32
%12 = call i32 (i32, ...) bitcast (i32 (...)* @assert to i32 (i32, ...)*)(i32 %11)
ret void
}