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

/* Variables and functions */
int toml_rtod_ex(char const *, double *, char *, int);
int toml_rtod(const char *src, double *ret_) {
  char buf[100];
  return toml_rtod_ex(src, ret_, buf, sizeof(buf));
}


x86 assembly (clang, -O0):
<toml_rtod>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
lea    -0x80(%rbp),%rdx
mov    $0x64,%ecx
call   1030 <toml_rtod_ex@plt>
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<toml_rtod>:
sub    $0x68,%rsp
mov    %rsp,%rdx
mov    $0x64,%ecx
call   1030 <toml_rtod_ex@plt>
add    $0x68,%rsp
ret

LLVM IR (-O0):
define i32 @toml_rtod(i8* %0, double* %1) {
%3 = alloca i8*
%4 = alloca double*
%5 = alloca [100 x i8]
store i8* %0, i8** %3
store double* %1, double** %4
%6 = load i8*, i8** %3
%7 = load double*, double** %4
%8 = getelementptr inbounds [100 x i8], [100 x i8]* %5, i64 0, i64 0
%9 = call i32 @toml_rtod_ex(i8* %6, double* %7, i8* %8, i32 100)
ret i32 %9
}

LLVM IR (-O2):
define i32 @toml_rtod(i8* %0, double* %1) {
%3 = alloca [100 x i8]
%4 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%5 = call i32 @toml_rtod_ex(i8* %0, double* %1, i8* %4, i32 100)
ret i32 %5
}
/* Variables and functions */
char *malloc(int);
int /*<<< orphan*/ pthread_exit(void *);
int /*<<< orphan*/ strcpy(char *, char *);
void *thread_function(void) {
  char *hello = malloc(sizeof(char) * 10);
  strcpy(hello, "hello world");
  pthread_exit((void *)hello);
}


x86 assembly (clang, -O0):
<thread_function>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0xa,%edi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xeaf(%rip),%rsi
call   1030 <strcpy@plt>
mov    -0x10(%rbp),%rdi
call   1040 <pthread_exit@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<thread_function>:
push   %rbx
mov    $0xa,%edi
call   1050 <malloc@plt>
mov    %rax,%rbx
lea    0xebb(%rip),%rsi
mov    %rax,%rdi
call   1030 <strcpy@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <pthread_exit@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"hello world\00"
define i8* @thread_function() {
%1 = alloca i8*
%2 = alloca i8*
%3 = call i8* @malloc(i32 10)
store i8* %3, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @strcpy(i8* %4, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%6 = load i8*, i8** %2
%7 = call i32 @pthread_exit(i8* %6)
%8 = load i8*, i8** %1
ret i8* %8
}

LLVM IR (-O2):
@.str = [12 x i8] c"hello world\00"
define noalias i8* @thread_function() {
%1 = tail call dereferenceable_or_null(10) i8* @malloc(i32 10)
%2 = tail call i32 @strcpy(i8* %1, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @pthread_exit(i8* %1)
ret i8* undef
}
/* Type definitions */
struct ac_buffer {
  int dummy;
};
typedef int /*<<< orphan*/ int16_t;

/* Variables and functions */
int _buffer_write(struct ac_buffer *, int /*<<< orphan*/ *, int);
int buffer_write_short(struct ac_buffer *buffer, int16_t value) {
  return _buffer_write(buffer, &value, sizeof(short));
}


x86 assembly (clang, -O0):
<buffer_write_short>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0xc(%rbp),%rsi
mov    $0x2,%edx
call   1030 <_buffer_write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<buffer_write_short>:
push   %rax
mov    %esi,0x4(%rsp)
lea    0x4(%rsp),%rsi
mov    $0x2,%edx
call   1030 <_buffer_write@plt>
pop    %rcx
ret

LLVM IR (-O0):
%struct.ac_buffer = type { i32 }
define i32 @buffer_write_short(%struct.ac_buffer* %0, i32 %1) {
%3 = alloca %struct.ac_buffer*
%4 = alloca i32
store %struct.ac_buffer* %0, %struct.ac_buffer** %3
store i32 %1, i32* %4
%5 = load %struct.ac_buffer*, %struct.ac_buffer** %3
%6 = call i32 @_buffer_write(%struct.ac_buffer* %5, i32* %4, i32 2)
ret i32 %6
}

LLVM IR (-O2):
%struct.ac_buffer = type { i32 }
define i32 @buffer_write_short(%struct.ac_buffer* %0, i32 %1) {
%3 = alloca i32
store i32 %1, i32* %3
%4 = call i32 @_buffer_write(%struct.ac_buffer* %0, i32* %3, i32 2)
ret i32 %4
}
void futex_wake(int *addr, int count) {
  long res;
  __asm volatile("syscall"
                 : "=a"(res)
                 : "0"(202), "D"(addr), "S"(1), "d"(count)
                 : "r11", "rcx", "memory");
}


x86 assembly (clang, -O0):
<futex_wake>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
mov    $0xca,%eax
mov    $0x1,%esi
syscall
mov    %rax,-0x18(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<futex_wake>:
mov    %esi,%edx
mov    $0xca,%eax
mov    $0x1,%esi
syscall
ret

LLVM IR (-O0):
define void @futex_wake(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i64
store i32* %0, i32** %3
store i32 %1, i32* %4
%6 = load i32*, i32** %3
%7 = load i32, i32* %4
%8 = call i64 asm sideeffect "syscall", "={ax},0,{di},{si},{dx},~{r11},~{rcx},~{memory},~{dirflag},~{fpsr},~{flags}"(i64 202, i32* %6, i32 1, i32 %7)
store i64 %8, i64* %5
ret void
}

LLVM IR (-O2):
define void @futex_wake(i32* %0, i32 %1) {
%3 = tail call i64 asm sideeffect "syscall", "={ax},0,{di},{si},{dx},~{r11},~{rcx},~{memory},~{dirflag},~{fpsr},~{flags}"(i64 202, i32* %0, i32 1, i32 %1)
ret void
}
/* Variables and functions */
int get_npeople_qss(int);
int get_npeople(int i, double dummy_t) { return get_npeople_qss(i); }


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

x86 assembly (clang, -O2):
<get_npeople>:
jmp    1030 <get_npeople_qss@plt>

LLVM IR (-O0):
define i32 @get_npeople(i32 %0, double %1) {
%3 = alloca i32
%4 = alloca double
store i32 %0, i32* %3
store double %1, double* %4
%5 = load i32, i32* %3
%6 = call i32 @get_npeople_qss(i32 %5)
ret i32 %6
}

LLVM IR (-O2):
define i32 @get_npeople(i32 %0, double %1) {
%3 = tail call i32 @get_npeople_qss(i32 %0)
ret i32 %3
}
/* Variables and functions */
int write(int, unsigned char *, int);
int rs232_send_byte(int fd, unsigned char byte) {
  int n;
  n = write(fd, &byte, 1);
  if (n < 0)
    return (-1);
  return (0);
}


x86 assembly (clang, -O0):
<rs232_send_byte>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %edi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%edi
lea    -0x9(%rbp),%rsi
mov    $0x1,%edx
call   1030 <write@plt>
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
jge    114b <rs232_send_byte+0x3b>
movl   $0xffffffff,-0x4(%rbp)
jmp    1152 <rs232_send_byte+0x42>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rs232_send_byte>:
push   %rax
mov    %sil,0x7(%rsp)
lea    0x7(%rsp),%rsi
mov    $0x1,%edx
call   1030 <write@plt>
sar    $0x1f,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @rs232_send_byte(i32 %0, i8 zeroext %1) {
%3 = alloca i8
store i8 %1, i8* %3
%4 = call i32 @write(i32 %0, i8* %3, i32 1)
%5 = ashr i32 %4, 31
ret i32 %5
}
int test_imm_06int16_reg(short val) {
  return ((val) & (-0x06 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_06int16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%edx
and    $0xfffffffa,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test_imm_06int16_reg(i16 signext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = sext i16 %3 to i32
%5 = and i32 %4, -6
%6 = icmp ne i32 %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_06int16_reg(i16 signext %0) {
%2 = and i16 %0, -6
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Type definitions */
struct iam_container {
  int dummy;
};
typedef int /*<<< orphan*/ __u32;

/* Variables and functions */
__u32 lvar_root_ptr(struct iam_container *c) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.iam_container = type { i32 }
define i32 @lvar_root_ptr(%struct.iam_container* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
char readc(char *);
int ppp_up(void) { return readc("/etc/ppp/ppp0-status") == '1'; }


x86 assembly (clang, -O0):
<ppp_up>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <readc@plt>
movsbl %al,%eax
cmp    $0x31,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ppp_up>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <readc@plt>
xor    %ecx,%ecx
cmp    $0x31,%al
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [21 x i8] c"/etc/ppp/ppp0-status\00"
define i32 @ppp_up() {
%1 = call signext i8 @readc(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%2 = sext i8 %1 to i32
%3 = icmp eq i32 %2, 49
%4 = zext i1 %3 to i32
ret i32 %4
}

LLVM IR (-O2):
@.str = [21 x i8] c"/etc/ppp/ppp0-status\00"
define i32 @ppp_up() {
%1 = tail call signext i8 @readc(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%2 = icmp eq i8 %1, 49
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Type definitions */
typedef int int16_t;

/* Variables and functions */
void test_vorrimm_s16x8(int16_t *__restrict__ dest, int16_t *a) {
  int i;
  for (i = 0; i < 8; i++) {
    dest[i] = a[i] | 1;
  }
}


x86 assembly (clang, -O0):
<test_vorrimm_s16x8>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x8,-0x14(%rbp)
jge    1144 <test_vorrimm_s16x8+0x44>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
or     $0x1,%edx
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1113 <test_vorrimm_s16x8+0x13>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_vorrimm_s16x8>:
movups (%rsi),%xmm0
movaps 0xef6(%rip),%xmm1
orps   %xmm1,%xmm0
movups %xmm0,(%rdi)
movups 0x10(%rsi),%xmm0
orps   %xmm1,%xmm0
movups %xmm0,0x10(%rdi)
ret

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

LLVM IR (-O2):
define void @test_vorrimm_s16x8(i32* noalias nocapture writeonly %0, i32* nocapture %1) {
%3 = bitcast i32* %1 to <4 x i32>*
%4 = load <4 x i32>, <4 x i32>* %3
%5 = or <4 x i32> %4, <i32 1, i32 1, i32 1, i32 1>
%6 = bitcast i32* %0 to <4 x i32>*
store <4 x i32> %5, <4 x i32>* %6
%7 = getelementptr inbounds i32, i32* %1, i64 4
%8 = getelementptr inbounds i32, i32* %0, i64 4
%9 = bitcast i32* %7 to <4 x i32>*
%10 = load <4 x i32>, <4 x i32>* %9
%11 = or <4 x i32> %10, <i32 1, i32 1, i32 1, i32 1>
%12 = bitcast i32* %8 to <4 x i32>*
store <4 x i32> %11, <4 x i32>* %12
ret void
}
/* Variables and functions */
scalar_t__ is_dotty(int const);
int is_fixed_ratio(const int symbology) {
  if (is_dotty(symbology)) {
    return 1;
  }
  switch (symbology) {
  case 57:
  case 144:
    return 1;
    break;
  }
  return 0;
}


x86 assembly (clang, -O0):
<is_fixed_ratio>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <is_dotty@plt>
cmp    $0x0,%rax
je     1139 <is_fixed_ratio+0x29>
movl   $0x1,-0x4(%rbp)
jmp    1173 <is_fixed_ratio+0x63>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
sub    $0x39,%eax
je     1160 <is_fixed_ratio+0x50>
jmp    114d <is_fixed_ratio+0x3d>
mov    -0xc(%rbp),%eax
sub    $0x90,%eax
jne    116c <is_fixed_ratio+0x5c>
jmp    1160 <is_fixed_ratio+0x50>
movl   $0x1,-0x4(%rbp)
jmp    1173 <is_fixed_ratio+0x63>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_fixed_ratio>:
push   %rbx
mov    %edi,%ebx
call   1030 <is_dotty@plt>
test   %rax,%rax
setne  %al
cmp    $0x39,%ebx
sete   %cl
cmp    $0x90,%ebx
sete   %dl
or     %cl,%dl
or     %al,%dl
movzbl %dl,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @is_fixed_ratio(i32 %0) {
%2 = tail call i64 @is_dotty(i32 %0)
%3 = icmp ne i64 %2, 0
%4 = icmp eq i32 %0, 57
%5 = icmp eq i32 %0, 144
%6 = or i1 %4, %5
%7 = or i1 %6, %3
%8 = zext i1 %7 to i32
ret i32 %8
}
/* Variables and functions */
char *strstr(char const *, char *);
int isGccLibPath(const char *path_) {
  const char *gccStart = strstr(path_, "/lib/gcc");
  if (!gccStart) {
    return 0;
  }
  return strstr(gccStart, "include") != NULL;
}


x86 assembly (clang, -O0):
<isGccLibPath>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xed9(%rip),%rsi
call   1030 <strstr@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1147 <isGccLibPath+0x37>
movl   $0x0,-0x4(%rbp)
jmp    1166 <isGccLibPath+0x56>
mov    -0x18(%rbp),%rdi
lea    0xeb7(%rip),%rsi
call   1030 <strstr@plt>
cmp    $0x0,%rax
setne  %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isGccLibPath>:
push   %rax
lea    0xee8(%rip),%rsi
call   1030 <strstr@plt>
test   %rax,%rax
je     113e <isGccLibPath+0x2e>
lea    0xee0(%rip),%rsi
mov    %rax,%rdi
call   1030 <strstr@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [9 x i8] c"/lib/gcc\00"
@.str.1 = [8 x i8] c"include\00"
define i32 @isGccLibPath(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i8* @strstr(i8* %5, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
store i8* %6, i8** %4
%7 = load i8*, i8** %4
%8 = icmp ne i8* %7, null
br i1 %8, label %10, label %9
9: ; preds = %1
store i32 0, i32* %2
br label %15
10: ; preds = %1
%11 = load i8*, i8** %4
%12 = call i8* @strstr(i8* %11, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%13 = icmp ne i8* %12, null
%14 = zext i1 %13 to i32
store i32 %14, i32* %2
br label %15
15: ; preds = %10, %9
%16 = load i32, i32* %2
ret i32 %16
}

LLVM IR (-O2):
@.str = [9 x i8] c"/lib/gcc\00"
@.str.1 = [8 x i8] c"include\00"
define i32 @isGccLibPath(i8* %0) {
%2 = tail call i8* @strstr(i8* dereferenceable(1) %0, i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i8* %2, null
br i1 %3, label %8, label %4
4: ; preds = %1
%5 = tail call i8* @strstr(i8* %2, i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%6 = icmp ne i8* %5, null
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %1, %4
%9 = phi i32 [ %7, %4 ], [ 0, %1 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ __mingw_aligned_free(void *);
void av_free(void *ptr) {
  if (ptr)
    __mingw_aligned_free(ptr);
}


x86 assembly (clang, -O0):
<av_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1130 <av_free+0x20>
mov    -0x8(%rbp),%rdi
call   1030 <__mingw_aligned_free@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @av_free(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 %5, label %8
5: ; preds = %1
%6 = load i8*, i8** %2
%7 = call i32 @__mingw_aligned_free(i8* %6)
br label %8
8: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
define void @av_free(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @__mingw_aligned_free(i8* %0)
br label %5
5: ; preds = %3, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memset(void *, int /*<<< orphan*/, int);
void InitDoubleData(void *p, int n) { memset(p, 0, sizeof(double) * n); }


x86 assembly (clang, -O0):
<InitDoubleData>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
movslq -0xc(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edx
xor    %esi,%esi
call   1030 <memset@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<InitDoubleData>:
lea    0x0(,%rsi,8),%edx
xor    %esi,%esi
jmp    1030 <memset@plt>

LLVM IR (-O0):
define void @InitDoubleData(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 = load i32, i32* %4
%7 = sext i32 %6 to i64
%8 = mul i64 8, %7
%9 = trunc i64 %8 to i32
%10 = call i32 @memset(i8* %5, i32 0, i32 %9)
ret void
}

LLVM IR (-O2):
define void @InitDoubleData(i8* %0, i32 %1) {
%3 = shl i32 %1, 3
%4 = tail call i32 @memset(i8* %0, i32 0, i32 %3)
ret void
}
/* Variables and functions */
scalar_t__ cbrt(float);
float cbrtf(float x) { return (float)cbrt(x); }


x86 assembly (clang, -O0):
<cbrtf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <cbrt@plt>
cvtsi2ss %rax,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cbrtf>:
push   %rax
call   1030 <cbrt@plt>
xorps  %xmm0,%xmm0
cvtsi2ss %rax,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @cbrtf(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call i64 @cbrt(float %3)
%5 = sitofp i64 %4 to float
ret float %5
}

LLVM IR (-O2):
define float @cbrtf(float %0) {
%2 = tail call i64 @cbrt(float %0)
%3 = sitofp i64 %2 to float
ret float %3
}
int int_compare(const void *A, const void *B) {
  int *a = (int *)A;
  int *b = (int *)B;
  if (*a < *b)
    return -1;
  else if (*a > *b)
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<int_compare>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rax
mov    (%rax),%eax
mov    -0x28(%rbp),%rcx
cmp    (%rcx),%eax
jge    113a <int_compare+0x3a>
movl   $0xffffffff,-0x4(%rbp)
jmp    115f <int_compare+0x5f>
mov    -0x20(%rbp),%rax
mov    (%rax),%eax
mov    -0x28(%rbp),%rcx
cmp    (%rcx),%eax
jle    1158 <int_compare+0x58>
movl   $0x1,-0x4(%rbp)
jmp    115f <int_compare+0x5f>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<int_compare>:
mov    (%rdi),%eax
xor    %ecx,%ecx
cmp    (%rsi),%eax
setg   %cl
mov    $0xffffffff,%eax
cmovge %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @int_compare(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = bitcast i8* %1 to i32*
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = icmp slt i32 %5, %6
%8 = icmp sgt i32 %5, %6
%9 = zext i1 %8 to i32
%10 = select i1 %7, i32 -1, i32 %9
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, char *, char *, char *);
void print_version() {
  printf("%s version %s, by %s (%s)\n", "esocks", "0.1", "editor700",
         "editor700@gmail.com");
}


x86 assembly (clang, -O0):
<print_version>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
lea    0xef9(%rip),%rsi
lea    0xef9(%rip),%rdx
lea    0xef6(%rip),%rcx
lea    0xef9(%rip),%r8
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_version>:
lea    0xee9(%rip),%rdi
lea    0xefd(%rip),%rsi
lea    0xefd(%rip),%rdx
lea    0xefa(%rip),%rcx
lea    0xefd(%rip),%r8
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [27 x i8] c"%s version %s, by %s (%s)\0A\00"
@.str.1 = [7 x i8] c"esocks\00"
@.str.2 = [4 x i8] c"0.1\00"
@.str.3 = [10 x i8] c"editor700\00"
@.str.4 = [20 x i8] c"editor700@gmail.com\00"
define void @print_version() {
%1 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.4, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [27 x i8] c"%s version %s, by %s (%s)\0A\00"
@.str.1 = [7 x i8] c"esocks\00"
@.str.2 = [4 x i8] c"0.1\00"
@.str.3 = [10 x i8] c"editor700\00"
@.str.4 = [20 x i8] c"editor700@gmail.com\00"
define void @print_version() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.4, i64 0, i64 0))
ret void
}
/* Variables and functions */
void *kernel_page_alloc();
int /*<<< orphan*/ memset32(void *, int /*<<< orphan*/, int);
void *kernel_page_alloc_zeroed() {
  void *page = kernel_page_alloc();
  memset32(page, 0, 1024);
  return page;
}


x86 assembly (clang, -O0):
<kernel_page_alloc_zeroed>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <kernel_page_alloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
xor    %esi,%esi
mov    $0x400,%edx
call   1030 <memset32@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<kernel_page_alloc_zeroed>:
push   %rbx
xor    %eax,%eax
call   1040 <kernel_page_alloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
xor    %esi,%esi
mov    $0x400,%edx
call   1030 <memset32@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @kernel_page_alloc_zeroed() {
%1 = alloca i8*
%2 = call i8* (...) @kernel_page_alloc()
store i8* %2, i8** %1
%3 = load i8*, i8** %1
%4 = call i32 @memset32(i8* %3, i32 0, i32 1024)
%5 = load i8*, i8** %1
ret i8* %5
}

LLVM IR (-O2):
define i8* @kernel_page_alloc_zeroed() {
%1 = tail call i8* (...) @kernel_page_alloc()
%2 = tail call i32 @memset32(i8* %1, i32 0, i32 1024)
ret i8* %1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("hi configure\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 = [14 x i8] c"hi configure\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [13 x i8] c"hi configure\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ SA1AbsoluteLongIndexedX(int);
int /*<<< orphan*/ STA8(int /*<<< orphan*/);
void Op9FM1(void) { STA8(SA1AbsoluteLongIndexedX(2)); }


x86 assembly (clang, -O0):
<Op9FM1>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2,%edi
call   1040 <SA1AbsoluteLongIndexedX@plt>
mov    %eax,%edi
call   1030 <STA8@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<Op9FM1>:
push   %rax
mov    $0x2,%edi
call   1040 <SA1AbsoluteLongIndexedX@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <STA8@plt>

LLVM IR (-O0):
define void @Op9FM1() {
%1 = call i32 @SA1AbsoluteLongIndexedX(i32 2)
%2 = call i32 @STA8(i32 %1)
ret void
}

LLVM IR (-O2):
define void @Op9FM1() {
%1 = tail call i32 @SA1AbsoluteLongIndexedX(i32 2)
%2 = tail call i32 @STA8(i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ LINUX_REBOOT_CMD_RESTART;
int /*<<< orphan*/ reboot(int /*<<< orphan*/);
int main() {
  reboot(LINUX_REBOOT_CMD_RESTART);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2ed0(%rip),%rax
mov    (%rax),%edi
call   1030 <reboot@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@LINUX_REBOOT_CMD_RESTART = global i32 0
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = load i32, i32* @LINUX_REBOOT_CMD_RESTART
%3 = call i32 @reboot(i32 %2)
ret i32 0
}

LLVM IR (-O2):
@LINUX_REBOOT_CMD_RESTART = global i32 0
define i32 @main() {
%1 = load i32, i32* @LINUX_REBOOT_CMD_RESTART
%2 = tail call i32 @reboot(i32 %1)
ret i32 0
}
/* Variables and functions */
char *memtob64(char const *, int /*<<< orphan*/);
int /*<<< orphan*/ strlen(char const *);
char *strtob64(const char *p) { return memtob64(p, strlen(p)); }


x86 assembly (clang, -O0):
<strtob64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x10(%rbp),%rdi
mov    %eax,%esi
call   1040 <memtob64@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strtob64>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
mov    %rbx,%rdi
mov    %eax,%esi
pop    %rbx
jmp    1040 <memtob64@plt>

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

LLVM IR (-O2):
define i8* @strtob64(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = tail call i8* @memtob64(i8* %0, i32 %2)
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isdigit(int);
void t_isdigit_0xa6() {
  Assert_real((isdigit(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_isdigit.c",
              835, ("isdigit should be 0 for 0xa6"));
}


x86 assembly (clang, -O0):
<t_isdigit_0xa6>:
push   %rbp
mov    %rsp,%rbp
mov    $0xa6,%edi
call   1030 <isdigit@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_isdigit_0xa6>:
push   %rax
mov    $0xa6,%edi
call   1030 <isdigit@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_isdigit.c\00"
@.str.1 = [29 x i8] c"isdigit should be 0 for 0xa6\00"
define void @t_isdigit_0xa6() {
%1 = call i64 @isdigit(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_isdigit.c\00"
@.str.1 = [29 x i8] c"isdigit should be 0 for 0xa6\00"
define void @t_isdigit_0xa6() {
%1 = tail call i64 @isdigit(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
}
int foo(int a, int b, int c) {
  int x = a * b;
  return c ? x : a;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
imul   -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     112c <foo+0x2c>
mov    -0x10(%rbp),%eax
mov    %eax,-0x14(%rbp)
jmp    1132 <foo+0x32>
mov    -0x4(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
test   %edx,%edx
mov    $0x1,%eax
cmovne %esi,%eax
imul   %edi,%eax
ret

LLVM IR (-O0):
define i32 @foo(i32 %0, i32 %1, i32 %2) {
%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
%8 = load i32, i32* %4
%9 = load i32, i32* %5
%10 = mul nsw i32 %8, %9
store i32 %10, i32* %7
%11 = load i32, i32* %6
%12 = icmp ne i32 %11, 0
br i1 %12, label %13, label %15
13: ; preds = %3
%14 = load i32, i32* %7
br label %17
15: ; preds = %3
%16 = load i32, i32* %4
br label %17
17: ; preds = %15, %13
%18 = phi i32 [ %14, %13 ], [ %16, %15 ]
ret i32 %18
}

LLVM IR (-O2):
define i32 @foo(i32 %0, i32 %1, i32 %2) {
%4 = icmp eq i32 %2, 0
%5 = select i1 %4, i32 1, i32 %1
%6 = mul nsw i32 %5, %0
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ parser_test();
int /*<<< orphan*/ random_messages_test();
int /*<<< orphan*/ scanner_test();
int /*<<< orphan*/ utils_test();
int main() {
  scanner_test();
  parser_test();
  random_messages_test();
  utils_test();
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <scanner_test@plt>
xor    %eax,%eax
call   1060 <parser_test@plt>
xor    %eax,%eax
call   1040 <random_messages_test@plt>
xor    %eax,%eax
call   1050 <utils_test@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @scanner_test()
%3 = call i32 (...) @parser_test()
%4 = call i32 (...) @random_messages_test()
%5 = call i32 (...) @utils_test()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @scanner_test()
%2 = tail call i32 (...) @parser_test()
%3 = tail call i32 (...) @random_messages_test()
%4 = tail call i32 (...) @utils_test()
ret i32 0
}
unsigned int token_count(char **toklist) {
  unsigned int i = 0;
  while (0 != *toklist) {
    i++;
    toklist++;
  }
  return i;
}


x86 assembly (clang, -O0):
<token_count>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rcx
xor    %eax,%eax
cmp    (%rcx),%rax
je     1138 <token_count+0x38>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x8(%rbp)
jmp    110f <token_count+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<token_count>:
cmpq   $0x0,(%rdi)
je     111d <token_count+0x1d>
xor    %eax,%eax
nopl   0x0(%rax,%rax,1)
cmpq   $0x0,0x8(%rdi,%rax,8)
lea    0x1(%rax),%rax
jne    1110 <token_count+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @token_count(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = icmp eq i8* %2, null
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i32 [ %7, %4 ], [ 0, %1 ]
%6 = phi i8** [ %8, %4 ], [ %0, %1 ]
%7 = add i32 %5, 1
%8 = getelementptr inbounds i8*, i8** %6, i64 1
%9 = load i8*, i8** %8
%10 = icmp eq i8* %9, null
br i1 %10, label %11, label %4
11: ; preds = %4, %1
%12 = phi i32 [ 0, %1 ], [ %7, %4 ]
ret i32 %12
}
/* Variables and functions */
void *icvAlignPtr(void *ptr, int align) {
  return (void *)(((size_t)ptr + align - 1) & -align);
}


x86 assembly (clang, -O0):
<icvAlignPtr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
add    %rcx,%rax
sub    $0x1,%rax
xor    %ecx,%ecx
sub    -0xc(%rbp),%ecx
movslq %ecx,%rcx
and    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<icvAlignPtr>:
movslq %esi,%rax
lea    (%rdi,%rax,1),%rcx
add    $0xffffffffffffffff,%rcx
neg    %eax
cltq
and    %rcx,%rax
ret

LLVM IR (-O0):
define i8* @icvAlignPtr(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 = ptrtoint i8* %5 to i64
%7 = load i32, i32* %4
%8 = sext i32 %7 to i64
%9 = add i64 %6, %8
%10 = sub i64 %9, 1
%11 = load i32, i32* %4
%12 = sub nsw i32 0, %11
%13 = sext i32 %12 to i64
%14 = and i64 %10, %13
%15 = inttoptr i64 %14 to i8*
ret i8* %15
}

LLVM IR (-O2):
define i8* @icvAlignPtr(i8* %0, i32 %1) {
%3 = ptrtoint i8* %0 to i64
%4 = sext i32 %1 to i64
%5 = add i64 %3, -1
%6 = add i64 %5, %4
%7 = sub nsw i32 0, %1
%8 = sext i32 %7 to i64
%9 = and i64 %6, %8
%10 = inttoptr i64 %9 to i8*
ret i8* %10
}
const char *__malidrv_build_info(void) {
  return "malidrv:  API_VERSION=600 REPO_URL=heads/master "
         "REVISION=r4p1-01rel0-b7b7392 CHANGED_REVISION=b7b7392 "
         "CHANGE_DATE=2014-08-06 17:20:47 +0530 BUILD_DATE=Tue Aug 12 16:39:56 "
         "IST 2014 BUILD=debug TARGET_PLATFORM= MALI_PLATFORM= KDIR= "
         "OS_MEMORY_KERNEL_BUFFER_SIZE_IN_MB=16 USING_UMP= USING_PROFILING= "
         "USING_INTERNAL_PROFILING= USING_GPU_UTILIZATION=1 "
         "USING_POWER_PERFORMANCE_POLICY= MALI_UPPER_HALF_SCHEDULING=1";
}


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

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

LLVM IR (-O0):
@.str = [407 x i8] c"malidrv: API_VERSION=600 REPO_URL=heads/master REVISION=r4p1-01rel0-b7b7392 CHANGED_REVISION=b7b7392 CHANGE_DATE=2014-08-06 17:20:47 +0530 BUILD_DATE=Tue Aug 12 16:39:56 IST 2014 BUILD=debug TARGET_PLATFORM= MALI_PLATFORM= KDIR= OS_MEMORY_KERNEL_BUFFER_SIZE_IN_MB=16 USING_UMP= USING_PROFILING= USING_INTERNAL_PROFILING= USING_GPU_UTILIZATION=1 USING_POWER_PERFORMANCE_POLICY= MALI_UPPER_HALF_SCHEDULING=1\00"
define i8* @__malidrv_build_info() {
ret i8* getelementptr inbounds ([407 x i8], [407 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [407 x i8] c"malidrv: API_VERSION=600 REPO_URL=heads/master REVISION=r4p1-01rel0-b7b7392 CHANGED_REVISION=b7b7392 CHANGE_DATE=2014-08-06 17:20:47 +0530 BUILD_DATE=Tue Aug 12 16:39:56 IST 2014 BUILD=debug TARGET_PLATFORM= MALI_PLATFORM= KDIR= OS_MEMORY_KERNEL_BUFFER_SIZE_IN_MB=16 USING_UMP= USING_PROFILING= USING_INTERNAL_PROFILING= USING_GPU_UTILIZATION=1 USING_POWER_PERFORMANCE_POLICY= MALI_UPPER_HALF_SCHEDULING=1\00"
define i8* @__malidrv_build_info() {
ret i8* getelementptr inbounds ([407 x i8], [407 x i8]* @.str, i64 0, i64 0)
}
/* Type definitions */
struct window {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ window_goto_pos(struct window *, int /*<<< orphan*/);
void window_page_top(struct window *win) { window_goto_pos(win, 0); }


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

x86 assembly (clang, -O2):
<window_page_top>:
xor    %esi,%esi
jmp    1030 <window_goto_pos@plt>

LLVM IR (-O0):
%struct.window = type { i32 }
define void @window_page_top(%struct.window* %0) {
%2 = alloca %struct.window*
store %struct.window* %0, %struct.window** %2
%3 = load %struct.window*, %struct.window** %2
%4 = call i32 @window_goto_pos(%struct.window* %3, i32 0)
ret void
}

LLVM IR (-O2):
%struct.window = type { i32 }
define void @window_page_top(%struct.window* %0) {
%2 = tail call i32 @window_goto_pos(%struct.window* %0, i32 0)
ret void
}
/* Variables and functions */
void ext_status_read(char **buffer, size_t *buffer_size,
                     bool *needs_deallocation) {
  (void)buffer;
  (void)buffer_size;
  (void)needs_deallocation;
}


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

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

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

LLVM IR (-O2):
define void @ext_status_read(i8** nocapture %0, i64* nocapture %1, i32* nocapture %2) {
ret void
}
int main(void) {
  int i = 99;
  if (i == 99 && i != 98) {
    return 42;
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x63,-0x8(%rbp)
cmpl   $0x63,-0x8(%rbp)
jne    1132 <main+0x32>
cmpl   $0x62,-0x8(%rbp)
je     1132 <main+0x32>
movl   $0x2a,-0x4(%rbp)
jmp    1139 <main+0x39>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 42
}
extern long shmem_long_finc(long *target, int pe) { return *target; }


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

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

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

LLVM IR (-O2):
define i64 @shmem_long_finc(i64* nocapture %0, i32 %1) {
%3 = load i64, i64* %0
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ m(char *, char *);
main(int c, char **v) { return !m(v[1], v[2]); }


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    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rsi
call   1030 <m@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x8(%rsi),%rdi
mov    0x10(%rsi),%rsi
call   1030 <m@plt>
xor    %ecx,%ecx
test   %eax,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = load i8*, i8** %3
%5 = getelementptr inbounds i8*, i8** %1, i64 2
%6 = load i8*, i8** %5
%7 = tail call i32 @m(i8* %4, i8* %6)
%8 = icmp eq i32 %7, 0
%9 = zext i1 %8 to i32
ret i32 %9
}
/* Variables and functions */
int shift_to_mmu_psize(int);
int check_and_get_huge_psize(int shift) { return shift_to_mmu_psize(shift); }


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

x86 assembly (clang, -O2):
<check_and_get_huge_psize>:
jmp    1030 <shift_to_mmu_psize@plt>

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

LLVM IR (-O2):
define i32 @check_and_get_huge_psize(i32 %0) {
%2 = tail call i32 @shift_to_mmu_psize(i32 %0)
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ getdw(int /*<<< orphan*/ *);
int /*<<< orphan*/ printf(char *, long, int /*<<< orphan*/);
void KWDataDump(FILE *HelpFile, long FileLength) {
  long i;
  for (i = 0; i < FileLength; i += 4) {
    printf("KWDataAddress: 0x%08lx TopicOffset: 0x%08lX\n", i, getdw(HelpFile));
  }
}


x86 assembly (clang, -O0):
<KWDataDump>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x10(%rbp),%rax
jge    117a <KWDataDump+0x5a>
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <getdw@plt>
mov    -0x20(%rbp),%rsi
mov    %eax,%edx
lea    0xe9c(%rip),%rdi
call   1030 <printf@plt>
mov    -0x18(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x18(%rbp)
jmp    1138 <KWDataDump+0x18>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<KWDataDump>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %rsi,%rsi
jle    115e <KWDataDump+0x3e>
mov    %rsi,%r15
mov    %rdi,%r14
xor    %ebx,%ebx
lea    0xec4(%rip),%r12
nopl   0x0(%rax)
mov    %r14,%rdi
call   1040 <getdw@plt>
mov    %r12,%rdi
mov    %rbx,%rsi
mov    %eax,%edx
call   1030 <printf@plt>
add    $0x4,%rbx
cmp    %r15,%rbx
jl     1140 <KWDataDump+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [45 x i8] c"KWDataAddress: 0x%08lx TopicOffset: 0x%08lX\0A\00"
define void @KWDataDump(i32* %0, i64 %1) {
%3 = alloca i32*
%4 = alloca i64
%5 = alloca i64
store i32* %0, i32** %3
store i64 %1, i64* %4
store i64 0, i64* %5
br label %6
6: ; preds = %15, %2
%7 = load i64, i64* %5
%8 = load i64, i64* %4
%9 = icmp slt i64 %7, %8
br i1 %9, label %10, label %18
10: ; preds = %6
%11 = load i64, i64* %5
%12 = load i32*, i32** %3
%13 = call i32 @getdw(i32* %12)
%14 = call i32 @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0), i64 %11, i32 %13)
br label %15
15: ; preds = %10
%16 = load i64, i64* %5
%17 = add nsw i64 %16, 4
store i64 %17, i64* %5
br label %6
18: ; preds = %6
ret void
}

LLVM IR (-O2):
@.str = [45 x i8] c"KWDataAddress: 0x%08lx TopicOffset: 0x%08lX\0A\00"
define void @KWDataDump(i32* %0, i64 %1) {
%3 = icmp sgt i64 %1, 0
br i1 %3, label %4, label %10
4: ; preds = %2, %4
%5 = phi i64 [ %8, %4 ], [ 0, %2 ]
%6 = tail call i32 @getdw(i32* %0)
%7 = tail call i32 @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0), i64 %5, i32 %6)
%8 = add nuw nsw i64 %5, 4
%9 = icmp slt i64 %8, %1
br i1 %9, label %4, label %10
10: ; preds = %4, %2
ret void
}
int simple_is_exp(char c) {
  int result = 0;
  if (c == 'e' || c == 'E')
    result = 1;
  return result;
}


x86 assembly (clang, -O0):
<simple_is_exp>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movl   $0x0,-0x8(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x65,%eax
je     112b <simple_is_exp+0x2b>
movsbl -0x1(%rbp),%eax
cmp    $0x45,%eax
jne    1132 <simple_is_exp+0x32>
movl   $0x1,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<simple_is_exp>:
and    $0xdf,%dil
xor    %eax,%eax
cmp    $0x45,%dil
sete   %al
ret

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

LLVM IR (-O2):
define i32 @simple_is_exp(i8 signext %0) {
%2 = and i8 %0, -33
%3 = icmp eq i8 %2, 69
%4 = zext i1 %3 to i32
ret i32 %4
}