xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ EOPNOTSUPP;
int /*<<< orphan*/ errno;
int set_linger(int fd, void *optval, int optlen) {
  errno = EOPNOTSUPP;
  return -1;
}


x86 assembly (clang, -O0):
<set_linger>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    0x2ecb(%rip),%rax
mov    (%rax),%ecx
mov    0x2eba(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_linger>:
mov    0x2ed9(%rip),%rax
mov    (%rax),%eax
mov    0x2ec8(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
@EOPNOTSUPP = global i32 0
@errno = global i32 0
define i32 @set_linger(i32 %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
store i32 %0, i32* %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i32, i32* @EOPNOTSUPP
store i32 %7, i32* @errno
ret i32 -1
}

LLVM IR (-O2):
@EOPNOTSUPP = global i32 0
@errno = global i32 0
define i32 @set_linger(i32 %0, i8* nocapture readnone %1, i32 %2) {
%4 = load i32, i32* @EOPNOTSUPP
store i32 %4, i32* @errno
ret i32 -1
}
/* Variables and functions */
int read_word(int /*<<< orphan*/);
int /*<<< orphan*/ srand(int);
void generate_rand_seed() {
  int rand_seed = read_word(0);
  srand(rand_seed);
}


x86 assembly (clang, -O0):
<generate_rand_seed>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xor    %edi,%edi
call   1040 <read_word@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <srand@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<generate_rand_seed>:
push   %rax
xor    %edi,%edi
call   1040 <read_word@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <srand@plt>

LLVM IR (-O0):
define void @generate_rand_seed() {
%1 = alloca i32
%2 = call i32 @read_word(i32 0)
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = call i32 @srand(i32 %3)
ret void
}

LLVM IR (-O2):
define void @generate_rand_seed() {
%1 = tail call i32 @read_word(i32 0)
%2 = tail call i32 @srand(i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ e_absx();
int /*<<< orphan*/ e_ora();
void e_ora_absx() {
  e_absx();
  e_ora();
}


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

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

LLVM IR (-O0):
define void @e_ora_absx() {
%1 = call i32 (...) @e_absx()
%2 = call i32 (...) @e_ora()
ret void
}

LLVM IR (-O2):
define void @e_ora_absx() {
%1 = tail call i32 (...) @e_absx()
%2 = tail call i32 (...) @e_ora()
ret void
}
/* Variables and functions */
bool bar2() { return false; }


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

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

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

LLVM IR (-O2):
define i32 @bar2() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ __bound_check(void const *, size_t);
void *memmove(void *, void const *, size_t);
void *__bound_memmove(void *dst, const void *src, size_t size) {
  __bound_check(dst, size);
  __bound_check(src, size);
  return memmove(dst, src, size);
}


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

x86 assembly (clang, -O2):
<__bound_memmove>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%rbx
mov    %rsi,%r14
mov    %rdi,%r15
mov    %rdx,%rsi
call   1030 <__bound_check@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <__bound_check@plt>
mov    %r15,%rdi
mov    %r14,%rsi
mov    %rbx,%rdx
pop    %rbx
pop    %r14
pop    %r15
jmp    1040 <memmove@plt>

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

LLVM IR (-O2):
define i8* @__bound_memmove(i8* returned %0, i8* %1, i64 %2) {
%4 = tail call i32 @__bound_check(i8* %0, i64 %2)
%5 = tail call i32 @__bound_check(i8* %1, i64 %2)
tail call void @llvm.memmove.p0i8.p0i8.i64(i8* align 1 %0, i8* align 1 %1, i64 %2, i1 false)
ret i8* %0
}
void XtGetMultiClickTime() {}


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

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

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

LLVM IR (-O2):
define void @XtGetMultiClickTime() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *, int);
void nonecb(const char *longname, char shortname) {
  printf("Callback [none]: %s %d\n", longname, (int)shortname);
}


x86 assembly (clang, -O0):
<nonecb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rsi
movsbl -0x9(%rbp),%edx
lea    0xecf(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nonecb>:
mov    %esi,%edx
mov    %rdi,%rsi
lea    0xee4(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [24 x i8] c"Callback [none]: %s %d\0A\00"
define void @nonecb(i8* %0, i8 signext %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
%7 = sext i8 %6 to i32
%8 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* %5, i32 %7)
ret void
}

LLVM IR (-O2):
@.str = [24 x i8] c"Callback [none]: %s %d\0A\00"
define void @nonecb(i8* %0, i8 signext %1) {
%3 = sext i8 %1 to i32
%4 = tail call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %3)
ret void
}
void enter_data(int *X) {
#pragma omp target enter data map(to : var1, var2, X[:N]) map(alloc : sum)
}


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

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

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

LLVM IR (-O2):
define void @enter_data(i32* nocapture %0) {
ret void
}
int power(int x, int n) {
  if (n == 0)
    return 1;
  else if (n % 2 == 0)
    return power(x * x, n / 2);
  else
    return x * power(x * x, n / 2);
}


x86 assembly (clang, -O0):
<power>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    1134 <power+0x24>
movl   $0x1,-0x4(%rbp)
jmp    1193 <power+0x83>
mov    -0xc(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1169 <power+0x59>
mov    -0x8(%rbp),%edi
imul   -0x8(%rbp),%edi
mov    -0xc(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%esi
call   1030 <power@plt>
mov    %eax,-0x4(%rbp)
jmp    1193 <power+0x83>
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%edi
imul   -0x8(%rbp),%edi
mov    -0xc(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%esi
call   1030 <power@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
imul   %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<power>:
mov    $0x1,%eax
test   %esi,%esi
je     113b <power+0x3b>
mov    %esi,%ecx
mov    %edi,%edx
nopl   (%rax)
imul   %edi,%edi
shr    $0x1f,%esi
add    %ecx,%esi
sar    %esi
test   $0x1,%cl
jne    1130 <power+0x30>
mov    %edi,%edx
cmp    $0x2,%ecx
mov    %esi,%ecx
jae    1110 <power+0x10>
jmp    113b <power+0x3b>
nopw   0x0(%rax,%rax,1)
imul   %edx,%eax
add    $0x1,%ecx
cmp    $0x2,%ecx
ja     1109 <power+0x9>
ret

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

LLVM IR (-O2):
define i32 @power(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %21, label %4
4: ; preds = %2, %17
%5 = phi i32 [ %14, %17 ], [ %1, %2 ]
%6 = phi i32 [ %13, %17 ], [ %0, %2 ]
%7 = phi i32 [ %18, %17 ], [ 1, %2 ]
br label %8
8: ; preds = %4, %15
%9 = phi i32 [ %5, %4 ], [ %14, %15 ]
%10 = phi i32 [ %6, %4 ], [ %13, %15 ]
%11 = and i32 %9, 1
%12 = icmp eq i32 %11, 0
%13 = mul nsw i32 %10, %10
%14 = sdiv i32 %9, 2
br i1 %12, label %15, label %17
15: ; preds = %8
%16 = icmp ult i32 %9, 2
br i1 %16, label %21, label %8
17: ; preds = %8
%18 = mul nsw i32 %10, %7
%19 = add i32 %9, 1
%20 = icmp ult i32 %19, 3
br i1 %20, label %21, label %4
21: ; preds = %17, %15, %2
%22 = phi i32 [ 1, %2 ], [ %7, %15 ], [ %18, %17 ]
ret i32 %22
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int);
int /*<<< orphan*/ stdout;
void al_ansi_escape_bg_reset(int bg) {
  fprintf(stdout, "\\[\\e[0;38;5;%d;49;22m\\]", bg);
}


x86 assembly (clang, -O0):
<al_ansi_escape_bg_reset>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2ebe(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%edx
lea    0xed2(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<al_ansi_escape_bg_reset>:
mov    %edi,%edx
mov    0x2ec7(%rip),%rax
mov    (%rax),%edi
lea    0xede(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stdout = global i32 0
@.str = [24 x i8] c"\\[\\e[0;38;5;%d;49;22m\\]\00"
define void @al_ansi_escape_bg_reset(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @stdout
%4 = load i32, i32* %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 %4)
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [24 x i8] c"\\[\\e[0;38;5;%d;49;22m\\]\00"
define void @al_ansi_escape_bg_reset(i32 %0) {
%2 = load i32, i32* @stdout
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
/* Variables and functions */
int f14(int *);
int f15(int *p) { return f14(p); }


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

x86 assembly (clang, -O2):
<f15>:
jmp    1030 <f14@plt>

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

LLVM IR (-O2):
define i32 @f15(i32* %0) {
%2 = tail call i32 @f14(i32* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ Sync();
void Restore(int version) { Sync(); }


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

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

LLVM IR (-O0):
define void @Restore(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @Sync()
ret void
}

LLVM IR (-O2):
define void @Restore(i32 %0) {
%2 = tail call i32 (...) @Sync()
ret void
}
void fun(char c, ...) {}


x86 assembly (clang, -O0):
<fun>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @fun(i8 signext %0, ...) {
%2 = alloca i8
store i8 %0, i8* %2
ret void
}

LLVM IR (-O2):
define void @fun(i8 signext %0, ...) {
ret void
}
void gscanlist2_(actno, maxno, list, return_code) int *actno, *maxno,
    *return_code;
float *list;
{}


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

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

LLVM IR (-O0):
define void @gscanlist2_(i32* %0, i32* %1, float* %2, i32* %3) {
%5 = alloca i32*
%6 = alloca i32*
%7 = alloca float*
%8 = alloca i32*
store i32* %0, i32** %5
store i32* %1, i32** %6
store float* %2, float** %7
store i32* %3, i32** %8
ret void
}

LLVM IR (-O2):
define void @gscanlist2_(i32* nocapture %0, i32* nocapture %1, float* nocapture %2, i32* nocapture %3) {
ret void
}
int sprintf_str(char *str, char *src) {
  char *dst;
  dst = str;
  while (*src) {
    *dst++ = *src++;
  }
  return dst - str;
}


x86 assembly (clang, -O0):
<sprintf_str>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1148 <sprintf_str+0x48>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%cl
mov    -0x18(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x18(%rbp)
mov    %cl,(%rax)
jmp    1114 <sprintf_str+0x14>
mov    -0x18(%rbp),%rax
mov    -0x8(%rbp),%rcx
sub    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sprintf_str>:
mov    (%rsi),%cl
mov    %rdi,%rax
test   %cl,%cl
je     1121 <sprintf_str+0x21>
add    $0x1,%rsi
mov    %rdi,%rax
mov    %cl,(%rax)
add    $0x1,%rax
movzbl (%rsi),%ecx
add    $0x1,%rsi
test   %cl,%cl
jne    1110 <sprintf_str+0x10>
sub    %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @sprintf_str(i8* %0, i8* nocapture %1) {
%3 = load i8, i8* %1
%4 = icmp eq i8 %3, 0
br i1 %4, label %13, label %5
5: ; preds = %2, %5
%6 = phi i8 [ %11, %5 ], [ %3, %2 ]
%7 = phi i8* [ %10, %5 ], [ %0, %2 ]
%8 = phi i8* [ %9, %5 ], [ %1, %2 ]
%9 = getelementptr inbounds i8, i8* %8, i64 1
%10 = getelementptr inbounds i8, i8* %7, i64 1
store i8 %6, i8* %7
%11 = load i8, i8* %9
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %5
13: ; preds = %5, %2
%14 = phi i8* [ %0, %2 ], [ %10, %5 ]
%15 = ptrtoint i8* %14 to i64
%16 = ptrtoint i8* %0 to i64
%17 = sub i64 %15, %16
%18 = trunc i64 %17 to i32
ret i32 %18
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  printf("%d", (int)sizeof(size_t));
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 8)
ret i32 0
}
/* Variables and functions */
int sys_execve(char const *, char const *const *, char const *const *);
int sys_execv(const char *path, const char *const argv[]) {
  extern char **environ;
  return sys_execve(path, argv, (const char *const *)environ);
}


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

x86 assembly (clang, -O2):
<sys_execv>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%rdx
jmp    1030 <sys_execve@plt>

LLVM IR (-O0):
@environ = external global i8**
define i32 @sys_execv(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
%7 = load i8**, i8*** @environ
%8 = call i32 @sys_execve(i8* %5, i8** %6, i8** %7)
ret i32 %8
}

LLVM IR (-O2):
@environ = external global i8**
define i32 @sys_execv(i8* %0, i8** %1) {
%3 = load i8**, i8*** @environ
%4 = tail call i32 @sys_execve(i8* %0, i8** %1, i8** %3)
ret i32 %4
}
/* Type definitions */
struct statement {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ end_symbol_scope();
void end_iterator(struct statement *stmt) { end_symbol_scope(); }


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

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

LLVM IR (-O0):
%struct.statement = type { i32 }
define void @end_iterator(%struct.statement* %0) {
%2 = alloca %struct.statement*
store %struct.statement* %0, %struct.statement** %2
%3 = call i32 (...) @end_symbol_scope()
ret void
}

LLVM IR (-O2):
%struct.statement = type { i32 }
define void @end_iterator(%struct.statement* nocapture readnone %0) {
%2 = tail call i32 (...) @end_symbol_scope()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
long pci_config_read_word(unsigned char bus, unsigned char dev, int func,
                          unsigned cmd) {
  printf("pci_config_read_word: generic function call\n");
  return 0;
}


x86 assembly (clang, -O0):
<pci_config_read_word>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %dil,%sil
mov    %sil,-0x1(%rbp)
mov    %al,-0x2(%rbp)
mov    %edx,-0x8(%rbp)
mov    %ecx,-0xc(%rbp)
lea    0xece(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [45 x i8] c"pci_config_read_word: generic function call\0A\00"
define i64 @pci_config_read_word(i8 zeroext %0, i8 zeroext %1, i32 %2, i32 %3) {
%5 = alloca i8
%6 = alloca i8
%7 = alloca i32
%8 = alloca i32
store i8 %0, i8* %5
store i8 %1, i8* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = call i32 @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0))
ret i64 0
}

LLVM IR (-O2):
@str = [44 x i8] c"pci_config_read_word: generic function call\00"
define i64 @pci_config_read_word(i8 zeroext %0, i8 zeroext %1, i32 %2, i32 %3) {
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([44 x i8], [44 x i8]* @str, i64 0, i64 0))
ret i64 0
}
/* Variables and functions */
int /*<<< orphan*/ OutputReset(unsigned char);
void ResetTachoCount(unsigned char Outputs) { OutputReset(Outputs); }


x86 assembly (clang, -O0):
<ResetTachoCount>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%edi
call   1030 <OutputReset@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ResetTachoCount>:
jmp    1030 <OutputReset@plt>

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

LLVM IR (-O2):
define void @ResetTachoCount(i8 zeroext %0) {
%2 = tail call i32 @OutputReset(i8 zeroext %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ vp8_variance(unsigned char const *, int,
                                unsigned char const *, int, int, int,
                                unsigned int *, int *);
unsigned int vp8_get16x16var_c(const unsigned char *src_ptr, int source_stride,
                               const unsigned char *ref_ptr, int recon_stride,
                               unsigned int *SSE, int *Sum) {
  vp8_variance(src_ptr, source_stride, ref_ptr, recon_stride, 16, 16, SSE, Sum);
  return (*SSE - (((*Sum) * (*Sum)) >> 8));
}


x86 assembly (clang, -O0):
<vp8_get16x16var_c>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
mov    -0x28(%rbp),%r10
mov    -0x30(%rbp),%rax
mov    $0x10,%r9d
mov    %r9d,%r8d
mov    %r10,(%rsp)
mov    %rax,0x8(%rsp)
call   1030 <vp8_variance@plt>
mov    -0x28(%rbp),%rax
mov    (%rax),%eax
mov    -0x30(%rbp),%rcx
mov    (%rcx),%ecx
mov    -0x30(%rbp),%rdx
imul   (%rdx),%ecx
sar    $0x8,%ecx
sub    %ecx,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vp8_get16x16var_c>:
push   %r14
push   %rbx
push   %rax
mov    %r9,%r14
mov    %r8,%rbx
mov    $0x10,%r8d
mov    $0x10,%r9d
push   %r14
push   %rbx
call   1030 <vp8_variance@plt>
add    $0x10,%rsp
mov    (%rbx),%eax
mov    (%r14),%ecx
imul   %ecx,%ecx
shr    $0x8,%ecx
sub    %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @vp8_get16x16var_c(i8* %0, i32 %1, i8* %2, i32 %3, i32* %4, i32* %5) {
%7 = alloca i8*
%8 = alloca i32
%9 = alloca i8*
%10 = alloca i32
%11 = alloca i32*
%12 = alloca i32*
store i8* %0, i8** %7
store i32 %1, i32* %8
store i8* %2, i8** %9
store i32 %3, i32* %10
store i32* %4, i32** %11
store i32* %5, i32** %12
%13 = load i8*, i8** %7
%14 = load i32, i32* %8
%15 = load i8*, i8** %9
%16 = load i32, i32* %10
%17 = load i32*, i32** %11
%18 = load i32*, i32** %12
%19 = call i32 @vp8_variance(i8* %13, i32 %14, i8* %15, i32 %16, i32 16, i32 16, i32* %17, i32* %18)
%20 = load i32*, i32** %11
%21 = load i32, i32* %20
%22 = load i32*, i32** %12
%23 = load i32, i32* %22
%24 = load i32*, i32** %12
%25 = load i32, i32* %24
%26 = mul nsw i32 %23, %25
%27 = ashr i32 %26, 8
%28 = sub i32 %21, %27
ret i32 %28
}

LLVM IR (-O2):
define i32 @vp8_get16x16var_c(i8* %0, i32 %1, i8* %2, i32 %3, i32* %4, i32* %5) {
%7 = tail call i32 @vp8_variance(i8* %0, i32 %1, i8* %2, i32 %3, i32 16, i32 16, i32* %4, i32* %5)
%8 = load i32, i32* %4
%9 = load i32, i32* %5
%10 = mul nsw i32 %9, %9
%11 = lshr i32 %10, 8
%12 = sub i32 %8, %11
ret i32 %12
}
int unset_bit(int number, int index) { return number & ~(1 << index); }


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

x86 assembly (clang, -O2):
<unset_bit>:
mov    %edi,%eax
btr    %esi,%eax
ret

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

LLVM IR (-O2):
define i32 @unset_bit(i32 %0, i32 %1) {
%3 = shl nuw i32 1, %1
%4 = xor i32 %3, -1
%5 = and i32 %4, %0
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ c_string();
int main(int argc, char *argv[]) {
  c_string();
  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 <c_string@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <c_string@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 (...) @c_string()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @c_string()
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/ *);
int /*<<< orphan*/ lib_free(char *);
char *string_resource_item(int, char *);
void write_resource_item(FILE *f, int num) {
  char *line;
  line = string_resource_item(num, "\n");
  if (line != NULL) {
    fputs(line, f);
    lib_free(line);
  }
}


x86 assembly (clang, -O0):
<write_resource_item>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%edi
lea    0xeb7(%rip),%rsi
call   1050 <string_resource_item@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1173 <write_resource_item+0x43>
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1040 <fputs@plt>
mov    -0x18(%rbp),%rdi
call   1030 <lib_free@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_resource_item>:
push   %r14
push   %rbx
push   %rax
mov    %esi,%eax
mov    %rdi,%r14
lea    0xec0(%rip),%rsi
mov    %eax,%edi
call   1050 <string_resource_item@plt>
test   %rax,%rax
je     1169 <write_resource_item+0x39>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
call   1040 <fputs@plt>
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <lib_free@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [2 x i8] c"\0A\00"
define void @write_resource_item(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i8*
store i32* %0, i32** %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
%7 = call i8* @string_resource_item(i32 %6, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i8* %7, i8** %5
%8 = load i8*, i8** %5
%9 = icmp ne i8* %8, null
br i1 %9, label %10, label %16
10: ; preds = %2
%11 = load i8*, i8** %5
%12 = load i32*, i32** %3
%13 = call i32 @fputs(i8* %11, i32* %12)
%14 = load i8*, i8** %5
%15 = call i32 @lib_free(i8* %14)
br label %16
16: ; preds = %10, %2
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c"\0A\00"
define void @write_resource_item(i32* nocapture %0, i32 %1) {
%3 = tail call i8* @string_resource_item(i32 %1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%4 = icmp eq i8* %3, null
br i1 %4, label %8, label %5
5: ; preds = %2
%6 = tail call i32 @fputs(i8* %3, i32* %0)
%7 = tail call i32 @lib_free(i8* %3)
br label %8
8: ; preds = %5, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _OS_Restore_TaskSP();
int /*<<< orphan*/ _OS_SET_FSR_CUR_TASK();
int /*<<< orphan*/ _OS_SET_PC();
int /*<<< orphan*/ _OS_STORE_SP();
void _OS_JumpToTask(void) {
  _OS_STORE_SP();
  _OS_SET_FSR_CUR_TASK();
  _OS_Restore_TaskSP();
  _OS_SET_PC();
}


x86 assembly (clang, -O0):
<_OS_JumpToTask>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <_OS_STORE_SP@plt>
mov    $0x0,%al
call   1050 <_OS_SET_FSR_CUR_TASK@plt>
mov    $0x0,%al
call   1040 <_OS_Restore_TaskSP@plt>
mov    $0x0,%al
call   1060 <_OS_SET_PC@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<_OS_JumpToTask>:
push   %rax
xor    %eax,%eax
call   1030 <_OS_STORE_SP@plt>
xor    %eax,%eax
call   1050 <_OS_SET_FSR_CUR_TASK@plt>
xor    %eax,%eax
call   1040 <_OS_Restore_TaskSP@plt>
xor    %eax,%eax
pop    %rcx
jmp    1060 <_OS_SET_PC@plt>

LLVM IR (-O0):
define void @_OS_JumpToTask() {
%1 = call i32 (...) @_OS_STORE_SP()
%2 = call i32 (...) @_OS_SET_FSR_CUR_TASK()
%3 = call i32 (...) @_OS_Restore_TaskSP()
%4 = call i32 (...) @_OS_SET_PC()
ret void
}

LLVM IR (-O2):
define void @_OS_JumpToTask() {
%1 = tail call i32 (...) @_OS_STORE_SP()
%2 = tail call i32 (...) @_OS_SET_FSR_CUR_TASK()
%3 = tail call i32 (...) @_OS_Restore_TaskSP()
%4 = tail call i32 (...) @_OS_SET_PC()
ret void
}
const void *__launder_type(const void *__x) {
  __asm __volatile("" : "+r"(__x));
  return __x;
}


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

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

LLVM IR (-O0):
define i8* @__launder_type(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i8* asm sideeffect "", "=r,0,~{dirflag},~{fpsr},~{flags}"(i8* %3)
store i8* %4, i8** %2
%5 = load i8*, i8** %2
ret i8* %5
}

LLVM IR (-O2):
define i8* @__launder_type(i8* %0) {
%2 = tail call i8* asm sideeffect "", "=r,0,~{dirflag},~{fpsr},~{flags}"(i8* %0)
ret i8* %2
}
/* Type definitions */
struct flashctx {
  int dummy;
};

/* Variables and functions */
int spi_disable_blockprotect_generic(struct flashctx *, int, int,
                                     int /*<<< orphan*/);
int spi_disable_blockprotect_at25f512a(struct flashctx *flash) {
  return spi_disable_blockprotect_generic(flash, 0x04, 1 << 7, 0);
}


x86 assembly (clang, -O0):
<spi_disable_blockprotect_at25f512a>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x4,%esi
mov    $0x80,%edx
xor    %ecx,%ecx
call   1030 <spi_disable_blockprotect_generic@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<spi_disable_blockprotect_at25f512a>:
mov    $0x4,%esi
mov    $0x80,%edx
xor    %ecx,%ecx
jmp    1030 <spi_disable_blockprotect_generic@plt>

LLVM IR (-O0):
%struct.flashctx = type { i32 }
define i32 @spi_disable_blockprotect_at25f512a(%struct.flashctx* %0) {
%2 = alloca %struct.flashctx*
store %struct.flashctx* %0, %struct.flashctx** %2
%3 = load %struct.flashctx*, %struct.flashctx** %2
%4 = call i32 @spi_disable_blockprotect_generic(%struct.flashctx* %3, i32 4, i32 128, i32 0)
ret i32 %4
}

LLVM IR (-O2):
%struct.flashctx = type { i32 }
define i32 @spi_disable_blockprotect_at25f512a(%struct.flashctx* %0) {
%2 = tail call i32 @spi_disable_blockprotect_generic(%struct.flashctx* %0, i32 4, i32 128, i32 0)
ret i32 %2
}
void moveUp(int *x, int *y) { (*y)--; }


x86 assembly (clang, -O0):
<moveUp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
add    $0xffffffff,%ecx
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<moveUp>:
addl   $0xffffffff,(%rsi)
ret

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

LLVM IR (-O2):
define void @moveUp(i32* nocapture readnone %0, i32* nocapture %1) {
%3 = load i32, i32* %1
%4 = add nsw i32 %3, -1
store i32 %4, i32* %1
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ __mmask8;
typedef int /*<<< orphan*/ __m128;

/* Variables and functions */
int /*<<< orphan*/ _mm128_mask_cmp_ps_mask(int /*<<< orphan*/,
                                           int /*<<< orphan*/,
                                           int /*<<< orphan*/,
                                           int /*<<< orphan*/);
__mmask8 test_mm128_mask_cmp_ps_mask(__mmask8 m, __m128 __A, __m128 __B) {
  return _mm128_mask_cmp_ps_mask(m, __A, __B, 0);
}


x86 assembly (clang, -O0):
<test_mm128_mask_cmp_ps_mask>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
xor    %ecx,%ecx
call   1030 <_mm128_mask_cmp_ps_mask@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_mm128_mask_cmp_ps_mask>:
xor    %ecx,%ecx
jmp    1030 <_mm128_mask_cmp_ps_mask@plt>

LLVM IR (-O0):
define i32 @test_mm128_mask_cmp_ps_mask(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 = load i32, i32* %6
%10 = call i32 @_mm128_mask_cmp_ps_mask(i32 %7, i32 %8, i32 %9, i32 0)
ret i32 %10
}

LLVM IR (-O2):
define i32 @test_mm128_mask_cmp_ps_mask(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @_mm128_mask_cmp_ps_mask(i32 %0, i32 %1, i32 %2, i32 0)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
void checkoutBranch(const char *branchName) {
  printf("git checkout %s\n", branchName);
}


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

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

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

LLVM IR (-O2):
@.str = [17 x i8] c"git checkout %s\0A\00"
define void @checkoutBranch(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
double expm1(double x) {
  if (fabs(x) < 6.9314718055994530941723E-1L) {
    x *= 1.4426950408889634073599E0L;
    __asm__("f2xm1" : "=t"(x) : "0"(x));
    return x;
  } else
    return exp(x) - 1.0;
}


x86 assembly (clang, -O0):
<expm1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x10(%rbp)
movaps 0xedc(%rip),%xmm1
movsd  -0x10(%rbp),%xmm0
pand   %xmm1,%xmm0
movlpd %xmm0,-0x18(%rbp)
fldl   -0x18(%rbp)
fldt   0xed5(%rip)
fucomip %st(1),%st
fstp   %st(0)
jbe    118d <expm1+0x7d>
jmp    114a <expm1+0x3a>
fldl   -0x10(%rbp)
fldt   0xecd(%rip)
fmulp  %st,%st(1)
fstpl  -0x30(%rbp)
movsd  -0x30(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
fldl   -0x20(%rbp)
f2xm1
fstpl  -0x28(%rbp)
movsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    11a8 <expm1+0x98>
movsd  -0x10(%rbp),%xmm0
call   1030 <exp@plt>
movsd  0xe91(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<expm1>:
sub    $0x28,%rsp
movapd 0xee4(%rip),%xmm1
andpd  %xmm0,%xmm1
movlpd %xmm1,0x20(%rsp)
fldl   0x20(%rsp)
fldt   0xee0(%rip)
fucomip %st(1),%st
fstp   %st(0)
jbe    1169 <expm1+0x59>
movsd  %xmm0,0x18(%rsp)
fldt   0xede(%rip)
fmull  0x18(%rsp)
fstpl  0x10(%rsp)
movsd  0x10(%rsp),%xmm0
movsd  %xmm0,0x8(%rsp)
fldl   0x8(%rsp)
f2xm1
fstpl  (%rsp)
movsd  (%rsp),%xmm0
add    $0x28,%rsp
ret
call   1030 <exp@plt>
addsd  0xeba(%rip),%xmm0
add    $0x28,%rsp
ret

LLVM IR (-O0):
define double @expm1(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %3
%4 = load double, double* %3
%5 = call double @llvm.fabs.f64(double %4)
%6 = fpext double %5 to x86_fp80
%7 = fcmp olt x86_fp80 %6, 0xK3FFEB17217F7D1CF79AC
br i1 %7, label %8, label %16
8: ; preds = %1
%9 = load double, double* %3
%10 = fpext double %9 to x86_fp80
%11 = fmul x86_fp80 %10, 0xK3FFFB8AA3B295C17F0BC
%12 = fptrunc x86_fp80 %11 to double
store double %12, double* %3
%13 = load double, double* %3
%14 = call double asm "f2xm1", "={st},0,~{dirflag},~{fpsr},~{flags}"(double %13)
store double %14, double* %3
%15 = load double, double* %3
store double %15, double* %2
br label %20
16: ; preds = %1
%17 = load double, double* %3
%18 = call double @exp(double %17)
%19 = fsub double %18, 1.000000e+00
store double %19, double* %2
br label %20
20: ; preds = %16, %8
%21 = load double, double* %2
ret double %21
}

LLVM IR (-O2):
define double @expm1(double %0) {
%2 = tail call double @llvm.fabs.f64(double %0)
%3 = fpext double %2 to x86_fp80
%4 = fcmp olt x86_fp80 %3, 0xK3FFEB17217F7D1CF79AC
br i1 %4, label %5, label %10
5: ; preds = %1
%6 = fpext double %0 to x86_fp80
%7 = fmul x86_fp80 %6, 0xK3FFFB8AA3B295C17F0BC
%8 = fptrunc x86_fp80 %7 to double
%9 = tail call double asm "f2xm1", "={st},0,~{dirflag},~{fpsr},~{flags}"(double %8)
br label %13
10: ; preds = %1
%11 = tail call double @exp(double %0)
%12 = fadd double %11, -1.000000e+00
br label %13
13: ; preds = %10, %5
%14 = phi double [ %9, %5 ], [ %12, %10 ]
ret double %14
}
/* Variables and functions */
int /*<<< orphan*/ ParseFinalize(void *);
void stub1(void *);
void ParseFree(void *p, void (*freeProc)(void *)) {
  if (p == 0)
    return;
  ParseFinalize(p);
  (*freeProc)(p);
}


x86 assembly (clang, -O0):
<ParseFree>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1130 <ParseFree+0x20>
jmp    1143 <ParseFree+0x33>
mov    -0x8(%rbp),%rdi
call   1030 <ParseFinalize@plt>
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rdi
call   *%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ParseFree>:
test   %rdi,%rdi
je     1133 <ParseFree+0x23>
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    %rsi,%r14
call   1030 <ParseFinalize@plt>
mov    %rbx,%rdi
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    *%rax
ret

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

LLVM IR (-O2):
define void @ParseFree(i8* %0, void (i8*)* nocapture %1) {
%3 = icmp eq i8* %0, null
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i32 @ParseFinalize(i8* %0)
tail call void %1(i8* %0)
br label %6
6: ; preds = %2, %4
ret void
}
void EC_GFp_mont_method(void) {}


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

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

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

LLVM IR (-O2):
define void @EC_GFp_mont_method() {
ret void
}
void do_opt(const unsigned char *aa0, int n0, const unsigned char *aa1, int n1,
            int frame, struct pstruct *ppst, struct f_struct *f_str,
            struct rstruct *rst) {}


x86 assembly (clang, -O0):
<do_opt>:
push   %rbp
mov    %rsp,%rbp
mov    0x18(%rbp),%rax
mov    0x10(%rbp),%rax
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8d,-0x20(%rbp)
mov    %r9,-0x28(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.pstruct = type opaque
%struct.f_struct = type opaque
%struct.rstruct = type opaque
define void @do_opt(i8* %0, i32 %1, i8* %2, i32 %3, i32 %4, %struct.pstruct* %5, %struct.f_struct* %6, %struct.rstruct* %7) {
%9 = alloca i8*
%10 = alloca i32
%11 = alloca i8*
%12 = alloca i32
%13 = alloca i32
%14 = alloca %struct.pstruct*
%15 = alloca %struct.f_struct*
%16 = alloca %struct.rstruct*
store i8* %0, i8** %9
store i32 %1, i32* %10
store i8* %2, i8** %11
store i32 %3, i32* %12
store i32 %4, i32* %13
store %struct.pstruct* %5, %struct.pstruct** %14
store %struct.f_struct* %6, %struct.f_struct** %15
store %struct.rstruct* %7, %struct.rstruct** %16
ret void
}

LLVM IR (-O2):
%struct.pstruct = type opaque
%struct.f_struct = type opaque
%struct.rstruct = type opaque
define void @do_opt(i8* nocapture %0, i32 %1, i8* nocapture %2, i32 %3, i32 %4, %struct.pstruct* nocapture %5, %struct.f_struct* nocapture %6, %struct.rstruct* nocapture %7) {
ret void
}
/* Variables and functions */
int PKCS5_PBKDF2_HMAC_SHA1(char const *, int, unsigned char *, scalar_t__, int,
                           int, unsigned char *);
scalar_t__ strlen(char *);
int generateKey(const char *pass, const char *salt, char *out) {
  return PKCS5_PBKDF2_HMAC_SHA1(
      pass, -1, (unsigned char *)salt,
      strlen("l1pWK8SAkDR4UtE1uk9pPIc1qEMlxq7pwIJaoV1W4dspCYlnbs") + 1, 65536,
      16, (unsigned char *)out);
}


x86 assembly (clang, -O0):
<generateKey>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
lea    0xeb5(%rip),%rdi
call   1030 <strlen@plt>
mov    -0x28(%rbp),%rdi
mov    -0x20(%rbp),%rdx
mov    %rax,%rcx
add    $0x1,%rcx
mov    -0x18(%rbp),%rax
mov    $0xffffffff,%esi
mov    $0x10000,%r8d
mov    $0x10,%r9d
mov    %rax,(%rsp)
call   1040 <PKCS5_PBKDF2_HMAC_SHA1@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<generateKey>:
push   %rax
mov    %rsi,%rax
mov    %rdx,(%rsp)
mov    $0x33,%ecx
mov    $0xffffffff,%esi
mov    %rax,%rdx
mov    $0x10000,%r8d
mov    $0x10,%r9d
call   1030 <PKCS5_PBKDF2_HMAC_SHA1@plt>
pop    %rcx
ret

LLVM IR (-O0):
@.str = [51 x i8] c"l1pWK8SAkDR4UtE1uk9pPIc1qEMlxq7pwIJaoV1W4dspCYlnbs\00"
define i32 @generateKey(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = call i64 @strlen(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str, i64 0, i64 0))
%10 = add nsw i64 %9, 1
%11 = load i8*, i8** %6
%12 = call i32 @PKCS5_PBKDF2_HMAC_SHA1(i8* %7, i32 -1, i8* %8, i64 %10, i32 65536, i32 16, i8* %11)
ret i32 %12
}

LLVM IR (-O2):
define i32 @generateKey(i8* %0, i8* %1, i8* %2) {
%4 = tail call i32 @PKCS5_PBKDF2_HMAC_SHA1(i8* %0, i32 -1, i8* %1, i64 51, i32 65536, i32 16, i8* %2)
ret i32 %4
}
void g_option_group_new() {}


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

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

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

LLVM IR (-O2):
define void @g_option_group_new() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ FreeAcc();
int /*<<< orphan*/ printf(char *);
void PopAcc(int o) {
  if (o == 0) {
    printf("pop _R1\n");
    printf("pop ACC\n");
  } else {
    printf("pop _R3\n");
    printf("pop _R2\n");
  }
  FreeAcc();
}


x86 assembly (clang, -O0):
<PopAcc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    1152 <PopAcc+0x32>
lea    0xec4(%rip),%rdi
call   1030 <printf@plt>
lea    0xec1(%rip),%rdi
call   1030 <printf@plt>
jmp    116a <PopAcc+0x4a>
lea    0xeb9(%rip),%rdi
call   1030 <printf@plt>
lea    0xeb6(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <FreeAcc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PopAcc>:
push   %rbx
test   %edi,%edi
lea    0xee6(%rip),%rax
lea    0xecf(%rip),%rdi
cmove  %rax,%rdi
lea    0xedc(%rip),%rax
lea    0xec5(%rip),%rbx
cmove  %rax,%rbx
call   1030 <puts@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rbx
jmp    1040 <FreeAcc@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"pop _R1\0A\00"
@.str.1 = [9 x i8] c"pop ACC\0A\00"
@.str.2 = [9 x i8] c"pop _R3\0A\00"
@.str.3 = [9 x i8] c"pop _R2\0A\00"
define void @PopAcc(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
br label %11
8: ; preds = %1
%9 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0))
%10 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0))
br label %11
11: ; preds = %8, %5
%12 = call i32 (...) @FreeAcc()
ret void
}

LLVM IR (-O2):
@str = [8 x i8] c"pop _R3\00"
@str.4 = [8 x i8] c"pop _R2\00"
@str.5 = [8 x i8] c"pop _R1\00"
@str.6 = [8 x i8] c"pop ACC\00"
define void @PopAcc(i32 %0) {
%2 = icmp eq i32 %0, 0
%3 = select i1 %2, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @str.5, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @str, i64 0, i64 0)
%4 = select i1 %2, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @str.6, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @str.4, i64 0, i64 0)
%5 = tail call i32 @puts(i8* dereferenceable(1) %3)
%6 = tail call i32 @puts(i8* dereferenceable(1) %4)
%7 = tail call i32 (...) @FreeAcc()
ret void
}
/* Variables and functions */
int Cmd_Argc();
int /*<<< orphan*/ Cmd_Argv(int);
int /*<<< orphan*/ Com_Printf(char *);
int /*<<< orphan*/ SV_StartMod(int /*<<< orphan*/);
void SV_ChangeGame_f(void) {
  if (Cmd_Argc() < 2) {
    Com_Printf("changegame <gamedir> : change game directory\n");
    return;
  }
  SV_StartMod(Cmd_Argv(1));
}


x86 assembly (clang, -O0):
<SV_ChangeGame_f>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <Cmd_Argc@plt>
cmp    $0x2,%eax
jge    1165 <SV_ChangeGame_f+0x25>
lea    0xea5(%rip),%rdi
call   1050 <Com_Printf@plt>
jmp    1176 <SV_ChangeGame_f+0x36>
mov    $0x1,%edi
call   1060 <Cmd_Argv@plt>
mov    %eax,%edi
call   1040 <SV_StartMod@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<SV_ChangeGame_f>:
push   %rax
xor    %eax,%eax
call   1030 <Cmd_Argc@plt>
cmp    $0x1,%eax
jg     115a <SV_ChangeGame_f+0x1a>
lea    0xeac(%rip),%rdi
pop    %rax
jmp    1050 <Com_Printf@plt>
mov    $0x1,%edi
call   1060 <Cmd_Argv@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <SV_StartMod@plt>

LLVM IR (-O0):
@.str = [46 x i8] c"changegame <gamedir> : change game directory\0A\00"
define void @SV_ChangeGame_f() {
%1 = call i32 (...) @Cmd_Argc()
%2 = icmp slt i32 %1, 2
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = call i32 @Com_Printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0))
br label %8
5: ; preds = %0
%6 = call i32 @Cmd_Argv(i32 1)
%7 = call i32 @SV_StartMod(i32 %6)
br label %8
8: ; preds = %5, %3
ret void
}

LLVM IR (-O2):
@.str = [46 x i8] c"changegame <gamedir> : change game directory\0A\00"
define void @SV_ChangeGame_f() {
%1 = tail call i32 (...) @Cmd_Argc()
%2 = icmp slt i32 %1, 2
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 @Com_Printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0))
br label %8
5: ; preds = %0
%6 = tail call i32 @Cmd_Argv(i32 1)
%7 = tail call i32 @SV_StartMod(i32 %6)
br label %8
8: ; preds = %5, %3
ret void
}