xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int main() {
  int counter = 0;
  for (counter = 0; counter <= 255; counter++) {
    printf("%d --> %c\n", counter, counter);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0xff,-0x8(%rbp)
jg     115a <main+0x4a>
mov    -0x8(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xeb9(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    112d <main+0x1d>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
xor    %ebx,%ebx
lea    0xee3(%rip),%r14
nopl   (%rax)
mov    %r14,%rdi
mov    %ebx,%esi
mov    %ebx,%edx
call   1030 <printf@plt>
add    $0x1,%ebx
cmp    $0x100,%ebx
jne    1120 <main+0x10>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [11 x i8] c"%d --> %c\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
store i32 0, i32* %2
br label %3
3: ; preds = %10, %0
%4 = load i32, i32* %2
%5 = icmp sle i32 %4, 255
br i1 %5, label %6, label %13
6: ; preds = %3
%7 = load i32, i32* %2
%8 = load i32, i32* %2
%9 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %7, i32 %8)
br label %10
10: ; preds = %6
%11 = load i32, i32* %2
%12 = add nsw i32 %11, 1
store i32 %12, i32* %2
br label %3
13: ; preds = %3
ret i32 0
}

LLVM IR (-O2):
@.str = [11 x i8] c"%d --> %c\0A\00"
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 0, %0 ], [ %4, %1 ]
%3 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %2, i32 %2)
%4 = add nuw nsw i32 %2, 1
%5 = icmp eq i32 %4, 256
br i1 %5, label %6, label %1
6: ; preds = %1
ret i32 0
}
/* Type definitions */
typedef unsigned long uint32_t;

/* Variables and functions */
void SHAMD5HashLengthSet(uint32_t ui32Base, uint32_t ui32Length) {
  ;
  (*((volatile unsigned long *)(ui32Base + 0x00000048))) = ui32Length;
}


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

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

LLVM IR (-O0):
define void @SHAMD5HashLengthSet(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = load i64, i64* %3
%7 = add i64 %6, 72
%8 = inttoptr i64 %7 to i64*
store volatile i64 %5, i64* %8
ret void
}

LLVM IR (-O2):
define void @SHAMD5HashLengthSet(i64 %0, i64 %1) {
%3 = add i64 %0, 72
%4 = inttoptr i64 %3 to i64*
store volatile i64 %1, i64* %4
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ngSpice_Command(char *);
void alterp(int sig) { ngSpice_Command("bg_halt"); }


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

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

LLVM IR (-O0):
@.str = [8 x i8] c"bg_halt\00"
define void @alterp(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @ngSpice_Command(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"bg_halt\00"
define void @alterp(i32 %0) {
%2 = tail call i32 @ngSpice_Command(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ RC4_INT;

/* Variables and functions */
const char *RC4_options(void) {
  if (sizeof(RC4_INT) == 1)
    return ("rc4(ptr,char)");
  else
    return ("rc4(ptr,int)");
}


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

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

LLVM IR (-O0):
@.str = [13 x i8] c"rc4(ptr,int)\00"
define i8* @RC4_options() {
ret i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [13 x i8] c"rc4(ptr,int)\00"
define i8* @RC4_options() {
ret i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0)
}
void g_string_printf() {}


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

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

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

LLVM IR (-O2):
define void @g_string_printf() {
ret void
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
int /*<<< orphan*/ mp2vstart_init(int *, int);
void mp2vseqx_init(uint8_t *p_mp2vseq) {
  mp2vstart_init(p_mp2vseq, 0xb5);
  p_mp2vseq[4] = (1 << 4) & 0xf0;
  p_mp2vseq[5] = 0;
  p_mp2vseq[7] = 0x1;
  p_mp2vseq[9] = 0;
}


x86 assembly (clang, -O0):
<mp2vseqx_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0xb5,%esi
call   1030 <mp2vstart_init@plt>
mov    -0x8(%rbp),%rax
movl   $0x10,0x10(%rax)
mov    -0x8(%rbp),%rax
movl   $0x0,0x14(%rax)
mov    -0x8(%rbp),%rax
movl   $0x1,0x1c(%rax)
mov    -0x8(%rbp),%rax
movl   $0x0,0x24(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mp2vseqx_init>:
push   %rbx
mov    %rdi,%rbx
mov    $0xb5,%esi
call   1030 <mp2vstart_init@plt>
movq   $0x10,0x10(%rbx)
movl   $0x1,0x1c(%rbx)
movl   $0x0,0x24(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @mp2vseqx_init(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @mp2vstart_init(i32* %3, i32 181)
%5 = load i32*, i32** %2
%6 = getelementptr inbounds i32, i32* %5, i64 4
store i32 16, i32* %6
%7 = load i32*, i32** %2
%8 = getelementptr inbounds i32, i32* %7, i64 5
store i32 0, i32* %8
%9 = load i32*, i32** %2
%10 = getelementptr inbounds i32, i32* %9, i64 7
store i32 1, i32* %10
%11 = load i32*, i32** %2
%12 = getelementptr inbounds i32, i32* %11, i64 9
store i32 0, i32* %12
ret void
}

LLVM IR (-O2):
define void @mp2vseqx_init(i32* %0) {
%2 = tail call i32 @mp2vstart_init(i32* %0, i32 181)
%3 = getelementptr inbounds i32, i32* %0, i64 4
store i32 16, i32* %3
%4 = getelementptr inbounds i32, i32* %0, i64 5
store i32 0, i32* %4
%5 = getelementptr inbounds i32, i32* %0, i64 7
store i32 1, i32* %5
%6 = getelementptr inbounds i32, i32* %0, i64 9
store i32 0, i32* %6
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fputc(char, int /*<<< orphan*/ *);
void int_put(int number, FILE *stream) {
  if (number > (int)9) {
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
    int_put(number / (int)10, stream);
#pragma GCC diagnostic pop
  }
  fputc('0' + (char)(number % (int)10), stream);
}


x86 assembly (clang, -O0):
<int_put>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x9,-0x4(%rbp)
jle    114f <int_put+0x2f>
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,%edi
mov    -0x10(%rbp),%rsi
call   1040 <int_put@plt>
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %dl,%al
movsbl %al,%eax
add    $0x30,%eax
mov    -0x10(%rbp),%rsi
movsbl %al,%edi
call   1030 <fputc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<int_put>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
cmp    $0xa,%edi
jl     1144 <int_put+0x24>
mov    %ebp,%eax
mov    $0xcccccccd,%edi
imul   %rax,%rdi
shr    $0x23,%rdi
mov    %rbx,%rsi
call   1040 <int_put@plt>
movslq %ebp,%rax
imul   $0x66666667,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
shr    $0x22,%rax
add    %ecx,%eax
add    %eax,%eax
lea    (%rax,%rax,4),%eax
sub    %eax,%ebp
add    $0x30,%bpl
movsbl %bpl,%edi
mov    %rbx,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <fputc@plt>

LLVM IR (-O0):
define void @int_put(i32 %0, i32* %1) {
%3 = alloca i32
%4 = alloca i32*
store i32 %0, i32* %3
store i32* %1, i32** %4
%5 = load i32, i32* %3
%6 = icmp sgt i32 %5, 9
br i1 %6, label %7, label %11
7: ; preds = %2
%8 = load i32, i32* %3
%9 = sdiv i32 %8, 10
%10 = load i32*, i32** %4
br label %11
11: ; preds = %7, %2
%12 = load i32, i32* %3
%13 = srem i32 %12, 10
%14 = trunc i32 %13 to i8
%15 = sext i8 %14 to i32
%16 = add nsw i32 48, %15
%17 = trunc i32 %16 to i8
%18 = load i32*, i32** %4
%19 = call i32 @fputc(i8 signext %17, i32* %18)
ret void
}

LLVM IR (-O2):
define void @int_put(i32 %0, i32* nocapture %1) {
%3 = icmp sgt i32 %0, 9
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = udiv i32 %0, 10
tail call void @int_put(i32 %5, i32* %1)
br label %6
6: ; preds = %4, %2
%7 = srem i32 %0, 10
%8 = trunc i32 %7 to i8
%9 = add nsw i8 %8, 48
%10 = tail call i32 @fputc(i8 signext %9, i32* %1)
ret void
}
/* Variables and functions */
scalar_t__ malloc(int);
int return_malloc_deref_bad() {
  int *p = (int *)malloc(sizeof(int));
  if (p) {
    *p = 42;
    return *p;
  }
  return 10;
}


x86 assembly (clang, -O0):
<return_malloc_deref_bad>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x4,%edi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1149 <return_malloc_deref_bad+0x39>
mov    -0x10(%rbp),%rax
movl   $0x2a,(%rax)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1150 <return_malloc_deref_bad+0x40>
movl   $0xa,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<return_malloc_deref_bad>:
push   %rax
mov    $0x4,%edi
call   1030 <malloc@plt>
test   %rax,%rax
je     112d <return_malloc_deref_bad+0x1d>
movl   $0x2a,(%rax)
mov    $0x2a,%eax
pop    %rcx
ret
mov    $0xa,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @return_malloc_deref_bad() {
%1 = tail call i64 @malloc(i32 4)
%2 = icmp eq i64 %1, 0
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = inttoptr i64 %1 to i32*
store i32 42, i32* %4
br label %5
5: ; preds = %0, %3
%6 = phi i32 [ 42, %3 ], [ 10, %0 ]
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ pres_terminate_req(int);
void CC_BLF_unsudirribe(int request_id) { pres_terminate_req(request_id); }


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

x86 assembly (clang, -O2):
<CC_BLF_unsudirribe>:
jmp    1030 <pres_terminate_req@plt>

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

LLVM IR (-O2):
define void @CC_BLF_unsudirribe(i32 %0) {
%2 = tail call i32 @pres_terminate_req(i32 %0)
ret void
}
long maxOf(long a, long b) { return (a < b) ? b : a; }


x86 assembly (clang, -O0):
<maxOf>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
jge    1127 <maxOf+0x27>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    112f <maxOf+0x2f>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<maxOf>:
mov    %rdi,%rax
cmp    %rsi,%rdi
cmovl  %rsi,%rax
ret

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

LLVM IR (-O2):
define i64 @maxOf(i64 %0, i64 %1) {
%3 = icmp slt i64 %0, %1
%4 = select i1 %3, i64 %1, i64 %0
ret i64 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ puts(char *);
void view_arr(int *arr, size_t el_count) {
  for (size_t i = 0; i < el_count; i++)
    printf("%d ", arr[i]);
  puts("");
}


x86 assembly (clang, -O0):
<view_arr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x10(%rbp),%rax
jae    116e <view_arr+0x4e>
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xea8(%rip),%rdi
call   1040 <printf@plt>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1138 <view_arr+0x18>
lea    0xe8e(%rip),%rdi
call   1030 <puts@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<view_arr>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %rsi,%rsi
je     1155 <view_arr+0x35>
mov    %rsi,%r12
mov    %rdi,%r14
xor    %ebx,%ebx
lea    0xec4(%rip),%r15
nopl   0x0(%rax)
mov    (%r14,%rbx,4),%esi
mov    %r15,%rdi
call   1040 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1140 <view_arr+0x20>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%d \00"
@.str.1 = [1 x i8] zeroinitializer
define void @view_arr(i32* %0, i64 %1) {
%3 = alloca i32*
%4 = alloca i64
%5 = alloca i64
store i32* %0, i32** %3
store i64 %1, i64* %4
store i64 0, i64* %5
br label %6
6: ; preds = %16, %2
%7 = load i64, i64* %5
%8 = load i64, i64* %4
%9 = icmp ult i64 %7, %8
br i1 %9, label %10, label %19
10: ; preds = %6
%11 = load i32*, i32** %3
%12 = load i64, i64* %5
%13 = getelementptr inbounds i32, i32* %11, i64 %12
%14 = load i32, i32* %13
%15 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %14)
br label %16
16: ; preds = %10
%17 = load i64, i64* %5
%18 = add i64 %17, 1
store i64 %18, i64* %5
br label %6
19: ; preds = %6
%20 = call i32 @puts(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d \00"
define void @view_arr(i32* nocapture %0, i64 %1) {
%3 = icmp eq i64 %1, 0
br i1 %3, label %4, label %6
4: ; preds = %6, %2
%5 = tail call i32 @putchar(i32 10)
ret void
6: ; preds = %2, %6
%7 = phi i64 [ %11, %6 ], [ 0, %2 ]
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = load i32, i32* %8
%10 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = add nuw i64 %7, 1
%12 = icmp eq i64 %11, %1
br i1 %12, label %4, label %6
}
/* Variables and functions */
int /*<<< orphan*/ rl_beg_of_line();
int /*<<< orphan*/ rl_insert_text(char *);
int /*<<< orphan*/ rl_newline(int, char);
int /*<<< orphan*/ rl_redisplay();
rl_vi_comment() {
  rl_beg_of_line();
  rl_insert_text(": ");
  rl_redisplay();
  rl_newline(1, '\010');
}


x86 assembly (clang, -O0):
<rl_vi_comment>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1060 <rl_beg_of_line@plt>
lea    0xeaa(%rip),%rdi
call   1030 <rl_insert_text@plt>
mov    $0x0,%al
call   1050 <rl_redisplay@plt>
mov    $0x1,%edi
mov    $0x8,%esi
call   1040 <rl_newline@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rl_vi_comment>:
push   %rax
xor    %eax,%eax
call   1060 <rl_beg_of_line@plt>
lea    0xeb1(%rip),%rdi
call   1030 <rl_insert_text@plt>
xor    %eax,%eax
call   1050 <rl_redisplay@plt>
mov    $0x1,%edi
mov    $0x8,%esi
pop    %rax
jmp    1040 <rl_newline@plt>

LLVM IR (-O0):
@.str = [3 x i8] c": \00"
define i32 @rl_vi_comment() {
%1 = alloca i32
%2 = call i32 (...) @rl_beg_of_line()
%3 = call i32 @rl_insert_text(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%4 = call i32 (...) @rl_redisplay()
%5 = call i32 @rl_newline(i32 1, i8 signext 8)
%6 = load i32, i32* %1
ret i32 %6
}

LLVM IR (-O2):
@.str = [3 x i8] c": \00"
define i32 @rl_vi_comment() {
%1 = tail call i32 (...) @rl_beg_of_line()
%2 = tail call i32 @rl_insert_text(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (...) @rl_redisplay()
%4 = tail call i32 @rl_newline(i32 1, i8 signext 8)
ret i32 undef
}
/* Variables and functions */
scalar_t__ browser_load(char const *);
int /*<<< orphan*/ errno;
int /*<<< orphan*/ error_msg(char *, char const *, int /*<<< orphan*/);
int /*<<< orphan*/ strerror(int /*<<< orphan*/);
void browser_cd_playlist(const char *filename) {
  if (browser_load(filename))
    error_msg("could not read playlist '%s': %s\n", filename, strerror(errno));
}


x86 assembly (clang, -O0):
<browser_cd_playlist>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <browser_load@plt>
cmp    $0x0,%rax
je     1177 <browser_cd_playlist+0x47>
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    0x2e82(%rip),%rax
mov    (%rax),%edi
call   1050 <strerror@plt>
mov    -0x10(%rbp),%rsi
mov    %eax,%edx
lea    0xe8e(%rip),%rdi
call   1030 <error_msg@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<browser_cd_playlist>:
push   %rbx
mov    %rdi,%rbx
call   1040 <browser_load@plt>
test   %rax,%rax
je     115e <browser_cd_playlist+0x2e>
mov    0x2e9b(%rip),%rax
mov    (%rax),%edi
call   1050 <strerror@plt>
lea    0xead(%rip),%rdi
mov    %rbx,%rsi
mov    %eax,%edx
pop    %rbx
jmp    1030 <error_msg@plt>
pop    %rbx
ret

LLVM IR (-O0):
@.str = [34 x i8] c"could not read playlist '%s': %s\0A\00"
@errno = global i32 0
define void @browser_cd_playlist(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i64 @browser_load(i8* %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %11
6: ; preds = %1
%7 = load i8*, i8** %2
%8 = load i32, i32* @errno
%9 = call i32 @strerror(i32 %8)
%10 = call i32 @error_msg(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i8* %7, i32 %9)
br label %11
11: ; preds = %6, %1
ret void
}

LLVM IR (-O2):
@.str = [34 x i8] c"could not read playlist '%s': %s\0A\00"
@errno = global i32 0
define void @browser_cd_playlist(i8* %0) {
%2 = tail call i64 @browser_load(i8* %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %8, label %4
4: ; preds = %1
%5 = load i32, i32* @errno
%6 = tail call i32 @strerror(i32 %5)
%7 = tail call i32 @error_msg(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %6)
br label %8
8: ; preds = %4, %1
ret void
}
int BLNK_CheckPtrBigSpace(void *ptr) {
  long long l;
  return (0);
}


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

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

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

LLVM IR (-O2):
define i32 @BLNK_CheckPtrBigSpace(i8* nocapture readnone %0) {
ret i32 0
}
__attribute__((always_)) unsigned short bswap_16(unsigned short x) {
  return (x >> 8) | (x << 8);
}


x86 assembly (clang, -O0):
<bswap_16>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%eax
sar    $0x8,%eax
movzwl -0x2(%rbp),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
movzwl %ax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bswap_16>:
mov    %edi,%eax
rol    $0x8,%ax
ret

LLVM IR (-O0):
define zeroext i16 @bswap_16(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = zext i16 %3 to i32
%5 = ashr i32 %4, 8
%6 = load i16, i16* %2
%7 = zext i16 %6 to i32
%8 = shl i32 %7, 8
%9 = or i32 %5, %8
%10 = trunc i32 %9 to i16
ret i16 %10
}

LLVM IR (-O2):
define zeroext i16 @bswap_16(i16 zeroext %0) {
%2 = tail call i16 @llvm.bswap.i16(i16 %0)
ret i16 %2
}
int is_navmsg(int msg) {
  return msg == 1019 || msg == 1020 || msg == 1044 || msg == 1045 ||
         msg == 1046;
}


x86 assembly (clang, -O0):
<is_navmsg>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0x1,%al
cmpl   $0x3fb,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     115c <is_navmsg+0x5c>
mov    $0x1,%al
cmpl   $0x3fc,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     115c <is_navmsg+0x5c>
mov    $0x1,%al
cmpl   $0x414,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     115c <is_navmsg+0x5c>
mov    $0x1,%al
cmpl   $0x415,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     115c <is_navmsg+0x5c>
cmpl   $0x416,-0x4(%rbp)
sete   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_navmsg>:
lea    -0x3fb(%rdi),%ecx
cmp    $0x1a,%ecx
ja     111b <is_navmsg+0x1b>
mov    $0x1,%eax
mov    $0x6000003,%edx
bt     %ecx,%edx
jae    111b <is_navmsg+0x1b>
ret
xor    %eax,%eax
cmp    $0x416,%edi
sete   %al
ret

LLVM IR (-O0):
define i32 @is_navmsg(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 1019
br i1 %4, label %17, label %5
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp eq i32 %6, 1020
br i1 %7, label %17, label %8
8: ; preds = %5
%9 = load i32, i32* %2
%10 = icmp eq i32 %9, 1044
br i1 %10, label %17, label %11
11: ; preds = %8
%12 = load i32, i32* %2
%13 = icmp eq i32 %12, 1045
br i1 %13, label %17, label %14
14: ; preds = %11
%15 = load i32, i32* %2
%16 = icmp eq i32 %15, 1046
br label %17
17: ; preds = %14, %11, %8, %5, %1
%18 = phi i1 [ true, %11 ], [ true, %8 ], [ true, %5 ], [ true, %1 ], [ %16, %14 ]
%19 = zext i1 %18 to i32
ret i32 %19
}

LLVM IR (-O2):
define i32 @is_navmsg(i32 %0) {
switch i32 %0, label %2 [
i32 1045, label %5
i32 1044, label %5
i32 1020, label %5
i32 1019, label %5
]
2: ; preds = %1
%3 = icmp eq i32 %0, 1046
%4 = zext i1 %3 to i32
br label %5
5: ; preds = %1, %1, %1, %1, %2
%6 = phi i32 [ 1, %1 ], [ %4, %2 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ]
ret i32 %6
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ assert(int);
uint8_t sancus_u8l(long v) {
  assert((v >= 0) && (v <= 0xff));
  return (uint8_t)v;
}


x86 assembly (clang, -O0):
<sancus_u8l>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
xor    %eax,%eax
cmpq   $0x0,-0x8(%rbp)
mov    %al,-0x9(%rbp)
jl     113a <sancus_u8l+0x2a>
cmpq   $0xff,-0x8(%rbp)
setle  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sancus_u8l>:
push   %rbx
mov    %rdi,%rbx
xor    %edi,%edi
cmp    $0x100,%rbx
setb   %dil
call   1030 <assert@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @sancus_u8l(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = icmp sge i64 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i64, i64* %2
%7 = icmp sle i64 %6, 255
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ false, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i32
%11 = call i32 @assert(i32 %10)
%12 = load i64, i64* %2
%13 = trunc i64 %12 to i32
ret i32 %13
}

LLVM IR (-O2):
define i32 @sancus_u8l(i64 %0) {
%2 = icmp ult i64 %0, 256
%3 = zext i1 %2 to i32
%4 = tail call i32 @assert(i32 %3)
%5 = trunc i64 %0 to i32
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
int /*<<< orphan*/ SIGTERM;
int /*<<< orphan*/ kill(int /*<<< orphan*/, int /*<<< orphan*/);
void hupchild(pid_t child) { kill(child, SIGTERM); }


x86 assembly (clang, -O0):
<hupchild>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2ec3(%rip),%rax
mov    (%rax),%esi
call   1030 <kill@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hupchild>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%esi
jmp    1030 <kill@plt>

LLVM IR (-O0):
@SIGTERM = global i32 0
define void @hupchild(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* @SIGTERM
%5 = call i32 @kill(i32 %3, i32 %4)
ret void
}

LLVM IR (-O2):
@SIGTERM = global i32 0
define void @hupchild(i32 %0) {
%2 = load i32, i32* @SIGTERM
%3 = tail call i32 @kill(i32 %0, i32 %2)
ret void
}
int HelpItem7(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @HelpItem7() {
ret i32 0
}
void hash_table_print() {}


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

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

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

LLVM IR (-O2):
define void @hash_table_print() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void btree_free(void *p) {
  if (p != NULL) {
    free(p);
  }
}


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

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

LLVM IR (-O0):
define void @btree_free(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp ne i8* %3, null
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i8*, i8** %2
%7 = call i32 @free(i8* %6)
br label %8
8: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
define void @btree_free(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @free(i8* %0)
br label %5
5: ; preds = %3, %1
ret void
}
/* Variables and functions */
bool nrf52_errata_217(void) { return false; }


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

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

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

LLVM IR (-O2):
define i32 @nrf52_errata_217() {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
scalar_t__ open_i2c_dev(int *, char *, int);
int /*<<< orphan*/ piups_printstats(int);
int /*<<< orphan*/ printf(char *);
int main(void) {
  int file_i2c;
  char *filename = (char *)"/dev/i2c-1";
  uint16_t vcc;
  uint16_t vbat;
  if (open_i2c_dev(&file_i2c, filename, 0x13) != 0) {
    printf("Failed to setup i2c");
    return -1;
  }
  piups_printstats(file_i2c);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
lea    -0x8(%rbp),%rdi
mov    $0x13,%edx
call   1050 <open_i2c_dev@plt>
cmp    $0x0,%rax
je     117e <main+0x4e>
lea    0xe9e(%rip),%rdi
call   1030 <printf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1186 <main+0x56>
mov    -0x8(%rbp),%edi
call   1040 <piups_printstats@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rsi
lea    0x4(%rsp),%rdi
mov    $0x13,%edx
call   1050 <open_i2c_dev@plt>
test   %rax,%rax
je     115f <main+0x2f>
lea    0xeb8(%rip),%rdi
call   1030 <printf@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret
mov    0x4(%rsp),%edi
call   1040 <piups_printstats@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [11 x i8] c"/dev/i2c-1\00"
@.str.1 = [20 x i8] c"Failed to setup i2c\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %1
store i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8** %3
%6 = load i8*, i8** %3
%7 = call i64 @open_i2c_dev(i32* %2, i8* %6, i32 19)
%8 = icmp ne i64 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %0
%10 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0))
store i32 -1, i32* %1
br label %14
11: ; preds = %0
%12 = load i32, i32* %2
%13 = call i32 @piups_printstats(i32 %12)
br label %14
14: ; preds = %11, %9
%15 = load i32, i32* %1
ret i32 %15
}

LLVM IR (-O2):
@.str = [11 x i8] c"/dev/i2c-1\00"
@.str.1 = [20 x i8] c"Failed to setup i2c\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i64 @open_i2c_dev(i32* %1, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 19)
%4 = icmp eq i64 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %0
%6 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0))
br label %10
7: ; preds = %0
%8 = load i32, i32* %1
%9 = call i32 @piups_printstats(i32 %8)
br label %10
10: ; preds = %7, %5
%11 = phi i32 [ -1, %5 ], [ 0, %7 ]
ret i32 %11
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int __sgetc(int /*<<< orphan*/ *);
int /*<<< orphan*/ flockfile(int /*<<< orphan*/ *);
int /*<<< orphan*/ funlockfile(int /*<<< orphan*/ *);
int __getc(FILE *_p) {
  int ret;
  flockfile(_p);
  ret = __sgetc(_p);
  funlockfile(_p);
  return (ret);
}


x86 assembly (clang, -O0):
<__getc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <flockfile@plt>
mov    -0x8(%rbp),%rdi
call   1050 <__sgetc@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <funlockfile@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__getc>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1040 <flockfile@plt>
mov    %rbx,%rdi
call   1050 <__sgetc@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1030 <funlockfile@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @__getc(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = call i32 @flockfile(i32* %4)
%6 = load i32*, i32** %2
%7 = call i32 @__sgetc(i32* %6)
store i32 %7, i32* %3
%8 = load i32*, i32** %2
%9 = call i32 @funlockfile(i32* %8)
%10 = load i32, i32* %3
ret i32 %10
}

LLVM IR (-O2):
define i32 @__getc(i32* %0) {
%2 = tail call i32 @flockfile(i32* %0)
%3 = tail call i32 @__sgetc(i32* %0)
%4 = tail call i32 @funlockfile(i32* %0)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
int memstream_close(void *cookie) {
  free(cookie);
  return (0);
}


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

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

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

LLVM IR (-O2):
define i32 @memstream_close(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret i32 0
}
/* Variables and functions */
char *pipe2string(char *);
int /*<<< orphan*/ strcpy(char *, char *);
char *appaserver_library_get_whoami(void) {
  char sys_string[64];
  strcpy(sys_string, "whoami");
  return pipe2string(sys_string);
}


x86 assembly (clang, -O0):
<appaserver_library_get_whoami>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
lea    -0x40(%rbp),%rdi
lea    0xecd(%rip),%rsi
call   1030 <strcpy@plt>
lea    -0x40(%rbp),%rdi
call   1040 <pipe2string@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<appaserver_library_get_whoami>:
push   %rbx
sub    $0x40,%rsp
lea    0xed4(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1030 <strcpy@plt>
mov    %rbx,%rdi
call   1040 <pipe2string@plt>
add    $0x40,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [7 x i8] c"whoami\00"
define i8* @appaserver_library_get_whoami() {
%1 = alloca [64 x i8]
%2 = getelementptr inbounds [64 x i8], [64 x i8]* %1, i64 0, i64 0
%3 = call i32 @strcpy(i8* %2, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%4 = getelementptr inbounds [64 x i8], [64 x i8]* %1, i64 0, i64 0
%5 = call i8* @pipe2string(i8* %4)
ret i8* %5
}

LLVM IR (-O2):
@.str = [7 x i8] c"whoami\00"
define i8* @appaserver_library_get_whoami() {
%1 = alloca [64 x i8]
%2 = getelementptr inbounds [64 x i8], [64 x i8]* %1, i64 0, i64 0
%3 = call i32 @strcpy(i8* %2, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%4 = call i8* @pipe2string(i8* %2)
ret i8* %4
}
int adder(int a, int b) { return a + b; }


x86 assembly (clang, -O0):
<adder>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<adder>:
lea    (%rdi,%rsi,1),%eax
ret

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

LLVM IR (-O2):
define i32 @adder(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void if_eq(void) { printf("equal\n"); }


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

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

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

LLVM IR (-O2):
@str = [6 x i8] c"equal\00"
define void @if_eq() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int is_category_Lt(unsigned int);
bool is_property_titlecase(unsigned int ch) { return is_category_Lt(ch); }


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

x86 assembly (clang, -O2):
<is_property_titlecase>:
jmp    1030 <is_category_Lt@plt>

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

LLVM IR (-O2):
define i32 @is_property_titlecase(i32 %0) {
%2 = tail call i32 @is_category_Lt(i32 %0)
ret i32 %2
}
/* Variables and functions */
void *realloc(void *, int);
void grow_array_impl(void **array, int *capacity, int member_size) {
  int new_cap = *capacity;
  if (new_cap == 0) {
    new_cap = 8;
  } else {
    new_cap *= 2;
  }
  *array = realloc(*array, new_cap * member_size);
  *capacity = new_cap;
}


x86 assembly (clang, -O0):
<grow_array_impl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x18(%rbp)
cmpl   $0x0,-0x18(%rbp)
jne    1142 <grow_array_impl+0x32>
movl   $0x8,-0x18(%rbp)
jmp    114b <grow_array_impl+0x3b>
mov    -0x18(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
mov    -0x18(%rbp),%esi
imul   -0x14(%rbp),%esi
call   1030 <realloc@plt>
mov    %rax,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x18(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<grow_array_impl>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%rbx
mov    (%rsi),%eax
lea    (%rax,%rax,1),%ecx
test   %eax,%eax
mov    $0x8,%ebp
cmovne %ecx,%ebp
mov    (%rdi),%rdi
imul   %ebp,%edx
mov    %edx,%esi
call   1030 <realloc@plt>
mov    %rax,(%rbx)
mov    %ebp,(%r14)
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define void @grow_array_impl(i8** nocapture %0, i32* nocapture %1, i32 %2) {
%4 = load i32, i32* %1
%5 = icmp eq i32 %4, 0
%6 = shl nsw i32 %4, 1
%7 = select i1 %5, i32 8, i32 %6
%8 = load i8*, i8** %0
%9 = mul nsw i32 %7, %2
%10 = tail call i8* @realloc(i8* %8, i32 %9)
store i8* %10, i8** %0
store i32 %7, i32* %1
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_mutexattr_t;
typedef int /*<<< orphan*/ pthread_mutex_t;

/* Variables and functions */
int /*<<< orphan*/ PTHREAD_MUTEX_RECURSIVE;
int /*<<< orphan*/ pthread_mutex_init(int /*<<< orphan*/ *,
                                      int /*<<< orphan*/ *);
int /*<<< orphan*/ pthread_mutexattr_destroy(int /*<<< orphan*/ *);
int /*<<< orphan*/ pthread_mutexattr_init(int /*<<< orphan*/ *);
int /*<<< orphan*/ pthread_mutexattr_settype(int /*<<< orphan*/ *,
                                             int /*<<< orphan*/);
void GSPThreadInitRecursiveMutex(pthread_mutex_t *x) {
  pthread_mutexattr_t recursiveAttributes;
  pthread_mutexattr_init(&recursiveAttributes);
  pthread_mutexattr_settype(&recursiveAttributes, PTHREAD_MUTEX_RECURSIVE);
  pthread_mutex_init(x, &recursiveAttributes);
  pthread_mutexattr_destroy(&recursiveAttributes);
}


x86 assembly (clang, -O0):
<GSPThreadInitRecursiveMutex>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0xc(%rbp),%rdi
call   1040 <pthread_mutexattr_init@plt>
mov    0x2e9c(%rip),%rax
mov    (%rax),%esi
lea    -0xc(%rbp),%rdi
call   1030 <pthread_mutexattr_settype@plt>
mov    -0x8(%rbp),%rdi
lea    -0xc(%rbp),%rsi
call   1050 <pthread_mutex_init@plt>
lea    -0xc(%rbp),%rdi
call   1060 <pthread_mutexattr_destroy@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GSPThreadInitRecursiveMutex>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
lea    0x4(%rsp),%rbx
mov    %rbx,%rdi
call   1040 <pthread_mutexattr_init@plt>
mov    0x2e9d(%rip),%rax
mov    (%rax),%esi
mov    %rbx,%rdi
call   1030 <pthread_mutexattr_settype@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1050 <pthread_mutex_init@plt>
mov    %rbx,%rdi
call   1060 <pthread_mutexattr_destroy@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@PTHREAD_MUTEX_RECURSIVE = global i32 0
define void @GSPThreadInitRecursiveMutex(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
%4 = call i32 @pthread_mutexattr_init(i32* %3)
%5 = load i32, i32* @PTHREAD_MUTEX_RECURSIVE
%6 = call i32 @pthread_mutexattr_settype(i32* %3, i32 %5)
%7 = load i32*, i32** %2
%8 = call i32 @pthread_mutex_init(i32* %7, i32* %3)
%9 = call i32 @pthread_mutexattr_destroy(i32* %3)
ret void
}

LLVM IR (-O2):
@PTHREAD_MUTEX_RECURSIVE = global i32 0
define void @GSPThreadInitRecursiveMutex(i32* %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = call i32 @pthread_mutexattr_init(i32* %2)
%5 = load i32, i32* @PTHREAD_MUTEX_RECURSIVE
%6 = call i32 @pthread_mutexattr_settype(i32* %2, i32 %5)
%7 = call i32 @pthread_mutex_init(i32* %0, i32* %2)
%8 = call i32 @pthread_mutexattr_destroy(i32* %2)
ret void
}
void server_accept(int accept_sockfd, int epfd) {}


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

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

LLVM IR (-O0):
define void @server_accept(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
ret void
}

LLVM IR (-O2):
define void @server_accept(i32 %0, i32 %1) {
ret void
}
/* Variables and functions */
int strlen(char const *);
int validate_description(const char *description) {
  if (description == NULL) {
    return -1;
  }
  if (strlen(description) > 250) {
    return -1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<validate_description>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1133 <validate_description+0x23>
movl   $0xffffffff,-0x4(%rbp)
jmp    115a <validate_description+0x4a>
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
cmp    $0xfa,%eax
jle    1153 <validate_description+0x43>
movl   $0xffffffff,-0x4(%rbp)
jmp    115a <validate_description+0x4a>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<validate_description>:
test   %rdi,%rdi
je     112f <validate_description+0x1f>
push   %rax
call   1030 <strlen@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0xfb,%ecx
setge  %al
neg    %eax
add    $0x8,%rsp
ret
mov    $0xffffffff,%eax
ret

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

LLVM IR (-O2):
define i32 @validate_description(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %7, label %3
3: ; preds = %1
%4 = tail call i32 @strlen(i8* %0)
%5 = icmp sgt i32 %4, 250
%6 = sext i1 %5 to i32
br label %7
7: ; preds = %3, %1
%8 = phi i32 [ -1, %1 ], [ %6, %3 ]
ret i32 %8
}
/* Type definitions */
struct stat {
  int /*<<< orphan*/ st_mode;
};

/* Variables and functions */
int S_ISDIR(int /*<<< orphan*/);
scalar_t__ stat(char const *, struct stat *);
int is_directory(const char *fname) {
  struct stat tmp;
  if (stat(fname, &tmp) < 0) {
    return 0;
  }
  return S_ISDIR(tmp.st_mode);
}


x86 assembly (clang, -O0):
<is_directory>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1040 <stat@plt>
cmp    $0x0,%rax
jge    114f <is_directory+0x2f>
movl   $0x0,-0x4(%rbp)
jmp    115a <is_directory+0x3a>
mov    -0x18(%rbp),%edi
call   1030 <S_ISDIR@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_directory>:
push   %rax
mov    %rsp,%rsi
call   1040 <stat@plt>
test   %rax,%rax
js     1138 <is_directory+0x18>
mov    (%rsp),%edi
call   1030 <S_ISDIR@plt>
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @is_directory(i8* %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i64 @stat(i8* %0, %struct.stat* %2)
%5 = icmp slt i64 %4, 0
br i1 %5, label %10, label %6
6: ; preds = %1
%7 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%8 = load i32, i32* %7
%9 = call i32 @S_ISDIR(i32 %8)
br label %10
10: ; preds = %1, %6
%11 = phi i32 [ %9, %6 ], [ 0, %1 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void hand(int s) { printf("sigpipe\n"); }


x86 assembly (clang, -O0):
<hand>:
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):
<hand>:
lea    0xee9(%rip),%rdi
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"sigpipe\0A\00"
define void @hand(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = 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"sigpipe\00"
define void @hand(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
struct macan_key {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ macan_aes_unwrap(struct macan_key const *, size_t,
                                    int /*<<< orphan*/ *, int /*<<< orphan*/ *,
                                    int /*<<< orphan*/ *);
void macan_unwrap_key(const struct macan_key *key, size_t srclen, uint8_t *dst,
                      uint8_t *src) {
  macan_aes_unwrap(key, srclen, dst, src, src);
}


x86 assembly (clang, -O0):
<macan_unwrap_key>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x20(%rbp),%r8
call   1030 <macan_aes_unwrap@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<macan_unwrap_key>:
mov    %rcx,%r8
jmp    1030 <macan_aes_unwrap@plt>

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

LLVM IR (-O2):
%struct.macan_key = type { i32 }
define void @macan_unwrap_key(%struct.macan_key* %0, i64 %1, i32* %2, i32* %3) {
%5 = tail call i32 @macan_aes_unwrap(%struct.macan_key* %0, i64 %1, i32* %2, i32* %3, i32* %3)
ret void
}