xunge/DecIR huggingface dataset:
unsigned long bclr(unsigned char bo, unsigned char bi, unsigned char lk) {
  return (19 << 26) | (bo << 21) | (bi << 16) | 16 << 1 | (lk << 0);
}


x86 assembly (clang, -O0):
<bclr>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %dil,%dl
mov    %dl,-0x1(%rbp)
mov    %cl,-0x2(%rbp)
mov    %al,-0x3(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x15,%eax
or     $0x4c000000,%eax
movzbl -0x2(%rbp),%ecx
shl    $0x10,%ecx
or     %ecx,%eax
or     $0x20,%eax
movzbl -0x3(%rbp),%ecx
shl    $0x0,%ecx
or     %ecx,%eax
cltq
pop    %rbp
ret

x86 assembly (clang, -O2):
<bclr>:
mov    %edi,%eax
shl    $0x15,%rax
mov    %esi,%ecx
shl    $0x10,%rcx
or     %rax,%rcx
mov    %edx,%eax
or     %rcx,%rax
or     $0x4c000020,%rax
ret

LLVM IR (-O0):
define i64 @bclr(i8 zeroext %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8
%5 = alloca i8
%6 = alloca i8
store i8 %0, i8* %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%7 = load i8, i8* %4
%8 = zext i8 %7 to i32
%9 = shl i32 %8, 21
%10 = or i32 1275068416, %9
%11 = load i8, i8* %5
%12 = zext i8 %11 to i32
%13 = shl i32 %12, 16
%14 = or i32 %10, %13
%15 = or i32 %14, 32
%16 = load i8, i8* %6
%17 = zext i8 %16 to i32
%18 = shl i32 %17, 0
%19 = or i32 %15, %18
%20 = sext i32 %19 to i64
ret i64 %20
}

LLVM IR (-O2):
define i64 @bclr(i8 zeroext %0, i8 zeroext %1, i8 zeroext %2) {
%4 = zext i8 %0 to i64
%5 = shl nuw nsw i64 %4, 21
%6 = zext i8 %1 to i64
%7 = shl nuw nsw i64 %6, 16
%8 = zext i8 %2 to i64
%9 = or i64 %5, %7
%10 = or i64 %9, %8
%11 = or i64 %10, 1275068448
ret i64 %11
}
/* Variables and functions */
int real_putenv(char *);
int /*<<< orphan*/ setproctitle(char *);
int strlen(char *);
int /*<<< orphan*/ strncmp(char *, char *, int);
int putenv(char *string) {
  if (!strncmp(string,
               "SETPROCTITLE"
               "=",
               13) &&
      (strlen(string) > 13)) {
    setproctitle((char *)(string + 13));
  }
  return real_putenv(string);
}


x86 assembly (clang, -O0):
<putenv>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xea9(%rip),%rsi
mov    $0xd,%edx
call   1040 <strncmp@plt>
cmp    $0x0,%eax
jne    1189 <putenv+0x49>
mov    -0x8(%rbp),%rdi
call   1060 <strlen@plt>
cmp    $0xd,%eax
jle    1189 <putenv+0x49>
mov    -0x8(%rbp),%rdi
add    $0xd,%rdi
call   1030 <setproctitle@plt>
mov    -0x8(%rbp),%rdi
call   1050 <real_putenv@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<putenv>:
push   %rbx
mov    %rdi,%rbx
lea    0xeb5(%rip),%rsi
mov    $0xd,%edx
call   1040 <strncmp@plt>
test   %eax,%eax
jne    116f <putenv+0x2f>
mov    %rbx,%rdi
call   1060 <strlen@plt>
cmp    $0xe,%eax
jl     116f <putenv+0x2f>
lea    0xd(%rbx),%rdi
call   1030 <setproctitle@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1050 <real_putenv@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"SETPROCTITLE=\00"
define i32 @putenv(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @strncmp(i8* %3, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 13)
%5 = icmp ne i32 %4, 0
br i1 %5, label %14, label %6
6: ; preds = %1
%7 = load i8*, i8** %2
%8 = call i32 @strlen(i8* %7)
%9 = icmp sgt i32 %8, 13
br i1 %9, label %10, label %14
10: ; preds = %6
%11 = load i8*, i8** %2
%12 = getelementptr inbounds i8, i8* %11, i64 13
%13 = call i32 @setproctitle(i8* %12)
br label %14
14: ; preds = %10, %6, %1
%15 = load i8*, i8** %2
%16 = call i32 @real_putenv(i8* %15)
ret i32 %16
}

LLVM IR (-O2):
@.str = [14 x i8] c"SETPROCTITLE=\00"
define i32 @putenv(i8* %0) {
%2 = tail call i32 @strncmp(i8* %0, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 13)
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %10
4: ; preds = %1
%5 = tail call i32 @strlen(i8* %0)
%6 = icmp sgt i32 %5, 13
br i1 %6, label %7, label %10
7: ; preds = %4
%8 = getelementptr inbounds i8, i8* %0, i64 13
%9 = tail call i32 @setproctitle(i8* %8)
br label %10
10: ; preds = %7, %4, %1
%11 = tail call i32 @real_putenv(i8* %0)
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ f(int);
void not_usb_storage_proc_info(int i) { f(1); }


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

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

LLVM IR (-O0):
define void @not_usb_storage_proc_info(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @f(i32 1)
ret void
}

LLVM IR (-O2):
define void @not_usb_storage_proc_info(i32 %0) {
%2 = tail call i32 @f(i32 1)
ret void
}
int get_cell_network_size(int wide_circ_ids) {
  return wide_circ_ids ? 514 : 514 - 2;
}


x86 assembly (clang, -O0):
<get_cell_network_size>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
mov    $0x200,%eax
mov    $0x202,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_cell_network_size>:
xor    %eax,%eax
test   %edi,%edi
setne  %al
add    %eax,%eax
add    $0x200,%eax
ret

LLVM IR (-O0):
define i32 @get_cell_network_size(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ne i32 %3, 0
%5 = zext i1 %4 to i64
%6 = select i1 %4, i32 514, i32 512
ret i32 %6
}

LLVM IR (-O2):
define i32 @get_cell_network_size(i32 %0) {
%2 = icmp eq i32 %0, 0
%3 = select i1 %2, i32 512, i32 514
ret i32 %3
}
void *ft_mem_set(void *s, int c, unsigned long n) {
  unsigned long i;
  i = 0;
  while (i < n)
    ((char *)s)[i++] = c;
  return (s);
}


x86 assembly (clang, -O0):
<ft_mem_set>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x18(%rbp),%rax
jae    1145 <ft_mem_set+0x45>
mov    -0xc(%rbp),%eax
mov    %al,%dl
mov    -0x8(%rbp),%rax
mov    -0x20(%rbp),%rcx
mov    %rcx,%rsi
add    $0x1,%rsi
mov    %rsi,-0x20(%rbp)
mov    %dl,(%rax,%rcx,1)
jmp    1117 <ft_mem_set+0x17>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_mem_set>:
push   %rbx
mov    %rdi,%rbx
test   %rdx,%rdx
je     1121 <ft_mem_set+0x11>
mov    %rbx,%rdi
call   1030 <memset@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @ft_mem_set(i8* returned writeonly %0, i32 %1, i64 %2) {
%4 = icmp eq i64 %2, 0
br i1 %4, label %7, label %5
5: ; preds = %3
%6 = trunc i32 %1 to i8
br label %7
7: ; preds = %5, %3
ret i8* %0
}
void srandom(seed) unsigned int seed;
{}


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

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

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

LLVM IR (-O2):
define void @srandom(i32 %0) {
ret void
}
void fsys3(const char *f, ...) { return; }


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

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

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

LLVM IR (-O2):
define void @fsys3(i8* nocapture %0, ...) {
ret void
}
void rct_set_pll_frac_mode(void) {}


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

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

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

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

/* Variables and functions */
int ferror(int /*<<< orphan*/ *);
int ferror_file_func(void *opaque, void *stream) {
  return ferror((FILE *)stream);
}


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

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

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

LLVM IR (-O2):
define i32 @ferror_file_func(i8* nocapture readnone %0, i8* nocapture %1) {
%3 = bitcast i8* %1 to i32*
%4 = tail call i32 @ferror(i32* %3)
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ value;

/* Variables and functions */
scalar_t__ ERANGE;
scalar_t__ errno;
int getxattr(char *, char *, char *, int);
bool noexecve_enabled(void) {
  char value[16];
  int ret = getxattr("/proc/self/exe", "user.noexecve", value, sizeof(value));
  return ret >= 0 || errno == ERANGE;
}


x86 assembly (clang, -O0):
<noexecve_enabled>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    -0x10(%rbp),%rdx
lea    0xedd(%rip),%rdi
lea    0xee5(%rip),%rsi
mov    $0x10,%ecx
call   1030 <getxattr@plt>
mov    %eax,-0x14(%rbp)
mov    $0x1,%al
cmpl   $0x0,-0x14(%rbp)
mov    %al,-0x15(%rbp)
jge    1160 <noexecve_enabled+0x50>
mov    0x2e8b(%rip),%rax
mov    (%rax),%rax
mov    0x2e91(%rip),%rcx
cmp    (%rcx),%rax
sete   %al
mov    %al,-0x15(%rbp)
mov    -0x15(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<noexecve_enabled>:
sub    $0x18,%rsp
lea    0xee5(%rip),%rdi
lea    0xeed(%rip),%rsi
mov    %rsp,%rdx
mov    $0x10,%ecx
call   1030 <getxattr@plt>
test   %eax,%eax
setns  %al
mov    0x2e9d(%rip),%rcx
mov    (%rcx),%rcx
mov    0x2ea3(%rip),%rdx
cmp    (%rdx),%rcx
sete   %cl
or     %al,%cl
movzbl %cl,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [15 x i8] c"/proc/self/exe\00"
@.str.1 = [14 x i8] c"user.noexecve\00"
@errno = global i64 0
@ERANGE = global i64 0
define i32 @noexecve_enabled() {
%1 = alloca [16 x i8]
%2 = alloca i32
%3 = getelementptr inbounds [16 x i8], [16 x i8]* %1, i64 0, i64 0
%4 = call i32 @getxattr(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i8* %3, i32 16)
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = icmp sge i32 %5, 0
br i1 %6, label %11, label %7
7: ; preds = %0
%8 = load i64, i64* @errno
%9 = load i64, i64* @ERANGE
%10 = icmp eq i64 %8, %9
br label %11
11: ; preds = %7, %0
%12 = phi i1 [ true, %0 ], [ %10, %7 ]
%13 = zext i1 %12 to i32
ret i32 %13
}

LLVM IR (-O2):
@.str = [15 x i8] c"/proc/self/exe\00"
@.str.1 = [14 x i8] c"user.noexecve\00"
@errno = global i64 0
@ERANGE = global i64 0
define i32 @noexecve_enabled() {
%1 = alloca [16 x i8]
%2 = getelementptr inbounds [16 x i8], [16 x i8]* %1, i64 0, i64 0
%3 = call i32 @getxattr(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i8* %2, i32 16)
%4 = icmp sgt i32 %3, -1
%5 = load i64, i64* @errno
%6 = load i64, i64* @ERANGE
%7 = icmp eq i64 %5, %6
%8 = select i1 %4, i1 true, i1 %7
%9 = zext i1 %8 to i32
ret i32 %9
}
double pathconN_nm7_sq(double x) { return x * x; }


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

x86 assembly (clang, -O2):
<pathconN_nm7_sq>:
mulsd  %xmm0,%xmm0
ret

LLVM IR (-O0):
define double @pathconN_nm7_sq(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = load double, double* %2
%5 = fmul double %3, %4
ret double %5
}

LLVM IR (-O2):
define double @pathconN_nm7_sq(double %0) {
%2 = fmul double %0, %0
ret double %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void exec(const char *fn, const void *buf, size_t n) {
  (void)fn;
  (void)buf;
  (void)n;
  printf("Hello, world!\n");
}


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

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

LLVM IR (-O0):
@.str = [15 x i8] c"Hello, world!\0A\00"
define void @exec(i8* %0, i8* %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
store i8* %0, i8** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = load i64, i64* %6
%10 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [14 x i8] c"Hello, world!\00"
define void @exec(i8* nocapture readnone %0, i8* nocapture readnone %1, i64 %2) {
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
ret void
}
void test11() {
  enum { A = -1, B, C } a;
  switch (a) {
  case B:
  case C:
    break;
  }
  switch (a) {
  case B:
  case C:
    break;
  default:
    break;
  }
}


x86 assembly (clang, -O0):
<test11>:
push   %rbp
mov    %rsp,%rbp
mov    -0x4(%rbp),%eax
sub    $0x1,%eax
ja     111a <test11+0x1a>
jmp    1115 <test11+0x15>
jmp    111a <test11+0x1a>
mov    -0x4(%rbp),%eax
sub    $0x1,%eax
ja     1130 <test11+0x30>
jmp    112b <test11+0x2b>
jmp    1135 <test11+0x35>
jmp    1135 <test11+0x35>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @test11() {
%1 = alloca i32
%2 = load i32, i32* %1
switch i32 %2, label %4 [
i32 0, label %3
i32 1, label %3
]
3: ; preds = %0, %0
br label %4
4: ; preds = %0, %3
%5 = load i32, i32* %1
switch i32 %5, label %7 [
i32 0, label %6
i32 1, label %6
]
6: ; preds = %4, %4
br label %8
7: ; preds = %4
br label %8
8: ; preds = %7, %6
ret void
}

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

/* Variables and functions */
int /*<<< orphan*/ __builtin_arm_rbit64(int /*<<< orphan*/);
uint64_t rbit64(uint64_t a) { return __builtin_arm_rbit64(a); }


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

x86 assembly (clang, -O2):
<rbit64>:
jmp    1030 <__builtin_arm_rbit64@plt>

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

LLVM IR (-O2):
define i32 @rbit64(i32 %0) {
%2 = tail call i32 @__builtin_arm_rbit64(i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ get_params(int, char **);
int /*<<< orphan*/ yylex();
int main(int argc, char *argv[]) {
  get_params(argc, argv);
  yylex();
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
call   1030 <get_params@plt>
xor    %eax,%eax
call   1040 <yylex@plt>
xor    %eax,%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 i32, i32* %4
%7 = load i8**, i8*** %5
%8 = call i32 @get_params(i32 %6, i8** %7)
%9 = call i32 (...) @yylex()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @get_params(i32 %0, i8** %1)
%4 = tail call i32 (...) @yylex()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, ...);
void version(void) {
  printf("kore %d.%d.%d-%s ", 2, 0, 0, "devel");
  printf("\n");
  exit(0);
}


x86 assembly (clang, -O0):
<version>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
mov    $0x2,%esi
xor    %ecx,%ecx
lea    0xed9(%rip),%r8
mov    %ecx,%edx
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xecf(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<version>:
push   %rax
lea    0xec8(%rip),%rdi
lea    0xed3(%rip),%r8
mov    $0x2,%esi
xor    %edx,%edx
xor    %ecx,%ecx
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [18 x i8] c"kore %d.%d.%d-%s \00"
@.str.1 = [6 x i8] c"devel\00"
@.str.2 = [2 x i8] c"\0A\00"
define void @version() {
%1 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 2, i32 0, i32 0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%3 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [18 x i8] c"kore %d.%d.%d-%s \00"
@.str.1 = [6 x i8] c"devel\00"
define void @version() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 2, i32 0, i32 0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @putchar(i32 10)
%3 = tail call i32 @exit(i32 0)
unreachable
}
/* Type definitions */
struct timeval {
  double tv_sec;
  double tv_usec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, void *);
double cp_Wtime() {
  struct timeval tv;
  gettimeofday(&tv, (void *)0);
  return tv.tv_sec + 1.0e-6 * tv.tv_usec;
}


x86 assembly (clang, -O0):
<cp_Wtime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
movsd  -0x10(%rbp),%xmm1
movsd  -0x8(%rbp),%xmm0
movsd  0xec9(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cp_Wtime>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
movsd  0x10(%rsp),%xmm0
mulsd  0xed2(%rip),%xmm0
addsd  0x8(%rsp),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timeval = type { double, double }
define double @cp_Wtime() {
%1 = alloca %struct.timeval
%2 = call i32 @gettimeofday(%struct.timeval* %1, i8* null)
%3 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%4 = load double, double* %3
%5 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%6 = load double, double* %5
%7 = call double @llvm.fmuladd.f64(double 0x3EB0C6F7A0B5ED8D, double %6, double %4)
ret double %7
}

LLVM IR (-O2):
%struct.timeval = type { double, double }
define double @cp_Wtime() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i8* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%5 = load double, double* %4
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%7 = load double, double* %6
%8 = tail call double @llvm.fmuladd.f64(double %7, double 0x3EB0C6F7A0B5ED8D, double %5)
ret double %8
}
/* Type definitions */
typedef int uint32_t;
typedef int ui32Value;

/* Variables and functions */
uint32_t GrOffScreen1BPPColorTranslate(void *pvDisplayData,
                                       uint32_t ui32Value) {
  ;
  return (((((((ui32Value)&0x00ff0000) >> 16) * 19661) +
            ((((ui32Value)&0x0000ff00) >> 8) * 38666) +
            (((ui32Value)&0x000000ff) * 7209)) /
           (65536 * 128)));
}


x86 assembly (clang, -O0):
<GrOffScreen1BPPColorTranslate>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
and    $0xff0000,%eax
sar    $0x10,%eax
imul   $0x4ccd,%eax,%eax
mov    -0xc(%rbp),%ecx
and    $0xff00,%ecx
sar    $0x8,%ecx
imul   $0x970a,%ecx,%ecx
add    %ecx,%eax
mov    -0xc(%rbp),%ecx
and    $0xff,%ecx
imul   $0x1c29,%ecx,%ecx
add    %ecx,%eax
mov    $0x800000,%ecx
cltd
idiv   %ecx
pop    %rbp
ret

x86 assembly (clang, -O2):
<GrOffScreen1BPPColorTranslate>:
mov    %esi,%eax
movzbl %ah,%ecx
movzbl %al,%edx
shr    $0x10,%eax
movzbl %al,%eax
imul   $0x4ccd,%eax,%esi
imul   $0x970a,%ecx,%ecx
imul   $0x1c29,%edx,%eax
add    %ecx,%eax
add    %esi,%eax
shr    $0x17,%eax
ret

LLVM IR (-O0):
define i32 @GrOffScreen1BPPColorTranslate(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = and i32 %5, 16711680
%7 = ashr i32 %6, 16
%8 = mul nsw i32 %7, 19661
%9 = load i32, i32* %4
%10 = and i32 %9, 65280
%11 = ashr i32 %10, 8
%12 = mul nsw i32 %11, 38666
%13 = add nsw i32 %8, %12
%14 = load i32, i32* %4
%15 = and i32 %14, 255
%16 = mul nsw i32 %15, 7209
%17 = add nsw i32 %13, %16
%18 = sdiv i32 %17, 8388608
ret i32 %18
}

LLVM IR (-O2):
define i32 @GrOffScreen1BPPColorTranslate(i8* nocapture readnone %0, i32 %1) {
%3 = lshr i32 %1, 16
%4 = and i32 %3, 255
%5 = mul nuw nsw i32 %4, 19661
%6 = lshr i32 %1, 8
%7 = and i32 %6, 255
%8 = mul nuw nsw i32 %7, 38666
%9 = and i32 %1, 255
%10 = mul nuw nsw i32 %9, 7209
%11 = add nuw nsw i32 %8, %10
%12 = add nuw nsw i32 %11, %5
%13 = lshr i32 %12, 23
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ SDL_ExitProcess(int);
int /*<<< orphan*/ SDL_Quit();
void SDL_AbortAssertion(void) {
  SDL_Quit();
  SDL_ExitProcess(42);
}


x86 assembly (clang, -O0):
<SDL_AbortAssertion>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <SDL_Quit@plt>
mov    $0x2a,%edi
call   1030 <SDL_ExitProcess@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<SDL_AbortAssertion>:
push   %rax
xor    %eax,%eax
call   1040 <SDL_Quit@plt>
mov    $0x2a,%edi
pop    %rax
jmp    1030 <SDL_ExitProcess@plt>

LLVM IR (-O0):
define void @SDL_AbortAssertion() {
%1 = call i32 (...) @SDL_Quit()
%2 = call i32 @SDL_ExitProcess(i32 42)
ret void
}

LLVM IR (-O2):
define void @SDL_AbortAssertion() {
%1 = tail call i32 (...) @SDL_Quit()
%2 = tail call i32 @SDL_ExitProcess(i32 42)
ret void
}
int endswith(char *s, char *suffix) {
  int n1 = strlen(s);
  int n2 = strlen(suffix);
  char *location = s + n1 - n2;
  char *found = strstr(s, suffix);
  return found == location;
}


x86 assembly (clang, -O0):
<endswith>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
add    %rcx,%rax
movslq -0x18(%rbp),%rdx
xor    %ecx,%ecx
sub    %rdx,%rcx
add    %rcx,%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <strstr@plt>
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
cmp    -0x20(%rbp),%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<endswith>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%r12
call   1030 <strlen@plt>
mov    %rax,%r15
mov    %r14,%rdi
call   1030 <strlen@plt>
movslq %r15d,%rbx
add    %r12,%rbx
cltq
sub    %rax,%rbx
mov    %r12,%rdi
mov    %r14,%rsi
call   1040 <strstr@plt>
xor    %ecx,%ecx
cmp    %rbx,%rax
sete   %cl
mov    %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i32 @endswith(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%9 = load i8*, i8** %3
%10 = call i64 @strlen(i8* %9)
%11 = trunc i64 %10 to i32
store i32 %11, i32* %5
%12 = load i8*, i8** %4
%13 = call i64 @strlen(i8* %12)
%14 = trunc i64 %13 to i32
store i32 %14, i32* %6
%15 = load i8*, i8** %3
%16 = load i32, i32* %5
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds i8, i8* %15, i64 %17
%19 = load i32, i32* %6
%20 = sext i32 %19 to i64
%21 = sub i64 0, %20
%22 = getelementptr inbounds i8, i8* %18, i64 %21
store i8* %22, i8** %7
%23 = load i8*, i8** %3
%24 = load i8*, i8** %4
%25 = call i8* @strstr(i8* %23, i8* %24)
store i8* %25, i8** %8
%26 = load i8*, i8** %8
%27 = load i8*, i8** %7
%28 = icmp eq i8* %26, %27
%29 = zext i1 %28 to i32
ret i32 %29
}

LLVM IR (-O2):
define i32 @endswith(i8* %0, i8* nocapture %1) {
%3 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%4 = tail call i64 @strlen(i8* dereferenceable(1) %1)
%5 = shl i64 %3, 32
%6 = ashr exact i64 %5, 32
%7 = getelementptr inbounds i8, i8* %0, i64 %6
%8 = shl i64 %4, 32
%9 = ashr exact i64 %8, 32
%10 = sub nsw i64 0, %9
%11 = getelementptr inbounds i8, i8* %7, i64 %10
%12 = tail call i8* @strstr(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
%13 = icmp eq i8* %12, %11
%14 = zext i1 %13 to i32
ret i32 %14
}
/* Type definitions */
struct timespec {
  unsigned long long tv_sec;
  unsigned long long tv_nsec;
};

/* Variables and functions */
unsigned long long ts_to_nsec(struct timespec ts) {
  return ts.tv_sec * 1000000000ULL + ts.tv_nsec;
}


x86 assembly (clang, -O0):
<ts_to_nsec>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x8(%rbp)
imul   $0x3b9aca00,-0x10(%rbp),%rax
3b
add    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ts_to_nsec>:
imul   $0x3b9aca00,%rdi,%rax
add    %rsi,%rax
ret

LLVM IR (-O0):
%struct.timespec = type { i64, i64 }
define i64 @ts_to_nsec(i64 %0, i64 %1) {
%3 = alloca %struct.timespec
%4 = bitcast %struct.timespec* %3 to { i64, i64 }*
%5 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %4, i32 0, i32 0
store i64 %0, i64* %5
%6 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %4, i32 0, i32 1
store i64 %1, i64* %6
%7 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i32 0, i32 0
%8 = load i64, i64* %7
%9 = mul i64 %8, 1000000000
%10 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i32 0, i32 1
%11 = load i64, i64* %10
%12 = add i64 %9, %11
ret i64 %12
}

LLVM IR (-O2):
define i64 @ts_to_nsec(i64 %0, i64 %1) {
%3 = mul i64 %0, 1000000000
%4 = add i64 %3, %1
ret i64 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void help(char *param) {
  char *c_help_text = "Help commands: \n\0";
  printf(c_help_text);
  return;
}


x86 assembly (clang, -O0):
<help>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@str = [16 x i8] c"Help commands: \00"
define void @help(i8* nocapture readnone %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free_diag_hash();
void free_quantum_search(void) { free_diag_hash(); }


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

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

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

LLVM IR (-O2):
define void @free_quantum_search() {
%1 = tail call i32 (...) @free_diag_hash()
ret void
}
/* Variables and functions */
int PAPI_list_events(int, int *, int *);
void papif_list_events__(int *EventSet, int *Events, int *number, int *check) {
  *check = PAPI_list_events(*EventSet, Events, number);
}


x86 assembly (clang, -O0):
<papif_list_events__>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <PAPI_list_events@plt>
mov    %eax,%ecx
mov    -0x20(%rbp),%rax
mov    %ecx,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<papif_list_events__>:
push   %rbx
mov    %rcx,%rbx
mov    (%rdi),%edi
call   1030 <PAPI_list_events@plt>
mov    %eax,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @papif_list_events__(i32* %0, i32* %1, i32* %2, i32* %3) {
%5 = alloca i32*
%6 = alloca i32*
%7 = alloca i32*
%8 = alloca i32*
store i32* %0, i32** %5
store i32* %1, i32** %6
store i32* %2, i32** %7
store i32* %3, i32** %8
%9 = load i32*, i32** %5
%10 = load i32, i32* %9
%11 = load i32*, i32** %6
%12 = load i32*, i32** %7
%13 = call i32 @PAPI_list_events(i32 %10, i32* %11, i32* %12)
%14 = load i32*, i32** %8
store i32 %13, i32* %14
ret void
}

LLVM IR (-O2):
define void @papif_list_events__(i32* nocapture %0, i32* %1, i32* %2, i32* nocapture writeonly %3) {
%5 = load i32, i32* %0
%6 = tail call i32 @PAPI_list_events(i32 %5, i32* %1, i32* %2)
store i32 %6, i32* %3
ret void
}
void gtk_curve_set_curve_type() {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ cnet_getdelim(char **, size_t *, char, int /*<<< orphan*/ *);
ssize_t cnet_getline(char **lineptr, size_t *n, FILE *stream) {
  return cnet_getdelim(lineptr, n, '\n', stream);
}


x86 assembly (clang, -O0):
<cnet_getline>:
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),%rcx
mov    $0xa,%edx
call   1030 <cnet_getdelim@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cnet_getline>:
mov    %rdx,%rcx
mov    $0xa,%edx
jmp    1030 <cnet_getdelim@plt>

LLVM IR (-O0):
define i32 @cnet_getline(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
%10 = call i32 @cnet_getdelim(i8** %7, i64* %8, i8 signext 10, i32* %9)
ret i32 %10
}

LLVM IR (-O2):
define i32 @cnet_getline(i8** %0, i64* %1, i32* %2) {
%4 = tail call i32 @cnet_getdelim(i8** %0, i64* %1, i8 signext 10, i32* %2)
ret i32 %4
}
void main() { 1 * +2; }


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

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

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

LLVM IR (-O2):
define void @main() {
ret void
}
int fun1015() { return 1015; }


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

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

LLVM IR (-O0):
define i32 @fun1015() {
ret i32 1015
}

LLVM IR (-O2):
define i32 @fun1015() {
ret i32 1015
}
/* Variables and functions */
int /*<<< orphan*/ abort();
void *malloc(size_t);
void *v_malloc(size_t size) {
  void *ptr = malloc(size);
  if (!ptr)
    abort();
  return ptr;
}


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

x86 assembly (clang, -O2):
<v_malloc>:
push   %rax
call   1040 <malloc@plt>
test   %rax,%rax
je     112d <v_malloc+0xd>
pop    %rcx
ret
xor    %eax,%eax
call   1030 <abort@plt>

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

LLVM IR (-O2):
define noalias i8* @v_malloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 (...) @abort()
unreachable
6: ; preds = %1
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
scalar_t__ malloc(int);
int /*<<< orphan*/ printf(char *);
void *gf_malloc(int bytes) {
  void *p;
  p = (void *)malloc(bytes);
  if (p == NULL) {
    printf("\n\tProblem allocating memory in gf_malloc()\n");
    exit(1);
  }
  return p;
}


x86 assembly (clang, -O0):
<gf_malloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1168 <gf_malloc+0x38>
lea    0xea7(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gf_malloc>:
push   %rax
call   1040 <malloc@plt>
test   %rax,%rax
je     113d <gf_malloc+0xd>
pop    %rcx
ret
lea    0xebc(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [44 x i8] c"\0A\09Problem allocating memory in gf_malloc()\0A\00"
define i8* @gf_malloc(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i64 @malloc(i32 %4)
%6 = inttoptr i64 %5 to i8*
store i8* %6, i8** %3
%7 = load i8*, i8** %3
%8 = icmp eq i8* %7, null
br i1 %8, label %9, label %12
9: ; preds = %1
%10 = call i32 @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0))
%11 = call i32 @exit(i32 1)
unreachable
12: ; preds = %1
%13 = load i8*, i8** %3
ret i8* %13
}

LLVM IR (-O2):
@str = [43 x i8] c"\0A\09Problem allocating memory in gf_malloc()\00"
define i8* @gf_malloc(i32 %0) {
%2 = tail call i64 @malloc(i32 %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @str, i64 0, i64 0))
%6 = tail call i32 @exit(i32 1)
unreachable
7: ; preds = %1
%8 = inttoptr i64 %2 to i8*
ret i8* %8
}
/* Variables and functions */
int /*<<< orphan*/ isxdigit(char);
int ishex(char *str) {
  while (*str) {
    if (!isxdigit(*str))
      return 0;
    str++;
  }
  return 1;
}


x86 assembly (clang, -O0):
<ishex>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     115b <ishex+0x4b>
mov    -0x10(%rbp),%rax
movsbl (%rax),%edi
call   1030 <isxdigit@plt>
cmp    $0x0,%eax
jne    114a <ishex+0x3a>
movl   $0x0,-0x4(%rbp)
jmp    1162 <ishex+0x52>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    111c <ishex+0xc>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ishex>:
push   %rbp
push   %rbx
push   %rax
mov    (%rdi),%al
mov    $0x1,%ebp
test   %al,%al
je     114b <ishex+0x3b>
mov    %rdi,%rbx
add    $0x1,%rbx
cs nopw 0x0(%rax,%rax,1)
nop
movsbl %al,%edi
call   1030 <isxdigit@plt>
test   %eax,%eax
je     1149 <ishex+0x39>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1130 <ishex+0x20>
jmp    114b <ishex+0x3b>
xor    %ebp,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @ishex(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %13, label %7
4: ; preds = %7
%5 = load i8, i8* %12
%6 = icmp eq i8 %5, 0
br i1 %6, label %13, label %7
7: ; preds = %1, %4
%8 = phi i8 [ %5, %4 ], [ %2, %1 ]
%9 = phi i8* [ %12, %4 ], [ %0, %1 ]
%10 = tail call i32 @isxdigit(i8 signext %8)
%11 = icmp eq i32 %10, 0
%12 = getelementptr inbounds i8, i8* %9, i64 1
br i1 %11, label %13, label %4
13: ; preds = %7, %4, %1
%14 = phi i32 [ 1, %1 ], [ 1, %4 ], [ 0, %7 ]
ret i32 %14
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
int /*<<< orphan*/ printf(char *, char *);
void myfunc(void *data) {
  char *t;
  t = (char *)data;
  printf("GOT data = %s\n", t);
  free(t);
}


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

x86 assembly (clang, -O2):
<myfunc>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"GOT data = %s\0A\00"
define void @myfunc(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
store i8* %4, i8** %3
%5 = load i8*, i8** %3
%6 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %5)
%7 = load i8*, i8** %3
%8 = call i32 @free(i8* %7)
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"GOT data = %s\0A\00"
define void @myfunc(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @free(i8* %0)
ret void
}
void ndb_osdep_done() { ; }


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

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

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

LLVM IR (-O2):
define void @ndb_osdep_done() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ BatteryMeasure_init();
void BatteryMeasure_start() { BatteryMeasure_init(); }


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

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

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

LLVM IR (-O2):
define void @BatteryMeasure_start() {
%1 = tail call i32 (...) @BatteryMeasure_init()
ret void
}
/* Type definitions */
struct codec {
  int dummy;
};
typedef int ssize_t;

/* Variables and functions */
ssize_t sgen_seek(struct codec *c, ssize_t pos) { return -1; }


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

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

LLVM IR (-O0):
%struct.codec = type { i32 }
define i32 @sgen_seek(%struct.codec* %0, i32 %1) {
%3 = alloca %struct.codec*
%4 = alloca i32
store %struct.codec* %0, %struct.codec** %3
store i32 %1, i32* %4
ret i32 -1
}

LLVM IR (-O2):
%struct.codec = type { i32 }
define i32 @sgen_seek(%struct.codec* nocapture readnone %0, i32 %1) {
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ dprintf(int, char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ http_get_response_message(int);
void http_start_response(int fd, int status_code) {
  dprintf(fd, "HTTP/1.0 %d %s\r\n", status_code,
          http_get_response_message(status_code));
}


x86 assembly (clang, -O0):
<http_start_response>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <http_get_response_message@plt>
mov    -0x10(%rbp),%edi
mov    -0xc(%rbp),%edx
mov    %eax,%ecx
lea    0xeaf(%rip),%rsi
call   1040 <dprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<http_start_response>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
mov    %esi,%edi
call   1030 <http_get_response_message@plt>
lea    0xecb(%rip),%rsi
mov    %ebp,%edi
mov    %ebx,%edx
mov    %eax,%ecx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <dprintf@plt>

LLVM IR (-O0):
@.str = [17 x i8] c"HTTP/1.0 %d %s\0D\0A\00"
define void @http_start_response(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = load i32, i32* %4
%8 = call i32 @http_get_response_message(i32 %7)
%9 = call i32 @dprintf(i32 %5, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %6, i32 %8)
ret void
}

LLVM IR (-O2):
@.str = [17 x i8] c"HTTP/1.0 %d %s\0D\0A\00"
define void @http_start_response(i32 %0, i32 %1) {
%3 = tail call i32 @http_get_response_message(i32 %1)
%4 = tail call i32 @dprintf(i32 %0, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %1, i32 %3)
ret void
}
/* Variables and functions */
int final(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ semi(int, int);
int playoff(int a, int b, int c, int d) {
  return final(semi(a, d), semi(b, c));
}


x86 assembly (clang, -O0):
<playoff>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%esi
call   1040 <semi@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1040 <semi@plt>
mov    -0x14(%rbp),%edi
mov    %eax,%esi
call   1030 <final@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<playoff>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%r14d
mov    %esi,%ebp
mov    %ecx,%esi
call   1040 <semi@plt>
mov    %eax,%ebx
mov    %ebp,%edi
mov    %r14d,%esi
call   1040 <semi@plt>
mov    %ebx,%edi
mov    %eax,%esi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <final@plt>

LLVM IR (-O0):
define i32 @playoff(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32, i32* %5
%10 = load i32, i32* %8
%11 = call i32 @semi(i32 %9, i32 %10)
%12 = load i32, i32* %6
%13 = load i32, i32* %7
%14 = call i32 @semi(i32 %12, i32 %13)
%15 = call i32 @final(i32 %11, i32 %14)
ret i32 %15
}

LLVM IR (-O2):
define i32 @playoff(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = tail call i32 @semi(i32 %0, i32 %3)
%6 = tail call i32 @semi(i32 %1, i32 %2)
%7 = tail call i32 @final(i32 %5, i32 %6)
ret i32 %7
}
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ ide_write_data(int, int /*<<< orphan*/, int);
void writeidew(int ide_board, uint16_t val) {
  ide_write_data(ide_board, val, 2);
}


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

x86 assembly (clang, -O2):
<writeidew>:
mov    $0x2,%edx
jmp    1030 <ide_write_data@plt>

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

LLVM IR (-O2):
define void @writeidew(i32 %0, i32 %1) {
%3 = tail call i32 @ide_write_data(i32 %0, i32 %1, i32 2)
ret void
}
void restore() {
  asm volatile("popq %%rsp\n\t"
               "addq $0x8, %%rsp\n\t" ::
                   :);
}


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

x86 assembly (clang, -O2):
<restore>:
pop    %rsp
add    $0x8,%rsp
ret

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

LLVM IR (-O2):
define void @restore() {
tail call void asm sideeffect "popq %rsp\0A\09addq $$0x8, %rsp\0A\09", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, char *);
void ntrerror(char *s) {
  printf("%s\n", s);
  exit(1);
}


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define void @ntrerror(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int parse_number_from_char(char *, int /*<<< orphan*/, int);
int /*<<< orphan*/ sprintf(char *, char *, int);
char *make_port_readable(char *readable_port, char *port) {
  sprintf(readable_port, "%u", parse_number_from_char(port, 0, 15));
  return readable_port;
}


x86 assembly (clang, -O0):
<make_port_readable>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
xor    %esi,%esi
mov    $0xf,%edx
call   1030 <parse_number_from_char@plt>
mov    -0x18(%rbp),%rdi
mov    %eax,%edx
lea    0xeab(%rip),%rsi
call   1040 <sprintf@plt>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<make_port_readable>:
push   %rbx
mov    %rdi,%rbx
mov    %rsi,%rdi
xor    %esi,%esi
mov    $0xf,%edx
call   1030 <parse_number_from_char@plt>
lea    0xec6(%rip),%rsi
mov    %rbx,%rdi
mov    %eax,%edx
call   1040 <sprintf@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%u\00"
define i8* @make_port_readable(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = call i32 @parse_number_from_char(i8* %6, i32 0, i32 15)
%8 = call i32 @sprintf(i8* %5, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = load i8*, i8** %3
ret i8* %9
}

LLVM IR (-O2):
@.str = [3 x i8] c"%u\00"
define i8* @make_port_readable(i8* returned writeonly %0, i8* %1) {
%3 = tail call i32 @parse_number_from_char(i8* %1, i32 0, i32 15)
%4 = tail call i32 @sprintf(i8* dereferenceable(1) %0, i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i8* %0
}