xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ closegraph();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int peekb(int /*<<< orphan*/, int);
int /*<<< orphan*/ pokeb(int /*<<< orphan*/, int, int);
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ textmode(int /*<<< orphan*/);
void quit_prog() {
  closegraph();
  textmode(0);
  pokeb(0, 0x417, peekb(0, 0x417) & 0xBF);
  puts("Thankyou for using `SOFTBEEB'\n");
  puts("Have a nice day {;-)\n");
  exit(0);
}


x86 assembly (clang, -O0):
<quit_prog>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1060 <closegraph@plt>
xor    %edi,%edi
call   1040 <textmode@plt>
xor    %edi,%edi
mov    $0x417,%esi
call   1070 <peekb@plt>
mov    %eax,%edx
and    $0xbf,%edx
xor    %edi,%edi
mov    $0x417,%esi
call   1050 <pokeb@plt>
lea    0xe67(%rip),%rdi
call   1030 <puts@plt>
lea    0xe7a(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1080 <exit@plt>

x86 assembly (clang, -O2):
<quit_prog>:
push   %rax
xor    %eax,%eax
call   1060 <closegraph@plt>
xor    %edi,%edi
call   1040 <textmode@plt>
xor    %edi,%edi
mov    $0x417,%esi
call   1070 <peekb@plt>
and    $0xbf,%eax
xor    %edi,%edi
mov    $0x417,%esi
mov    %eax,%edx
call   1050 <pokeb@plt>
lea    0xe6b(%rip),%rdi
call   1030 <puts@plt>
lea    0xe7e(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1080 <exit@plt>

LLVM IR (-O0):
@.str = [31 x i8] c"Thankyou for using `SOFTBEEB'\0A\00"
@.str.1 = [22 x i8] c"Have a nice day {;-)\0A\00"
define void @quit_prog() {
%1 = call i32 (...) @closegraph()
%2 = call i32 @textmode(i32 0)
%3 = call i32 @peekb(i32 0, i32 1047)
%4 = and i32 %3, 191
%5 = call i32 @pokeb(i32 0, i32 1047, i32 %4)
%6 = call i32 @puts(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @puts(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0))
%8 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [31 x i8] c"Thankyou for using `SOFTBEEB'\0A\00"
@.str.1 = [22 x i8] c"Have a nice day {;-)\0A\00"
define void @quit_prog() {
%1 = tail call i32 (...) @closegraph()
%2 = tail call i32 @textmode(i32 0)
%3 = tail call i32 @peekb(i32 0, i32 1047)
%4 = and i32 %3, 191
%5 = tail call i32 @pokeb(i32 0, i32 1047, i32 %4)
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0))
%8 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void FreeArray4D(void ****m) {
  free((char *)m[0][0][0]);
  free((char *)m[0][0]);
  free((char *)m[0]);
  free((char *)m);
}


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

x86 assembly (clang, -O2):
<FreeArray4D>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%rax
mov    (%rax),%rax
mov    (%rax),%rdi
call   1030 <free@plt>
mov    (%rbx),%rax
mov    (%rax),%rdi
call   1030 <free@plt>
mov    (%rbx),%rdi
call   1030 <free@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @FreeArray4D(i8**** %0) {
%2 = alloca i8****
store i8**** %0, i8***** %2
%3 = load i8****, i8***** %2
%4 = getelementptr inbounds i8***, i8**** %3, i64 0
%5 = load i8***, i8**** %4
%6 = getelementptr inbounds i8**, i8*** %5, i64 0
%7 = load i8**, i8*** %6
%8 = getelementptr inbounds i8*, i8** %7, i64 0
%9 = load i8*, i8** %8
%10 = call i32 @free(i8* %9)
%11 = load i8****, i8***** %2
%12 = getelementptr inbounds i8***, i8**** %11, i64 0
%13 = load i8***, i8**** %12
%14 = getelementptr inbounds i8**, i8*** %13, i64 0
%15 = load i8**, i8*** %14
%16 = bitcast i8** %15 to i8*
%17 = call i32 @free(i8* %16)
%18 = load i8****, i8***** %2
%19 = getelementptr inbounds i8***, i8**** %18, i64 0
%20 = load i8***, i8**** %19
%21 = bitcast i8*** %20 to i8*
%22 = call i32 @free(i8* %21)
%23 = load i8****, i8***** %2
%24 = bitcast i8**** %23 to i8*
%25 = call i32 @free(i8* %24)
ret void
}

LLVM IR (-O2):
define void @FreeArray4D(i8**** nocapture %0) {
%2 = load i8***, i8**** %0
%3 = load i8**, i8*** %2
%4 = load i8*, i8** %3
%5 = tail call i32 @free(i8* %4)
%6 = bitcast i8**** %0 to i8***
%7 = load i8**, i8*** %6
%8 = load i8*, i8** %7
%9 = tail call i32 @free(i8* %8)
%10 = bitcast i8**** %0 to i8**
%11 = load i8*, i8** %10
%12 = tail call i32 @free(i8* %11)
%13 = bitcast i8**** %0 to i8*
%14 = tail call i32 @free(i8* %13)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void test(int Arg) {
  printf("%d\n", Arg / (1 << 0));
  printf("%d\n", Arg / (1 << 4));
  printf("%d\n", Arg / (1 << 18));
  printf("%d\n", Arg / (1 << 30));
}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x1,%ecx
cltd
idiv   %ecx
mov    %eax,%esi
lea    0xed1(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
mov    $0x10,%ecx
cltd
idiv   %ecx
mov    %eax,%esi
lea    0xeb8(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
mov    $0x40000,%ecx
cltd
idiv   %ecx
mov    %eax,%esi
lea    0xe9f(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
mov    $0x40000000,%ecx
cltd
idiv   %ecx
mov    %eax,%esi
lea    0xe86(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %edi,%esi
lea    0x3fffffff(%rsi),%r14d
test   %edi,%edi
cmovns %edi,%r14d
lea    0x3ffff(%rsi),%ebp
test   %edi,%edi
cmovns %edi,%ebp
lea    0xf(%rsi),%ebx
test   %edi,%edi
lea    0xec3(%rip),%r15
cmovns %edi,%ebx
mov    %r15,%rdi
call   1030 <printf@plt>
sar    $0x4,%ebx
mov    %r15,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
sar    $0x12,%ebp
mov    %r15,%rdi
mov    %ebp,%esi
call   1030 <printf@plt>
sar    $0x1e,%r14d
mov    %r15,%rdi
mov    %r14d,%esi
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
define void @test(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sdiv i32 %3, 1
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = load i32, i32* %2
%7 = sdiv i32 %6, 16
%8 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = load i32, i32* %2
%10 = sdiv i32 %9, 262144
%11 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %10)
%12 = load i32, i32* %2
%13 = sdiv i32 %12, 1073741824
%14 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %13)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define void @test(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %0)
%3 = sdiv i32 %0, 16
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = sdiv i32 %0, 262144
%6 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = sdiv i32 %0, 1073741824
%8 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %7)
ret void
}
int start_farm() { return 1; }


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

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

LLVM IR (-O0):
define i32 @start_farm() {
ret i32 1
}

LLVM IR (-O2):
define i32 @start_farm() {
ret i32 1
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
bool AUXSMPHTryAcquire(uint32_t ui32Semaphore) {
  uint32_t ui32SemaReg;

  ;
  ui32SemaReg = (*(
      (volatile unsigned long *)(0x400C8000 + 0x00000000 + 4 * ui32Semaphore)));
  return (ui32SemaReg == 0x00000001);
}


x86 assembly (clang, -O0):
<AUXSMPHTryAcquire>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x2,%eax
add    $0x400c8000,%eax
cltq
mov    (%rax),%rax
mov    %eax,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<AUXSMPHTryAcquire>:
movslq %edi,%rax
mov    0x400c8000(,%rax,4),%rcx
40
xor    %eax,%eax
cmp    $0x1,%ecx
sete   %al
ret

LLVM IR (-O0):
define i32 @AUXSMPHTryAcquire(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = mul nsw i32 4, %4
%6 = add nsw i32 1074561024, %5
%7 = sext i32 %6 to i64
%8 = inttoptr i64 %7 to i64*
%9 = load volatile i64, i64* %8
%10 = trunc i64 %9 to i32
store i32 %10, i32* %3
%11 = load i32, i32* %3
%12 = icmp eq i32 %11, 1
%13 = zext i1 %12 to i32
ret i32 %13
}

LLVM IR (-O2):
define i32 @AUXSMPHTryAcquire(i32 %0) {
%2 = shl nsw i32 %0, 2
%3 = add nsw i32 %2, 1074561024
%4 = sext i32 %3 to i64
%5 = inttoptr i64 %4 to i64*
%6 = load volatile i64, i64* %5
%7 = trunc i64 %6 to i32
%8 = icmp eq i32 %7, 1
%9 = zext i1 %8 to i32
ret i32 %9
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  int /*<<< orphan*/ state;
};
typedef TYPE_1__ XEnterWindowEvent;

/* Variables and functions */
unsigned get_XEnterWindowEvent_state(void *_p) {
  return (unsigned)((XEnterWindowEvent *)_p)->state;
}


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

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

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

LLVM IR (-O2):
define i32 @get_XEnterWindowEvent_state(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
ret i32 %3
}
/* Type definitions */
struct wl_subsurface {
  int dummy;
};
struct wl_proxy {
  int dummy;
};

/* Variables and functions */
void *wl_proxy_get_user_data(struct wl_proxy *);
void *wl_subsurface_get_user_data(struct wl_subsurface *wl_subsurface) {
  return wl_proxy_get_user_data((struct wl_proxy *)wl_subsurface);
}


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

x86 assembly (clang, -O2):
<wl_subsurface_get_user_data>:
jmp    1030 <wl_proxy_get_user_data@plt>

LLVM IR (-O0):
%struct.wl_subsurface = type { i32 }
%struct.wl_proxy = type { i32 }
define i8* @wl_subsurface_get_user_data(%struct.wl_subsurface* %0) {
%2 = alloca %struct.wl_subsurface*
store %struct.wl_subsurface* %0, %struct.wl_subsurface** %2
%3 = load %struct.wl_subsurface*, %struct.wl_subsurface** %2
%4 = bitcast %struct.wl_subsurface* %3 to %struct.wl_proxy*
%5 = call i8* @wl_proxy_get_user_data(%struct.wl_proxy* %4)
ret i8* %5
}

LLVM IR (-O2):
%struct.wl_subsurface = type { i32 }
%struct.wl_proxy = type { i32 }
define i8* @wl_subsurface_get_user_data(%struct.wl_subsurface* %0) {
%2 = bitcast %struct.wl_subsurface* %0 to %struct.wl_proxy*
%3 = tail call i8* @wl_proxy_get_user_data(%struct.wl_proxy* %2)
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void Usage(void) {
  printf("\nUsage:\n");
  printf(">> aacdec [-wav] infile.aac outfile\n");
  printf("     -wav:  if specified, then outfile is a .wav file.\n");
  printf("            otherwise, outfile is a raw PCM file\n");
}


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

x86 assembly (clang, -O2):
<Usage>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xee4(%rip),%rdi
call   1030 <puts@plt>
lea    0xefc(%rip),%rdi
call   1030 <puts@plt>
lea    0xf27(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"\0AUsage:\0A\00"
@.str.1 = [37 x i8] c">> aacdec [-wav] infile.aac outfile\0A\00"
@.str.2 = [56 x i8] c" -wav: if specified, then outfile is a .wav file.\0A\00"
@.str.3 = [50 x i8] c" otherwise, outfile is a raw PCM file\0A\00"
define void @Usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [8 x i8] c"\0AUsage:\00"
@str.4 = [36 x i8] c">> aacdec [-wav] infile.aac outfile\00"
@str.5 = [55 x i8] c" -wav: if specified, then outfile is a .wav file.\00"
@str.6 = [49 x i8] c" otherwise, outfile is a raw PCM file\00"
define void @Usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @str.4, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([55 x i8], [55 x i8]* @str.5, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([49 x i8], [49 x i8]* @str.6, i64 0, i64 0))
ret void
}
/* Variables and functions */
int inp_emulate(int);
char TOSH_READ_UART_TXD0_PIN() { return 0x01 & (inp_emulate(0x71) >> 1); }


x86 assembly (clang, -O0):
<TOSH_READ_UART_TXD0_PIN>:
push   %rbp
mov    %rsp,%rbp
mov    $0x71,%edi
call   1030 <inp_emulate@plt>
sar    $0x1,%eax
and    $0x1,%eax
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<TOSH_READ_UART_TXD0_PIN>:
push   %rax
mov    $0x71,%edi
call   1030 <inp_emulate@plt>
shr    %al
and    $0x1,%al
pop    %rcx
ret

LLVM IR (-O0):
define signext i8 @TOSH_READ_UART_TXD0_PIN() {
%1 = call i32 @inp_emulate(i32 113)
%2 = ashr i32 %1, 1
%3 = and i32 1, %2
%4 = trunc i32 %3 to i8
ret i8 %4
}

LLVM IR (-O2):
define signext i8 @TOSH_READ_UART_TXD0_PIN() {
%1 = tail call i32 @inp_emulate(i32 113)
%2 = trunc i32 %1 to i8
%3 = lshr i8 %2, 1
%4 = and i8 %3, 1
ret i8 %4
}
/* Type definitions */
struct bufrdeco {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ sprint_sec1_info(char *, int, struct bufrdeco *);
void print_sec1_info(struct bufrdeco *b) {
  char caux[2048];
  caux[0] = 0;
  sprint_sec1_info(caux, 2048, b);
  printf("%s", caux);
}


x86 assembly (clang, -O0):
<print_sec1_info>:
push   %rbp
mov    %rsp,%rbp
sub    $0x810,%rsp
mov    %rdi,-0x8(%rbp)
movb   $0x0,-0x810(%rbp)
lea    -0x810(%rbp),%rdi
mov    -0x8(%rbp),%rdx
mov    $0x800,%esi
call   1040 <sprint_sec1_info@plt>
lea    -0x810(%rbp),%rsi
lea    0xea7(%rip),%rdi
call   1030 <printf@plt>
add    $0x810,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_sec1_info>:
push   %rbx
sub    $0x800,%rsp
mov    %rdi,%rdx
movb   $0x0,(%rsp)
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x800,%esi
call   1040 <sprint_sec1_info@plt>
lea    0xeba(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
add    $0x800,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.bufrdeco = type { i32 }
@.str = [3 x i8] c"%s\00"
define void @print_sec1_info(%struct.bufrdeco* %0) {
%2 = alloca %struct.bufrdeco*
%3 = alloca [2048 x i8]
store %struct.bufrdeco* %0, %struct.bufrdeco** %2
%4 = getelementptr inbounds [2048 x i8], [2048 x i8]* %3, i64 0, i64 0
store i8 0, i8* %4
%5 = getelementptr inbounds [2048 x i8], [2048 x i8]* %3, i64 0, i64 0
%6 = load %struct.bufrdeco*, %struct.bufrdeco** %2
%7 = call i32 @sprint_sec1_info(i8* %5, i32 2048, %struct.bufrdeco* %6)
%8 = getelementptr inbounds [2048 x i8], [2048 x i8]* %3, i64 0, i64 0
%9 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %8)
ret void
}

LLVM IR (-O2):
%struct.bufrdeco = type { i32 }
@.str = [3 x i8] c"%s\00"
define void @print_sec1_info(%struct.bufrdeco* %0) {
%2 = alloca [2048 x i8]
%3 = getelementptr inbounds [2048 x i8], [2048 x i8]* %2, i64 0, i64 0
store i8 0, i8* %3
%4 = call i32 @sprint_sec1_info(i8* %3, i32 2048, %struct.bufrdeco* %0)
%5 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}
int fib(int i) {
  if (i == 0)
    return 0;
  if (i == 1)
    return 1;
  return fib(i - 1) + fib(i - 2);
}


x86 assembly (clang, -O0):
<fib>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1131 <fib+0x21>
movl   $0x0,-0x4(%rbp)
jmp    116a <fib+0x5a>
cmpl   $0x1,-0x8(%rbp)
jne    1147 <fib+0x37>
movl   $0x1,-0x4(%rbp)
jmp    116a <fib+0x5a>
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
call   1030 <fib@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
sub    $0x2,%edi
call   1030 <fib@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fib>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
xor    %ebp,%ebp
cmp    $0x2,%ebx
jb     1132 <fib+0x22>
nopl   0x0(%rax)
lea    -0x1(%rbx),%edi
call   1030 <fib@plt>
add    %eax,%ebp
add    $0xfffffffe,%ebx
cmp    $0x2,%ebx
jae    1120 <fib+0x10>
add    %ebp,%ebx
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @fib(i32 %0) {
br label %2
2: ; preds = %6, %1
%3 = phi i32 [ 0, %1 ], [ %10, %6 ]
%4 = phi i32 [ %0, %1 ], [ %9, %6 ]
%5 = icmp ult i32 %4, 2
br i1 %5, label %11, label %6
6: ; preds = %2
%7 = add nsw i32 %4, -1
%8 = tail call i32 @fib(i32 %7)
%9 = add nsw i32 %4, -2
%10 = add nsw i32 %8, %3
br label %2
11: ; preds = %2
%12 = add nsw i32 %4, %3
ret i32 %12
}
void af(void) {}


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

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

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

LLVM IR (-O2):
define void @af() {
ret void
}
void WebReportError(const char *file, int line, const char *function,
                    const char *format, ...) {}


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

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

LLVM IR (-O0):
define void @WebReportError(i8* %0, i32 %1, i8* %2, i8* %3, ...) {
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i8*
store i8* %0, i8** %5
store i32 %1, i32* %6
store i8* %2, i8** %7
store i8* %3, i8** %8
ret void
}

LLVM IR (-O2):
define void @WebReportError(i8* nocapture %0, i32 %1, i8* nocapture %2, i8* nocapture %3, ...) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ led(int, int, int, int);
int main(int argn, char *argv[]) {
  led(0, 255, 0, 0);
  led(1, 255, 0, 255);
  led(2, 0, 255, 255);
  led(3, 255, 255, 0);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %ecx,%ecx
mov    $0xff,%esi
mov    %ecx,%edi
mov    %ecx,%edx
call   1030 <led@plt>
mov    $0x1,%edi
mov    $0xff,%ecx
xor    %edx,%edx
mov    %ecx,%esi
call   1030 <led@plt>
mov    $0x2,%edi
xor    %esi,%esi
mov    $0xff,%ecx
mov    %ecx,%edx
call   1030 <led@plt>
mov    $0x3,%edi
mov    $0xff,%edx
xor    %ecx,%ecx
mov    %edx,%esi
call   1030 <led@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
mov    $0xff,%esi
xor    %edx,%edx
xor    %ecx,%ecx
call   1030 <led@plt>
mov    $0x1,%edi
mov    $0xff,%esi
xor    %edx,%edx
mov    $0xff,%ecx
call   1030 <led@plt>
mov    $0x2,%edi
xor    %esi,%esi
mov    $0xff,%edx
mov    $0xff,%ecx
call   1030 <led@plt>
mov    $0x3,%edi
mov    $0xff,%esi
mov    $0xff,%edx
xor    %ecx,%ecx
call   1030 <led@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**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @led(i32 0, i32 255, i32 0, i32 0)
%7 = call i32 @led(i32 1, i32 255, i32 0, i32 255)
%8 = call i32 @led(i32 2, i32 0, i32 255, i32 255)
%9 = call i32 @led(i32 3, i32 255, i32 255, i32 0)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @led(i32 0, i32 255, i32 0, i32 0)
%4 = tail call i32 @led(i32 1, i32 255, i32 0, i32 255)
%5 = tail call i32 @led(i32 2, i32 0, i32 255, i32 255)
%6 = tail call i32 @led(i32 3, i32 255, i32 255, i32 0)
ret i32 0
}
/* Variables and functions */
char getch_(int /*<<< orphan*/);
char _getch(void) { return getch_(0); }


x86 assembly (clang, -O0):
<_getch>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <getch_@plt>
movsbl %al,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define signext i8 @_getch() {
%1 = call signext i8 @getch_(i32 0)
ret i8 %1
}

LLVM IR (-O2):
define signext i8 @_getch() {
%1 = tail call signext i8 @getch_(i32 0)
ret i8 %1
}
/* Variables and functions */
int KIONIX_ACCEL_read_bytes(int, char *, int);
int KIONIX_ACCEL_read_previous_position(char *previous_position) {
  int status;
  status = KIONIX_ACCEL_read_bytes(0x11, previous_position, 1);
  return status;
}


x86 assembly (clang, -O0):
<KIONIX_ACCEL_read_previous_position>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
mov    $0x11,%edi
mov    $0x1,%edx
call   1030 <KIONIX_ACCEL_read_bytes@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<KIONIX_ACCEL_read_previous_position>:
mov    %rdi,%rsi
mov    $0x11,%edi
mov    $0x1,%edx
jmp    1030 <KIONIX_ACCEL_read_bytes@plt>

LLVM IR (-O0):
define i32 @KIONIX_ACCEL_read_previous_position(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @KIONIX_ACCEL_read_bytes(i32 17, i8* %4, i32 1)
store i32 %5, i32* %3
%6 = load i32, i32* %3
ret i32 %6
}

LLVM IR (-O2):
define i32 @KIONIX_ACCEL_read_previous_position(i8* %0) {
%2 = tail call i32 @KIONIX_ACCEL_read_bytes(i32 17, i8* %0, i32 1)
ret i32 %2
}
void _exit(int status) { asm volatile(".globl C$$EXIT\nnop\nC$$EXIT:nop"); }


x86 assembly (clang, -O0):
<_exit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
nop

x86 assembly (clang, -O2):
<_exit>:
nop

LLVM IR (-O0):
define void @_exit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
unreachable
}

LLVM IR (-O2):
define void @_exit(i32 %0) {
tail call void asm sideeffect ".globl C$$$$EXIT\0Anop\0AC$$$$EXIT:nop", "~{dirflag},~{fpsr},~{flags}"()
unreachable
}
/* Variables and functions */
int rand();
int generateProduct() { return rand() % 10; }


x86 assembly (clang, -O0):
<generateProduct>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <rand@plt>
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<generateProduct>:
push   %rax
xor    %eax,%eax
call   1030 <rand@plt>
cltq
imul   $0x66666667,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x22,%rcx
add    %edx,%ecx
add    %ecx,%ecx
lea    (%rcx,%rcx,4),%ecx
sub    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @generateProduct() {
%1 = call i32 (...) @rand()
%2 = srem i32 %1, 10
ret i32 %2
}

LLVM IR (-O2):
define i32 @generateProduct() {
%1 = tail call i32 (...) @rand()
%2 = srem i32 %1, 10
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ drawPowerstacker(int, int);
void drawCenteredPowerstacker() { drawPowerstacker(20, 4); }


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

x86 assembly (clang, -O2):
<drawCenteredPowerstacker>:
mov    $0x14,%edi
mov    $0x4,%esi
jmp    1030 <drawPowerstacker@plt>

LLVM IR (-O0):
define void @drawCenteredPowerstacker() {
%1 = call i32 @drawPowerstacker(i32 20, i32 4)
ret void
}

LLVM IR (-O2):
define void @drawCenteredPowerstacker() {
%1 = tail call i32 @drawPowerstacker(i32 20, i32 4)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ __uid_t;

/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ __set_errno(int /*<<< orphan*/);
int seteuid(__uid_t uid) {
  __set_errno(ENOSYS);
  return -1;
}


x86 assembly (clang, -O0):
<seteuid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2ec6(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
mov    $0xffffffff,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<seteuid>:
push   %rax
mov    0x2ed0(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@ENOSYS = global i32 0
define i32 @seteuid(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @ENOSYS
%4 = call i32 @__set_errno(i32 %3)
ret i32 -1
}

LLVM IR (-O2):
@ENOSYS = global i32 0
define i32 @seteuid(i32 %0) {
%2 = load i32, i32* @ENOSYS
%3 = tail call i32 @__set_errno(i32 %2)
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void help(char *prog) {
  printf("Usage: %s "
         "[data|bss|stack|stack-exec|malloc-rw|malloc-rw-x|mmap-rw|mmap-rwx|"
         "mmap-rw-x|shm-open-rwx|shmget-rw|shmget-rwx|shmget-rw-x]\n",
         prog);
}


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

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

LLVM IR (-O0):
@.str = [134 x i8] c"Usage: %s [data|bss|stack|stack-exec|malloc-rw|malloc-rw-x|mmap-rw|mmap-rwx|mmap-rw-x|shm-open-rwx|shmget-rw|shmget-rwx|shmget-rw-x]\0A\00"
define void @help(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([134 x i8], [134 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [134 x i8] c"Usage: %s [data|bss|stack|stack-exec|malloc-rw|malloc-rw-x|mmap-rw|mmap-rwx|mmap-rw-x|shm-open-rwx|shmget-rw|shmget-rwx|shmget-rw-x]\0A\00"
define void @help(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([134 x i8], [134 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int f();
int /*<<< orphan*/ printf(char *, int);
main() {
  for (int i = 0; i < 5; i++)
    printf("%d\n", f());
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x5,-0x8(%rbp)
jge    1163 <main+0x43>
mov    $0x0,%al
call   1030 <f@plt>
mov    %eax,%esi
lea    0xeb0(%rip),%rdi
call   1040 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1136 <main+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1030 <f@plt>
lea    0xed1(%rip),%rbx
mov    %rbx,%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
call   1030 <f@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
call   1030 <f@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
call   1030 <f@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
call   1030 <f@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @f()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 (...) @f()
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = tail call i32 (...) @f()
%6 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = tail call i32 (...) @f()
%8 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = tail call i32 (...) @f()
%10 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %9)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ getuid();
int username_is_super() { return !getuid(); }


x86 assembly (clang, -O0):
<username_is_super>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <getuid@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @username_is_super() {
%1 = call i32 (...) @getuid()
%2 = icmp ne i32 %1, 0
%3 = xor i1 %2, true
%4 = zext i1 %3 to i32
ret i32 %4
}

LLVM IR (-O2):
define i32 @username_is_super() {
%1 = tail call i32 (...) @getuid()
%2 = icmp eq i32 %1, 0
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ strlen(char const *);
int /*<<< orphan*/ write(int, char const *, int /*<<< orphan*/);
void memtuner_debug_print(char const *str) {
  if (str != NULL && str[0] != '\n')
    write(1, str, strlen(str));
}


x86 assembly (clang, -O0):
<memtuner_debug_print>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1168 <memtuner_debug_print+0x48>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0xa,%eax
je     1168 <memtuner_debug_print+0x48>
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x10(%rbp),%rsi
mov    %eax,%edx
mov    $0x1,%edi
call   1030 <write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<memtuner_debug_print>:
push   %rbx
test   %rdi,%rdi
je     112e <memtuner_debug_print+0xe>
mov    %rdi,%rbx
cmpb   $0xa,(%rdi)
jne    1130 <memtuner_debug_print+0x10>
pop    %rbx
ret
mov    %rbx,%rdi
call   1040 <strlen@plt>
mov    $0x1,%edi
mov    %rbx,%rsi
mov    %eax,%edx
pop    %rbx
jmp    1030 <write@plt>

LLVM IR (-O0):
define void @memtuner_debug_print(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 %16
5: ; preds = %1
%6 = load i8*, i8** %2
%7 = getelementptr inbounds i8, i8* %6, i64 0
%8 = load i8, i8* %7
%9 = sext i8 %8 to i32
%10 = icmp ne i32 %9, 10
br i1 %10, label %11, label %16
11: ; preds = %5
%12 = load i8*, i8** %2
%13 = load i8*, i8** %2
%14 = call i32 @strlen(i8* %13)
%15 = call i32 @write(i32 1, i8* %12, i32 %14)
br label %16
16: ; preds = %11, %5, %1
ret void
}

LLVM IR (-O2):
define void @memtuner_debug_print(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %9, label %3
3: ; preds = %1
%4 = load i8, i8* %0
%5 = icmp eq i8 %4, 10
br i1 %5, label %9, label %6
6: ; preds = %3
%7 = tail call i32 @strlen(i8* %0)
%8 = tail call i32 @write(i32 1, i8* %0, i32 %7)
br label %9
9: ; preds = %6, %3, %1
ret void
}
/* Variables and functions */
int enable_setting(char *);
int enable_csum() {
  return enable_setting("/proc/sys/net/mptcp/mptcp_checksum");
}


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

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

LLVM IR (-O0):
@.str = [35 x i8] c"/proc/sys/net/mptcp/mptcp_checksum\00"
define i32 @enable_csum() {
%1 = call i32 @enable_setting(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}

LLVM IR (-O2):
@.str = [35 x i8] c"/proc/sys/net/mptcp/mptcp_checksum\00"
define i32 @enable_csum() {
%1 = tail call i32 @enable_setting(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}
int vx_try_skip(struct rq *rq, int cpu) { return 0; }


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

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

LLVM IR (-O0):
%struct.rq = type opaque
define i32 @vx_try_skip(%struct.rq* %0, i32 %1) {
%3 = alloca %struct.rq*
%4 = alloca i32
store %struct.rq* %0, %struct.rq** %3
store i32 %1, i32* %4
ret i32 0
}

LLVM IR (-O2):
%struct.rq = type opaque
define i32 @vx_try_skip(%struct.rq* nocapture readnone %0, i32 %1) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
scalar_t__ mkdir(char *, int);
int /*<<< orphan*/ printf(char *);
int main(int argc, char **argv) {
  if (argc == 1)
    exit(0);
  if (mkdir(argv[1], 0666) < 0)
    printf("make dictionary failed!\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x1,-0x8(%rbp)
jne    1157 <main+0x27>
xor    %edi,%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
mov    $0x1b6,%esi
call   1030 <mkdir@plt>
cmp    $0x0,%rax
jge    117f <main+0x4f>
lea    0xe86(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
cmp    $0x1,%edi
je     1159 <main+0x29>
mov    0x8(%rsi),%rdi
mov    $0x1b6,%esi
call   1030 <mkdir@plt>
test   %rax,%rax
jns    1155 <main+0x25>
lea    0xeb0(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [25 x i8] c"make dictionary failed!\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* %4
%7 = icmp eq i32 %6, 1
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = call i32 @exit(i32 0)
unreachable
10: ; preds = %2
%11 = load i8**, i8*** %5
%12 = getelementptr inbounds i8*, i8** %11, i64 1
%13 = load i8*, i8** %12
%14 = call i64 @mkdir(i8* %13, i32 438)
%15 = icmp slt i64 %14, 0
br i1 %15, label %16, label %18
16: ; preds = %10
%17 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
br label %18
18: ; preds = %16, %10
ret i32 0
}

LLVM IR (-O2):
@str = [24 x i8] c"make dictionary failed!\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 1
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i32 @exit(i32 0)
unreachable
6: ; preds = %2
%7 = getelementptr inbounds i8*, i8** %1, i64 1
%8 = load i8*, i8** %7
%9 = tail call i64 @mkdir(i8* %8, i32 438)
%10 = icmp slt i64 %9, 0
br i1 %10, label %11, label %13
11: ; preds = %6
%12 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str, i64 0, i64 0))
br label %13
13: ; preds = %11, %6
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ arm_memio_regdh_op();
int /*<<< orphan*/ arm_memio_strh(int /*<<< orphan*/);
void arm_strh_reg() { arm_memio_strh(arm_memio_regdh_op()); }


x86 assembly (clang, -O0):
<arm_strh_reg>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <arm_memio_regdh_op@plt>
mov    %eax,%edi
call   1030 <arm_memio_strh@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<arm_strh_reg>:
push   %rax
xor    %eax,%eax
call   1040 <arm_memio_regdh_op@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <arm_memio_strh@plt>

LLVM IR (-O0):
define void @arm_strh_reg() {
%1 = call i32 (...) @arm_memio_regdh_op()
%2 = call i32 @arm_memio_strh(i32 %1)
ret void
}

LLVM IR (-O2):
define void @arm_strh_reg() {
%1 = tail call i32 (...) @arm_memio_regdh_op()
%2 = tail call i32 @arm_memio_strh(i32 %1)
ret void
}
int test_imm_99int16_mem(short *val) {
  return ((*val) & (0x99 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_99int16_mem(i16* %0) {
%2 = alloca i16*
store i16* %0, i16** %2
%3 = load i16*, i16** %2
%4 = load i16, i16* %3
%5 = sext i16 %4 to i32
%6 = and i32 %5, 153
%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_99int16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, 153
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
int qsort_int_cmp(const void *x, const void *y) {
  if (*((int *)x) < *((int *)y))
    return (-1);
  else
    return (*((int *)x) > *((int *)y));
}


x86 assembly (clang, -O0):
<qsort_int_cmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    -0x18(%rbp),%rcx
cmp    (%rcx),%eax
jge    112a <qsort_int_cmp+0x2a>
movl   $0xffffffff,-0x4(%rbp)
jmp    1141 <qsort_int_cmp+0x41>
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    -0x18(%rbp),%rcx
cmp    (%rcx),%eax
setg   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<qsort_int_cmp>:
mov    (%rdi),%eax
xor    %ecx,%ecx
cmp    (%rsi),%eax
setg   %cl
mov    $0xffffffff,%eax
cmovge %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @qsort_int_cmp(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = icmp slt i32 %4, %6
%8 = icmp sgt i32 %4, %6
%9 = zext i1 %8 to i32
%10 = select i1 %7, i32 -1, i32 %9
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ bgaputch(char);
void bgaputs(char *str) {
  int i = 0;
  while (str[i]) {
    bgaputch(str[i++]);
  }
}


x86 assembly (clang, -O0):
<bgaputs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
cmpb   $0x0,(%rax,%rcx,1)
je     1155 <bgaputs+0x45>
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
mov    %ecx,%edx
add    $0x1,%edx
mov    %edx,-0xc(%rbp)
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%edi
call   1030 <bgaputch@plt>
jmp    1123 <bgaputs+0x13>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bgaputs>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1133 <bgaputs+0x23>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movsbl %al,%edi
call   1030 <bgaputch@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <bgaputs+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @bgaputs(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 i64 [ %7, %4 ], [ 0, %1 ]
%6 = phi i8 [ %10, %4 ], [ %2, %1 ]
%7 = add nuw i64 %5, 1
%8 = tail call i32 @bgaputch(i8 signext %6)
%9 = getelementptr inbounds i8, i8* %0, i64 %7
%10 = load i8, i8* %9
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %4
12: ; preds = %4, %1
ret void
}
void INT_Excep_PERIB_INTB194(void) {}


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

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

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

LLVM IR (-O2):
define void @INT_Excep_PERIB_INTB194() {
ret void
}
void swap_chars(char *c1, char *c2) {
  char temp = *c1;
  *c1 = *c2;
  *c2 = temp;
}


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

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

LLVM IR (-O0):
define void @swap_chars(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
%7 = load i8, i8* %6
store i8 %7, i8* %5
%8 = load i8*, i8** %4
%9 = load i8, i8* %8
%10 = load i8*, i8** %3
store i8 %9, i8* %10
%11 = load i8, i8* %5
%12 = load i8*, i8** %4
store i8 %11, i8* %12
ret void
}

LLVM IR (-O2):
define void @swap_chars(i8* nocapture %0, i8* nocapture %1) {
%3 = load i8, i8* %0
%4 = load i8, i8* %1
store i8 %4, i8* %0
store i8 %3, i8* %1
ret void
}
char *removeFirstChar(char *a) { return a + 1; }


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

x86 assembly (clang, -O2):
<removeFirstChar>:
lea    0x1(%rdi),%rax
ret

LLVM IR (-O0):
define i8* @removeFirstChar(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 1
ret i8* %4
}

LLVM IR (-O2):
define i8* @removeFirstChar(i8* readnone %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 1
ret i8* %2
}
int HelpItem44(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @HelpItem44() {
ret i32 0
}
int main() {
  char *v = "Hong Gil Dong";
  printf("%.*s\n", 4, v + 3);
}


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

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

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

LLVM IR (-O2):
@.str = [14 x i8] c"Hong Gil Dong\00"
@.str.1 = [6 x i8] c"%.*s\0A\00"
define i32 @main() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32 4, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 3))
ret i32 0
}
int test_imm_6Cint8_mem(signed char *val) {
  return ((*val) & (-0x6C << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_6Cint8_mem(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = and i32 %5, -108
%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_6Cint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, -108
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}