xunge/DecIR huggingface dataset:
int max3(int a, int b, int c) {
  if (a < b) {
    if (b < c) {
      return c;
    }
    return b;
  }
  if (a < c) {
    return c;
  }
  return a;
}


x86 assembly (clang, -O0):
<max3>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    113b <max3+0x3b>
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1130 <max3+0x30>
mov    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1158 <max3+0x58>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1158 <max3+0x58>
mov    -0x8(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1152 <max3+0x52>
mov    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1158 <max3+0x58>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @max3(i32 %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %1, %2
%5 = select i1 %4, i32 %2, i32 %1
%6 = icmp sgt i32 %5, %0
%7 = select i1 %6, i32 %5, i32 %0
ret i32 %7
}
/* Variables and functions */
scalar_t__ wild_match(char const *, char const *);
int star(const char *string, const char *pattern) {
  while (wild_match(string, pattern) == 0)
    if (*++string == '\0')
      return 0;
  return 1;
}


x86 assembly (clang, -O0):
<star>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <wild_match@plt>
cmp    $0x0,%rax
jne    1164 <star+0x54>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movsbl 0x1(%rax),%eax
cmp    $0x0,%eax
jne    115f <star+0x4f>
movl   $0x0,-0x4(%rbp)
jmp    116b <star+0x5b>
jmp    1120 <star+0x10>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<star>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
nopw   0x0(%rax,%rax,1)
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <wild_match@plt>
test   %rax,%rax
jne    113e <star+0x2e>
cmpb   $0x0,0x1(%rbx)
lea    0x1(%rbx),%rbx
jne    1120 <star+0x10>
xor    %eax,%eax
jmp    1143 <star+0x33>
mov    $0x1,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i32 @star(i8* %0, i8* %1) {
br label %3
3: ; preds = %7, %2
%4 = phi i8* [ %0, %2 ], [ %8, %7 ]
%5 = tail call i64 @wild_match(i8* %4, i8* %1)
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %11
7: ; preds = %3
%8 = getelementptr inbounds i8, i8* %4, i64 1
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %3
11: ; preds = %3, %7
%12 = phi i32 [ 0, %7 ], [ 1, %3 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("Open Source SW Project \n");
  printf("First GitHub Tranning \n");
  printf("Hey 모두들 안녕 내 누군지 아니?");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [25 x i8] c"Open Source SW Project \0A\00"
@.str.1 = [24 x i8] c"First GitHub Tranning \0A\00"
@.str.2 = [43 x i8] c"Hey \EB\AA\A8\EB\91\90\EB\93\A4 \EC\95\88\EB\85\95 \EB\82\B4 \EB\88\84\EA\B5\B0\EC\A7\80 \EC\95\84\EB\8B\88?\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str.2 = [43 x i8] c"Hey \EB\AA\A8\EB\91\90\EB\93\A4 \EC\95\88\EB\85\95 \EB\82\B4 \EB\88\84\EA\B5\B0\EC\A7\80 \EC\95\84\EB\8B\88?\00"
@str = [24 x i8] c"Open Source SW Project \00"
@str.3 = [23 x i8] c"First GitHub Tranning \00"
define i32 @main() {
%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 ([23 x i8], [23 x i8]* @str.3, i64 0, i64 0))
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
struct jit_state {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ emit1(struct jit_state *, int);
int /*<<< orphan*/ emit_basic_rex(struct jit_state *, int /*<<< orphan*/,
                                  int /*<<< orphan*/, int);
void emit_push(struct jit_state *state, int r) {
  emit_basic_rex(state, 0, 0, r);
  emit1(state, 0x50 | (r & 7));
}


x86 assembly (clang, -O0):
<emit_push>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%ecx
xor    %edx,%edx
mov    %edx,%esi
call   1040 <emit_basic_rex@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
and    $0x7,%esi
or     $0x50,%esi
call   1030 <emit1@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<emit_push>:
push   %r14
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %rdi,%r14
xor    %esi,%esi
xor    %edx,%edx
mov    %ebx,%ecx
call   1040 <emit_basic_rex@plt>
and    $0x7,%ebx
or     $0x50,%ebx
mov    %r14,%rdi
mov    %ebx,%esi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <emit1@plt>

LLVM IR (-O0):
%struct.jit_state = type { i32 }
define void @emit_push(%struct.jit_state* %0, i32 %1) {
%3 = alloca %struct.jit_state*
%4 = alloca i32
store %struct.jit_state* %0, %struct.jit_state** %3
store i32 %1, i32* %4
%5 = load %struct.jit_state*, %struct.jit_state** %3
%6 = load i32, i32* %4
%7 = call i32 @emit_basic_rex(%struct.jit_state* %5, i32 0, i32 0, i32 %6)
%8 = load %struct.jit_state*, %struct.jit_state** %3
%9 = load i32, i32* %4
%10 = and i32 %9, 7
%11 = or i32 80, %10
%12 = call i32 @emit1(%struct.jit_state* %8, i32 %11)
ret void
}

LLVM IR (-O2):
%struct.jit_state = type { i32 }
define void @emit_push(%struct.jit_state* %0, i32 %1) {
%3 = tail call i32 @emit_basic_rex(%struct.jit_state* %0, i32 0, i32 0, i32 %1)
%4 = and i32 %1, 7
%5 = or i32 %4, 80
%6 = tail call i32 @emit1(%struct.jit_state* %0, i32 %5)
ret void
}
/* Type definitions */
typedef int uint8_t;
typedef int uint16_t;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int getc(int /*<<< orphan*/ *);
void freadushort(uint16_t *ptr, FILE *fd) {
  uint16_t tmp;
  uint8_t t1, t2;
  t1 = getc(fd);
  t2 = getc(fd);
  tmp = t2;
  tmp = tmp * 256 + t1;
  *ptr = tmp;
}


x86 assembly (clang, -O0):
<freadushort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <getc@plt>
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <getc@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
shl    $0x8,%eax
add    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<freadushort>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1030 <getc@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1030 <getc@plt>
shl    $0x8,%eax
add    %ebp,%eax
mov    %eax,(%r14)
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define void @freadushort(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32* %0, i32** %3
store i32* %1, i32** %4
%8 = load i32*, i32** %4
%9 = call i32 @getc(i32* %8)
store i32 %9, i32* %6
%10 = load i32*, i32** %4
%11 = call i32 @getc(i32* %10)
store i32 %11, i32* %7
%12 = load i32, i32* %7
store i32 %12, i32* %5
%13 = load i32, i32* %5
%14 = mul nsw i32 %13, 256
%15 = load i32, i32* %6
%16 = add nsw i32 %14, %15
store i32 %16, i32* %5
%17 = load i32, i32* %5
%18 = load i32*, i32** %3
store i32 %17, i32* %18
ret void
}

LLVM IR (-O2):
define void @freadushort(i32* nocapture writeonly %0, i32* nocapture %1) {
%3 = tail call i32 @getc(i32* %1)
%4 = tail call i32 @getc(i32* %1)
%5 = shl nsw i32 %4, 8
%6 = add nsw i32 %5, %3
store i32 %6, i32* %0
ret void
}
int abs(int n) {
  int m;
  if (n >= 0)
    m = n;
  else
    m = -n;
  return m;
}


x86 assembly (clang, -O0):
<abs>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jl     111c <abs+0x1c>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    1124 <abs+0x24>
xor    %eax,%eax
sub    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<abs>:
mov    %edi,%eax
neg    %eax
cmovs  %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @abs(i32 %0) {
%2 = tail call i32 @llvm.abs.i32(i32 %0, i1 true)
ret i32 %2
}
void setval_248(unsigned *p) { *p = 3674787457U; }


x86 assembly (clang, -O0):
<setval_248>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movl   $0xdb08ce81,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<setval_248>:
movl   $0xdb08ce81,(%rdi)
ret

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

LLVM IR (-O2):
define void @setval_248(i32* nocapture writeonly %0) {
store i32 -620179839, i32* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ aux_carry_flag_add_test();
int /*<<< orphan*/ aux_carry_flag_sub_test();
int /*<<< orphan*/ carry_flag_add_test();
int /*<<< orphan*/ carry_flag_sub_test();
int /*<<< orphan*/ parity_flag_test();
int /*<<< orphan*/ sign_flag_test();
int /*<<< orphan*/ zero_flag_test();
int main(int argc, const char *argv[]) {
  zero_flag_test();
  sign_flag_test();
  parity_flag_test();
  carry_flag_add_test();
  carry_flag_sub_test();
  aux_carry_flag_add_test();
  aux_carry_flag_sub_test();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <zero_flag_test@plt>
mov    $0x0,%al
call   1070 <sign_flag_test@plt>
mov    $0x0,%al
call   1060 <parity_flag_test@plt>
mov    $0x0,%al
call   1040 <carry_flag_add_test@plt>
mov    $0x0,%al
call   1080 <carry_flag_sub_test@plt>
mov    $0x0,%al
call   1050 <aux_carry_flag_add_test@plt>
mov    $0x0,%al
call   1090 <aux_carry_flag_sub_test@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <zero_flag_test@plt>
xor    %eax,%eax
call   1070 <sign_flag_test@plt>
xor    %eax,%eax
call   1060 <parity_flag_test@plt>
xor    %eax,%eax
call   1040 <carry_flag_add_test@plt>
xor    %eax,%eax
call   1080 <carry_flag_sub_test@plt>
xor    %eax,%eax
call   1050 <aux_carry_flag_add_test@plt>
xor    %eax,%eax
call   1090 <aux_carry_flag_sub_test@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 (...) @zero_flag_test()
%7 = call i32 (...) @sign_flag_test()
%8 = call i32 (...) @parity_flag_test()
%9 = call i32 (...) @carry_flag_add_test()
%10 = call i32 (...) @carry_flag_sub_test()
%11 = call i32 (...) @aux_carry_flag_add_test()
%12 = call i32 (...) @aux_carry_flag_sub_test()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @zero_flag_test()
%4 = tail call i32 (...) @sign_flag_test()
%5 = tail call i32 (...) @parity_flag_test()
%6 = tail call i32 (...) @carry_flag_add_test()
%7 = tail call i32 (...) @carry_flag_sub_test()
%8 = tail call i32 (...) @aux_carry_flag_add_test()
%9 = tail call i32 (...) @aux_carry_flag_sub_test()
ret i32 0
}
int matsu_c(int ii, char cc) {
  printf("%s -- start\n", __func__);
  printf("%s -- exit\n", __func__);
  return 0;
}


x86 assembly (clang, -O0):
<matsu_c>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %edi,-0x4(%rbp)
mov    %al,-0x5(%rbp)
lea    0xed8(%rip),%rdi
lea    0xede(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xed8(%rip),%rdi
lea    0xec9(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<matsu_c>:
push   %rbx
lea    0xee8(%rip),%rdi
lea    0xeee(%rip),%rbx
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xee5(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [13 x i8] c"%s -- start\0A\00"
@__func__.matsu_c = [8 x i8] c"matsu_c\00"
@.str.1 = [12 x i8] c"%s -- exit\0A\00"
define i32 @matsu_c(i32 %0, i8 signext %1) {
%3 = alloca i32
%4 = alloca i8
store i32 %0, i32* %3
store i8 %1, i8* %4
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @__func__.matsu_c, i64 0, i64 0))
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @__func__.matsu_c, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [13 x i8] c"%s -- start\0A\00"
@__func__.matsu_c = [8 x i8] c"matsu_c\00"
@.str.1 = [12 x i8] c"%s -- exit\0A\00"
define i32 @matsu_c(i32 %0, i8 signext %1) {
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @__func__.matsu_c, i64 0, i64 0))
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @__func__.matsu_c, i64 0, i64 0))
ret i32 0
}
int config_mem(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @config_mem() {
ret i32 0
}
/* Variables and functions */
int chdir(void *);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ pthread_exit(void *);
void *routine(void *path) {
  int status;
  status = chdir(path);
  if (status < 0) {
    perror("chdir");
    pthread_exit((void *)-1);
  }
  pthread_exit(NULL);
}


x86 assembly (clang, -O0):
<routine>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <chdir@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jge    116a <routine+0x3a>
lea    0xea7(%rip),%rdi
call   1050 <perror@plt>
mov    $0xffffffffffffffff,%rdi
call   1040 <pthread_exit@plt>
xor    %eax,%eax
mov    %eax,%edi
call   1040 <pthread_exit@plt>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<routine>:
push   %rax
call   1030 <chdir@plt>
test   %eax,%eax
js     1142 <routine+0x12>
xor    %edi,%edi
pop    %rax
jmp    1040 <pthread_exit@plt>
lea    0xeb7(%rip),%rdi
call   1050 <perror@plt>
mov    $0xffffffffffffffff,%rdi
call   1040 <pthread_exit@plt>
jmp    113a <routine+0xa>

LLVM IR (-O0):
@.str = [6 x i8] c"chdir\00"
define i8* @routine(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i32 @chdir(i8* %5)
store i32 %6, i32* %4
%7 = load i32, i32* %4
%8 = icmp slt i32 %7, 0
br i1 %8, label %9, label %12
9: ; preds = %1
%10 = call i32 @perror(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%11 = call i32 @pthread_exit(i8* inttoptr (i64 -1 to i8*))
br label %12
12: ; preds = %9, %1
%13 = call i32 @pthread_exit(i8* null)
%14 = load i8*, i8** %2
ret i8* %14
}

LLVM IR (-O2):
@.str = [6 x i8] c"chdir\00"
define noalias i8* @routine(i8* %0) {
%2 = tail call i32 @chdir(i8* %0)
%3 = icmp slt i32 %2, 0
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = tail call i32 @perror(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%6 = tail call i32 @pthread_exit(i8* inttoptr (i64 -1 to i8*))
br label %7
7: ; preds = %4, %1
%8 = tail call i32 @pthread_exit(i8* null)
ret i8* undef
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void eval_continue(void) { fprintf(stderr, "continue;"); }


x86 assembly (clang, -O0):
<eval_continue>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<eval_continue>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [10 x i8] c"continue;\00"
define void @eval_continue() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [10 x i8] c"continue;\00"
define void @eval_continue() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ charatatime(char *);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int fork();
int main(void) {
  int pid = fork();
  if (pid == 0) {
    charatatime("output from child\n");
  } else {
    charatatime("output from parent\n");
  }
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1050 <fork@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1164 <main+0x34>
lea    0xea6(%rip),%rdi
call   1030 <charatatime@plt>
jmp    1170 <main+0x40>
lea    0xea8(%rip),%rdi
call   1030 <charatatime@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1050 <fork@plt>
test   %eax,%eax
lea    0xebf(%rip),%rax
lea    0xecb(%rip),%rdi
cmove  %rax,%rdi
call   1030 <charatatime@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [19 x i8] c"output from child\0A\00"
@.str.1 = [20 x i8] c"output from parent\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 (...) @fork()
store i32 %3, i32* %2
%4 = load i32, i32* %2
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %0
%7 = call i32 @charatatime(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
br label %10
8: ; preds = %0
%9 = call i32 @charatatime(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0))
br label %10
10: ; preds = %8, %6
%11 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [19 x i8] c"output from child\0A\00"
@.str.1 = [20 x i8] c"output from parent\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @fork()
%2 = icmp eq i32 %1, 0
%3 = select i1 %2, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0)
%4 = tail call i32 @charatatime(i8* %3)
%5 = tail call i32 @exit(i32 0)
unreachable
}
int get_cc_mode_state() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @get_cc_mode_state() {
ret i32 0
}
unsigned char *int_serialize(unsigned char *buffer, int n) {
  buffer[0] = n >> 8;
  buffer[1] = n;
  return (buffer + (sizeof(int) / 2));
}


x86 assembly (clang, -O0):
<int_serialize>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
sar    $0x8,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0xc(%rbp),%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x1(%rax)
mov    -0x8(%rbp),%rax
add    $0x2,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<int_serialize>:
rol    $0x8,%si
mov    %si,(%rdi)
lea    0x2(%rdi),%rax
ret

LLVM IR (-O0):
define i8* @int_serialize(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = ashr i32 %5, 8
%7 = trunc i32 %6 to i8
%8 = load i8*, i8** %3
%9 = getelementptr inbounds i8, i8* %8, i64 0
store i8 %7, i8* %9
%10 = load i32, i32* %4
%11 = trunc i32 %10 to i8
%12 = load i8*, i8** %3
%13 = getelementptr inbounds i8, i8* %12, i64 1
store i8 %11, i8* %13
%14 = load i8*, i8** %3
%15 = getelementptr inbounds i8, i8* %14, i64 2
ret i8* %15
}

LLVM IR (-O2):
define i8* @int_serialize(i8* writeonly %0, i32 %1) {
%3 = lshr i32 %1, 8
%4 = trunc i32 %3 to i8
store i8 %4, i8* %0
%5 = trunc i32 %1 to i8
%6 = getelementptr inbounds i8, i8* %0, i64 1
store i8 %5, i8* %6
%7 = getelementptr inbounds i8, i8* %0, i64 2
ret i8* %7
}
/* Variables and functions */
int /*<<< orphan*/ uart_poll_tx_byte(int, float);
int freeloader_main() {
  int i;
  while (1) {
    uart_poll_tx_byte(1, 'F');
    for (i = 0; i < 1000000; i++)
      ;
  }
}


x86 assembly (clang, -O0):
<freeloader_main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x1,%edi
movss  0xedb(%rip),%xmm0
call   1030 <uart_poll_tx_byte@plt>
movl   $0x0,-0x4(%rbp)
cmpl   $0xf4240,-0x4(%rbp)
jge    1151 <freeloader_main+0x41>
jmp    1143 <freeloader_main+0x33>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1131 <freeloader_main+0x21>
jmp    1118 <freeloader_main+0x8>

x86 assembly (clang, -O2):
<freeloader_main>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    $0x1,%edi
movss  0xed3(%rip),%xmm0
call   1030 <uart_poll_tx_byte@plt>
jmp    1120 <freeloader_main+0x10>

LLVM IR (-O0):
define i32 @freeloader_main() {
%1 = alloca i32
br label %2
2: ; preds = %0, %11
%3 = call i32 @uart_poll_tx_byte(i32 1, float 7.000000e+01)
store i32 0, i32* %1
br label %4
4: ; preds = %8, %2
%5 = load i32, i32* %1
%6 = icmp slt i32 %5, 1000000
br i1 %6, label %7, label %11
7: ; preds = %4
br label %8
8: ; preds = %7
%9 = load i32, i32* %1
%10 = add nsw i32 %9, 1
store i32 %10, i32* %1
br label %4
11: ; preds = %4
br label %2
}

LLVM IR (-O2):
define i32 @freeloader_main() {
br label %1
1: ; preds = %1, %0
%2 = tail call i32 @uart_poll_tx_byte(i32 1, float 7.000000e+01)
br label %1
}
/* Variables and functions */
scalar_t__ calloc(long, int);
char *make_buffer_of_size(long int length) {
  if (length <= 0)
    length = 1;
  return (char *)calloc(length, sizeof(char));
}


x86 assembly (clang, -O0):
<make_buffer_of_size>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jg     112f <make_buffer_of_size+0x1f>
movq   $0x1,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x1,%esi
call   1030 <calloc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<make_buffer_of_size>:
test   %rdi,%rdi
mov    $0x1,%eax
cmovle %rax,%rdi
mov    $0x1,%esi
jmp    1030 <calloc@plt>

LLVM IR (-O0):
define i8* @make_buffer_of_size(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = icmp sle i64 %3, 0
br i1 %4, label %5, label %6
5: ; preds = %1
store i64 1, i64* %2
br label %6
6: ; preds = %5, %1
%7 = load i64, i64* %2
%8 = call i64 @calloc(i64 %7, i32 1)
%9 = inttoptr i64 %8 to i8*
ret i8* %9
}

LLVM IR (-O2):
define i8* @make_buffer_of_size(i64 %0) {
%2 = icmp sgt i64 %0, 1
%3 = select i1 %2, i64 %0, i64 1
%4 = tail call i64 @calloc(i64 %3, i32 1)
%5 = inttoptr i64 %4 to i8*
ret i8* %5
}
void rop3_115_0_0(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  unsigned char stk3;
  stk3 = ~T;
  stk2 = *D | stk3;
  stk1 = S & stk2;
  stk1 = ~stk1;
  *D = stk1;
}


x86 assembly (clang, -O0):
<rop3_115_0_0>:
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
xor    $0xffffffff,%eax
mov    %al,-0xd(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
movzbl -0xd(%rbp),%ecx
or     %ecx,%eax
mov    %al,-0xc(%rbp)
movzbl -0x9(%rbp),%eax
movzbl -0xc(%rbp),%ecx
and    %ecx,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
xor    $0xffffffff,%eax
mov    %al,-0xb(%rbp)
mov    -0xb(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rop3_115_0_0>:
not    %dl
or     (%rdi),%dl
and    %sil,%dl
not    %dl
mov    %dl,(%rdi)
ret

LLVM IR (-O0):
define void @rop3_115_0_0(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 = xor i32 %11, -1
%13 = trunc i32 %12 to i8
store i8 %13, i8* %9
%14 = load i8*, i8** %4
%15 = load i8, i8* %14
%16 = zext i8 %15 to i32
%17 = load i8, i8* %9
%18 = zext i8 %17 to i32
%19 = or i32 %16, %18
%20 = trunc i32 %19 to i8
store i8 %20, i8* %8
%21 = load i8, i8* %5
%22 = zext i8 %21 to i32
%23 = load i8, i8* %8
%24 = zext i8 %23 to i32
%25 = and i32 %22, %24
%26 = trunc i32 %25 to i8
store i8 %26, i8* %7
%27 = load i8, i8* %7
%28 = zext i8 %27 to i32
%29 = xor i32 %28, -1
%30 = trunc i32 %29 to i8
store i8 %30, i8* %7
%31 = load i8, i8* %7
%32 = load i8*, i8** %4
store i8 %31, i8* %32
ret void
}

LLVM IR (-O2):
define void @rop3_115_0_0(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = xor i8 %2, -1
%5 = load i8, i8* %0
%6 = or i8 %5, %4
%7 = and i8 %6, %1
%8 = xor i8 %7, -1
store i8 %8, i8* %0
ret void
}
int compare_double(const void *a, const void *b) {
  double da;
  double db;
  da = *(double *)a;
  db = *(double *)b;
  if (da > db)
    return 1;
  if (da == db)
    return 0;
  return -1;
}


x86 assembly (clang, -O0):
<compare_double>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x20(%rbp)
mov    -0x18(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x20(%rbp),%xmm0
ucomisd -0x28(%rbp),%xmm0
jbe    1142 <compare_double+0x42>
movl   $0x1,-0x4(%rbp)
jmp    116b <compare_double+0x6b>
movsd  -0x20(%rbp),%xmm0
ucomisd -0x28(%rbp),%xmm0
jne    1164 <compare_double+0x64>
jp     1164 <compare_double+0x64>
movl   $0x0,-0x4(%rbp)
jmp    116b <compare_double+0x6b>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<compare_double>:
movsd  (%rdi),%xmm0
movsd  (%rsi),%xmm1
ucomisd %xmm1,%xmm0
cmpneqsd %xmm1,%xmm0
movq   %xmm0,%rcx
mov    $0x1,%eax
cmovbe %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @compare_double(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to double*
%4 = load double, double* %3
%5 = bitcast i8* %1 to double*
%6 = load double, double* %5
%7 = fcmp ogt double %4, %6
%8 = fcmp une double %4, %6
%9 = sext i1 %8 to i32
%10 = select i1 %7, i32 1, i32 %9
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ e_izpy();
int /*<<< orphan*/ e_lda();
void e_lda_izpy() {
  e_izpy();
  e_lda();
}


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

x86 assembly (clang, -O2):
<e_lda_izpy>:
push   %rax
xor    %eax,%eax
call   1030 <e_izpy@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <e_lda@plt>

LLVM IR (-O0):
define void @e_lda_izpy() {
%1 = call i32 (...) @e_izpy()
%2 = call i32 (...) @e_lda()
ret void
}

LLVM IR (-O2):
define void @e_lda_izpy() {
%1 = tail call i32 (...) @e_izpy()
%2 = tail call i32 (...) @e_lda()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Msp430GpioC__1__GeneralIO__set();
void CC2420TransmitP__CSN__set(void) { Msp430GpioC__1__GeneralIO__set(); }


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

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

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

LLVM IR (-O2):
define void @CC2420TransmitP__CSN__set() {
%1 = tail call i32 (...) @Msp430GpioC__1__GeneralIO__set()
ret void
}
/* Variables and functions */
unsigned int htonl(unsigned int);
unsigned int host_int_to_network(unsigned int x) { return htonl(x); }


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

x86 assembly (clang, -O2):
<host_int_to_network>:
jmp    1030 <htonl@plt>

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

LLVM IR (-O2):
define i32 @host_int_to_network(i32 %0) {
%2 = tail call i32 @htonl(i32 %0)
ret i32 %2
}
unsigned int f2u(float x) {
  union {
    float f;
    unsigned int u;
  } cvt;
  cvt.f = x;
  return cvt.u;
}


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

x86 assembly (clang, -O2):
<f2u>:
movd   %xmm0,%eax
ret

LLVM IR (-O0):
%union.anon = type { float }
define i32 @f2u(float %0) {
%2 = alloca float
%3 = alloca %union.anon
store float %0, float* %2
%4 = load float, float* %2
%5 = bitcast %union.anon* %3 to float*
store float %4, float* %5
%6 = bitcast %union.anon* %3 to i32*
%7 = load i32, i32* %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @f2u(float %0) {
%2 = bitcast float %0 to i32
ret i32 %2
}
/* Variables and functions */
int strlen(char *);
char toupper(char);
void upcase(char *S) {
  int i, len;
  len = strlen(S);
  for (i = 0; i < len; i++)
    S[i] = toupper(S[i]);
}


x86 assembly (clang, -O0):
<upcase>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,-0x10(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1177 <upcase+0x57>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1030 <toupper@plt>
mov    %al,%dl
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    113f <upcase+0x1f>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<upcase>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r15
call   1040 <strlen@plt>
test   %eax,%eax
jle    1157 <upcase+0x37>
mov    %eax,%r14d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
movsbl (%r15,%rbx,1),%edi
call   1030 <toupper@plt>
mov    %al,(%r15,%rbx,1)
add    $0x1,%rbx
cmp    %rbx,%r14
jne    1140 <upcase+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @upcase(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = icmp sgt i32 %2, 0
br i1 %3, label %4, label %13
4: ; preds = %1
%5 = zext i32 %2 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i8, i8* %0, i64 %7
%9 = load i8, i8* %8
%10 = tail call signext i8 @toupper(i8 signext %9)
store i8 %10, i8* %8
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %1
ret void
}
int test5(unsigned int x) { return (x < 0) && (0 > x) && (x >= 0) && (0 <= x); }


x86 assembly (clang, -O0):
<test5>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jae    1140 <test5+0x40>
xor    %eax,%eax
xor    %ecx,%ecx
cmp    -0x4(%rbp),%ecx
mov    %al,-0x5(%rbp)
jbe    1140 <test5+0x40>
xor    %eax,%eax
cmpl   $0x0,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jb     1140 <test5+0x40>
xor    %eax,%eax
cmp    -0x4(%rbp),%eax
setbe  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test5(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ult i32 %3, 0
br i1 %4, label %5, label %14
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp ugt i32 0, %6
br i1 %7, label %8, label %14
8: ; preds = %5
%9 = load i32, i32* %2
%10 = icmp uge i32 %9, 0
br i1 %10, label %11, label %14
11: ; preds = %8
%12 = load i32, i32* %2
%13 = icmp ule i32 0, %12
br label %14
14: ; preds = %11, %8, %5, %1
%15 = phi i1 [ false, %8 ], [ false, %5 ], [ false, %1 ], [ %13, %11 ]
%16 = zext i1 %15 to i32
ret i32 %16
}

LLVM IR (-O2):
define i32 @test5(i32 %0) {
ret i32 0
}
void rtl_checkPathName(char *path) {
  while (*path) {
    if (!(((*path) == '/') || ((*path) == '\\'))) {
      path++;
      continue;
    }
    *path++ = '/';
  }
}


x86 assembly (clang, -O0):
<rtl_checkPathName>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     115d <rtl_checkPathName+0x5d>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2f,%eax
je     1146 <rtl_checkPathName+0x46>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x5c,%eax
je     1146 <rtl_checkPathName+0x46>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1108 <rtl_checkPathName+0x8>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movb   $0x2f,(%rax)
jmp    1108 <rtl_checkPathName+0x8>
pop    %rbp
ret

x86 assembly (clang, -O2):
<rtl_checkPathName>:
jmp    1117 <rtl_checkPathName+0x17>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movb   $0x2f,(%rdi)
add    $0x1,%rdi
movzbl (%rdi),%eax
cmp    $0x2f,%al
je     1110 <rtl_checkPathName+0x10>
cmp    $0x5c,%al
je     1110 <rtl_checkPathName+0x10>
test   %al,%al
je     112c <rtl_checkPathName+0x2c>
add    $0x1,%rdi
jmp    1117 <rtl_checkPathName+0x17>
ret

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

LLVM IR (-O2):
define void @rtl_checkPathName(i8* nocapture %0) {
br label %2
2: ; preds = %5, %1
%3 = phi i8* [ %0, %1 ], [ %6, %5 ]
%4 = load i8, i8* %3
switch i8 %4, label %5 [
i8 0, label %8
i8 47, label %7
i8 92, label %7
]
5: ; preds = %2, %7
%6 = getelementptr inbounds i8, i8* %3, i64 1
br label %2
7: ; preds = %2, %2
store i8 47, i8* %3
br label %5
8: ; preds = %2
ret void
}
/* Variables and functions */
int mount(int /*<<< orphan*/ *, char *, char *, int /*<<< orphan*/,
          int /*<<< orphan*/ *);
void mount_procfs(void) {
  int ret;
  ret = mount(NULL, "/proc", "procfs", 0, NULL);
}


x86 assembly (clang, -O0):
<mount_procfs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xor    %eax,%eax
mov    %eax,%r8d
lea    0xedc(%rip),%rsi
lea    0xedb(%rip),%rdx
xor    %ecx,%ecx
mov    %r8,%rdi
call   1030 <mount@plt>
mov    %eax,-0x4(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mount_procfs>:
lea    0xee9(%rip),%rsi
lea    0xee8(%rip),%rdx
xor    %edi,%edi
xor    %ecx,%ecx
xor    %r8d,%r8d
jmp    1030 <mount@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"/proc\00"
@.str.1 = [7 x i8] c"procfs\00"
define void @mount_procfs() {
%1 = alloca i32
%2 = call i32 @mount(i32* null, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 0, i32* null)
store i32 %2, i32* %1
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"/proc\00"
@.str.1 = [7 x i8] c"procfs\00"
define void @mount_procfs() {
%1 = tail call i32 @mount(i32* null, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 0, i32* null)
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t Maj(uint32_t x, uint32_t y, uint32_t z) {
  return (x & y) | (z & (x | y));
}


x86 assembly (clang, -O0):
<Maj>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
and    -0x8(%rbp),%eax
mov    -0xc(%rbp),%ecx
mov    -0x4(%rbp),%edx
or     -0x8(%rbp),%edx
and    %edx,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Maj>:
mov    %esi,%eax
and    %edi,%eax
or     %edi,%esi
and    %edx,%esi
or     %esi,%eax
ret

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

LLVM IR (-O2):
define i32 @Maj(i32 %0, i32 %1, i32 %2) {
%4 = and i32 %1, %0
%5 = or i32 %1, %0
%6 = and i32 %5, %2
%7 = or i32 %6, %4
ret i32 %7
}
char *one_var(unsigned long offset) {
  static char *const base = (char *)1;
  return base + offset;
}


x86 assembly (clang, -O0):
<one_var>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    $0x1,%eax
add    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<one_var>:
lea    0x1(%rdi),%rax
ret

LLVM IR (-O0):
@one_var.base = internal constant i8* inttoptr (i64 1 to i8*)
define i8* @one_var(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = getelementptr inbounds i8, i8* inttoptr (i64 1 to i8*), i64 %3
ret i8* %4
}

LLVM IR (-O2):
define i8* @one_var(i64 %0) {
%2 = getelementptr inbounds i8, i8* inttoptr (i64 1 to i8*), i64 %0
ret i8* %2
}
int foo(int xx, int xy) {
  xx &= 1;
  xy &= 1;
  return xx ^ xy;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
and    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
and    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
xor    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
mov    %edi,%eax
xor    %esi,%eax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @foo(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 = and i32 %5, 1
store i32 %6, i32* %3
%7 = load i32, i32* %4
%8 = and i32 %7, 1
store i32 %8, i32* %4
%9 = load i32, i32* %3
%10 = load i32, i32* %4
%11 = xor i32 %9, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @foo(i32 %0, i32 %1) {
%3 = xor i32 %1, %0
%4 = and i32 %3, 1
ret i32 %4
}
void yy_1_Section(char *yytext, int yyleng) {
  ;
  ;
}


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

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

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

LLVM IR (-O2):
define void @yy_1_Section(i8* nocapture %0, i32 %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ SendChar(int);
void GUI_CleanScreen(void) {
  SendChar((0XEE) & 0xFF);
  SendChar((0x01) & 0xFF);
  SendChar((((0XFFFCFFFF) >> 16) >> 8) & 0xFF);
  SendChar(((0XFFFCFFFF) >> 16) & 0xFF);
  SendChar((((0XFFFCFFFF) & 0xFFFF) >> 8) & 0xFF);
  SendChar(((0XFFFCFFFF) & 0xFFFF) & 0xFF);
}


x86 assembly (clang, -O0):
<GUI_CleanScreen>:
push   %rbp
mov    %rsp,%rbp
mov    $0xee,%edi
call   1030 <SendChar@plt>
mov    $0x1,%edi
call   1030 <SendChar@plt>
mov    $0xff,%edi
call   1030 <SendChar@plt>
mov    $0xfc,%edi
call   1030 <SendChar@plt>
mov    $0xff,%edi
call   1030 <SendChar@plt>
mov    $0xff,%edi
call   1030 <SendChar@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<GUI_CleanScreen>:
push   %rax
mov    $0xee,%edi
call   1030 <SendChar@plt>
mov    $0x1,%edi
call   1030 <SendChar@plt>
mov    $0xff,%edi
call   1030 <SendChar@plt>
mov    $0xfc,%edi
call   1030 <SendChar@plt>
mov    $0xff,%edi
call   1030 <SendChar@plt>
mov    $0xff,%edi
pop    %rax
jmp    1030 <SendChar@plt>

LLVM IR (-O0):
define void @GUI_CleanScreen() {
%1 = call i32 @SendChar(i32 238)
%2 = call i32 @SendChar(i32 1)
%3 = call i32 @SendChar(i32 255)
%4 = call i32 @SendChar(i32 252)
%5 = call i32 @SendChar(i32 255)
%6 = call i32 @SendChar(i32 255)
ret void
}

LLVM IR (-O2):
define void @GUI_CleanScreen() {
%1 = tail call i32 @SendChar(i32 238)
%2 = tail call i32 @SendChar(i32 1)
%3 = tail call i32 @SendChar(i32 255)
%4 = tail call i32 @SendChar(i32 252)
%5 = tail call i32 @SendChar(i32 255)
%6 = tail call i32 @SendChar(i32 255)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ wFOpen(char *, char *);
int /*<<< orphan*/ wFree(char *);
char *wPopString();
int /*<<< orphan*/ wPushNumber(int /*<<< orphan*/);
void wBasFOpen() {
  char *fname, *fmode;
  fmode = wPopString();
  fname = wPopString();
  wPushNumber(wFOpen(fname, fmode));
  wFree(fname);
  wFree(fmode);
}


x86 assembly (clang, -O0):
<wBasFOpen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <wPopString@plt>
mov    %rax,-0x10(%rbp)
mov    $0x0,%al
call   1030 <wPopString@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1060 <wFOpen@plt>
mov    %eax,%edi
call   1040 <wPushNumber@plt>
mov    -0x8(%rbp),%rdi
call   1050 <wFree@plt>
mov    -0x10(%rbp),%rdi
call   1050 <wFree@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wBasFOpen>:
push   %r14
push   %rbx
push   %rax
xor    %eax,%eax
call   1030 <wPopString@plt>
mov    %rax,%r14
xor    %eax,%eax
call   1030 <wPopString@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
call   1060 <wFOpen@plt>
mov    %eax,%edi
call   1040 <wPushNumber@plt>
mov    %rbx,%rdi
call   1050 <wFree@plt>
mov    %r14,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1050 <wFree@plt>

LLVM IR (-O0):
define void @wBasFOpen() {
%1 = alloca i8*
%2 = alloca i8*
%3 = call i8* (...) @wPopString()
store i8* %3, i8** %2
%4 = call i8* (...) @wPopString()
store i8* %4, i8** %1
%5 = load i8*, i8** %1
%6 = load i8*, i8** %2
%7 = call i32 @wFOpen(i8* %5, i8* %6)
%8 = call i32 @wPushNumber(i32 %7)
%9 = load i8*, i8** %1
%10 = call i32 @wFree(i8* %9)
%11 = load i8*, i8** %2
%12 = call i32 @wFree(i8* %11)
ret void
}

LLVM IR (-O2):
define void @wBasFOpen() {
%1 = tail call i8* (...) @wPopString()
%2 = tail call i8* (...) @wPopString()
%3 = tail call i32 @wFOpen(i8* %2, i8* %1)
%4 = tail call i32 @wPushNumber(i32 %3)
%5 = tail call i32 @wFree(i8* %2)
%6 = tail call i32 @wFree(i8* %1)
ret void
}
/* Type definitions */
typedef scalar_t__ ptrdiff_t;

/* Variables and functions */
const void *offset_cref(const void *base, ptrdiff_t offset) {
  return ((const void *)(((base)) ? (((const unsigned char *)(base)) +
                                     ((ptrdiff_t)(offset)))
                                  : (NULL)));
}


x86 assembly (clang, -O0):
<offset_cref>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1128 <offset_cref+0x28>
mov    -0x8(%rbp),%rax
add    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    1133 <offset_cref+0x33>
xor    %eax,%eax
mov    %rax,-0x18(%rbp)
jmp    1133 <offset_cref+0x33>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<offset_cref>:
lea    (%rsi,%rdi,1),%rax
test   %rdi,%rdi
cmove  %rdi,%rax
ret

LLVM IR (-O0):
define i8* @offset_cref(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 = icmp ne i8* %5, null
br i1 %6, label %7, label %11
7: ; preds = %2
%8 = load i8*, i8** %3
%9 = load i64, i64* %4
%10 = getelementptr inbounds i8, i8* %8, i64 %9
br label %12
11: ; preds = %2
br label %12
12: ; preds = %11, %7
%13 = phi i8* [ %10, %7 ], [ null, %11 ]
ret i8* %13
}

LLVM IR (-O2):
define i8* @offset_cref(i8* readnone %0, i64 %1) {
%3 = icmp eq i8* %0, null
%4 = getelementptr inbounds i8, i8* %0, i64 %1
%5 = select i1 %3, i8* null, i8* %4
ret i8* %5
}