xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ put32(unsigned int);
int /*<<< orphan*/ put8(unsigned int);
void or_reg32_m32(unsigned int reg32, unsigned int *m32) {
  put8(0x0B);
  put8((reg32 << 3) | 5);
  put32((unsigned int)(m32));
}


x86 assembly (clang, -O0):
<or_reg32_m32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0xb,%edi
call   1030 <put8@plt>
mov    -0x4(%rbp),%edi
shl    $0x3,%edi
or     $0x5,%edi
call   1030 <put8@plt>
mov    -0x10(%rbp),%rax
mov    %eax,%edi
call   1040 <put32@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<or_reg32_m32>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %edi,%ebx
mov    $0xb,%edi
call   1030 <put8@plt>
lea    0x5(,%rbx,8),%edi
call   1030 <put8@plt>
mov    %r14d,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <put32@plt>

LLVM IR (-O0):
define void @or_reg32_m32(i32 %0, i32* %1) {
%3 = alloca i32
%4 = alloca i32*
store i32 %0, i32* %3
store i32* %1, i32** %4
%5 = call i32 @put8(i32 11)
%6 = load i32, i32* %3
%7 = shl i32 %6, 3
%8 = or i32 %7, 5
%9 = call i32 @put8(i32 %8)
%10 = load i32*, i32** %4
%11 = ptrtoint i32* %10 to i32
%12 = call i32 @put32(i32 %11)
ret void
}

LLVM IR (-O2):
define void @or_reg32_m32(i32 %0, i32* %1) {
%3 = tail call i32 @put8(i32 11)
%4 = shl i32 %0, 3
%5 = or i32 %4, 5
%6 = tail call i32 @put8(i32 %5)
%7 = ptrtoint i32* %1 to i64
%8 = trunc i64 %7 to i32
%9 = tail call i32 @put32(i32 %8)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isspace(int);
void t_isspace_0x1c() {
  Assert_real((isspace(28) == 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_isspace.c",
              145, ("isspace should be 0 for 0x1c"));
}


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

x86 assembly (clang, -O2):
<t_isspace_0x1c>:
push   %rax
mov    $0x1c,%edi
call   1030 <isspace@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x91,%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_isspace.c\00"
@.str.1 = [29 x i8] c"isspace should be 0 for 0x1c\00"
define void @t_isspace_0x1c() {
%1 = call i64 @isspace(i32 28)
%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 145, 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_isspace.c\00"
@.str.1 = [29 x i8] c"isspace should be 0 for 0x1c\00"
define void @t_isspace_0x1c() {
%1 = tail call i64 @isspace(i32 28)
%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 145, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int do_auth_custom(const char *userid, struct authinfo *authinfo) {
  return (-1);
}


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

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

LLVM IR (-O0):
%struct.authinfo = type opaque
define i32 @do_auth_custom(i8* %0, %struct.authinfo* %1) {
%3 = alloca i8*
%4 = alloca %struct.authinfo*
store i8* %0, i8** %3
store %struct.authinfo* %1, %struct.authinfo** %4
ret i32 -1
}

LLVM IR (-O2):
%struct.authinfo = type opaque
define i32 @do_auth_custom(i8* nocapture readnone %0, %struct.authinfo* nocapture readnone %1) {
ret i32 -1
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ background_pixel;
};
typedef TYPE_1__ XSetWindowAttributes;

/* Variables and functions */
unsigned long get_XSetWindowAttributes_background_pixel(void *_p) {
  return (unsigned long)((XSetWindowAttributes *)_p)->background_pixel;
}


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

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

LLVM IR (-O0):
%struct.TYPE_2__ = type { i64 }
define i64 @get_XSetWindowAttributes_background_pixel(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.TYPE_2__*
%5 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %4, i32 0, i32 0
%6 = load i64, i64* %5
ret i64 %6
}

LLVM IR (-O2):
define i64 @get_XSetWindowAttributes_background_pixel(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
ret i64 %3
}
void chkr_check_str(char *p, unsigned char a) {}


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

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

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

LLVM IR (-O2):
define void @chkr_check_str(i8* nocapture %0, i8 zeroext %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ indigoFree(int);
int indigoLoadQueryMolecule(int);
int indigoReadString(char const *);
__attribute__((visibility("default"))) int
indigoLoadQueryMoleculeFromString(const char *string) {
  int source = indigoReadString(string);
  int result;
  if (source <= 0)
    return -1;
  result = indigoLoadQueryMolecule(source);
  indigoFree(source);
  return result;
}


x86 assembly (clang, -O0):
<indigoLoadQueryMoleculeFromString>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <indigoReadString@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jg     115e <indigoLoadQueryMoleculeFromString+0x2e>
movl   $0xffffffff,-0x4(%rbp)
jmp    1177 <indigoLoadQueryMoleculeFromString+0x47>
mov    -0x14(%rbp),%edi
call   1040 <indigoLoadQueryMolecule@plt>
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%edi
call   1030 <indigoFree@plt>
mov    -0x18(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<indigoLoadQueryMoleculeFromString>:
push   %rbp
push   %rbx
push   %rax
call   1050 <indigoReadString@plt>
test   %eax,%eax
jle    1152 <indigoLoadQueryMoleculeFromString+0x22>
mov    %eax,%ebx
mov    %eax,%edi
call   1040 <indigoLoadQueryMolecule@plt>
mov    %eax,%ebp
mov    %ebx,%edi
call   1030 <indigoFree@plt>
mov    %ebp,%eax
jmp    1157 <indigoLoadQueryMoleculeFromString+0x27>
mov    $0xffffffff,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @indigoLoadQueryMoleculeFromString(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
store i8* %0, i8** %3
%6 = load i8*, i8** %3
%7 = call i32 @indigoReadString(i8* %6)
store i32 %7, i32* %4
%8 = load i32, i32* %4
%9 = icmp sle i32 %8, 0
br i1 %9, label %10, label %11
10: ; preds = %1
store i32 -1, i32* %2
br label %17
11: ; preds = %1
%12 = load i32, i32* %4
%13 = call i32 @indigoLoadQueryMolecule(i32 %12)
store i32 %13, i32* %5
%14 = load i32, i32* %4
%15 = call i32 @indigoFree(i32 %14)
%16 = load i32, i32* %5
store i32 %16, i32* %2
br label %17
17: ; preds = %11, %10
%18 = load i32, i32* %2
ret i32 %18
}

LLVM IR (-O2):
define i32 @indigoLoadQueryMoleculeFromString(i8* %0) {
%2 = tail call i32 @indigoReadString(i8* %0)
%3 = icmp slt i32 %2, 1
br i1 %3, label %7, label %4
4: ; preds = %1
%5 = tail call i32 @indigoLoadQueryMolecule(i32 %2)
%6 = tail call i32 @indigoFree(i32 %2)
br label %7
7: ; preds = %1, %4
%8 = phi i32 [ %5, %4 ], [ -1, %1 ]
ret i32 %8
}
/* Variables and functions */
int strcmp(char *, char *);
int compareString(void *ip, void *ip2) {
  return strcmp((char *)ip, (char *)ip2);
}


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

x86 assembly (clang, -O2):
<compareString>:
jmp    1030 <strcmp@plt>

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

LLVM IR (-O2):
define i32 @compareString(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isupper(int);
void t_isupper_0x25() {
  Assert_real((isupper(37) == 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",
              190, ("isupper should be 0 for %"));
}


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

x86 assembly (clang, -O2):
<t_isupper_0x25>:
push   %rax
mov    $0x25,%edi
call   1030 <isupper@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0xbe,%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 = [26 x i8] c"isupper should be 0 for %\00"
define void @t_isupper_0x25() {
%1 = call i64 @isupper(i32 37)
%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 190, i8* getelementptr inbounds ([26 x i8], [26 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 = [26 x i8] c"isupper should be 0 for %\00"
define void @t_isupper_0x25() {
%1 = tail call i64 @isupper(i32 37)
%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 190, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int gcd(int x, int y) { return x * y; }


x86 assembly (clang, -O0):
<gcd>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
imul   -0x8(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @gcd(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 = mul nsw i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @gcd(i32 %0, i32 %1) {
%3 = mul nsw i32 %1, %0
ret i32 %3
}
void X509_VERIFY_PARAM_new(void) {}


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

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

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

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

/* Variables and functions */
int null_readtoc_raw(uint8_t id, uint8_t *b, int maxlen) { return (0); }


x86 assembly (clang, -O0):
<null_readtoc_raw>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @null_readtoc_raw(i32 %0, i32* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32*
%6 = alloca i32
store i32 %0, i32* %4
store i32* %1, i32** %5
store i32 %2, i32* %6
ret i32 0
}

LLVM IR (-O2):
define i32 @null_readtoc_raw(i32 %0, i32* nocapture readnone %1, i32 %2) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void STEST901(char *s) {
  printf("sub  (test15f) C901:(%20s):(ABCDEFGHIJ0123456789):Call by ref from "
         "variable\n",
         s);
}


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

LLVM IR (-O0):
@.str = [77 x i8] c"sub (test15f) C901:(%20s):(ABCDEFGHIJ0123456789):Call by ref from variable\0A\00"
define void @STEST901(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([77 x i8], [77 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [77 x i8] c"sub (test15f) C901:(%20s):(ABCDEFGHIJ0123456789):Call by ref from variable\0A\00"
define void @STEST901(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([77 x i8], [77 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
bool is_word_aligned(void const *p) { return (((uintptr_t)p & 0x03) == 0); }


x86 assembly (clang, -O0):
<is_word_aligned>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
and    $0x3,%rax
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_word_aligned>:
xor    %eax,%eax
test   $0x3,%dil
sete   %al
ret

LLVM IR (-O0):
define i32 @is_word_aligned(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = ptrtoint i8* %3 to i64
%5 = and i64 %4, 3
%6 = icmp eq i64 %5, 0
%7 = zext i1 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @is_word_aligned(i8* %0) {
%2 = ptrtoint i8* %0 to i64
%3 = and i64 %2, 3
%4 = icmp eq i64 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
int answer() { return 42; }


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

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

LLVM IR (-O0):
define i32 @answer() {
ret i32 42
}

LLVM IR (-O2):
define i32 @answer() {
ret i32 42
}
/* Variables and functions */
int /*<<< orphan*/ sinh(double);
int /*<<< orphan*/ sinhf(float);
int /*<<< orphan*/ sinhl(long double);
void uninitvar_sinh(void) {
  float f;
  (void)sinhf(f);
  double d;
  (void)sinh(d);
  long double ld;
  (void)sinhl(ld);
}


x86 assembly (clang, -O0):
<uninitvar_sinh>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movss  -0x4(%rbp),%xmm0
call   1050 <sinhf@plt>
movsd  -0x10(%rbp),%xmm0
call   1030 <sinh@plt>
fldt   -0x20(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
call   1040 <sinhl@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uninitvar_sinh>:
sub    $0x18,%rsp
call   1050 <sinhf@plt>
call   1030 <sinh@plt>
call   1040 <sinhl@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
define void @uninitvar_sinh() {
%1 = alloca float
%2 = alloca double
%3 = alloca x86_fp80
%4 = load float, float* %1
%5 = call i32 @sinhf(float %4)
%6 = load double, double* %2
%7 = call i32 @sinh(double %6)
%8 = load x86_fp80, x86_fp80* %3
%9 = call i32 @sinhl(x86_fp80 %8)
ret void
}

LLVM IR (-O2):
define void @uninitvar_sinh() {
%1 = tail call i32 @sinhf(float undef)
%2 = tail call i32 @sinh(double undef)
%3 = tail call i32 @sinhl(x86_fp80 undef)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ scanf(char *, char *);
void read_input(char *prompt, char *format, char *buffer) {
  puts(prompt);
  scanf(format, buffer);
}


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

x86 assembly (clang, -O2):
<read_input>:
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rsi,%rbx
call   1030 <puts@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <scanf@plt>

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

LLVM IR (-O2):
define void @read_input(i8* nocapture %0, i8* nocapture %1, i8* %2) {
%4 = tail call i32 @puts(i8* dereferenceable(1) %0)
%5 = tail call i32 @scanf(i8* %1, i8* %2)
ret void
}
int first_empty_slot(int *a, int length) {
  int i = 0;
  while (i < length) {
    if (-1 == a[i]) {
      break;
    }
    ++i;
  }
  return i;
}


x86 assembly (clang, -O0):
<first_empty_slot>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1147 <first_empty_slot+0x47>
mov    -0x8(%rbp),%rcx
movslq -0x10(%rbp),%rdx
mov    $0xffffffff,%eax
cmp    (%rcx,%rdx,4),%eax
jne    1139 <first_empty_slot+0x39>
jmp    1147 <first_empty_slot+0x47>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1112 <first_empty_slot+0x12>
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<first_empty_slot>:
test   %esi,%esi
jle    1122 <first_empty_slot+0x22>
mov    %esi,%ecx
xor    %eax,%eax
nopl   0x0(%rax,%rax,1)
cmpl   $0xffffffff,(%rdi,%rax,4)
je     1121 <first_empty_slot+0x21>
add    $0x1,%rax
cmp    %rax,%rcx
jne    1110 <first_empty_slot+0x10>
mov    %ecx,%eax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @first_empty_slot(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %16
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %11
%7 = phi i64 [ 0, %4 ], [ %12, %11 ]
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = load i32, i32* %8
%10 = icmp eq i32 %9, -1
br i1 %10, label %14, label %11
11: ; preds = %6
%12 = add nuw nsw i64 %7, 1
%13 = icmp eq i64 %12, %5
br i1 %13, label %16, label %6
14: ; preds = %6
%15 = trunc i64 %7 to i32
br label %16
16: ; preds = %11, %14, %2
%17 = phi i32 [ 0, %2 ], [ %15, %14 ], [ %1, %11 ]
ret i32 %17
}
/* Variables and functions */
int /*<<< orphan*/ scanf(char *, int *);
int scanInt() {
  int begin;
  scanf("%d", &begin);
  return begin;
}


x86 assembly (clang, -O0):
<scanInt>:
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):
<scanInt>:
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 @scanInt() {
%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 @scanInt() {
%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
}
double prv_process_fpa_div_real64(double a, double b) { return a / b; }


x86 assembly (clang, -O0):
<prv_process_fpa_div_real64>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
divsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<prv_process_fpa_div_real64>:
divsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @prv_process_fpa_div_real64(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = fdiv double %5, %6
ret double %7
}

LLVM IR (-O2):
define double @prv_process_fpa_div_real64(double %0, double %1) {
%3 = fdiv double %0, %1
ret double %3
}
int test_imm_7Aint64_lowword_reg(long long val) {
  return ((val) & (0x7A << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_7Aint64_lowword_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
and    $0x7a,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_7Aint64_lowword_reg>:
test   $0x7a,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_7Aint64_lowword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = and i64 %3, 122
%5 = icmp ne i64 %4, 0
%6 = zext i1 %5 to i64
%7 = select i1 %5, i32 -20, i32 -40
ret i32 %7
}

LLVM IR (-O2):
define i32 @test_imm_7Aint64_lowword_reg(i64 %0) {
%2 = and i64 %0, 122
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ assert(void *);
void *malloc(unsigned int);
void *New(unsigned int n) {
  void *ptr = malloc(n);
  assert(ptr);
  return ptr;
}


x86 assembly (clang, -O0):
<New>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <assert@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<New>:
push   %rbx
call   1040 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1030 <assert@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @New(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i8* @malloc(i32 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = call i32 @assert(i8* %6)
%8 = load i8*, i8** %3
ret i8* %8
}

LLVM IR (-O2):
define i8* @New(i32 %0) {
%2 = tail call i8* @malloc(i32 %0)
%3 = tail call i32 @assert(i8* %2)
ret i8* %2
}
/* Variables and functions */
char *get_sata_log(int, int);
char *get_sata_temp(int fd) { return (get_sata_log(fd, 0x05)); }


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

x86 assembly (clang, -O2):
<get_sata_temp>:
mov    $0x5,%esi
jmp    1030 <get_sata_log@plt>

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

LLVM IR (-O2):
define i8* @get_sata_temp(i32 %0) {
%2 = tail call i8* @get_sata_log(i32 %0, i32 5)
ret i8* %2
}
void EPIConfigSDRAMSet(unsigned long ulBase, unsigned long ulConfig,
                       unsigned long ulRefresh) {
  ;
  ;
  ulConfig &= ~0x07FF0000;
  ulConfig |= ulRefresh << 16;
  (*((volatile unsigned long *)(ulBase + 0x00000010))) = ulConfig;
}


x86 assembly (clang, -O0):
<EPIConfigSDRAMSet>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
and    $0xfffffffff800ffff,%rax
mov    %rax,-0x10(%rbp)
mov    -0x18(%rbp),%rax
shl    $0x10,%rax
or     -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,0x10(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<EPIConfigSDRAMSet>:
and    $0xfffffffff800ffff,%rsi
shl    $0x10,%rdx
or     %rsi,%rdx
mov    %rdx,0x10(%rdi)
ret

LLVM IR (-O0):
define void @EPIConfigSDRAMSet(i64 %0, i64 %1, i64 %2) {
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
store i64 %0, i64* %4
store i64 %1, i64* %5
store i64 %2, i64* %6
%7 = load i64, i64* %5
%8 = and i64 %7, -134152193
store i64 %8, i64* %5
%9 = load i64, i64* %6
%10 = shl i64 %9, 16
%11 = load i64, i64* %5
%12 = or i64 %11, %10
store i64 %12, i64* %5
%13 = load i64, i64* %5
%14 = load i64, i64* %4
%15 = add i64 %14, 16
%16 = inttoptr i64 %15 to i64*
store volatile i64 %13, i64* %16
ret void
}

LLVM IR (-O2):
define void @EPIConfigSDRAMSet(i64 %0, i64 %1, i64 %2) {
%4 = and i64 %1, -134152193
%5 = shl i64 %2, 16
%6 = or i64 %5, %4
%7 = add i64 %0, 16
%8 = inttoptr i64 %7 to i64*
store volatile i64 %6, i64* %8
ret void
}
void projekt(int id) { printf('RepoReapers %d\n', id); }


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

x86 assembly (clang, -O2):
<projekt>:
mov    %edi,%esi
mov    $0x2025640a,%edi
xor    %eax,%eax
jmp    1030 <printf@plt>

LLVM IR (-O0):
define void @projekt(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 (i8*, ...) @printf(i8* inttoptr (i64 539321354 to i8*), i32 %3)
ret void
}

LLVM IR (-O2):
define void @projekt(i32 %0) {
%2 = tail call i32 (i8*, ...) @printf(i8* inttoptr (i64 539321354 to i8*), i32 %0)
ret void
}
/* Variables and functions */
int d27(int);
int d28(int a) { return d27(d27(a)); }


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

x86 assembly (clang, -O2):
<d28>:
push   %rax
call   1030 <d27@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <d27@plt>

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

LLVM IR (-O2):
define i32 @d28(i32 %0) {
%2 = tail call i32 @d27(i32 %0)
%3 = tail call i32 @d27(i32 %2)
ret i32 %3
}
/* Variables and functions */
int comp(int);
int /*<<< orphan*/ printf(char *, int);
int main() {
  printf("%d\n", comp(5));
  printf("%d\n", comp(2));
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x5,%edi
call   1030 <comp@plt>
lea    0xece(%rip),%rbx
mov    %rbx,%rdi
mov    %eax,%esi
call   1040 <printf@plt>
mov    $0x2,%edi
call   1030 <comp@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 @comp(i32 5)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 @comp(i32 2)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ print_target_indices(char *, int const *);
void print_framelock_target_indices(const int *pData) {
  print_target_indices("FRAMELOCK", pData);
}


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

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

LLVM IR (-O0):
@.str = [10 x i8] c"FRAMELOCK\00"
define void @print_framelock_target_indices(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @print_target_indices(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32* %3)
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"FRAMELOCK\00"
define void @print_framelock_target_indices(i32* %0) {
%2 = tail call i32 @print_target_indices(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32* %0)
ret void
}
/* Type definitions */
typedef scalar_t__ pid_t;

/* Variables and functions */
int /*<<< orphan*/ SIGKILL;
scalar_t__ fork();
int /*<<< orphan*/ kill(scalar_t__, int /*<<< orphan*/);
int /*<<< orphan*/ sleep(int);
int main(void) {
  pid_t child = fork();
  if (child) {
    sleep(5);
    kill(child, SIGKILL);
  } else {
    for (;;)
      ;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1050 <fork@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1176 <main+0x46>
mov    $0x5,%edi
call   1040 <sleep@plt>
mov    -0x10(%rbp),%rdi
mov    0x2e76(%rip),%rax
mov    (%rax),%esi
call   1030 <kill@plt>
jmp    1180 <main+0x50>
jmp    117b <main+0x4b>
jmp    117b <main+0x4b>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1050 <fork@plt>
test   %rax,%rax
je     1160 <main+0x30>
mov    %rax,%rbx
mov    $0x5,%edi
call   1040 <sleep@plt>
mov    0x2e8f(%rip),%rax
mov    (%rax),%esi
mov    %rbx,%rdi
call   1030 <kill@plt>
xor    %eax,%eax
pop    %rbx
ret
nop
jmp    1160 <main+0x30>

LLVM IR (-O0):
@SIGKILL = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i64
store i32 0, i32* %1
%3 = call i64 (...) @fork()
store i64 %3, i64* %2
%4 = load i64, i64* %2
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %11
6: ; preds = %0
%7 = call i32 @sleep(i32 5)
%8 = load i64, i64* %2
%9 = load i32, i32* @SIGKILL
%10 = call i32 @kill(i64 %8, i32 %9)
br label %13
11: ; preds = %0
br label %12
12: ; preds = %12, %11
br label %12
13: ; preds = %6
ret i32 0
}

LLVM IR (-O2):
@SIGKILL = global i32 0
define i32 @main() {
%1 = tail call i64 (...) @fork()
%2 = icmp eq i64 %1, 0
br i1 %2, label %7, label %3
3: ; preds = %0
%4 = tail call i32 @sleep(i32 5)
%5 = load i32, i32* @SIGKILL
%6 = tail call i32 @kill(i64 %1, i32 %5)
ret i32 0
7: ; preds = %0, %7
br label %7
}
/* Variables and functions */
int /*<<< orphan*/ appStartupResp(int);
int /*<<< orphan*/ pid_init(int);
int /*<<< orphan*/ setup_sigsegv();
int baseInit_th(int pid) {
  pid_init(pid);
  setup_sigsegv();
  appStartupResp(pid);
  return 0;
}


x86 assembly (clang, -O0):
<baseInit_th>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <pid_init@plt>
mov    $0x0,%al
call   1040 <setup_sigsegv@plt>
mov    -0x4(%rbp),%edi
call   1050 <appStartupResp@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<baseInit_th>:
push   %rbx
mov    %edi,%ebx
call   1030 <pid_init@plt>
xor    %eax,%eax
call   1040 <setup_sigsegv@plt>
mov    %ebx,%edi
call   1050 <appStartupResp@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @baseInit_th(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @pid_init(i32 %3)
%5 = call i32 (...) @setup_sigsegv()
%6 = load i32, i32* %2
%7 = call i32 @appStartupResp(i32 %6)
ret i32 0
}

LLVM IR (-O2):
define i32 @baseInit_th(i32 %0) {
%2 = tail call i32 @pid_init(i32 %0)
%3 = tail call i32 (...) @setup_sigsegv()
%4 = tail call i32 @appStartupResp(i32 %0)
ret i32 0
}
void delay(volatile int count) {
  volatile int i = count;
  while (i) {
    i--;
  }
}


x86 assembly (clang, -O0):
<delay>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    $0x0,%eax
je     1127 <delay+0x27>
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
jmp    110d <delay+0xd>
pop    %rbp
ret

x86 assembly (clang, -O2):
<delay>:
mov    %edi,-0x4(%rsp)
mov    -0x4(%rsp),%eax
mov    %eax,-0x8(%rsp)
cmpl   $0x0,-0x8(%rsp)
je     112c <delay+0x2c>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
addl   $0xffffffff,-0x8(%rsp)
cmpl   $0x0,-0x8(%rsp)
jne    1120 <delay+0x20>
ret

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

LLVM IR (-O2):
define void @delay(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store volatile i32 %0, i32* %2
%4 = bitcast i32* %3 to i8*
%5 = load volatile i32, i32* %2
store volatile i32 %5, i32* %3
%6 = load volatile i32, i32* %3
%7 = icmp eq i32 %6, 0
br i1 %7, label %13, label %8
8: ; preds = %1, %8
%9 = load volatile i32, i32* %3
%10 = add nsw i32 %9, -1
store volatile i32 %10, i32* %3
%11 = load volatile i32, i32* %3
%12 = icmp eq i32 %11, 0
br i1 %12, label %13, label %8
13: ; preds = %8, %1
ret void
}
void Timer1A_Disable(void) {
  (*((volatile unsigned long *)0x4003100C)) &= ~0x00000001;
}


x86 assembly (clang, -O0):
<Timer1A_Disable>:
push   %rbp
mov    %rsp,%rbp
mov    $0x4003100c,%eax
mov    (%rax),%rcx
and    $0xfffffffffffffffe,%rcx
mov    $0x4003100c,%eax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<Timer1A_Disable>:
andq   $0xfffffffffffffffe,0x4003100c
40 fe
ret

LLVM IR (-O0):
define void @Timer1A_Disable() {
%1 = load volatile i64, i64* inttoptr (i64 1073942540 to i64*)
%2 = and i64 %1, -2
store volatile i64 %2, i64* inttoptr (i64 1073942540 to i64*)
ret void
}

LLVM IR (-O2):
define void @Timer1A_Disable() {
%1 = load volatile i64, i64* inttoptr (i64 1073942540 to i64*)
%2 = and i64 %1, -2
store volatile i64 %2, i64* inttoptr (i64 1073942540 to i64*)
ret void
}
/* Variables and functions */
int _rt(char *);
int main(int argc, char *argv[]) {
  int ret = 0;
  (void)argc;
  ret |= _rt(argv[0]);
  return (ret == 0) ? 0 : 2;
}


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)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1030 <_rt@plt>
or     -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edx
mov    $0x2,%eax
xor    %ecx,%ecx
cmp    $0x0,%edx
cmove  %ecx,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    (%rsi),%rdi
call   1030 <_rt@plt>
xor    %ecx,%ecx
test   %eax,%eax
setne  %cl
add    %ecx,%ecx
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %6
%7 = load i32, i32* %4
%8 = load i8**, i8*** %5
%9 = getelementptr inbounds i8*, i8** %8, i64 0
%10 = load i8*, i8** %9
%11 = call i32 @_rt(i8* %10)
%12 = load i32, i32* %6
%13 = or i32 %12, %11
store i32 %13, i32* %6
%14 = load i32, i32* %6
%15 = icmp eq i32 %14, 0
%16 = zext i1 %15 to i64
%17 = select i1 %15, i32 0, i32 2
ret i32 %17
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = load i8*, i8** %1
%4 = tail call i32 @_rt(i8* %3)
%5 = icmp eq i32 %4, 0
%6 = select i1 %5, i32 0, i32 2
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
char *getprogname();
int /*<<< orphan*/ stderr;
void usage(void) {
  (void)fprintf(stderr, "Usage: %s [ <-|+><A|a|G|g|M|m> ] <file> ...\n",
                getprogname());
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ea1(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1030 <getprogname@plt>
mov    -0x4(%rbp),%edi
mov    %rax,%rdx
lea    0xea8(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rbx
mov    0x2ea8(%rip),%rax
mov    (%rax),%ebx
xor    %eax,%eax
call   1030 <getprogname@plt>
lea    0xeb8(%rip),%rsi
mov    %ebx,%edi
mov    %rax,%rdx
call   1040 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [45 x i8] c"Usage: %s [ <-|+><A|a|G|g|M|m> ] <file> ...\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i8* (...) @getprogname()
%3 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [45 x i8] c"Usage: %s [ <-|+><A|a|G|g|M|m> ] <file> ...\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i8* (...) @getprogname()
%3 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
char const *cfe_errortext(int);
const char *ui_errstring(int errcode) { return cfe_errortext(errcode); }


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

x86 assembly (clang, -O2):
<ui_errstring>:
jmp    1030 <cfe_errortext@plt>

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

LLVM IR (-O2):
define i8* @ui_errstring(i32 %0) {
%2 = tail call i8* @cfe_errortext(i32 %0)
ret i8* %2
}
/* Variables and functions */
int errno;
void SetErrno(int value) { errno = value; }


x86 assembly (clang, -O0):
<SetErrno>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
mov    0x2ecf(%rip),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<SetErrno>:
mov    0x2ed9(%rip),%rax
mov    %edi,(%rax)
ret

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

LLVM IR (-O2):
@errno = global i32 0
define void @SetErrno(i32 %0) {
store i32 %0, i32* @errno
ret void
}
int rsock_socktype_to_int(const char *str, long len, int *valp) {
  switch (len) {
  case 3:
    return -1;
  case 5:
    return -1;
  case 6:
    return -1;
  case 8:
    return -1;
  case 9:
    return -1;
  case 10:
    return -1;
  case 11:
    return -1;
  case 14:
    return -1;
  default:
    if (!str || !valp) {
    }
    return -1;
  }
}


x86 assembly (clang, -O0):
<rsock_socktype_to_int>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x18(%rbp),%rax
add    $0xfffffffffffffffd,%rax
mov    %rax,-0x28(%rbp)
sub    $0xb,%rax
ja     119a <rsock_socktype_to_int+0x9a>
mov    -0x28(%rbp),%rax
lea    0xecf(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movl   $0xffffffff,-0x4(%rbp)
jmp    11bc <rsock_socktype_to_int+0xbc>
movl   $0xffffffff,-0x4(%rbp)
jmp    11bc <rsock_socktype_to_int+0xbc>
movl   $0xffffffff,-0x4(%rbp)
jmp    11bc <rsock_socktype_to_int+0xbc>
movl   $0xffffffff,-0x4(%rbp)
jmp    11bc <rsock_socktype_to_int+0xbc>
movl   $0xffffffff,-0x4(%rbp)
jmp    11bc <rsock_socktype_to_int+0xbc>
movl   $0xffffffff,-0x4(%rbp)
jmp    11bc <rsock_socktype_to_int+0xbc>
movl   $0xffffffff,-0x4(%rbp)
jmp    11bc <rsock_socktype_to_int+0xbc>
movl   $0xffffffff,-0x4(%rbp)
jmp    11bc <rsock_socktype_to_int+0xbc>
cmpq   $0x0,-0x10(%rbp)
je     11b0 <rsock_socktype_to_int+0xb0>
cmpq   $0x0,-0x20(%rbp)
jne    11b5 <rsock_socktype_to_int+0xb5>
jmp    11b5 <rsock_socktype_to_int+0xb5>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @rsock_socktype_to_int(i8* nocapture readnone %0, i64 %1, i32* nocapture readnone %2) {
ret i32 -1
}
void *test_anti_range_132(signed char n) {
  extern void *alloc_anti_range_132(signed char) __attribute__((alloc_size(1)));
  if ((-0x7f - 1) + 2 <= n && n <= 2)
    n = (-0x7f - 1) + 2 - 1;
  return alloc_anti_range_132(n);
}


x86 assembly (clang, -O0):
<test_anti_range_132>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
mov    $0xffffff82,%eax
cmp    %ecx,%eax
jg     1140 <test_anti_range_132+0x30>
movsbl -0x1(%rbp),%eax
cmp    $0x2,%eax
jg     1140 <test_anti_range_132+0x30>
movb   $0x81,-0x1(%rbp)
movsbl -0x1(%rbp),%edi
call   1030 <alloc_anti_range_132@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_anti_range_132>:
lea    0x7e(%rdi),%eax
cmp    $0x81,%al
mov    $0x81,%eax
cmovae %edi,%eax
movsbl %al,%edi
jmp    1030 <alloc_anti_range_132@plt>

LLVM IR (-O0):
define i8* @test_anti_range_132(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp sle i32 -126, %4
br i1 %5, label %6, label %11
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp sle i32 %8, 2
br i1 %9, label %10, label %11
10: ; preds = %6
store i8 -127, i8* %2
br label %11
11: ; preds = %10, %6, %1
%12 = load i8, i8* %2
%13 = call i8* @alloc_anti_range_132(i8 signext %12)
ret i8* %13
}

LLVM IR (-O2):
define i8* @test_anti_range_132(i8 signext %0) {
%2 = add i8 %0, 126
%3 = icmp ult i8 %2, -127
%4 = select i1 %3, i8 -127, i8 %0
%5 = tail call i8* @alloc_anti_range_132(i8 signext %4)
ret i8* %5
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ printf(char *, char const *);
void error(FILE *payload, const char *message) {
  fclose(payload);
  printf("%s, are you sure you're using an AuReiNand payload?\n", message);
  exit(0);
}


x86 assembly (clang, -O0):
<error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <fclose@plt>
mov    -0x10(%rbp),%rsi
lea    0xeac(%rip),%rdi
call   1040 <printf@plt>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<error>:
push   %rbx
mov    %rsi,%rbx
call   1030 <fclose@plt>
lea    0xec0(%rip),%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [53 x i8] c"%s, are you sure you're using an AuReiNand payload?\0A\00"
define void @error(i32* %0, i8* %1) {
%3 = alloca i32*
%4 = alloca i8*
store i32* %0, i32** %3
store i8* %1, i8** %4
%5 = load i32*, i32** %3
%6 = call i32 @fclose(i32* %5)
%7 = load i8*, i8** %4
%8 = call i32 @printf(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str, i64 0, i64 0), i8* %7)
%9 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [53 x i8] c"%s, are you sure you're using an AuReiNand payload?\0A\00"
define void @error(i32* nocapture %0, i8* %1) {
%3 = tail call i32 @fclose(i32* %0)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str, i64 0, i64 0), i8* %1)
%5 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int _ada_use_c2phc(int, int *, int *, double *);
int clear_data(void) {
  int *a, *b, fail;
  double *c;
  fail = _ada_use_c2phc(18, a, b, c);
  return fail;
}


x86 assembly (clang, -O0):
<clear_data>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x12,%edi
call   1030 <_ada_use_c2phc@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clear_data>:
mov    $0x12,%edi
jmp    1030 <_ada_use_c2phc@plt>

LLVM IR (-O0):
define i32 @clear_data() {
%1 = alloca i32*
%2 = alloca i32*
%3 = alloca i32
%4 = alloca double*
%5 = load i32*, i32** %1
%6 = load i32*, i32** %2
%7 = load double*, double** %4
%8 = call i32 @_ada_use_c2phc(i32 18, i32* %5, i32* %6, double* %7)
store i32 %8, i32* %3
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
define i32 @clear_data() {
%1 = tail call i32 @_ada_use_c2phc(i32 18, i32* undef, i32* undef, double* undef)
ret i32 %1
}