xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int fread(int *, int, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ fseek(int /*<<< orphan*/ *, int, int /*<<< orphan*/);
int imgH(char *filename) {
  FILE *fp;
  int n, int_var, h;
  fp = fopen(filename, "r");
  fseek(fp, 22, 0);
  n = fread(&int_var, sizeof(int), 1, fp);
  h = int_var;
  fclose(fp);
  return h;
}


x86 assembly (clang, -O0):
<imgH>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xea9(%rip),%rsi
call   1060 <fopen@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x16,%esi
xor    %edx,%edx
call   1050 <fseek@plt>
mov    -0x10(%rbp),%rcx
lea    -0x18(%rbp),%rdi
mov    $0x4,%esi
mov    $0x1,%edx
call   1030 <fread@plt>
mov    %eax,-0x14(%rbp)
mov    -0x18(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <fclose@plt>
mov    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<imgH>:
push   %rbp
push   %rbx
push   %rax
lea    0xeb6(%rip),%rsi
call   1060 <fopen@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    $0x16,%esi
xor    %edx,%edx
call   1050 <fseek@plt>
lea    0x4(%rsp),%rdi
mov    $0x4,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1030 <fread@plt>
mov    0x4(%rsp),%ebp
mov    %rbx,%rdi
call   1040 <fclose@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [2 x i8] c"r\00"
define i32 @imgH(i8* %0) {
%2 = alloca i8*
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %2
%7 = load i8*, i8** %2
%8 = call i32* @fopen(i8* %7, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32* %8, i32** %3
%9 = load i32*, i32** %3
%10 = call i32 @fseek(i32* %9, i32 22, i32 0)
%11 = load i32*, i32** %3
%12 = call i32 @fread(i32* %5, i32 4, i32 1, i32* %11)
store i32 %12, i32* %4
%13 = load i32, i32* %5
store i32 %13, i32* %6
%14 = load i32*, i32** %3
%15 = call i32 @fclose(i32* %14)
%16 = load i32, i32* %6
ret i32 %16
}

LLVM IR (-O2):
@.str = [2 x i8] c"r\00"
define i32 @imgH(i8* nocapture %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%5 = tail call i32 @fseek(i32* %4, i32 22, i32 0)
%6 = call i32 @fread(i32* %2, i32 4, i32 1, i32* %4)
%7 = load i32, i32* %2
%8 = tail call i32 @fclose(i32* %4)
ret i32 %7
}
/* Variables and functions */
int getpid();
int /*<<< orphan*/ printf(char *, int);
int statsTest() {
  printf("MY PROCESS ID IS: %d\n", getpid());
  return 0;
}


x86 assembly (clang, -O0):
<statsTest>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <getpid@plt>
mov    %eax,%esi
lea    0xecc(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<statsTest>:
push   %rax
xor    %eax,%eax
call   1030 <getpid@plt>
lea    0xed1(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [22 x i8] c"MY PROCESS ID IS: %d\0A\00"
define i32 @statsTest() {
%1 = call i32 (...) @getpid()
%2 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}

LLVM IR (-O2):
@.str = [22 x i8] c"MY PROCESS ID IS: %d\0A\00"
define i32 @statsTest() {
%1 = tail call i32 (...) @getpid()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ fexpect(char *, int, int, int);
void t7() {
  int a[3 * 3];
  a[8] = 68;
  fexpect("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
          "2022-01-22/02-19-57/repos/8l/8cc/refs/heads/master/test/array.c",
          58, 68, a[8]);
  ;
}


x86 assembly (clang, -O0):
<t7>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x44,-0x10(%rbp)
mov    -0x10(%rbp),%ecx
lea    0xed7(%rip),%rdi
mov    $0x3a,%esi
mov    $0x44,%edx
call   1030 <fexpect@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<t7>:
lea    0xee9(%rip),%rdi
mov    $0x3a,%esi
mov    $0x44,%edx
mov    $0x44,%ecx
jmp    1030 <fexpect@plt>

LLVM IR (-O0):
@.str = [128 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/8l/8cc/refs/heads/master/test/array.c\00"
define void @t7() {
%1 = alloca [9 x i32]
%2 = getelementptr inbounds [9 x i32], [9 x i32]* %1, i64 0, i64 8
store i32 68, i32* %2
%3 = getelementptr inbounds [9 x i32], [9 x i32]* %1, i64 0, i64 8
%4 = load i32, i32* %3
%5 = call i32 @fexpect(i8* getelementptr inbounds ([128 x i8], [128 x i8]* @.str, i64 0, i64 0), i32 58, i32 68, i32 %4)
ret void
}

LLVM IR (-O2):
@.str = [128 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/8l/8cc/refs/heads/master/test/array.c\00"
define void @t7() {
%1 = tail call i32 @fexpect(i8* getelementptr inbounds ([128 x i8], [128 x i8]* @.str, i64 0, i64 0), i32 58, i32 68, i32 68)
ret void
}
int init_signals() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @init_signals() {
ret i32 0
}
/* Type definitions */
struct timeval {
  int tv_sec;
  int tv_usec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
long jm_time() {
  struct timeval tv;
  gettimeofday(&tv, NULL);
  return tv.tv_sec * 1000 + tv.tv_usec / 1000;
}


x86 assembly (clang, -O0):
<jm_time>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x8(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
imul   $0x3e8,-0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x3e8,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
cltq
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<jm_time>:
push   %rax
mov    %rsp,%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
movslq (%rsp),%rax
imul   $0x3e8,%rax,%rcx
movslq 0x4(%rsp),%rax
imul   $0x10624dd3,%rax,%rax
mov    %rax,%rdx
shr    $0x3f,%rdx
sar    $0x26,%rax
add    %edx,%eax
cltq
add    %rcx,%rax
pop    %rcx
ret

LLVM IR (-O0):
%struct.timeval = type { i32, i32 }
define i64 @jm_time() {
%1 = alloca %struct.timeval
%2 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%3 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%4 = load i32, i32* %3
%5 = mul nsw i32 %4, 1000
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%7 = load i32, i32* %6
%8 = sdiv i32 %7, 1000
%9 = add nsw i32 %5, %8
%10 = sext i32 %9 to i64
ret i64 %10
}

LLVM IR (-O2):
%struct.timeval = type { i32, i32 }
define i64 @jm_time() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%5 = load i32, i32* %4
%6 = mul nsw i32 %5, 1000
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%8 = load i32, i32* %7
%9 = sdiv i32 %8, 1000
%10 = add nsw i32 %9, %6
%11 = sext i32 %10 to i64
ret i64 %11
}
/* Type definitions */
struct stat {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
int callback(const char *fpath, const struct stat *sb, int typeflag) {
  printf("%s\n", fpath);
  return 0;
}


x86 assembly (clang, -O0):
<callback>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xed2(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.stat = type { i32 }
@.str = [4 x i8] c"%s\0A\00"
define i32 @callback(i8* %0, %struct.stat* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca %struct.stat*
%6 = alloca i32
store i8* %0, i8** %4
store %struct.stat* %1, %struct.stat** %5
store i32 %2, i32* %6
%7 = load i8*, i8** %4
%8 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %7)
ret i32 0
}

LLVM IR (-O2):
%struct.stat = type { i32 }
@.str = [4 x i8] c"%s\0A\00"
define i32 @callback(i8* %0, %struct.stat* nocapture readnone %1, i32 %2) {
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
ret i32 0
}
/* Variables and functions */
scalar_t__ IsOneOf(char, char *);
int IsString(char *buf) {
  if (IsOneOf(buf[0], "\'\""))
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<IsString>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
lea    0xed9(%rip),%rsi
movsbl (%rax),%edi
call   1030 <IsOneOf@plt>
cmp    $0x0,%rax
je     1145 <IsString+0x35>
movl   $0x1,-0x4(%rbp)
jmp    114c <IsString+0x3c>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<IsString>:
push   %rax
movsbl (%rdi),%edi
lea    0xee5(%rip),%rsi
call   1030 <IsOneOf@plt>
xor    %ecx,%ecx
test   %rax,%rax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"'\22\00"
define i32 @IsString(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = getelementptr inbounds i8, i8* %4, i64 0
%6 = load i8, i8* %5
%7 = call i64 @IsOneOf(i8 signext %6, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%8 = icmp ne i64 %7, 0
br i1 %8, label %9, label %10
9: ; preds = %1
store i32 1, i32* %2
br label %11
10: ; preds = %1
store i32 0, i32* %2
br label %11
11: ; preds = %10, %9
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
@.str = [3 x i8] c"'\22\00"
define i32 @IsString(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = tail call i64 @IsOneOf(i8 signext %2, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%4 = icmp ne i64 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
void intmem_disable(void) {}


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

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

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

LLVM IR (-O2):
define void @intmem_disable() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Eprintf(char *);
int /*<<< orphan*/ SilentWait();
void NormalWait(void) {
  Eprintf("\nPress <Return> to continue ...\n");
  SilentWait();
}


x86 assembly (clang, -O0):
<NormalWait>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1040 <Eprintf@plt>
mov    $0x0,%al
call   1030 <SilentWait@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<NormalWait>:
push   %rax
lea    0xed8(%rip),%rdi
call   1040 <Eprintf@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <SilentWait@plt>

LLVM IR (-O0):
@.str = [33 x i8] c"\0APress <Return> to continue ...\0A\00"
define void @NormalWait() {
%1 = call i32 @Eprintf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (...) @SilentWait()
ret void
}

LLVM IR (-O2):
@.str = [33 x i8] c"\0APress <Return> to continue ...\0A\00"
define void @NormalWait() {
%1 = tail call i32 @Eprintf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (...) @SilentWait()
ret void
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
uint64_t read_64_be(unsigned char bytes[8]) {
  uint64_t result = 0;
  for (int i = 0; i < 8; i++)
    result = (result << 8) | bytes[i];
  return result;
}


x86 assembly (clang, -O0):
<read_64_be>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
cmpl   $0x8,-0x10(%rbp)
jge    1145 <read_64_be+0x45>
mov    -0xc(%rbp),%eax
shl    $0x8,%eax
mov    -0x8(%rbp),%rcx
movslq -0x10(%rbp),%rdx
movzbl (%rcx,%rdx,1),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1116 <read_64_be+0x16>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_64_be>:
mov    0x4(%rdi),%eax
bswap  %eax
ret

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

LLVM IR (-O2):
define i32 @read_64_be(i8* nocapture %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 4
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = getelementptr inbounds i8, i8* %0, i64 5
%6 = load i8, i8* %5
%7 = zext i8 %6 to i32
%8 = shl nuw nsw i32 %4, 16
%9 = shl nuw nsw i32 %7, 8
%10 = or i32 %8, %9
%11 = getelementptr inbounds i8, i8* %0, i64 6
%12 = load i8, i8* %11
%13 = zext i8 %12 to i32
%14 = or i32 %10, %13
%15 = shl nuw i32 %14, 8
%16 = getelementptr inbounds i8, i8* %0, i64 7
%17 = load i8, i8* %16
%18 = zext i8 %17 to i32
%19 = or i32 %15, %18
ret i32 %19
}
/* Variables and functions */
void *realloc(void *, size_t);
void *memrealloc(void *ptr, size_t sz, int flags) { return realloc(ptr, sz); }


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

x86 assembly (clang, -O2):
<memrealloc>:
jmp    1030 <realloc@plt>

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

LLVM IR (-O2):
define noalias i8* @memrealloc(i8* nocapture %0, i64 %1, i32 %2) {
%4 = tail call i8* @realloc(i8* %0, i64 %1)
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, unsigned int);
void asnumber(char i) { printf("%u", (unsigned int)((unsigned char)i)); }


x86 assembly (clang, -O0):
<asnumber>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%esi
lea    0xed7(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<asnumber>:
movzbl %dil,%esi
lea    0xee5(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"%u\00"
define void @asnumber(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %4)
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%u\00"
define void @asnumber(i8 signext %0) {
%2 = zext i8 %0 to i32
%3 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %2)
ret void
}
int cmd_nand_write(char *arg_list[], int n) {
  sw_printf("\nstart run %s...\n\n\r", __func__);
  return 0;
}


x86 assembly (clang, -O0):
<cmd_nand_write>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
lea    0xeda(%rip),%rdi
lea    0xee7(%rip),%rsi
mov    $0x0,%al
call   1030 <sw_printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [20 x i8] c"\0Astart run %s...\0A\0A\0D\00"
@__func__.cmd_nand_write = [15 x i8] c"cmd_nand_write\00"
define i32 @cmd_nand_write(i8** %0, i32 %1) {
%3 = alloca i8**
%4 = alloca i32
store i8** %0, i8*** %3
store i32 %1, i32* %4
%5 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @sw_printf to i32 (i8*, i8*, ...)*)(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @__func__.cmd_nand_write, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [20 x i8] c"\0Astart run %s...\0A\0A\0D\00"
@__func__.cmd_nand_write = [15 x i8] c"cmd_nand_write\00"
define i32 @cmd_nand_write(i8** nocapture readnone %0, i32 %1) {
%3 = tail call i32 (i8*, i8*, ...) bitcast (i32 (...)* @sw_printf to i32 (i8*, i8*, ...)*)(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @__func__.cmd_nand_write, i64 0, i64 0))
ret i32 0
}
int smb1357_get_aicl_result(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @smb1357_get_aicl_result() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void system_free(void *allocator_data, void *data) { free(data); }


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

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

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

LLVM IR (-O2):
define void @system_free(i8* nocapture readnone %0, i8* nocapture %1) {
%3 = tail call i32 @free(i8* %1)
ret void
}
void test82_ArrayReturnErr_targetInit__I() {}


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

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

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

LLVM IR (-O2):
define void @test82_ArrayReturnErr_targetInit__I() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fn4();
void t8() { fn4(); }


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

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

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

LLVM IR (-O2):
define void @t8() {
%1 = tail call i32 (...) @fn4()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ testRand();
void testRandNumber(void) { testRand(); }


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

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

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

LLVM IR (-O2):
define void @testRandNumber() {
%1 = tail call i32 (...) @testRand()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ c;

/* Variables and functions */
int read(int /*<<< orphan*/, unsigned char *, int);
int reset_input() {
  int r;
  unsigned char c;
  if ((r = read(0, &c, sizeof(c))) < 0) {
    return r;
  } else {
    return c;
  }
}


x86 assembly (clang, -O0):
<reset_input>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xor    %edi,%edi
lea    -0x9(%rbp),%rsi
mov    $0x1,%edx
call   1030 <read@plt>
mov    %eax,-0x8(%rbp)
cmp    $0x0,%eax
jge    113f <reset_input+0x2f>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1146 <reset_input+0x36>
movzbl -0x9(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<reset_input>:
push   %rax
lea    0x7(%rsp),%rsi
xor    %edi,%edi
mov    $0x1,%edx
call   1030 <read@plt>
test   %eax,%eax
movzbl 0x7(%rsp),%ecx
cmovns %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @reset_input() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i8
%4 = call i32 @read(i32 0, i8* %3, i32 1)
store i32 %4, i32* %2
%5 = icmp slt i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %0
%7 = load i32, i32* %2
store i32 %7, i32* %1
br label %11
8: ; preds = %0
%9 = load i8, i8* %3
%10 = zext i8 %9 to i32
store i32 %10, i32* %1
br label %11
11: ; preds = %8, %6
%12 = load i32, i32* %1
ret i32 %12
}

LLVM IR (-O2):
define i32 @reset_input() {
%1 = alloca i8
%2 = call i32 @read(i32 0, i8* %1, i32 1)
%3 = icmp slt i32 %2, 0
%4 = load i8, i8* %1
%5 = zext i8 %4 to i32
%6 = select i1 %3, i32 %2, i32 %5
ret i32 %6
}
int fun866() { return 866; }


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

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

LLVM IR (-O0):
define i32 @fun866() {
ret i32 866
}

LLVM IR (-O2):
define i32 @fun866() {
ret i32 866
}
int facility_is_invalid(int facility) {
  return facility < 0 || facility > (23 << 3) || facility % 8 != 0;
}


x86 assembly (clang, -O0):
<facility_is_invalid>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0x1,%al
cmpl   $0x0,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jl     113c <facility_is_invalid+0x3c>
mov    $0x1,%al
cmpl   $0xb8,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jg     113c <facility_is_invalid+0x3c>
mov    -0x4(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
setne  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<facility_is_invalid>:
cmp    $0xb9,%edi
setae  %al
test   $0x7,%dil
setne  %cl
or     %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @facility_is_invalid(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp slt i32 %3, 0
br i1 %4, label %12, label %5
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sgt i32 %6, 184
br i1 %7, label %12, label %8
8: ; preds = %5
%9 = load i32, i32* %2
%10 = srem i32 %9, 8
%11 = icmp ne i32 %10, 0
br label %12
12: ; preds = %8, %5, %1
%13 = phi i1 [ true, %5 ], [ true, %1 ], [ %11, %8 ]
%14 = zext i1 %13 to i32
ret i32 %14
}

LLVM IR (-O2):
define i32 @facility_is_invalid(i32 %0) {
%2 = icmp ugt i32 %0, 184
%3 = and i32 %0, 7
%4 = icmp ne i32 %3, 0
%5 = or i1 %2, %4
%6 = zext i1 %5 to i32
ret i32 %6
}
int lsh_exit(char **args) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @lsh_exit(i8** nocapture readnone %0) {
ret i32 0
}
float conv_ui2_to_norm_float(unsigned ui2) { return ui2 / 3.0f; }


x86 assembly (clang, -O0):
<conv_ui2_to_norm_float>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
cvtsi2ss %rax,%xmm0
movss  0xee9(%rip),%xmm1
divss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<conv_ui2_to_norm_float>:
mov    %edi,%eax
cvtsi2ss %rax,%xmm0
divss  0xef1(%rip),%xmm0
ret

LLVM IR (-O0):
define float @conv_ui2_to_norm_float(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = uitofp i32 %3 to float
%5 = fdiv float %4, 3.000000e+00
ret float %5
}

LLVM IR (-O2):
define float @conv_ui2_to_norm_float(i32 %0) {
%2 = uitofp i32 %0 to float
%3 = fdiv float %2, 3.000000e+00
ret float %3
}
/* Variables and functions */
size_t align_to_word_boundary(size_t n) {
  return (n & (sizeof(void *) - 1)) == 0
             ? n
             : (n + sizeof(void *)) & ~(sizeof(void *) - 1);
}


x86 assembly (clang, -O0):
<align_to_word_boundary>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
and    $0x7,%rax
cmp    $0x0,%rax
jne    1127 <align_to_word_boundary+0x27>
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
jmp    1137 <align_to_word_boundary+0x37>
mov    -0x8(%rbp),%rax
add    $0x8,%rax
and    $0xfffffffffffffff8,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<align_to_word_boundary>:
lea    0x8(%rdi),%rax
and    $0xfffffffffffffff8,%rax
test   $0x7,%dil
cmove  %rdi,%rax
ret

LLVM IR (-O0):
define i64 @align_to_word_boundary(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = and i64 %3, 7
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = load i64, i64* %2
br label %12
8: ; preds = %1
%9 = load i64, i64* %2
%10 = add i64 %9, 8
%11 = and i64 %10, -8
br label %12
12: ; preds = %8, %6
%13 = phi i64 [ %7, %6 ], [ %11, %8 ]
ret i64 %13
}

LLVM IR (-O2):
define i64 @align_to_word_boundary(i64 %0) {
%2 = and i64 %0, 7
%3 = icmp eq i64 %2, 0
%4 = add i64 %0, 8
%5 = and i64 %4, -8
%6 = select i1 %3, i64 %0, i64 %5
ret i64 %6
}
unsigned int ECAPIntStatus(unsigned int baseAdd, unsigned int flag) {
  return ((*((volatile unsigned short *)(baseAdd + (0x2E)))) & flag);
}


x86 assembly (clang, -O0):
<ECAPIntStatus>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    $0x2e,%eax
mov    %eax,%eax
mov    (%rax),%ax
movzwl %ax,%eax
and    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ECAPIntStatus>:
add    $0x2e,%edi
movzwl (%rdi),%eax
and    %esi,%eax
ret

LLVM IR (-O0):
define i32 @ECAPIntStatus(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 = add i32 %5, 46
%7 = zext i32 %6 to i64
%8 = inttoptr i64 %7 to i16*
%9 = load volatile i16, i16* %8
%10 = zext i16 %9 to i32
%11 = load i32, i32* %4
%12 = and i32 %10, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @ECAPIntStatus(i32 %0, i32 %1) {
%3 = add i32 %0, 46
%4 = zext i32 %3 to i64
%5 = inttoptr i64 %4 to i16*
%6 = load volatile i16, i16* %5
%7 = zext i16 %6 to i32
%8 = and i32 %7, %1
ret i32 %8
}
/* Type definitions */
struct in_addr {
  int dummy;
};

/* Variables and functions */
int memcmp(struct in_addr const *, struct in_addr const *, int);
int ipv4_addr_cmp(const struct in_addr *a1, const struct in_addr *a2) {
  return memcmp(a1, a2, sizeof(struct in_addr));
}


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

x86 assembly (clang, -O2):
<ipv4_addr_cmp>:
mov    $0x4,%edx
jmp    1030 <memcmp@plt>

LLVM IR (-O0):
%struct.in_addr = type { i32 }
define i32 @ipv4_addr_cmp(%struct.in_addr* %0, %struct.in_addr* %1) {
%3 = alloca %struct.in_addr*
%4 = alloca %struct.in_addr*
store %struct.in_addr* %0, %struct.in_addr** %3
store %struct.in_addr* %1, %struct.in_addr** %4
%5 = load %struct.in_addr*, %struct.in_addr** %3
%6 = load %struct.in_addr*, %struct.in_addr** %4
%7 = call i32 @memcmp(%struct.in_addr* %5, %struct.in_addr* %6, i32 4)
ret i32 %7
}

LLVM IR (-O2):
%struct.in_addr = type { i32 }
define i32 @ipv4_addr_cmp(%struct.in_addr* %0, %struct.in_addr* %1) {
%3 = tail call i32 @memcmp(%struct.in_addr* %0, %struct.in_addr* %1, i32 4)
ret i32 %3
}
int test_imm_B7int8_mem(signed char *val) {
  return ((*val) & (-0xB7 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_B7int8_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%edx
and    $0xffffff49,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_B7int8_mem>:
movsbl (%rdi),%eax
test   $0xffffff49,%eax
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_B7int8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = sext i8 %2 to i32
%4 = and i32 %3, -183
%5 = icmp eq i32 %4, 0
%6 = select i1 %5, i32 -40, i32 -20
ret i32 %6
}
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ s291_compute_cs(int /*<<< orphan*/ *);
int s291_get_dc(int /*<<< orphan*/ *);
void s291_set_cs(uint16_t *p_s291) {
  p_s291[6 + s291_get_dc(p_s291)] = s291_compute_cs(p_s291);
}


x86 assembly (clang, -O0):
<s291_set_cs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <s291_compute_cs@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <s291_get_dc@plt>
mov    -0x14(%rbp),%edx
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
add    $0x6,%ecx
movslq %ecx,%rcx
mov    %edx,(%rax,%rcx,4)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<s291_set_cs>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1030 <s291_compute_cs@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1040 <s291_get_dc@plt>
cltq
mov    %ebp,0x18(%rbx,%rax,4)
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define void @s291_set_cs(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @s291_compute_cs(i32* %3)
%5 = load i32*, i32** %2
%6 = load i32*, i32** %2
%7 = call i32 @s291_get_dc(i32* %6)
%8 = add nsw i32 6, %7
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds i32, i32* %5, i64 %9
store i32 %4, i32* %10
ret void
}

LLVM IR (-O2):
define void @s291_set_cs(i32* %0) {
%2 = tail call i32 @s291_compute_cs(i32* %0)
%3 = tail call i32 @s291_get_dc(i32* %0)
%4 = add nsw i32 %3, 6
%5 = sext i32 %4 to i64
%6 = getelementptr inbounds i32, i32* %0, i64 %5
store i32 %2, i32* %6
ret void
}
/* Variables and functions */
int /*<<< orphan*/ config_cmd(unsigned char, unsigned int, unsigned int);
unsigned char inb(int);
int /*<<< orphan*/ outl(int /*<<< orphan*/, int);
unsigned char pcibios_read_config_byte(unsigned char bus, unsigned devfn,
                                       unsigned where) {
  outl(config_cmd(bus, devfn, where), 0xCF8);
  return inb(0xCFC + (where & 3));
}


x86 assembly (clang, -O0):
<pcibios_read_config_byte>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x1(%rbp),%al
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
movzbl %al,%edi
call   1050 <config_cmd@plt>
mov    %eax,%edi
mov    $0xcf8,%esi
call   1030 <outl@plt>
mov    -0xc(%rbp),%edi
and    $0x3,%edi
add    $0xcfc,%edi
call   1040 <inb@plt>
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pcibios_read_config_byte>:
push   %rbx
mov    %edx,%ebx
call   1050 <config_cmd@plt>
mov    %eax,%edi
mov    $0xcf8,%esi
call   1030 <outl@plt>
or     $0xcfc,%ebx
and    $0xcff,%ebx
mov    %ebx,%edi
pop    %rbx
jmp    1040 <inb@plt>

LLVM IR (-O0):
define zeroext i8 @pcibios_read_config_byte(i8 zeroext %0, i32 %1, i32 %2) {
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
store i8 %0, i8* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i8, i8* %4
%8 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = call i32 @config_cmd(i8 zeroext %7, i32 %8, i32 %9)
%11 = call i32 @outl(i32 %10, i32 3320)
%12 = load i32, i32* %6
%13 = and i32 %12, 3
%14 = add i32 3324, %13
%15 = call zeroext i8 @inb(i32 %14)
ret i8 %15
}

LLVM IR (-O2):
define zeroext i8 @pcibios_read_config_byte(i8 zeroext %0, i32 %1, i32 %2) {
%4 = tail call i32 @config_cmd(i8 zeroext %0, i32 %1, i32 %2)
%5 = tail call i32 @outl(i32 %4, i32 3320)
%6 = and i32 %2, 3
%7 = or i32 %6, 3324
%8 = tail call zeroext i8 @inb(i32 %7)
ret i8 %8
}
int find_device_by_sysfs(struct device *dev) {
  int rc = -1;
  return rc;
}


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

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

LLVM IR (-O0):
%struct.device = type opaque
define i32 @find_device_by_sysfs(%struct.device* %0) {
%2 = alloca %struct.device*
%3 = alloca i32
store %struct.device* %0, %struct.device** %2
store i32 -1, i32* %3
%4 = load i32, i32* %3
ret i32 %4
}

LLVM IR (-O2):
%struct.device = type opaque
define i32 @find_device_by_sysfs(%struct.device* nocapture readnone %0) {
ret i32 -1
}
/* Type definitions */
struct Var {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ pA(char *, char const *, char const *, char const *);
void __func_xor_sint(struct Var *avar, const char *areg, const char *lreg,
                     const char *rreg) {
  pA("%s = %s ^ %s;", areg, lreg, rreg);
}


x86 assembly (clang, -O0):
<__func_xor_sint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
lea    0xec5(%rip),%rdi
call   1030 <pA@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.Var = type { i32 }
@.str = [14 x i8] c"%s = %s ^ %s;\00"
define void @__func_xor_sint(%struct.Var* %0, i8* %1, i8* %2, i8* %3) {
%5 = alloca %struct.Var*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
store %struct.Var* %0, %struct.Var** %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store i8* %3, i8** %8
%9 = load i8*, i8** %6
%10 = load i8*, i8** %7
%11 = load i8*, i8** %8
%12 = call i32 @pA(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* %9, i8* %10, i8* %11)
ret void
}

LLVM IR (-O2):
%struct.Var = type { i32 }
@.str = [14 x i8] c"%s = %s ^ %s;\00"
define void @__func_xor_sint(%struct.Var* nocapture readnone %0, i8* %1, i8* %2, i8* %3) {
%5 = tail call i32 @pA(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* %1, i8* %2, i8* %3)
ret void
}
/* Variables and functions */
int _ada_use_c2phc(int, int *, int *, double *, int /*<<< orphan*/);
int set_value_of_continuation_parameter(int k, double *val) {
  int *b, fail;
  fail = _ada_use_c2phc(190, &k, b, val, 0);
  return fail;
}


x86 assembly (clang, -O0):
<set_value_of_continuation_parameter>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x18(%rbp),%rdx
mov    -0x10(%rbp),%rcx
mov    $0xbe,%edi
lea    -0x4(%rbp),%rsi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_value_of_continuation_parameter>:
push   %rax
mov    %rsi,%rcx
mov    %edi,0x4(%rsp)
lea    0x4(%rsp),%rsi
mov    $0xbe,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc@plt>
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @set_value_of_continuation_parameter(i32 %0, double* %1) {
%3 = alloca i32
store i32 %0, i32* %3
%4 = call i32 @_ada_use_c2phc(i32 190, i32* %3, i32* undef, double* %1, i32 0)
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ buf;

/* Variables and functions */
int /*<<< orphan*/ download_rx_port(unsigned char *, int);
int read_serial_port(unsigned char *, int);
void handle_port_input() {
  unsigned char buf[256];
  int num;
  num = read_serial_port(buf, sizeof(buf));
  if (num > 0) {
    download_rx_port(buf, num);
  }
}


x86 assembly (clang, -O0):
<handle_port_input>:
push   %rbp
mov    %rsp,%rbp
sub    $0x110,%rsp
lea    -0x100(%rbp),%rdi
mov    $0x100,%esi
call   1030 <read_serial_port@plt>
mov    %eax,-0x104(%rbp)
cmpl   $0x0,-0x104(%rbp)
jle    1161 <handle_port_input+0x41>
lea    -0x100(%rbp),%rdi
mov    -0x104(%rbp),%esi
call   1040 <download_rx_port@plt>
add    $0x110,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<handle_port_input>:
sub    $0x108,%rsp
mov    %rsp,%rdi
mov    $0x100,%esi
call   1030 <read_serial_port@plt>
test   %eax,%eax
jle    1142 <handle_port_input+0x22>
mov    %rsp,%rdi
mov    %eax,%esi
call   1040 <download_rx_port@plt>
add    $0x108,%rsp
ret

LLVM IR (-O0):
define void @handle_port_input() {
%1 = alloca [256 x i8]
%2 = alloca i32
%3 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%4 = call i32 @read_serial_port(i8* %3, i32 256)
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = icmp sgt i32 %5, 0
br i1 %6, label %7, label %11
7: ; preds = %0
%8 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%9 = load i32, i32* %2
%10 = call i32 @download_rx_port(i8* %8, i32 %9)
br label %11
11: ; preds = %7, %0
ret void
}

LLVM IR (-O2):
define void @handle_port_input() {
%1 = alloca [256 x i8]
%2 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%3 = call i32 @read_serial_port(i8* %2, i32 256)
%4 = icmp sgt i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %0
%6 = call i32 @download_rx_port(i8* %2, i32 %3)
br label %7
7: ; preds = %5, %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ c(char *);
int /*<<< orphan*/ mark_forward();
void If() {
  c("?branch");
  mark_forward();
}


x86 assembly (clang, -O0):
<If>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <c@plt>
mov    $0x0,%al
call   1040 <mark_forward@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<If>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <c@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <mark_forward@plt>

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

LLVM IR (-O2):
@.str = [8 x i8] c"?branch\00"
define void @If() {
%1 = tail call i32 @c(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (...) @mark_forward()
ret void
}
Init(s, n) int s, n;
{
  int discctr;
  Makenull(s);
  for (discctr = n; discctr >= 1; discctr--)
    Push(discctr, s);
}


x86 assembly (clang, -O0):
<Init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%edi
mov    $0x0,%al
call   1030 <Makenull@plt>
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
cmpl   $0x1,-0x10(%rbp)
jl     1163 <Init+0x43>
mov    -0x10(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    $0x0,%al
call   1040 <Push@plt>
mov    -0x10(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x10(%rbp)
jmp    113e <Init+0x1e>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Init>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
xor    %eax,%eax
call   1030 <Makenull@plt>
test   %ebx,%ebx
jle    1155 <Init+0x35>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %ebx,%edi
mov    %ebp,%esi
xor    %eax,%eax
call   1040 <Push@plt>
lea    -0x1(%rbx),%eax
cmp    $0x1,%ebx
mov    %eax,%ebx
ja     1140 <Init+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @Init(i32 %0, i32 %1) {
%3 = tail call i32 (i32, ...) bitcast (i32 (...)* @Makenull to i32 (i32, ...)*)(i32 %0)
%4 = icmp sgt i32 %1, 0
br i1 %4, label %5, label %10
5: ; preds = %2, %5
%6 = phi i32 [ %8, %5 ], [ %1, %2 ]
%7 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @Push to i32 (i32, i32, ...)*)(i32 %6, i32 %0)
%8 = add nsw i32 %6, -1
%9 = icmp ugt i32 %6, 1
br i1 %9, label %5, label %10
10: ; preds = %5, %2
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, char const *);
void diaf(const char *msg) {
  printf("%s", msg);
  exit(1);
}


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

x86 assembly (clang, -O2):
<diaf>:
push   %rax
mov    %rdi,%rsi
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define void @diaf(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @exit(i32 1)
unreachable
}
int macosx_ibook_fnswitch(__attribute__((unused)) int setting) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @macosx_ibook_fnswitch(i32 %0) {
ret i32 0
}
__attribute__((__target__("sse4.2,popcnt"))) void
__sanitizer_cov_trace_cmpd(double Arg1 __attribute__((unused)),
                           double Arg2 __attribute__((unused))) {}


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

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

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

LLVM IR (-O2):
define void @__sanitizer_cov_trace_cmpd(double %0, double %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ O_WRONLY;
int /*<<< orphan*/ close(int);
int open(char const *, int /*<<< orphan*/);
int check_writable(const char *fname) {
  int fd;
  fd = open(fname, O_WRONLY);
  if (fd >= 0)
    close(fd);
  return fd >= 0;
}


x86 assembly (clang, -O0):
<check_writable>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2ea1(%rip),%rax
mov    (%rax),%esi
call   1040 <open@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jl     1153 <check_writable+0x33>
mov    -0xc(%rbp),%edi
call   1030 <close@plt>
cmpl   $0x0,-0xc(%rbp)
setge  %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_writable>:
push   %rbx
mov    0x2eb0(%rip),%rax
mov    (%rax),%esi
call   1040 <open@plt>
mov    %eax,%ebx
test   %eax,%eax
js     113c <check_writable+0x1c>
mov    %ebx,%edi
call   1030 <close@plt>
not    %ebx
shr    $0x1f,%ebx
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@O_WRONLY = global i32 0
define i32 @check_writable(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = load i32, i32* @O_WRONLY
%6 = call i32 @open(i8* %4, i32 %5)
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = icmp sge i32 %7, 0
br i1 %8, label %9, label %12
9: ; preds = %1
%10 = load i32, i32* %3
%11 = call i32 @close(i32 %10)
br label %12
12: ; preds = %9, %1
%13 = load i32, i32* %3
%14 = icmp sge i32 %13, 0
%15 = zext i1 %14 to i32
ret i32 %15
}

LLVM IR (-O2):
@O_WRONLY = global i32 0
define i32 @check_writable(i8* nocapture %0) {
%2 = load i32, i32* @O_WRONLY
%3 = tail call i32 @open(i8* %0, i32 %2)
%4 = icmp sgt i32 %3, -1
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = tail call i32 @close(i32 %3)
br label %7
7: ; preds = %5, %1
%8 = xor i32 %3, -1
%9 = lshr i32 %8, 31
ret i32 %9
}
/* Variables and functions */
scalar_t__ strcmp(char const *, char const *);
size_t strlen(char const *);
int hasExtension(char const *name, char const *ext) {
  size_t lenN = strlen(name);
  size_t lenE = strlen(ext);
  return lenN > lenE && strcmp(name + lenN - lenE, ext) == 0;
}


x86 assembly (clang, -O0):
<hasExtension>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rcx
xor    %eax,%eax
cmp    -0x20(%rbp),%rcx
mov    %al,-0x21(%rbp)
jbe    1181 <hasExtension+0x61>
mov    -0x8(%rbp),%rdi
add    -0x18(%rbp),%rdi
xor    %eax,%eax
sub    -0x20(%rbp),%rax
add    %rax,%rdi
mov    -0x10(%rbp),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
sete   %al
mov    %al,-0x21(%rbp)
mov    -0x21(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hasExtension>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <strlen@plt>
mov    %rax,%r15
mov    %r14,%rdi
call   1030 <strlen@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rcx,%r15
jbe    1161 <hasExtension+0x41>
add    %r15,%rbx
sub    %rcx,%rbx
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <strcmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
sete   %al
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i32 @hasExtension(i8* %0, i8* %1) {
%3 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%4 = tail call i64 @strlen(i8* dereferenceable(1) %1)
%5 = icmp ugt i64 %3, %4
br i1 %5, label %6, label %13
6: ; preds = %2
%7 = getelementptr inbounds i8, i8* %0, i64 %3
%8 = sub i64 0, %4
%9 = getelementptr inbounds i8, i8* %7, i64 %8
%10 = tail call i64 @strcmp(i8* %9, i8* %1)
%11 = icmp eq i64 %10, 0
%12 = zext i1 %11 to i32
br label %13
13: ; preds = %6, %2
%14 = phi i32 [ 0, %2 ], [ %12, %6 ]
ret i32 %14
}
void nav_read(void) {}


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

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

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

LLVM IR (-O2):
define void @nav_read() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ disableARMInterrupts();
void os_disableInterrupts() { disableARMInterrupts(); }


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

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

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

LLVM IR (-O2):
define void @os_disableInterrupts() {
%1 = tail call i32 (...) @disableARMInterrupts()
ret void
}