xunge/DecIR huggingface dataset:
/* Variables and functions */
int gNand(int, int);
int gNot(int a) { return gNand(a, a); }


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

x86 assembly (clang, -O2):
<gNot>:
mov    %edi,%esi
jmp    1030 <gNand@plt>

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

LLVM IR (-O2):
define i32 @gNot(i32 %0) {
%2 = tail call i32 @gNand(i32 %0, i32 %0)
ret i32 %2
}
int puttab(int x, int w, int xskip, char *s, int tab) {
  for (;;) {
    if (0 <= x && x < w) {
      s[x] = ' ';
    }
    x++;
    if ((x + xskip) % tab == 0) {
      break;
    }
  }
  return x;
}


x86 assembly (clang, -O0):
<puttab>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %rcx,-0x18(%rbp)
mov    %r8d,-0x1c(%rbp)
xor    %eax,%eax
cmp    -0x4(%rbp),%eax
jg     1138 <puttab+0x38>
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1138 <puttab+0x38>
mov    -0x18(%rbp),%rax
movslq -0x4(%rbp),%rcx
movb   $0x20,(%rax,%rcx,1)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    -0xc(%rbp),%eax
cltd
idivl  -0x1c(%rbp)
cmp    $0x0,%edx
jne    1159 <puttab+0x59>
jmp    115e <puttab+0x5e>
jmp    1115 <puttab+0x15>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<puttab>:
mov    %edx,%r9d
add    $0x1,%r9d
jmp    111f <puttab+0x1f>
nopl   0x0(%rax)
lea    (%r9,%rdi,1),%eax
add    $0x1,%edi
cltd
idiv   %r8d
test   %edx,%edx
je     112f <puttab+0x2f>
test   %edi,%edi
js     1110 <puttab+0x10>
cmp    %esi,%edi
jge    1110 <puttab+0x10>
mov    %edi,%eax
movb   $0x20,(%rcx,%rax,1)
jmp    1110 <puttab+0x10>
mov    %edi,%eax
ret

LLVM IR (-O0):
define i32 @puttab(i32 %0, i32 %1, i32 %2, i8* %3, i32 %4) {
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i8*
%10 = alloca i32
store i32 %0, i32* %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i8* %3, i8** %9
store i32 %4, i32* %10
br label %11
11: ; preds = %33, %5
%12 = load i32, i32* %6
%13 = icmp sle i32 0, %12
br i1 %13, label %14, label %23
14: ; preds = %11
%15 = load i32, i32* %6
%16 = load i32, i32* %7
%17 = icmp slt i32 %15, %16
br i1 %17, label %18, label %23
18: ; preds = %14
%19 = load i8*, i8** %9
%20 = load i32, i32* %6
%21 = sext i32 %20 to i64
%22 = getelementptr inbounds i8, i8* %19, i64 %21
store i8 32, i8* %22
br label %23
23: ; preds = %18, %14, %11
%24 = load i32, i32* %6
%25 = add nsw i32 %24, 1
store i32 %25, i32* %6
%26 = load i32, i32* %6
%27 = load i32, i32* %8
%28 = add nsw i32 %26, %27
%29 = load i32, i32* %10
%30 = srem i32 %28, %29
%31 = icmp eq i32 %30, 0
br i1 %31, label %32, label %33
32: ; preds = %23
br label %34
33: ; preds = %23
br label %11
34: ; preds = %32
%35 = load i32, i32* %6
ret i32 %35
}

LLVM IR (-O2):
define i32 @puttab(i32 %0, i32 %1, i32 %2, i8* nocapture writeonly %3, i32 %4) {
br label %6
6: ; preds = %14, %5
%7 = phi i32 [ %0, %5 ], [ %15, %14 ]
%8 = icmp sgt i32 %7, -1
%9 = icmp slt i32 %7, %1
%10 = and i1 %8, %9
br i1 %10, label %11, label %14
11: ; preds = %6
%12 = zext i32 %7 to i64
%13 = getelementptr inbounds i8, i8* %3, i64 %12
store i8 32, i8* %13
br label %14
14: ; preds = %11, %6
%15 = add nsw i32 %7, 1
%16 = add nsw i32 %15, %2
%17 = srem i32 %16, %4
%18 = icmp eq i32 %17, 0
br i1 %18, label %19, label %6
19: ; preds = %14
ret i32 %15
}
/* Variables and functions */
scalar_t__ strcmp(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
void zAmberConvertWildCard(char *sType) {
  if (strcmp(sType, "X") == 0) {
    strcpy(sType, "?");
  }
}


x86 assembly (clang, -O0):
<zAmberConvertWildCard>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xec9(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    1156 <zAmberConvertWildCard+0x36>
mov    -0x8(%rbp),%rdi
lea    0xeb1(%rip),%rsi
call   1030 <strcpy@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<zAmberConvertWildCard>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rsi
call   1040 <strcmp@plt>
test   %rax,%rax
je     1137 <zAmberConvertWildCard+0x17>
pop    %rbx
ret
lea    0xec4(%rip),%rsi
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <strcpy@plt>

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

LLVM IR (-O2):
@.str = [2 x i8] c"X\00"
@.str.1 = [2 x i8] c"?\00"
define void @zAmberConvertWildCard(i8* %0) {
%2 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @strcpy(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
br label %6
6: ; preds = %4, %1
ret void
}
/* Variables and functions */
bool errors_reported(void) {
  extern bool errors;
  return errors;
}


x86 assembly (clang, -O0):
<errors_reported>:
push   %rbp
mov    %rsp,%rbp
mov    0x2edd(%rip),%rax
mov    (%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<errors_reported>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%eax
ret

LLVM IR (-O0):
@errors = external global i32
define i32 @errors_reported() {
%1 = load i32, i32* @errors
ret i32 %1
}

LLVM IR (-O2):
@errors = external global i32
define i32 @errors_reported() {
%1 = load i32, i32* @errors
ret i32 %1
}
void sigchld_handler(int sig) { return; }


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

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

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

LLVM IR (-O2):
define void @sigchld_handler(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int log2_ceil(int n) {
  int e;
  assert(n >= 1);
  for (e = 0;; e++)
    if ((1 << e) >= n)
      break;
  return e;
}


x86 assembly (clang, -O0):
<log2_ceil>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x1,-0x4(%rbp)
setge  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
cmp    -0x4(%rbp),%eax
jl     114b <log2_ceil+0x3b>
jmp    115e <log2_ceil+0x4e>
jmp    1150 <log2_ceil+0x40>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1133 <log2_ceil+0x23>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<log2_ceil>:
push   %rbx
mov    %edi,%ebx
xor    %edi,%edi
test   %ebx,%ebx
setg   %dil
call   1030 <assert@plt>
mov    $0xffffffff,%ecx
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%ecx
mov    $0x1,%eax
shl    %cl,%eax
cmp    %ebx,%eax
jl     1130 <log2_ceil+0x20>
mov    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @log2_ceil(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = icmp sge i32 %4, 1
%6 = zext i1 %5 to i32
%7 = call i32 @assert(i32 %6)
store i32 0, i32* %3
br label %8
8: ; preds = %15, %1
%9 = load i32, i32* %3
%10 = shl i32 1, %9
%11 = load i32, i32* %2
%12 = icmp sge i32 %10, %11
br i1 %12, label %13, label %14
13: ; preds = %8
br label %18
14: ; preds = %8
br label %15
15: ; preds = %14
%16 = load i32, i32* %3
%17 = add nsw i32 %16, 1
store i32 %17, i32* %3
br label %8
18: ; preds = %13
%19 = load i32, i32* %3
ret i32 %19
}

LLVM IR (-O2):
define i32 @log2_ceil(i32 %0) {
%2 = icmp sgt i32 %0, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @assert(i32 %3)
br label %5
5: ; preds = %5, %1
%6 = phi i32 [ 0, %1 ], [ %9, %5 ]
%7 = shl nuw i32 1, %6
%8 = icmp slt i32 %7, %0
%9 = add nuw nsw i32 %6, 1
br i1 %8, label %5, label %10
10: ; preds = %5
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ usleep(unsigned long);
void tkMsSleep(unsigned long pa_ms) { usleep(pa_ms * 1000); }


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

x86 assembly (clang, -O2):
<tkMsSleep>:
imul   $0x3e8,%rdi,%rdi
jmp    1030 <usleep@plt>

LLVM IR (-O0):
define void @tkMsSleep(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = mul i64 %3, 1000
%5 = call i32 @usleep(i64 %4)
ret void
}

LLVM IR (-O2):
define void @tkMsSleep(i64 %0) {
%2 = mul i64 %0, 1000
%3 = tail call i32 @usleep(i64 %2)
ret void
}
void ASN1_STRING_to_UTF8(void) {}


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

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

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

LLVM IR (-O2):
define void @ASN1_STRING_to_UTF8() {
ret void
}
int func(char hex_dec[100]) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @func(i8* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
double exp(double);
double exp10_(double m) { return exp(2.3025850929940456840179914546844 * m); }


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

x86 assembly (clang, -O2):
<exp10_>:
mulsd  0xee8(%rip),%xmm0
jmp    1030 <exp@plt>

LLVM IR (-O0):
define double @exp10_(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fmul double 0x40026BB1BBB55516, %3
%5 = call double @exp(double %4)
ret double %5
}

LLVM IR (-O2):
define double @exp10_(double %0) {
%2 = fmul double %0, 0x40026BB1BBB55516
%3 = tail call double @exp(double %2)
ret double %3
}
/* Variables and functions */
int /*<<< orphan*/ reportNil();
int field(int recAddr, int offset) {
  if (recAddr == 0) {
    reportNil();
  } else {
    return (recAddr + offset + sizeof(int));
  }
}


x86 assembly (clang, -O0):
<field>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1134 <field+0x24>
mov    $0x0,%al
call   1030 <reportNil@plt>
jmp    1143 <field+0x33>
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
cltq
add    $0x4,%rax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<field>:
test   %edi,%edi
je     111b <field+0xb>
lea    (%rdi,%rsi,1),%eax
add    $0x4,%eax
ret
push   %rax
xor    %eax,%eax
call   1030 <reportNil@plt>
add    $0x8,%rsp
ret

LLVM IR (-O0):
define i32 @field(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* %4
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = call i32 (...) @reportNil()
br label %17
10: ; preds = %2
%11 = load i32, i32* %4
%12 = load i32, i32* %5
%13 = add nsw i32 %11, %12
%14 = sext i32 %13 to i64
%15 = add i64 %14, 4
%16 = trunc i64 %15 to i32
store i32 %16, i32* %3
br label %17
17: ; preds = %10, %8
%18 = load i32, i32* %3
ret i32 %18
}

LLVM IR (-O2):
define i32 @field(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, 0
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i32 (...) @reportNil()
br label %9
6: ; preds = %2
%7 = add i32 %0, 4
%8 = add i32 %7, %1
br label %9
9: ; preds = %6, %4
%10 = phi i32 [ undef, %4 ], [ %8, %6 ]
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pclmul() {
  printf("PCMUL is not supported.");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [24 x i8] c"PCMUL is not supported.\00"
define i32 @pclmul() {
%1 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [24 x i8] c"PCMUL is not supported.\00"
define i32 @pclmul() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ calc_cscf_parameters();
void change_cscf_scaling(void) {
  ;
  calc_cscf_parameters();
}


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

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

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

LLVM IR (-O2):
define void @change_cscf_scaling() {
%1 = tail call i32 (...) @calc_cscf_parameters()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ run_test();
int main(int argc, const char *argv[]) {
  run_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 <run_test@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @run_test()
ret i32 0
}
void identity(char *pass, int cnt, void **nxt_f) {
  void (*func)(char *pass, int cnt, void **nxt_f) = *nxt_f;
  func(pass, 0, nxt_f + 1);
  return;
}


x86 assembly (clang, -O0):
<identity>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rdx
add    $0x8,%rdx
xor    %esi,%esi
call   *%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<identity>:
mov    (%rdx),%rax
add    $0x8,%rdx
xor    %esi,%esi
jmp    *%rax

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

LLVM IR (-O2):
define void @identity(i8* %0, i32 %1, i8** %2) {
%4 = bitcast i8** %2 to void (i8*, i32, i8**)**
%5 = load void (i8*, i32, i8**)*, void (i8*, i32, i8**)** %4
%6 = getelementptr inbounds i8*, i8** %2, i64 1
tail call void %5(i8* %0, i32 0, i8** %6)
ret void
}
/* Variables and functions */
int Update(char *, char *, char *);
int HandleSubmitSPLASH(void) {
  return Update("SPLASH", "/local/etc/sysconfig/img/splash.png",
                "/bin/chmod 644 /local/etc/sysconfig/img/splash.png");
}


x86 assembly (clang, -O0):
<HandleSubmitSPLASH>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
lea    0xef4(%rip),%rsi
lea    0xede(%rip),%rdx
call   1030 <Update@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<HandleSubmitSPLASH>:
lea    0xee9(%rip),%rdi
lea    0xef8(%rip),%rsi
lea    0xee2(%rip),%rdx
jmp    1030 <Update@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"SPLASH\00"
@.str.1 = [36 x i8] c"/local/etc/sysconfig/img/splash.png\00"
@.str.2 = [51 x i8] c"/bin/chmod 644 /local/etc/sysconfig/img/splash.png\00"
define i32 @HandleSubmitSPLASH() {
%1 = call i32 @Update(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.2, i64 0, i64 0))
ret i32 %1
}

LLVM IR (-O2):
@.str = [7 x i8] c"SPLASH\00"
@.str.1 = [36 x i8] c"/local/etc/sysconfig/img/splash.png\00"
@.str.2 = [51 x i8] c"/bin/chmod 644 /local/etc/sysconfig/img/splash.png\00"
define i32 @HandleSubmitSPLASH() {
%1 = tail call i32 @Update(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.2, i64 0, i64 0))
ret i32 %1
}
/* Type definitions */
typedef int /*<<< orphan*/ Display;

/* Variables and functions */
int /*<<< orphan*/ True;
unsigned int get_time_resource(int /*<<< orphan*/ *, char *, char *,
                               int /*<<< orphan*/);
unsigned int get_seconds_resource(Display *dpy, char *res_name,
                                  char *res_class) {
  return get_time_resource(dpy, res_name, res_class, True);
}


x86 assembly (clang, -O0):
<get_seconds_resource>:
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    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    0x2eb1(%rip),%rax
mov    (%rax),%ecx
call   1030 <get_time_resource@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_seconds_resource>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%ecx
jmp    1030 <get_time_resource@plt>

LLVM IR (-O0):
@True = global i32 0
define i32 @get_seconds_resource(i32* %0, i8* %1, i8* %2) {
%4 = alloca i32*
%5 = alloca i8*
%6 = alloca i8*
store i32* %0, i32** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load i32*, i32** %4
%8 = load i8*, i8** %5
%9 = load i8*, i8** %6
%10 = load i32, i32* @True
%11 = call i32 @get_time_resource(i32* %7, i8* %8, i8* %9, i32 %10)
ret i32 %11
}

LLVM IR (-O2):
@True = global i32 0
define i32 @get_seconds_resource(i32* %0, i8* %1, i8* %2) {
%4 = load i32, i32* @True
%5 = tail call i32 @get_time_resource(i32* %0, i8* %1, i8* %2, i32 %4)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ compute(int);
int /*<<< orphan*/ scanf(char *, float *);
void method1() {
  float number;
  scanf("%f", &number);
  compute(*(int *)(&number));
}


x86 assembly (clang, -O0):
<method1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1030 <scanf@plt>
mov    -0x4(%rbp),%edi
call   1040 <compute@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<method1>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1030 <scanf@plt>
mov    0x4(%rsp),%edi
call   1040 <compute@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%f\00"
define void @method1() {
%1 = alloca float
%2 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float* %1)
%3 = bitcast float* %1 to i32*
%4 = load i32, i32* %3
%5 = call i32 @compute(i32 %4)
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%f\00"
define void @method1() {
%1 = alloca float
%2 = bitcast float* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float* %1)
%4 = bitcast float* %1 to i32*
%5 = load i32, i32* %4
%6 = call i32 @compute(i32 %5)
ret void
}
int mylib1_fct2() { printf("enter %s\n", __func__); }


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

x86 assembly (clang, -O2):
<mylib1_fct2>:
lea    0xee9(%rip),%rdi
lea    0xeec(%rip),%rsi
xor    %eax,%eax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"enter %s\0A\00"
@__func__.mylib1_fct2 = [12 x i8] c"mylib1_fct2\00"
define i32 @mylib1_fct2() {
%1 = alloca i32
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @__func__.mylib1_fct2, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@.str = [10 x i8] c"enter %s\0A\00"
@__func__.mylib1_fct2 = [12 x i8] c"mylib1_fct2\00"
define i32 @mylib1_fct2() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @__func__.mylib1_fct2, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int DPMI_LockMemory(void *, int);
int DPMI_LockMemoryRegion(void *start, void *end) {
  int status;
  status = DPMI_LockMemory(start, (char *)end - (char *)start);
  return (status);
}


x86 assembly (clang, -O0):
<DPMI_LockMemoryRegion>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rcx
sub    %rcx,%rax
mov    %eax,%esi
call   1030 <DPMI_LockMemory@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<DPMI_LockMemoryRegion>:
sub    %edi,%esi
jmp    1030 <DPMI_LockMemory@plt>

LLVM IR (-O0):
define i32 @DPMI_LockMemoryRegion(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
%7 = load i8*, i8** %4
%8 = load i8*, i8** %3
%9 = ptrtoint i8* %7 to i64
%10 = ptrtoint i8* %8 to i64
%11 = sub i64 %9, %10
%12 = trunc i64 %11 to i32
%13 = call i32 @DPMI_LockMemory(i8* %6, i32 %12)
store i32 %13, i32* %5
%14 = load i32, i32* %5
ret i32 %14
}

LLVM IR (-O2):
define i32 @DPMI_LockMemoryRegion(i8* %0, i8* %1) {
%3 = ptrtoint i8* %1 to i64
%4 = ptrtoint i8* %0 to i64
%5 = sub i64 %3, %4
%6 = trunc i64 %5 to i32
%7 = tail call i32 @DPMI_LockMemory(i8* %0, i32 %6)
ret i32 %7
}
void misc_source(double *ph, double *phxp1, double *phxm1, double *phyp1,
                 double *phym1, int ii, int jj, int kk, struct of_geom *geom,
                 struct of_state *q, double *dU, double Dt) {
  double dudx1, dudx2;
}


x86 assembly (clang, -O0):
<misc_source>:
push   %rbp
mov    %rsp,%rbp
mov    0x30(%rbp),%rax
mov    0x28(%rbp),%rax
mov    0x20(%rbp),%rax
mov    0x18(%rbp),%eax
mov    0x10(%rbp),%eax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9d,-0x2c(%rbp)
movsd  %xmm0,-0x38(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.of_geom = type opaque
%struct.of_state = type opaque
define void @misc_source(double* %0, double* %1, double* %2, double* %3, double* %4, i32 %5, i32 %6, i32 %7, %struct.of_geom* %8, %struct.of_state* %9, double* %10, double %11) {
%13 = alloca double*
%14 = alloca double*
%15 = alloca double*
%16 = alloca double*
%17 = alloca double*
%18 = alloca i32
%19 = alloca i32
%20 = alloca i32
%21 = alloca %struct.of_geom*
%22 = alloca %struct.of_state*
%23 = alloca double*
%24 = alloca double
%25 = alloca double
%26 = alloca double
store double* %0, double** %13
store double* %1, double** %14
store double* %2, double** %15
store double* %3, double** %16
store double* %4, double** %17
store i32 %5, i32* %18
store i32 %6, i32* %19
store i32 %7, i32* %20
store %struct.of_geom* %8, %struct.of_geom** %21
store %struct.of_state* %9, %struct.of_state** %22
store double* %10, double** %23
store double %11, double* %24
ret void
}

LLVM IR (-O2):
%struct.of_geom = type opaque
%struct.of_state = type opaque
define void @misc_source(double* nocapture %0, double* nocapture %1, double* nocapture %2, double* nocapture %3, double* nocapture %4, i32 %5, i32 %6, i32 %7, %struct.of_geom* nocapture %8, %struct.of_state* nocapture %9, double* nocapture %10, double %11) {
ret void
}
RX0AR1(r0, r1, x0, x1, p0, p1) unsigned char r0, r1;
unsigned char *p0, *p1;
{
  if ((p0[x0]) <= (p1[1111111 / 4]))
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<RX0AR1>:
push   %rbp
mov    %rsp,%rbp
mov    %esi,%eax
mov    %dil,%sil
mov    %sil,-0x5(%rbp)
mov    %al,-0x6(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8,-0x18(%rbp)
mov    %r9,-0x20(%rbp)
mov    -0x18(%rbp),%rax
movslq -0xc(%rbp),%rcx
movzbl (%rax,%rcx,1),%eax
mov    -0x20(%rbp),%rcx
movzbl 0x43d11(%rcx),%ecx
cmp    %ecx,%eax
jg     1149 <RX0AR1+0x49>
movl   $0x1,-0x4(%rbp)
jmp    1150 <RX0AR1+0x50>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<RX0AR1>:
movslq %edx,%rax
mov    (%r8,%rax,1),%cl
xor    %eax,%eax
cmp    0x43d11(%r9),%cl
setbe  %al
ret

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

LLVM IR (-O2):
define i32 @RX0AR1(i32 %0, i32 %1, i32 %2, i32 %3, i8* nocapture %4, i8* nocapture %5) {
%7 = sext i32 %2 to i64
%8 = getelementptr inbounds i8, i8* %4, i64 %7
%9 = load i8, i8* %8
%10 = getelementptr inbounds i8, i8* %5, i64 277777
%11 = load i8, i8* %10
%12 = icmp ule i8 %9, %11
%13 = zext i1 %12 to i32
ret i32 %13
}
/* Variables and functions */
int BIO_fd_non_fatal_error(int);
int get_last_sys_error();
int BIO_fd_should_retry(int i) {
  int err;
  if ((i == 0) || (i == -1)) {
    err = get_last_sys_error();
    return (BIO_fd_non_fatal_error(err));
  }
  return (0);
}


x86 assembly (clang, -O0):
<BIO_fd_should_retry>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     113f <BIO_fd_should_retry+0x1f>
cmpl   $0xffffffff,-0x8(%rbp)
jne    1159 <BIO_fd_should_retry+0x39>
mov    $0x0,%al
call   1030 <get_last_sys_error@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%edi
call   1040 <BIO_fd_non_fatal_error@plt>
mov    %eax,-0x4(%rbp)
jmp    1160 <BIO_fd_should_retry+0x40>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<BIO_fd_should_retry>:
add    $0x1,%edi
cmp    $0x1,%edi
ja     1138 <BIO_fd_should_retry+0x18>
push   %rax
xor    %eax,%eax
call   1030 <get_last_sys_error@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <BIO_fd_non_fatal_error@plt>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @BIO_fd_should_retry(i32 %0) {
%2 = add i32 %0, 1
%3 = icmp ult i32 %2, 2
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = tail call i32 (...) @get_last_sys_error()
%6 = tail call i32 @BIO_fd_non_fatal_error(i32 %5)
br label %7
7: ; preds = %1, %4
%8 = phi i32 [ %6, %4 ], [ 0, %1 ]
ret i32 %8
}
/* Variables and functions */
scalar_t__ islower(char);
char toupper(char);
void convert_to_uppercase(char *s_ptr) {
  while (*s_ptr != '\0') {
    if (islower(*s_ptr))
      *s_ptr = toupper(*s_ptr);
    ++s_ptr;
  }
}


x86 assembly (clang, -O0):
<convert_to_uppercase>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1177 <convert_to_uppercase+0x57>
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <islower@plt>
cmp    $0x0,%rax
je     1166 <convert_to_uppercase+0x46>
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1040 <toupper@plt>
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    112c <convert_to_uppercase+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<convert_to_uppercase>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1155 <convert_to_uppercase+0x35>
mov    %rdi,%rbx
jmp    113c <convert_to_uppercase+0x1c>
nopl   0x0(%rax)
movzbl 0x1(%rbx),%eax
add    $0x1,%rbx
test   %al,%al
je     1155 <convert_to_uppercase+0x35>
movsbl %al,%edi
call   1030 <islower@plt>
test   %rax,%rax
je     1130 <convert_to_uppercase+0x10>
movsbl (%rbx),%edi
call   1040 <toupper@plt>
mov    %al,(%rbx)
jmp    1130 <convert_to_uppercase+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @convert_to_uppercase(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %16, label %4
4: ; preds = %1, %12
%5 = phi i8 [ %14, %12 ], [ %2, %1 ]
%6 = phi i8* [ %13, %12 ], [ %0, %1 ]
%7 = tail call i64 @islower(i8 signext %5)
%8 = icmp eq i64 %7, 0
br i1 %8, label %12, label %9
9: ; preds = %4
%10 = load i8, i8* %6
%11 = tail call signext i8 @toupper(i8 signext %10)
store i8 %11, i8* %6
br label %12
12: ; preds = %9, %4
%13 = getelementptr inbounds i8, i8* %6, i64 1
%14 = load i8, i8* %13
%15 = icmp eq i8 %14, 0
br i1 %15, label %16, label %4
16: ; preds = %12, %1
ret void
}
/* Variables and functions */
unsigned long get_sp(void) { __asm__("mov %esp, %eax"); }


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

x86 assembly (clang, -O2):
<get_sp>:
mov    %esp,%eax
ret

LLVM IR (-O0):
define i64 @get_sp() {
%1 = alloca i64
%2 = load i64, i64* %1
ret i64 %2
}

LLVM IR (-O2):
define i64 @get_sp() {
tail call void asm sideeffect "mov %esp, %eax", "~{dirflag},~{fpsr},~{flags}"()
ret i64 undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void help() {
  printf("getopt test program\n"
         "Usage: test [OPTION] [INPUT]\n"
         "   INPUT           set input filename (doesn't do anything)\n"
         "   -h              help menu (this screen)\n"
         "   -i              interactive mode (doesn't do anything)\n"
         "   -f              force mode (doesn't do anything)\n"
         "   -r              recursive mode (doesn't do anything)\n"
         "   -v[level]       set verbosity level (5 is default; doesn't do "
         "anything)\n"
         "   -o filename     set output filename (doesn't do anything)\n");
}


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

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

LLVM IR (-O0):
@.str = [455 x i8] c"getopt test program\0AUsage: test [OPTION] [INPUT]\0A INPUT set input filename (doesn't do anything)\0A -h help menu (this screen)\0A -i interactive mode (doesn't do anything)\0A -f force mode (doesn't do anything)\0A -r recursive mode (doesn't do anything)\0A -v[level] set verbosity level (5 is default; doesn't do anything)\0A -o filename set output filename (doesn't do anything)\0A\00"
define void @help() {
%1 = call i32 @printf(i8* getelementptr inbounds ([455 x i8], [455 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [454 x i8] c"getopt test program\0AUsage: test [OPTION] [INPUT]\0A INPUT set input filename (doesn't do anything)\0A -h help menu (this screen)\0A -i interactive mode (doesn't do anything)\0A -f force mode (doesn't do anything)\0A -r recursive mode (doesn't do anything)\0A -v[level] set verbosity level (5 is default; doesn't do anything)\0A -o filename set output filename (doesn't do anything)\00"
define void @help() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([454 x i8], [454 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ test_low_high();
int /*<<< orphan*/ test_pack();
int /*<<< orphan*/ test_rawmask();
int /*<<< orphan*/ test_shift();
int /*<<< orphan*/ test_unpack();
int /*<<< orphan*/ test_width();
void bf_test(void) {
  test_low_high();
  test_width();
  test_shift();
  test_rawmask();
  test_unpack();
  test_pack();
}


x86 assembly (clang, -O0):
<bf_test>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1050 <test_low_high@plt>
mov    $0x0,%al
call   1080 <test_width@plt>
mov    $0x0,%al
call   1040 <test_shift@plt>
mov    $0x0,%al
call   1060 <test_rawmask@plt>
mov    $0x0,%al
call   1070 <test_unpack@plt>
mov    $0x0,%al
call   1030 <test_pack@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<bf_test>:
push   %rax
xor    %eax,%eax
call   1050 <test_low_high@plt>
xor    %eax,%eax
call   1080 <test_width@plt>
xor    %eax,%eax
call   1040 <test_shift@plt>
xor    %eax,%eax
call   1060 <test_rawmask@plt>
xor    %eax,%eax
call   1070 <test_unpack@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <test_pack@plt>

LLVM IR (-O0):
define void @bf_test() {
%1 = call i32 (...) @test_low_high()
%2 = call i32 (...) @test_width()
%3 = call i32 (...) @test_shift()
%4 = call i32 (...) @test_rawmask()
%5 = call i32 (...) @test_unpack()
%6 = call i32 (...) @test_pack()
ret void
}

LLVM IR (-O2):
define void @bf_test() {
%1 = tail call i32 (...) @test_low_high()
%2 = tail call i32 (...) @test_width()
%3 = tail call i32 (...) @test_shift()
%4 = tail call i32 (...) @test_rawmask()
%5 = tail call i32 (...) @test_unpack()
%6 = tail call i32 (...) @test_pack()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
void output_widthmap(FILE *stream) {}


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

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

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

LLVM IR (-O2):
define void @output_widthmap(i32* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ default_handler();
__attribute__((weak)) void SAI2_IRQHandler() { default_handler(); }


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

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

LLVM IR (-O0):
define weak void @SAI2_IRQHandler() {
%1 = call i32 (...) @default_handler()
ret void
}

LLVM IR (-O2):
define weak void @SAI2_IRQHandler() {
%1 = tail call i32 (...) @default_handler()
ret void
}
/* Variables and functions */
int func16();
int main(int argc, char *argv[]) { return func16() == 3 ? 0 : 1; }


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 <func16@plt>
mov    %eax,%edx
mov    $0x1,%eax
xor    %ecx,%ecx
cmp    $0x3,%edx
cmove  %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <func16@plt>
xor    %ecx,%ecx
cmp    $0x3,%eax
setne  %cl
mov    %ecx,%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 (...) @func16()
%7 = icmp eq i32 %6, 3
%8 = zext i1 %7 to i64
%9 = select i1 %7, i32 0, i32 1
ret i32 %9
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @func16()
%4 = icmp ne i32 %3, 3
%5 = zext i1 %4 to i32
ret i32 %5
}
int limit(int val, int min, int max) {
  if (val < min)
    return min;
  if (val > max)
    return max;
  return val;
}


x86 assembly (clang, -O0):
<limit>:
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    1124 <limit+0x24>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1141 <limit+0x41>
mov    -0x8(%rbp),%eax
cmp    -0x10(%rbp),%eax
jle    113b <limit+0x3b>
mov    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1141 <limit+0x41>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @limit(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 %13
11: ; preds = %3
%12 = load i32, i32* %6
store i32 %12, i32* %4
br label %21
13: ; preds = %3
%14 = load i32, i32* %5
%15 = load i32, i32* %7
%16 = icmp sgt i32 %14, %15
br i1 %16, label %17, label %19
17: ; preds = %13
%18 = load i32, i32* %7
store i32 %18, i32* %4
br label %21
19: ; preds = %13
%20 = load i32, i32* %5
store i32 %20, i32* %4
br label %21
21: ; preds = %19, %17, %11
%22 = load i32, i32* %4
ret i32 %22
}

LLVM IR (-O2):
define i32 @limit(i32 %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %0, %1
%5 = icmp sgt i32 %0, %2
%6 = select i1 %5, i32 %2, i32 %0
%7 = select i1 %4, i32 %1, i32 %6
ret i32 %7
}
unsigned long get_fs(void) { return 1; }


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

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

LLVM IR (-O0):
define i64 @get_fs() {
ret i64 1
}

LLVM IR (-O2):
define i64 @get_fs() {
ret i64 1
}
/* Type definitions */
typedef int /*<<< orphan*/ clock_t;

/* Variables and functions */
int /*<<< orphan*/ clock();
clock_t FUZ_GetMilliStart(void) { return clock(); }


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

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

LLVM IR (-O0):
define i32 @FUZ_GetMilliStart() {
%1 = call i32 (...) @clock()
ret i32 %1
}

LLVM IR (-O2):
define i32 @FUZ_GetMilliStart() {
%1 = tail call i32 (...) @clock()
ret i32 %1
}
int main() {
  int a;
  a = 1 + 2;
  return a;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x3,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 3
}
void freeArgs(int argc, char **argv) {
  for (; argc >= 0; argc--)
    free(argv[argc]);
  free(argv);
}


x86 assembly (clang, -O0):
<freeArgs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x0,-0x4(%rbp)
jl     1148 <freeArgs+0x38>
mov    -0x10(%rbp),%rax
movslq -0x4(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <free@plt>
mov    -0x4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x4(%rbp)
jmp    111f <freeArgs+0xf>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<freeArgs>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
test   %edi,%edi
js     112f <freeArgs+0x1f>
mov    %edi,%ebx
nopl   (%rax)
mov    (%r14,%rbx,8),%rdi
call   1030 <free@plt>
add    $0xffffffffffffffff,%rbx
jb     1120 <freeArgs+0x10>
mov    %r14,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @freeArgs(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, -1
br i1 %3, label %4, label %12
4: ; preds = %2
%5 = zext i32 %0 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ %5, %4 ], [ %10, %6 ]
%8 = getelementptr inbounds i8*, i8** %1, i64 %7
%9 = load i8*, i8** %8
tail call void @free(i8* %9)
%10 = add nsw i64 %7, -1
%11 = icmp eq i64 %7, 0
br i1 %11, label %12, label %6
12: ; preds = %6, %2
%13 = bitcast i8** %1 to i8*
tail call void @free(i8* %13)
ret void
}
int __test_and_change_bit(long nr, volatile unsigned long *addr) {
  int oldbit;
  asm volatile("btc %2,%1\n\t"
               "sbb %0,%0"
               : "=r"(oldbit), "+m"(*(volatile long *)(addr))
               : "Ir"(nr)
               : "memory");
  return oldbit;
}


x86 assembly (clang, -O0):
<__test_and_change_bit>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rcx
btc    %rcx,(%rax)
sbb    %eax,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__test_and_change_bit>:
btc    %rdi,(%rsi)
sbb    %eax,%eax
ret

LLVM IR (-O0):
define i32 @__test_and_change_bit(i64 %0, i64* %1) {
%3 = alloca i64
%4 = alloca i64*
%5 = alloca i32
store i64 %0, i64* %3
store i64* %1, i64** %4
%6 = load i64*, i64** %4
%7 = load i64, i64* %3
%8 = call i32 asm sideeffect "btc $2,$1\0A\09sbb $0,$0", "=r,=*m,Ir,*m,~{memory},~{dirflag},~{fpsr},~{flags}"(i64* elementtype(i64) %6, i64 %7, i64* elementtype(i64) %6)
store i32 %8, i32* %5
%9 = load i32, i32* %5
ret i32 %9
}

LLVM IR (-O2):
define i32 @__test_and_change_bit(i64 %0, i64* %1) {
%3 = tail call i32 asm sideeffect "btc $2,$1\0A\09sbb $0,$0", "=r,=*m,Ir,*m,~{memory},~{dirflag},~{fpsr},~{flags}"(i64* elementtype(i64) %1, i64 %0, i64* elementtype(i64) %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ fz_free(void *);
void zfree(void *opaque, void *address) { fz_free(address); }


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

x86 assembly (clang, -O2):
<zfree>:
mov    %rsi,%rdi
jmp    1030 <fz_free@plt>

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

LLVM IR (-O2):
define void @zfree(i8* nocapture readnone %0, i8* %1) {
%3 = tail call i32 @fz_free(i8* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(void) {
  printf("Something that matches\n");
  printf("And something that doesn't\n");
  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    0xee6(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [24 x i8] c"Something that matches\0A\00"
@.str.1 = [28 x i8] c"And something that doesn't\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [23 x i8] c"Something that matches\00"
@str.2 = [27 x i8] c"And something that doesn't\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str.2, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int wait_a_while(int);
int main(int argc, char **argv) {
  printf("stop here in main.\n");
  int num_times = wait_a_while(argc * 1000);
  printf("Done, took %d times.\n", num_times);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xec3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
imul   $0x3e8,-0x8(%rbp),%edi
call   1040 <wait_a_while@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%esi
lea    0xeb7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    %edi,%ebx
lea    0xedc(%rip),%rdi
call   1030 <puts@plt>
imul   $0x3e8,%ebx,%edi
call   1050 <wait_a_while@plt>
lea    0xeaf(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [20 x i8] c"stop here in main.\0A\00"
@.str.1 = [22 x i8] c"Done, took %d times.\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%8 = load i32, i32* %4
%9 = mul nsw i32 %8, 1000
%10 = call i32 @wait_a_while(i32 %9)
store i32 %10, i32* %6
%11 = load i32, i32* %6
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i32 %11)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [22 x i8] c"Done, took %d times.\0A\00"
@str = [19 x i8] c"stop here in main.\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str, i64 0, i64 0))
%4 = mul nsw i32 %0, 1000
%5 = tail call i32 @wait_a_while(i32 %4)
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i32 %5)
ret i32 0
}