xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ __NR_pivot_root;
int /*<<< orphan*/ syscall(int /*<<< orphan*/, char const *, char const *);
int main() {
  syscall(__NR_pivot_root, "/tmp", "/");
  syscall(__NR_pivot_root, (const char *)-1, "/tmp");
  syscall(__NR_pivot_root, "/tmp", (const char *)-1);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2eba(%rip),%rax
mov    (%rax),%edi
lea    0xed1(%rip),%rsi
lea    0xecf(%rip),%rdx
call   1030 <syscall@plt>
mov    0x2e9e(%rip),%rax
mov    (%rax),%edi
mov    $0xffffffffffffffff,%rsi
lea    0xeae(%rip),%rdx
call   1030 <syscall@plt>
mov    0x2e82(%rip),%rax
mov    (%rax),%edi
lea    0xe99(%rip),%rsi
mov    $0xffffffffffffffff,%rdx
call   1030 <syscall@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    0x2ec5(%rip),%r14
mov    (%r14),%edi
lea    0xedb(%rip),%rbx
lea    0xed9(%rip),%rdx
mov    %rbx,%rsi
call   1030 <syscall@plt>
mov    (%r14),%edi
mov    $0xffffffffffffffff,%rsi
mov    %rbx,%rdx
call   1030 <syscall@plt>
mov    (%r14),%edi
mov    %rbx,%rsi
mov    $0xffffffffffffffff,%rdx
call   1030 <syscall@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@__NR_pivot_root = global i32 0
@.str = [5 x i8] c"/tmp\00"
@.str.1 = [2 x i8] c"/\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = load i32, i32* @__NR_pivot_root
%3 = call i32 @syscall(i32 %2, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%4 = load i32, i32* @__NR_pivot_root
%5 = call i32 @syscall(i32 %4, i8* inttoptr (i64 -1 to i8*), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%6 = load i32, i32* @__NR_pivot_root
%7 = call i32 @syscall(i32 %6, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* inttoptr (i64 -1 to i8*))
ret i32 0
}

LLVM IR (-O2):
@__NR_pivot_root = global i32 0
@.str = [5 x i8] c"/tmp\00"
@.str.1 = [2 x i8] c"/\00"
define i32 @main() {
%1 = load i32, i32* @__NR_pivot_root
%2 = tail call i32 @syscall(i32 %1, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%3 = load i32, i32* @__NR_pivot_root
%4 = tail call i32 @syscall(i32 %3, i8* inttoptr (i64 -1 to i8*), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%5 = load i32, i32* @__NR_pivot_root
%6 = tail call i32 @syscall(i32 %5, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* inttoptr (i64 -1 to i8*))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("Hello1111111 world!\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>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@str = [20 x i8] c"Hello1111111 world!\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
ret i32 0
}
void h$$1() { f$$1(); }


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

x86 assembly (clang, -O2):
<h$$1>:
xor    %eax,%eax
jmp    1030 <f$$1@plt>

LLVM IR (-O0):
define void @"h$$1"() {
%1 = call i32 (...) @"f$$1"()
ret void
}

LLVM IR (-O2):
define void @"h$$1"() {
%1 = tail call i32 (...) @"f$$1"()
ret void
}
int Bematech_FI_StatusCheque(Var, Retorno) {
  return Formata("\x1b|62|48|\x1b", Var, Retorno);
}


x86 assembly (clang, -O0):
<Bematech_FI_StatusCheque>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xed5(%rip),%rdi
mov    $0x0,%al
call   1030 <Formata@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Bematech_FI_StatusCheque>:
mov    %esi,%edx
mov    %edi,%esi
lea    0xee5(%rip),%rdi
xor    %eax,%eax
jmp    1030 <Formata@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"\1B|62|48|\1B\00"
define i32 @Bematech_FI_StatusCheque(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = call i32 (i8*, i32, i32, ...) bitcast (i32 (...)* @Formata to i32 (i8*, i32, i32, ...)*)(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %5, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
@.str = [10 x i8] c"\1B|62|48|\1B\00"
define i32 @Bematech_FI_StatusCheque(i32 %0, i32 %1) {
%3 = tail call i32 (i8*, i32, i32, ...) bitcast (i32 (...)* @Formata to i32 (i8*, i32, i32, ...)*)(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1)
ret i32 %3
}
int FIO_GetBlockSize_FromBlockId(int id) { return (1 << id) * (1U << 10); }


x86 assembly (clang, -O0):
<FIO_GetBlockSize_FromBlockId>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
shl    $0xa,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<FIO_GetBlockSize_FromBlockId>:
mov    %edi,%ecx
mov    $0x400,%eax
shl    %cl,%eax
ret

LLVM IR (-O0):
define i32 @FIO_GetBlockSize_FromBlockId(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = shl i32 1, %3
%5 = mul i32 %4, 1024
ret i32 %5
}

LLVM IR (-O2):
define i32 @FIO_GetBlockSize_FromBlockId(i32 %0) {
%2 = shl i32 1024, %0
ret i32 %2
}
void user_negociation(int positionin, int positionout, int positionrealin,
                      int positionrealout, int errorraised) {
  (void)positionin;
  (void)positionout;
  (void)positionrealin;
  (void)positionrealout;
  (void)errorraised;
}


x86 assembly (clang, -O0):
<user_negociation>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8d,-0x14(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @user_negociation(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4) {
ret void
}
void f6(unsigned char a, unsigned short b) {}


x86 assembly (clang, -O0):
<f6>:
push   %rbp
mov    %rsp,%rbp
mov    %si,%ax
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %ax,-0x4(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @f6(i8 zeroext %0, i16 zeroext %1) {
ret void
}
/* Variables and functions */
int own_strcmp(char *, char *);
int /*<<< orphan*/ printf(char *, char *, char *, int);
int main(int argc, char *argv[]) {
  printf("%s and %s is %d\n", argv[1], argv[2], own_strcmp(argv[1], argv[2]));
  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)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rsi
call   1030 <own_strcmp@plt>
mov    -0x20(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    %eax,%ecx
lea    0xe8c(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    0x8(%rsi),%rbx
mov    0x10(%rsi),%r14
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <own_strcmp@plt>
lea    0xec2(%rip),%rdi
mov    %rbx,%rsi
mov    %r14,%rdx
mov    %eax,%ecx
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [17 x i8] c"%s and %s is %d\0A\00"
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 = load i8**, i8*** %5
%7 = getelementptr inbounds i8*, i8** %6, i64 1
%8 = load i8*, i8** %7
%9 = load i8**, i8*** %5
%10 = getelementptr inbounds i8*, i8** %9, i64 2
%11 = load i8*, i8** %10
%12 = load i8**, i8*** %5
%13 = getelementptr inbounds i8*, i8** %12, i64 1
%14 = load i8*, i8** %13
%15 = load i8**, i8*** %5
%16 = getelementptr inbounds i8*, i8** %15, i64 2
%17 = load i8*, i8** %16
%18 = call i32 @own_strcmp(i8* %14, i8* %17)
%19 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %8, i8* %11, i32 %18)
ret i32 0
}

LLVM IR (-O2):
@.str = [17 x i8] c"%s and %s is %d\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = load i8*, i8** %3
%5 = getelementptr inbounds i8*, i8** %1, i64 2
%6 = load i8*, i8** %5
%7 = tail call i32 @own_strcmp(i8* %4, i8* %6)
%8 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %4, i8* %6, i32 %7)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int i;
  i = 10;
  printf("i : %d\n", i);
  printf("sizeof(i++) is: %zu\n", sizeof(i++));
  printf("i : %d\n", i);
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [8 x i8] c"i : %d\0A\00"
@.str.1 = [21 x i8] c"sizeof(i++) is: %zu\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 10, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), i32 4)
%6 = load i32, i32* %2
%7 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [8 x i8] c"i : %d\0A\00"
@.str.1 = [21 x i8] c"sizeof(i++) is: %zu\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 10)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), i32 4)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 10)
ret i32 0
}
void ble_rsp_flash_ps_erase(const void *nul) {}


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

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

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

LLVM IR (-O2):
define void @ble_rsp_flash_ps_erase(i8* nocapture %0) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ value;
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int /*<<< orphan*/ rgph_t1ha64s_finalise(int /*<<< orphan*/ *);
int /*<<< orphan*/ rgph_t1ha64s_fmix1(int /*<<< orphan*/, int /*<<< orphan*/ *);
int /*<<< orphan*/ rgph_t1ha64s_init(int, uintptr_t, int /*<<< orphan*/ *);
uint64_t rgph_u64_t1ha64s_u64(uint64_t value, uintptr_t seed) {
  uint64_t h[4];
  rgph_t1ha64s_init(sizeof(value), seed, h);
  rgph_t1ha64s_fmix1(value, h);
  return rgph_t1ha64s_finalise(h);
}


x86 assembly (clang, -O0):
<rgph_u64_t1ha64s_u64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
lea    -0x20(%rbp),%rdx
mov    $0x4,%edi
call   1030 <rgph_t1ha64s_init@plt>
mov    -0x4(%rbp),%edi
lea    -0x20(%rbp),%rsi
call   1050 <rgph_t1ha64s_fmix1@plt>
lea    -0x20(%rbp),%rdi
call   1040 <rgph_t1ha64s_finalise@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rgph_u64_t1ha64s_u64>:
push   %r14
push   %rbx
sub    $0x18,%rsp
mov    %edi,%ebx
mov    %rsp,%r14
mov    $0x4,%edi
mov    %r14,%rdx
call   1030 <rgph_t1ha64s_init@plt>
mov    %ebx,%edi
mov    %r14,%rsi
call   1050 <rgph_t1ha64s_fmix1@plt>
mov    %r14,%rdi
call   1040 <rgph_t1ha64s_finalise@plt>
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @rgph_u64_t1ha64s_u64(i32 %0, i64 %1) {
%3 = alloca i32
%4 = alloca i64
%5 = alloca [4 x i32]
store i32 %0, i32* %3
store i64 %1, i64* %4
%6 = load i64, i64* %4
%7 = getelementptr inbounds [4 x i32], [4 x i32]* %5, i64 0, i64 0
%8 = call i32 @rgph_t1ha64s_init(i32 4, i64 %6, i32* %7)
%9 = load i32, i32* %3
%10 = getelementptr inbounds [4 x i32], [4 x i32]* %5, i64 0, i64 0
%11 = call i32 @rgph_t1ha64s_fmix1(i32 %9, i32* %10)
%12 = getelementptr inbounds [4 x i32], [4 x i32]* %5, i64 0, i64 0
%13 = call i32 @rgph_t1ha64s_finalise(i32* %12)
ret i32 %13
}

LLVM IR (-O2):
define i32 @rgph_u64_t1ha64s_u64(i32 %0, i64 %1) {
%3 = alloca [4 x i32]
%4 = bitcast [4 x i32]* %3 to i8*
%5 = getelementptr inbounds [4 x i32], [4 x i32]* %3, i64 0, i64 0
%6 = call i32 @rgph_t1ha64s_init(i32 4, i64 %1, i32* %5)
%7 = call i32 @rgph_t1ha64s_fmix1(i32 %0, i32* %5)
%8 = call i32 @rgph_t1ha64s_finalise(i32* %5)
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void dummy_oracle_listener() { printf("\n"); }


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

x86 assembly (clang, -O2):
<dummy_oracle_listener>:
mov    $0xa,%edi
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
define void @dummy_oracle_listener() {
%1 = tail call i32 @putchar(i32 10)
ret void
}
void RGBAToYRow_C() {}


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

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

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

LLVM IR (-O2):
define void @RGBAToYRow_C() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ putc(short const, int /*<<< orphan*/ *);
void writeshort(FILE *fp, const short s) {
  putc((s >> 8) & 0xFF, fp);
  putc(s & 0xFF, fp);
}


x86 assembly (clang, -O0):
<writeshort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %si,%ax
mov    %rdi,-0x8(%rbp)
mov    %ax,-0xa(%rbp)
movswl -0xa(%rbp),%eax
sar    $0x8,%eax
and    $0xff,%eax
mov    -0x8(%rbp),%rsi
movswl %ax,%edi
call   1030 <putc@plt>
movswl -0xa(%rbp),%eax
and    $0xff,%eax
mov    -0x8(%rbp),%rsi
movswl %ax,%edi
call   1030 <putc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<writeshort>:
push   %r14
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %rdi,%r14
movzbl %bh,%edi
mov    %r14,%rsi
call   1030 <putc@plt>
movzbl %bl,%edi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <putc@plt>

LLVM IR (-O0):
define void @writeshort(i32* %0, i16 signext %1) {
%3 = alloca i32*
%4 = alloca i16
store i32* %0, i32** %3
store i16 %1, i16* %4
%5 = load i16, i16* %4
%6 = sext i16 %5 to i32
%7 = ashr i32 %6, 8
%8 = and i32 %7, 255
%9 = trunc i32 %8 to i16
%10 = load i32*, i32** %3
%11 = call i32 @putc(i16 signext %9, i32* %10)
%12 = load i16, i16* %4
%13 = sext i16 %12 to i32
%14 = and i32 %13, 255
%15 = trunc i32 %14 to i16
%16 = load i32*, i32** %3
%17 = call i32 @putc(i16 signext %15, i32* %16)
ret void
}

LLVM IR (-O2):
define void @writeshort(i32* nocapture %0, i16 signext %1) {
%3 = lshr i16 %1, 8
%4 = tail call i32 @putc(i16 signext %3, i32* %0)
%5 = and i16 %1, 255
%6 = tail call i32 @putc(i16 signext %5, i32* %0)
ret void
}
/* Variables and functions */
scalar_t__ strlen(char *);
char toupper(char);
void str_toupper(char string[]) {
  int i;
  int str_length = (int)strlen(string);
  for (i = 0; i < str_length; i++) {
    string[i] = toupper(string[i]);
  }
  return;
}


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

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

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

LLVM IR (-O2):
define void @str_toupper(i8* nocapture %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = trunc i64 %2 to i32
%4 = icmp sgt i32 %3, 0
br i1 %4, label %5, label %14
5: ; preds = %1
%6 = and i64 %2, 4294967295
br label %7
7: ; preds = %5, %7
%8 = phi i64 [ 0, %5 ], [ %12, %7 ]
%9 = getelementptr inbounds i8, i8* %0, i64 %8
%10 = load i8, i8* %9
%11 = tail call signext i8 @toupper(i8 signext %10)
store i8 %11, i8* %9
%12 = add nuw nsw i64 %8, 1
%13 = icmp eq i64 %12, %6
br i1 %13, label %14, label %7
14: ; preds = %7, %1
ret void
}
/* Variables and functions */
int f459(int *);
int f460(int *p) { return f459(p); }


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

x86 assembly (clang, -O2):
<f460>:
jmp    1030 <f459@plt>

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

LLVM IR (-O2):
define i32 @f460(i32* %0) {
%2 = tail call i32 @f459(i32* %0)
ret i32 %2
}
/* Variables and functions */
int foo();
int bla(void) {
  int i, j = foo();
  for (i = 0; i < 100; i++, j++)
    foo();
  return j;
}


x86 assembly (clang, -O0):
<bla>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <foo@plt>
mov    %eax,-0x8(%rbp)
movl   $0x0,-0x4(%rbp)
cmpl   $0x64,-0x4(%rbp)
jge    1151 <bla+0x41>
mov    $0x0,%al
call   1030 <foo@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1129 <bla+0x19>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bla>:
push   %rbp
push   %rbx
push   %rax
xor    %eax,%eax
call   1030 <foo@plt>
mov    %eax,%ebx
mov    $0x64,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <foo@plt>
add    $0xffffffff,%ebp
jne    1130 <bla+0x20>
add    $0x64,%ebx
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @bla() {
%1 = tail call i32 (...) @foo()
br label %2
2: ; preds = %0, %2
%3 = phi i32 [ 0, %0 ], [ %5, %2 ]
%4 = tail call i32 (...) @foo()
%5 = add nuw nsw i32 %3, 1
%6 = icmp eq i32 %5, 100
br i1 %6, label %7, label %2
7: ; preds = %2
%8 = add i32 %1, 100
ret i32 %8
}
void f0(void (*fp)(void)) { int x = fp - fp; }


x86 assembly (clang, -O0):
<f0>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x8(%rbp),%rcx
sub    %rcx,%rax
mov    %eax,-0xc(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @f0(void ()* %0) {
%2 = alloca void ()*
%3 = alloca i32
store void ()* %0, void ()** %2
%4 = load void ()*, void ()** %2
%5 = load void ()*, void ()** %2
%6 = ptrtoint void ()* %4 to i64
%7 = ptrtoint void ()* %5 to i64
%8 = sub i64 %6, %7
%9 = trunc i64 %8 to i32
store i32 %9, i32* %3
ret void
}

LLVM IR (-O2):
define void @f0(void ()* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ init_gdt();
int /*<<< orphan*/ init_idt();
int /*<<< orphan*/ init_pit(int);
void init_dt() {
  init_gdt();
  init_idt();
  init_pit(50);
}


x86 assembly (clang, -O0):
<init_dt>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1050 <init_gdt@plt>
mov    $0x0,%al
call   1030 <init_idt@plt>
mov    $0x32,%edi
call   1040 <init_pit@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_dt>:
push   %rax
xor    %eax,%eax
call   1050 <init_gdt@plt>
xor    %eax,%eax
call   1030 <init_idt@plt>
mov    $0x32,%edi
pop    %rax
jmp    1040 <init_pit@plt>

LLVM IR (-O0):
define void @init_dt() {
%1 = call i32 (...) @init_gdt()
%2 = call i32 (...) @init_idt()
%3 = call i32 @init_pit(i32 50)
ret void
}

LLVM IR (-O2):
define void @init_dt() {
%1 = tail call i32 (...) @init_gdt()
%2 = tail call i32 (...) @init_idt()
%3 = tail call i32 @init_pit(i32 50)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ SEEK_END;
int /*<<< orphan*/ SEEK_SET;
int /*<<< orphan*/ fseek(int /*<<< orphan*/ *, unsigned long,
                         int /*<<< orphan*/);
void *ftell(int /*<<< orphan*/ *);
int /*<<< orphan*/ rewind(int /*<<< orphan*/ *);
size_t fs_fsize(FILE *file) {
  unsigned long pos = ftell(file);
  rewind(file);
  fseek(file, 0, SEEK_END);
  size_t size = ftell(file);
  fseek(file, pos, SEEK_SET);
  return size;
}


x86 assembly (clang, -O0):
<fs_fsize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <ftell@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <rewind@plt>
mov    -0x8(%rbp),%rdi
mov    0x2e8b(%rip),%rax
mov    (%rax),%edx
xor    %eax,%eax
mov    %eax,%esi
call   1050 <fseek@plt>
mov    -0x8(%rbp),%rdi
call   1040 <ftell@plt>
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    0x2e54(%rip),%rax
mov    (%rax),%edx
call   1050 <fseek@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fs_fsize>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%rbx
call   1040 <ftell@plt>
mov    %rax,%r14
mov    %rbx,%rdi
call   1030 <rewind@plt>
mov    0x2e99(%rip),%rax
mov    (%rax),%edx
mov    %rbx,%rdi
xor    %esi,%esi
call   1050 <fseek@plt>
mov    %rbx,%rdi
call   1040 <ftell@plt>
mov    %rax,%r15
mov    0x2e6b(%rip),%rax
mov    (%rax),%edx
mov    %rbx,%rdi
mov    %r14,%rsi
call   1050 <fseek@plt>
mov    %r15,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@SEEK_END = global i32 0
@SEEK_SET = global i32 0
define i64 @fs_fsize(i32* %0) {
%2 = alloca i32*
%3 = alloca i64
%4 = alloca i64
store i32* %0, i32** %2
%5 = load i32*, i32** %2
%6 = call i8* @ftell(i32* %5)
%7 = ptrtoint i8* %6 to i64
store i64 %7, i64* %3
%8 = load i32*, i32** %2
%9 = call i32 @rewind(i32* %8)
%10 = load i32*, i32** %2
%11 = load i32, i32* @SEEK_END
%12 = call i32 @fseek(i32* %10, i64 0, i32 %11)
%13 = load i32*, i32** %2
%14 = call i8* @ftell(i32* %13)
%15 = ptrtoint i8* %14 to i64
store i64 %15, i64* %4
%16 = load i32*, i32** %2
%17 = load i64, i64* %3
%18 = load i32, i32* @SEEK_SET
%19 = call i32 @fseek(i32* %16, i64 %17, i32 %18)
%20 = load i64, i64* %4
ret i64 %20
}

LLVM IR (-O2):
@SEEK_END = global i32 0
@SEEK_SET = global i32 0
define i64 @fs_fsize(i32* nocapture %0) {
%2 = tail call i8* @ftell(i32* %0)
%3 = ptrtoint i8* %2 to i64
%4 = tail call i32 @rewind(i32* %0)
%5 = load i32, i32* @SEEK_END
%6 = tail call i32 @fseek(i32* %0, i64 0, i32 %5)
%7 = tail call i8* @ftell(i32* %0)
%8 = ptrtoint i8* %7 to i64
%9 = load i32, i32* @SEEK_SET
%10 = tail call i32 @fseek(i32* %0, i64 %3, i32 %9)
ret i64 %8
}
int shortCmpFn(const void *p1, const void *p2) {
  short v1, v2;
  v1 = *((short *)p1);
  v2 = *((short *)p2);
  if (v1 == v2)
    return 0;
  return (v1 < v2) ? -1 : +1;
}


x86 assembly (clang, -O0):
<shortCmpFn>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%ax
mov    %ax,-0x1a(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%ax
mov    %ax,-0x1c(%rbp)
movswl -0x1a(%rbp),%eax
movswl -0x1c(%rbp),%ecx
cmp    %ecx,%eax
jne    113e <shortCmpFn+0x3e>
movl   $0x0,-0x4(%rbp)
jmp    1158 <shortCmpFn+0x58>
movswl -0x1a(%rbp),%edx
movswl -0x1c(%rbp),%esi
mov    $0x1,%eax
mov    $0xffffffff,%ecx
cmp    %esi,%edx
cmovl  %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<shortCmpFn>:
movzwl (%rdi),%eax
xor    %ecx,%ecx
xor    %edx,%edx
cmp    (%rsi),%ax
setge  %dl
lea    -0x1(%rdx,%rdx,1),%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @shortCmpFn(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i16*
%4 = load i16, i16* %3
%5 = bitcast i8* %1 to i16*
%6 = load i16, i16* %5
%7 = icmp eq i16 %4, %6
%8 = icmp slt i16 %4, %6
%9 = select i1 %8, i32 -1, i32 1
%10 = select i1 %7, i32 0, i32 %9
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isupper(int);
void t_isupper_0xe5() {
  Assert_real((isupper(229) == 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_isupper.c",
              1150, ("isupper should be 0 for 0xe5"));
}


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

x86 assembly (clang, -O2):
<t_isupper_0xe5>:
push   %rax
mov    $0xe5,%edi
call   1030 <isupper@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x47e,%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_isupper.c\00"
@.str.1 = [29 x i8] c"isupper should be 0 for 0xe5\00"
define void @t_isupper_0xe5() {
%1 = call i64 @isupper(i32 229)
%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 1150, 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_isupper.c\00"
@.str.1 = [29 x i8] c"isupper should be 0 for 0xe5\00"
define void @t_isupper_0xe5() {
%1 = tail call i64 @isupper(i32 229)
%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 1150, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int main() {
  int a;
  for (a = 1; a <= 255; a++) {
    printf("%d - %c \n", a, a);
  }
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [10 x i8] c"%d - %c \0A\00"
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 1, %0 ], [ %4, %1 ]
%3 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %2, i32 %2)
%4 = add nuw nsw i32 %2, 1
%5 = icmp eq i32 %4, 256
br i1 %5, label %6, label %1
6: ; preds = %1
ret i32 0
}
int(__attribute__((noreturn)) function)(a, b) int a;
int b;
{ return a + b; }


x86 assembly (clang, -O0):
<function>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)

x86 assembly (clang, -O2):
LLVM IR (-O0):
define i32 @function(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 = load i32, i32* %5
%8 = add nsw i32 %6, %7
store i32 %8, i32* %3
unreachable
}

LLVM IR (-O2):
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int main() {
  int a = 0;
  unsigned long long x = 18446744073709551615ull;
  if (x > 18446744073709551612ull) {
    a = 1;
  }
  assert(a);
  unsigned long long y = x + 4;
  assert(y == 3);
  signed long long s = 9223372036854775807;
  assert(s > 9223372036854775806);
  signed long long t = s + 2;
  assert(t == -9223372036854775807);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movq   $0xffffffffffffffff,-0x10(%rbp)
ff
cmpq   $0xfffffffffffffffc,-0x10(%rbp)
jbe    1140 <main+0x30>
movl   $0x1,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <assert@plt>
mov    -0x10(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x18(%rbp)
cmpq   $0x3,-0x18(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
movabs $0x7fffffffffffffff,%rax
ff ff 7f
mov    %rax,-0x20(%rbp)
movabs $0x7ffffffffffffffe,%rax
ff ff 7f
cmp    %rax,-0x20(%rbp)
setg   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x20(%rbp),%rax
add    $0x2,%rax
mov    %rax,-0x28(%rbp)
movabs $0x8000000000000001,%rax
cmp    %rax,-0x28(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
store i32 0, i32* %1
store i32 0, i32* %2
store i64 -1, i64* %3
%7 = load i64, i64* %3
%8 = icmp ugt i64 %7, -4
br i1 %8, label %9, label %10
9: ; preds = %0
store i32 1, i32* %2
br label %10
10: ; preds = %9, %0
%11 = load i32, i32* %2
%12 = call i32 @assert(i32 %11)
%13 = load i64, i64* %3
%14 = add i64 %13, 4
store i64 %14, i64* %4
%15 = load i64, i64* %4
%16 = icmp eq i64 %15, 3
%17 = zext i1 %16 to i32
%18 = call i32 @assert(i32 %17)
store i64 9223372036854775807, i64* %5
%19 = load i64, i64* %5
%20 = icmp sgt i64 %19, 9223372036854775806
%21 = zext i1 %20 to i32
%22 = call i32 @assert(i32 %21)
%23 = load i64, i64* %5
%24 = add nsw i64 %23, 2
store i64 %24, i64* %6
%25 = load i64, i64* %6
%26 = icmp eq i64 %25, -9223372036854775807
%27 = zext i1 %26 to i32
%28 = call i32 @assert(i32 %27)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @assert(i32 1)
%2 = tail call i32 @assert(i32 1)
%3 = tail call i32 @assert(i32 1)
%4 = tail call i32 @assert(i32 1)
ret i32 0
}
int isupper(int c) { return !!((c >= 'A') && (c <= 'Z')); }


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

x86 assembly (clang, -O2):
<isupper>:
add    $0xffffffbf,%edi
xor    %eax,%eax
cmp    $0x1a,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @isupper(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 65
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 90
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ false, %1 ], [ %7, %5 ]
%10 = xor i1 %9, true
%11 = xor i1 %10, true
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @isupper(i32 %0) {
%2 = add i32 %0, -65
%3 = icmp ult i32 %2, 26
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void ShowBanner(void) {
  printf("CodeBreaker PS2 Cheat Code Extractor v%s\n", "1.0");
  printf("THIS PROGRAM IS NOT LICENSED, ENDORSED, NOR SPONSORED BY SONY\n"
         "COMPUTER ENTERTAINMENT, INC. NOR PELICAN ACCESSORIES, INC.\n"
         "ALL TRADEMARKS ARE PROPERTY OF THEIR RESPECTIVE OWNERS.\n");
  printf("Copyright (C) 2006 misfire\n\n");
}


x86 assembly (clang, -O0):
<ShowBanner>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
lea    0xf08(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xefe(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xfa2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<ShowBanner>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0xefb(%rip),%rsi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xef1(%rip),%rdi
call   1030 <puts@plt>
lea    0xf96(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [42 x i8] c"CodeBreaker PS2 Cheat Code Extractor v%s\0A\00"
@.str.1 = [4 x i8] c"1.0\00"
@.str.2 = [178 x i8] c"THIS PROGRAM IS NOT LICENSED, ENDORSED, NOR SPONSORED BY SONY\0ACOMPUTER ENTERTAINMENT, INC. NOR PELICAN ACCESSORIES, INC.\0AALL TRADEMARKS ARE PROPERTY OF THEIR RESPECTIVE OWNERS.\0A\00"
@.str.3 = [29 x i8] c"Copyright (C) 2006 misfire\0A\0A\00"
define void @ShowBanner() {
%1 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([178 x i8], [178 x i8]* @.str.2, i64 0, i64 0))
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [42 x i8] c"CodeBreaker PS2 Cheat Code Extractor v%s\0A\00"
@.str.1 = [4 x i8] c"1.0\00"
@str = [177 x i8] c"THIS PROGRAM IS NOT LICENSED, ENDORSED, NOR SPONSORED BY SONY\0ACOMPUTER ENTERTAINMENT, INC. NOR PELICAN ACCESSORIES, INC.\0AALL TRADEMARKS ARE PROPERTY OF THEIR RESPECTIVE OWNERS.\00"
@str.4 = [28 x i8] c"Copyright (C) 2006 misfire\0A\00"
define void @ShowBanner() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([177 x i8], [177 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str.4, i64 0, i64 0))
ret void
}
void ASN1_INTEGER_dup(void) {}


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

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

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

LLVM IR (-O2):
define void @ASN1_INTEGER_dup() {
ret void
}
/* Variables and functions */
int ENOSYS;
int errno;
int fsetxattr(int filedes, const char *name, void *value, size_t size,
              int flags) {
  return (errno = ENOSYS, -1);
}


x86 assembly (clang, -O0):
<fsetxattr>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
mov    0x2eca(%rip),%rax
mov    (%rax),%ecx
mov    0x2eb1(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @fsetxattr(i32 %0, i8* %1, i8* %2, i64 %3, i32 %4) {
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i64
%10 = alloca i32
store i32 %0, i32* %6
store i8* %1, i8** %7
store i8* %2, i8** %8
store i64 %3, i64* %9
store i32 %4, i32* %10
%11 = load i32, i32* @ENOSYS
store i32 %11, i32* @errno
ret i32 -1
}

LLVM IR (-O2):
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @fsetxattr(i32 %0, i8* nocapture readnone %1, i8* nocapture readnone %2, i64 %3, i32 %4) {
%6 = load i32, i32* @ENOSYS
store i32 %6, i32* @errno
ret i32 -1
}
int __attribute__((no)) intermediate(void (*f)(int, char), char num) {
  if (num == 1)
    f(100, 100);
  else
    f(3, 100);
  return num % 3;
}


x86 assembly (clang, -O0):
<intermediate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
movsbl -0x9(%rbp),%eax
cmp    $0x1,%eax
jne    112e <intermediate+0x2e>
mov    $0x64,%esi
mov    %esi,%edi
call   *-0x8(%rbp)
jmp    113b <intermediate+0x3b>
mov    $0x3,%edi
mov    $0x64,%esi
call   *-0x8(%rbp)
movsbl -0x9(%rbp),%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<intermediate>:
push   %rbx
mov    %esi,%ebx
mov    %rdi,%rax
cmp    $0x1,%bl
mov    $0x64,%ecx
mov    $0x3,%edi
cmove  %ecx,%edi
mov    $0x64,%esi
call   *%rax
imul   $0x56,%ebx,%eax
movzwl %ax,%eax
mov    %eax,%ecx
shr    $0xf,%ecx
shr    $0x8,%eax
add    %cl,%al
movzbl %al,%eax
lea    (%rax,%rax,2),%eax
sub    %al,%bl
movsbl %bl,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @intermediate(void (i32, i8)* %0, i8 signext %1) {
%3 = alloca void (i32, i8)*
%4 = alloca i8
store void (i32, i8)* %0, void (i32, i8)** %3
store i8 %1, i8* %4
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = icmp eq i32 %6, 1
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load void (i32, i8)*, void (i32, i8)** %3
br label %12
10: ; preds = %2
%11 = load void (i32, i8)*, void (i32, i8)** %3
br label %12
12: ; preds = %10, %8
%13 = load i8, i8* %4
%14 = sext i8 %13 to i32
%15 = srem i32 %14, 3
ret i32 %15
}

LLVM IR (-O2):
define i32 @intermediate(void (i32, i8)* nocapture %0, i8 signext %1) {
%3 = icmp eq i8 %1, 1
%4 = select i1 %3, i32 100, i32 3
tail call void %0(i32 %4, i8 signext 100)
%5 = srem i8 %1, 3
%6 = sext i8 %5 to i32
ret i32 %6
}
/* Variables and functions */
int __VERIFIER_nondet_int();
int main() {
  int x;
  int y;
  int z;
  x = __VERIFIER_nondet_int();
  y = __VERIFIER_nondet_int();
  z = __VERIFIER_nondet_int();
  while (x == y && x > z) {
    while (y > z) {
      x = x - 1;
      y = y - 1;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0xc(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%ecx
xor    %eax,%eax
cmp    -0xc(%rbp),%ecx
mov    %al,-0x11(%rbp)
jne    115a <main+0x4a>
mov    -0x8(%rbp),%eax
cmp    -0x10(%rbp),%eax
setg   %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    116a <main+0x5a>
jmp    1197 <main+0x87>
jmp    116f <main+0x5f>
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jle    1192 <main+0x82>
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    116f <main+0x5f>
jmp    113d <main+0x2d>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_int@plt>
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_int@plt>
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_int@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @__VERIFIER_nondet_int()
%2 = tail call i32 (...) @__VERIFIER_nondet_int()
%3 = tail call i32 (...) @__VERIFIER_nondet_int()
ret i32 0
}
void I010ToAR30() {}


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

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

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

LLVM IR (-O2):
define void @I010ToAR30() {
ret void
}
void bench_init(void) {}


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

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

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

LLVM IR (-O2):
define void @bench_init() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ c2_addr_write(int);
int /*<<< orphan*/ check_status();
int /*<<< orphan*/ fpdat_write(int);
void flash_device_erase(void) {
  c2_addr_write(0xb4);
  fpdat_write(0x03);
  check_status();
  fpdat_write(0xde);
  fpdat_write(0xad);
  fpdat_write(0xa5);
  check_status();
}


x86 assembly (clang, -O0):
<flash_device_erase>:
push   %rbp
mov    %rsp,%rbp
mov    $0xb4,%edi
call   1040 <c2_addr_write@plt>
mov    $0x3,%edi
call   1050 <fpdat_write@plt>
mov    $0x0,%al
call   1030 <check_status@plt>
mov    $0xde,%edi
call   1050 <fpdat_write@plt>
mov    $0xad,%edi
call   1050 <fpdat_write@plt>
mov    $0xa5,%edi
call   1050 <fpdat_write@plt>
mov    $0x0,%al
call   1030 <check_status@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<flash_device_erase>:
push   %rax
mov    $0xb4,%edi
call   1040 <c2_addr_write@plt>
mov    $0x3,%edi
call   1050 <fpdat_write@plt>
xor    %eax,%eax
call   1030 <check_status@plt>
mov    $0xde,%edi
call   1050 <fpdat_write@plt>
mov    $0xad,%edi
call   1050 <fpdat_write@plt>
mov    $0xa5,%edi
call   1050 <fpdat_write@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <check_status@plt>

LLVM IR (-O0):
define void @flash_device_erase() {
%1 = call i32 @c2_addr_write(i32 180)
%2 = call i32 @fpdat_write(i32 3)
%3 = call i32 (...) @check_status()
%4 = call i32 @fpdat_write(i32 222)
%5 = call i32 @fpdat_write(i32 173)
%6 = call i32 @fpdat_write(i32 165)
%7 = call i32 (...) @check_status()
ret void
}

LLVM IR (-O2):
define void @flash_device_erase() {
%1 = tail call i32 @c2_addr_write(i32 180)
%2 = tail call i32 @fpdat_write(i32 3)
%3 = tail call i32 (...) @check_status()
%4 = tail call i32 @fpdat_write(i32 222)
%5 = tail call i32 @fpdat_write(i32 173)
%6 = tail call i32 @fpdat_write(i32 165)
%7 = tail call i32 (...) @check_status()
ret void
}