xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ eewrite(int, int /*<<< orphan*/);
void saveString(int addr, char *str) {
  while (*str)
    eewrite(addr++, *str++);
  eewrite(addr, 0);
}


x86 assembly (clang, -O0):
<saveString>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1153 <saveString+0x43>
mov    -0x4(%rbp),%edi
mov    %edi,%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movsbl (%rax),%esi
call   1030 <eewrite@plt>
jmp    111f <saveString+0xf>
mov    -0x4(%rbp),%edi
xor    %esi,%esi
call   1030 <eewrite@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<saveString>:
push   %rbp
push   %rbx
push   %rax
mov    (%rsi),%al
test   %al,%al
je     113a <saveString+0x2a>
mov    %rsi,%rbx
add    $0x1,%rbx
lea    0x1(%rdi),%ebp
movsbl %al,%esi
call   1030 <eewrite@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
mov    %ebp,%edi
test   %al,%al
jne    1120 <saveString+0x10>
jmp    113c <saveString+0x2c>
mov    %edi,%ebp
mov    %ebp,%edi
xor    %esi,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <eewrite@plt>

LLVM IR (-O0):
define void @saveString(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 i8*, i8** %4
%7 = load i8, i8* %6
%8 = icmp ne i8 %7, 0
br i1 %8, label %9, label %17
9: ; preds = %5
%10 = load i32, i32* %3
%11 = add nsw i32 %10, 1
store i32 %11, i32* %3
%12 = load i8*, i8** %4
%13 = getelementptr inbounds i8, i8* %12, i32 1
store i8* %13, i8** %4
%14 = load i8, i8* %12
%15 = sext i8 %14 to i32
%16 = call i32 @eewrite(i32 %10, i32 %15)
br label %5
17: ; preds = %5
%18 = load i32, i32* %3
%19 = call i32 @eewrite(i32 %18, i32 0)
ret void
}

LLVM IR (-O2):
define void @saveString(i32 %0, i8* nocapture %1) {
%3 = load i8, i8* %1
%4 = icmp eq i8 %3, 0
br i1 %4, label %15, label %5
5: ; preds = %2, %5
%6 = phi i8 [ %13, %5 ], [ %3, %2 ]
%7 = phi i8* [ %10, %5 ], [ %1, %2 ]
%8 = phi i32 [ %9, %5 ], [ %0, %2 ]
%9 = add nsw i32 %8, 1
%10 = getelementptr inbounds i8, i8* %7, i64 1
%11 = sext i8 %6 to i32
%12 = tail call i32 @eewrite(i32 %8, i32 %11)
%13 = load i8, i8* %10
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %5
15: ; preds = %5, %2
%16 = phi i32 [ %0, %2 ], [ %9, %5 ]
%17 = tail call i32 @eewrite(i32 %16, i32 0)
ret void
}
/* Variables and functions */
char *jsonTopoAddDevice(char *, char *, char *, int /*<<< orphan*/ *,
                        int /*<<< orphan*/);
char *jsonTopoAddSensor(char *mac, char *name) {
  return (jsonTopoAddDevice("sen", mac, name, NULL, 0));
}


x86 assembly (clang, -O0):
<jsonTopoAddSensor>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
lea    0xed1(%rip),%rdi
xor    %eax,%eax
mov    %eax,%ecx
xor    %r8d,%r8d
call   1030 <jsonTopoAddDevice@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<jsonTopoAddSensor>:
mov    %rsi,%rdx
mov    %rdi,%rsi
lea    0xee3(%rip),%rdi
xor    %ecx,%ecx
xor    %r8d,%r8d
jmp    1030 <jsonTopoAddDevice@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"sen\00"
define i8* @jsonTopoAddSensor(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = call i8* @jsonTopoAddDevice(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %5, i8* %6, i32* null, i32 0)
ret i8* %7
}

LLVM IR (-O2):
@.str = [4 x i8] c"sen\00"
define i8* @jsonTopoAddSensor(i8* %0, i8* %1) {
%3 = tail call i8* @jsonTopoAddDevice(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1, i32* null, i32 0)
ret i8* %3
}
/* Variables and functions */
void *malloc(size_t);
int /*<<< orphan*/ nomem();
void *xmalloc(size_t sz) {
  void *p = malloc(sz);
  if (p == NULL)
    nomem();
  return p;
}


x86 assembly (clang, -O0):
<xmalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    114b <xmalloc+0x2b>
mov    $0x0,%al
call   1030 <nomem@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmalloc>:
push   %rbx
call   1040 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1135 <xmalloc+0x15>
xor    %eax,%eax
call   1030 <nomem@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @xmalloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp eq i8* %6, null
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = call i32 (...) @nomem()
br label %10
10: ; preds = %8, %1
%11 = load i8*, i8** %3
ret i8* %11
}

LLVM IR (-O2):
define noalias i8* @xmalloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 (...) @nomem()
br label %6
6: ; preds = %4, %1
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ EACCES;
int /*<<< orphan*/ errno;
int open(const char *path, int access, ...) {
  errno = EACCES;
  return -1;
}


x86 assembly (clang, -O0):
<open>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    0x2ed6(%rip),%rax
mov    (%rax),%ecx
mov    0x2ebd(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@EACCES = global i32 0
@errno = global i32 0
define i32 @open(i8* %0, i32 %1, ...) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* @EACCES
store i32 %5, i32* @errno
ret i32 -1
}

LLVM IR (-O2):
@EACCES = global i32 0
@errno = global i32 0
define i32 @open(i8* nocapture readnone %0, i32 %1, ...) {
%3 = load i32, i32* @EACCES
store i32 %3, i32* @errno
ret i32 -1
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ read_unixtstamp(char *, int *);
void test_one_decimal() {
  char *str = "1234.1";
  uint64_t dest;
  read_unixtstamp(str, &dest);
  assert((dest / 1000000000) == 1234 && (dest % 1000000000) == 100000000);
}


x86 assembly (clang, -O0):
<test_one_decimal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0xc(%rbp),%rsi
call   1040 <read_unixtstamp@plt>
mov    -0xc(%rbp),%eax
mov    $0x3b9aca00,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0x4d2,%ecx
mov    %al,-0xd(%rbp)
jne    1175 <test_one_decimal+0x55>
mov    -0xc(%rbp),%eax
mov    $0x3b9aca00,%ecx
cltd
idiv   %ecx
cmp    $0x5f5e100,%edx
sete   %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_one_decimal>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <read_unixtstamp@plt>
xor    %edi,%edi
call   1030 <assert@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [7 x i8] c"1234.1\00"
define void @test_one_decimal() {
%1 = alloca i8*
%2 = alloca i32
store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8** %1
%3 = load i8*, i8** %1
%4 = call i32 @read_unixtstamp(i8* %3, i32* %2)
%5 = load i32, i32* %2
%6 = sdiv i32 %5, 1000000000
%7 = icmp eq i32 %6, 1234
br i1 %7, label %8, label %12
8: ; preds = %0
%9 = load i32, i32* %2
%10 = srem i32 %9, 1000000000
%11 = icmp eq i32 %10, 100000000
br label %12
12: ; preds = %8, %0
%13 = phi i1 [ false, %0 ], [ %11, %8 ]
%14 = zext i1 %13 to i32
%15 = call i32 @assert(i32 %14)
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"1234.1\00"
define void @test_one_decimal() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @read_unixtstamp(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = call i32 @assert(i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ info(int, char *, char const *, unsigned int);
void print_xfer(const char *name, char rw, unsigned int size) {
  info(1, (rw == 'r' ? "%-6s          < %-8u" : "%-6s %8u >"), name, size);
}


x86 assembly (clang, -O0):
<print_xfer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    %edx,-0x10(%rbp)
movsbl -0x9(%rbp),%ecx
lea    0xee5(%rip),%rsi
lea    0xec9(%rip),%rax
cmp    $0x72,%ecx
cmove  %rax,%rsi
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%ecx
mov    $0x1,%edi
call   1030 <info@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_xfer>:
mov    %edx,%ecx
mov    %rdi,%rdx
cmp    $0x72,%sil
lea    0xee0(%rip),%rax
lea    0xeee(%rip),%rsi
cmove  %rax,%rsi
mov    $0x1,%edi
jmp    1030 <info@plt>

LLVM IR (-O0):
@.str = [21 x i8] c"%-6s < %-8u\00"
@.str.1 = [11 x i8] c"%-6s %8u >\00"
define void @print_xfer(i8* %0, i8 signext %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i32
store i8* %0, i8** %4
store i8 %1, i8* %5
store i32 %2, i32* %6
%7 = load i8, i8* %5
%8 = sext i8 %7 to i32
%9 = icmp eq i32 %8, 114
%10 = zext i1 %9 to i64
%11 = select i1 %9, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0)
%12 = load i8*, i8** %4
%13 = load i32, i32* %6
%14 = call i32 @info(i32 1, i8* %11, i8* %12, i32 %13)
ret void
}

LLVM IR (-O2):
@.str = [21 x i8] c"%-6s < %-8u\00"
@.str.1 = [11 x i8] c"%-6s %8u >\00"
define void @print_xfer(i8* %0, i8 signext %1, i32 %2) {
%4 = icmp eq i8 %1, 114
%5 = select i1 %4, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0)
%6 = tail call i32 @info(i32 1, i8* %5, i8* %0, i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ getchar();
int /*<<< orphan*/ test_memmgr();
int main() {
  test_memmgr();
  getchar();
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <test_memmgr@plt>
xor    %eax,%eax
call   1030 <getchar@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_memmgr()
%3 = call i32 (...) @getchar()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @test_memmgr()
%2 = tail call i32 (...) @getchar()
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;

/* Variables and functions */
char *ctime(int /*<<< orphan*/ *);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
int main() {
  time_t date = time(NULL);
  printf("%s", ctime(&date));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1050 <time@plt>
mov    %eax,-0x8(%rbp)
lea    -0x8(%rbp),%rdi
call   1030 <ctime@plt>
mov    %rax,%rsi
lea    0xea2(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
call   1050 <time@plt>
mov    %eax,0x4(%rsp)
lea    0x4(%rsp),%rdi
call   1030 <ctime@plt>
lea    0xeb3(%rip),%rdi
mov    %rax,%rsi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @time(i32* null)
store i32 %3, i32* %1
%4 = call i8* @ctime(i32* %1)
%5 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %4)
ret i32 0
}
/* Variables and functions */
int strcmp(char const *, char const *);
int compare(const void *p1, const void *p2) {
  return strcmp((const char *)p1, (const char *)p2);
}


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

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

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

LLVM IR (-O2):
define i32 @compare(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
ret i32 %3
}
const char *ls_cost_nm6_name_out(int i) {
  switch (i) {
  case 0:
    return "o0";
  case 1:
    return "o1";
  default:
    return 0;
  }
}


x86 assembly (clang, -O0):
<ls_cost_nm6_name_out>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
test   %eax,%eax
je     112b <ls_cost_nm6_name_out+0x2b>
jmp    111a <ls_cost_nm6_name_out+0x1a>
mov    -0x10(%rbp),%eax
sub    $0x1,%eax
je     113b <ls_cost_nm6_name_out+0x3b>
jmp    114b <ls_cost_nm6_name_out+0x4b>
lea    0xece(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1153 <ls_cost_nm6_name_out+0x53>
lea    0xec1(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1153 <ls_cost_nm6_name_out+0x53>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ls_cost_nm6_name_out>:
xor    %ecx,%ecx
cmp    $0x1,%edi
lea    0xef7(%rip),%rax
cmove  %rax,%rcx
test   %edi,%edi
lea    0xee7(%rip),%rax
cmovne %rcx,%rax
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"o0\00"
@.str.1 = [3 x i8] c"o1\00"
define i8* @ls_cost_nm6_name_out(i32 %0) {
%2 = icmp eq i32 %0, 1
%3 = select i1 %2, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* null
%4 = icmp eq i32 %0, 0
%5 = select i1 %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %3
ret i8* %5
}
int lws_plat_socket_offset(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @lws_plat_socket_offset() {
ret i32 0
}
void debug(const char *str, ...) { (void)str; }


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

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

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

LLVM IR (-O2):
define void @debug(i8* nocapture %0, ...) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fdaF(void *);
void fdaF2(void *x) { fdaF(x); }


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

x86 assembly (clang, -O2):
<fdaF2>:
jmp    1030 <fdaF@plt>

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

LLVM IR (-O2):
define void @fdaF2(i8* %0) {
%2 = tail call i32 @fdaF(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ rt_InitInfAndNaN(unsigned int);
void estimate_rincf_drone_initialize(void) { rt_InitInfAndNaN(8U); }


x86 assembly (clang, -O0):
<estimate_rincf_drone_initialize>:
push   %rbp
mov    %rsp,%rbp
mov    $0x8,%edi
call   1030 <rt_InitInfAndNaN@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<estimate_rincf_drone_initialize>:
mov    $0x8,%edi
jmp    1030 <rt_InitInfAndNaN@plt>

LLVM IR (-O0):
define void @estimate_rincf_drone_initialize() {
%1 = call i32 @rt_InitInfAndNaN(i32 8)
ret void
}

LLVM IR (-O2):
define void @estimate_rincf_drone_initialize() {
%1 = tail call i32 @rt_InitInfAndNaN(i32 8)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ L0(int /*<<< orphan*/ *);
int /*<<< orphan*/ L1Inv(int /*<<< orphan*/ *);
int /*<<< orphan*/ L2Inv(int /*<<< orphan*/ *);
int /*<<< orphan*/ L3(int /*<<< orphan*/ *);
void L_layerInv(uint8_t *data) {
  L0(data);
  L1Inv(data);
  L2Inv(data);
  L3(data);
}


x86 assembly (clang, -O0):
<L_layerInv>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <L0@plt>
mov    -0x8(%rbp),%rdi
call   1040 <L1Inv@plt>
mov    -0x8(%rbp),%rdi
call   1060 <L2Inv@plt>
mov    -0x8(%rbp),%rdi
call   1030 <L3@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<L_layerInv>:
push   %rbx
mov    %rdi,%rbx
call   1050 <L0@plt>
mov    %rbx,%rdi
call   1040 <L1Inv@plt>
mov    %rbx,%rdi
call   1060 <L2Inv@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <L3@plt>

LLVM IR (-O0):
define void @L_layerInv(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @L0(i32* %3)
%5 = load i32*, i32** %2
%6 = call i32 @L1Inv(i32* %5)
%7 = load i32*, i32** %2
%8 = call i32 @L2Inv(i32* %7)
%9 = load i32*, i32** %2
%10 = call i32 @L3(i32* %9)
ret void
}

LLVM IR (-O2):
define void @L_layerInv(i32* %0) {
%2 = tail call i32 @L0(i32* %0)
%3 = tail call i32 @L1Inv(i32* %0)
%4 = tail call i32 @L2Inv(i32* %0)
%5 = tail call i32 @L3(i32* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ f(scalar_t__);
scalar_t__ foo(int);
int main(int argc, char **argv) {
  f(foo(4) + argc);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x4,%edi
call   1040 <foo@plt>
mov    %rax,%rdi
movslq -0x8(%rbp),%rax
add    %rax,%rdi
call   1030 <f@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    %edi,%ebx
mov    $0x4,%edi
call   1040 <foo@plt>
movslq %ebx,%rdi
add    %rax,%rdi
call   1030 <f@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 = call i64 @foo(i32 4)
%7 = load i32, i32* %4
%8 = sext i32 %7 to i64
%9 = add nsw i64 %6, %8
%10 = call i32 @f(i64 %9)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i64 @foo(i32 4)
%4 = sext i32 %0 to i64
%5 = add nsw i64 %3, %4
%6 = tail call i32 @f(i64 %5)
ret i32 0
}
/* Type definitions */
typedef int int32_t;

/* Variables and functions */
int insertInto(int, int, int, int);
int /*<<< orphan*/ printf(char *, char *);
char *ulongToBin(int);
int main() {
  int32_t N = 1 << 10;
  int32_t M = 19;
  int32_t result = insertInto(M, N, 2, 6);
  printf("Result: %s\n", ulongToBin(result));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x400,-0x8(%rbp)
movl   $0x13,-0xc(%rbp)
mov    -0xc(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    $0x2,%edx
mov    $0x6,%ecx
call   1040 <insertInto@plt>
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%edi
call   1050 <ulongToBin@plt>
mov    %rax,%rsi
lea    0xe89(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x13,%edi
mov    $0x400,%esi
mov    $0x2,%edx
mov    $0x6,%ecx
call   1040 <insertInto@plt>
mov    %eax,%edi
call   1050 <ulongToBin@plt>
lea    0xea8(%rip),%rdi
mov    %rax,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [12 x i8] c"Result: %s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
store i32 1024, i32* %2
store i32 19, i32* %3
%5 = load i32, i32* %3
%6 = load i32, i32* %2
%7 = call i32 @insertInto(i32 %5, i32 %6, i32 2, i32 6)
store i32 %7, i32* %4
%8 = load i32, i32* %4
%9 = call i8* @ulongToBin(i32 %8)
%10 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %9)
ret i32 0
}

LLVM IR (-O2):
@.str = [12 x i8] c"Result: %s\0A\00"
define i32 @main() {
%1 = tail call i32 @insertInto(i32 19, i32 1024, i32 2, i32 6)
%2 = tail call i8* @ulongToBin(i32 %1)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %2)
ret i32 0
}
const char *getstring2() { return "hello"; }


x86 assembly (clang, -O0):
<getstring2>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getstring2>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [6 x i8] c"hello\00"
define i8* @getstring2() {
ret i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [6 x i8] c"hello\00"
define i8* @getstring2() {
ret i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ do_command();
scalar_t__ get_command();
int /*<<< orphan*/ usleep(int);
void do_music_server() {
  int cnt = 0;
  while (0 == get_command()) {
    do_command();
    if (cnt > 100) {
      cnt = 0;
      usleep(10);
    }
    cnt++;
  }
}


x86 assembly (clang, -O0):
<do_music_server>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <get_command@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rcx,%rax
jne    1184 <do_music_server+0x54>
mov    $0x0,%al
call   1030 <do_command@plt>
cmpl   $0x64,-0x4(%rbp)
jle    1176 <do_music_server+0x46>
movl   $0x0,-0x4(%rbp)
mov    $0xa,%edi
call   1050 <usleep@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    113f <do_music_server+0xf>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_music_server>:
push   %rbx
xor    %eax,%eax
call   1040 <get_command@plt>
test   %rax,%rax
je     113f <do_music_server+0xf>
pop    %rbx
ret
xor    %ebx,%ebx
jmp    115f <do_music_server+0x2f>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
add    $0x1,%ebx
xor    %eax,%eax
call   1040 <get_command@plt>
test   %rax,%rax
jne    113d <do_music_server+0xd>
xor    %eax,%eax
call   1030 <do_command@plt>
cmp    $0x65,%ebx
jl     1150 <do_music_server+0x20>
mov    $0xa,%edi
call   1050 <usleep@plt>
xor    %ebx,%ebx
jmp    1150 <do_music_server+0x20>

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

LLVM IR (-O2):
define void @do_music_server() {
%1 = tail call i64 (...) @get_command()
%2 = icmp eq i64 %1, 0
br i1 %2, label %3, label %14
3: ; preds = %0, %9
%4 = phi i32 [ %11, %9 ], [ 0, %0 ]
%5 = tail call i32 (...) @do_command()
%6 = icmp sgt i32 %4, 100
br i1 %6, label %7, label %9
7: ; preds = %3
%8 = tail call i32 @usleep(i32 10)
br label %9
9: ; preds = %7, %3
%10 = phi i32 [ 0, %7 ], [ %4, %3 ]
%11 = add nsw i32 %10, 1
%12 = tail call i64 (...) @get_command()
%13 = icmp eq i64 %12, 0
br i1 %13, label %3, label %14
14: ; preds = %9, %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, char *);
void ErrorPrump_IdNotFound(int line, char *id) {
  printf("Error in line: %d \n => Identifier %s Not Found!", line, id);
}


x86 assembly (clang, -O0):
<ErrorPrump_IdNotFound>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rdx
lea    0xed3(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ErrorPrump_IdNotFound>:
mov    %rsi,%rdx
mov    %edi,%esi
lea    0xee4(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [48 x i8] c"Error in line: %d \0A => Identifier %s Not Found!\00"
define void @ErrorPrump_IdNotFound(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i32, i32* %3
%6 = load i8*, i8** %4
%7 = call i32 @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0), i32 %5, i8* %6)
ret void
}

LLVM IR (-O2):
@.str = [48 x i8] c"Error in line: %d \0A => Identifier %s Not Found!\00"
define void @ErrorPrump_IdNotFound(i32 %0, i8* %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0), i32 %0, i8* %1)
ret void
}
void ft_add_test_case(int *data, int min, int max) {
  data[0] = min;
  data[1] = max;
}


x86 assembly (clang, -O0):
<ft_add_test_case>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x10(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x4(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_add_test_case>:
mov    %esi,(%rdi)
mov    %edx,0x4(%rdi)
ret

LLVM IR (-O0):
define void @ft_add_test_case(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** %4
%9 = getelementptr inbounds i32, i32* %8, i64 0
store i32 %7, i32* %9
%10 = load i32, i32* %6
%11 = load i32*, i32** %4
%12 = getelementptr inbounds i32, i32* %11, i64 1
store i32 %10, i32* %12
ret void
}

LLVM IR (-O2):
define void @ft_add_test_case(i32* nocapture writeonly %0, i32 %1, i32 %2) {
store i32 %1, i32* %0
%4 = getelementptr inbounds i32, i32* %0, i64 1
store i32 %2, i32* %4
ret void
}
/* Type definitions */
struct tcb {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ CDE_begin_at_fileop(struct tcb *, char *);
void CDE_begin_mkdirat(struct tcb *tcp) { CDE_begin_at_fileop(tcp, "mkdirat"); }


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

x86 assembly (clang, -O2):
<CDE_begin_mkdirat>:
lea    0xee9(%rip),%rsi
jmp    1030 <CDE_begin_at_fileop@plt>

LLVM IR (-O0):
%struct.tcb = type { i32 }
@.str = [8 x i8] c"mkdirat\00"
define void @CDE_begin_mkdirat(%struct.tcb* %0) {
%2 = alloca %struct.tcb*
store %struct.tcb* %0, %struct.tcb** %2
%3 = load %struct.tcb*, %struct.tcb** %2
%4 = call i32 @CDE_begin_at_fileop(%struct.tcb* %3, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
%struct.tcb = type { i32 }
@.str = [8 x i8] c"mkdirat\00"
define void @CDE_begin_mkdirat(%struct.tcb* %0) {
%2 = tail call i32 @CDE_begin_at_fileop(%struct.tcb* %0, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret void
}
void kasan_poison_slab_free(struct kmem_cache *s, void *object) {}


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

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

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

LLVM IR (-O2):
%struct.kmem_cache = type opaque
define void @kasan_poison_slab_free(%struct.kmem_cache* nocapture %0, i8* nocapture %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ get_lexval();
int yyselect();
const_val() {
  switch (yyselect()) {
  case 72: {
    get_lexval();
  } break;
  case 73: {
    get_lexval();
  } break;
  case 74: {
    get_lexval();
  } break;
  case 75: {
    get_lexval();
  } break;
  case 76: {
    get_lexval();
  } break;
  }
}


x86 assembly (clang, -O0):
<const_val>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xor    %eax,%eax
call   1030 <yyselect@plt>
add    $0xffffffb8,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0x4,%eax
ja     118c <const_val+0x6c>
mov    -0x10(%rbp),%rax
lea    0xeb4(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    $0x0,%al
call   1040 <get_lexval@plt>
jmp    118c <const_val+0x6c>
mov    $0x0,%al
call   1040 <get_lexval@plt>
jmp    118c <const_val+0x6c>
mov    $0x0,%al
call   1040 <get_lexval@plt>
jmp    118c <const_val+0x6c>
mov    $0x0,%al
call   1040 <get_lexval@plt>
jmp    118c <const_val+0x6c>
mov    $0x0,%al
call   1040 <get_lexval@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<const_val>:
push   %rax
xor    %eax,%eax
call   1030 <yyselect@plt>
add    $0xffffffb8,%eax
cmp    $0x4,%eax
ja     1137 <const_val+0x17>
xor    %eax,%eax
call   1040 <get_lexval@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @const_val() {
%1 = alloca i32
%2 = call i32 (...) @yyselect()
switch i32 %2, label %13 [
i32 72, label %3
i32 73, label %5
i32 74, label %7
i32 75, label %9
i32 76, label %11
]
3: ; preds = %0
%4 = call i32 (...) @get_lexval()
br label %13
5: ; preds = %0
%6 = call i32 (...) @get_lexval()
br label %13
7: ; preds = %0
%8 = call i32 (...) @get_lexval()
br label %13
9: ; preds = %0
%10 = call i32 (...) @get_lexval()
br label %13
11: ; preds = %0
%12 = call i32 (...) @get_lexval()
br label %13
13: ; preds = %0, %11, %9, %7, %5, %3
%14 = load i32, i32* %1
ret i32 %14
}

LLVM IR (-O2):
define i32 @const_val() {
%1 = tail call i32 (...) @yyselect()
%2 = add i32 %1, -72
%3 = icmp ult i32 %2, 5
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = tail call i32 (...) @get_lexval()
br label %6
6: ; preds = %0, %4
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ line(int, char *);
int /*<<< orphan*/ puts(char *);
void fizzbuzz(int i) {
  int j;
  char out[256];
  for (j = 1; j <= i; j++) {
    line(j, out);
    puts(out);
  }
}


x86 assembly (clang, -O0):
<fizzbuzz>:
push   %rbp
mov    %rsp,%rbp
sub    $0x110,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jg     116a <fizzbuzz+0x4a>
mov    -0x8(%rbp),%edi
lea    -0x110(%rbp),%rsi
call   1040 <line@plt>
lea    -0x110(%rbp),%rdi
call   1030 <puts@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1135 <fizzbuzz+0x15>
add    $0x110,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fizzbuzz>:
push   %r15
push   %r14
push   %rbx
sub    $0x100,%rsp
test   %edi,%edi
jle    1165 <fizzbuzz+0x45>
mov    %edi,%r14d
neg    %r14d
mov    $0x1,%ebx
mov    %rsp,%r15
xchg   %ax,%ax
mov    %ebx,%edi
mov    %r15,%rsi
call   1040 <line@plt>
mov    %r15,%rdi
call   1030 <puts@plt>
lea    (%r14,%rbx,1),%eax
add    $0x1,%eax
mov    %ebx,%ecx
add    $0x1,%ecx
mov    %ecx,%ebx
cmp    $0x1,%eax
jne    1140 <fizzbuzz+0x20>
add    $0x100,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @fizzbuzz(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca [256 x i8]
store i32 %0, i32* %2
store i32 1, i32* %3
br label %5
5: ; preds = %15, %1
%6 = load i32, i32* %3
%7 = load i32, i32* %2
%8 = icmp sle i32 %6, %7
br i1 %8, label %9, label %18
9: ; preds = %5
%10 = load i32, i32* %3
%11 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 0
%12 = call i32 @line(i32 %10, i8* %11)
%13 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 0
%14 = call i32 @puts(i8* %13)
br label %15
15: ; preds = %9
%16 = load i32, i32* %3
%17 = add nsw i32 %16, 1
store i32 %17, i32* %3
br label %5
18: ; preds = %5
ret void
}

LLVM IR (-O2):
define void @fizzbuzz(i32 %0) {
%2 = alloca [256 x i8]
%3 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 0
%4 = icmp slt i32 %0, 1
br i1 %4, label %11, label %5
5: ; preds = %1, %5
%6 = phi i32 [ %9, %5 ], [ 1, %1 ]
%7 = call i32 @line(i32 %6, i8* %3)
%8 = call i32 @puts(i8* %3)
%9 = add nuw i32 %6, 1
%10 = icmp eq i32 %6, %0
br i1 %10, label %11, label %5
11: ; preds = %5, %1
ret void
}
int isLetter(int c) { return (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z'); }


x86 assembly (clang, -O0):
<isLetter>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x61,-0x4(%rbp)
jl     1120 <isLetter+0x20>
mov    $0x1,%al
cmpl   $0x7a,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jle    113f <isLetter+0x3f>
xor    %eax,%eax
cmpl   $0x41,-0x4(%rbp)
mov    %al,-0x6(%rbp)
jl     1139 <isLetter+0x39>
cmpl   $0x5a,-0x4(%rbp)
setle  %al
mov    %al,-0x6(%rbp)
mov    -0x6(%rbp),%al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @isLetter(i32 %0) {
%2 = and i32 %0, -33
%3 = add i32 %2, -65
%4 = icmp ult i32 %3, 26
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ MIPS_SET_BIT(int, int /*<<< orphan*/);
void xburst_cgm_gate_smb3() { MIPS_SET_BIT((0xB0000000 + 0x28), 0); }


x86 assembly (clang, -O0):
<xburst_cgm_gate_smb3>:
push   %rbp
mov    %rsp,%rbp
mov    $0xb0000028,%edi
xor    %esi,%esi
call   1030 <MIPS_SET_BIT@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<xburst_cgm_gate_smb3>:
mov    $0xb0000028,%edi
xor    %esi,%esi
jmp    1030 <MIPS_SET_BIT@plt>

LLVM IR (-O0):
define void @xburst_cgm_gate_smb3() {
%1 = call i32 @MIPS_SET_BIT(i32 -1342177240, i32 0)
ret void
}

LLVM IR (-O2):
define void @xburst_cgm_gate_smb3() {
%1 = tail call i32 @MIPS_SET_BIT(i32 -1342177240, i32 0)
ret void
}
/* Type definitions */
struct fdmi_queue {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ fdmi_queue_enq(struct fdmi_queue *, void *);
int /*<<< orphan*/ fdmi_queue_lock(struct fdmi_queue *);
int /*<<< orphan*/ fdmi_queue_unlock(struct fdmi_queue *);
void fdmi_queue_lock_enq(struct fdmi_queue *q, void *data) {
  fdmi_queue_lock(q);
  fdmi_queue_enq(q, data);
  fdmi_queue_unlock(q);
  return;
}


x86 assembly (clang, -O0):
<fdmi_queue_lock_enq>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <fdmi_queue_lock@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <fdmi_queue_enq@plt>
mov    -0x8(%rbp),%rdi
call   1040 <fdmi_queue_unlock@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fdmi_queue_lock_enq>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1050 <fdmi_queue_lock@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <fdmi_queue_enq@plt>
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <fdmi_queue_unlock@plt>

LLVM IR (-O0):
%struct.fdmi_queue = type { i32 }
define void @fdmi_queue_lock_enq(%struct.fdmi_queue* %0, i8* %1) {
%3 = alloca %struct.fdmi_queue*
%4 = alloca i8*
store %struct.fdmi_queue* %0, %struct.fdmi_queue** %3
store i8* %1, i8** %4
%5 = load %struct.fdmi_queue*, %struct.fdmi_queue** %3
%6 = call i32 @fdmi_queue_lock(%struct.fdmi_queue* %5)
%7 = load %struct.fdmi_queue*, %struct.fdmi_queue** %3
%8 = load i8*, i8** %4
%9 = call i32 @fdmi_queue_enq(%struct.fdmi_queue* %7, i8* %8)
%10 = load %struct.fdmi_queue*, %struct.fdmi_queue** %3
%11 = call i32 @fdmi_queue_unlock(%struct.fdmi_queue* %10)
ret void
}

LLVM IR (-O2):
%struct.fdmi_queue = type { i32 }
define void @fdmi_queue_lock_enq(%struct.fdmi_queue* %0, i8* %1) {
%3 = tail call i32 @fdmi_queue_lock(%struct.fdmi_queue* %0)
%4 = tail call i32 @fdmi_queue_enq(%struct.fdmi_queue* %0, i8* %1)
%5 = tail call i32 @fdmi_queue_unlock(%struct.fdmi_queue* %0)
ret void
}
/* Variables and functions */
int _ada_use_c2phc(int, int *, int *, double *);
int assign_coefficient_of_slice(int i, int j, double *r) {
  int fail;
  fail = _ada_use_c2phc(43, &i, &j, r);
  return fail;
}


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

x86 assembly (clang, -O2):
<assign_coefficient_of_slice>:
push   %rax
mov    %rdx,%rcx
mov    %edi,0x4(%rsp)
mov    %esi,(%rsp)
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
mov    $0x2b,%edi
call   1030 <_ada_use_c2phc@plt>
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @assign_coefficient_of_slice(i32 %0, i32 %1, double* %2) {
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = call i32 @_ada_use_c2phc(i32 43, i32* %4, i32* %5, double* %2)
ret i32 %6
}
void enable_no_exec() {
  asm volatile("push %%rcx\n"
               "mov $0xC0000080, %%ecx\n"
               "rdmsr\n"
               "or $0x800, %%eax\n"
               "wrmsr\n"
               "pop %%rcx"
               :
               :
               : "%ecx");
}


x86 assembly (clang, -O0):
<enable_no_exec>:
push   %rbp
mov    %rsp,%rbp
push   %rcx
mov    $0xc0000080,%ecx
rdmsr
or     $0x800,%eax
wrmsr
pop    %rcx
pop    %rbp
ret

x86 assembly (clang, -O2):
<enable_no_exec>:
push   %rcx
mov    $0xc0000080,%ecx
rdmsr
or     $0x800,%eax
wrmsr
pop    %rcx
ret

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

LLVM IR (-O2):
define void @enable_no_exec() {
tail call void asm sideeffect "push %rcx\0Amov $$0xC0000080, %ecx\0Ardmsr\0Aor $$0x800, %eax\0Awrmsr\0Apop %rcx", "~{ecx},~{dirflag},~{fpsr},~{flags}"()
ret void
}
void g_value_array_remove() {}


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

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

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

LLVM IR (-O2):
define void @g_value_array_remove() {
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int cmpID(const void *a, const void *b) {
  return *(uint32_t *)a - *(uint32_t *)b;
}


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

x86 assembly (clang, -O2):
<cmpID>:
mov    (%rdi),%eax
sub    (%rsi),%eax
ret

LLVM IR (-O0):
define i32 @cmpID(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = bitcast i8* %5 to i32*
%7 = load i32, i32* %6
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i32*
%10 = load i32, i32* %9
%11 = sub nsw i32 %7, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @cmpID(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = sub nsw i32 %4, %6
ret i32 %7
}
void dump_raw_pkt(const char *msg, int len) {}


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

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

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

LLVM IR (-O2):
define void @dump_raw_pkt(i8* nocapture %0, i32 %1) {
ret void
}
char *skip_word(char *ptr) {
  for (; *ptr; ptr++)
    if (*ptr == ' ' || *ptr == '\t' || *ptr == '\n')
      break;
  return ptr;
}


x86 assembly (clang, -O0):
<skip_word>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1160 <skip_word+0x60>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x20,%eax
je     1145 <skip_word+0x45>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x9,%eax
je     1145 <skip_word+0x45>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0xa,%eax
jne    114a <skip_word+0x4a>
jmp    1160 <skip_word+0x60>
jmp    114f <skip_word+0x4f>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1108 <skip_word+0x8>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<skip_word>:
mov    %rdi,%rax
movabs $0x100000601,%rcx
jmp    1114 <skip_word+0x14>
nop
add    $0x1,%rax
movzbl (%rax),%edx
cmp    $0x20,%rdx
ja     1110 <skip_word+0x10>
bt     %rdx,%rcx
jae    1110 <skip_word+0x10>
ret

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

LLVM IR (-O2):
define i8* @skip_word(i8* %0) {
br label %2
2: ; preds = %5, %1
%3 = phi i8* [ %0, %1 ], [ %6, %5 ]
%4 = load i8, i8* %3
switch i8 %4, label %5 [
i8 0, label %7
i8 32, label %7
i8 9, label %7
i8 10, label %7
]
5: ; preds = %2
%6 = getelementptr inbounds i8, i8* %3, i64 1
br label %2
7: ; preds = %2, %2, %2, %2
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("\nmain(): \n");
  return 0;
}


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

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

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

LLVM IR (-O2):
@str = [10 x i8] c"\0Amain(): \00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int fwrite(int *, int, int, int /*<<< orphan*/ *);
bool write_int(FILE *fp, int i) { return fwrite(&i, sizeof(int), 1, fp) == 1; }


x86 assembly (clang, -O0):
<write_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rcx
lea    -0xc(%rbp),%rdi
mov    $0x4,%esi
mov    $0x1,%edx
call   1030 <fwrite@plt>
cmp    $0x1,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_int>:
push   %rax
mov    %rdi,%rcx
mov    %esi,0x4(%rsp)
lea    0x4(%rsp),%rdi
mov    $0x4,%esi
mov    $0x1,%edx
call   1030 <fwrite@plt>
xor    %ecx,%ecx
cmp    $0x1,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @write_int(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 = call i32 @fwrite(i32* %4, i32 4, i32 1, i32* %5)
%7 = icmp eq i32 %6, 1
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @write_int(i32* nocapture %0, i32 %1) {
%3 = alloca i32
store i32 %1, i32* %3
%4 = call i32 @fwrite(i32* %3, i32 4, i32 1, i32* %0)
%5 = icmp eq i32 %4, 1
%6 = zext i1 %5 to i32
ret i32 %6
}
const char *yac_storage_shared_memory_name(void) { return "shm"; }


x86 assembly (clang, -O0):
<yac_storage_shared_memory_name>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<yac_storage_shared_memory_name>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [4 x i8] c"shm\00"
define i8* @yac_storage_shared_memory_name() {
ret i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [4 x i8] c"shm\00"
define i8* @yac_storage_shared_memory_name() {
ret i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void ft_strdel(char **as) {
  if (!as)
    return;
  free(*as);
  *as = NULL;
}


x86 assembly (clang, -O0):
<ft_strdel>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    112c <ft_strdel+0x1c>
jmp    1143 <ft_strdel+0x33>
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
call   1030 <free@plt>
mov    -0x8(%rbp),%rax
movq   $0x0,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_strdel>:
test   %rdi,%rdi
je     1129 <ft_strdel+0x19>
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%rdi
call   1030 <free@plt>
movq   $0x0,(%rbx)
pop    %rbx
ret

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

LLVM IR (-O2):
define void @ft_strdel(i8** %0) {
%2 = icmp eq i8** %0, null
br i1 %2, label %6, label %3
3: ; preds = %1
%4 = load i8*, i8** %0
%5 = tail call i32 @free(i8* %4)
store i8* null, i8** %0
br label %6
6: ; preds = %1, %3
ret void
}