xunge/DecIR huggingface dataset:
unsigned char value_to_b64(int v) {
  static unsigned char table[] =
      "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
  if (v >= (int)sizeof(table) || v < 0)
    return -1;
  return table[v];
}


x86 assembly (clang, -O0):
<value_to_b64>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x41,-0x8(%rbp)
jge    111b <value_to_b64+0x1b>
cmpl   $0x0,-0x8(%rbp)
jge    1124 <value_to_b64+0x24>
movb   $0xff,-0x1(%rbp)
jmp    1135 <value_to_b64+0x35>
movslq -0x8(%rbp),%rcx
lea    0x2f01(%rip),%rax
mov    (%rax,%rcx,1),%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<value_to_b64>:
mov    $0xff,%al
cmp    $0x40,%edi
ja     1113 <value_to_b64+0x13>
mov    %edi,%eax
lea    0xef0(%rip),%rcx
mov    (%rax,%rcx,1),%al
ret

LLVM IR (-O0):
@value_to_b64.table = internal global [65 x i8] c"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/\00"
define zeroext i8 @value_to_b64(i32 %0) {
%2 = alloca i8
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp sge i32 %4, 65
br i1 %5, label %9, label %6
6: ; preds = %1
%7 = load i32, i32* %3
%8 = icmp slt i32 %7, 0
br i1 %8, label %9, label %10
9: ; preds = %6, %1
store i8 -1, i8* %2
br label %15
10: ; preds = %6
%11 = load i32, i32* %3
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds [65 x i8], [65 x i8]* @value_to_b64.table, i64 0, i64 %12
%14 = load i8, i8* %13
store i8 %14, i8* %2
br label %15
15: ; preds = %10, %9
%16 = load i8, i8* %2
ret i8 %16
}

LLVM IR (-O2):
@value_to_b64.table = internal unnamed_addr constant [65 x i8] c"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/\00"
define zeroext i8 @value_to_b64(i32 %0) {
%2 = icmp ugt i32 %0, 64
br i1 %2, label %7, label %3
3: ; preds = %1
%4 = zext i32 %0 to i64
%5 = getelementptr inbounds [65 x i8], [65 x i8]* @value_to_b64.table, i64 0, i64 %4
%6 = load i8, i8* %5
br label %7
7: ; preds = %1, %3
%8 = phi i8 [ %6, %3 ], [ -1, %1 ]
ret i8 %8
}
void tpop() { asm volatile("addq $0x8, %%r11\n\t" :::); }


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

x86 assembly (clang, -O2):
<tpop>:
add    $0x8,%r11
ret

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

LLVM IR (-O2):
define void @tpop() {
tail call void asm sideeffect "addq $$0x8, %r11\0A\09", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
void send2cpu() {}


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

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

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

LLVM IR (-O2):
define void @send2cpu() {
ret void
}
void gtk_file_chooser_dialog_new_with_backend() {}


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

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

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

LLVM IR (-O2):
define void @gtk_file_chooser_dialog_new_with_backend() {
ret void
}
int GetAutoRunState(void) {
  unsigned char bPort;
  int fAutoRunState;
  bPort = (*(volatile unsigned char *)(void *)(0x80000000 + 0x000A22));
  if ((bPort & 0x08)) {
    fAutoRunState = 0;
  } else {
    fAutoRunState = 1;
  }
  return (fAutoRunState);
}


x86 assembly (clang, -O0):
<GetAutoRunState>:
push   %rbp
mov    %rsp,%rbp
mov    $0x80000a22,%eax
mov    (%rax),%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
and    $0x8,%eax
cmp    $0x0,%eax
je     112a <GetAutoRunState+0x2a>
movl   $0x0,-0x8(%rbp)
jmp    1131 <GetAutoRunState+0x31>
movl   $0x1,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<GetAutoRunState>:
mov    $0x80000a22,%eax
movzbl (%rax),%ecx
xor    %eax,%eax
test   $0x8,%cl
sete   %al
ret

LLVM IR (-O0):
define i32 @GetAutoRunState() {
%1 = alloca i8
%2 = alloca i32
%3 = load volatile i8, i8* inttoptr (i64 2147486242 to i8*)
store i8 %3, i8* %1
%4 = load i8, i8* %1
%5 = zext i8 %4 to i32
%6 = and i32 %5, 8
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %0
store i32 0, i32* %2
br label %10
9: ; preds = %0
store i32 1, i32* %2
br label %10
10: ; preds = %9, %8
%11 = load i32, i32* %2
ret i32 %11
}

LLVM IR (-O2):
define i32 @GetAutoRunState() {
%1 = load volatile i8, i8* inttoptr (i64 2147486242 to i8*)
%2 = lshr i8 %1, 3
%3 = and i8 %2, 1
%4 = xor i8 %3, 1
%5 = zext i8 %4 to i32
ret i32 %5
}
int test_imm_73uint16_mem(unsigned short *val) {
  return ((*val) & (0x73 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_73uint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, 115
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ foo();
void main(void) { foo(); }


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

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

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

LLVM IR (-O2):
define void @main() {
%1 = tail call i32 (...) @foo()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ test1();
int /*<<< orphan*/ test2();
int /*<<< orphan*/ test3();
int /*<<< orphan*/ test4();
int /*<<< orphan*/ test5();
int /*<<< orphan*/ test6();
int main(void) {
  test1();
  test2();
  test3();
  test4();
  test5();
  test6();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1050 <test1@plt>
mov    $0x0,%al
call   1080 <test2@plt>
mov    $0x0,%al
call   1040 <test3@plt>
mov    $0x0,%al
call   1070 <test4@plt>
mov    $0x0,%al
call   1030 <test5@plt>
mov    $0x0,%al
call   1060 <test6@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1050 <test1@plt>
xor    %eax,%eax
call   1080 <test2@plt>
xor    %eax,%eax
call   1040 <test3@plt>
xor    %eax,%eax
call   1070 <test4@plt>
xor    %eax,%eax
call   1030 <test5@plt>
xor    %eax,%eax
call   1060 <test6@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @test1()
%3 = call i32 (...) @test2()
%4 = call i32 (...) @test3()
%5 = call i32 (...) @test4()
%6 = call i32 (...) @test5()
%7 = call i32 (...) @test6()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @test1()
%2 = tail call i32 (...) @test2()
%3 = tail call i32 (...) @test3()
%4 = tail call i32 (...) @test4()
%5 = tail call i32 (...) @test5()
%6 = tail call i32 (...) @test6()
ret i32 0
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
int fuzix_isascii(int c) { return !((uint8_t)c & 0x80); }


x86 assembly (clang, -O0):
<fuzix_isascii>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x80,%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fuzix_isascii>:
xor    %eax,%eax
test   $0x80,%dil
sete   %al
ret

LLVM IR (-O0):
define i32 @fuzix_isascii(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 128
%5 = icmp ne i32 %4, 0
%6 = xor i1 %5, true
%7 = zext i1 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @fuzix_isascii(i32 %0) {
%2 = lshr i32 %0, 7
%3 = and i32 %2, 1
%4 = xor i32 %3, 1
ret i32 %4
}
int refc_count(void *handle) {
  int *ptr = ((void *)(((int *)handle) - 1));
  return *ptr;
}


x86 assembly (clang, -O0):
<refc_count>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0xfffffffffffffffc,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<refc_count>:
mov    -0x4(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @refc_count(i8* %0) {
%2 = alloca i8*
%3 = alloca i32*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = bitcast i8* %4 to i32*
%6 = getelementptr inbounds i32, i32* %5, i64 -1
%7 = bitcast i32* %6 to i8*
%8 = bitcast i8* %7 to i32*
store i32* %8, i32** %3
%9 = load i32*, i32** %3
%10 = load i32, i32* %9
ret i32 %10
}

LLVM IR (-O2):
define i32 @refc_count(i8* nocapture %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 -4
%3 = bitcast i8* %2 to i32*
%4 = load i32, i32* %3
ret i32 %4
}
int test_22(unsigned char *x, int y, int z) { return (x[0] >> 2) ? y : z; }


x86 assembly (clang, -O0):
<test_22>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
sar    $0x2,%eax
cmp    $0x0,%eax
je     112c <test_22+0x2c>
mov    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
jmp    1132 <test_22+0x32>
mov    -0x10(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_22>:
mov    %esi,%eax
cmpb   $0x4,(%rdi)
cmovb  %edx,%eax
ret

LLVM IR (-O0):
define i32 @test_22(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i8*, i8** %4
%8 = getelementptr inbounds i8, i8* %7, i64 0
%9 = load i8, i8* %8
%10 = zext i8 %9 to i32
%11 = ashr i32 %10, 2
%12 = icmp ne i32 %11, 0
br i1 %12, label %13, label %15
13: ; preds = %3
%14 = load i32, i32* %5
br label %17
15: ; preds = %3
%16 = load i32, i32* %6
br label %17
17: ; preds = %15, %13
%18 = phi i32 [ %14, %13 ], [ %16, %15 ]
ret i32 %18
}

LLVM IR (-O2):
define i32 @test_22(i8* nocapture %0, i32 %1, i32 %2) {
%4 = load i8, i8* %0
%5 = icmp ult i8 %4, 4
%6 = select i1 %5, i32 %2, i32 %1
ret i32 %6
}
int l2(int a, int b, int c) { return b << c; }


x86 assembly (clang, -O0):
<l2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    -0xc(%rbp),%ecx
shl    %cl,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<l2>:
mov    %edx,%ecx
mov    %esi,%eax
shl    %cl,%eax
ret

LLVM IR (-O0):
define i32 @l2(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %5
%8 = load i32, i32* %6
%9 = shl i32 %7, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @l2(i32 %0, i32 %1, i32 %2) {
%4 = shl i32 %1, %2
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *);
void printHeader(FILE *fp) {
  fprintf(fp, "#ORIGINAL_SOURCE MULTISPLIT\n"
              "#CREATURE \n"
              "#REGION \n"
              "#FIELD/LAYER \n"
              "#TYPE \n"
              "#CONTRIBUTOR \n"
              "#REFERENCE \n"
              "#RAW \n"
              "#EXTRAS \n"
              "#SOMA_AREA\n"
              "#SHINKAGE_CORRECTION 1.000000 1.000000 1.000000\n"
              "#VERSION_NUMBER\n"
              "#VERSION_DATE 2012-04-22\n"
              "#SCALE 1.0 1.0 1.0\n"
              "\n");
}


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

x86 assembly (clang, -O2):
<printHeader>:
mov    %rdi,%rcx
lea    0xee6(%rip),%rdi
mov    $0xe6,%esi
mov    $0x1,%edx
jmp    1030 <fwrite@plt>

LLVM IR (-O0):
@.str = [231 x i8] c"#ORIGINAL_SOURCE MULTISPLIT\0A#CREATURE \0A#REGION \0A#FIELD/LAYER \0A#TYPE \0A#CONTRIBUTOR \0A#REFERENCE \0A#RAW \0A#EXTRAS \0A#SOMA_AREA\0A#SHINKAGE_CORRECTION 1.000000 1.000000 1.000000\0A#VERSION_NUMBER\0A#VERSION_DATE 2012-04-22\0A#SCALE 1.0 1.0 1.0\0A\0A\00"
define void @printHeader(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @fprintf(i32* %3, i8* getelementptr inbounds ([231 x i8], [231 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [231 x i8] c"#ORIGINAL_SOURCE MULTISPLIT\0A#CREATURE \0A#REGION \0A#FIELD/LAYER \0A#TYPE \0A#CONTRIBUTOR \0A#REFERENCE \0A#RAW \0A#EXTRAS \0A#SOMA_AREA\0A#SHINKAGE_CORRECTION 1.000000 1.000000 1.000000\0A#VERSION_NUMBER\0A#VERSION_DATE 2012-04-22\0A#SCALE 1.0 1.0 1.0\0A\0A\00"
define void @printHeader(i32* nocapture %0) {
%2 = tail call i64 @fwrite(i8* getelementptr inbounds ([231 x i8], [231 x i8]* @.str, i64 0, i64 0), i64 230, i64 1, i32* %0)
ret void
}
/* Variables and functions */
char *hoedown_hash_strndup(char const *, int /*<<< orphan*/);
int /*<<< orphan*/ strlen(char const *);
char *hoedown_hash_strdup(const char *str) {
  if (str) {
    return hoedown_hash_strndup(str, strlen(str));
  }
  return NULL;
}


x86 assembly (clang, -O0):
<hoedown_hash_strdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     115c <hoedown_hash_strdup+0x3c>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x18(%rbp),%rdi
mov    %eax,%esi
call   1040 <hoedown_hash_strndup@plt>
mov    %rax,-0x8(%rbp)
jmp    1164 <hoedown_hash_strdup+0x44>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hoedown_hash_strdup>:
test   %rdi,%rdi
je     1139 <hoedown_hash_strdup+0x19>
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
mov    %rbx,%rdi
mov    %eax,%esi
pop    %rbx
jmp    1040 <hoedown_hash_strndup@plt>
xor    %eax,%eax
ret

LLVM IR (-O0):
define i8* @hoedown_hash_strdup(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 %6, label %11
6: ; preds = %1
%7 = load i8*, i8** %3
%8 = load i8*, i8** %3
%9 = call i32 @strlen(i8* %8)
%10 = call i8* @hoedown_hash_strndup(i8* %7, i32 %9)
store i8* %10, i8** %2
br label %12
11: ; preds = %1
store i8* null, i8** %2
br label %12
12: ; preds = %11, %6
%13 = load i8*, i8** %2
ret i8* %13
}

LLVM IR (-O2):
define i8* @hoedown_hash_strdup(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %6, label %3
3: ; preds = %1
%4 = tail call i32 @strlen(i8* %0)
%5 = tail call i8* @hoedown_hash_strndup(i8* %0, i32 %4)
br label %6
6: ; preds = %1, %3
%7 = phi i8* [ %5, %3 ], [ null, %1 ]
ret i8* %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_hello() { printf("Hello World!\n"); }


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

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

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

LLVM IR (-O2):
@str = [13 x i8] c"Hello World!\00"
define void @print_hello() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
ret void
}
int solib_main(arg)
int arg;
{ return arg * arg * arg; }


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

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

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

LLVM IR (-O2):
define i32 @solib_main(i32 %0) {
%2 = mul nsw i32 %0, %0
%3 = mul nsw i32 %2, %0
ret i32 %3
}
int dwc3_debugfs_init(struct dwc3 *d) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.dwc3 = type opaque
define i32 @dwc3_debugfs_init(%struct.dwc3* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ PrintErrorCode();
int /*<<< orphan*/ dxl_write_byte(int, int, int);
void changeD(int Id, int dValue) {
  dxl_write_byte(Id, 26, dValue);
  PrintErrorCode();
}


x86 assembly (clang, -O0):
<changeD>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%edx
mov    $0x1a,%esi
call   1030 <dxl_write_byte@plt>
mov    $0x0,%al
call   1040 <PrintErrorCode@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<changeD>:
push   %rax
mov    %esi,%edx
mov    $0x1a,%esi
call   1030 <dxl_write_byte@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <PrintErrorCode@plt>

LLVM IR (-O0):
define void @changeD(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = call i32 @dxl_write_byte(i32 %5, i32 26, i32 %6)
%8 = call i32 (...) @PrintErrorCode()
ret void
}

LLVM IR (-O2):
define void @changeD(i32 %0, i32 %1) {
%3 = tail call i32 @dxl_write_byte(i32 %0, i32 26, i32 %1)
%4 = tail call i32 (...) @PrintErrorCode()
ret void
}
void __attribute__((no)) __attribute__((regparm(3))) print(const char *s) {
  while (*s) {
    __asm__ __volatile__("int  $0x10" : : "a"(0x0E00 | *s), "b"(7));
    s++;
  }
}


x86 assembly (clang, -O0):
<print>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     113a <print+0x3a>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
or     $0xe00,%eax
mov    $0x7,%ebx
int    $0x10
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1109 <print+0x9>
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<print>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1125 <print+0x25>
add    $0x1,%rdi
mov    $0x7,%ebx
movsbl %al,%eax
or     $0xe00,%eax
int    $0x10
movzbl (%rdi),%eax
add    $0x1,%rdi
test   %al,%al
jne    1110 <print+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @print(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %12, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %10, %4 ], [ %2, %1 ]
%6 = phi i8* [ %9, %4 ], [ %0, %1 ]
%7 = sext i8 %5 to i32
%8 = or i32 %7, 3584
tail call void asm sideeffect "int $$0x10", "{ax},{bx},~{dirflag},~{fpsr},~{flags}"(i32 %8, i32 7)
%9 = getelementptr inbounds i8, i8* %6, i64 1
%10 = load i8, i8* %9
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %4
12: ; preds = %4, %1
ret void
}
int index_left(int index) { return index << 1; }


x86 assembly (clang, -O0):
<index_left>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x1,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @index_left(i32 %0) {
%2 = shl i32 %0, 1
ret i32 %2
}
int big_calc3(int i, int *array) { return i; }


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

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

LLVM IR (-O0):
define i32 @big_calc3(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
ret i32 %5
}

LLVM IR (-O2):
define i32 @big_calc3(i32 returned %0, i32* nocapture readnone %1) {
ret i32 %0
}
/* Variables and functions */
unsigned short fFunction(unsigned short, unsigned short);
unsigned short fK(unsigned short input, unsigned short key) {
  return (((input >> 4) ^ fFunction(input & 15, key)) << 4) + (input & 15);
}


x86 assembly (clang, -O0):
<fK>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %si,%ax
mov    %di,%cx
mov    %cx,-0x2(%rbp)
mov    %ax,-0x4(%rbp)
movzwl -0x2(%rbp),%eax
sar    $0x4,%eax
mov    %eax,-0x8(%rbp)
movzwl -0x2(%rbp),%eax
and    $0xf,%eax
movzwl %ax,%edi
movzwl -0x4(%rbp),%esi
call   1030 <fFunction@plt>
mov    %ax,%cx
mov    -0x8(%rbp),%eax
movzwl %cx,%ecx
xor    %ecx,%eax
shl    $0x4,%eax
movzwl -0x2(%rbp),%ecx
and    $0xf,%ecx
add    %ecx,%eax
movzwl %ax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fK>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
mov    %edi,%ebp
and    $0xf,%ebp
mov    %ebp,%edi
call   1030 <fFunction@plt>
shl    $0x4,%eax
and    $0xfffffff0,%ebx
xor    %ebx,%eax
or     %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define zeroext i16 @fK(i16 zeroext %0, i16 zeroext %1) {
%3 = alloca i16
%4 = alloca i16
store i16 %0, i16* %3
store i16 %1, i16* %4
%5 = load i16, i16* %3
%6 = zext i16 %5 to i32
%7 = ashr i32 %6, 4
%8 = load i16, i16* %3
%9 = zext i16 %8 to i32
%10 = and i32 %9, 15
%11 = trunc i32 %10 to i16
%12 = load i16, i16* %4
%13 = call zeroext i16 @fFunction(i16 zeroext %11, i16 zeroext %12)
%14 = zext i16 %13 to i32
%15 = xor i32 %7, %14
%16 = shl i32 %15, 4
%17 = load i16, i16* %3
%18 = zext i16 %17 to i32
%19 = and i32 %18, 15
%20 = add nsw i32 %16, %19
%21 = trunc i32 %20 to i16
ret i16 %21
}

LLVM IR (-O2):
define zeroext i16 @fK(i16 zeroext %0, i16 zeroext %1) {
%3 = zext i16 %0 to i32
%4 = and i32 %3, 15
%5 = trunc i32 %4 to i16
%6 = tail call zeroext i16 @fFunction(i16 zeroext %5, i16 zeroext %1)
%7 = zext i16 %6 to i32
%8 = shl nuw nsw i32 %7, 4
%9 = and i32 %3, 65520
%10 = xor i32 %8, %9
%11 = or i32 %10, %4
%12 = trunc i32 %11 to i16
ret i16 %12
}
unsigned long strhash(const char *str, int *length) {
  unsigned char *c = (unsigned char *)str;
  unsigned long hash = 0;
  int l = 0;
  while (*c != '\0') {
    hash = (hash * 0xF4243) ^ (unsigned char)(*c++);
    l++;
  }
  *length = l;
  return hash;
}


x86 assembly (clang, -O0):
<strhash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
movl   $0x0,-0x24(%rbp)
mov    -0x18(%rbp),%rax
movzbl (%rax),%eax
cmp    $0x0,%eax
je     1162 <strhash+0x62>
imul   $0xf4243,-0x20(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x18(%rbp)
movzbl (%rcx),%ecx
xor    %rcx,%rax
mov    %rax,-0x20(%rbp)
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1123 <strhash+0x23>
mov    -0x24(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x20(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strhash>:
mov    (%rdi),%dl
test   %dl,%dl
je     112d <strhash+0x2d>
xor    %ecx,%ecx
xor    %eax,%eax
nopw   0x0(%rax,%rax,1)
imul   $0xf4243,%rax,%r8
movzbl %dl,%eax
xor    %r8,%rax
movzbl 0x1(%rdi,%rcx,1),%edx
add    $0x1,%rcx
test   %dl,%dl
jne    1110 <strhash+0x10>
mov    %ecx,(%rsi)
ret
xor    %eax,%eax
xor    %ecx,%ecx
mov    %ecx,(%rsi)
ret

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

LLVM IR (-O2):
define i64 @strhash(i8* nocapture %0, i32* nocapture writeonly %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %17, label %5
5: ; preds = %2, %5
%6 = phi i8 [ %15, %5 ], [ %3, %2 ]
%7 = phi i32 [ %14, %5 ], [ 0, %2 ]
%8 = phi i64 [ %13, %5 ], [ 0, %2 ]
%9 = phi i8* [ %11, %5 ], [ %0, %2 ]
%10 = mul i64 %8, 1000003
%11 = getelementptr inbounds i8, i8* %9, i64 1
%12 = zext i8 %6 to i64
%13 = xor i64 %10, %12
%14 = add nuw nsw i32 %7, 1
%15 = load i8, i8* %11
%16 = icmp eq i8 %15, 0
br i1 %16, label %17, label %5
17: ; preds = %5, %2
%18 = phi i64 [ 0, %2 ], [ %13, %5 ]
%19 = phi i32 [ 0, %2 ], [ %14, %5 ]
store i32 %19, i32* %1
ret i64 %18
}
/* Variables and functions */
int fastlz1_compress(void const *, int, void *);
int fastlz2_compress(void const *, int, void *);
int fastlz_compress(const void *input, int length, void *output) {
  if (length < 65536) {
    return fastlz1_compress(input, length, output);
  }
  return fastlz2_compress(input, length, output);
}


x86 assembly (clang, -O0):
<fastlz_compress>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
cmpl   $0x10000,-0x14(%rbp)
jge    1158 <fastlz_compress+0x38>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0x20(%rbp),%rdx
call   1030 <fastlz1_compress@plt>
mov    %eax,-0x4(%rbp)
jmp    116b <fastlz_compress+0x4b>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0x20(%rbp),%rdx
call   1040 <fastlz2_compress@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fastlz_compress>:
cmp    $0xffff,%esi
jg     112d <fastlz_compress+0xd>
jmp    1030 <fastlz1_compress@plt>
jmp    1040 <fastlz2_compress@plt>

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

LLVM IR (-O2):
define i32 @fastlz_compress(i8* %0, i32 %1, i8* %2) {
%4 = icmp slt i32 %1, 65536
br i1 %4, label %5, label %7
5: ; preds = %3
%6 = tail call i32 @fastlz1_compress(i8* %0, i32 %1, i8* %2)
br label %9
7: ; preds = %3
%8 = tail call i32 @fastlz2_compress(i8* %0, i32 %1, i8* %2)
br label %9
9: ; preds = %7, %5
%10 = phi i32 [ %6, %5 ], [ %8, %7 ]
ret i32 %10
}
void power_supply_remove_triggers(struct power_supply *psy) {}


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

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

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

LLVM IR (-O2):
%struct.power_supply = type opaque
define void @power_supply_remove_triggers(%struct.power_supply* nocapture %0) {
ret void
}
/* Type definitions */
struct io_buf_handle {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ io_error();
void io_free(struct io_buf_handle *iobh) {
  io_error();
  return;
}


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

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

LLVM IR (-O0):
%struct.io_buf_handle = type { i32 }
define void @io_free(%struct.io_buf_handle* %0) {
%2 = alloca %struct.io_buf_handle*
store %struct.io_buf_handle* %0, %struct.io_buf_handle** %2
%3 = call i32 (...) @io_error()
ret void
}

LLVM IR (-O2):
%struct.io_buf_handle = type { i32 }
define void @io_free(%struct.io_buf_handle* nocapture readnone %0) {
%2 = tail call i32 (...) @io_error()
ret void
}
void ff_hevc_put_hevc_bi_epel_v12_8_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_bi_epel_v12_8_sse4() {
ret void
}
/* Type definitions */
typedef scalar_t__ uint64_t;

/* Variables and functions */
size_t integer_less(uint64_t const left, uint64_t const right) {
  return (left < right);
}


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

x86 assembly (clang, -O2):
<integer_less>:
xor    %eax,%eax
cmp    %rsi,%rdi
setl   %al
ret

LLVM IR (-O0):
define i64 @integer_less(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
%8 = zext i1 %7 to i32
%9 = sext i32 %8 to i64
ret i64 %9
}

LLVM IR (-O2):
define i64 @integer_less(i64 %0, i64 %1) {
%3 = icmp slt i64 %0, %1
%4 = zext i1 %3 to i64
ret i64 %4
}
void XtScreenDatabase() {}


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

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

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

LLVM IR (-O2):
define void @XtScreenDatabase() {
ret void
}
char *strcpy(char *dest, const char *src) {
  char *d = dest;
  const char *s = src;
  while ((*d++ = *s++))
    ;
  return dest;
}


x86 assembly (clang, -O0):
<strcpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x20(%rbp)
mov    (%rax),%al
mov    -0x18(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x18(%rbp)
mov    %al,(%rcx)
cmp    $0x0,%al
je     114b <strcpy+0x4b>
jmp    111c <strcpy+0x1c>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcpy>:
mov    %rdi,%rax
xor    %ecx,%ecx
cs nopw 0x0(%rax,%rax,1)
nop
movzbl (%rsi,%rcx,1),%edx
mov    %dl,(%rax,%rcx,1)
add    $0x1,%rcx
test   %dl,%dl
jne    1110 <strcpy+0x10>
ret

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

LLVM IR (-O2):
define i8* @strcpy(i8* returned writeonly %0, i8* nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %0, %2 ], [ %8, %3 ]
%5 = phi i8* [ %1, %2 ], [ %6, %3 ]
%6 = getelementptr inbounds i8, i8* %5, i64 1
%7 = load i8, i8* %5
%8 = getelementptr inbounds i8, i8* %4, i64 1
store i8 %7, i8* %4
%9 = icmp eq i8 %7, 0
br i1 %9, label %10, label %3
10: ; preds = %3
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ bmy_user_interal_call(char const *, int, char *);
void bmy_user_delete(int usernum, char *userid) {
  const char *sql = "CALL procedure_delete_user(?, ?)";
  bmy_user_interal_call(sql, usernum, userid);
}


x86 assembly (clang, -O0):
<bmy_user_delete>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xeda(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rdx
call   1030 <bmy_user_interal_call@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bmy_user_delete>:
mov    %rsi,%rdx
mov    %edi,%esi
lea    0xee4(%rip),%rdi
jmp    1030 <bmy_user_interal_call@plt>

LLVM IR (-O0):
@.str = [33 x i8] c"CALL procedure_delete_user(?, ?)\00"
define void @bmy_user_delete(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
store i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i8** %5
%6 = load i8*, i8** %5
%7 = load i32, i32* %3
%8 = load i8*, i8** %4
%9 = call i32 @bmy_user_interal_call(i8* %6, i32 %7, i8* %8)
ret void
}

LLVM IR (-O2):
@.str = [33 x i8] c"CALL procedure_delete_user(?, ?)\00"
define void @bmy_user_delete(i32 %0, i8* %1) {
%3 = tail call i32 @bmy_user_interal_call(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i32 %0, i8* %1)
ret void
}
int test(int i, int j) {
  if (i < j) {
    return 42;
  } else {
    return 43;
  }
}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1122 <test+0x22>
movl   $0x2a,-0x4(%rbp)
jmp    1129 <test+0x29>
movl   $0x2b,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test>:
xor    %eax,%eax
cmp    %esi,%edi
setl   %al
xor    $0x2b,%eax
ret

LLVM IR (-O0):
define i32 @test(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = load i32, i32* %4
%7 = load i32, i32* %5
%8 = icmp slt i32 %6, %7
br i1 %8, label %9, label %10
9: ; preds = %2
store i32 42, i32* %3
br label %11
10: ; preds = %2
store i32 43, i32* %3
br label %11
11: ; preds = %10, %9
%12 = load i32, i32* %3
ret i32 %12
}

LLVM IR (-O2):
define i32 @test(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, %1
%4 = select i1 %3, i32 42, i32 43
ret i32 %4
}
int main() {
  int i = 0;
  return i++ + ++i;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0x8(%rbp)
mov    -0x8(%rbp),%ecx
add    $0x1,%ecx
mov    %ecx,-0x8(%rbp)
add    %ecx,%eax
pop    %rbp
ret

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

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

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

/* Variables and functions */
void unpack_byte(uint8_t a, char *c) {
  char table[16] = {0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37,
                    0x38, 0x39, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46};
  c[0] = table[a / 16];
  c[1] = table[a % 16];
}


x86 assembly (clang, -O0):
<unpack_byte>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0xeee(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xeeb(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x10,%ecx
cltd
idiv   %ecx
cltq
mov    -0x20(%rbp,%rax,1),%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
mov    -0x4(%rbp),%eax
mov    $0x10,%ecx
cltd
idiv   %ecx
movslq %edx,%rax
mov    -0x20(%rbp,%rax,1),%cl
mov    -0x10(%rbp),%rax
mov    %cl,0x1(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<unpack_byte>:
lea    0xf(%rdi),%eax
test   %edi,%edi
cmovns %edi,%eax
mov    %eax,%ecx
sar    $0x4,%ecx
movslq %ecx,%rcx
lea    0xee9(%rip),%rdx
mov    (%rcx,%rdx,1),%cl
mov    %cl,(%rsi)
and    $0xfffffff0,%eax
sub    %eax,%edi
movslq %edi,%rax
mov    (%rax,%rdx,1),%al
mov    %al,0x1(%rsi)
ret

LLVM IR (-O0):
@__const.unpack_byte.table = [16 x i8] c"0123456789ABCDEF"
define void @unpack_byte(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca [16 x i8]
store i32 %0, i32* %3
store i8* %1, i8** %4
%6 = bitcast [16 x i8]* %5 to i8*
%7 = load i32, i32* %3
%8 = sdiv i32 %7, 16
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds [16 x i8], [16 x i8]* %5, i64 0, i64 %9
%11 = load i8, i8* %10
%12 = load i8*, i8** %4
%13 = getelementptr inbounds i8, i8* %12, i64 0
store i8 %11, i8* %13
%14 = load i32, i32* %3
%15 = srem i32 %14, 16
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds [16 x i8], [16 x i8]* %5, i64 0, i64 %16
%18 = load i8, i8* %17
%19 = load i8*, i8** %4
%20 = getelementptr inbounds i8, i8* %19, i64 1
store i8 %18, i8* %20
ret void
}

LLVM IR (-O2):
@__const.unpack_byte.table = [16 x i8] c"0123456789ABCDEF"
define void @unpack_byte(i32 %0, i8* nocapture writeonly %1) {
%3 = sdiv i32 %0, 16
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds [16 x i8], [16 x i8]* @__const.unpack_byte.table, i64 0, i64 %4
%6 = load i8, i8* %5
store i8 %6, i8* %1
%7 = srem i32 %0, 16
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds [16 x i8], [16 x i8]* @__const.unpack_byte.table, i64 0, i64 %8
%10 = load i8, i8* %9
%11 = getelementptr inbounds i8, i8* %1, i64 1
store i8 %10, i8* %11
ret void
}
/* Variables and functions */
int syscall_kill(int, int);
int kill(int pid, int sig) { return syscall_kill(pid, sig); }


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

x86 assembly (clang, -O2):
<kill>:
jmp    1030 <syscall_kill@plt>

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

LLVM IR (-O2):
define i32 @kill(i32 %0, i32 %1) {
%3 = tail call i32 @syscall_kill(i32 %0, i32 %1)
ret i32 %3
}
/* Variables and functions */
int mygetline(char *, int);
int /*<<< orphan*/ printf(char *, char *);
int main() {
  char line[1000];
  int len;
  while ((len = mygetline(line, 1000)) > 0)
    if (len > 80)
      printf("%s\n", line);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x400,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x3f0(%rbp),%rdi
mov    $0x3e8,%esi
call   1040 <mygetline@plt>
mov    %eax,-0x3f4(%rbp)
cmp    $0x0,%eax
jle    1177 <main+0x57>
cmpl   $0x50,-0x3f4(%rbp)
jle    1172 <main+0x52>
lea    -0x3f0(%rbp),%rsi
lea    0xe93(%rip),%rdi
call   1030 <printf@plt>
jmp    1132 <main+0x12>
mov    -0x4(%rbp),%eax
add    $0x400,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x3e8,%rsp
mov    %rsp,%rdi
mov    $0x3e8,%esi
call   1040 <mygetline@plt>
test   %eax,%eax
jle    1173 <main+0x53>
lea    0xebe(%rip),%r14
mov    %rsp,%rbx
jmp    1161 <main+0x41>
nopw   0x0(%rax,%rax,1)
mov    %rbx,%rdi
mov    $0x3e8,%esi
call   1040 <mygetline@plt>
test   %eax,%eax
jle    1173 <main+0x53>
cmp    $0x51,%eax
jb     1150 <main+0x30>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
jmp    1150 <main+0x30>
xor    %eax,%eax
add    $0x3e8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca [1000 x i8]
%2 = getelementptr inbounds [1000 x i8], [1000 x i8]* %1, i64 0, i64 0
%3 = call i32 @mygetline(i8* %2, i32 1000)
%4 = icmp sgt i32 %3, 0
br i1 %4, label %5, label %13
5: ; preds = %0, %10
%6 = phi i32 [ %11, %10 ], [ %3, %0 ]
%7 = icmp ugt i32 %6, 80
br i1 %7, label %8, label %10
8: ; preds = %5
%9 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %2)
br label %10
10: ; preds = %8, %5
%11 = call i32 @mygetline(i8* %2, i32 1000)
%12 = icmp sgt i32 %11, 0
br i1 %12, label %5, label %13
13: ; preds = %10, %0
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
void print_usage(const char *progname) {
  fprintf(stderr, "Usage: %s filename [args]\n", progname);
  exit(1);
}


x86 assembly (clang, -O0):
<print_usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<print_usage>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

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

LLVM IR (-O2):
@stderr = global i32 0
@.str = [27 x i8] c"Usage: %s filename [args]\0A\00"
define void @print_usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 1)
unreachable
}
int change_bit_at_position(int numb, int v, int p) {
  int bit_at_position = (numb & (1 << p)) == 0 ? 0 : 1;
  int output = numb;
  if (bit_at_position != v) {
    output = numb ^ (1 << p);
  }
  return output;
}


x86 assembly (clang, -O0):
<change_bit_at_position>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%edx
mov    -0xc(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
and    %eax,%edx
mov    $0x1,%eax
xor    %ecx,%ecx
cmp    $0x0,%edx
cmove  %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x8(%rbp),%eax
je     1152 <change_bit_at_position+0x52>
mov    -0x4(%rbp),%eax
mov    -0xc(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
xor    %ecx,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<change_bit_at_position>:
mov    %edx,%ecx
mov    %edi,%edx
shr    %cl,%edx
and    $0x1,%edx
mov    $0x1,%r8d
shl    %cl,%r8d
xor    %eax,%eax
cmp    %esi,%edx
cmovne %r8d,%eax
xor    %edi,%eax
ret

LLVM IR (-O0):
define i32 @change_bit_at_position(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%9 = load i32, i32* %4
%10 = load i32, i32* %6
%11 = shl i32 1, %10
%12 = and i32 %9, %11
%13 = icmp eq i32 %12, 0
%14 = zext i1 %13 to i64
%15 = select i1 %13, i32 0, i32 1
store i32 %15, i32* %7
%16 = load i32, i32* %4
store i32 %16, i32* %8
%17 = load i32, i32* %7
%18 = load i32, i32* %5
%19 = icmp ne i32 %17, %18
br i1 %19, label %20, label %25
20: ; preds = %3
%21 = load i32, i32* %4
%22 = load i32, i32* %6
%23 = shl i32 1, %22
%24 = xor i32 %21, %23
store i32 %24, i32* %8
br label %25
25: ; preds = %20, %3
%26 = load i32, i32* %8
ret i32 %26
}

LLVM IR (-O2):
define i32 @change_bit_at_position(i32 %0, i32 %1, i32 %2) {
%4 = lshr i32 %0, %2
%5 = and i32 %4, 1
%6 = icmp eq i32 %5, %1
%7 = shl nuw i32 1, %2
%8 = select i1 %6, i32 0, i32 %7
%9 = xor i32 %8, %0
ret i32 %9
}
RCU_DEF_INIT_FUNC(user_f4_init, param) { RCU_FAIL("user_f4_init"); }


x86 assembly (clang, -O0):
<RCU_DEF_INIT_FUNC>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
lea    0xedb(%rip),%rdi
mov    $0x0,%al
call   1030 <RCU_FAIL@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<RCU_DEF_INIT_FUNC>:
lea    0xee9(%rip),%rdi
xor    %eax,%eax
jmp    1030 <RCU_FAIL@plt>

LLVM IR (-O0):
@.str = [13 x i8] c"user_f4_init\00"
define i32 @RCU_DEF_INIT_FUNC(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = call i32 (i8*, ...) bitcast (i32 (...)* @RCU_FAIL to i32 (i8*, ...)*)(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%7 = load i32, i32* %3
ret i32 %7
}

LLVM IR (-O2):
@.str = [13 x i8] c"user_f4_init\00"
define i32 @RCU_DEF_INIT_FUNC(i32 %0, i32 %1) {
%3 = tail call i32 (i8*, ...) bitcast (i32 (...)* @RCU_FAIL to i32 (i8*, ...)*)(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ diamond(long);
long strtol(char *, int /*<<< orphan*/ *, int);
int main(int argc, char *argv[]) {
  long n = strtol(argv[1], NULL, 10);
  diamond(n);
  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)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
xor    %eax,%eax
mov    %eax,%esi
mov    $0xa,%edx
call   1040 <strtol@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <diamond@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x8(%rsi),%rdi
xor    %esi,%esi
mov    $0xa,%edx
call   1040 <strtol@plt>
mov    %rax,%rdi
call   1030 <diamond@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i64
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = load i8**, i8*** %5
%8 = getelementptr inbounds i8*, i8** %7, i64 1
%9 = load i8*, i8** %8
%10 = call i64 @strtol(i8* %9, i32* null, i32 10)
store i64 %10, i64* %6
%11 = load i64, i64* %6
%12 = call i32 @diamond(i64 %11)
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 i64 @strtol(i8* nocapture %4, i32* null, i32 10)
%6 = tail call i32 @diamond(i64 %5)
ret i32 0
}
/* Variables and functions */
int bar();
int foo();
int main() { return foo() + bar(); }


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

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1040 <foo@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1030 <bar@plt>
add    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @foo()
%3 = call i32 (...) @bar()
%4 = add nsw i32 %2, %3
ret i32 %4
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @foo()
%2 = tail call i32 (...) @bar()
%3 = add nsw i32 %2, %1
ret i32 %3
}