xunge/DecIR huggingface dataset:
int PageTransTail(struct page *page) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.page = type opaque
define i32 @PageTransTail(%struct.page* nocapture readnone %0) {
ret i32 0
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  unsigned long serial;
};
struct TYPE_4__ {
  TYPE_1__ xkeymap;
};
typedef TYPE_2__ XEvent;

/* Variables and functions */
void set_XEvent_xkeymap_serial(void *_p, unsigned long _v) {
  ((XEvent *)_p)->xkeymap.serial = (unsigned long)_v;
}


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

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

LLVM IR (-O0):
%struct.TYPE_4__ = type { %struct.TYPE_3__ }
%struct.TYPE_3__ = type { i64 }
define void @set_XEvent_xkeymap_serial(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 = load i8*, i8** %3
%7 = bitcast i8* %6 to %struct.TYPE_4__*
%8 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %7, i32 0, i32 0
%9 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %8, i32 0, i32 0
store i64 %5, i64* %9
ret void
}

LLVM IR (-O2):
define void @set_XEvent_xkeymap_serial(i8* nocapture writeonly %0, i64 %1) {
%3 = bitcast i8* %0 to i64*
store i64 %1, i64* %3
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ WINDOW;

/* Variables and functions */
int wmove(WINDOW *w, int n1, int n2) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @wmove(i32* nocapture readnone %0, i32 %1, i32 %2) {
ret i32 0
}
void _malloc_prefork(void) { ; }


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

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

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

LLVM IR (-O2):
define void @_malloc_prefork() {
ret void
}
/* Variables and functions */
char *dupe_str(char const *);
int /*<<< orphan*/ free(char *);
size_t strlen(char const *);
char *update_string_string(char *str, const char *value, size_t *length) {
  if (value == NULL) {
    ;
    return str;
  }
  if (str != NULL) {
    free(str);
  }
  *length = strlen(value);
  return dupe_str(value);
}


x86 assembly (clang, -O0):
<update_string_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    115c <update_string_string+0x2c>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1190 <update_string_string+0x60>
cmpq   $0x0,-0x10(%rbp)
je     1170 <update_string_string+0x40>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
mov    -0x18(%rbp),%rdi
call   1050 <strlen@plt>
mov    %rax,%rcx
mov    -0x20(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x18(%rbp),%rdi
call   1040 <dupe_str@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<update_string_string>:
test   %rsi,%rsi
je     1163 <update_string_string+0x33>
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rsi,%rbx
test   %rdi,%rdi
je     1149 <update_string_string+0x19>
call   1030 <free@plt>
mov    %rbx,%rdi
call   1050 <strlen@plt>
mov    %rax,(%r14)
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <dupe_str@plt>
mov    %rdi,%rax
ret

LLVM IR (-O0):
define i8* @update_string_string(i8* %0, i8* %1, i64* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i64*
store i8* %0, i8** %5
store i8* %1, i8** %6
store i64* %2, i64** %7
%8 = load i8*, i8** %6
%9 = icmp eq i8* %8, null
br i1 %9, label %10, label %12
10: ; preds = %3
%11 = load i8*, i8** %5
store i8* %11, i8** %4
br label %24
12: ; preds = %3
%13 = load i8*, i8** %5
%14 = icmp ne i8* %13, null
br i1 %14, label %15, label %18
15: ; preds = %12
%16 = load i8*, i8** %5
%17 = call i32 @free(i8* %16)
br label %18
18: ; preds = %15, %12
%19 = load i8*, i8** %6
%20 = call i64 @strlen(i8* %19)
%21 = load i64*, i64** %7
store i64 %20, i64* %21
%22 = load i8*, i8** %6
%23 = call i8* @dupe_str(i8* %22)
store i8* %23, i8** %4
br label %24
24: ; preds = %18, %10
%25 = load i8*, i8** %4
ret i8* %25
}

LLVM IR (-O2):
define i8* @update_string_string(i8* %0, i8* %1, i64* nocapture writeonly %2) {
%4 = icmp eq i8* %1, null
br i1 %4, label %12, label %5
5: ; preds = %3
%6 = icmp eq i8* %0, null
br i1 %6, label %9, label %7
7: ; preds = %5
%8 = tail call i32 @free(i8* %0)
br label %9
9: ; preds = %7, %5
%10 = tail call i64 @strlen(i8* %1)
store i64 %10, i64* %2
%11 = tail call i8* @dupe_str(i8* %1)
br label %12
12: ; preds = %3, %9
%13 = phi i8* [ %11, %9 ], [ %0, %3 ]
ret i8* %13
}
const char *Sigstr(int n) {}


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

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

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

LLVM IR (-O2):
define noalias i8* @Sigstr(i32 %0) {
ret i8* undef
}
/* Variables and functions */
int /*<<< orphan*/ tetris_send_newline();
int /*<<< orphan*/ tetris_send_string(char *);
void draw_board_line(void) {
  tetris_send_string("l..........l");
  tetris_send_newline();
}


x86 assembly (clang, -O0):
<draw_board_line>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <tetris_send_string@plt>
mov    $0x0,%al
call   1040 <tetris_send_newline@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<draw_board_line>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <tetris_send_string@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <tetris_send_newline@plt>

LLVM IR (-O0):
@.str = [13 x i8] c"l..........l\00"
define void @draw_board_line() {
%1 = call i32 @tetris_send_string(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (...) @tetris_send_newline()
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c"l..........l\00"
define void @draw_board_line() {
%1 = tail call i32 @tetris_send_string(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (...) @tetris_send_newline()
ret void
}
int calculate(int x) { return x * x; }


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

x86 assembly (clang, -O2):
<calculate>:
mov    %edi,%eax
imul   %edi,%eax
ret

LLVM IR (-O0):
define i32 @calculate(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* %2
%5 = mul nsw i32 %3, %4
ret i32 %5
}

LLVM IR (-O2):
define i32 @calculate(i32 %0) {
%2 = mul nsw i32 %0, %0
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ putchar(char);
void dump(char type) { putchar(type); }


x86 assembly (clang, -O0):
<dump>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edi
call   1030 <putchar@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dump>:
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
define void @dump(i8 signext %0) {
%2 = tail call i32 @putchar(i8 signext %0)
ret void
}
int isabre_fecha(char digito) {
  if ((digito == '(') || (digito == ')'))
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<isabre_fecha>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x28,%eax
je     1124 <isabre_fecha+0x24>
movsbl -0x5(%rbp),%eax
cmp    $0x29,%eax
jne    1130 <isabre_fecha+0x30>
movl   $0x1,-0x4(%rbp)
jmp    1137 <isabre_fecha+0x37>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isabre_fecha>:
and    $0xfe,%dil
xor    %eax,%eax
cmp    $0x28,%dil
sete   %al
ret

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

LLVM IR (-O2):
define i32 @isabre_fecha(i8 signext %0) {
%2 = and i8 %0, -2
%3 = icmp eq i8 %2, 40
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
scalar_t__ isalnum(int);
int isvalid_varchar(int c) {
  if (isalnum(c) || c == '_') {
    return 1;
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<isvalid_varchar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <isalnum@plt>
cmp    $0x0,%rax
jne    1137 <isvalid_varchar+0x27>
cmpl   $0x5f,-0x8(%rbp)
jne    1143 <isvalid_varchar+0x33>
movl   $0x1,-0x4(%rbp)
jmp    114a <isvalid_varchar+0x3a>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @isvalid_varchar(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = call i64 @isalnum(i32 %4)
%6 = icmp ne i64 %5, 0
br i1 %6, label %10, label %7
7: ; preds = %1
%8 = load i32, i32* %3
%9 = icmp eq i32 %8, 95
br i1 %9, label %10, label %11
10: ; preds = %7, %1
store i32 1, i32* %2
br label %12
11: ; preds = %7
store i32 0, i32* %2
br label %12
12: ; preds = %11, %10
%13 = load i32, i32* %2
ret i32 %13
}

LLVM IR (-O2):
define i32 @isvalid_varchar(i32 %0) {
%2 = tail call i64 @isalnum(i32 %0)
%3 = icmp ne i64 %2, 0
%4 = icmp eq i32 %0, 95
%5 = or i1 %4, %3
%6 = zext i1 %5 to i32
ret i32 %6
}
int fun150() { return 150; }


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

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

LLVM IR (-O0):
define i32 @fun150() {
ret i32 150
}

LLVM IR (-O2):
define i32 @fun150() {
ret i32 150
}
/* Type definitions */
struct ether_addr {
  int dummy;
};

/* Variables and functions */
struct ether_addr *ether_aton_r(char const *, struct ether_addr *);
struct ether_addr *ether_aton(const char *a) {
  static struct ether_addr e;
  return (ether_aton_r(a, &e));
}


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

x86 assembly (clang, -O2):
<ether_aton>:
lea    0x2f15(%rip),%rsi
jmp    1030 <ether_aton_r@plt>

LLVM IR (-O0):
%struct.ether_addr = type { i32 }
@ether_aton.e = internal global %struct.ether_addr zeroinitializer
define %struct.ether_addr* @ether_aton(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call %struct.ether_addr* @ether_aton_r(i8* %3, %struct.ether_addr* @ether_aton.e)
ret %struct.ether_addr* %4
}

LLVM IR (-O2):
%struct.ether_addr = type { i32 }
@ether_aton.e = internal global %struct.ether_addr zeroinitializer
define %struct.ether_addr* @ether_aton(i8* %0) {
%2 = tail call %struct.ether_addr* @ether_aton_r(i8* %0, %struct.ether_addr* @ether_aton.e)
ret %struct.ether_addr* %2
}
/* Variables and functions */
int get_pid();
int mptest_start(volatile int *irqmp_ptr) {
  int id, i, sem, ncpu;
  unsigned int ccfg;
  ncpu = (((*(irqmp_ptr + 0x10 / 4)) >> 28) & 0x0f) + 1;
  if (ncpu == 1)
    return (-1);
  id = get_pid();
  if (id == 0) {
    *(irqmp_ptr + 0x10 / 4) = 0x0ffff;
  }
}


x86 assembly (clang, -O0):
<mptest_start>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%eax
sar    $0x1c,%eax
and    $0xf,%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
cmpl   $0x1,-0x20(%rbp)
jne    1145 <mptest_start+0x35>
movl   $0xffffffff,-0x4(%rbp)
jmp    1164 <mptest_start+0x54>
mov    $0x0,%al
call   1030 <get_pid@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jne    1164 <mptest_start+0x54>
mov    -0x10(%rbp),%rax
movl   $0xffff,0x10(%rax)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mptest_start>:
push   %rbx
mov    0x10(%rdi),%eax
cmp    $0x10000000,%eax
jb     1130 <mptest_start+0x20>
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <get_pid@plt>
test   %eax,%eax
jne    1130 <mptest_start+0x20>
movl   $0xffff,0x10(%rbx)
mov    $0xffffffff,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @mptest_start(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** %3
%9 = load i32*, i32** %3
%10 = getelementptr inbounds i32, i32* %9, i64 4
%11 = load volatile i32, i32* %10
%12 = ashr i32 %11, 28
%13 = and i32 %12, 15
%14 = add nsw i32 %13, 1
store i32 %14, i32* %7
%15 = load i32, i32* %7
%16 = icmp eq i32 %15, 1
br i1 %16, label %17, label %18
17: ; preds = %1
store i32 -1, i32* %2
br label %25
18: ; preds = %1
%19 = call i32 (...) @get_pid()
store i32 %19, i32* %4
%20 = load i32, i32* %4
%21 = icmp eq i32 %20, 0
br i1 %21, label %22, label %25
22: ; preds = %18
%23 = load i32*, i32** %3
%24 = getelementptr inbounds i32, i32* %23, i64 4
store volatile i32 65535, i32* %24
br label %25
25: ; preds = %17, %22, %18
%26 = load i32, i32* %2
ret i32 %26
}

LLVM IR (-O2):
define i32 @mptest_start(i32* %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 4
%3 = load volatile i32, i32* %2
%4 = icmp ult i32 %3, 268435456
br i1 %4, label %9, label %5
5: ; preds = %1
%6 = tail call i32 (...) @get_pid()
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %5
store volatile i32 65535, i32* %2
br label %9
9: ; preds = %5, %8, %1
ret i32 -1
}
/* Type definitions */
struct cache_entry_ {
  int dummy;
};
struct cache_ {
  int dummy;
};

/* Variables and functions */
struct cache_entry_ **find_cache_entry_p(struct cache_ *, char const *);
struct cache_entry_ *find_cache_entry(struct cache_ *the_cache,
                                      const char *entry_name) {
  struct cache_entry_ **result;
  (void)0;
  result = find_cache_entry_p(the_cache, entry_name);
  if (result == NULL) {
    (void)0;
    return (NULL);
  } else {
    (void)0;
    return (*result);
  }
}


x86 assembly (clang, -O0):
<find_cache_entry>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <find_cache_entry_p@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    1149 <find_cache_entry+0x39>
movq   $0x0,-0x8(%rbp)
jmp    1154 <find_cache_entry+0x44>
mov    -0x20(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<find_cache_entry>:
push   %rax
call   1030 <find_cache_entry_p@plt>
test   %rax,%rax
je     1120 <find_cache_entry+0x10>
mov    (%rax),%rax
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.cache_entry_ = type { i32 }
%struct.cache_ = type { i32 }
define %struct.cache_entry_* @find_cache_entry(%struct.cache_* %0, i8* %1) {
%3 = alloca %struct.cache_entry_*
%4 = alloca %struct.cache_*
%5 = alloca i8*
%6 = alloca %struct.cache_entry_**
store %struct.cache_* %0, %struct.cache_** %4
store i8* %1, i8** %5
%7 = load %struct.cache_*, %struct.cache_** %4
%8 = load i8*, i8** %5
%9 = call %struct.cache_entry_** @find_cache_entry_p(%struct.cache_* %7, i8* %8)
store %struct.cache_entry_** %9, %struct.cache_entry_*** %6
%10 = load %struct.cache_entry_**, %struct.cache_entry_*** %6
%11 = icmp eq %struct.cache_entry_** %10, null
br i1 %11, label %12, label %13
12: ; preds = %2
store %struct.cache_entry_* null, %struct.cache_entry_** %3
br label %16
13: ; preds = %2
%14 = load %struct.cache_entry_**, %struct.cache_entry_*** %6
%15 = load %struct.cache_entry_*, %struct.cache_entry_** %14
store %struct.cache_entry_* %15, %struct.cache_entry_** %3
br label %16
16: ; preds = %13, %12
%17 = load %struct.cache_entry_*, %struct.cache_entry_** %3
ret %struct.cache_entry_* %17
}

LLVM IR (-O2):
%struct.cache_entry_ = type { i32 }
%struct.cache_ = type { i32 }
define %struct.cache_entry_* @find_cache_entry(%struct.cache_* %0, i8* %1) {
%3 = tail call %struct.cache_entry_** @find_cache_entry_p(%struct.cache_* %0, i8* %1)
%4 = icmp eq %struct.cache_entry_** %3, null
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = load %struct.cache_entry_*, %struct.cache_entry_** %3
br label %7
7: ; preds = %2, %5
%8 = phi %struct.cache_entry_* [ %6, %5 ], [ null, %2 ]
ret %struct.cache_entry_* %8
}
/* Type definitions */
struct pico_mqtt_serializer {
  int dummy;
};

/* Variables and functions */
int serialize_sudirribtion(struct pico_mqtt_serializer *, int /*<<< orphan*/);
int serialize_unsudirribe(struct pico_mqtt_serializer *serializer) {
  do {
  } while (0);
  return serialize_sudirribtion(serializer, 0);
}


x86 assembly (clang, -O0):
<serialize_unsudirribe>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
jmp    1121 <serialize_unsudirribe+0x11>
mov    -0x8(%rbp),%rdi
xor    %esi,%esi
call   1030 <serialize_sudirribtion@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.pico_mqtt_serializer = type { i32 }
define i32 @serialize_unsudirribe(%struct.pico_mqtt_serializer* %0) {
%2 = alloca %struct.pico_mqtt_serializer*
store %struct.pico_mqtt_serializer* %0, %struct.pico_mqtt_serializer** %2
br label %3
3: ; preds = %1
br label %4
4: ; preds = %3
%5 = load %struct.pico_mqtt_serializer*, %struct.pico_mqtt_serializer** %2
%6 = call i32 @serialize_sudirribtion(%struct.pico_mqtt_serializer* %5, i32 0)
ret i32 %6
}

LLVM IR (-O2):
%struct.pico_mqtt_serializer = type { i32 }
define i32 @serialize_unsudirribe(%struct.pico_mqtt_serializer* %0) {
%2 = tail call i32 @serialize_sudirribtion(%struct.pico_mqtt_serializer* %0, i32 0)
ret i32 %2
}
int test12(const char *X) { return X == "foo"; }


x86 assembly (clang, -O0):
<test12>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
lea    0xef1(%rip),%rax
cmp    %rax,-0x8(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test12>:
lea    0xef9(%rip),%rcx
xor    %eax,%eax
cmp    %rcx,%rdi
sete   %al
ret

LLVM IR (-O0):
@.str = [4 x i8] c"foo\00"
define i32 @test12(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp eq i8* %3, getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0)
%5 = zext i1 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
@.str = [4 x i8] c"foo\00"
define i32 @test12(i8* readnone %0) {
%2 = icmp eq i8* %0, getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0)
%3 = zext i1 %2 to i32
ret i32 %3
}
int test_imm_32uint8_mem(unsigned char *val) {
  return ((*val) & (0x32 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_32uint8_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%edx
and    $0x32,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_32uint8_mem>:
testb  $0x32,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_32uint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, 50
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
void __asan_unregister_globals() {}


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

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

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

LLVM IR (-O2):
define void @__asan_unregister_globals() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  int xy = 42;
  printf("%d\n", xy);
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 42)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ test_solution();
int main() {
  test_solution();
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @test_solution()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @test_solution()
ret i32 0
}
int gcd(int a, int b) {
  if (a == 0)
    return b;
  else if (b == 0)
    return a;
  else
    return gcd(b, a % b);
}


x86 assembly (clang, -O0):
<gcd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1133 <gcd+0x23>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    115c <gcd+0x4c>
cmpl   $0x0,-0xc(%rbp)
jne    1148 <gcd+0x38>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    115c <gcd+0x4c>
mov    -0xc(%rbp),%edi
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    %edx,%esi
call   1030 <gcd@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gcd>:
mov    %esi,%edx
test   %edi,%edi
je     111e <gcd+0x1e>
mov    %edi,%eax
test   %edx,%edx
je     1120 <gcd+0x20>
nopl   0x0(%rax)
mov    %edx,%ecx
cltd
idiv   %ecx
mov    %ecx,%eax
test   %edx,%edx
jne    1110 <gcd+0x10>
mov    %ecx,%eax
ret
mov    %edx,%eax
ret

LLVM IR (-O0):
define i32 @gcd(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = load i32, i32* %4
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i32, i32* %5
store i32 %9, i32* %3
br label %21
10: ; preds = %2
%11 = load i32, i32* %5
%12 = icmp eq i32 %11, 0
br i1 %12, label %13, label %15
13: ; preds = %10
%14 = load i32, i32* %4
store i32 %14, i32* %3
br label %21
15: ; preds = %10
%16 = load i32, i32* %5
%17 = load i32, i32* %4
%18 = load i32, i32* %5
%19 = srem i32 %17, %18
%20 = call i32 @gcd(i32 %16, i32 %19)
store i32 %20, i32* %3
br label %21
21: ; preds = %15, %13, %8
%22 = load i32, i32* %3
ret i32 %22
}

LLVM IR (-O2):
define i32 @gcd(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, 0
br i1 %3, label %11, label %4
4: ; preds = %2
%5 = icmp eq i32 %1, 0
br i1 %5, label %11, label %6
6: ; preds = %4, %6
%7 = phi i32 [ %8, %6 ], [ %0, %4 ]
%8 = phi i32 [ %9, %6 ], [ %1, %4 ]
%9 = srem i32 %7, %8
%10 = icmp eq i32 %9, 0
br i1 %10, label %11, label %6
11: ; preds = %6, %4, %2
%12 = phi i32 [ %1, %2 ], [ %0, %4 ], [ %8, %6 ]
ret i32 %12
}
/* Type definitions */
struct Tuple2_Int_Int {
  int dummy;
};

/* Variables and functions */
struct Tuple2_Int_Int *Tuple2_0(int /*<<< orphan*/, int /*<<< orphan*/);
struct Tuple2_Int_Int *init_pos() {
  return Tuple2_0(0, 0);
}


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

x86 assembly (clang, -O2):
<init_pos>:
xor    %edi,%edi
xor    %esi,%esi
jmp    1030 <Tuple2_0@plt>

LLVM IR (-O0):
%struct.Tuple2_Int_Int = type { i32 }
define %struct.Tuple2_Int_Int* @init_pos() {
%1 = call %struct.Tuple2_Int_Int* @Tuple2_0(i32 0, i32 0)
ret %struct.Tuple2_Int_Int* %1
}

LLVM IR (-O2):
%struct.Tuple2_Int_Int = type { i32 }
define %struct.Tuple2_Int_Int* @init_pos() {
%1 = tail call %struct.Tuple2_Int_Int* @Tuple2_0(i32 0, i32 0)
ret %struct.Tuple2_Int_Int* %1
}
int to_hex2(int x) {
  int result;
  __asm__ volatile("andl $0x0f, %%eax			\n"
                   "leal (0x7fffffff-9)(%%eax), %%ebx	\n"
                   "sarl $31, %%ebx			\n"
                   "andl $39, %%ebx			\n"
                   "leal '0'(%%eax, %%ebx), %%eax		\n"
                   : "=a"(result)
                   : "a"(x)
                   : "ebx");
  return result;
}


x86 assembly (clang, -O0):
<to_hex2>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
mov    %edi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
and    $0xf,%eax
lea    0x7ffffff6(%eax),%ebx
sar    $0x1f,%ebx
and    $0x27,%ebx
lea    0x30(%eax,%ebx,1),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<to_hex2>:
push   %rbx
mov    %edi,%eax
and    $0xf,%eax
lea    0x7ffffff6(%eax),%ebx
sar    $0x1f,%ebx
and    $0x27,%ebx
lea    0x30(%eax,%ebx,1),%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @to_hex2(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i32 asm sideeffect "andl $$0x0f, %eax\09\09\09\0Aleal (0x7fffffff-9)(%eax), %ebx\09\0Asarl $$31, %ebx\09\09\09\0Aandl $$39, %ebx\09\09\09\0Aleal '0'(%eax, %ebx), %eax\09\09\0A", "={ax},{ax},~{ebx},~{dirflag},~{fpsr},~{flags}"(i32 %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
ret i32 %6
}

LLVM IR (-O2):
define i32 @to_hex2(i32 %0) {
%2 = tail call i32 asm sideeffect "andl $$0x0f, %eax\09\09\09\0Aleal (0x7fffffff-9)(%eax), %ebx\09\0Asarl $$31, %ebx\09\09\09\0Aandl $$39, %ebx\09\09\09\0Aleal '0'(%eax, %ebx), %eax\09\09\0A", "={ax},{ax},~{ebx},~{dirflag},~{fpsr},~{flags}"(i32 %0)
ret i32 %2
}
unsigned log2_roundup(unsigned n) {
  unsigned l2;
  l2 = 31 - __builtin_clz(n);
  if (n == 1U << l2) {
    return l2;
  }
  return l2 + 1;
}


x86 assembly (clang, -O0):
<log2_roundup>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
bsr    %eax,%ecx
xor    $0x1f,%ecx
mov    $0x1f,%eax
sub    %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    -0xc(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
cmp    %ecx,%eax
jne    113c <log2_roundup+0x3c>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1145 <log2_roundup+0x45>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<log2_roundup>:
bsr    %edi,%ecx
mov    %ecx,%eax
xor    $0xffffffe0,%eax
mov    $0x1,%edx
shl    %cl,%edx
add    $0x21,%eax
cmp    %edi,%edx
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @log2_roundup(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
%5 = load i32, i32* %3
%6 = call i32 @llvm.ctlz.i32(i32 %5, i1 true)
%7 = sub nsw i32 31, %6
store i32 %7, i32* %4
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = shl i32 1, %9
%11 = icmp eq i32 %8, %10
br i1 %11, label %12, label %14
12: ; preds = %1
%13 = load i32, i32* %4
store i32 %13, i32* %2
br label %17
14: ; preds = %1
%15 = load i32, i32* %4
%16 = add i32 %15, 1
store i32 %16, i32* %2
br label %17
17: ; preds = %14, %12
%18 = load i32, i32* %2
ret i32 %18
}

LLVM IR (-O2):
define i32 @log2_roundup(i32 %0) {
%2 = tail call i32 @llvm.ctlz.i32(i32 %0, i1 true)
%3 = xor i32 %2, 31
%4 = shl nuw i32 1, %3
%5 = icmp eq i32 %4, %0
%6 = sub nuw nsw i32 32, %2
%7 = select i1 %5, i32 %3, i32 %6
ret i32 %7
}
int send_cmd_unlink(void) {}


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

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

LLVM IR (-O0):
define i32 @send_cmd_unlink() {
%1 = alloca i32
%2 = load i32, i32* %1
ret i32 %2
}

LLVM IR (-O2):
define i32 @send_cmd_unlink() {
ret i32 undef
}
void RTAvlULRemoveBestFit(void) {}


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

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

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

LLVM IR (-O2):
define void @RTAvlULRemoveBestFit() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void PrintName() { printf("liuchao\n"); }


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

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

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

LLVM IR (-O2):
@str = [8 x i8] c"liuchao\00"
define void @PrintName() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int count_chars(char, char *);
int /*<<< orphan*/ sprintf(char *, char *, int, int);
int LeftJust_int(char *fmt_str, int from_int, char *to_str) {
  int num_of_d = count_chars('d', fmt_str);
  sprintf(to_str, "%-*d", num_of_d, from_int);
  return num_of_d;
}


x86 assembly (clang, -O0):
<LeftJust_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rsi
mov    $0x64,%edi
call   1030 <count_chars@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x1c(%rbp),%edx
mov    -0xc(%rbp),%ecx
lea    0xeab(%rip),%rsi
call   1040 <sprintf@plt>
mov    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<LeftJust_int>:
push   %rbp
push   %r14
push   %rbx
mov    %rdx,%rbx
mov    %esi,%r14d
mov    %rdi,%rsi
mov    $0x64,%edi
call   1030 <count_chars@plt>
mov    %eax,%ebp
lea    0xec0(%rip),%rsi
mov    %rbx,%rdi
mov    %eax,%edx
mov    %r14d,%ecx
call   1040 <sprintf@plt>
mov    %ebp,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [5 x i8] c"%-*d\00"
define i32 @LeftJust_int(i8* %0, i32 %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%8 = load i8*, i8** %4
%9 = call i32 @count_chars(i8 signext 100, i8* %8)
store i32 %9, i32* %7
%10 = load i8*, i8** %6
%11 = load i32, i32* %7
%12 = load i32, i32* %5
%13 = call i32 @sprintf(i8* %10, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %11, i32 %12)
%14 = load i32, i32* %7
ret i32 %14
}

LLVM IR (-O2):
@.str = [5 x i8] c"%-*d\00"
define i32 @LeftJust_int(i8* %0, i32 %1, i8* nocapture writeonly %2) {
%4 = tail call i32 @count_chars(i8 signext 100, i8* %0)
%5 = tail call i32 @sprintf(i8* dereferenceable(1) %2, i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %4, i32 %1)
ret i32 %4
}
/* Variables and functions */
double cos(int /*<<< orphan*/);
int /*<<< orphan*/ ephDegToRad(double);
double ephCos(double theta) { return cos(ephDegToRad(theta)); }


x86 assembly (clang, -O0):
<ephCos>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <ephDegToRad@plt>
mov    %eax,%edi
call   1040 <cos@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ephCos>:
push   %rax
call   1030 <ephDegToRad@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <cos@plt>

LLVM IR (-O0):
define double @ephCos(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call i32 @ephDegToRad(double %3)
%5 = call double @cos(i32 %4)
ret double %5
}

LLVM IR (-O2):
define double @ephCos(double %0) {
%2 = tail call i32 @ephDegToRad(double %0)
%3 = tail call double @cos(i32 %2)
ret double %3
}
/* Variables and functions */
int /*<<< orphan*/ f();
void d() { f(); }


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

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

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

LLVM IR (-O2):
define void @d() {
%1 = tail call i32 (...) @f()
ret void
}
int test_imm_4Cint8_reg(signed char val) {
  return ((val) & (0x4C << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_4Cint8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edx
and    $0x4c,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_4Cint8_reg>:
test   $0x4c,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_4Cint8_reg(i8 signext %0) {
%2 = and i8 %0, 76
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void handler(int signo __attribute__((unused))) {
  printf("OK to be in once\n");
}


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

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

LLVM IR (-O0):
@.str = [18 x i8] c"OK to be in once\0A\00"
define void @handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [17 x i8] c"OK to be in once\00"
define void @handler(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str, i64 0, i64 0))
ret void
}
unsigned long long process_is_writable_pte(struct trace_seq *s,
                                           unsigned long long *args) {
  unsigned long pte = args[0];
  return pte & (1ULL << 1);
}


x86 assembly (clang, -O0):
<process_is_writable_pte>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
and    $0x2,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<process_is_writable_pte>:
mov    (%rsi),%rax
and    $0x2,%eax
ret

LLVM IR (-O0):
%struct.trace_seq = type opaque
define i64 @process_is_writable_pte(%struct.trace_seq* %0, i64* %1) {
%3 = alloca %struct.trace_seq*
%4 = alloca i64*
%5 = alloca i64
store %struct.trace_seq* %0, %struct.trace_seq** %3
store i64* %1, i64** %4
%6 = load i64*, i64** %4
%7 = getelementptr inbounds i64, i64* %6, i64 0
%8 = load i64, i64* %7
store i64 %8, i64* %5
%9 = load i64, i64* %5
%10 = and i64 %9, 2
ret i64 %10
}

LLVM IR (-O2):
%struct.trace_seq = type opaque
define i64 @process_is_writable_pte(%struct.trace_seq* nocapture readnone %0, i64* nocapture %1) {
%3 = load i64, i64* %1
%4 = and i64 %3, 2
ret i64 %4
}
/* Variables and functions */
int /*<<< orphan*/ sem_unlink(char *);
int highlander_clean(void) {
  sem_unlink("/power_wrapperK");
  sem_unlink("/power_wrapperL");
}


x86 assembly (clang, -O0):
<highlander_clean>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
call   1030 <sem_unlink@plt>
lea    0xee5(%rip),%rdi
call   1030 <sem_unlink@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<highlander_clean>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <sem_unlink@plt>
lea    0xeec(%rip),%rdi
pop    %rax
jmp    1030 <sem_unlink@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"/power_wrapperK\00"
@.str.1 = [16 x i8] c"/power_wrapperL\00"
define i32 @highlander_clean() {
%1 = alloca i32
%2 = call i32 @sem_unlink(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @sem_unlink(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
%4 = load i32, i32* %1
ret i32 %4
}

LLVM IR (-O2):
@.str = [16 x i8] c"/power_wrapperK\00"
@.str.1 = [16 x i8] c"/power_wrapperL\00"
define i32 @highlander_clean() {
%1 = tail call i32 @sem_unlink(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @sem_unlink(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
ret i32 undef
}
char *jump_tok(string)
char *string;
{ return (apont_next_tok(apont_next_tok(string))); }


x86 assembly (clang, -O0):
<jump_tok>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1030 <apont_next_tok@plt>
mov    %eax,%edi
mov    $0x0,%al
call   1030 <apont_next_tok@plt>
cltq
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<jump_tok>:
push   %rax
xor    %eax,%eax
call   1030 <apont_next_tok@plt>
mov    %eax,%edi
xor    %eax,%eax
call   1030 <apont_next_tok@plt>
cltq
pop    %rcx
ret

LLVM IR (-O0):
define i8* @jump_tok(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 (i8*, ...) bitcast (i32 (...)* @apont_next_tok to i32 (i8*, ...)*)(i8* %3)
%5 = call i32 (i32, ...) bitcast (i32 (...)* @apont_next_tok to i32 (i32, ...)*)(i32 %4)
%6 = sext i32 %5 to i64
%7 = inttoptr i64 %6 to i8*
ret i8* %7
}

LLVM IR (-O2):
define i8* @jump_tok(i8* %0) {
%2 = tail call i32 (i8*, ...) bitcast (i32 (...)* @apont_next_tok to i32 (i8*, ...)*)(i8* %0)
%3 = tail call i32 (i32, ...) bitcast (i32 (...)* @apont_next_tok to i32 (i32, ...)*)(i32 %2)
%4 = sext i32 %3 to i64
%5 = inttoptr i64 %4 to i8*
ret i8* %5
}
/* Type definitions */
struct node_args_info {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ node_cmdline_parser_release(struct node_args_info *);
void node_cmdline_parser_free(struct node_args_info *args_info) {
  node_cmdline_parser_release(args_info);
}


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

x86 assembly (clang, -O2):
<node_cmdline_parser_free>:
jmp    1030 <node_cmdline_parser_release@plt>

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

LLVM IR (-O2):
%struct.node_args_info = type { i32 }
define void @node_cmdline_parser_free(%struct.node_args_info* %0) {
%2 = tail call i32 @node_cmdline_parser_release(%struct.node_args_info* %0)
ret void
}
/* Variables and functions */
int dspd_strtoi32(char const *, int *, int /*<<< orphan*/);
int dspd_strtoidef(const char *str, int defaultvalue) {
  int ret, val;
  if (!str)
    return defaultvalue;
  ret = dspd_strtoi32(str, &val, 0);
  if (ret == 0)
    ret = val;
  else
    ret = defaultvalue;
  return ret;
}


x86 assembly (clang, -O0):
<dspd_strtoidef>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1135 <dspd_strtoidef+0x25>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1168 <dspd_strtoidef+0x58>
mov    -0x10(%rbp),%rdi
lea    -0x1c(%rbp),%rsi
xor    %edx,%edx
call   1030 <dspd_strtoi32@plt>
mov    %eax,-0x18(%rbp)
cmpl   $0x0,-0x18(%rbp)
jne    115c <dspd_strtoidef+0x4c>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x18(%rbp)
jmp    1162 <dspd_strtoidef+0x52>
mov    -0x14(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dspd_strtoidef>:
push   %rbx
sub    $0x10,%rsp
mov    %esi,%ebx
test   %rdi,%rdi
je     1130 <dspd_strtoidef+0x20>
lea    0xc(%rsp),%rsi
xor    %edx,%edx
call   1030 <dspd_strtoi32@plt>
test   %eax,%eax
jne    1130 <dspd_strtoidef+0x20>
mov    0xc(%rsp),%ebx
mov    %ebx,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @dspd_strtoidef(i8* %0, i32 %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
%8 = load i8*, i8** %4
%9 = icmp ne i8* %8, null
br i1 %9, label %12, label %10
10: ; preds = %2
%11 = load i32, i32* %5
store i32 %11, i32* %3
br label %23
12: ; preds = %2
%13 = load i8*, i8** %4
%14 = call i32 @dspd_strtoi32(i8* %13, i32* %7, i32 0)
store i32 %14, i32* %6
%15 = load i32, i32* %6
%16 = icmp eq i32 %15, 0
br i1 %16, label %17, label %19
17: ; preds = %12
%18 = load i32, i32* %7
store i32 %18, i32* %6
br label %21
19: ; preds = %12
%20 = load i32, i32* %5
store i32 %20, i32* %6
br label %21
21: ; preds = %19, %17
%22 = load i32, i32* %6
store i32 %22, i32* %3
br label %23
23: ; preds = %21, %10
%24 = load i32, i32* %3
ret i32 %24
}

LLVM IR (-O2):
define i32 @dspd_strtoidef(i8* %0, i32 %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = icmp eq i8* %0, null
br i1 %5, label %11, label %6
6: ; preds = %2
%7 = call i32 @dspd_strtoi32(i8* %0, i32* %3, i32 0)
%8 = icmp eq i32 %7, 0
%9 = load i32, i32* %3
%10 = select i1 %8, i32 %9, i32 %1
br label %11
11: ; preds = %2, %6
%12 = phi i32 [ %10, %6 ], [ %1, %2 ]
ret i32 %12
}
void *xmalloc(unsigned int size) {
  void *cp;
  void *return_value_malloc$1;
  return_value_malloc$1 = malloc((unsigned long int)size);
  cp = (void *)return_value_malloc$1;
  if (cp == ((void *)0))
    error("out of memory");
  return cp;
}


x86 assembly (clang, -O0):
<xmalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,%edi
call   1030 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    115a <xmalloc+0x3a>
lea    0xead(%rip),%rdi
mov    $0x0,%al
call   1040 <error@plt>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmalloc>:
push   %rbx
mov    %edi,%edi
call   1030 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    113e <xmalloc+0x1e>
lea    0xec9(%rip),%rdi
xor    %eax,%eax
call   1040 <error@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [14 x i8] c"out of memory\00"
define i8* @xmalloc(i32 %0) {
%2 = zext i32 %0 to i64
%3 = tail call i8* @malloc(i64 %2)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = tail call i32 (i8*, ...) bitcast (i32 (...)* @error to i32 (i8*, ...)*)(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %1
ret i8* %3
}
/* Variables and functions */
int japi_getselect(int);
int j_getselect(int arg0) { return (japi_getselect(arg0)); }


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

x86 assembly (clang, -O2):
<j_getselect>:
jmp    1030 <japi_getselect@plt>

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

LLVM IR (-O2):
define i32 @j_getselect(i32 %0) {
%2 = tail call i32 @japi_getselect(i32 %0)
ret i32 %2
}
int cycle_is_update_vc(unsigned int flags) {
  return (flags & 0x01000000) ? 1 : 0;
}


x86 assembly (clang, -O0):
<cycle_is_update_vc>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
and    $0x1000000,%edx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cycle_is_update_vc>:
mov    %edi,%eax
shr    $0x18,%eax
and    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @cycle_is_update_vc(i32 %0) {
%2 = lshr i32 %0, 24
%3 = and i32 %2, 1
ret i32 %3
}
/* Type definitions */
struct spaceSaver {
  int dummy;
};

/* Variables and functions */
struct spaceSaver *spaceSaverMaxCellsNew(int, int, int, int);
struct spaceSaver *spaceSaverNew(int winStart, int winEnd, int maxRows) {
  return spaceSaverMaxCellsNew(winStart, winEnd, maxRows, 800);
}


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

x86 assembly (clang, -O2):
<spaceSaverNew>:
mov    $0x320,%ecx
jmp    1030 <spaceSaverMaxCellsNew@plt>

LLVM IR (-O0):
%struct.spaceSaver = type { i32 }
define %struct.spaceSaver* @spaceSaverNew(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = call %struct.spaceSaver* @spaceSaverMaxCellsNew(i32 %7, i32 %8, i32 %9, i32 800)
ret %struct.spaceSaver* %10
}

LLVM IR (-O2):
%struct.spaceSaver = type { i32 }
define %struct.spaceSaver* @spaceSaverNew(i32 %0, i32 %1, i32 %2) {
%4 = tail call %struct.spaceSaver* @spaceSaverMaxCellsNew(i32 %0, i32 %1, i32 %2, i32 800)
ret %struct.spaceSaver* %4
}