xunge/DecIR huggingface dataset:
void my_atomic_storeptr(void *volatile *a, void *v) {
  (void)__sync_lock_test_and_set(a, v);
}


x86 assembly (clang, -O0):
<my_atomic_storeptr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rcx
mov    -0x10(%rbp),%rax
xchg   %rax,(%rcx)
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_atomic_storeptr>:
xchg   %rsi,(%rdi)
ret

LLVM IR (-O0):
define void @my_atomic_storeptr(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 = bitcast i8** %5 to i64*
%7 = load i8*, i8** %4
%8 = ptrtoint i8* %7 to i64
%9 = atomicrmw xchg i64* %6, i64 %8 seq_cst
%10 = inttoptr i64 %9 to i8*
ret void
}

LLVM IR (-O2):
define void @my_atomic_storeptr(i8** nocapture %0, i8* %1) {
%3 = bitcast i8** %0 to i64*
%4 = ptrtoint i8* %1 to i64
%5 = atomicrmw xchg i64* %3, i64 %4 seq_cst
ret void
}
/* Variables and functions */
int /*<<< orphan*/ scanf(char *, int *);
int promptValue() {
  int value;
  scanf("%d", &value);
  return value;
}


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

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

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @promptValue() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
ret i32 %4
}
int isgraph(int c) { return ((c) > ' ') && ((c) <= 126); }


x86 assembly (clang, -O0):
<isgraph>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x20,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jle    1120 <isgraph+0x20>
cmpl   $0x7e,-0x4(%rbp)
setle  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isgraph>:
add    $0xffffffdf,%edi
xor    %eax,%eax
cmp    $0x5e,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @isgraph(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sgt i32 %3, 32
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 126
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ false, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @isgraph(i32 %0) {
%2 = add i32 %0, -33
%3 = icmp ult i32 %2, 94
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ test_err_sys();
int /*<<< orphan*/ test_lockfile();
int /*<<< orphan*/ test_pr();
int /*<<< orphan*/ test_xlog();
int main(int argc, char *argv[]) {
  test_pr();
  test_xlog();
  test_lockfile();
  test_err_sys();
  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 <test_pr@plt>
mov    $0x0,%al
call   1040 <test_xlog@plt>
mov    $0x0,%al
call   1060 <test_lockfile@plt>
mov    $0x0,%al
call   1050 <test_err_sys@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <test_pr@plt>
xor    %eax,%eax
call   1040 <test_xlog@plt>
xor    %eax,%eax
call   1060 <test_lockfile@plt>
xor    %eax,%eax
call   1050 <test_err_sys@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 (...) @test_pr()
%7 = call i32 (...) @test_xlog()
%8 = call i32 (...) @test_lockfile()
%9 = call i32 (...) @test_err_sys()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @test_pr()
%4 = tail call i32 (...) @test_xlog()
%5 = tail call i32 (...) @test_lockfile()
%6 = tail call i32 (...) @test_err_sys()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ getchar();
int /*<<< orphan*/ towers(int);
int main() {
  towers(3);
  getchar();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x3,%edi
call   1040 <towers@plt>
mov    $0x0,%al
call   1030 <getchar@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x3,%edi
call   1040 <towers@plt>
xor    %eax,%eax
call   1030 <getchar@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 @towers(i32 3)
%2 = call i32 (...) @getchar()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @towers(i32 3)
%2 = tail call i32 (...) @getchar()
ret i32 0
}
void border_se_ext_diagonal_special_sand_long_hori(unsigned char *pic,
                                                   unsigned char *mirr) {
  *pic = 0x30;
  ;
}


x86 assembly (clang, -O0):
<border_se_ext_diagonal_special_sand_long_hori>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movb   $0x30,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<border_se_ext_diagonal_special_sand_long_hori>:
movb   $0x30,(%rdi)
ret

LLVM IR (-O0):
define void @border_se_ext_diagonal_special_sand_long_hori(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
store i8 48, i8* %5
ret void
}

LLVM IR (-O2):
define void @border_se_ext_diagonal_special_sand_long_hori(i8* nocapture writeonly %0, i8* nocapture readnone %1) {
store i8 48, i8* %0
ret void
}
/* Variables and functions */
bool romwbw_bios_present(void) {
  unsigned int **bios_signature = (unsigned int **)0xFFFE;
  return (**bios_signature == 0xA857);
}


x86 assembly (clang, -O0):
<romwbw_bios_present>:
push   %rbp
mov    %rsp,%rbp
mov    $0xfffe,%eax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
cmpl   $0xa857,(%rax)
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<romwbw_bios_present>:
mov    0xfffe,%rcx
xor    %eax,%eax
cmpl   $0xa857,(%rcx)
sete   %al
ret

LLVM IR (-O0):
define i32 @romwbw_bios_present() {
%1 = alloca i32**
store i32** inttoptr (i64 65534 to i32**), i32*** %1
%2 = load i32**, i32*** %1
%3 = load i32*, i32** %2
%4 = load i32, i32* %3
%5 = icmp eq i32 %4, 43095
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @romwbw_bios_present() {
%1 = load i32*, i32** inttoptr (i64 65534 to i32**)
%2 = load i32, i32* %1
%3 = icmp eq i32 %2, 43095
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
size_t strnlen(const char *s, size_t count) {
  const char *sc;
  for (sc = s; count-- && *sc != '\0'; ++sc) {
    ;
  }
  return sc - s;
}


x86 assembly (clang, -O0):
<strnlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rcx
mov    %rcx,%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x10(%rbp)
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x19(%rbp)
je     1142 <strnlen+0x42>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
setne  %al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
test   $0x1,%al
jne    1152 <strnlen+0x52>
jmp    1168 <strnlen+0x68>
jmp    1157 <strnlen+0x57>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1114 <strnlen+0x14>
mov    -0x18(%rbp),%rax
mov    -0x8(%rbp),%rcx
sub    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strnlen>:
mov    %rdi,%rax
test   %rsi,%rsi
je     1125 <strnlen+0x25>
lea    (%rdi,%rsi,1),%rcx
mov    %rdi,%rax
nop
cmpb   $0x0,(%rax)
je     1125 <strnlen+0x25>
add    $0xffffffffffffffff,%rsi
add    $0x1,%rax
test   %rsi,%rsi
jne    1110 <strnlen+0x10>
mov    %rcx,%rax
sub    %rdi,%rax
ret

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

LLVM IR (-O2):
define i64 @strnlen(i8* %0, i64 %1) {
%3 = icmp eq i64 %1, 0
br i1 %3, label %15, label %4
4: ; preds = %2
%5 = getelementptr i8, i8* %0, i64 %1
br label %6
6: ; preds = %4, %12
%7 = phi i64 [ %9, %12 ], [ %1, %4 ]
%8 = phi i8* [ %13, %12 ], [ %0, %4 ]
%9 = add i64 %7, -1
%10 = load i8, i8* %8
%11 = icmp eq i8 %10, 0
br i1 %11, label %15, label %12
12: ; preds = %6
%13 = getelementptr inbounds i8, i8* %8, i64 1
%14 = icmp eq i64 %9, 0
br i1 %14, label %15, label %6
15: ; preds = %6, %12, %2
%16 = phi i8* [ %0, %2 ], [ %5, %12 ], [ %8, %6 ]
%17 = ptrtoint i8* %16 to i64
%18 = ptrtoint i8* %0 to i64
%19 = sub i64 %17, %18
ret i64 %19
}
void ASN1_STRING_TABLE_add(void) {}


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

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

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

LLVM IR (-O2):
define void @ASN1_STRING_TABLE_add() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, char *, unsigned char, int, int);
void outmsg(char *msg, int start, int nextstart, unsigned char type) {
  printf("# %5d MB %16s (type %2x): sectors %9d-%9d\n",
         ((nextstart - start) + 1024) / 2048, msg, type, start, nextstart - 1);
}


x86 assembly (clang, -O0):
<outmsg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %cl,%al
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %al,-0x11(%rbp)
mov    -0x10(%rbp),%eax
sub    -0xc(%rbp),%eax
add    $0x400,%eax
mov    $0x800,%ecx
cltd
idiv   %ecx
mov    %eax,%esi
mov    -0x8(%rbp),%rdx
mov    -0x11(%rbp),%al
mov    -0xc(%rbp),%r8d
mov    -0x10(%rbp),%r9d
sub    $0x1,%r9d
lea    0xeaa(%rip),%rdi
movzbl %al,%ecx
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<outmsg>:
mov    %esi,%r8d
mov    %rdi,%rax
lea    -0x1(%rdx),%r9d
mov    %edx,%esi
sub    %r8d,%esi
lea    0x400(%rsi),%edx
add    $0xbff,%esi
test   %edx,%edx
cmovns %edx,%esi
sar    $0xb,%esi
lea    0xec6(%rip),%rdi
mov    %rax,%rdx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [43 x i8] c"# %5d MB %16s (type %2x): sectors %9d-%9d\0A\00"
define void @outmsg(i8* %0, i32 %1, i32 %2, i8 zeroext %3) {
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i8
store i8* %0, i8** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i8 %3, i8* %8
%9 = load i32, i32* %7
%10 = load i32, i32* %6
%11 = sub nsw i32 %9, %10
%12 = add nsw i32 %11, 1024
%13 = sdiv i32 %12, 2048
%14 = load i8*, i8** %5
%15 = load i8, i8* %8
%16 = load i32, i32* %6
%17 = load i32, i32* %7
%18 = sub nsw i32 %17, 1
%19 = call i32 @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0), i32 %13, i8* %14, i8 zeroext %15, i32 %16, i32 %18)
ret void
}

LLVM IR (-O2):
@.str = [43 x i8] c"# %5d MB %16s (type %2x): sectors %9d-%9d\0A\00"
define void @outmsg(i8* %0, i32 %1, i32 %2, i8 zeroext %3) {
%5 = sub i32 1024, %1
%6 = add i32 %5, %2
%7 = sdiv i32 %6, 2048
%8 = add nsw i32 %2, -1
%9 = tail call i32 @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0), i32 %7, i8* %0, i8 zeroext %3, i32 %1, i32 %8)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ arm_arith_sbc(int /*<<< orphan*/);
int /*<<< orphan*/ arm_data_imm_op();
void arm_sbc_imm() { arm_arith_sbc(arm_data_imm_op()); }


x86 assembly (clang, -O0):
<arm_sbc_imm>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <arm_data_imm_op@plt>
mov    %eax,%edi
call   1040 <arm_arith_sbc@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @arm_sbc_imm() {
%1 = call i32 (...) @arm_data_imm_op()
%2 = call i32 @arm_arith_sbc(i32 %1)
ret void
}

LLVM IR (-O2):
define void @arm_sbc_imm() {
%1 = tail call i32 (...) @arm_data_imm_op()
%2 = tail call i32 @arm_arith_sbc(i32 %1)
ret void
}
double mod(double a) { return (a > 0) ? a : -a; }


x86 assembly (clang, -O0):
<mod>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    112a <mod+0x2a>
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
jmp    114b <mod+0x4b>
movsd  -0x8(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<mod>:
movapd 0xef8(%rip),%xmm1
xorpd  %xmm0,%xmm1
xorpd  %xmm2,%xmm2
cmpltsd %xmm0,%xmm2
andpd  %xmm2,%xmm0
andnpd %xmm1,%xmm2
orpd   %xmm2,%xmm0
ret

LLVM IR (-O0):
define double @mod(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fcmp ogt double %3, 0.000000e+00
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = load double, double* %2
br label %10
7: ; preds = %1
%8 = load double, double* %2
%9 = fneg double %8
br label %10
10: ; preds = %7, %5
%11 = phi double [ %6, %5 ], [ %9, %7 ]
ret double %11
}

LLVM IR (-O2):
define double @mod(double %0) {
%2 = fcmp ogt double %0, 0.000000e+00
%3 = fneg double %0
%4 = select i1 %2, double %0, double %3
ret double %4
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ printf(char *, char const *const, int const,
                          char const *const, char const *const);
__attribute__((weak, noreturn)) void __assert_func(const char *const file,
                                                   const int line,
                                                   const char *const func,
                                                   const char *const expr) {
  printf("\nassert error at %s:%d:%s:%s\n", file, line, expr, func);
  abort();
}


x86 assembly (clang, -O0):
<__assert_func>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
mov    -0x20(%rbp),%rcx
mov    -0x18(%rbp),%r8
lea    0xeb3(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<__assert_func>:
push   %rax
mov    %rdx,%r8
mov    %esi,%edx
mov    %rdi,%rsi
lea    0xed0(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@.str = [30 x i8] c"\0Aassert error at %s:%d:%s:%s\0A\00"
define weak void @__assert_func(i8* %0, i32 %1, i8* %2, i8* %3) {
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i8*
store i8* %0, i8** %5
store i32 %1, i32* %6
store i8* %2, i8** %7
store i8* %3, i8** %8
%9 = load i8*, i8** %5
%10 = load i32, i32* %6
%11 = load i8*, i8** %8
%12 = load i8*, i8** %7
%13 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* %9, i32 %10, i8* %11, i8* %12)
%14 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
@.str = [30 x i8] c"\0Aassert error at %s:%d:%s:%s\0A\00"
define weak void @__assert_func(i8* %0, i32 %1, i8* %2, i8* %3) {
%5 = tail call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %1, i8* %3, i8* %2)
%6 = tail call i32 (...) @abort()
unreachable
}
int indexOfChar(char *s, char c, int start, int end) {
  int i;
  for (i = start; i < end; i++)
    if (s[i] == c)
      return i;
  return -1;
}


x86 assembly (clang, -O0):
<indexOfChar>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x10(%rbp)
mov    %al,-0x11(%rbp)
mov    %edx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x18(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    115c <indexOfChar+0x5c>
mov    -0x10(%rbp),%rax
movslq -0x20(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
movsbl -0x11(%rbp),%ecx
cmp    %ecx,%eax
jne    1149 <indexOfChar+0x49>
mov    -0x20(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1163 <indexOfChar+0x63>
jmp    114e <indexOfChar+0x4e>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    111a <indexOfChar+0x1a>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<indexOfChar>:
mov    $0xffffffff,%eax
cmp    %ecx,%edx
jge    1120 <indexOfChar+0x20>
movslq %edx,%r8
add    %r8,%rdi
nop
cmp    %sil,(%rdi)
je     1121 <indexOfChar+0x21>
add    $0x1,%edx
add    $0x1,%rdi
cmp    %edx,%ecx
jne    1110 <indexOfChar+0x10>
ret
mov    %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @indexOfChar(i8* nocapture %0, i8 signext %1, i32 %2, i32 %3) {
%5 = icmp slt i32 %2, %3
br i1 %5, label %6, label %19
6: ; preds = %4
%7 = sext i32 %2 to i64
br label %8
8: ; preds = %6, %13
%9 = phi i64 [ %7, %6 ], [ %14, %13 ]
%10 = getelementptr inbounds i8, i8* %0, i64 %9
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, %1
br i1 %12, label %17, label %13
13: ; preds = %8
%14 = add nsw i64 %9, 1
%15 = trunc i64 %14 to i32
%16 = icmp eq i32 %15, %3
br i1 %16, label %19, label %8
17: ; preds = %8
%18 = trunc i64 %9 to i32
br label %19
19: ; preds = %13, %17, %4
%20 = phi i32 [ -1, %4 ], [ %18, %17 ], [ -1, %13 ]
ret i32 %20
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void printUsage() {
  printf("Byteswaps the contents of a file.\n");
  printf("Usage: byteswap input_file output_file\n");
}


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

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

LLVM IR (-O0):
@.str = [35 x i8] c"Byteswaps the contents of a file.\0A\00"
@.str.1 = [40 x i8] c"Usage: byteswap input_file output_file\0A\00"
define void @printUsage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [34 x i8] c"Byteswaps the contents of a file.\00"
@str.2 = [39 x i8] c"Usage: byteswap input_file output_file\00"
define void @printUsage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @str.2, i64 0, i64 0))
ret void
}
/* Variables and functions */
float __nv_modff(float, float *);
float modff(float __a, float *__b) { return __nv_modff(__a, __b); }


x86 assembly (clang, -O0):
<modff>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
mov    %rdi,-0x10(%rbp)
movss  -0x4(%rbp),%xmm0
mov    -0x10(%rbp),%rdi
call   1030 <__nv_modff@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<modff>:
jmp    1030 <__nv_modff@plt>

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

LLVM IR (-O2):
define float @modff(float %0, float* %1) {
%3 = tail call float @__nv_modff(float %0, float* %1)
ret float %3
}
/* Variables and functions */
int /*<<< orphan*/ gpio_output(char *, char *);
int /*<<< orphan*/ sprintf(char *, char *, int);
void gpio_set(int gpioNr, int val) {
  char filename[(128)];
  sprintf(filename, "/sys/class/gpio/gpio%d/value", gpioNr);
  char buf[(128)];
  sprintf(buf, "%d", val);
  gpio_output(filename, buf);
}


x86 assembly (clang, -O0):
<gpio_set>:
push   %rbp
mov    %rsp,%rbp
sub    $0x110,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
lea    -0x90(%rbp),%rdi
mov    -0x4(%rbp),%edx
lea    0xebe(%rip),%rsi
call   1040 <sprintf@plt>
lea    -0x110(%rbp),%rdi
mov    -0x8(%rbp),%edx
lea    0xec5(%rip),%rsi
call   1040 <sprintf@plt>
lea    -0x90(%rbp),%rdi
lea    -0x110(%rbp),%rsi
call   1030 <gpio_output@plt>
add    $0x110,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gpio_set>:
push   %r15
push   %r14
push   %rbx
sub    $0x100,%rsp
mov    %esi,%ebx
mov    %edi,%edx
lea    0xec9(%rip),%rsi
lea    0x80(%rsp),%r14
mov    %r14,%rdi
call   1040 <sprintf@plt>
lea    0xecf(%rip),%rsi
mov    %rsp,%r15
mov    %r15,%rdi
mov    %ebx,%edx
call   1040 <sprintf@plt>
mov    %r14,%rdi
mov    %r15,%rsi
call   1030 <gpio_output@plt>
add    $0x100,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [29 x i8] c"/sys/class/gpio/gpio%d/value\00"
@.str.1 = [3 x i8] c"%d\00"
define void @gpio_set(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca [128 x i8]
%6 = alloca [128 x i8]
store i32 %0, i32* %3
store i32 %1, i32* %4
%7 = getelementptr inbounds [128 x i8], [128 x i8]* %5, i64 0, i64 0
%8 = load i32, i32* %3
%9 = call i32 @sprintf(i8* %7, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i32 %8)
%10 = getelementptr inbounds [128 x i8], [128 x i8]* %6, i64 0, i64 0
%11 = load i32, i32* %4
%12 = call i32 @sprintf(i8* %10, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %11)
%13 = getelementptr inbounds [128 x i8], [128 x i8]* %5, i64 0, i64 0
%14 = getelementptr inbounds [128 x i8], [128 x i8]* %6, i64 0, i64 0
%15 = call i32 @gpio_output(i8* %13, i8* %14)
ret void
}

LLVM IR (-O2):
@.str = [29 x i8] c"/sys/class/gpio/gpio%d/value\00"
@.str.1 = [3 x i8] c"%d\00"
define void @gpio_set(i32 %0, i32 %1) {
%3 = alloca [128 x i8]
%4 = alloca [128 x i8]
%5 = getelementptr inbounds [128 x i8], [128 x i8]* %3, i64 0, i64 0
%6 = call i32 @sprintf(i8* %5, i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i32 %0)
%7 = getelementptr inbounds [128 x i8], [128 x i8]* %4, i64 0, i64 0
%8 = call i32 @sprintf(i8* %7, i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %1)
%9 = call i32 @gpio_output(i8* %5, i8* %7)
ret void
}
void log_notice(const char *type, int code, const char *msg) {
  (void)type;
  (void)code;
  (void)msg;
}


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

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

LLVM IR (-O0):
define void @log_notice(i8* %0, i32 %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i8*
store i8* %0, i8** %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%7 = load i8*, i8** %4
%8 = load i32, i32* %5
%9 = load i8*, i8** %6
ret void
}

LLVM IR (-O2):
define void @log_notice(i8* nocapture %0, i32 %1, i8* nocapture %2) {
ret void
}
void *fn7(void (*fp)(void)) { return fp; }


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

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

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

LLVM IR (-O2):
define i8* @fn7(void ()* readnone %0) {
%2 = bitcast void ()* %0 to i8*
ret i8* %2
}
void free_dummy(void *p) {}


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

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

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

LLVM IR (-O2):
define void @free_dummy(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int hPrintNumber(int, unsigned long long, int /*<<< orphan*/, int, int);
int fb_PrintUsingLongint(int fnum, long long val_ll, int mask) {
  int flags;
  unsigned long long val_ull;
  if (val_ll < 0) {
    flags = 0x1;
    val_ull = -val_ll;
  } else {
    flags = 0;
    val_ull = val_ll;
  }
  return hPrintNumber(fnum, val_ull, 0, flags, mask);
}


x86 assembly (clang, -O0):
<fb_PrintUsingLongint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
cmpq   $0x0,-0x10(%rbp)
jge    1143 <fb_PrintUsingLongint+0x33>
movl   $0x1,-0x18(%rbp)
xor    %eax,%eax
sub    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
jmp    1152 <fb_PrintUsingLongint+0x42>
movl   $0x0,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x20(%rbp),%rsi
mov    -0x18(%rbp),%ecx
mov    -0x14(%rbp),%r8d
xor    %edx,%edx
call   1030 <hPrintNumber@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fb_PrintUsingLongint>:
mov    %edx,%r8d
mov    %rsi,%rcx
shr    $0x3f,%rcx
mov    %rsi,%rax
neg    %rax
cmovns %rax,%rsi
xor    %edx,%edx
jmp    1030 <hPrintNumber@plt>

LLVM IR (-O0):
define i32 @fb_PrintUsingLongint(i32 %0, i64 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i64
%6 = alloca i32
%7 = alloca i32
%8 = alloca i64
store i32 %0, i32* %4
store i64 %1, i64* %5
store i32 %2, i32* %6
%9 = load i64, i64* %5
%10 = icmp slt i64 %9, 0
br i1 %10, label %11, label %14
11: ; preds = %3
store i32 1, i32* %7
%12 = load i64, i64* %5
%13 = sub nsw i64 0, %12
store i64 %13, i64* %8
br label %16
14: ; preds = %3
store i32 0, i32* %7
%15 = load i64, i64* %5
store i64 %15, i64* %8
br label %16
16: ; preds = %14, %11
%17 = load i32, i32* %4
%18 = load i64, i64* %8
%19 = load i32, i32* %7
%20 = load i32, i32* %6
%21 = call i32 @hPrintNumber(i32 %17, i64 %18, i32 0, i32 %19, i32 %20)
ret i32 %21
}

LLVM IR (-O2):
define i32 @fb_PrintUsingLongint(i32 %0, i64 %1, i32 %2) {
%4 = lshr i64 %1, 63
%5 = trunc i64 %4 to i32
%6 = tail call i64 @llvm.abs.i64(i64 %1, i1 true)
%7 = tail call i32 @hPrintNumber(i32 %0, i64 %6, i32 0, i32 %5, i32 %2)
ret i32 %7
}
long PLOCK(op)
long *op;
{ return ((long)plock(*op)); }


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

x86 assembly (clang, -O2):
<PLOCK>:
push   %rax
mov    (%rdi),%rdi
xor    %eax,%eax
call   1030 <plock@plt>
cltq
pop    %rcx
ret

LLVM IR (-O0):
define i64 @PLOCK(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = call i32 (i64, ...) bitcast (i32 (...)* @plock to i32 (i64, ...)*)(i64 %4)
%6 = sext i32 %5 to i64
ret i64 %6
}

LLVM IR (-O2):
define i64 @PLOCK(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = tail call i32 (i64, ...) bitcast (i32 (...)* @plock to i32 (i64, ...)*)(i64 %2)
%4 = sext i32 %3 to i64
ret i64 %4
}
int fun1076() { return 1076; }


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

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

LLVM IR (-O0):
define i32 @fun1076() {
ret i32 1076
}

LLVM IR (-O2):
define i32 @fun1076() {
ret i32 1076
}
/* Variables and functions */
float atanf(float);
void sAtan_process(float bIn, float *bOut) { *bOut = atanf(bIn); }


x86 assembly (clang, -O0):
<sAtan_process>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
mov    %rdi,-0x10(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <atanf@plt>
mov    -0x10(%rbp),%rax
movss  %xmm0,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sAtan_process>:
push   %rbx
mov    %rdi,%rbx
call   1030 <atanf@plt>
movss  %xmm0,(%rbx)
pop    %rbx
ret

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

LLVM IR (-O2):
define void @sAtan_process(float %0, float* nocapture writeonly %1) {
%3 = tail call float @atanf(float %0)
store float %3, float* %1
ret void
}
int is_straight(char *vals) {
  int i;
  for (i = 1; i < 5; i++)
    if (vals[i] != vals[0] + i)
      return 0;
  return 1;
}


x86 assembly (clang, -O0):
<is_straight>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
movl   $0x1,-0x14(%rbp)
cmpl   $0x5,-0x14(%rbp)
jge    1156 <is_straight+0x56>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
mov    -0x10(%rbp),%rcx
movsbl (%rcx),%ecx
add    -0x14(%rbp),%ecx
cmp    %ecx,%eax
je     1143 <is_straight+0x43>
movl   $0x0,-0x4(%rbp)
jmp    115d <is_straight+0x5d>
jmp    1148 <is_straight+0x48>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    110f <is_straight+0xf>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_straight>:
movsbl (%rdi),%ecx
movsbl 0x1(%rdi),%edx
lea    0x1(%rcx),%esi
xor    %eax,%eax
cmp    %edx,%esi
jne    1134 <is_straight+0x34>
movsbl 0x2(%rdi),%edx
lea    0x2(%rcx),%esi
cmp    %edx,%esi
jne    1134 <is_straight+0x34>
movsbl 0x3(%rdi),%edx
lea    0x3(%rcx),%esi
cmp    %edx,%esi
jne    1134 <is_straight+0x34>
movsbl 0x4(%rdi),%edx
add    $0x4,%ecx
xor    %eax,%eax
cmp    %edx,%ecx
sete   %al
ret

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

LLVM IR (-O2):
define i32 @is_straight(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = sext i8 %2 to i32
%4 = getelementptr inbounds i8, i8* %0, i64 1
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = sext i8 %2 to i32
%8 = add nsw i32 %7, 1
%9 = icmp eq i32 %8, %6
br i1 %9, label %10, label %31
10: ; preds = %1
%11 = getelementptr inbounds i8, i8* %0, i64 2
%12 = load i8, i8* %11
%13 = sext i8 %12 to i32
%14 = sext i8 %2 to i32
%15 = add nsw i32 %14, 2
%16 = icmp eq i32 %15, %13
br i1 %16, label %17, label %31
17: ; preds = %10
%18 = getelementptr inbounds i8, i8* %0, i64 3
%19 = load i8, i8* %18
%20 = sext i8 %19 to i32
%21 = sext i8 %2 to i32
%22 = add nsw i32 %21, 3
%23 = icmp eq i32 %22, %20
br i1 %23, label %24, label %31
24: ; preds = %17
%25 = getelementptr inbounds i8, i8* %0, i64 4
%26 = load i8, i8* %25
%27 = sext i8 %26 to i32
%28 = add nsw i32 %3, 4
%29 = icmp eq i32 %28, %27
%30 = zext i1 %29 to i32
br label %31
31: ; preds = %24, %17, %10, %1
%32 = phi i32 [ 0, %1 ], [ 0, %10 ], [ 0, %17 ], [ %30, %24 ]
ret i32 %32
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, long);
void StartPoint(long id) { printf("\033GP%ld", id); }


x86 assembly (clang, -O0):
<StartPoint>:
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):
<StartPoint>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"\1BGP%ld\00"
define void @StartPoint(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i64 %3)
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"\1BGP%ld\00"
define void @StartPoint(i64 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i64 %0)
ret void
}
int getlength(char string[]) {
  int length = 0;
  while (string[length] != '\0')
    length++;
  return length;
}


x86 assembly (clang, -O0):
<getlength>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1132 <getlength+0x32>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <getlength+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getlength>:
mov    $0xffffffff,%eax
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%eax
cmpb   $0x0,(%rdi)
lea    0x1(%rdi),%rdi
jne    1110 <getlength+0x10>
ret

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

LLVM IR (-O2):
define i32 @getlength(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ %7, %2 ], [ 0, %1 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = add nuw i64 %3, 1
br i1 %6, label %8, label %2
8: ; preds = %2
%9 = trunc i64 %3 to i32
ret i32 %9
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ *fopen(char const *, char const *);
int /*<<< orphan*/ pfatal(char *);
FILE *fancy_fopen(const char *file_path, const char *mode) {
  FILE *file = fopen(file_path, mode);
  if (file == NULL)
    pfatal("cannot open file");
  return file;
}


x86 assembly (clang, -O0):
<fancy_fopen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <fopen@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1158 <fancy_fopen+0x38>
lea    0xead(%rip),%rdi
call   1030 <pfatal@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fancy_fopen>:
push   %rbx
call   1040 <fopen@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    113a <fancy_fopen+0x1a>
lea    0xecb(%rip),%rdi
call   1030 <pfatal@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [17 x i8] c"cannot open file\00"
define i32* @fancy_fopen(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 = call i32* @fopen(i8* %6, i8* %7)
store i32* %8, i32** %5
%9 = load i32*, i32** %5
%10 = icmp eq i32* %9, null
br i1 %10, label %11, label %13
11: ; preds = %2
%12 = call i32 @pfatal(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
br label %13
13: ; preds = %11, %2
%14 = load i32*, i32** %5
ret i32* %14
}

LLVM IR (-O2):
@.str = [17 x i8] c"cannot open file\00"
define noalias i32* @fancy_fopen(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32* @fopen(i8* %0, i8* %1)
%4 = icmp eq i32* %3, null
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @pfatal(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %2
ret i32* %3
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isalnum(int);
void t_isalnum_0x8b() {
  Assert_real((isalnum(139) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isalnum.c",
              700, ("isalnum should be 0 for 0x8b"));
}


x86 assembly (clang, -O0):
<t_isalnum_0x8b>:
push   %rbp
mov    %rsp,%rbp
mov    $0x8b,%edi
call   1030 <isalnum@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x2bc,%edx
lea    0xf5b(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isalnum_0x8b>:
push   %rax
mov    $0x8b,%edi
call   1030 <isalnum@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x2bc,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isalnum.c\00"
@.str.1 = [29 x i8] c"isalnum should be 0 for 0x8b\00"
define void @t_isalnum_0x8b() {
%1 = call i64 @isalnum(i32 139)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 700, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isalnum.c\00"
@.str.1 = [29 x i8] c"isalnum should be 0 for 0x8b\00"
define void @t_isalnum_0x8b() {
%1 = tail call i64 @isalnum(i32 139)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 700, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ secure_main(int, char **);
int /*<<< orphan*/ uncrypt();
int main(int argc, char *argv[]) {
  uncrypt();
  secure_main(argc, argv);
  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 <uncrypt@plt>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1040 <secure_main@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
xor    %eax,%eax
call   1030 <uncrypt@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
call   1040 <secure_main@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
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 (...) @uncrypt()
%7 = load i32, i32* %4
%8 = load i8**, i8*** %5
%9 = call i32 @secure_main(i32 %7, i8** %8)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 (...) @uncrypt()
%4 = tail call i32 @secure_main(i32 %0, i8** %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
int isqrt(int);
void t_sqrt_154() {
  Assert_real((isqrt(154) == 12),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/stdlib/isqrt.c",
              775, ("Integer square root of 154 should be 12"));
}


x86 assembly (clang, -O0):
<t_sqrt_154>:
push   %rbp
mov    %rsp,%rbp
mov    $0x9a,%edi
call   1030 <isqrt@plt>
cmp    $0xc,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xec0(%rip),%rsi
mov    $0x307,%edx
lea    0xf56(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_sqrt_154>:
push   %rax
mov    $0x9a,%edi
call   1030 <isqrt@plt>
xor    %edi,%edi
cmp    $0xc,%eax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf60(%rip),%rcx
mov    $0x307,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [162 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/stdlib/isqrt.c\00"
@.str.1 = [40 x i8] c"Integer square root of 154 should be 12\00"
define void @t_sqrt_154() {
%1 = call i32 @isqrt(i32 154)
%2 = icmp eq i32 %1, 12
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str, i64 0, i64 0), i32 775, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [162 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/stdlib/isqrt.c\00"
@.str.1 = [40 x i8] c"Integer square root of 154 should be 12\00"
define void @t_sqrt_154() {
%1 = tail call i32 @isqrt(i32 154)
%2 = icmp eq i32 %1, 12
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str, i64 0, i64 0), i32 775, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void gtk_action_group_add_action_with_accel() {}


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

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

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

LLVM IR (-O2):
define void @gtk_action_group_add_action_with_accel() {
ret void
}
void _gfortran_caf_init(int *argc __attribute__((unused)),
                        char ***argv __attribute__((unused))) {}


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

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

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

LLVM IR (-O2):
define void @_gfortran_caf_init(i32* nocapture %0, i8*** nocapture %1) {
ret void
}
/* Variables and functions */
int bar();
int __attribute__((no)) f1(void) { return bar(); }


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

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

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

LLVM IR (-O2):
define i32 @f1() {
%1 = tail call i32 (...) @bar()
ret i32 %1
}
long mul3(long a) { return (a << 1) + a; }


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

x86 assembly (clang, -O2):
<mul3>:
lea    (%rdi,%rdi,2),%rax
ret

LLVM IR (-O0):
define i64 @mul3(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = shl i64 %3, 1
%5 = load i64, i64* %2
%6 = add nsw i64 %4, %5
ret i64 %6
}

LLVM IR (-O2):
define i64 @mul3(i64 %0) {
%2 = mul i64 %0, 3
ret i64 %2
}
/* Variables and functions */
int /*<<< orphan*/ negexp(char *, int);
int /*<<< orphan*/ posexp(char *, int);
int expnotate(char *s) {
  int zenspot = 1;
  if (*s == '-')
    zenspot = 2;
  if (s[zenspot] == ';')
    negexp(s, zenspot);
  else
    posexp(s, zenspot);
  return 0;
}


x86 assembly (clang, -O0):
<expnotate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2d,%eax
jne    114a <expnotate+0x2a>
movl   $0x2,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x3b,%eax
jne    1170 <expnotate+0x50>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1040 <negexp@plt>
jmp    117c <expnotate+0x5c>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <posexp@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<expnotate>:
push   %rax
xor    %esi,%esi
cmpb   $0x2d,(%rdi)
sete   %sil
add    $0x1,%esi
cmpb   $0x3b,(%rdi,%rsi,1)
jne    113a <expnotate+0x1a>
call   1040 <negexp@plt>
jmp    113f <expnotate+0x1f>
call   1030 <posexp@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @expnotate(i8* %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 45
%4 = select i1 %3, i32 2, i32 1
%5 = zext i32 %4 to i64
%6 = getelementptr inbounds i8, i8* %0, i64 %5
%7 = load i8, i8* %6
%8 = icmp eq i8 %7, 59
br i1 %8, label %9, label %11
9: ; preds = %1
%10 = tail call i32 @negexp(i8* %0, i32 %4)
br label %13
11: ; preds = %1
%12 = tail call i32 @posexp(i8* %0, i32 %4)
br label %13
13: ; preds = %11, %9
ret i32 0
}