xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ DPRINT();
int /*<<< orphan*/ printf(char *, char const *);
void syslog(int prio, const char *format, ...) {
  DPRINT();
  printf("qpid:>> %s\n", format);
}


x86 assembly (clang, -O0):
<syslog>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %eax,%eax
call   1030 <DPRINT@plt>
mov    -0x10(%rbp),%rsi
lea    0xebf(%rip),%rdi
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<syslog>:
push   %rbx
mov    %rsi,%rbx
xor    %eax,%eax
call   1030 <DPRINT@plt>
lea    0xece(%rip),%rdi
mov    %rbx,%rsi
pop    %rbx
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"qpid:>> %s\0A\00"
define void @syslog(i32 %0, i8* %1, ...) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = call i32 (...) @DPRINT()
%6 = load i8*, i8** %4
%7 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %6)
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"qpid:>> %s\0A\00"
define void @syslog(i32 %0, i8* %1, ...) {
%3 = tail call i32 (...) @DPRINT()
%4 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %1)
ret void
}
/* Variables and functions */
int puts(char const *);
int c_puts(const char *arg0) { return puts(arg0); }


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

x86 assembly (clang, -O2):
<c_puts>:
jmp    1030 <puts@plt>

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

LLVM IR (-O2):
define i32 @c_puts(i8* nocapture %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void printMainMenu() {
  printf("\nNew Game (1)\n");
  printf("Settings (2)\n");
  printf("Help (3)\n");
  printf("Exit (0)\n");
}


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

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

LLVM IR (-O0):
@.str = [15 x i8] c"\0ANew Game (1)\0A\00"
@.str.1 = [14 x i8] c"Settings (2)\0A\00"
@.str.2 = [10 x i8] c"Help (3)\0A\00"
@.str.3 = [10 x i8] c"Exit (0)\0A\00"
define void @printMainMenu() {
%1 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [14 x i8] c"\0ANew Game (1)\00"
@str.4 = [13 x i8] c"Settings (2)\00"
@str.5 = [9 x i8] c"Help (3)\00"
@str.6 = [9 x i8] c"Exit (0)\00"
define void @printMainMenu() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str.4, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str.5, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str.6, i64 0, i64 0))
ret void
}
/* Variables and functions */
int syscall(int, int /*<<< orphan*/, int /*<<< orphan*/);
int mutex_creat() { return syscall(15, 0, 0); }


x86 assembly (clang, -O0):
<mutex_creat>:
push   %rbp
mov    %rsp,%rbp
mov    $0xf,%edi
xor    %edx,%edx
mov    %edx,%esi
call   1030 <syscall@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<mutex_creat>:
mov    $0xf,%edi
xor    %esi,%esi
xor    %edx,%edx
jmp    1030 <syscall@plt>

LLVM IR (-O0):
define i32 @mutex_creat() {
%1 = call i32 @syscall(i32 15, i32 0, i32 0)
ret i32 %1
}

LLVM IR (-O2):
define i32 @mutex_creat() {
%1 = tail call i32 @syscall(i32 15, i32 0, i32 0)
ret i32 %1
}
/* Type definitions */
struct search_range {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ primes_loop(struct search_range *);
void *primes_thread(void *ctx) {
  struct search_range *range;
  range = (struct search_range *)ctx;
  primes_loop(range);
  return NULL;
}


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

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

LLVM IR (-O0):
%struct.search_range = type { i32 }
define i8* @primes_thread(i8* %0) {
%2 = alloca i8*
%3 = alloca %struct.search_range*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = bitcast i8* %4 to %struct.search_range*
store %struct.search_range* %5, %struct.search_range** %3
%6 = load %struct.search_range*, %struct.search_range** %3
%7 = call i32 @primes_loop(%struct.search_range* %6)
ret i8* null
}

LLVM IR (-O2):
%struct.search_range = type { i32 }
define noalias i8* @primes_thread(i8* %0) {
%2 = bitcast i8* %0 to %struct.search_range*
%3 = tail call i32 @primes_loop(%struct.search_range* %2)
ret i8* null
}
/* Variables and functions */
int /*<<< orphan*/ RTLD_LAZY;
int /*<<< orphan*/ dlclose(void *);
void *dlopen(char *, int /*<<< orphan*/);
scalar_t__ dlsym(void *, char *);
int /*<<< orphan*/ printf(char *, int);
int stub1(int);
int stub2(int);
void test(void) {
  void *dl = dlopen("./Test.so", RTLD_LAZY);
  printf("%d\n", ((int (*)(int))dlsym(dl, "hsfun"))(5));
  dlclose(dl);
}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2e91(%rip),%rax
mov    (%rax),%esi
lea    0xea8(%rip),%rdi
call   1040 <dlopen@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xea2(%rip),%rsi
call   1050 <dlsym@plt>
mov    $0x5,%edi
call   *%rax
mov    %eax,%esi
lea    0xe89(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rdi
call   1060 <dlclose@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test>:
push   %rbx
mov    0x2e98(%rip),%rax
mov    (%rax),%esi
lea    0xeaf(%rip),%rdi
call   1040 <dlopen@plt>
mov    %rax,%rbx
lea    0xeae(%rip),%rsi
mov    %rax,%rdi
call   1050 <dlsym@plt>
mov    $0x5,%edi
call   *%rax
lea    0xe94(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1060 <dlclose@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"./Test.so\00"
@RTLD_LAZY = global i32 0
@.str.1 = [4 x i8] c"%d\0A\00"
@.str.2 = [6 x i8] c"hsfun\00"
define void @test() {
%1 = alloca i8*
%2 = load i32, i32* @RTLD_LAZY
%3 = call i8* @dlopen(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %2)
store i8* %3, i8** %1
%4 = load i8*, i8** %1
%5 = call i64 @dlsym(i8* %4, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
%6 = inttoptr i64 %5 to i32 (i32)*
%7 = call i32 %6(i32 5)
%8 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %7)
%9 = load i8*, i8** %1
%10 = call i32 @dlclose(i8* %9)
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"./Test.so\00"
@RTLD_LAZY = global i32 0
@.str.1 = [4 x i8] c"%d\0A\00"
@.str.2 = [6 x i8] c"hsfun\00"
define void @test() {
%1 = load i32, i32* @RTLD_LAZY
%2 = tail call i8* @dlopen(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i64 @dlsym(i8* %2, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
%4 = inttoptr i64 %3 to i32 (i32)*
%5 = tail call i32 %4(i32 5)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %5)
%7 = tail call i32 @dlclose(i8* %2)
ret void
}
/* Variables and functions */
char *five_morsecode();
scalar_t__ strcmp(char const *, char *);
char *test_five_morsecode() {
  const char *out = five_morsecode();
  do {
    if (strcmp(out, "di-di-di-di-dit"))
      return "error, five_morsecode != di-di-di-di-dit";
  } while (0);
  return 0;
}


x86 assembly (clang, -O0):
<test_five_morsecode>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <five_morsecode@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xedb(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
je     115d <test_five_morsecode+0x3d>
lea    0xeac(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    116a <test_five_morsecode+0x4a>
jmp    1162 <test_five_morsecode+0x42>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_five_morsecode>:
push   %rax
xor    %eax,%eax
call   1030 <five_morsecode@plt>
lea    0xeea(%rip),%rsi
mov    %rax,%rdi
call   1040 <strcmp@plt>
test   %rax,%rax
lea    0xebf(%rip),%rcx
cmovne %rcx,%rax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [16 x i8] c"di-di-di-di-dit\00"
@.str.1 = [41 x i8] c"error, five_morsecode != di-di-di-di-dit\00"
define i8* @test_five_morsecode() {
%1 = alloca i8*
%2 = alloca i8*
%3 = call i8* (...) @five_morsecode()
store i8* %3, i8** %2
br label %4
4: ; preds = %0
%5 = load i8*, i8** %2
%6 = call i64 @strcmp(i8* %5, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%7 = icmp ne i64 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %4
store i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.1, i64 0, i64 0), i8** %1
br label %11
9: ; preds = %4
br label %10
10: ; preds = %9
store i8* null, i8** %1
br label %11
11: ; preds = %10, %8
%12 = load i8*, i8** %1
ret i8* %12
}

LLVM IR (-O2):
@.str = [16 x i8] c"di-di-di-di-dit\00"
@.str.1 = [41 x i8] c"error, five_morsecode != di-di-di-di-dit\00"
define i8* @test_five_morsecode() {
%1 = tail call i8* (...) @five_morsecode()
%2 = tail call i64 @strcmp(i8* %1, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i8* null, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.1, i64 0, i64 0)
ret i8* %4
}
/* Variables and functions */
char *malloc(scalar_t__);
int /*<<< orphan*/ sprintf(char *, char *, int const, char const *);
scalar_t__ strlen(char const *);
char *strcolor(const char *str, const int color) {
  char *tmp = malloc(strlen(str) + 15);
  sprintf(tmp, "\x1b[%dm%s\x1b[0m", color, str);
  return tmp;
}


x86 assembly (clang, -O0):
<strcolor>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,%rdi
add    $0xf,%rdi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0xc(%rbp),%edx
mov    -0x8(%rbp),%rcx
lea    0xe96(%rip),%rsi
call   1050 <sprintf@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcolor>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%r14d
mov    %rdi,%rbx
call   1030 <strlen@plt>
lea    0xf(%rax),%rdi
call   1040 <malloc@plt>
mov    %rax,%rbp
lea    0xeae(%rip),%rsi
mov    %rax,%rdi
mov    %r14d,%edx
mov    %rbx,%rcx
call   1050 <sprintf@plt>
mov    %rbp,%rax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [12 x i8] c"\1B[%dm%s\1B[0m\00"
define i8* @strcolor(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i8*
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i8*, i8** %3
%7 = call i64 @strlen(i8* %6)
%8 = add nsw i64 %7, 15
%9 = call i8* @malloc(i64 %8)
store i8* %9, i8** %5
%10 = load i8*, i8** %5
%11 = load i32, i32* %4
%12 = load i8*, i8** %3
%13 = call i32 @sprintf(i8* %10, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %11, i8* %12)
%14 = load i8*, i8** %5
ret i8* %14
}

LLVM IR (-O2):
@.str = [12 x i8] c"\1B[%dm%s\1B[0m\00"
define noalias i8* @strcolor(i8* %0, i32 %1) {
%3 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%4 = add nsw i64 %3, 15
%5 = tail call i8* @malloc(i64 %4)
%6 = tail call i32 @sprintf(i8* dereferenceable(1) %5, i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %1, i8* %0)
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void __attribute__((no)) montreal(int a, char *b, char c) {
  printf(".");
  return;
}


x86 assembly (clang, -O0):
<montreal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %dl,%al
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %al,-0x11(%rbp)
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @montreal(i32 %0, i8* nocapture readnone %1, i8 signext %2) {
%4 = tail call i32 @putchar(i32 46)
ret void
}
void XSyncGetPriority() {}


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

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

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

LLVM IR (-O2):
define void @XSyncGetPriority() {
ret void
}
int sum(int i) {
  if (i == 1)
    return 1;
  else
    return sum(i - 1) + i;
}


x86 assembly (clang, -O0):
<sum>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
jne    1131 <sum+0x21>
movl   $0x1,-0x4(%rbp)
jmp    1142 <sum+0x32>
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
call   1030 <sum@plt>
add    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sum>:
mov    $0x1,%eax
cmp    $0x1,%edi
je     1124 <sum+0x24>
lea    -0x1(%rdi),%eax
lea    -0x2(%rdi),%ecx
imul   %ecx,%eax
lea    -0x3(%rdi),%edx
imul   %rcx,%rdx
shr    %rdx
add    %edi,%eax
sub    %edx,%eax
add    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @sum(i32 %0) {
%2 = icmp eq i32 %0, 1
br i1 %2, label %16, label %3
3: ; preds = %1
%4 = add i32 %0, -1
%5 = add i32 %0, -2
%6 = mul i32 %4, %5
%7 = zext i32 %5 to i33
%8 = add i32 %0, -3
%9 = zext i32 %8 to i33
%10 = mul i33 %7, %9
%11 = lshr i33 %10, 1
%12 = trunc i33 %11 to i32
%13 = add i32 %6, %0
%14 = sub i32 %13, %12
%15 = add i32 %14, 1
br label %16
16: ; preds = %3, %1
%17 = phi i32 [ 1, %1 ], [ %15, %3 ]
ret i32 %17
}
/* Variables and functions */
int /*<<< orphan*/ STDOUT_FILENO;
int write(int /*<<< orphan*/, char const *, int);
int write_bytes(const void *buffer, int size) {
  const char *p = (const char *)buffer;
  if (p == NULL) {
    return -1;
  }
  int wrote = write(STDOUT_FILENO, p, size);
  return wrote;
}


x86 assembly (clang, -O0):
<write_bytes>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    113e <write_bytes+0x2e>
movl   $0xffffffff,-0x4(%rbp)
jmp    115c <write_bytes+0x4c>
mov    0x2eab(%rip),%rax
mov    (%rax),%edi
mov    -0x20(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <write@plt>
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_bytes>:
test   %rdi,%rdi
je     1128 <write_bytes+0x18>
mov    %esi,%edx
mov    %rdi,%rsi
mov    0x2ecf(%rip),%rax
mov    (%rax),%edi
jmp    1030 <write@plt>
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
@STDOUT_FILENO = global i32 0
define i32 @write_bytes(i8* %0, i32 %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
%8 = load i8*, i8** %4
store i8* %8, i8** %6
%9 = load i8*, i8** %6
%10 = icmp eq i8* %9, null
br i1 %10, label %11, label %12
11: ; preds = %2
store i32 -1, i32* %3
br label %18
12: ; preds = %2
%13 = load i32, i32* @STDOUT_FILENO
%14 = load i8*, i8** %6
%15 = load i32, i32* %5
%16 = call i32 @write(i32 %13, i8* %14, i32 %15)
store i32 %16, i32* %7
%17 = load i32, i32* %7
store i32 %17, i32* %3
br label %18
18: ; preds = %12, %11
%19 = load i32, i32* %3
ret i32 %19
}

LLVM IR (-O2):
@STDOUT_FILENO = global i32 0
define i32 @write_bytes(i8* %0, i32 %1) {
%3 = icmp eq i8* %0, null
br i1 %3, label %7, label %4
4: ; preds = %2
%5 = load i32, i32* @STDOUT_FILENO
%6 = tail call i32 @write(i32 %5, i8* %0, i32 %1)
br label %7
7: ; preds = %2, %4
%8 = phi i32 [ %6, %4 ], [ -1, %2 ]
ret i32 %8
}
int bdd_restore_int(unsigned char *b) {
  return (b[0] << 24) | (b[1] << 16) | (b[2] << 8) | b[3];
}


x86 assembly (clang, -O0):
<bdd_restore_int>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
shl    $0x18,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x1(%rcx),%ecx
shl    $0x10,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x2(%rcx),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x3(%rcx),%ecx
or     %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @bdd_restore_int(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 0
%5 = load i8, i8* %4
%6 = zext i8 %5 to i32
%7 = shl i32 %6, 24
%8 = load i8*, i8** %2
%9 = getelementptr inbounds i8, i8* %8, i64 1
%10 = load i8, i8* %9
%11 = zext i8 %10 to i32
%12 = shl i32 %11, 16
%13 = or i32 %7, %12
%14 = load i8*, i8** %2
%15 = getelementptr inbounds i8, i8* %14, i64 2
%16 = load i8, i8* %15
%17 = zext i8 %16 to i32
%18 = shl i32 %17, 8
%19 = or i32 %13, %18
%20 = load i8*, i8** %2
%21 = getelementptr inbounds i8, i8* %20, i64 3
%22 = load i8, i8* %21
%23 = zext i8 %22 to i32
%24 = or i32 %19, %23
ret i32 %24
}

LLVM IR (-O2):
define i32 @bdd_restore_int(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = zext i8 %2 to i32
%4 = shl nuw i32 %3, 24
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = load i8, i8* %5
%7 = zext i8 %6 to i32
%8 = shl nuw nsw i32 %7, 16
%9 = or i32 %8, %4
%10 = getelementptr inbounds i8, i8* %0, i64 2
%11 = load i8, i8* %10
%12 = zext i8 %11 to i32
%13 = shl nuw nsw i32 %12, 8
%14 = or i32 %9, %13
%15 = getelementptr inbounds i8, i8* %0, i64 3
%16 = load i8, i8* %15
%17 = zext i8 %16 to i32
%18 = or i32 %14, %17
ret i32 %18
}
void RTMsgErrorRc(void) {}


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

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

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

LLVM IR (-O2):
define void @RTMsgErrorRc() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ FlightBatteryStateHandle();
int /*<<< orphan*/ UAVObjLogging(int /*<<< orphan*/);
void FlightBatteryStateLogging() { UAVObjLogging(FlightBatteryStateHandle()); }


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

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

LLVM IR (-O0):
define void @FlightBatteryStateLogging() {
%1 = call i32 (...) @FlightBatteryStateHandle()
%2 = call i32 @UAVObjLogging(i32 %1)
ret void
}

LLVM IR (-O2):
define void @FlightBatteryStateLogging() {
%1 = tail call i32 (...) @FlightBatteryStateHandle()
%2 = tail call i32 @UAVObjLogging(i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ test_fork2();
int main() {
  test_fork2();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <test_fork2@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @test_fork2()
ret i32 0
}
/* Variables and functions */
int WEXITSTATUS(int);
int WIFEXITED(int);
int /*<<< orphan*/ assert(int);
int waitpid(int, int *, int /*<<< orphan*/);
void wait_for_child_exit(int pid, int exit_code) {
  int status;
  assert(waitpid(pid, &status, 0) == pid);
  assert(WIFEXITED(status));
  assert(WEXITSTATUS(status) == exit_code);
}


x86 assembly (clang, -O0):
<wait_for_child_exit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
lea    -0xc(%rbp),%rsi
xor    %edx,%edx
call   1050 <waitpid@plt>
cmp    -0x4(%rbp),%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0xc(%rbp),%edi
call   1060 <WIFEXITED@plt>
mov    %eax,%edi
call   1030 <assert@plt>
mov    -0xc(%rbp),%edi
call   1040 <WEXITSTATUS@plt>
cmp    -0x8(%rbp),%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wait_for_child_exit>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
lea    0x4(%rsp),%rsi
xor    %edx,%edx
call   1050 <waitpid@plt>
xor    %edi,%edi
cmp    %ebp,%eax
sete   %dil
call   1030 <assert@plt>
mov    0x4(%rsp),%edi
call   1060 <WIFEXITED@plt>
mov    %eax,%edi
call   1030 <assert@plt>
mov    0x4(%rsp),%edi
call   1040 <WEXITSTATUS@plt>
xor    %edi,%edi
cmp    %ebx,%eax
sete   %dil
call   1030 <assert@plt>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define void @wait_for_child_exit(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = call i32 @waitpid(i32 %6, i32* %5, i32 0)
%8 = load i32, i32* %3
%9 = icmp eq i32 %7, %8
%10 = zext i1 %9 to i32
%11 = call i32 @assert(i32 %10)
%12 = load i32, i32* %5
%13 = call i32 @WIFEXITED(i32 %12)
%14 = call i32 @assert(i32 %13)
%15 = load i32, i32* %5
%16 = call i32 @WEXITSTATUS(i32 %15)
%17 = load i32, i32* %4
%18 = icmp eq i32 %16, %17
%19 = zext i1 %18 to i32
%20 = call i32 @assert(i32 %19)
ret void
}

LLVM IR (-O2):
define void @wait_for_child_exit(i32 %0, i32 %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = call i32 @waitpid(i32 %0, i32* %3, i32 0)
%6 = icmp eq i32 %5, %0
%7 = zext i1 %6 to i32
%8 = call i32 @assert(i32 %7)
%9 = load i32, i32* %3
%10 = call i32 @WIFEXITED(i32 %9)
%11 = call i32 @assert(i32 %10)
%12 = load i32, i32* %3
%13 = call i32 @WEXITSTATUS(i32 %12)
%14 = icmp eq i32 %13, %1
%15 = zext i1 %14 to i32
%16 = call i32 @assert(i32 %15)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ put_char_utf8(int /*<<< orphan*/, char *);
void put_string_utf8(const int *v, char *s) {
  while (*v) {
    s += put_char_utf8(*v++, s);
  }
  *s = 0;
}


x86 assembly (clang, -O0):
<put_string_utf8>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmpl   $0x0,(%rax)
je     115c <put_string_utf8+0x4c>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x4,%rcx
mov    %rcx,-0x8(%rbp)
mov    (%rax),%edi
mov    -0x10(%rbp),%rsi
call   1030 <put_char_utf8@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x10(%rbp)
jmp    1120 <put_string_utf8+0x10>
mov    -0x10(%rbp),%rax
movb   $0x0,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<put_string_utf8>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
mov    (%rdi),%edi
test   %edi,%edi
je     1147 <put_string_utf8+0x37>
add    $0x4,%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %r14,%rsi
call   1030 <put_char_utf8@plt>
cltq
add    %rax,%r14
mov    (%rbx),%edi
add    $0x4,%rbx
test   %edi,%edi
jne    1130 <put_string_utf8+0x20>
movb   $0x0,(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define void @put_string_utf8(i32* nocapture %0, i8* %1) {
%3 = load i32, i32* %0
%4 = icmp eq i32 %3, 0
br i1 %4, label %15, label %5
5: ; preds = %2, %5
%6 = phi i32 [ %13, %5 ], [ %3, %2 ]
%7 = phi i8* [ %12, %5 ], [ %1, %2 ]
%8 = phi i32* [ %9, %5 ], [ %0, %2 ]
%9 = getelementptr inbounds i32, i32* %8, i64 1
%10 = tail call i32 @put_char_utf8(i32 %6, i8* %7)
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds i8, i8* %7, i64 %11
%13 = load i32, i32* %9
%14 = icmp eq i32 %13, 0
br i1 %14, label %15, label %5
15: ; preds = %5, %2
%16 = phi i8* [ %1, %2 ], [ %12, %5 ]
store i8 0, i8* %16
ret void
}
/* Variables and functions */
int /*<<< orphan*/ queue_managing();
int main() { queue_managing(); }


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @queue_managing()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ __NR_get_mempolicy;
int syscall(int /*<<< orphan*/, int *, unsigned long *, unsigned long, void *,
            unsigned long);
int get_mempolicy(int *mode, unsigned long *nodemask, unsigned long maxnode,
                  void *addr, unsigned long flags) {
  return syscall(__NR_get_mempolicy, mode, nodemask, maxnode, addr, flags);
}


x86 assembly (clang, -O0):
<get_mempolicy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    -0x20(%rbp),%r8
mov    -0x28(%rbp),%r9
call   1030 <syscall@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_mempolicy>:
mov    %r8,%r9
mov    %rcx,%r8
mov    %rdx,%rcx
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    0x2ec2(%rip),%rax
mov    (%rax),%edi
jmp    1030 <syscall@plt>

LLVM IR (-O0):
@__NR_get_mempolicy = global i32 0
define i32 @get_mempolicy(i32* %0, i64* %1, i64 %2, i8* %3, i64 %4) {
%6 = alloca i32*
%7 = alloca i64*
%8 = alloca i64
%9 = alloca i8*
%10 = alloca i64
store i32* %0, i32** %6
store i64* %1, i64** %7
store i64 %2, i64* %8
store i8* %3, i8** %9
store i64 %4, i64* %10
%11 = load i32, i32* @__NR_get_mempolicy
%12 = load i32*, i32** %6
%13 = load i64*, i64** %7
%14 = load i64, i64* %8
%15 = load i8*, i8** %9
%16 = load i64, i64* %10
%17 = call i32 @syscall(i32 %11, i32* %12, i64* %13, i64 %14, i8* %15, i64 %16)
ret i32 %17
}

LLVM IR (-O2):
@__NR_get_mempolicy = global i32 0
define i32 @get_mempolicy(i32* %0, i64* %1, i64 %2, i8* %3, i64 %4) {
%6 = load i32, i32* @__NR_get_mempolicy
%7 = tail call i32 @syscall(i32 %6, i32* %0, i64* %1, i64 %2, i8* %3, i64 %4)
ret i32 %7
}
const char *ls_costN_nm4_name_in(int i) {
  switch (i) {
  case 0:
    return "i0";
  default:
    return 0;
  }
}


x86 assembly (clang, -O0):
<ls_costN_nm4_name_in>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
test   %eax,%eax
jne    1127 <ls_costN_nm4_name_in+0x27>
jmp    1117 <ls_costN_nm4_name_in+0x17>
lea    0xee2(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    112f <ls_costN_nm4_name_in+0x2f>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ls_costN_nm4_name_in>:
xor    %eax,%eax
test   %edi,%edi
lea    0xef5(%rip),%rcx
cmove  %rcx,%rax
ret

LLVM IR (-O0):
@.str = [3 x i8] c"i0\00"
define i8* @ls_costN_nm4_name_in(i32 %0) {
%2 = alloca i8*
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %6 [
i32 0, label %5
]
5: ; preds = %1
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8** %2
br label %7
6: ; preds = %1
store i8* null, i8** %2
br label %7
7: ; preds = %6, %5
%8 = load i8*, i8** %2
ret i8* %8
}

LLVM IR (-O2):
@.str = [3 x i8] c"i0\00"
define i8* @ls_costN_nm4_name_in(i32 %0) {
%2 = icmp eq i32 %0, 0
%3 = select i1 %2, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* null
ret i8* %3
}
int palindrom(char vstup[], int dlzka) {
  int i = 0;
  while (dlzka > i) {
    if (vstup[i++] != vstup[dlzka--])
      return 0;
  }
  return 1;
}


x86 assembly (clang, -O0):
<palindrom>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x18(%rbp),%eax
jle    1163 <palindrom+0x63>
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%ecx
mov    %ecx,%edx
add    $0x1,%edx
mov    %edx,-0x18(%rbp)
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%eax
mov    -0x10(%rbp),%rcx
mov    -0x14(%rbp),%edx
mov    %edx,%esi
add    $0xffffffff,%esi
mov    %esi,-0x14(%rbp)
movslq %edx,%rdx
movsbl (%rcx,%rdx,1),%ecx
cmp    %ecx,%eax
je     115e <palindrom+0x5e>
movl   $0x0,-0x4(%rbp)
jmp    116a <palindrom+0x6a>
jmp    1112 <palindrom+0x12>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<palindrom>:
movslq %esi,%rcx
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nop
cmp    %rax,%rcx
jle    112c <palindrom+0x2c>
movzbl (%rdi,%rax,1),%edx
add    $0x1,%rax
lea    -0x1(%rcx),%rsi
cmp    (%rdi,%rcx,1),%dl
mov    %rsi,%rcx
je     1110 <palindrom+0x10>
xor    %eax,%eax
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @palindrom(i8* nocapture %0, i32 %1) {
%3 = sext i32 %1 to i64
br label %4
4: ; preds = %8, %2
%5 = phi i64 [ %9, %8 ], [ 0, %2 ]
%6 = phi i64 [ %12, %8 ], [ %3, %2 ]
%7 = icmp sgt i64 %6, %5
br i1 %7, label %8, label %16
8: ; preds = %4
%9 = add nuw nsw i64 %5, 1
%10 = getelementptr inbounds i8, i8* %0, i64 %5
%11 = load i8, i8* %10
%12 = add nsw i64 %6, -1
%13 = getelementptr inbounds i8, i8* %0, i64 %6
%14 = load i8, i8* %13
%15 = icmp eq i8 %11, %14
br i1 %15, label %4, label %16
16: ; preds = %4, %8
%17 = phi i32 [ 0, %8 ], [ 1, %4 ]
ret i32 %17
}
unsigned long long smaller(unsigned long long a, unsigned long long b) {
  unsigned long long atop = a >> 32;
  unsigned long long abot = a & 4294967295;
  unsigned long long btop = b >> 32;
  unsigned long long bbot = b & 4294967295;
  unsigned long long atopbelowbtop = (atop - btop) >> 63;
  unsigned long long atopeqbtop = ((atop ^ btop) - 1) >> 63;
  unsigned long long abotbelowbbot = (abot - bbot) >> 63;
  return atopbelowbtop | (atopeqbtop & abotbelowbbot);
}


x86 assembly (clang, -O0):
<smaller>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
shr    $0x20,%rax
mov    %rax,-0x18(%rbp)
movabs $0xffffffff,%rax
and    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
shr    $0x20,%rax
mov    %rax,-0x28(%rbp)
movabs $0xffffffff,%rax
and    -0x10(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x18(%rbp),%rax
sub    -0x28(%rbp),%rax
shr    $0x3f,%rax
mov    %rax,-0x38(%rbp)
mov    -0x18(%rbp),%rax
xor    -0x28(%rbp),%rax
sub    $0x1,%rax
shr    $0x3f,%rax
mov    %rax,-0x40(%rbp)
mov    -0x20(%rbp),%rax
sub    -0x30(%rbp),%rax
shr    $0x3f,%rax
mov    %rax,-0x48(%rbp)
mov    -0x38(%rbp),%rax
mov    -0x40(%rbp),%rcx
and    -0x48(%rbp),%rcx
or     %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<smaller>:
mov    %edi,%r8d
shr    $0x20,%rdi
mov    %esi,%edx
shr    $0x20,%rsi
xor    %ecx,%ecx
cmp    %rsi,%rdi
setb   %cl
xor    %rdi,%rsi
add    $0xffffffffffffffff,%rsi
shr    $0x3f,%rsi
xor    %eax,%eax
cmp    %rdx,%r8
setb   %al
and    %esi,%eax
or     %rcx,%rax
ret

LLVM IR (-O0):
define i64 @smaller(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
%7 = alloca i64
%8 = alloca i64
%9 = alloca i64
%10 = alloca i64
%11 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%12 = load i64, i64* %3
%13 = lshr i64 %12, 32
store i64 %13, i64* %5
%14 = load i64, i64* %3
%15 = and i64 %14, 4294967295
store i64 %15, i64* %6
%16 = load i64, i64* %4
%17 = lshr i64 %16, 32
store i64 %17, i64* %7
%18 = load i64, i64* %4
%19 = and i64 %18, 4294967295
store i64 %19, i64* %8
%20 = load i64, i64* %5
%21 = load i64, i64* %7
%22 = sub i64 %20, %21
%23 = lshr i64 %22, 63
store i64 %23, i64* %9
%24 = load i64, i64* %5
%25 = load i64, i64* %7
%26 = xor i64 %24, %25
%27 = sub i64 %26, 1
%28 = lshr i64 %27, 63
store i64 %28, i64* %10
%29 = load i64, i64* %6
%30 = load i64, i64* %8
%31 = sub i64 %29, %30
%32 = lshr i64 %31, 63
store i64 %32, i64* %11
%33 = load i64, i64* %9
%34 = load i64, i64* %10
%35 = load i64, i64* %11
%36 = and i64 %34, %35
%37 = or i64 %33, %36
ret i64 %37
}

LLVM IR (-O2):
define i64 @smaller(i64 %0, i64 %1) {
%3 = lshr i64 %0, 32
%4 = and i64 %0, 4294967295
%5 = lshr i64 %1, 32
%6 = and i64 %1, 4294967295
%7 = icmp ult i64 %3, %5
%8 = zext i1 %7 to i64
%9 = xor i64 %5, %3
%10 = add nsw i64 %9, -1
%11 = lshr i64 %10, 63
%12 = icmp ult i64 %4, %6
%13 = zext i1 %12 to i64
%14 = and i64 %11, %13
%15 = or i64 %14, %8
ret i64 %15
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ quiz_ACC_all();
int /*<<< orphan*/ quiz_programmer();
int main(int argc, char *argv[]) {
  assert(argc > 0);
  assert(argv != NULL);
  quiz_ACC_all();
  quiz_programmer();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x0,-0x8(%rbp)
setg   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
cmpq   $0x0,-0x10(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    $0x0,%al
call   1030 <quiz_ACC_all@plt>
mov    $0x0,%al
call   1050 <quiz_programmer@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    %rsi,%rbx
xor    %eax,%eax
test   %edi,%edi
setg   %al
mov    %eax,%edi
call   1040 <assert@plt>
xor    %edi,%edi
test   %rbx,%rbx
setne  %dil
call   1040 <assert@plt>
xor    %eax,%eax
call   1030 <quiz_ACC_all@plt>
xor    %eax,%eax
call   1050 <quiz_programmer@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* %4
%7 = icmp sgt i32 %6, 0
%8 = zext i1 %7 to i32
%9 = call i32 @assert(i32 %8)
%10 = load i8**, i8*** %5
%11 = icmp ne i8** %10, null
%12 = zext i1 %11 to i32
%13 = call i32 @assert(i32 %12)
%14 = call i32 (...) @quiz_ACC_all()
%15 = call i32 (...) @quiz_programmer()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** readnone %1) {
%3 = icmp sgt i32 %0, 0
%4 = zext i1 %3 to i32
%5 = tail call i32 @assert(i32 %4)
%6 = icmp ne i8** %1, null
%7 = zext i1 %6 to i32
%8 = tail call i32 @assert(i32 %7)
%9 = tail call i32 (...) @quiz_ACC_all()
%10 = tail call i32 (...) @quiz_programmer()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ write_instr(int);
int newline_handler(char **save) {
  (void)save;
  write_instr(0x2E);
  return 0;
}


x86 assembly (clang, -O0):
<newline_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x2e,%edi
call   1030 <write_instr@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @newline_handler(i8** nocapture readnone %0) {
%2 = tail call i32 @write_instr(i32 46)
ret i32 0
}
int addtest(int a, int b) { return a + b; }


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

x86 assembly (clang, -O2):
<addtest>:
lea    (%rdi,%rsi,1),%eax
ret

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

LLVM IR (-O2):
define i32 @addtest(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
ret i32 %3
}
int pinconf_apply_setting(struct pinctrl_setting const *setting) { return 0; }


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

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

LLVM IR (-O0):
%struct.pinctrl_setting = type opaque
define i32 @pinconf_apply_setting(%struct.pinctrl_setting* %0) {
%2 = alloca %struct.pinctrl_setting*
store %struct.pinctrl_setting* %0, %struct.pinctrl_setting** %2
ret i32 0
}

LLVM IR (-O2):
%struct.pinctrl_setting = type opaque
define i32 @pinconf_apply_setting(%struct.pinctrl_setting* nocapture readnone %0) {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ exit(int);
int fwrite(int /*<<< orphan*/ *, int, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ perror(char *);
void mdv_write(FILE *fp, uint8_t *data, int len) {
  if (fwrite(data, len, 1, fp) != 1) {
    perror("mdv_write");
    exit(1);
  }
}


x86 assembly (clang, -O0):
<mdv_write>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0x8(%rbp),%rcx
mov    $0x1,%edx
call   1050 <fwrite@plt>
cmp    $0x1,%eax
je     1177 <mdv_write+0x47>
lea    0xe98(%rip),%rdi
call   1030 <perror@plt>
mov    $0x1,%edi
call   1040 <exit@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mdv_write>:
push   %rax
mov    %rdi,%rcx
mov    %rsi,%rdi
mov    %edx,%esi
mov    $0x1,%edx
call   1050 <fwrite@plt>
cmp    $0x1,%eax
jne    114a <mdv_write+0x1a>
pop    %rax
ret
lea    0xeaf(%rip),%rdi
call   1030 <perror@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"mdv_write\00"
define void @mdv_write(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
%7 = load i32*, i32** %5
%8 = load i32, i32* %6
%9 = load i32*, i32** %4
%10 = call i32 @fwrite(i32* %7, i32 %8, i32 1, i32* %9)
%11 = icmp ne i32 %10, 1
br i1 %11, label %12, label %15
12: ; preds = %3
%13 = call i32 @perror(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%14 = call i32 @exit(i32 1)
unreachable
15: ; preds = %3
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"mdv_write\00"
define void @mdv_write(i32* nocapture %0, i32* nocapture %1, i32 %2) {
%4 = tail call i32 @fwrite(i32* %1, i32 %2, i32 1, i32* %0)
%5 = icmp eq i32 %4, 1
br i1 %5, label %9, label %6
6: ; preds = %3
%7 = tail call i32 @perror(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%8 = tail call i32 @exit(i32 1)
unreachable
9: ; preds = %3
ret void
}
/* Variables and functions */
int strlen(char *string) {
  if (!string)
    return 0;
  int count = 0;
  while (string[count])
    count++;
  return count;
}


x86 assembly (clang, -O0):
<strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    111f <strlen+0x1f>
movl   $0x0,-0x4(%rbp)
jmp    114c <strlen+0x4c>
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
cmpb   $0x0,(%rax,%rcx,1)
je     1146 <strlen+0x46>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1126 <strlen+0x26>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlen>:
test   %rdi,%rdi
je     111d <strlen+0x1d>
mov    $0xffffffff,%eax
nopw   0x0(%rax,%rax,1)
add    $0x1,%eax
cmpb   $0x0,(%rdi)
lea    0x1(%rdi),%rdi
jne    1110 <strlen+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @strlen(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %11, label %3
3: ; preds = %1, %3
%4 = phi i64 [ %8, %3 ], [ 0, %1 ]
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 0
%8 = add nuw i64 %4, 1
br i1 %7, label %9, label %3
9: ; preds = %3
%10 = trunc i64 %4 to i32
br label %11
11: ; preds = %9, %1
%12 = phi i32 [ 0, %1 ], [ %10, %9 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ busy_wait(int);
void blink(int n) {
  while (1) {
    *(int *)0xC0220134 = 0x46;
    *(int *)0xC02200BC = 0x46;
    busy_wait(n);
    *(int *)0xC0220134 = 0x44;
    *(int *)0xC02200BC = 0x44;
    busy_wait(n);
  }
}


x86 assembly (clang, -O0):
<blink>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0xc0220134,%eax
movl   $0x46,(%rax)
mov    $0xc02200bc,%eax
movl   $0x46,(%rax)
mov    -0x4(%rbp),%edi
call   1030 <busy_wait@plt>
mov    $0xc0220134,%eax
movl   $0x44,(%rax)
mov    $0xc02200bc,%eax
movl   $0x44,(%rax)
mov    -0x4(%rbp),%edi
call   1030 <busy_wait@plt>
jmp    111b <blink+0xb>

x86 assembly (clang, -O2):
<blink>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebp
mov    $0xc02200bc,%ebx
nopw   0x0(%rax,%rax,1)
movl   $0x46,0x78(%rbx)
movl   $0x46,(%rbx)
mov    %ebp,%edi
call   1030 <busy_wait@plt>
movl   $0x44,0x78(%rbx)
movl   $0x44,(%rbx)
mov    %ebp,%edi
call   1030 <busy_wait@plt>
jmp    1120 <blink+0x10>

LLVM IR (-O0):
define void @blink(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
br label %3
3: ; preds = %1, %3
store i32 70, i32* inttoptr (i64 3223454004 to i32*)
store i32 70, i32* inttoptr (i64 3223453884 to i32*)
%4 = load i32, i32* %2
%5 = call i32 @busy_wait(i32 %4)
store i32 68, i32* inttoptr (i64 3223454004 to i32*)
store i32 68, i32* inttoptr (i64 3223453884 to i32*)
%6 = load i32, i32* %2
%7 = call i32 @busy_wait(i32 %6)
br label %3
}

LLVM IR (-O2):
define void @blink(i32 %0) {
br label %2
2: ; preds = %1, %2
store i32 70, i32* inttoptr (i64 3223454004 to i32*)
store i32 70, i32* inttoptr (i64 3223453884 to i32*)
%3 = tail call i32 @busy_wait(i32 %0)
store i32 68, i32* inttoptr (i64 3223454004 to i32*)
store i32 68, i32* inttoptr (i64 3223453884 to i32*)
%4 = tail call i32 @busy_wait(i32 %0)
br label %2
}
/* Variables and functions */
int /*<<< orphan*/ free(unsigned int *);
void C_Utils_free_uint_ptr(unsigned int *item) { free(item); }


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

x86 assembly (clang, -O2):
<C_Utils_free_uint_ptr>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @C_Utils_free_uint_ptr(i32* nocapture %0) {
%2 = tail call i32 @free(i32* %0)
ret void
}
void INT_Excep_TPU6_TGI6B(void) {}


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

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

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

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