xunge/DecIR huggingface dataset:
int lba_to_msf(int lba) {
  return (((lba / 75) / 60) << 16) + (((lba / 75) % 60) << 8) + (lba % 75);
}


x86 assembly (clang, -O0):
<lba_to_msf>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x4b,%ecx
cltd
idiv   %ecx
mov    $0x3c,%ecx
cltd
idiv   %ecx
shl    $0x10,%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x4b,%ecx
cltd
idiv   %ecx
mov    $0x3c,%ecx
cltd
idiv   %ecx
mov    -0xc(%rbp),%eax
shl    $0x8,%edx
add    %edx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x4b,%ecx
cltd
idiv   %ecx
mov    -0x8(%rbp),%eax
add    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<lba_to_msf>:
movslq %edi,%rax
imul   $0x7482296b,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
shr    $0x2b,%rcx
add    %edx,%ecx
shl    $0x10,%ecx
imul   $0x1b4e81b5,%rax,%rdx
mov    %rdx,%rsi
shr    $0x3f,%rsi
sar    $0x23,%rdx
add    %esi,%edx
movslq %edx,%rdx
imul   $0xffffffff88888889,%rdx,%rsi
shr    $0x20,%rsi
add    %edx,%esi
mov    %esi,%edi
shr    $0x1f,%edi
shr    $0x5,%esi
add    %edi,%esi
imul   $0x3c,%esi,%esi
imul   $0x4b,%edx,%edi
sub    %esi,%edx
shl    $0x8,%edx
sub    %edi,%eax
add    %ecx,%eax
add    %edx,%eax
ret

LLVM IR (-O0):
define i32 @lba_to_msf(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sdiv i32 %3, 75
%5 = sdiv i32 %4, 60
%6 = shl i32 %5, 16
%7 = load i32, i32* %2
%8 = sdiv i32 %7, 75
%9 = srem i32 %8, 60
%10 = shl i32 %9, 8
%11 = add nsw i32 %6, %10
%12 = load i32, i32* %2
%13 = srem i32 %12, 75
%14 = add nsw i32 %11, %13
ret i32 %14
}

LLVM IR (-O2):
define i32 @lba_to_msf(i32 %0) {
%2 = sdiv i32 %0, 75
%3 = sdiv i32 %0, 4500
%4 = shl i32 %3, 16
%5 = srem i32 %2, 60
%6 = shl nsw i32 %5, 8
%7 = srem i32 %0, 75
%8 = add i32 %4, %7
%9 = add i32 %8, %6
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void characters(char *chars, int start, int length) {
  if (chars)
    printf("characters [%s]\n", chars);
  else
    printf("characters [*NULL*]\n", chars);
}


x86 assembly (clang, -O0):
<characters>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1142 <characters+0x32>
mov    -0x8(%rbp),%rsi
lea    0xec8(%rip),%rdi
call   1030 <printf@plt>
jmp    1152 <characters+0x42>
mov    -0x8(%rbp),%rsi
lea    0xec4(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<characters>:
test   %rdi,%rdi
je     1124 <characters+0x14>
mov    %rdi,%rsi
lea    0xee1(%rip),%rdi
jmp    1030 <printf@plt>
lea    0xee6(%rip),%rdi
xor    %esi,%esi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [17 x i8] c"characters [%s]\0A\00"
@.str.1 = [21 x i8] c"characters [*NULL*]\0A\00"
define void @characters(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i8*, i8** %4
%8 = icmp ne i8* %7, null
br i1 %8, label %9, label %12
9: ; preds = %3
%10 = load i8*, i8** %4
%11 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %10)
br label %15
12: ; preds = %3
%13 = load i8*, i8** %4
%14 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), i8* %13)
br label %15
15: ; preds = %12, %9
ret void
}

LLVM IR (-O2):
@.str = [17 x i8] c"characters [%s]\0A\00"
@.str.1 = [21 x i8] c"characters [*NULL*]\0A\00"
define void @characters(i8* %0, i32 %1, i32 %2) {
%4 = icmp eq i8* %0, null
br i1 %4, label %7, label %5
5: ; preds = %3
%6 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %0)
br label %9
7: ; preds = %3
%8 = tail call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), i8* null)
br label %9
9: ; preds = %7, %5
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
char *pipe_unix_poll(int *);
char *e_comm_poll(void) {
  int error;
  char *retval = pipe_unix_poll(&error);
  if (error)
    exit(1);
  return retval;
}


x86 assembly (clang, -O0):
<e_comm_poll>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x4(%rbp),%rdi
call   1040 <pipe_unix_poll@plt>
mov    %rax,-0x10(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1149 <e_comm_poll+0x29>
mov    $0x1,%edi
call   1030 <exit@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<e_comm_poll>:
push   %rax
lea    0x4(%rsp),%rdi
call   1040 <pipe_unix_poll@plt>
cmpl   $0x0,0x4(%rsp)
jne    1134 <e_comm_poll+0x14>
pop    %rcx
ret
mov    $0x1,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
define i8* @e_comm_poll() {
%1 = alloca i32
%2 = alloca i8*
%3 = call i8* @pipe_unix_poll(i32* %1)
store i8* %3, i8** %2
%4 = load i32, i32* %1
%5 = icmp ne i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %0
%7 = call i32 @exit(i32 1)
unreachable
8: ; preds = %0
%9 = load i8*, i8** %2
ret i8* %9
}

LLVM IR (-O2):
define i8* @e_comm_poll() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i8* @pipe_unix_poll(i32* %1)
%4 = load i32, i32* %1
%5 = icmp eq i32 %4, 0
br i1 %5, label %8, label %6
6: ; preds = %0
%7 = call i32 @exit(i32 1)
unreachable
8: ; preds = %0
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ LCD_write_byte(int, int /*<<< orphan*/);
void LCD_clear(void) { LCD_write_byte(0x01, 0); }


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

x86 assembly (clang, -O2):
<LCD_clear>:
mov    $0x1,%edi
xor    %esi,%esi
jmp    1030 <LCD_write_byte@plt>

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

LLVM IR (-O2):
define void @LCD_clear() {
%1 = tail call i32 @LCD_write_byte(i32 1, i32 0)
ret void
}
/* Variables and functions */
scalar_t__ strcmp(char const *, char *);
unsigned int strlen(char const *);
int bzipped_filename_p(const char *name) {
  unsigned len = strlen(name);
  return (sizeof("") > 1) && (len > sizeof("") - 1) &&
         (strcmp(name + len - (sizeof("") - 1), "") == 0);
}


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

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

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

LLVM IR (-O2):
define i32 @bzipped_filename_p(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
ret i32 0
}
/* Variables and functions */
int shash_rs_update(int /*<<< orphan*/, char const *);
unsigned shash_rs(const char *buf) { return shash_rs_update(0, buf); }


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

x86 assembly (clang, -O2):
<shash_rs>:
mov    %rdi,%rsi
xor    %edi,%edi
jmp    1030 <shash_rs_update@plt>

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

LLVM IR (-O2):
define i32 @shash_rs(i8* %0) {
%2 = tail call i32 @shash_rs_update(i32 0, i8* %0)
ret i32 %2
}
/* Variables and functions */
char *malloc(int);
int rand();
char *realloc(char *, int);
int /*<<< orphan*/ strcpy(char *, char *);
char *fn42() {
  char *result;
  result = malloc(20 + rand() % 20);
  result = realloc(result, 30 + rand() % 20);
  strcpy((char *)result, "fn42");
  return result;
}


x86 assembly (clang, -O0):
<fn42>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1060 <rand@plt>
mov    $0x14,%ecx
cltd
idiv   %ecx
mov    %edx,%edi
add    $0x14,%edi
call   1040 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    $0x0,%al
call   1060 <rand@plt>
mov    -0x10(%rbp),%rdi
mov    $0x14,%ecx
cltd
idiv   %ecx
mov    %edx,%esi
add    $0x1e,%esi
call   1050 <realloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xe67(%rip),%rsi
call   1030 <strcpy@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fn42>:
push   %rbx
xor    %eax,%eax
call   1060 <rand@plt>
cltq
imul   $0x66666667,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x23,%rcx
add    %edx,%ecx
shl    $0x2,%ecx
lea    (%rcx,%rcx,4),%ecx
neg    %ecx
lea    (%rax,%rcx,1),%edi
add    $0x14,%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
xor    %eax,%eax
call   1060 <rand@plt>
cltq
imul   $0x66666667,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x23,%rcx
add    %edx,%ecx
shl    $0x2,%ecx
lea    (%rcx,%rcx,4),%ecx
neg    %ecx
lea    (%rax,%rcx,1),%esi
add    $0x1e,%esi
mov    %rbx,%rdi
call   1050 <realloc@plt>
mov    %rax,%rbx
lea    0xe4f(%rip),%rsi
mov    %rax,%rdi
call   1030 <strcpy@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"fn42\00"
define i8* @fn42() {
%1 = alloca i8*
%2 = call i32 (...) @rand()
%3 = srem i32 %2, 20
%4 = add nsw i32 20, %3
%5 = call i8* @malloc(i32 %4)
store i8* %5, i8** %1
%6 = load i8*, i8** %1
%7 = call i32 (...) @rand()
%8 = srem i32 %7, 20
%9 = add nsw i32 30, %8
%10 = call i8* @realloc(i8* %6, i32 %9)
store i8* %10, i8** %1
%11 = load i8*, i8** %1
%12 = call i32 @strcpy(i8* %11, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%13 = load i8*, i8** %1
ret i8* %13
}

LLVM IR (-O2):
@.str = [5 x i8] c"fn42\00"
define i8* @fn42() {
%1 = tail call i32 (...) @rand()
%2 = srem i32 %1, 20
%3 = add nsw i32 %2, 20
%4 = tail call i8* @malloc(i32 %3)
%5 = tail call i32 (...) @rand()
%6 = srem i32 %5, 20
%7 = add nsw i32 %6, 30
%8 = tail call i8* @realloc(i8* %4, i32 %7)
%9 = tail call i32 @strcpy(i8* %8, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret i8* %8
}
int assertEquals(int *elements, int *expected) {
  int size = sizeof(elements) / 4;
  int i = 0;
  for (i = 0; i <= size; i++) {
    if (!(elements[i] == expected[i])) {
      return 0;
    }
  }
  return 1;
}


x86 assembly (clang, -O0):
<assertEquals>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
movl   $0x2,-0x1c(%rbp)
movl   $0x0,-0x20(%rbp)
movl   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jg     1168 <assertEquals+0x68>
mov    -0x10(%rbp),%rax
movslq -0x20(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    -0x18(%rbp),%rcx
movslq -0x20(%rbp),%rdx
cmp    (%rcx,%rdx,4),%eax
je     1155 <assertEquals+0x55>
movl   $0x0,-0x4(%rbp)
jmp    116f <assertEquals+0x6f>
jmp    115a <assertEquals+0x5a>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    1121 <assertEquals+0x21>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<assertEquals>:
mov    (%rdi),%ecx
xor    %eax,%eax
cmp    (%rsi),%ecx
jne    111b <assertEquals+0x1b>
mov    0x4(%rdi),%ecx
cmp    0x4(%rsi),%ecx
jne    111b <assertEquals+0x1b>
mov    0x8(%rdi),%ecx
xor    %eax,%eax
cmp    0x8(%rsi),%ecx
sete   %al
ret

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

LLVM IR (-O2):
define i32 @assertEquals(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %0
%4 = load i32, i32* %1
%5 = icmp eq i32 %3, %4
br i1 %5, label %6, label %19
6: ; preds = %2
%7 = getelementptr inbounds i32, i32* %0, i64 1
%8 = load i32, i32* %7
%9 = getelementptr inbounds i32, i32* %1, i64 1
%10 = load i32, i32* %9
%11 = icmp eq i32 %8, %10
br i1 %11, label %12, label %19
12: ; preds = %6
%13 = getelementptr inbounds i32, i32* %0, i64 2
%14 = load i32, i32* %13
%15 = getelementptr inbounds i32, i32* %1, i64 2
%16 = load i32, i32* %15
%17 = icmp eq i32 %14, %16
%18 = zext i1 %17 to i32
br label %19
19: ; preds = %12, %6, %2
%20 = phi i32 [ 0, %2 ], [ 0, %6 ], [ %18, %12 ]
ret i32 %20
}
/* Variables and functions */
int /*<<< orphan*/ strcat(char *, char *);
void dump_label(char *label, char *dump) {
  if (label[0] != 0) {
    strcat(dump, label);
    strcat(dump, ":");
  }
}


x86 assembly (clang, -O0):
<dump_label>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     114d <dump_label+0x3d>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcat@plt>
mov    -0x10(%rbp),%rdi
lea    0xeb8(%rip),%rsi
call   1030 <strcat@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dump_label>:
push   %rbx
cmpb   $0x0,(%rdi)
je     1134 <dump_label+0x24>
mov    %rsi,%rbx
mov    %rdi,%rsi
mov    %rbx,%rdi
call   1030 <strcat@plt>
lea    0xed5(%rip),%rsi
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <strcat@plt>
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [2 x i8] c":\00"
define void @dump_label(i8* %0, i8* %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %8, label %5
5: ; preds = %2
%6 = tail call i32 @strcat(i8* %1, i8* %0)
%7 = tail call i32 @strcat(i8* %1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %5, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void bar(void) { printf("Bar!\n"); }


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

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

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

LLVM IR (-O2):
@str = [5 x i8] c"Bar!\00"
define void @bar() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
double __nv_fma_rn(double, double, double);
double __fma_rn(double __a, double __b, double __c) {
  return __nv_fma_rn(__a, __b, __c);
}


x86 assembly (clang, -O0):
<__fma_rn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm2
call   1030 <__nv_fma_rn@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__fma_rn>:
jmp    1030 <__nv_fma_rn@plt>

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

LLVM IR (-O2):
define double @__fma_rn(double %0, double %1, double %2) {
%4 = tail call double @__nv_fma_rn(double %0, double %1, double %2)
ret double %4
}
/* Type definitions */
struct Audio {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ SDL_PauseAudio(int);
void sdl_audio_pause(struct Audio *audio) { SDL_PauseAudio(1); }


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

x86 assembly (clang, -O2):
<sdl_audio_pause>:
mov    $0x1,%edi
jmp    1030 <SDL_PauseAudio@plt>

LLVM IR (-O0):
%struct.Audio = type { i32 }
define void @sdl_audio_pause(%struct.Audio* %0) {
%2 = alloca %struct.Audio*
store %struct.Audio* %0, %struct.Audio** %2
%3 = call i32 @SDL_PauseAudio(i32 1)
ret void
}

LLVM IR (-O2):
%struct.Audio = type { i32 }
define void @sdl_audio_pause(%struct.Audio* nocapture readnone %0) {
%2 = tail call i32 @SDL_PauseAudio(i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ strcpy(char *, char *);
void func(char **argv) {
  printf("running strcpy...\n");
  char arr[16];
  strcpy(arr, argv[1]);
}


x86 assembly (clang, -O0):
<func>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xecd(%rip),%rdi
call   1040 <printf@plt>
lea    -0x20(%rbp),%rdi
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%rsi
call   1030 <strcpy@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<func>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
lea    0xed1(%rip),%rdi
call   1040 <puts@plt>
mov    0x8(%rbx),%rsi
mov    %rsp,%rdi
call   1030 <strcpy@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [19 x i8] c"running strcpy...\0A\00"
define void @func(i8** %0) {
%2 = alloca i8**
%3 = alloca [16 x i8]
store i8** %0, i8*** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%5 = getelementptr inbounds [16 x i8], [16 x i8]* %3, i64 0, i64 0
%6 = load i8**, i8*** %2
%7 = getelementptr inbounds i8*, i8** %6, i64 1
%8 = load i8*, i8** %7
%9 = call i32 @strcpy(i8* %5, i8* %8)
ret void
}

LLVM IR (-O2):
@str = [18 x i8] c"running strcpy...\00"
define void @func(i8** nocapture %0) {
%2 = alloca [16 x i8]
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str, i64 0, i64 0))
%4 = getelementptr inbounds [16 x i8], [16 x i8]* %2, i64 0, i64 0
%5 = getelementptr inbounds i8*, i8** %0, i64 1
%6 = load i8*, i8** %5
%7 = call i32 @strcpy(i8* %4, i8* %6)
ret void
}
/* Variables and functions */
int accept(int, int /*<<< orphan*/, int /*<<< orphan*/);
int network_accept(int master) { return accept(master, 0, 0); }


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

x86 assembly (clang, -O2):
<network_accept>:
xor    %esi,%esi
xor    %edx,%edx
jmp    1030 <accept@plt>

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

LLVM IR (-O2):
define i32 @network_accept(i32 %0) {
%2 = tail call i32 @accept(i32 %0, i32 0, i32 0)
ret i32 %2
}
/* Type definitions */
struct gheap_ctx {
  int dummy;
};

/* Variables and functions */
size_t const gheap_is_heap_until(struct gheap_ctx const *const,
                                 void const *const, size_t const);
int gheap_is_heap(const struct gheap_ctx *const ctx, const void *const base,
                  const size_t heap_size) {
  return (gheap_is_heap_until(ctx, base, heap_size) == heap_size);
}


x86 assembly (clang, -O0):
<gheap_is_heap>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <gheap_is_heap_until@plt>
cmp    -0x18(%rbp),%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gheap_is_heap>:
push   %rbx
mov    %rdx,%rbx
call   1030 <gheap_is_heap_until@plt>
xor    %ecx,%ecx
cmp    %rbx,%rax
sete   %cl
mov    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.gheap_ctx = type { i32 }
define i32 @gheap_is_heap(%struct.gheap_ctx* %0, i8* %1, i64 %2) {
%4 = alloca %struct.gheap_ctx*
%5 = alloca i8*
%6 = alloca i64
store %struct.gheap_ctx* %0, %struct.gheap_ctx** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%7 = load %struct.gheap_ctx*, %struct.gheap_ctx** %4
%8 = load i8*, i8** %5
%9 = load i64, i64* %6
%10 = call i64 @gheap_is_heap_until(%struct.gheap_ctx* %7, i8* %8, i64 %9)
%11 = load i64, i64* %6
%12 = icmp eq i64 %10, %11
%13 = zext i1 %12 to i32
ret i32 %13
}

LLVM IR (-O2):
%struct.gheap_ctx = type { i32 }
define i32 @gheap_is_heap(%struct.gheap_ctx* %0, i8* %1, i64 %2) {
%4 = tail call i64 @gheap_is_heap_until(%struct.gheap_ctx* %0, i8* %1, i64 %2)
%5 = icmp eq i64 %4, %2
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
scalar_t__ output_check(int);
int /*<<< orphan*/ output_orbits_append(char *);
int /*<<< orphan*/ output_timing();
void problem_output() {
  output_timing();
  if (output_check(2. * 3.14159265358979323846)) {
    output_orbits_append("orbit.txt");
  }
}


x86 assembly (clang, -O0):
<problem_output>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <output_timing@plt>
mov    $0x6,%edi
call   1050 <output_check@plt>
cmp    $0x0,%rax
je     115b <problem_output+0x2b>
lea    0xeaa(%rip),%rdi
call   1040 <output_orbits_append@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<problem_output>:
push   %rax
xor    %eax,%eax
call   1030 <output_timing@plt>
mov    $0x6,%edi
call   1050 <output_check@plt>
test   %rax,%rax
je     1154 <problem_output+0x24>
lea    0xeb2(%rip),%rdi
pop    %rax
jmp    1040 <output_orbits_append@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [10 x i8] c"orbit.txt\00"
define void @problem_output() {
%1 = call i32 (...) @output_timing()
%2 = call i64 @output_check(i32 6)
%3 = icmp ne i64 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = call i32 @output_orbits_append(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %0
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"orbit.txt\00"
define void @problem_output() {
%1 = tail call i32 (...) @output_timing()
%2 = tail call i64 @output_check(i32 6)
%3 = icmp eq i64 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %0
%5 = tail call i32 @output_orbits_append(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %0
ret void
}
/* Variables and functions */
int nc_dhcpd_go();
int nc_dhcp_run() { return nc_dhcpd_go(); }


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

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

LLVM IR (-O0):
define i32 @nc_dhcp_run() {
%1 = call i32 (...) @nc_dhcpd_go()
ret i32 %1
}

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

/* Variables and functions */
int _print_nb(int /*<<< orphan*/ *, int, int);
int printf_handle_flag_X(va_list *parameters) {
  return _print_nb(parameters, 1, 16);
}


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

x86 assembly (clang, -O2):
<printf_handle_flag_X>:
mov    $0x1,%esi
mov    $0x10,%edx
jmp    1030 <_print_nb@plt>

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

LLVM IR (-O2):
define i32 @printf_handle_flag_X(i32* %0) {
%2 = tail call i32 @_print_nb(i32* %0, i32 1, i32 16)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ soar_cExciseAllProductionsOfType(int);
int /*<<< orphan*/ soar_cReInitSoar();
void soar_cExciseAllProductions(void) {
  soar_cExciseAllProductionsOfType(1);
  soar_cExciseAllProductionsOfType(2);
  soar_cExciseAllProductionsOfType(3);
  soar_cExciseAllProductionsOfType(0);
  soar_cReInitSoar();
}


x86 assembly (clang, -O0):
<soar_cExciseAllProductions>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1030 <soar_cExciseAllProductionsOfType@plt>
mov    $0x2,%edi
call   1030 <soar_cExciseAllProductionsOfType@plt>
mov    $0x3,%edi
call   1030 <soar_cExciseAllProductionsOfType@plt>
xor    %edi,%edi
call   1030 <soar_cExciseAllProductionsOfType@plt>
mov    $0x0,%al
call   1040 <soar_cReInitSoar@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<soar_cExciseAllProductions>:
push   %rax
mov    $0x1,%edi
call   1030 <soar_cExciseAllProductionsOfType@plt>
mov    $0x2,%edi
call   1030 <soar_cExciseAllProductionsOfType@plt>
mov    $0x3,%edi
call   1030 <soar_cExciseAllProductionsOfType@plt>
xor    %edi,%edi
call   1030 <soar_cExciseAllProductionsOfType@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <soar_cReInitSoar@plt>

LLVM IR (-O0):
define void @soar_cExciseAllProductions() {
%1 = call i32 @soar_cExciseAllProductionsOfType(i32 1)
%2 = call i32 @soar_cExciseAllProductionsOfType(i32 2)
%3 = call i32 @soar_cExciseAllProductionsOfType(i32 3)
%4 = call i32 @soar_cExciseAllProductionsOfType(i32 0)
%5 = call i32 (...) @soar_cReInitSoar()
ret void
}

LLVM IR (-O2):
define void @soar_cExciseAllProductions() {
%1 = tail call i32 @soar_cExciseAllProductionsOfType(i32 1)
%2 = tail call i32 @soar_cExciseAllProductionsOfType(i32 2)
%3 = tail call i32 @soar_cExciseAllProductionsOfType(i32 3)
%4 = tail call i32 @soar_cExciseAllProductionsOfType(i32 0)
%5 = tail call i32 (...) @soar_cReInitSoar()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isalpha(int);
void t_isalpha_0xa6() {
  Assert_real((isalpha(166) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isalpha.c",
              835, ("isalpha should be 0 for 0xa6"));
}


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

x86 assembly (clang, -O2):
<t_isalpha_0xa6>:
push   %rax
mov    $0xa6,%edi
call   1030 <isalpha@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x343,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isalpha.c\00"
@.str.1 = [29 x i8] c"isalpha should be 0 for 0xa6\00"
define void @t_isalpha_0xa6() {
%1 = call i64 @isalpha(i32 166)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 835, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isalpha.c\00"
@.str.1 = [29 x i8] c"isalpha should be 0 for 0xa6\00"
define void @t_isalpha_0xa6() {
%1 = tail call i64 @isalpha(i32 166)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 835, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ print_file(char *);
void local_flag() {
  print_file("flag1");
  exit(0);
}


x86 assembly (clang, -O0):
<local_flag>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <print_file@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<local_flag>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <print_file@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"flag1\00"
define void @local_flag() {
%1 = call i32 @print_file(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [6 x i8] c"flag1\00"
define void @local_flag() {
%1 = tail call i32 @print_file(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 0)
unreachable
}
void ff_hevc_put_hevc_bi_w_epel_h16_8_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_bi_w_epel_h16_8_sse4() {
ret void
}
/* Variables and functions */
scalar_t__ intcmp(char *, char *);
int binary_lt(char *s1, char *s2) { return intcmp(s1, s2) < 0; }


x86 assembly (clang, -O0):
<binary_lt>:
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 <intcmp@plt>
cmp    $0x0,%rax
setl   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<binary_lt>:
push   %rax
call   1030 <intcmp@plt>
shr    $0x3f,%rax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @binary_lt(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 i64 @intcmp(i8* %5, i8* %6)
%8 = icmp slt i64 %7, 0
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @binary_lt(i8* %0, i8* %1) {
%3 = tail call i64 @intcmp(i8* %0, i8* %1)
%4 = lshr i64 %3, 63
%5 = trunc i64 %4 to i32
ret i32 %5
}
void s5p6440_default_sdhci2(void) {}


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

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

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

LLVM IR (-O2):
define void @s5p6440_default_sdhci2() {
ret void
}
/* Variables and functions */
int strlen(char *);
int getDirLen(char *fileName, char *dirName) {
  return strlen(fileName) + strlen(dirName) + 1;
}


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

x86 assembly (clang, -O2):
<getDirLen>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
call   1030 <strlen@plt>
mov    %eax,%r14d
mov    %rbx,%rdi
call   1030 <strlen@plt>
add    %r14d,%eax
add    $0x1,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @getDirLen(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 = call i32 @strlen(i8* %5)
%7 = load i8*, i8** %4
%8 = call i32 @strlen(i8* %7)
%9 = add nsw i32 %6, %8
%10 = add nsw i32 %9, 1
ret i32 %10
}

LLVM IR (-O2):
define i32 @getDirLen(i8* %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %0)
%4 = tail call i32 @strlen(i8* %1)
%5 = add i32 %3, 1
%6 = add i32 %5, %4
ret i32 %6
}
/* Variables and functions */
char *strchr(char const *, int);
char *xstrchr(const char *s1, int c) { return s1 ? strchr(s1, c) : NULL; }


x86 assembly (clang, -O0):
<xstrchr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     113f <xstrchr+0x2f>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <strchr@plt>
mov    %rax,-0x18(%rbp)
jmp    114a <xstrchr+0x3a>
xor    %eax,%eax
mov    %rax,-0x18(%rbp)
jmp    114a <xstrchr+0x3a>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xstrchr>:
test   %rdi,%rdi
je     111a <xstrchr+0xa>
jmp    1030 <strchr@plt>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i8* @xstrchr(i8* %0, i32 %1) {
%3 = icmp eq i8* %0, null
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i8* @strchr(i8* %0, i32 %1)
br label %6
6: ; preds = %2, %4
%7 = phi i8* [ %5, %4 ], [ null, %2 ]
ret i8* %7
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ yyparse();
main(int argc, char **argv) {
  yyparse();
  exit(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    $0x0,%al
call   1030 <yyparse@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <yyparse@plt>
xor    %edi,%edi
call   1040 <exit@plt>

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 i32 (...) @yyparse()
%7 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @yyparse()
%4 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ options_get_bool(char const *);
int /*<<< orphan*/ send_bool_to_srv(int);
int /*<<< orphan*/ send_int_to_srv(int);
int /*<<< orphan*/ send_str_to_srv(char const *);
int /*<<< orphan*/ sync_bool_option(char const *);
void toggle_option(const char *name) {
  send_int_to_srv(0x07);
  send_str_to_srv(name);
  send_bool_to_srv(!options_get_bool(name));
  sync_bool_option(name);
}


x86 assembly (clang, -O0):
<toggle_option>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x7,%edi
call   1050 <send_int_to_srv@plt>
mov    -0x8(%rbp),%rdi
call   1070 <send_str_to_srv@plt>
mov    -0x8(%rbp),%rdi
call   1060 <options_get_bool@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <send_bool_to_srv@plt>
mov    -0x8(%rbp),%rdi
call   1040 <sync_bool_option@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<toggle_option>:
push   %rbx
mov    %rdi,%rbx
mov    $0x7,%edi
call   1050 <send_int_to_srv@plt>
mov    %rbx,%rdi
call   1070 <send_str_to_srv@plt>
mov    %rbx,%rdi
call   1060 <options_get_bool@plt>
xor    %edi,%edi
test   %eax,%eax
sete   %dil
call   1030 <send_bool_to_srv@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <sync_bool_option@plt>

LLVM IR (-O0):
define void @toggle_option(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @send_int_to_srv(i32 7)
%4 = load i8*, i8** %2
%5 = call i32 @send_str_to_srv(i8* %4)
%6 = load i8*, i8** %2
%7 = call i32 @options_get_bool(i8* %6)
%8 = icmp ne i32 %7, 0
%9 = xor i1 %8, true
%10 = zext i1 %9 to i32
%11 = call i32 @send_bool_to_srv(i32 %10)
%12 = load i8*, i8** %2
%13 = call i32 @sync_bool_option(i8* %12)
ret void
}

LLVM IR (-O2):
define void @toggle_option(i8* %0) {
%2 = tail call i32 @send_int_to_srv(i32 7)
%3 = tail call i32 @send_str_to_srv(i8* %0)
%4 = tail call i32 @options_get_bool(i8* %0)
%5 = icmp eq i32 %4, 0
%6 = zext i1 %5 to i32
%7 = tail call i32 @send_bool_to_srv(i32 %6)
%8 = tail call i32 @sync_bool_option(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ mock_put_c(int /*<<< orphan*/);
void mock_put_s(const char *s) {
  while (*s)
    mock_put_c(*s++);
}


x86 assembly (clang, -O0):
<mock_put_s>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1145 <mock_put_s+0x35>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%edi
call   1030 <mock_put_c@plt>
jmp    111c <mock_put_s+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mock_put_s>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1133 <mock_put_s+0x23>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movsbl %al,%edi
call   1030 <mock_put_c@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <mock_put_s+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @mock_put_s(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %12, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %10, %4 ], [ %2, %1 ]
%6 = phi i8* [ %7, %4 ], [ %0, %1 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = sext i8 %5 to i32
%9 = tail call i32 @mock_put_c(i32 %8)
%10 = load i8, i8* %7
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %4
12: ; preds = %4, %1
ret void
}
void *gram_null_append(void *h, void *t) { return (0); }


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

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

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

LLVM IR (-O2):
define noalias i8* @gram_null_append(i8* nocapture readnone %0, i8* nocapture readnone %1) {
ret i8* null
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ by_ptr_pp(int /*<<< orphan*/);
void or_by_ptr_pp(uint32_t x) {
  by_ptr_pp(x);
  or ();
}


x86 assembly (clang, -O0):
<or_by_ptr_pp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <by_ptr_pp@plt>
mov    $0x0,%al
call   1040 <or@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<or_by_ptr_pp>:
push   %rax
call   1030 <by_ptr_pp@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <or@plt>

LLVM IR (-O0):
define void @or_by_ptr_pp(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @by_ptr_pp(i32 %3)
%5 = call i32 (...) @or()
ret void
}

LLVM IR (-O2):
define void @or_by_ptr_pp(i32 %0) {
%2 = tail call i32 @by_ptr_pp(i32 %0)
%3 = tail call i32 (...) @or()
ret void
}
/* Variables and functions */
int rand();
int main(int argc, char **argv) {
  int x;
  int r = rand();
  if (0 == r) {
    x = 7;
  } else {
    x = 42;
  }
  return x;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
mov    %eax,-0x18(%rbp)
xor    %eax,%eax
cmp    -0x18(%rbp),%eax
jne    1147 <main+0x37>
movl   $0x7,-0x14(%rbp)
jmp    114e <main+0x3e>
movl   $0x2a,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <rand@plt>
test   %eax,%eax
mov    $0x7,%ecx
mov    $0x2a,%eax
cmove  %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @rand()
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 7, i32 42
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ box_double(int /*<<< orphan*/);
int /*<<< orphan*/ dpop();
int /*<<< orphan*/ fmod(double, double);
double untag_float_fast(int /*<<< orphan*/);
void primitive_float_mod(void) {
  double y = untag_float_fast(dpop());
  double x = untag_float_fast(dpop());
  ;
  box_double(fmod(x, y));
}


x86 assembly (clang, -O0):
<primitive_float_mod>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <dpop@plt>
mov    %eax,%edi
call   1050 <untag_float_fast@plt>
movsd  %xmm0,-0x8(%rbp)
mov    $0x0,%al
call   1030 <dpop@plt>
mov    %eax,%edi
call   1050 <untag_float_fast@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm1
call   1040 <fmod@plt>
mov    %eax,%edi
call   1060 <box_double@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<primitive_float_mod>:
push   %rax
xor    %eax,%eax
call   1030 <dpop@plt>
mov    %eax,%edi
call   1050 <untag_float_fast@plt>
movsd  %xmm0,(%rsp)
xor    %eax,%eax
call   1030 <dpop@plt>
mov    %eax,%edi
call   1050 <untag_float_fast@plt>
movsd  (%rsp),%xmm1
call   1040 <fmod@plt>
mov    %eax,%edi
pop    %rax
jmp    1060 <box_double@plt>

LLVM IR (-O0):
define void @primitive_float_mod() {
%1 = alloca double
%2 = alloca double
%3 = call i32 (...) @dpop()
%4 = call double @untag_float_fast(i32 %3)
store double %4, double* %1
%5 = call i32 (...) @dpop()
%6 = call double @untag_float_fast(i32 %5)
store double %6, double* %2
%7 = load double, double* %2
%8 = load double, double* %1
%9 = call i32 @fmod(double %7, double %8)
%10 = call i32 @box_double(i32 %9)
ret void
}

LLVM IR (-O2):
define void @primitive_float_mod() {
%1 = tail call i32 (...) @dpop()
%2 = tail call double @untag_float_fast(i32 %1)
%3 = tail call i32 (...) @dpop()
%4 = tail call double @untag_float_fast(i32 %3)
%5 = tail call i32 @fmod(double %4, double %2)
%6 = tail call i32 @box_double(i32 %5)
ret void
}
void qdss_disable(struct qdss_source *src) {}


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

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

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

LLVM IR (-O2):
%struct.qdss_source = type opaque
define void @qdss_disable(%struct.qdss_source* nocapture %0) {
ret void
}
int test_imm_F7uint64_midword_reg(unsigned long long val) {
  return ((val >> 16) & (0xF7 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_F7uint64_midword_reg>:
test   $0xf70000,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_F7uint64_midword_reg(i64 %0) {
%2 = and i64 %0, 16187392
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
void ARGBMirrorRow_Any_AVX2() {}


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

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

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

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


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

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

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

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

/* Variables and functions */
int strlen(char const *);
int /*<<< orphan*/ write(int, ...);
void write_text(int socket_fd, const char *text) {
  int length = strlen(text) + 1;
  write(socket_fd, &length, sizeof(length));
  write(socket_fd, text, length);
}


x86 assembly (clang, -O0):
<write_text>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x14(%rbp),%rsi
mov    $0x4,%edx
mov    $0x0,%al
call   1030 <write@plt>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    $0x0,%al
call   1030 <write@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_text>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
mov    %rsi,%rdi
call   1040 <strlen@plt>
add    $0x1,%eax
mov    %eax,0x4(%rsp)
lea    0x4(%rsp),%rsi
mov    $0x4,%edx
mov    %ebp,%edi
xor    %eax,%eax
call   1030 <write@plt>
mov    0x4(%rsp),%edx
mov    %ebp,%edi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <write@plt>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define void @write_text(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i32
store i32 %0, i32* %3
store i8* %1, i8** %4
%6 = load i8*, i8** %4
%7 = call i32 @strlen(i8* %6)
%8 = add nsw i32 %7, 1
store i32 %8, i32* %5
%9 = load i32, i32* %3
%10 = call i32 (i32, ...) @write(i32 %9, i32* %5, i64 4)
%11 = load i32, i32* %3
%12 = load i8*, i8** %4
%13 = load i32, i32* %5
%14 = call i32 (i32, ...) @write(i32 %11, i8* %12, i32 %13)
ret void
}

LLVM IR (-O2):
define void @write_text(i32 %0, i8* %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = tail call i32 @strlen(i8* %1)
%6 = add nsw i32 %5, 1
store i32 %6, i32* %3
%7 = call i32 (i32, ...) @write(i32 %0, i32* %3, i64 4)
%8 = load i32, i32* %3
%9 = call i32 (i32, ...) @write(i32 %0, i8* %1, i32 %8)
ret void
}
void test42() {
  int a;
  a = 30;
}


x86 assembly (clang, -O0):
<test42>:
push   %rbp
mov    %rsp,%rbp
movl   $0x1e,-0x4(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @test42() {
%1 = alloca i32
store i32 30, i32* %1
ret void
}

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