xunge/DecIR huggingface dataset:
void gtk_widget_create_pango_layout() {}


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

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

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

LLVM IR (-O2):
define void @gtk_widget_create_pango_layout() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
void cosivm_print_license() {
  puts("cosivm  Copyright (C) 2014  Dipta Pandit\n    This program comes with "
       "ABSOLUTELY NO WARRANTY; for details type `cbmas -w'.\n    This is free "
       "software, and you are welcome to redistribute it\n    under certain "
       "conditions; type `cvmas -c' for details.");
}


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

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

LLVM IR (-O0):
@.str = [247 x i8] c"cosivm Copyright (C) 2014 Dipta Pandit\0A This program comes with ABSOLUTELY NO WARRANTY; for details type `cbmas -w'.\0A This is free software, and you are welcome to redistribute it\0A under certain conditions; type `cvmas -c' for details.\00"
define void @cosivm_print_license() {
%1 = call i32 @puts(i8* getelementptr inbounds ([247 x i8], [247 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [247 x i8] c"cosivm Copyright (C) 2014 Dipta Pandit\0A This program comes with ABSOLUTELY NO WARRANTY; for details type `cbmas -w'.\0A This is free software, and you are welcome to redistribute it\0A under certain conditions; type `cvmas -c' for details.\00"
define void @cosivm_print_license() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([247 x i8], [247 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const, char *);
char *strrchr(char const *, char const);
int main() {
  int len;
  const char str[] = "http://www.tutorialspoint.com";
  const char ch = '.';
  char *ret;
  ret = strrchr(str, ch);
  printf("String after |%c| is - |%s|\n", ch, ret);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xec7(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0xec4(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xec2(%rip),%eax
mov    %eax,-0x18(%rbp)
mov    0xebc(%rip),%ax
mov    %ax,-0x14(%rbp)
movb   $0x2e,-0x31(%rbp)
lea    -0x30(%rbp),%rdi
mov    $0x2e,%esi
call   1040 <strrchr@plt>
mov    %rax,-0x40(%rbp)
mov    -0x40(%rbp),%rdx
lea    0xe99(%rip),%rdi
mov    $0x2e,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
movups 0xee3(%rip),%xmm0
movups %xmm0,0xe(%rsp)
movaps 0xec9(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
mov    $0x2e,%esi
call   1040 <strrchr@plt>
lea    0xecf(%rip),%rdi
mov    $0x2e,%esi
mov    %rax,%rdx
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
@__const.main.str = [30 x i8] c"http://www.tutorialspoint.com\00"
@.str = [29 x i8] c"String after |%c| is - |%s|\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [30 x i8]
%4 = alloca i8
%5 = alloca i8*
store i32 0, i32* %1
%6 = bitcast [30 x i8]* %3 to i8*
store i8 46, i8* %4
%7 = getelementptr inbounds [30 x i8], [30 x i8]* %3, i64 0, i64 0
%8 = call i8* @strrchr(i8* %7, i8 signext 46)
store i8* %8, i8** %5
%9 = load i8*, i8** %5
%10 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i8 signext 46, i8* %9)
ret i32 0
}

LLVM IR (-O2):
@__const.main.str = [30 x i8] c"http://www.tutorialspoint.com\00"
@.str = [29 x i8] c"String after |%c| is - |%s|\0A\00"
define i32 @main() {
%1 = alloca [30 x i8]
%2 = getelementptr inbounds [30 x i8], [30 x i8]* %1, i64 0, i64 0
%3 = call i8* @strrchr(i8* %2, i8 signext 46)
%4 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i8 signext 46, i8* %3)
ret i32 0
}
/* Type definitions */
typedef int uint8_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ ppuSetNameTblHorizontal();
int /*<<< orphan*/ ppuSetNameTblVertical();
void m112setParamsE000(uint16_t addr, uint8_t val) {
  (void)addr;
  if ((val & 1) == 0)
    ppuSetNameTblVertical();
  else
    ppuSetNameTblHorizontal();
}


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
jne    1149 <m112setParamsE000+0x29>
mov    $0x0,%al
call   1040 <ppuSetNameTblVertical@plt>
jmp    1150 <m112setParamsE000+0x30>
mov    $0x0,%al
call   1030 <ppuSetNameTblHorizontal@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
xor    %eax,%eax
test   $0x1,%sil
jne    112d <m112setParamsE000+0xd>
jmp    1040 <ppuSetNameTblVertical@plt>
jmp    1030 <ppuSetNameTblHorizontal@plt>

LLVM IR (-O0):
define void @m112setParamsE000(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 = and i32 %6, 1
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = call i32 (...) @ppuSetNameTblVertical()
br label %13
11: ; preds = %2
%12 = call i32 (...) @ppuSetNameTblHorizontal()
br label %13
13: ; preds = %11, %9
ret void
}

LLVM IR (-O2):
define void @m112setParamsE000(i32 %0, i32 %1) {
%3 = and i32 %1, 1
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 (...) @ppuSetNameTblVertical()
br label %9
7: ; preds = %2
%8 = tail call i32 (...) @ppuSetNameTblHorizontal()
br label %9
9: ; preds = %7, %5
ret void
}
__attribute__((no, noclone)) void use(int *k, int *l, int *m, int *n, int *o,
                                      int *p, int *q, int *r) {
  asm volatile("" : : "r"(k) : "memory");
  asm volatile("" : : "r"(l) : "memory");
  asm volatile("" : : "r"(m) : "memory");
  asm volatile("" : : "r"(n) : "memory");
  asm volatile("" : : "r"(o) : "memory");
  asm volatile("" : : "r"(p) : "memory");
  asm volatile("" : : "r"(q) : "memory");
  asm volatile("" : : "r"(r) : "memory");
}


x86 assembly (clang, -O0):
<use>:
push   %rbp
mov    %rsp,%rbp
mov    0x18(%rbp),%rax
mov    0x10(%rbp),%rax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%rax
mov    -0x20(%rbp),%rax
mov    -0x28(%rbp),%rax
mov    -0x30(%rbp),%rax
mov    0x10(%rbp),%rax
mov    0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<use>:
mov    0x10(%rsp),%r10
mov    0x8(%rsp),%rax
ret

LLVM IR (-O0):
define void @use(i32* %0, i32* %1, i32* %2, i32* %3, i32* %4, i32* %5, i32* %6, i32* %7) {
%9 = alloca i32*
%10 = alloca i32*
%11 = alloca i32*
%12 = alloca i32*
%13 = alloca i32*
%14 = alloca i32*
%15 = alloca i32*
%16 = alloca i32*
store i32* %0, i32** %9
store i32* %1, i32** %10
store i32* %2, i32** %11
store i32* %3, i32** %12
store i32* %4, i32** %13
store i32* %5, i32** %14
store i32* %6, i32** %15
store i32* %7, i32** %16
%17 = load i32*, i32** %9
%18 = load i32*, i32** %10
%19 = load i32*, i32** %11
%20 = load i32*, i32** %12
%21 = load i32*, i32** %13
%22 = load i32*, i32** %14
%23 = load i32*, i32** %15
%24 = load i32*, i32** %16
ret void
}

LLVM IR (-O2):
define void @use(i32* %0, i32* %1, i32* %2, i32* %3, i32* %4, i32* %5, i32* %6, i32* %7) {
tail call void asm sideeffect "", "r,~{memory},~{dirflag},~{fpsr},~{flags}"(i32* %0)
tail call void asm sideeffect "", "r,~{memory},~{dirflag},~{fpsr},~{flags}"(i32* %1)
tail call void asm sideeffect "", "r,~{memory},~{dirflag},~{fpsr},~{flags}"(i32* %2)
tail call void asm sideeffect "", "r,~{memory},~{dirflag},~{fpsr},~{flags}"(i32* %3)
tail call void asm sideeffect "", "r,~{memory},~{dirflag},~{fpsr},~{flags}"(i32* %4)
tail call void asm sideeffect "", "r,~{memory},~{dirflag},~{fpsr},~{flags}"(i32* %5)
tail call void asm sideeffect "", "r,~{memory},~{dirflag},~{fpsr},~{flags}"(i32* %6)
tail call void asm sideeffect "", "r,~{memory},~{dirflag},~{fpsr},~{flags}"(i32* %7)
ret void
}
/* Variables and functions */
int countusers(char **users) {
  int rval;
  for (rval = 0; users[rval] != NULL; rval++)
    ;
  return (rval);
}


x86 assembly (clang, -O0):
<countusers>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
cmpq   $0x0,(%rax,%rcx,8)
je     1135 <countusers+0x35>
jmp    1127 <countusers+0x27>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <countusers+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<countusers>:
mov    $0xffffffff,%eax
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%eax
cmpq   $0x0,(%rdi)
lea    0x8(%rdi),%rdi
jne    1110 <countusers+0x10>
ret

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

LLVM IR (-O2):
define i32 @countusers(i8** nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ %7, %2 ], [ 0, %1 ]
%4 = getelementptr inbounds i8*, i8** %0, i64 %3
%5 = load i8*, i8** %4
%6 = icmp eq i8* %5, null
%7 = add nuw i64 %3, 1
br i1 %6, label %8, label %2
8: ; preds = %2
%9 = trunc i64 %3 to i32
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ write_to_spi(int, int);
void init_rx_pkt_mode(void) { write_to_spi(0x06, 0x0122); }


x86 assembly (clang, -O0):
<init_rx_pkt_mode>:
push   %rbp
mov    %rsp,%rbp
mov    $0x6,%edi
mov    $0x122,%esi
call   1030 <write_to_spi@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_rx_pkt_mode>:
mov    $0x6,%edi
mov    $0x122,%esi
jmp    1030 <write_to_spi@plt>

LLVM IR (-O0):
define void @init_rx_pkt_mode() {
%1 = call i32 @write_to_spi(i32 6, i32 290)
ret void
}

LLVM IR (-O2):
define void @init_rx_pkt_mode() {
%1 = tail call i32 @write_to_spi(i32 6, i32 290)
ret void
}
/* Variables and functions */
void gall_laplace_size(size_t m, size_t n, size_t *N, size_t *nz) {
  *N = m * n;
  *nz = 5 * (*N) - 2 * (m + n);
}


x86 assembly (clang, -O0):
<gall_laplace_size>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rcx
imul   -0x10(%rbp),%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x18(%rbp),%rax
imul   $0x5,(%rax),%rcx
mov    -0x8(%rbp),%rax
add    -0x10(%rbp),%rax
shl    $0x1,%rax
sub    %rax,%rcx
mov    -0x20(%rbp),%rax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<gall_laplace_size>:
mov    %rsi,%rax
imul   %rdi,%rax
mov    %rax,(%rdx)
lea    (%rax,%rax,4),%rax
add    %rdi,%rsi
add    %rsi,%rsi
sub    %rsi,%rax
mov    %rax,(%rcx)
ret

LLVM IR (-O0):
define void @gall_laplace_size(i64 %0, i64 %1, i64* %2, i64* %3) {
%5 = alloca i64
%6 = alloca i64
%7 = alloca i64*
%8 = alloca i64*
store i64 %0, i64* %5
store i64 %1, i64* %6
store i64* %2, i64** %7
store i64* %3, i64** %8
%9 = load i64, i64* %5
%10 = load i64, i64* %6
%11 = mul i64 %9, %10
%12 = load i64*, i64** %7
store i64 %11, i64* %12
%13 = load i64*, i64** %7
%14 = load i64, i64* %13
%15 = mul i64 5, %14
%16 = load i64, i64* %5
%17 = load i64, i64* %6
%18 = add i64 %16, %17
%19 = mul i64 2, %18
%20 = sub i64 %15, %19
%21 = load i64*, i64** %8
store i64 %20, i64* %21
ret void
}

LLVM IR (-O2):
define void @gall_laplace_size(i64 %0, i64 %1, i64* nocapture writeonly %2, i64* nocapture writeonly %3) {
%5 = mul i64 %1, %0
store i64 %5, i64* %2
%6 = mul i64 %5, 5
%7 = add i64 %1, %0
%8 = mul i64 %7, -2
%9 = add i64 %8, %6
store i64 %9, i64* %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
void *malloc(size_t);
int /*<<< orphan*/ stderr;
void *xmalloc(size_t s) {
  void *p = malloc(s);
  if (!p) {
    fprintf(stderr, "out of memory\n");
    exit(2);
  }
  return p;
}


x86 assembly (clang, -O0):
<xmalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1173 <xmalloc+0x43>
mov    0x2e85(%rip),%rax
mov    (%rax),%edi
lea    0xe9c(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x2,%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmalloc>:
push   %rax
call   1040 <malloc@plt>
test   %rax,%rax
je     113d <xmalloc+0xd>
pop    %rcx
ret
mov    0x2e9c(%rip),%rax
mov    (%rax),%edi
lea    0xeb3(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x2,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [15 x i8] c"out of memory\0A\00"
define i8* @xmalloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %12, label %8
8: ; preds = %1
%9 = load i32, i32* @stderr
%10 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%11 = call i32 @exit(i32 2)
unreachable
12: ; preds = %1
%13 = load i8*, i8** %3
ret i8* %13
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [15 x i8] c"out of memory\0A\00"
define noalias i8* @xmalloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%7 = tail call i32 @exit(i32 2)
unreachable
8: ; preds = %1
ret i8* %2
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ atom;
};
typedef TYPE_1__ XPropertyEvent;

/* Variables and functions */
unsigned long get_XPropertyEvent_atom(void *_p) {
  return (unsigned long)((XPropertyEvent *)_p)->atom;
}


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

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

LLVM IR (-O0):
%struct.TYPE_2__ = type { i64 }
define i64 @get_XPropertyEvent_atom(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.TYPE_2__*
%5 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %4, i32 0, i32 0
%6 = load i64, i64* %5
ret i64 %6
}

LLVM IR (-O2):
define i64 @get_XPropertyEvent_atom(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
ret i64 %3
}
int is_valid_vertex(int d, int vertex_count) {
  int max = vertex_count - 1;
  if (d < 0 || d > max) {
    return d;
  }
  return 0;
}


x86 assembly (clang, -O0):
<is_valid_vertex>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x8(%rbp)
jl     1129 <is_valid_vertex+0x29>
mov    -0x8(%rbp),%eax
cmp    -0x10(%rbp),%eax
jle    1134 <is_valid_vertex+0x34>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    113b <is_valid_vertex+0x3b>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_valid_vertex>:
xor    %eax,%eax
cmp    %edi,%esi
cmovle %edi,%eax
test   %edi,%edi
cmovs  %edi,%eax
ret

LLVM IR (-O0):
define i32 @is_valid_vertex(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%7 = load i32, i32* %5
%8 = sub nsw i32 %7, 1
store i32 %8, i32* %6
%9 = load i32, i32* %4
%10 = icmp slt i32 %9, 0
br i1 %10, label %15, label %11
11: ; preds = %2
%12 = load i32, i32* %4
%13 = load i32, i32* %6
%14 = icmp sgt i32 %12, %13
br i1 %14, label %15, label %17
15: ; preds = %11, %2
%16 = load i32, i32* %4
store i32 %16, i32* %3
br label %18
17: ; preds = %11
store i32 0, i32* %3
br label %18
18: ; preds = %17, %15
%19 = load i32, i32* %3
ret i32 %19
}

LLVM IR (-O2):
define i32 @is_valid_vertex(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, -1
%4 = icmp sgt i32 %1, %0
%5 = and i1 %3, %4
%6 = select i1 %5, i32 0, i32 %0
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ cstr_free(char **);
char *strdup(char const *);
void cstr_set(char **s, const char *n) {
  if (s != NULL) {
    cstr_free(s);
    if (n != NULL)
      *s = strdup(n);
  }
}


x86 assembly (clang, -O0):
<cstr_set>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1167 <cstr_set+0x47>
mov    -0x8(%rbp),%rdi
call   1030 <cstr_free@plt>
cmpq   $0x0,-0x10(%rbp)
je     1162 <cstr_set+0x42>
mov    -0x10(%rbp),%rdi
call   1040 <strdup@plt>
mov    %rax,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
jmp    1167 <cstr_set+0x47>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cstr_set>:
push   %r14
push   %rbx
push   %rax
test   %rdi,%rdi
je     1144 <cstr_set+0x24>
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <cstr_free@plt>
test   %r14,%r14
je     1144 <cstr_set+0x24>
mov    %r14,%rdi
call   1040 <strdup@plt>
mov    %rax,(%rbx)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @cstr_set(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 = icmp ne i8** %5, null
br i1 %6, label %7, label %17
7: ; preds = %2
%8 = load i8**, i8*** %3
%9 = call i32 @cstr_free(i8** %8)
%10 = load i8*, i8** %4
%11 = icmp ne i8* %10, null
br i1 %11, label %12, label %16
12: ; preds = %7
%13 = load i8*, i8** %4
%14 = call i8* @strdup(i8* %13)
%15 = load i8**, i8*** %3
store i8* %14, i8** %15
br label %16
16: ; preds = %12, %7
br label %17
17: ; preds = %16, %2
ret void
}

LLVM IR (-O2):
define void @cstr_set(i8** %0, i8* %1) {
%3 = icmp eq i8** %0, null
br i1 %3, label %9, label %4
4: ; preds = %2
%5 = tail call i32 @cstr_free(i8** %0)
%6 = icmp eq i8* %1, null
br i1 %6, label %9, label %7
7: ; preds = %4
%8 = tail call i8* @strdup(i8* %1)
store i8* %8, i8** %0
br label %9
9: ; preds = %4, %7, %2
ret void
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
void ubitmap_flip_bit(void *b, size_t num) {
  ((uint8_t *)b)[(num) / 8] ^= (0x80 >> ((num) % 8));
}


x86 assembly (clang, -O0):
<ubitmap_flip_bit>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
and    $0x7,%rax
mov    %eax,%ecx
mov    $0x80,%edx
sar    %cl,%edx
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
shr    $0x3,%rcx
xor    (%rax,%rcx,4),%edx
mov    %edx,(%rax,%rcx,4)
pop    %rbp
ret

x86 assembly (clang, -O2):
<ubitmap_flip_bit>:
mov    %esi,%ecx
and    $0x7,%cl
mov    $0x80,%eax
shr    %cl,%eax
shr    $0x3,%rsi
xor    %eax,(%rdi,%rsi,4)
ret

LLVM IR (-O0):
define void @ubitmap_flip_bit(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = urem i64 %5, 8
%7 = trunc i64 %6 to i32
%8 = ashr i32 128, %7
%9 = load i8*, i8** %3
%10 = bitcast i8* %9 to i32*
%11 = load i64, i64* %4
%12 = udiv i64 %11, 8
%13 = getelementptr inbounds i32, i32* %10, i64 %12
%14 = load i32, i32* %13
%15 = xor i32 %14, %8
store i32 %15, i32* %13
ret void
}

LLVM IR (-O2):
define void @ubitmap_flip_bit(i8* nocapture %0, i64 %1) {
%3 = trunc i64 %1 to i32
%4 = and i32 %3, 7
%5 = lshr i32 128, %4
%6 = bitcast i8* %0 to i32*
%7 = lshr i64 %1, 3
%8 = getelementptr inbounds i32, i32* %6, i64 %7
%9 = load i32, i32* %8
%10 = xor i32 %9, %5
store i32 %10, i32* %8
ret void
}
/* Variables and functions */
char **break_into_lines(char *, size_t, int *);
int /*<<< orphan*/ free(char *);
char **text_to_lines(char text[], size_t text_len, int *nlines) {
  char **list = NULL;
  if (text != NULL) {
    list = break_into_lines(text, text_len, nlines);
    free(text);
  }
  return list;
}


x86 assembly (clang, -O0):
<text_to_lines>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1165 <text_to_lines+0x45>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1040 <break_into_lines@plt>
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<text_to_lines>:
test   %rdi,%rdi
je     1147 <text_to_lines+0x27>
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1040 <break_into_lines@plt>
mov    %rax,%r14
mov    %rbx,%rdi
call   1030 <free@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i8** @text_to_lines(i8* %0, i64 %1, i32* %2) {
%4 = icmp eq i8* %0, null
br i1 %4, label %8, label %5
5: ; preds = %3
%6 = tail call i8** @break_into_lines(i8* %0, i64 %1, i32* %2)
%7 = tail call i32 @free(i8* %0)
br label %8
8: ; preds = %5, %3
%9 = phi i8** [ %6, %5 ], [ null, %3 ]
ret i8** %9
}
/* Type definitions */
typedef int /*<<< orphan*/ jmp_buf;

/* Variables and functions */
int /*<<< orphan*/ siglongjmp(int /*<<< orphan*/, int);
__attribute__((__noreturn__)) void sub5(jmp_buf buf) { siglongjmp(buf, 1); }


x86 assembly (clang, -O0):
<sub5>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x1,%esi
call   1030 <siglongjmp@plt>

x86 assembly (clang, -O2):
<sub5>:
push   %rax
mov    $0x1,%esi
call   1030 <siglongjmp@plt>

LLVM IR (-O0):
define void @sub5(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @siglongjmp(i32 %3, i32 1)
unreachable
}

LLVM IR (-O2):
define void @sub5(i32 %0) {
%2 = tail call i32 @siglongjmp(i32 %0, i32 1)
unreachable
}
int rightOleType(unsigned char *oleBuf) {
  return (oleBuf[0x42] == 1 || oleBuf[0x42] == 2 || oleBuf[0x42] == 3 ||
          oleBuf[0x42] == 5);
}


x86 assembly (clang, -O0):
<rightOleType>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl 0x42(%rax),%ecx
mov    $0x1,%al
cmp    $0x1,%ecx
mov    %al,-0x9(%rbp)
je     115b <rightOleType+0x5b>
mov    -0x8(%rbp),%rax
movzbl 0x42(%rax),%ecx
mov    $0x1,%al
cmp    $0x2,%ecx
mov    %al,-0x9(%rbp)
je     115b <rightOleType+0x5b>
mov    -0x8(%rbp),%rax
movzbl 0x42(%rax),%ecx
mov    $0x1,%al
cmp    $0x3,%ecx
mov    %al,-0x9(%rbp)
je     115b <rightOleType+0x5b>
mov    -0x8(%rbp),%rax
movzbl 0x42(%rax),%eax
cmp    $0x5,%eax
sete   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rightOleType>:
mov    0x42(%rdi),%al
lea    -0x1(%rax),%ecx
cmp    $0x3,%cl
setb   %cl
cmp    $0x5,%al
sete   %al
or     %cl,%al
movzbl %al,%eax
ret

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

LLVM IR (-O2):
define i32 @rightOleType(i8* nocapture %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 66
%3 = load i8, i8* %2
%4 = add i8 %3, -1
%5 = icmp ult i8 %4, 3
%6 = icmp eq i8 %3, 5
%7 = or i1 %6, %5
%8 = zext i1 %7 to i32
ret i32 %8
}
/* Variables and functions */
size_t hash_key(char *key, size_t count) {
  size_t k = 0;
  char *ptr = key;
  while (*ptr != '\0')
    k += (size_t) * (ptr++);
  return k % count;
}


x86 assembly (clang, -O0):
<hash_key>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     114c <hash_key+0x4c>
mov    -0x20(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x20(%rbp)
movsbq (%rax),%rax
add    -0x18(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    111c <hash_key+0x1c>
mov    -0x18(%rbp),%rax
xor    %ecx,%ecx
mov    %ecx,%edx
divq   -0x10(%rbp)
mov    %rdx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash_key>:
mov    (%rdi),%cl
test   %cl,%cl
je     1124 <hash_key+0x24>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
movsbq %cl,%rcx
add    %rcx,%rax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <hash_key+0x10>
jmp    1126 <hash_key+0x26>
xor    %eax,%eax
mov    %rax,%rcx
or     %rsi,%rcx
shr    $0x20,%rcx
je     113b <hash_key+0x3b>
xor    %edx,%edx
div    %rsi
mov    %rdx,%rax
ret
xor    %edx,%edx
div    %esi
mov    %edx,%eax
ret

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

LLVM IR (-O2):
define i64 @hash_key(i8* nocapture %0, i64 %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %14, label %5
5: ; preds = %2, %5
%6 = phi i8 [ %12, %5 ], [ %3, %2 ]
%7 = phi i8* [ %9, %5 ], [ %0, %2 ]
%8 = phi i64 [ %11, %5 ], [ 0, %2 ]
%9 = getelementptr inbounds i8, i8* %7, i64 1
%10 = sext i8 %6 to i64
%11 = add i64 %8, %10
%12 = load i8, i8* %9
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %5
14: ; preds = %5, %2
%15 = phi i64 [ 0, %2 ], [ %11, %5 ]
%16 = urem i64 %15, %1
ret i64 %16
}
/* Variables and functions */
int MAP_ANONYMOUS;
int MAP_SHARED;
void *mmap_helper(void *, size_t, int *, int, int, int /*<<< orphan*/, int,
                  int);
void *create_shared_anon_mem(void *addr_hint, size_t len, int *access,
                             int page_size, bool touch) {
  int flags;
  flags = (MAP_ANONYMOUS | MAP_SHARED);
  return mmap_helper(addr_hint, len, access, flags, -1, 0, page_size, touch);
}


x86 assembly (clang, -O0):
<create_shared_anon_mem>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8d,-0x20(%rbp)
mov    0x2eae(%rip),%rax
mov    (%rax),%eax
mov    0x2eb5(%rip),%rcx
or     (%rcx),%eax
mov    %eax,-0x24(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x24(%rbp),%ecx
mov    -0x1c(%rbp),%r10d
mov    -0x20(%rbp),%eax
mov    $0xffffffff,%r8d
xor    %r9d,%r9d
mov    %r10d,(%rsp)
mov    %eax,0x8(%rsp)
call   1030 <mmap_helper@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<create_shared_anon_mem>:
push   %rax
mov    %r8d,%eax
mov    %ecx,%r10d
mov    0x2ec2(%rip),%r8
mov    0x2ecb(%rip),%rcx
mov    (%rcx),%ecx
or     (%r8),%ecx
mov    $0xffffffff,%r8d
xor    %r9d,%r9d
push   %rax
push   %r10
call   1030 <mmap_helper@plt>
add    $0x10,%rsp
pop    %rcx
ret

LLVM IR (-O0):
@MAP_ANONYMOUS = global i32 0
@MAP_SHARED = global i32 0
define i8* @create_shared_anon_mem(i8* %0, i64 %1, i32* %2, i32 %3, i32 %4) {
%6 = alloca i8*
%7 = alloca i64
%8 = alloca i32*
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
store i8* %0, i8** %6
store i64 %1, i64* %7
store i32* %2, i32** %8
store i32 %3, i32* %9
store i32 %4, i32* %10
%12 = load i32, i32* @MAP_ANONYMOUS
%13 = load i32, i32* @MAP_SHARED
%14 = or i32 %12, %13
store i32 %14, i32* %11
%15 = load i8*, i8** %6
%16 = load i64, i64* %7
%17 = load i32*, i32** %8
%18 = load i32, i32* %11
%19 = load i32, i32* %9
%20 = load i32, i32* %10
%21 = call i8* @mmap_helper(i8* %15, i64 %16, i32* %17, i32 %18, i32 -1, i32 0, i32 %19, i32 %20)
ret i8* %21
}

LLVM IR (-O2):
@MAP_ANONYMOUS = global i32 0
@MAP_SHARED = global i32 0
define i8* @create_shared_anon_mem(i8* %0, i64 %1, i32* %2, i32 %3, i32 %4) {
%6 = load i32, i32* @MAP_ANONYMOUS
%7 = load i32, i32* @MAP_SHARED
%8 = or i32 %7, %6
%9 = tail call i8* @mmap_helper(i8* %0, i64 %1, i32* %2, i32 %8, i32 -1, i32 0, i32 %3, i32 %4)
ret i8* %9
}
/* Variables and functions */
int /*<<< orphan*/ func();
int /*<<< orphan*/ printf(char *);
int main(void) {
  printf("Hello from prog2.c\n");
  func();
  return 0;
}


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

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

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

LLVM IR (-O2):
@str = [19 x i8] c"Hello from prog2.c\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (...) @func()
ret i32 0
}
/* Type definitions */
struct stat {
  long long st_size;
};

/* Variables and functions */
int stat(char const *, struct stat *);
long long get_file_size(const char *filename) {
  struct stat st;
  int rc = stat(filename, &st);
  if (0 != rc) {
    return -1;
  } else {
    return st.st_size;
  }
}


x86 assembly (clang, -O0):
<get_file_size>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1030 <stat@plt>
mov    %eax,-0x1c(%rbp)
xor    %eax,%eax
cmp    -0x1c(%rbp),%eax
je     1144 <get_file_size+0x34>
movq   $0xffffffffffffffff,-0x8(%rbp)
ff
jmp    114c <get_file_size+0x3c>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_file_size>:
push   %rax
mov    %rsp,%rsi
call   1030 <stat@plt>
neg    %eax
sbb    %rax,%rax
or     (%rsp),%rax
pop    %rcx
ret

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

LLVM IR (-O2):
%struct.stat = type { i64 }
define i64 @get_file_size(i8* nocapture %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i32 @stat(i8* %0, %struct.stat* %2)
%5 = icmp eq i32 %4, 0
%6 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%7 = load i64, i64* %6
%8 = select i1 %5, i64 %7, i64 -1
ret i64 %8
}
void pt_encoder_fini(struct pt_encoder *encoder) {}


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

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

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

LLVM IR (-O2):
%struct.pt_encoder = type opaque
define void @pt_encoder_fini(%struct.pt_encoder* nocapture %0) {
ret void
}
void INT_WDTI(void) {}


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

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

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

LLVM IR (-O2):
define void @INT_WDTI() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void usage(void) {
  printf("Usage: tdbdump [options] <filename>\n\n");
  printf("   -h          this help message\n");
  printf("   -k keyname  dumps value of keyname\n");
}


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

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

LLVM IR (-O0):
@.str = [38 x i8] c"Usage: tdbdump [options] <filename>\0A\0A\00"
@.str.1 = [34 x i8] c" -h this help message\0A\00"
@.str.2 = [39 x i8] c" -k keyname dumps value of keyname\0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [37 x i8] c"Usage: tdbdump [options] <filename>\0A\00"
@str.3 = [33 x i8] c" -h this help message\00"
@str.4 = [38 x i8] c" -k keyname dumps value of keyname\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @str.3, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @str.4, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ eeconfig_update_user(int /*<<< orphan*/);
__attribute__((weak)) void eeconfig_init_user(void) { eeconfig_update_user(0); }


x86 assembly (clang, -O0):
<eeconfig_init_user>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <eeconfig_update_user@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<eeconfig_init_user>:
xor    %edi,%edi
jmp    1030 <eeconfig_update_user@plt>

LLVM IR (-O0):
define weak void @eeconfig_init_user() {
%1 = call i32 @eeconfig_update_user(i32 0)
ret void
}

LLVM IR (-O2):
define weak void @eeconfig_init_user() {
%1 = tail call i32 @eeconfig_update_user(i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ interrupt(int, int, char *, int, int /*<<< orphan*/);
void executeCommand(char *args[]) {
  interrupt(0x21, 0x4, args[1], 0x2000, 0);
  return;
}


x86 assembly (clang, -O0):
<executeCommand>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%rdx
mov    $0x21,%edi
mov    $0x4,%esi
mov    $0x2000,%ecx
xor    %r8d,%r8d
call   1030 <interrupt@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<executeCommand>:
mov    0x8(%rdi),%rdx
mov    $0x21,%edi
mov    $0x4,%esi
mov    $0x2000,%ecx
xor    %r8d,%r8d
jmp    1030 <interrupt@plt>

LLVM IR (-O0):
define void @executeCommand(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
%3 = load i8**, i8*** %2
%4 = getelementptr inbounds i8*, i8** %3, i64 1
%5 = load i8*, i8** %4
%6 = call i32 @interrupt(i32 33, i32 4, i8* %5, i32 8192, i32 0)
ret void
}

LLVM IR (-O2):
define void @executeCommand(i8** nocapture %0) {
%2 = getelementptr inbounds i8*, i8** %0, i64 1
%3 = load i8*, i8** %2
%4 = tail call i32 @interrupt(i32 33, i32 4, i8* %3, i32 8192, i32 0)
ret void
}
/* Variables and functions */
void snprintf(void) {}


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

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

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

LLVM IR (-O2):
define void @snprintf() {
ret void
}
char dec2hex(int dec) { return "0123456789ABCDEF"[dec]; }


x86 assembly (clang, -O0):
<dec2hex>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movslq -0x4(%rbp),%rcx
lea    0xeee(%rip),%rax
movsbl (%rax,%rcx,1),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<dec2hex>:
movslq %edi,%rax
lea    0xef6(%rip),%rcx
mov    (%rax,%rcx,1),%al
ret

LLVM IR (-O0):
@.str = [17 x i8] c"0123456789ABCDEF\00"
define signext i8 @dec2hex(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds [17 x i8], [17 x i8]* @.str, i64 0, i64 %4
%6 = load i8, i8* %5
ret i8 %6
}

LLVM IR (-O2):
@.str = [17 x i8] c"0123456789ABCDEF\00"
define signext i8 @dec2hex(i32 %0) {
%2 = sext i32 %0 to i64
%3 = getelementptr inbounds [17 x i8], [17 x i8]* @.str, i64 0, i64 %2
%4 = load i8, i8* %3
ret i8 %4
}
/* Type definitions */
typedef int uint64_t;
typedef int uint16_t;

/* Variables and functions */
int bitcount(uint16_t word) {
  uint64_t x = word;
  const uint64_t m1 = 0x5555555555555555ULL;
  const uint64_t m2 = 0x3333333333333333ULL;
  const uint64_t h01 = 0x0101010101010101ULL;
  const uint64_t m4 = 0x0f0f0f0f0f0f0f0fULL;
  x -= (x >> 1) & m1;
  x = (x & m2) + ((x >> 2) & m2);
  x = (x + (x >> 4)) & m4;
  int retval = (x * h01) >> 56;
  return retval;
}


x86 assembly (clang, -O0):
<bitcount>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
movl   $0x55555555,-0xc(%rbp)
movl   $0x33333333,-0x10(%rbp)
movl   $0x1010101,-0x14(%rbp)
movl   $0xf0f0f0f,-0x18(%rbp)
mov    -0x8(%rbp),%ecx
sar    $0x1,%ecx
and    $0x55555555,%ecx
mov    -0x8(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
and    $0x33333333,%eax
mov    -0x8(%rbp),%ecx
sar    $0x2,%ecx
and    $0x33333333,%ecx
add    %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    -0x8(%rbp),%ecx
sar    $0x4,%ecx
add    %ecx,%eax
and    $0xf0f0f0f,%eax
mov    %eax,-0x8(%rbp)
imul   $0x1010101,-0x8(%rbp),%eax
mov    $0x38,%ecx
sar    %cl,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @bitcount(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %2
%9 = load i32, i32* %2
store i32 %9, i32* %3
store i32 1431655765, i32* %4
store i32 858993459, i32* %5
store i32 16843009, i32* %6
store i32 252645135, i32* %7
%10 = load i32, i32* %3
%11 = ashr i32 %10, 1
%12 = and i32 %11, 1431655765
%13 = load i32, i32* %3
%14 = sub nsw i32 %13, %12
store i32 %14, i32* %3
%15 = load i32, i32* %3
%16 = and i32 %15, 858993459
%17 = load i32, i32* %3
%18 = ashr i32 %17, 2
%19 = and i32 %18, 858993459
%20 = add nsw i32 %16, %19
store i32 %20, i32* %3
%21 = load i32, i32* %3
%22 = load i32, i32* %3
%23 = ashr i32 %22, 4
%24 = add nsw i32 %21, %23
%25 = and i32 %24, 252645135
store i32 %25, i32* %3
%26 = load i32, i32* %3
%27 = mul nsw i32 %26, 16843009
%28 = ashr i32 %27, 56
store i32 %28, i32* %8
%29 = load i32, i32* %8
ret i32 %29
}

LLVM IR (-O2):
define i32 @bitcount(i32 %0) {
ret i32 poison
}
int no_poll(struct cdev *dev __attribute__((__unused__)), int events,
            struct thread *td __attribute__((__unused__))) {
  return (0x0020);
}


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

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

LLVM IR (-O0):
%struct.cdev = type opaque
%struct.thread = type opaque
define i32 @no_poll(%struct.cdev* %0, i32 %1, %struct.thread* %2) {
%4 = alloca %struct.cdev*
%5 = alloca i32
%6 = alloca %struct.thread*
store %struct.cdev* %0, %struct.cdev** %4
store i32 %1, i32* %5
store %struct.thread* %2, %struct.thread** %6
ret i32 32
}

LLVM IR (-O2):
%struct.cdev = type opaque
%struct.thread = type opaque
define i32 @no_poll(%struct.cdev* nocapture readnone %0, i32 %1, %struct.thread* nocapture readnone %2) {
ret i32 32
}
/* Variables and functions */
int /*<<< orphan*/ perror(char const *);
void perror_and_clean(const char *s) { perror(s); }


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

x86 assembly (clang, -O2):
<perror_and_clean>:
jmp    1030 <perror@plt>

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

LLVM IR (-O2):
define void @perror_and_clean(i8* nocapture %0) {
%2 = tail call i32 @perror(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ divide_array_array(double *, double *, double *, int, int);
void divide_array_array_inplace(double *a, double *b, int ncol, int nlns) {
  divide_array_array(a, a, b, ncol, nlns);
}


x86 assembly (clang, -O0):
<divide_array_array_inplace>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x14(%rbp),%ecx
mov    -0x18(%rbp),%r8d
call   1030 <divide_array_array@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<divide_array_array_inplace>:
mov    %ecx,%r8d
mov    %edx,%ecx
mov    %rsi,%rdx
mov    %rdi,%rsi
jmp    1030 <divide_array_array@plt>

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

LLVM IR (-O2):
define void @divide_array_array_inplace(double* %0, double* %1, i32 %2, i32 %3) {
%5 = tail call i32 @divide_array_array(double* %0, double* %0, double* %1, i32 %2, i32 %3)
ret void
}
/* Variables and functions */
double strtof(char const *, char **);
double strtod(const char *__restrict nptr, char **__restrict endptr) {
  return strtof(nptr, endptr);
}


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

x86 assembly (clang, -O2):
<strtod>:
jmp    1030 <strtof@plt>

LLVM IR (-O0):
define double @strtod(i8* noalias %0, i8** noalias %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 double @strtof(i8* %5, i8** %6)
ret double %7
}

LLVM IR (-O2):
define double @strtod(i8* noalias %0, i8** noalias nocapture %1) {
%3 = tail call double @strtof(i8* %0, i8** %1)
ret double %3
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int foo(int);
int main() {
  if (foo(1) != -2 || foo(3) != -2)
    abort();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x1,%edi
call   1040 <foo@plt>
cmp    $0xfffffffe,%eax
jne    1155 <main+0x35>
mov    $0x3,%edi
call   1040 <foo@plt>
cmp    $0xfffffffe,%eax
je     115c <main+0x3c>
mov    $0x0,%al
call   1030 <abort@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%edi
call   1040 <foo@plt>
cmp    $0xfffffffe,%eax
jne    1143 <main+0x23>
mov    $0x3,%edi
call   1040 <foo@plt>
cmp    $0xfffffffe,%eax
jne    1143 <main+0x23>
xor    %eax,%eax
pop    %rcx
ret
xor    %eax,%eax
call   1030 <abort@plt>

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @foo(i32 1)
%2 = icmp eq i32 %1, -2
br i1 %2, label %3, label %6
3: ; preds = %0
%4 = tail call i32 @foo(i32 3)
%5 = icmp eq i32 %4, -2
br i1 %5, label %8, label %6
6: ; preds = %3, %0
%7 = tail call i32 (...) @abort()
unreachable
8: ; preds = %3
ret i32 0
}
int ehci_detect(struct ehci_host *ehci) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.ehci_host = type opaque
define i32 @ehci_detect(%struct.ehci_host* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ niceprint(char *);
void shelter(void) {
  niceprint(
      "The party stumbles upon a cave that is sheltered and easily defended. "
      "If the characters camp here, they can finish a long rest without any "
      "chance of an encounter while they are resting.\n\n");
}


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

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

LLVM IR (-O0):
@.str = [188 x i8] c"The party stumbles upon a cave that is sheltered and easily defended. If the characters camp here, they can finish a long rest without any chance of an encounter while they are resting.\0A\0A\00"
define void @shelter() {
%1 = call i32 @niceprint(i8* getelementptr inbounds ([188 x i8], [188 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [188 x i8] c"The party stumbles upon a cave that is sheltered and easily defended. If the characters camp here, they can finish a long rest without any chance of an encounter while they are resting.\0A\0A\00"
define void @shelter() {
%1 = tail call i32 @niceprint(i8* getelementptr inbounds ([188 x i8], [188 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ e_adc();
int /*<<< orphan*/ e_zpx();
void e_adc_zpx() {
  e_zpx();
  e_adc();
}


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

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

LLVM IR (-O0):
define void @e_adc_zpx() {
%1 = call i32 (...) @e_zpx()
%2 = call i32 (...) @e_adc()
ret void
}

LLVM IR (-O2):
define void @e_adc_zpx() {
%1 = tail call i32 (...) @e_zpx()
%2 = tail call i32 (...) @e_adc()
ret void
}