xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void print_usage(char *e) {
  printf("Usage: %s [-s <System.map>] -b <vmlinux> -c <certfile>\n", e);
  printf("       %s [-s <System.map>] -z <bzImage> -c <certfile>\n", e);
}


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

x86 assembly (clang, -O2):
<print_usage>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
lea    0xf0e(%rip),%rdi
mov    %rbx,%rsi
pop    %rbx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [56 x i8] c"Usage: %s [-s <System.map>] -b <vmlinux> -c <certfile>\0A\00"
@.str.1 = [56 x i8] c" %s [-s <System.map>] -z <bzImage> -c <certfile>\0A\00"
define void @print_usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = load i8*, i8** %2
%6 = call i32 @printf(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str.1, i64 0, i64 0), i8* %5)
ret void
}

LLVM IR (-O2):
@.str = [56 x i8] c"Usage: %s [-s <System.map>] -b <vmlinux> -c <certfile>\0A\00"
@.str.1 = [56 x i8] c" %s [-s <System.map>] -z <bzImage> -c <certfile>\0A\00"
define void @print_usage(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret void
}
int is_tab(char *line) { return line[0] == '\t'; }


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

x86 assembly (clang, -O2):
<is_tab>:
xor    %eax,%eax
cmpb   $0x9,(%rdi)
sete   %al
ret

LLVM IR (-O0):
define i32 @is_tab(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 0
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = icmp eq i32 %6, 9
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @is_tab(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 9
%4 = zext i1 %3 to i32
ret i32 %4
}
int nisdomain_set(const char *ifname, int ifindex, const char *domain) {
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @nisdomain_set(i8* nocapture readnone %0, i32 %1, i8* nocapture readnone %2) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ TCODE_LOCK_MASK_SWAP;
int /*<<< orphan*/ do_lock_request(int /*<<< orphan*/);
void do_mask_swap(void) { do_lock_request(TCODE_LOCK_MASK_SWAP); }


x86 assembly (clang, -O0):
<do_mask_swap>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ecd(%rip),%rax
mov    (%rax),%edi
call   1030 <do_lock_request@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_mask_swap>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%edi
jmp    1030 <do_lock_request@plt>

LLVM IR (-O0):
@TCODE_LOCK_MASK_SWAP = global i32 0
define void @do_mask_swap() {
%1 = load i32, i32* @TCODE_LOCK_MASK_SWAP
%2 = call i32 @do_lock_request(i32 %1)
ret void
}

LLVM IR (-O2):
@TCODE_LOCK_MASK_SWAP = global i32 0
define void @do_mask_swap() {
%1 = load i32, i32* @TCODE_LOCK_MASK_SWAP
%2 = tail call i32 @do_lock_request(i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ println(char *, char *);
void td_version(void) { println("todo%s", "0.2.6"); }


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

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

LLVM IR (-O0):
@.str = [7 x i8] c"todo%s\00"
@.str.1 = [6 x i8] c"0.2.6\00"
define void @td_version() {
%1 = call i32 @println(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"todo%s\00"
@.str.1 = [6 x i8] c"0.2.6\00"
define void @td_version() {
%1 = tail call i32 @println(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int socklen_t;
typedef int /*<<< orphan*/ error;

/* Variables and functions */
int /*<<< orphan*/ SOL_SOCKET;
int /*<<< orphan*/ SO_ERROR;
int getsockopt(int, int /*<<< orphan*/, int /*<<< orphan*/, int *, int *);
bool isSocketUp(int socket_fd) {
  int ret, error = 0;
  socklen_t len = sizeof(error);
  ret = getsockopt(socket_fd, SOL_SOCKET, SO_ERROR, &error, &len);
  if (ret == 0)
    return true;
  return false;
}


x86 assembly (clang, -O0):
<isSocketUp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x4,-0x14(%rbp)
mov    -0x8(%rbp),%edi
mov    0x2eb5(%rip),%rax
mov    (%rax),%esi
mov    0x2e9c(%rip),%rax
mov    (%rax),%edx
lea    -0x10(%rbp),%rcx
lea    -0x14(%rbp),%r8
call   1030 <getsockopt@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    1164 <isSocketUp+0x54>
movl   $0x1,-0x4(%rbp)
jmp    116b <isSocketUp+0x5b>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isSocketUp>:
push   %rax
movl   $0x0,0x4(%rsp)
movl   $0x4,(%rsp)
mov    0x2ec1(%rip),%rax
mov    (%rax),%esi
mov    0x2ea8(%rip),%rax
mov    (%rax),%edx
lea    0x4(%rsp),%rcx
mov    %rsp,%r8
call   1030 <getsockopt@plt>
xor    %ecx,%ecx
test   %eax,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@SOL_SOCKET = global i32 0
@SO_ERROR = global i32 0
define i32 @isSocketUp(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %3
store i32 0, i32* %5
store i32 4, i32* %6
%7 = load i32, i32* %3
%8 = load i32, i32* @SOL_SOCKET
%9 = load i32, i32* @SO_ERROR
%10 = call i32 @getsockopt(i32 %7, i32 %8, i32 %9, i32* %5, i32* %6)
store i32 %10, i32* %4
%11 = load i32, i32* %4
%12 = icmp eq i32 %11, 0
br i1 %12, label %13, label %14
13: ; preds = %1
store i32 1, i32* %2
br label %15
14: ; preds = %1
store i32 0, i32* %2
br label %15
15: ; preds = %14, %13
%16 = load i32, i32* %2
ret i32 %16
}

LLVM IR (-O2):
@SOL_SOCKET = global i32 0
@SO_ERROR = global i32 0
define i32 @isSocketUp(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = bitcast i32* %2 to i8*
store i32 0, i32* %2
%5 = bitcast i32* %3 to i8*
store i32 4, i32* %3
%6 = load i32, i32* @SOL_SOCKET
%7 = load i32, i32* @SO_ERROR
%8 = call i32 @getsockopt(i32 %0, i32 %6, i32 %7, i32* %2, i32* %3)
%9 = icmp eq i32 %8, 0
%10 = zext i1 %9 to i32
ret i32 %10
}
int lib_mod_signal(struct mod *mod) {
  ;
  ;
  return 0;
}


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

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

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

LLVM IR (-O2):
%struct.mod = type opaque
define i32 @lib_mod_signal(%struct.mod* nocapture readnone %0) {
ret i32 0
}
/* Type definitions */
struct rabin_state {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct rabin_state *);
void rabin_free(struct rabin_state *state) { free(state); }


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

x86 assembly (clang, -O2):
<rabin_free>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
%struct.rabin_state = type { i32 }
define void @rabin_free(%struct.rabin_state* nocapture %0) {
%2 = tail call i32 @free(%struct.rabin_state* %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ eeprom_update_word(int /*<<< orphan*/ *, int /*<<< orphan*/);
void eeconfig_disable(void) {
  eeprom_update_word((uint16_t *)0, (uint16_t)0xFFFF);
}


x86 assembly (clang, -O0):
<eeconfig_disable>:
push   %rbp
mov    %rsp,%rbp
xor    %eax,%eax
mov    %eax,%edi
mov    $0xffff,%esi
call   1030 <eeprom_update_word@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<eeconfig_disable>:
xor    %edi,%edi
mov    $0xffff,%esi
jmp    1030 <eeprom_update_word@plt>

LLVM IR (-O0):
define void @eeconfig_disable() {
%1 = call i32 @eeprom_update_word(i32* null, i32 65535)
ret void
}

LLVM IR (-O2):
define void @eeconfig_disable() {
%1 = tail call i32 @eeprom_update_word(i32* null, i32 65535)
ret void
}
/* Variables and functions */
char *trim_left(char *str) {
  if (!str)
    return NULL;
  if (*str == ' ') {
    return trim_left(str + 1);
  } else {
    return str;
  }
}


x86 assembly (clang, -O0):
<trim_left>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1134 <trim_left+0x24>
movq   $0x0,-0x8(%rbp)
jmp    1162 <trim_left+0x52>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x20,%eax
jne    115a <trim_left+0x4a>
mov    -0x10(%rbp),%rdi
add    $0x1,%rdi
call   1030 <trim_left@plt>
mov    %rax,-0x8(%rbp)
jmp    1162 <trim_left+0x52>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<trim_left>:
test   %rdi,%rdi
je     111e <trim_left+0x1e>
add    $0xffffffffffffffff,%rdi
nopl   0x0(%rax)
lea    0x1(%rdi),%rax
cmpb   $0x20,0x1(%rdi)
mov    %rax,%rdi
je     1110 <trim_left+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i8* @trim_left(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %8, label %3
3: ; preds = %1, %3
%4 = phi i8* [ %7, %3 ], [ %0, %1 ]
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 32
%7 = getelementptr inbounds i8, i8* %4, i64 1
br i1 %6, label %3, label %8
8: ; preds = %3, %1
%9 = phi i8* [ null, %1 ], [ %4, %3 ]
ret i8* %9
}
void INI_Scalar_TYPE() { ; }


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

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

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

LLVM IR (-O2):
define void @INI_Scalar_TYPE() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ft_putstr(char const *);
int /*<<< orphan*/ write(int, char *, int);
void ft_putendl(char const *s) {
  if (s != NULL) {
    ft_putstr(s);
    write(1, "\n", 1);
  }
}


x86 assembly (clang, -O0):
<ft_putendl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1153 <ft_putendl+0x33>
mov    -0x8(%rbp),%rdi
call   1040 <ft_putstr@plt>
mov    $0x1,%edx
lea    0xeb4(%rip),%rsi
mov    %edx,%edi
call   1030 <write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_putendl>:
test   %rdi,%rdi
je     1142 <ft_putendl+0x22>
push   %rax
call   1040 <ft_putstr@plt>
lea    0xece(%rip),%rsi
mov    $0x1,%edi
mov    $0x1,%edx
pop    %rax
jmp    1030 <write@plt>
ret

LLVM IR (-O0):
@.str = [2 x i8] c"\0A\00"
define void @ft_putendl(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp ne i8* %3, null
br i1 %4, label %5, label %9
5: ; preds = %1
%6 = load i8*, i8** %2
%7 = call i32 @ft_putstr(i8* %6)
%8 = call i32 @write(i32 1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 1)
br label %9
9: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c"\0A\00"
define void @ft_putendl(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %6, label %3
3: ; preds = %1
%4 = tail call i32 @ft_putstr(i8* %0)
%5 = tail call i32 @write(i32 1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 1)
br label %6
6: ; preds = %3, %1
ret void
}
void plugin_init() {}


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

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

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

LLVM IR (-O2):
define void @plugin_init() {
ret void
}
/* Variables and functions */
char *strdup(char *);
char *bipro_strdup(char *str) { return (strdup(str)); }


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

x86 assembly (clang, -O2):
<bipro_strdup>:
jmp    1030 <strdup@plt>

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

LLVM IR (-O2):
define noalias i8* @bipro_strdup(i8* nocapture %0) {
%2 = tail call i8* @strdup(i8* %0)
ret i8* %2
}
/* Variables and functions */
scalar_t__ isupper(int);
int tolower(int c) { return (isupper(c)) ? c | 0x20 : c; }


x86 assembly (clang, -O0):
<tolower>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <isupper@plt>
cmp    $0x0,%rax
je     113b <tolower+0x2b>
mov    -0x4(%rbp),%eax
or     $0x20,%eax
mov    %eax,-0x8(%rbp)
jmp    1141 <tolower+0x31>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tolower>:
push   %rbx
mov    %edi,%ebx
call   1030 <isupper@plt>
mov    %ebx,%ecx
or     $0x20,%ecx
test   %rax,%rax
cmove  %ebx,%ecx
mov    %ecx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @tolower(i32 %0) {
%2 = tail call i64 @isupper(i32 %0)
%3 = icmp eq i64 %2, 0
%4 = or i32 %0, 32
%5 = select i1 %3, i32 %0, i32 %4
ret i32 %5
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t determ_negate_float(uint32_t a) { return a ^ 0x80000000; }


x86 assembly (clang, -O0):
<determ_negate_float>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
xor    $0x80000000,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<determ_negate_float>:
mov    %edi,%eax
xor    $0x80000000,%eax
ret

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

LLVM IR (-O2):
define i32 @determ_negate_float(i32 %0) {
%2 = xor i32 %0, -2147483648
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
int /*<<< orphan*/ memset(void *, int /*<<< orphan*/, int);
void aes_encrypt_deinit(void *ctx) {
  memset(ctx, 0, (4 * 4 * 15 + 4));
  free(ctx);
}


x86 assembly (clang, -O0):
<aes_encrypt_deinit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
xor    %esi,%esi
mov    $0xf4,%edx
call   1040 <memset@plt>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<aes_encrypt_deinit>:
push   %rbx
mov    %rdi,%rbx
xor    %esi,%esi
mov    $0xf4,%edx
call   1040 <memset@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @aes_encrypt_deinit(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @memset(i8* %3, i32 0, i32 244)
%5 = load i8*, i8** %2
%6 = call i32 @free(i8* %5)
ret void
}

LLVM IR (-O2):
define void @aes_encrypt_deinit(i8* %0) {
%2 = tail call i32 @memset(i8* %0, i32 0, i32 244)
%3 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ test_buffer();
int main(int n, char **args) { test_buffer(); }


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

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

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = call i32 (...) @test_buffer()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @test_buffer()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ peek(char *);
int main(int argc, char **argv) { peek(argv[1]); }


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

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

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = load i8**, i8*** %4
%6 = getelementptr inbounds i8*, i8** %5, i64 1
%7 = load i8*, i8** %6
%8 = call i32 @peek(i8* %7)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = load i8*, i8** %3
%5 = tail call i32 @peek(i8* %4)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ NumberIO_IntToStr(int, unsigned int, char *, int);
int /*<<< orphan*/ StrIO_WriteString(char *, int);
void NumberIO_WriteInt(int x, unsigned int n) {
  typedef struct _T6_a _T6;
  struct _T6_a {
    char array[79 + 1];
  };
  _T6 a;
  NumberIO_IntToStr(x, n, (char *)&a.array[0], 79);
  StrIO_WriteString((char *)&a.array[0], 79);
}


x86 assembly (clang, -O0):
<NumberIO_WriteInt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
lea    -0x58(%rbp),%rdx
mov    $0x4f,%ecx
call   1040 <NumberIO_IntToStr@plt>
lea    -0x58(%rbp),%rdi
mov    $0x4f,%esi
call   1030 <StrIO_WriteString@plt>
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<NumberIO_WriteInt>:
push   %rbx
sub    $0x50,%rsp
mov    %rsp,%rbx
mov    %rbx,%rdx
mov    $0x4f,%ecx
call   1040 <NumberIO_IntToStr@plt>
mov    %rbx,%rdi
mov    $0x4f,%esi
call   1030 <StrIO_WriteString@plt>
add    $0x50,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct._T6_a = type { [80 x i8] }
define void @NumberIO_WriteInt(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca %struct._T6_a
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = load i32, i32* %4
%8 = getelementptr inbounds %struct._T6_a, %struct._T6_a* %5, i32 0, i32 0
%9 = getelementptr inbounds [80 x i8], [80 x i8]* %8, i64 0, i64 0
%10 = call i32 @NumberIO_IntToStr(i32 %6, i32 %7, i8* %9, i32 79)
%11 = getelementptr inbounds %struct._T6_a, %struct._T6_a* %5, i32 0, i32 0
%12 = getelementptr inbounds [80 x i8], [80 x i8]* %11, i64 0, i64 0
%13 = call i32 @StrIO_WriteString(i8* %12, i32 79)
ret void
}

LLVM IR (-O2):
%struct._T6_a = type { [80 x i8] }
define void @NumberIO_WriteInt(i32 %0, i32 %1) {
%3 = alloca %struct._T6_a
%4 = getelementptr inbounds %struct._T6_a, %struct._T6_a* %3, i64 0, i32 0, i64 0
%5 = call i32 @NumberIO_IntToStr(i32 %0, i32 %1, i8* %4, i32 79)
%6 = call i32 @StrIO_WriteString(i8* %4, i32 79)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, int);
void print_message_number(char header[], int number) {
  printf("%s%d\n", header, number);
  return;
}


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

x86 assembly (clang, -O2):
<print_message_number>:
mov    %esi,%edx
mov    %rdi,%rsi
lea    0xee4(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [6 x i8] c"%s%d\0A\00"
define void @print_message_number(i8* %0, i32 %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ write(int, char *, int);
int main() {
  write(1, "Hello World", 11);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x1,%edi
lea    0xed5(%rip),%rsi
mov    $0xb,%edx
call   1030 <write@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rsi
mov    $0x1,%edi
mov    $0xb,%edx
call   1030 <write@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [12 x i8] c"Hello World\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @write(i32 1, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 11)
ret i32 0
}

LLVM IR (-O2):
@.str = [12 x i8] c"Hello World\00"
define i32 @main() {
%1 = tail call i32 @write(i32 1, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 11)
ret i32 0
}
void tv8532_shutdown(struct usb_spca50x *spca50x) {}


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

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

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

LLVM IR (-O2):
%struct.usb_spca50x = type opaque
define void @tv8532_shutdown(%struct.usb_spca50x* nocapture %0) {
ret void
}
/* Variables and functions */
scalar_t__ config_WITH_CARDREADER();
int config_CARDREADER_DB2COM(void) { return config_WITH_CARDREADER() ? 1 : 0; }


x86 assembly (clang, -O0):
<config_CARDREADER_DB2COM>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <config_WITH_CARDREADER@plt>
mov    %rax,%rdx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<config_CARDREADER_DB2COM>:
push   %rax
xor    %eax,%eax
call   1030 <config_WITH_CARDREADER@plt>
xor    %ecx,%ecx
test   %rax,%rax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @config_CARDREADER_DB2COM() {
%1 = call i64 (...) @config_WITH_CARDREADER()
%2 = icmp ne i64 %1, 0
%3 = zext i1 %2 to i64
%4 = select i1 %2, i32 1, i32 0
ret i32 %4
}

LLVM IR (-O2):
define i32 @config_CARDREADER_DB2COM() {
%1 = tail call i64 (...) @config_WITH_CARDREADER()
%2 = icmp ne i64 %1, 0
%3 = zext i1 %2 to i32
ret i32 %3
}
int match_integer(const void *key1, const void *key2) {
  int int_key1 = *(int *)key1;
  int int_key2 = *(int *)key2;
  return int_key1 == int_key2;
}


x86 assembly (clang, -O0):
<match_integer>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x18(%rbp),%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<match_integer>:
mov    (%rdi),%ecx
xor    %eax,%eax
cmp    (%rsi),%ecx
sete   %al
ret

LLVM IR (-O0):
define i32 @match_integer(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = bitcast i8* %7 to i32*
%9 = load i32, i32* %8
store i32 %9, i32* %5
%10 = load i8*, i8** %4
%11 = bitcast i8* %10 to i32*
%12 = load i32, i32* %11
store i32 %12, i32* %6
%13 = load i32, i32* %5
%14 = load i32, i32* %6
%15 = icmp eq i32 %13, %14
%16 = zext i1 %15 to i32
ret i32 %16
}

LLVM IR (-O2):
define i32 @match_integer(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = icmp eq i32 %4, %6
%8 = zext i1 %7 to i32
ret i32 %8
}
int uart1_getc() { return 0; }


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

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

LLVM IR (-O0):
define i32 @uart1_getc() {
ret i32 0
}

LLVM IR (-O2):
define i32 @uart1_getc() {
ret i32 0
}
void testFunction() {}


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

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

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

LLVM IR (-O2):
define void @testFunction() {
ret void
}
/* Type definitions */
struct SensorModul {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ initAcpiBattery(struct SensorModul *);
int /*<<< orphan*/ initAcpiFan(struct SensorModul *);
int /*<<< orphan*/ initAcpiThermal(struct SensorModul *);
void initAcpi(struct SensorModul *sm) {
  initAcpiBattery(sm);
  initAcpiFan(sm);
  initAcpiThermal(sm);
}


x86 assembly (clang, -O0):
<initAcpi>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <initAcpiBattery@plt>
mov    -0x8(%rbp),%rdi
call   1050 <initAcpiFan@plt>
mov    -0x8(%rbp),%rdi
call   1040 <initAcpiThermal@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<initAcpi>:
push   %rbx
mov    %rdi,%rbx
call   1030 <initAcpiBattery@plt>
mov    %rbx,%rdi
call   1050 <initAcpiFan@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <initAcpiThermal@plt>

LLVM IR (-O0):
%struct.SensorModul = type { i32 }
define void @initAcpi(%struct.SensorModul* %0) {
%2 = alloca %struct.SensorModul*
store %struct.SensorModul* %0, %struct.SensorModul** %2
%3 = load %struct.SensorModul*, %struct.SensorModul** %2
%4 = call i32 @initAcpiBattery(%struct.SensorModul* %3)
%5 = load %struct.SensorModul*, %struct.SensorModul** %2
%6 = call i32 @initAcpiFan(%struct.SensorModul* %5)
%7 = load %struct.SensorModul*, %struct.SensorModul** %2
%8 = call i32 @initAcpiThermal(%struct.SensorModul* %7)
ret void
}

LLVM IR (-O2):
%struct.SensorModul = type { i32 }
define void @initAcpi(%struct.SensorModul* %0) {
%2 = tail call i32 @initAcpiBattery(%struct.SensorModul* %0)
%3 = tail call i32 @initAcpiFan(%struct.SensorModul* %0)
%4 = tail call i32 @initAcpiThermal(%struct.SensorModul* %0)
ret void
}
/* Variables and functions */
int *dynCastOrNull(int /*<<< orphan*/);
void testDynCastOrNullOfNull() {
  int *casted = dynCastOrNull(0);
  *casted = 1;
}


x86 assembly (clang, -O0):
<testDynCastOrNullOfNull>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xor    %edi,%edi
call   1030 <dynCastOrNull@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movl   $0x1,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<testDynCastOrNullOfNull>:
push   %rax
xor    %edi,%edi
call   1030 <dynCastOrNull@plt>
movl   $0x1,(%rax)
pop    %rax
ret

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

LLVM IR (-O2):
define void @testDynCastOrNullOfNull() {
%1 = tail call i32* @dynCastOrNull(i32 0)
store i32 1, i32* %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ test_glesv2();
int /*<<< orphan*/ test_opengl();
int main(void) {
  test_opengl();
  test_glesv2();
  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_opengl@plt>
mov    $0x0,%al
call   1040 <test_glesv2@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <test_opengl@plt>
xor    %eax,%eax
call   1040 <test_glesv2@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_opengl()
%3 = call i32 (...) @test_glesv2()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @test_opengl()
%2 = tail call i32 (...) @test_glesv2()
ret i32 0
}
/* Variables and functions */
int b_search(int, int /*<<< orphan*/, int);
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char **argv) {
  int idx = -1;
  idx = b_search(10, 0, 7);
  printf("%d\n", idx);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0xffffffff,-0x14(%rbp)
mov    $0xa,%edi
xor    %esi,%esi
mov    $0x7,%edx
call   1040 <b_search@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%esi
lea    0xea5(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0xa,%edi
xor    %esi,%esi
mov    $0x7,%edx
call   1040 <b_search@plt>
lea    0xec7(%rip),%rdi
mov    %eax,%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(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 -1, i32* %6
%7 = call i32 @b_search(i32 10, i32 0, i32 7)
store i32 %7, i32* %6
%8 = load i32, i32* %6
%9 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %8)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @b_search(i32 10, i32 0, i32 7)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 0
}
int count_digits(int number) {
  int result = 0;
  while (number != 0) {
    number /= 10;
    result++;
  }
  return ({
    typeof(1) _a = (1);
    typeof(result) _b = (result);
    (_a > _b) ? _a : _b;
  });
}


x86 assembly (clang, -O0):
<count_digits>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1134 <count_digits+0x34>
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    110e <count_digits+0xe>
movl   $0x1,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jle    1158 <count_digits+0x58>
mov    -0xc(%rbp),%eax
mov    %eax,-0x18(%rbp)
jmp    115e <count_digits+0x5e>
mov    -0x10(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<count_digits>:
test   %edi,%edi
je     1133 <count_digits+0x33>
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
movslq %edi,%rcx
imul   $0x66666667,%rcx,%rdi
mov    %rdi,%rdx
shr    $0x3f,%rdx
sar    $0x22,%rdi
add    %edx,%edi
add    $0x1,%eax
add    $0x9,%ecx
cmp    $0x12,%ecx
ja     1110 <count_digits+0x10>
ret
mov    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @count_digits(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
br label %7
7: ; preds = %10, %1
%8 = load i32, i32* %2
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %15
10: ; preds = %7
%11 = load i32, i32* %2
%12 = sdiv i32 %11, 10
store i32 %12, i32* %2
%13 = load i32, i32* %3
%14 = add nsw i32 %13, 1
store i32 %14, i32* %3
br label %7
15: ; preds = %7
store i32 1, i32* %4
%16 = load i32, i32* %3
store i32 %16, i32* %5
%17 = load i32, i32* %4
%18 = load i32, i32* %5
%19 = icmp sgt i32 %17, %18
br i1 %19, label %20, label %22
20: ; preds = %15
%21 = load i32, i32* %4
br label %24
22: ; preds = %15
%23 = load i32, i32* %5
br label %24
24: ; preds = %22, %20
%25 = phi i32 [ %21, %20 ], [ %23, %22 ]
store i32 %25, i32* %6
%26 = load i32, i32* %6
ret i32 %26
}

LLVM IR (-O2):
define i32 @count_digits(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %10, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %6, %3 ], [ %0, %1 ]
%5 = phi i32 [ %7, %3 ], [ 0, %1 ]
%6 = sdiv i32 %4, 10
%7 = add nuw nsw i32 %5, 1
%8 = add i32 %4, 9
%9 = icmp ult i32 %8, 19
br i1 %9, label %10, label %3
10: ; preds = %3, %1
%11 = phi i32 [ 1, %1 ], [ %7, %3 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ bar(int);
__attribute__((always_)) void foo(void) { bar(4); }


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    $0x4,%edi
call   1030 <bar@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
mov    $0x4,%edi
jmp    1030 <bar@plt>

LLVM IR (-O0):
define void @foo() {
%1 = call i32 @bar(i32 4)
ret void
}

LLVM IR (-O2):
define void @foo() {
%1 = tail call i32 @bar(i32 4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
int main(void) {
  puts("Hello world!\n");
  while (1)
    ;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
call   1030 <puts@plt>
jmp    112b <main+0x1b>

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
nopl   (%rax)
jmp    1120 <main+0x10>

LLVM IR (-O0):
@.str = [14 x i8] c"Hello world!\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @puts(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %3
3: ; preds = %0, %3
br label %3
}

LLVM IR (-O2):
@.str = [14 x i8] c"Hello world!\0A\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %2
2: ; preds = %0, %2
br label %2
}
/* Type definitions */
struct timespec {
  long long tv_sec;
  long long tv_nsec;
};

/* Variables and functions */
int /*<<< orphan*/ CLOCK_REALTIME;
scalar_t__ clock_gettime(int /*<<< orphan*/, struct timespec *);
long long nanoseconds(void) {
  struct timespec t;
  if (clock_gettime(CLOCK_REALTIME, &t) != 0)
    return -1;
  return t.tv_sec * 1000000000LL + t.tv_nsec;
}


x86 assembly (clang, -O0):
<nanoseconds>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    0x2ec1(%rip),%rax
mov    (%rax),%edi
lea    -0x18(%rbp),%rsi
call   1030 <clock_gettime@plt>
cmp    $0x0,%rax
je     1141 <nanoseconds+0x31>
movq   $0xffffffffffffffff,-0x8(%rbp)
ff
jmp    1151 <nanoseconds+0x41>
imul   $0x3b9aca00,-0x18(%rbp),%rax
3b
add    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nanoseconds>:
sub    $0x18,%rsp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0x8(%rsp),%rsi
call   1030 <clock_gettime@plt>
imul   $0x3b9aca00,0x8(%rsp),%rcx
9a 3b
add    0x10(%rsp),%rcx
neg    %rax
sbb    %rax,%rax
or     %rcx,%rax
add    $0x18,%rsp
ret

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

LLVM IR (-O2):
%struct.timespec = type { i64, i64 }
@CLOCK_REALTIME = global i32 0
define i64 @nanoseconds() {
%1 = alloca %struct.timespec
%2 = bitcast %struct.timespec* %1 to i8*
%3 = load i32, i32* @CLOCK_REALTIME
%4 = call i64 @clock_gettime(i32 %3, %struct.timespec* %1)
%5 = icmp eq i64 %4, 0
%6 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 0
%7 = load i64, i64* %6
%8 = mul nsw i64 %7, 1000000000
%9 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 1
%10 = load i64, i64* %9
%11 = add nsw i64 %8, %10
%12 = select i1 %5, i64 %11, i64 -1
ret i64 %12
}
/* Variables and functions */
int /*<<< orphan*/ initscr();
int /*<<< orphan*/ noecho();
int /*<<< orphan*/ raw();
int /*<<< orphan*/ start_color();
void init_scr() {
  initscr();
  start_color();
  noecho();
  raw();
}


x86 assembly (clang, -O0):
<init_scr>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <initscr@plt>
mov    $0x0,%al
call   1050 <start_color@plt>
mov    $0x0,%al
call   1060 <noecho@plt>
mov    $0x0,%al
call   1040 <raw@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_scr>:
push   %rax
xor    %eax,%eax
call   1030 <initscr@plt>
xor    %eax,%eax
call   1050 <start_color@plt>
xor    %eax,%eax
call   1060 <noecho@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <raw@plt>

LLVM IR (-O0):
define void @init_scr() {
%1 = call i32 (...) @initscr()
%2 = call i32 (...) @start_color()
%3 = call i32 (...) @noecho()
%4 = call i32 (...) @raw()
ret void
}

LLVM IR (-O2):
define void @init_scr() {
%1 = tail call i32 (...) @initscr()
%2 = tail call i32 (...) @start_color()
%3 = tail call i32 (...) @noecho()
%4 = tail call i32 (...) @raw()
ret void
}
/* Type definitions */
struct vmbuf {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ memcpy(int /*<<< orphan*/, void const *, size_t);
int /*<<< orphan*/ vmbuf_resize_if_less(struct vmbuf *, size_t);
int /*<<< orphan*/ vmbuf_wloc(struct vmbuf *);
int vmbuf_wseek(struct vmbuf *, size_t);
int vmbuf_memcpy(struct vmbuf *vmbuf, const void *src, size_t n) {
  vmbuf_resize_if_less(vmbuf, n);
  memcpy(vmbuf_wloc(vmbuf), src, n);
  return vmbuf_wseek(vmbuf, n);
}


x86 assembly (clang, -O0):
<vmbuf_memcpy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <vmbuf_resize_if_less@plt>
mov    -0x8(%rbp),%rdi
call   1040 <vmbuf_wloc@plt>
mov    %eax,%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1050 <memcpy@plt>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1060 <vmbuf_wseek@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vmbuf_memcpy>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r15
mov    %rsi,%r14
mov    %rdi,%rbx
mov    %rdx,%rsi
call   1030 <vmbuf_resize_if_less@plt>
mov    %rbx,%rdi
call   1040 <vmbuf_wloc@plt>
mov    %eax,%edi
mov    %r14,%rsi
mov    %r15,%rdx
call   1050 <memcpy@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
pop    %rbx
pop    %r14
pop    %r15
jmp    1060 <vmbuf_wseek@plt>

LLVM IR (-O0):
%struct.vmbuf = type { i32 }
define i32 @vmbuf_memcpy(%struct.vmbuf* %0, i8* %1, i64 %2) {
%4 = alloca %struct.vmbuf*
%5 = alloca i8*
%6 = alloca i64
store %struct.vmbuf* %0, %struct.vmbuf** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%7 = load %struct.vmbuf*, %struct.vmbuf** %4
%8 = load i64, i64* %6
%9 = call i32 @vmbuf_resize_if_less(%struct.vmbuf* %7, i64 %8)
%10 = load %struct.vmbuf*, %struct.vmbuf** %4
%11 = call i32 @vmbuf_wloc(%struct.vmbuf* %10)
%12 = load i8*, i8** %5
%13 = load i64, i64* %6
%14 = call i32 @memcpy(i32 %11, i8* %12, i64 %13)
%15 = load %struct.vmbuf*, %struct.vmbuf** %4
%16 = load i64, i64* %6
%17 = call i32 @vmbuf_wseek(%struct.vmbuf* %15, i64 %16)
ret i32 %17
}

LLVM IR (-O2):
%struct.vmbuf = type { i32 }
define i32 @vmbuf_memcpy(%struct.vmbuf* %0, i8* %1, i64 %2) {
%4 = tail call i32 @vmbuf_resize_if_less(%struct.vmbuf* %0, i64 %2)
%5 = tail call i32 @vmbuf_wloc(%struct.vmbuf* %0)
%6 = tail call i32 @memcpy(i32 %5, i8* %1, i64 %2)
%7 = tail call i32 @vmbuf_wseek(%struct.vmbuf* %0, i64 %2)
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ NV_Graph_initStaticNodes();
void NV_insertInitialNode() { NV_Graph_initStaticNodes(); }


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

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

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

LLVM IR (-O2):
define void @NV_insertInitialNode() {
%1 = tail call i32 (...) @NV_Graph_initStaticNodes()
ret void
}
int gcd(int x, int y) {
  if (y == 0)
    return x;
  else
    gcd(y, x % y);
}


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

x86 assembly (clang, -O2):
<gcd>:
test   %esi,%esi
je     111b <gcd+0x1b>
mov    %esi,%edx
mov    %edi,%eax
nopl   0x0(%rax,%rax,1)
mov    %edx,%ecx
cltd
idiv   %ecx
mov    %ecx,%eax
test   %edx,%edx
jne    1110 <gcd+0x10>
mov    %edi,%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* %5
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i32, i32* %4
store i32 %9, i32* %3
br label %16
10: ; preds = %2
%11 = load i32, i32* %5
%12 = load i32, i32* %4
%13 = load i32, i32* %5
%14 = srem i32 %12, %13
%15 = call i32 @gcd(i32 %11, i32 %14)
br label %16
16: ; preds = %8, %10
%17 = load i32, i32* %3
ret i32 %17
}

LLVM IR (-O2):
define i32 @gcd(i32 returned %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %9, label %4
4: ; preds = %2, %4
%5 = phi i32 [ %7, %4 ], [ %1, %2 ]
%6 = phi i32 [ %5, %4 ], [ %0, %2 ]
%7 = srem i32 %6, %5
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %4
9: ; preds = %4, %2
ret i32 %0
}
/* Variables and functions */
int /*<<< orphan*/ GameDirRelativePath(char *, char *);
void trans_ent_filename(char *filename) {
  GameDirRelativePath("save/trans.ent", filename);
}


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

x86 assembly (clang, -O2):
<trans_ent_filename>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <GameDirRelativePath@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"save/trans.ent\00"
define void @trans_ent_filename(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @GameDirRelativePath(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"save/trans.ent\00"
define void @trans_ent_filename(i8* %0) {
%2 = tail call i32 @GameDirRelativePath(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void show_help() {
  printf("mkrom - Writes individual files into a ROM image\n"
         "\n"
         "Usage: mkrom OUTPUT LENGTH FILE:ADDRESS...\n"
         "See `man 1 mkrom` for details.\n"
         "\n"
         "LENGTH is the target size of the output file OUTPUT\n"
         "FILE:ADDRESS pairs specify input files and their\n"
         "respective offset in the output file.\n"
         "\n"
         "Examples:\n"
         "\tCreate a 16KiB ROM image from two input files\n"
         "\t\tmkrom example.rom 0x4000 temp1.bin:0x0 temp2.bin:0x200\n");
}


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

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

LLVM IR (-O0):
@.str = [380 x i8] c"mkrom - Writes individual files into a ROM image\0A\0AUsage: mkrom OUTPUT LENGTH FILE:ADDRESS...\0ASee `man 1 mkrom` for details.\0A\0ALENGTH is the target size of the output file OUTPUT\0AFILE:ADDRESS pairs specify input files and their\0Arespective offset in the output file.\0A\0AExamples:\0A\09Create a 16KiB ROM image from two input files\0A\09\09mkrom example.rom 0x4000 temp1.bin:0x0 temp2.bin:0x200\0A\00"
define void @show_help() {
%1 = call i32 @printf(i8* getelementptr inbounds ([380 x i8], [380 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [379 x i8] c"mkrom - Writes individual files into a ROM image\0A\0AUsage: mkrom OUTPUT LENGTH FILE:ADDRESS...\0ASee `man 1 mkrom` for details.\0A\0ALENGTH is the target size of the output file OUTPUT\0AFILE:ADDRESS pairs specify input files and their\0Arespective offset in the output file.\0A\0AExamples:\0A\09Create a 16KiB ROM image from two input files\0A\09\09mkrom example.rom 0x4000 temp1.bin:0x0 temp2.bin:0x200\00"
define void @show_help() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([379 x i8], [379 x i8]* @str, i64 0, i64 0))
ret void
}
int sched_component_take() {}


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

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

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

LLVM IR (-O2):
define i32 @sched_component_take() {
ret i32 undef
}
int dev_remove_bb_dev(const char *name) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @dev_remove_bb_dev(i8* nocapture readnone %0) {
ret i32 0
}
void ptrace_sandbox_permit_ftruncate(struct pt_sandbox *p_sandbox) {
  (void)p_sandbox;
}


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

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

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

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