xunge/DecIR huggingface dataset:
char *kr_event_api_name(void) { return "select"; }


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

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

LLVM IR (-O0):
@.str = [7 x i8] c"select\00"
define i8* @kr_event_api_name() {
ret i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [7 x i8] c"select\00"
define i8* @kr_event_api_name() {
ret i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0)
}
void f2fs_destroy_iostat(struct f2fs_sb_info *sbi) {}


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

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

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

LLVM IR (-O2):
%struct.f2fs_sb_info = type opaque
define void @f2fs_destroy_iostat(%struct.f2fs_sb_info* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void *thread_test(void *ptr) {
  while (1)
    printf("i am pthread\n");
}


x86 assembly (clang, -O0):
<thread_test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rdi
call   1030 <printf@plt>
jmp    111c <thread_test+0xc>

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

LLVM IR (-O0):
@.str = [14 x i8] c"i am pthread\0A\00"
define i8* @thread_test(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %1, %3
%4 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %3
}

LLVM IR (-O2):
@str = [13 x i8] c"i am pthread\00"
define noalias i8* @thread_test(i8* nocapture readnone %0) {
br label %2
2: ; preds = %1, %2
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
br label %2
}
/* Variables and functions */
size_t strlen(char const *);
size_t safe_strlen(const char *str) {
  if (str) {
    return strlen(str);
  }
  return 0;
}


x86 assembly (clang, -O0):
<safe_strlen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1139 <safe_strlen+0x29>
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,-0x8(%rbp)
jmp    1141 <safe_strlen+0x31>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i64 @safe_strlen(i8* %0) {
%2 = alloca i64
%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 %9
6: ; preds = %1
%7 = load i8*, i8** %3
%8 = call i64 @strlen(i8* %7)
store i64 %8, i64* %2
br label %10
9: ; preds = %1
store i64 0, i64* %2
br label %10
10: ; preds = %9, %6
%11 = load i64, i64* %2
ret i64 %11
}

LLVM IR (-O2):
define i64 @safe_strlen(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i64 @strlen(i8* %0)
br label %5
5: ; preds = %1, %3
%6 = phi i64 [ %4, %3 ], [ 0, %1 ]
ret i64 %6
}
int iscntrl(int c) { return (c >= 0x0 && c <= 0x1f) || 0x7f; }


x86 assembly (clang, -O0):
<iscntrl>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jl     1120 <iscntrl+0x20>
mov    $0x1,%al
cmpl   $0x1f,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jle    112a <iscntrl+0x2a>
mov    $0x1,%al
mov    %al,-0x5(%rbp)
jmp    112a <iscntrl+0x2a>
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @iscntrl(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 31
br i1 %7, label %9, label %8
8: ; preds = %5, %1
br label %9
9: ; preds = %8, %5
%10 = phi i1 [ true, %5 ], [ true, %8 ]
%11 = zext i1 %10 to i32
ret i32 %11
}

LLVM IR (-O2):
define i32 @iscntrl(i32 %0) {
ret i32 1
}
/* Type definitions */
struct rlimit {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ RLIMIT_NPROC;
int /*<<< orphan*/ getrlimit(int /*<<< orphan*/, struct rlimit *);
struct rlimit tp_info_sysmaxthreads() {
  struct rlimit limit;
  getrlimit(RLIMIT_NPROC, &limit);
  return limit;
}


x86 assembly (clang, -O0):
<tp_info_sysmaxthreads>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    -0x8(%rbp),%rsi
call   1030 <getrlimit@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tp_info_sysmaxthreads>:
push   %rax
mov    0x2ed0(%rip),%rax
mov    (%rax),%edi
mov    %rsp,%rsi
call   1030 <getrlimit@plt>
mov    (%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.rlimit = type { i32 }
@RLIMIT_NPROC = global i32 0
define i32 @tp_info_sysmaxthreads() {
%1 = alloca %struct.rlimit
%2 = load i32, i32* @RLIMIT_NPROC
%3 = call i32 @getrlimit(i32 %2, %struct.rlimit* %1)
%4 = getelementptr inbounds %struct.rlimit, %struct.rlimit* %1, i32 0, i32 0
%5 = load i32, i32* %4
ret i32 %5
}

LLVM IR (-O2):
%struct.rlimit = type { i32 }
@RLIMIT_NPROC = global i32 0
define i32 @tp_info_sysmaxthreads() {
%1 = alloca %struct.rlimit
%2 = load i32, i32* @RLIMIT_NPROC
%3 = call i32 @getrlimit(i32 %2, %struct.rlimit* %1)
%4 = getelementptr inbounds %struct.rlimit, %struct.rlimit* %1, i64 0, i32 0
%5 = load i32, i32* %4
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void print_hex(char *str, int len) {
  for (int i = 0; i < len; i++)
    printf("%x", (unsigned char)str[i]);
  printf("\n");
}


x86 assembly (clang, -O0):
<print_hex>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    115a <print_hex+0x4a>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movzbl (%rax,%rcx,1),%esi
lea    0xebb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <print_hex+0x16>
lea    0xea2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_hex>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1158 <print_hex+0x38>
mov    %rdi,%r15
mov    %esi,%r12d
lea    0xec7(%rip),%r14
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
movzbl (%r15,%rbx,1),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1140 <print_hex+0x20>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
@.str = [3 x i8] c"%x\00"
define void @print_hex(i8* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %8
6: ; preds = %8, %2
%7 = tail call i32 @putchar(i32 10)
ret void
8: ; preds = %4, %8
%9 = phi i64 [ 0, %4 ], [ %14, %8 ]
%10 = getelementptr inbounds i8, i8* %0, i64 %9
%11 = load i8, i8* %10
%12 = zext i8 %11 to i32
%13 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %12)
%14 = add nuw nsw i64 %9, 1
%15 = icmp eq i64 %14, %5
br i1 %15, label %6, label %8
}
/* Variables and functions */
int isdigit(unsigned char);
int isDigit(const char *ptr) { return isdigit(*(unsigned char *)ptr); }


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

x86 assembly (clang, -O2):
<isDigit>:
movzbl (%rdi),%edi
jmp    1030 <isdigit@plt>

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

LLVM IR (-O2):
define i32 @isDigit(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = tail call i32 @isdigit(i8 zeroext %2)
ret i32 %3
}
/* Variables and functions */
int find(int *, int);
int test_many_elements() {
  int array[] = {1, 5, 8, 3, 1, 1, 8, 5, 5, 8};
  return 3 == find(array, 10);
}


x86 assembly (clang, -O0):
<test_many_elements>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
lea    -0x30(%rbp),%rdi
lea    0xecd(%rip),%rsi
mov    $0x28,%edx
call   1030 <memcpy@plt>
lea    -0x30(%rbp),%rdi
mov    $0xa,%esi
call   1040 <find@plt>
mov    %eax,%ecx
mov    $0x3,%eax
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_many_elements>:
sub    $0x28,%rsp
mov    0xf05(%rip),%rax
mov    %rax,0x20(%rsp)
movaps 0xee9(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xecd(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
mov    $0xa,%esi
call   1030 <find@plt>
xor    %ecx,%ecx
cmp    $0x3,%eax
sete   %cl
mov    %ecx,%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
@__const.test_many_elements.array = [10 x i32] [i32 1, i32 5, i32 8, i32 3, i32 1, i32 1, i32 8, i32 5, i32 5, i32 8]
define i32 @test_many_elements() {
%1 = alloca [10 x i32]
%2 = bitcast [10 x i32]* %1 to i8*
%3 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
%4 = call i32 @find(i32* %3, i32 10)
%5 = icmp eq i32 3, %4
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
@__const.test_many_elements.array = [10 x i32] [i32 1, i32 5, i32 8, i32 3, i32 1, i32 1, i32 8, i32 5, i32 5, i32 8]
define i32 @test_many_elements() {
%1 = alloca [10 x i32]
%2 = bitcast [10 x i32]* %1 to i8*
%3 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
%4 = call i32 @find(i32* %3, i32 10)
%5 = icmp eq i32 %4, 3
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
bool nrf53_errata_18(void) { return false; }


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

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

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

LLVM IR (-O2):
define i32 @nrf53_errata_18() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void GiveInstructions(void) {
  printf("This program displays a calendar for a full year.\n");
}


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

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

LLVM IR (-O0):
@.str = [51 x i8] c"This program displays a calendar for a full year.\0A\00"
define void @GiveInstructions() {
%1 = call i32 @printf(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [50 x i8] c"This program displays a calendar for a full year.\00"
define void @GiveInstructions() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([50 x i8], [50 x i8]* @str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int read_s16b(int /*<<< orphan*/ *);
int read_s16l(int /*<<< orphan*/ *);
int read_s16(FILE *fp, int e) {
  return (e & 1) ? read_s16b(fp) : read_s16l(fp);
}


x86 assembly (clang, -O0):
<read_s16>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     114f <read_s16+0x2f>
mov    -0x8(%rbp),%rdi
call   1040 <read_s16b@plt>
mov    %eax,-0x10(%rbp)
jmp    115b <read_s16+0x3b>
mov    -0x8(%rbp),%rdi
call   1030 <read_s16l@plt>
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_s16>:
test   $0x1,%sil
jne    112b <read_s16+0xb>
jmp    1030 <read_s16l@plt>
jmp    1040 <read_s16b@plt>

LLVM IR (-O0):
define i32 @read_s16(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = and i32 %5, 1
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %11
8: ; preds = %2
%9 = load i32*, i32** %3
%10 = call i32 @read_s16b(i32* %9)
br label %14
11: ; preds = %2
%12 = load i32*, i32** %3
%13 = call i32 @read_s16l(i32* %12)
br label %14
14: ; preds = %11, %8
%15 = phi i32 [ %10, %8 ], [ %13, %11 ]
ret i32 %15
}

LLVM IR (-O2):
define i32 @read_s16(i32* %0, i32 %1) {
%3 = and i32 %1, 1
%4 = icmp eq i32 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 @read_s16b(i32* %0)
br label %9
7: ; preds = %2
%8 = tail call i32 @read_s16l(i32* %0)
br label %9
9: ; preds = %7, %5
%10 = phi i32 [ %6, %5 ], [ %8, %7 ]
ret i32 %10
}
/* Type definitions */
struct page {
  int dummy;
};

/* Variables and functions */
void *page_address(struct page *);
int /*<<< orphan*/ pagefault_disable();
int /*<<< orphan*/ preempt_disable();
void *kmap_atomic(struct page *page) {
  preempt_disable();
  pagefault_disable();
  return page_address(page);
}


x86 assembly (clang, -O0):
<kmap_atomic>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1050 <preempt_disable@plt>
mov    $0x0,%al
call   1030 <pagefault_disable@plt>
mov    -0x8(%rbp),%rdi
call   1040 <page_address@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<kmap_atomic>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1050 <preempt_disable@plt>
xor    %eax,%eax
call   1030 <pagefault_disable@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <page_address@plt>

LLVM IR (-O0):
%struct.page = type { i32 }
define i8* @kmap_atomic(%struct.page* %0) {
%2 = alloca %struct.page*
store %struct.page* %0, %struct.page** %2
%3 = call i32 (...) @preempt_disable()
%4 = call i32 (...) @pagefault_disable()
%5 = load %struct.page*, %struct.page** %2
%6 = call i8* @page_address(%struct.page* %5)
ret i8* %6
}

LLVM IR (-O2):
%struct.page = type { i32 }
define i8* @kmap_atomic(%struct.page* %0) {
%2 = tail call i32 (...) @preempt_disable()
%3 = tail call i32 (...) @pagefault_disable()
%4 = tail call i8* @page_address(%struct.page* %0)
ret i8* %4
}
int bibl_illegaloutmode(int mode) {
  if (mode < (200) || mode > ((200) + 8))
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<bibl_illegaloutmode>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0xc8,-0x8(%rbp)
jl     1121 <bibl_illegaloutmode+0x21>
cmpl   $0xd0,-0x8(%rbp)
jle    112d <bibl_illegaloutmode+0x2d>
movl   $0x1,-0x4(%rbp)
jmp    1134 <bibl_illegaloutmode+0x34>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bibl_illegaloutmode>:
add    $0xffffff2f,%edi
xor    %eax,%eax
cmp    $0xfffffff7,%edi
setb   %al
ret

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

LLVM IR (-O2):
define i32 @bibl_illegaloutmode(i32 %0) {
%2 = add i32 %0, -209
%3 = icmp ult i32 %2, -9
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ WINDOW;

/* Variables and functions */
int /*<<< orphan*/ COLOR_PAIR(int);
int /*<<< orphan*/ wattron(int /*<<< orphan*/ *, int /*<<< orphan*/);
void wcoloron(WINDOW *win, int fg, int bg) {
  wattron(win, COLOR_PAIR((fg << 4) | (bg << 0)));
}


x86 assembly (clang, -O0):
<wcoloron>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%edi
shl    $0x4,%edi
mov    -0x10(%rbp),%eax
shl    $0x0,%eax
or     %eax,%edi
call   1030 <COLOR_PAIR@plt>
mov    -0x18(%rbp),%rdi
mov    %eax,%esi
call   1040 <wattron@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wcoloron>:
push   %rbx
mov    %rdi,%rbx
shl    $0x4,%esi
or     %edx,%esi
mov    %esi,%edi
call   1030 <COLOR_PAIR@plt>
mov    %rbx,%rdi
mov    %eax,%esi
pop    %rbx
jmp    1040 <wattron@plt>

LLVM IR (-O0):
define void @wcoloron(i32* %0, i32 %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
store i32* %0, i32** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32*, i32** %4
%8 = load i32, i32* %5
%9 = shl i32 %8, 4
%10 = load i32, i32* %6
%11 = shl i32 %10, 0
%12 = or i32 %9, %11
%13 = call i32 @COLOR_PAIR(i32 %12)
%14 = call i32 @wattron(i32* %7, i32 %13)
ret void
}

LLVM IR (-O2):
define void @wcoloron(i32* %0, i32 %1, i32 %2) {
%4 = shl i32 %1, 4
%5 = or i32 %4, %2
%6 = tail call i32 @COLOR_PAIR(i32 %5)
%7 = tail call i32 @wattron(i32* %0, i32 %6)
ret void
}
void ata_acpi_bind_port(struct ata_port *ap) {}


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

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

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

LLVM IR (-O2):
%struct.ata_port = type opaque
define void @ata_acpi_bind_port(%struct.ata_port* nocapture %0) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int bit_get(int /*<<< orphan*/ const *, int);
int /*<<< orphan*/ printf(char *, int);
void bit_dump(const uint32_t *bitmap, int bits) {
  int i;
  for (i = 0; i < bits; i++)
    printf("%c", bit_get(bitmap, (bits - 1) - i) + '0');
}


x86 assembly (clang, -O0):
<bit_dump>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1173 <bit_dump+0x53>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
sub    $0x1,%esi
sub    -0x10(%rbp),%esi
call   1040 <bit_get@plt>
mov    %eax,%esi
add    $0x30,%esi
lea    0xea0(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1136 <bit_dump+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bit_dump>:
push   %r15
push   %r14
push   %rbx
test   %esi,%esi
jle    115a <bit_dump+0x3a>
mov    %esi,%ebx
mov    %rdi,%r14
add    $0xffffffff,%ebx
lea    0xec8(%rip),%r15
nopl   0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    %ebx,%esi
call   1040 <bit_get@plt>
lea    0x30(%rax),%esi
mov    %r15,%rdi
call   1030 <printf@plt>
add    $0xffffffff,%ebx
jb     1140 <bit_dump+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%c\00"
define void @bit_dump(i32* %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %13
4: ; preds = %2, %4
%5 = phi i32 [ %11, %4 ], [ 0, %2 ]
%6 = xor i32 %5, -1
%7 = add i32 %6, %1
%8 = tail call i32 @bit_get(i32* %0, i32 %7)
%9 = add nsw i32 %8, 48
%10 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = add nuw nsw i32 %5, 1
%12 = icmp eq i32 %11, %1
br i1 %12, label %13, label %4
13: ; preds = %4, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
main() { printf("%d\n", (4) * (5)); }


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

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

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

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


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

x86 assembly (clang, -O2):
<f169>:
jmp    1030 <f168@plt>

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

LLVM IR (-O2):
define i32 @f169(i32* %0) {
%2 = tail call i32 @f168(i32* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ Send_MPlayer_Command(int, int /*<<< orphan*/);
void MPlayer_Prev() { Send_MPlayer_Command(0x01, 0); }


x86 assembly (clang, -O0):
<MPlayer_Prev>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
xor    %esi,%esi
call   1030 <Send_MPlayer_Command@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<MPlayer_Prev>:
mov    $0x1,%edi
xor    %esi,%esi
jmp    1030 <Send_MPlayer_Command@plt>

LLVM IR (-O0):
define void @MPlayer_Prev() {
%1 = call i32 @Send_MPlayer_Command(i32 1, i32 0)
ret void
}

LLVM IR (-O2):
define void @MPlayer_Prev() {
%1 = tail call i32 @Send_MPlayer_Command(i32 1, i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
void _CATCAT_Xlen(void) {
  fputs("Length error: dynamic array too long\n", stderr);
  abort();
}


x86 assembly (clang, -O0):
<_CATCAT_Xlen>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%esi
lea    0xecc(%rip),%rdi
call   1040 <fputs@plt>
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<_CATCAT_Xlen>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%esi
lea    0xecf(%rip),%rdi
call   1040 <fputs@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@.str = [38 x i8] c"Length error: dynamic array too long\0A\00"
@stderr = global i32 0
define void @_CATCAT_Xlen() {
%1 = load i32, i32* @stderr
%2 = call i32 @fputs(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
@.str = [38 x i8] c"Length error: dynamic array too long\0A\00"
@stderr = global i32 0
define void @_CATCAT_Xlen() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fputs(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 (...) @abort()
unreachable
}
void func41() {
  char var_41[16];
  var_41[15] = 0x41;
}


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

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

LLVM IR (-O0):
define void @func41() {
%1 = alloca [16 x i8]
%2 = getelementptr inbounds [16 x i8], [16 x i8]* %1, i64 0, i64 15
store i8 65, i8* %2
ret void
}

LLVM IR (-O2):
define void @func41() {
ret void
}
void select_excalibur_mode(int *line) { (void)line; }


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

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

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

LLVM IR (-O2):
define void @select_excalibur_mode(i32* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Msp430GpioC__12__GeneralIO__makeInput();
void HplSensirionSht11P__DATA__makeInput(void) {
  Msp430GpioC__12__GeneralIO__makeInput();
}


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

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

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

LLVM IR (-O2):
define void @HplSensirionSht11P__DATA__makeInput() {
%1 = tail call i32 (...) @Msp430GpioC__12__GeneralIO__makeInput()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ getword(char, int /*<<< orphan*/);
Flcomment() { getword('\n', 0); }


x86 assembly (clang, -O0):
<Flcomment>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0xa,%edi
xor    %esi,%esi
call   1030 <getword@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Flcomment>:
mov    $0xa,%edi
xor    %esi,%esi
jmp    1030 <getword@plt>

LLVM IR (-O0):
define i32 @Flcomment() {
%1 = alloca i32
%2 = call i32 @getword(i8 signext 10, i32 0)
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
define i32 @Flcomment() {
%1 = tail call i32 @getword(i8 signext 10, i32 0)
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ pendfunc();
int main(void) {
  pendfunc();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @pendfunc()
ret i32 0
}
int incY(int initX, int initY, int numX, int numY) {
  int y = initY + 1;
  if (y == numY)
    return 0;
  else
    return y;
}


x86 assembly (clang, -O0):
<incY>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jne    1131 <incY+0x31>
movl   $0x0,-0x4(%rbp)
jmp    1137 <incY+0x37>
mov    -0x18(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<incY>:
lea    0x1(%rsi),%edx
xor    %eax,%eax
cmp    %ecx,%edx
cmovne %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @incY(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = add nsw i32 %1, 1
%6 = icmp eq i32 %5, %3
%7 = select i1 %6, i32 0, i32 %5
ret i32 %7
}
/* Variables and functions */
int key_length(char *);
char *key_length_01a() {
  char phrase[] =
      "zyzzyvas flutings mushers octopuses bizones talkier evokers coagent "
      "ringer neutral antipode omnibus havening whistles mistitled vacuums";
  do {
    if (!(key_length(phrase) == 64))
      return "return 64 for a 16 word phrase";
  } while (0);
  return 0;
}


x86 assembly (clang, -O0):
<key_length_01a>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
lea    -0x90(%rbp),%rdi
lea    0xec7(%rip),%rsi
mov    $0x88,%edx
call   1030 <memcpy@plt>
lea    -0x90(%rbp),%rdi
call   1040 <key_length@plt>
cmp    $0x40,%eax
je     1168 <key_length_01a+0x48>
lea    0xf29(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1175 <key_length_01a+0x55>
jmp    116d <key_length_01a+0x4d>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<key_length_01a>:
push   %rbx
sub    $0x90,%rsp
lea    0xed1(%rip),%rsi
mov    %rsp,%rbx
mov    $0x88,%edx
mov    %rbx,%rdi
call   1030 <memcpy@plt>
mov    %rbx,%rdi
call   1040 <key_length@plt>
xor    %ecx,%ecx
cmp    $0x40,%eax
lea    0xf35(%rip),%rax
cmovne %rax,%rcx
mov    %rcx,%rax
add    $0x90,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.key_length_01a.phrase = [136 x i8] c"zyzzyvas flutings mushers octopuses bizones talkier evokers coagent ringer neutral antipode omnibus havening whistles mistitled vacuums\00"
@.str = [31 x i8] c"return 64 for a 16 word phrase\00"
define i8* @key_length_01a() {
%1 = alloca i8*
%2 = alloca [136 x i8]
%3 = bitcast [136 x i8]* %2 to i8*
br label %4
4: ; preds = %0
%5 = getelementptr inbounds [136 x i8], [136 x i8]* %2, i64 0, i64 0
%6 = call i32 @key_length(i8* %5)
%7 = icmp eq i32 %6, 64
br i1 %7, label %9, label %8
8: ; preds = %4
store i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i8** %1
br label %11
9: ; preds = %4
br label %10
10: ; preds = %9
store i8* null, i8** %1
br label %11
11: ; preds = %10, %8
%12 = load i8*, i8** %1
ret i8* %12
}

LLVM IR (-O2):
@__const.key_length_01a.phrase = [136 x i8] c"zyzzyvas flutings mushers octopuses bizones talkier evokers coagent ringer neutral antipode omnibus havening whistles mistitled vacuums\00"
@.str = [31 x i8] c"return 64 for a 16 word phrase\00"
define i8* @key_length_01a() {
%1 = alloca [136 x i8]
%2 = getelementptr inbounds [136 x i8], [136 x i8]* %1, i64 0, i64 0
%3 = call i32 @key_length(i8* %2)
%4 = icmp eq i32 %3, 64
%5 = select i1 %4, i8* null, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0)
ret i8* %5
}
/* Variables and functions */
scalar_t__ isDiff20Upper(int);
scalar_t__ isEvenOddUpper(int);
int toLower(int cr) {
  if (isDiff20Upper(cr)) {
    cr += 0x20;
  } else if (isEvenOddUpper(cr)) {
    ++cr;
  } else if (cr == 0x178) {
    cr = 0xFF;
  }
  return cr;
}


x86 assembly (clang, -O0):
<toLower>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <isDiff20Upper@plt>
cmp    $0x0,%rax
je     114b <toLower+0x2b>
mov    -0x4(%rbp),%eax
add    $0x20,%eax
mov    %eax,-0x4(%rbp)
jmp    1189 <toLower+0x69>
mov    -0x4(%rbp),%edi
call   1030 <isEvenOddUpper@plt>
cmp    $0x0,%rax
je     116b <toLower+0x4b>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1184 <toLower+0x64>
cmpl   $0x178,-0x4(%rbp)
jne    117f <toLower+0x5f>
movl   $0xff,-0x4(%rbp)
jmp    1184 <toLower+0x64>
jmp    1189 <toLower+0x69>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<toLower>:
push   %rbx
mov    %edi,%ebx
call   1040 <isDiff20Upper@plt>
test   %rax,%rax
je     1132 <toLower+0x12>
add    $0x20,%ebx
jmp    1151 <toLower+0x31>
mov    %ebx,%edi
call   1030 <isEvenOddUpper@plt>
test   %rax,%rax
je     1143 <toLower+0x23>
add    $0x1,%ebx
jmp    1151 <toLower+0x31>
cmp    $0x178,%ebx
mov    $0xff,%eax
cmove  %eax,%ebx
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @toLower(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i64 @isDiff20Upper(i32 %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load i32, i32* %2
%8 = add nsw i32 %7, 32
store i32 %8, i32* %2
br label %22
9: ; preds = %1
%10 = load i32, i32* %2
%11 = call i64 @isEvenOddUpper(i32 %10)
%12 = icmp ne i64 %11, 0
br i1 %12, label %13, label %16
13: ; preds = %9
%14 = load i32, i32* %2
%15 = add nsw i32 %14, 1
store i32 %15, i32* %2
br label %21
16: ; preds = %9
%17 = load i32, i32* %2
%18 = icmp eq i32 %17, 376
br i1 %18, label %19, label %20
19: ; preds = %16
store i32 255, i32* %2
br label %20
20: ; preds = %19, %16
br label %21
21: ; preds = %20, %13
br label %22
22: ; preds = %21, %6
%23 = load i32, i32* %2
ret i32 %23
}

LLVM IR (-O2):
define i32 @toLower(i32 %0) {
%2 = tail call i64 @isDiff20Upper(i32 %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = add nsw i32 %0, 32
br label %14
6: ; preds = %1
%7 = tail call i64 @isEvenOddUpper(i32 %0)
%8 = icmp eq i64 %7, 0
br i1 %8, label %11, label %9
9: ; preds = %6
%10 = add nsw i32 %0, 1
br label %14
11: ; preds = %6
%12 = icmp eq i32 %0, 376
%13 = select i1 %12, i32 255, i32 %0
br label %14
14: ; preds = %9, %11, %4
%15 = phi i32 [ %5, %4 ], [ %10, %9 ], [ %13, %11 ]
ret i32 %15
}
/* Variables and functions */
int backup_sync_msg(int, int, int, void *, int);
int Backup_protect(int mode, void *overwrite_data, int size) {
  return backup_sync_msg(25, 3, mode, overwrite_data, size);
}


x86 assembly (clang, -O0):
<Backup_protect>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%edx
mov    -0x10(%rbp),%rcx
mov    -0x14(%rbp),%r8d
mov    $0x19,%edi
mov    $0x3,%esi
call   1030 <backup_sync_msg@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Backup_protect>:
mov    %edx,%r8d
mov    %rsi,%rcx
mov    %edi,%edx
mov    $0x19,%edi
mov    $0x3,%esi
jmp    1030 <backup_sync_msg@plt>

LLVM IR (-O0):
define i32 @Backup_protect(i32 %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
store i32 %0, i32* %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load i8*, i8** %5
%9 = load i32, i32* %6
%10 = call i32 @backup_sync_msg(i32 25, i32 3, i32 %7, i8* %8, i32 %9)
ret i32 %10
}

LLVM IR (-O2):
define i32 @Backup_protect(i32 %0, i8* %1, i32 %2) {
%4 = tail call i32 @backup_sync_msg(i32 25, i32 3, i32 %0, i8* %1, i32 %2)
ret i32 %4
}
/* Variables and functions */
char *get_message();
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ set_message(char *);
int main() {
  set_message("hello, world");
  printf("%s\n", get_message());
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
call   1050 <set_message@plt>
mov    $0x0,%al
call   1030 <get_message@plt>
mov    %rax,%rsi
lea    0xeb1(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
call   1050 <set_message@plt>
xor    %eax,%eax
call   1030 <get_message@plt>
lea    0xec2(%rip),%rdi
mov    %rax,%rsi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [13 x i8] c"hello, world\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = tail call i32 @set_message(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%2 = tail call i8* (...) @get_message()
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %2)
ret i32 0
}
/* Type definitions */
struct iw_csdescr {
  int dummy;
};

/* Variables and functions */
scalar_t__ x_to_linear_sample(double, struct iw_csdescr const *);
double iw_convert_sample_to_linear(double v, const struct iw_csdescr *csdescr) {
  return (double)x_to_linear_sample(v, csdescr);
}


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

x86 assembly (clang, -O2):
<iw_convert_sample_to_linear>:
push   %rax
call   1030 <x_to_linear_sample@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
pop    %rax
ret

LLVM IR (-O0):
%struct.iw_csdescr = type { i32 }
define double @iw_convert_sample_to_linear(double %0, %struct.iw_csdescr* %1) {
%3 = alloca double
%4 = alloca %struct.iw_csdescr*
store double %0, double* %3
store %struct.iw_csdescr* %1, %struct.iw_csdescr** %4
%5 = load double, double* %3
%6 = load %struct.iw_csdescr*, %struct.iw_csdescr** %4
%7 = call i64 @x_to_linear_sample(double %5, %struct.iw_csdescr* %6)
%8 = sitofp i64 %7 to double
ret double %8
}

LLVM IR (-O2):
%struct.iw_csdescr = type { i32 }
define double @iw_convert_sample_to_linear(double %0, %struct.iw_csdescr* %1) {
%3 = tail call i64 @x_to_linear_sample(double %0, %struct.iw_csdescr* %1)
%4 = sitofp i64 %3 to double
ret double %4
}
void foo207() {}


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

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

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

LLVM IR (-O2):
define void @foo207() {
ret void
}
int functionCalled(void) { return (0x5A); }


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

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

LLVM IR (-O0):
define i32 @functionCalled() {
ret i32 90
}

LLVM IR (-O2):
define i32 @functionCalled() {
ret i32 90
}
/* Variables and functions */
int test2(int);
int test4() {
  int a, b;
  return test2(4);
}


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

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

LLVM IR (-O0):
define i32 @test4() {
%1 = alloca i32
%2 = alloca i32
%3 = call i32 @test2(i32 4)
ret i32 %3
}

LLVM IR (-O2):
define i32 @test4() {
%1 = tail call i32 @test2(i32 4)
ret i32 %1
}
void HibernateIntEnable(unsigned long ulIntFlags) {

  ;
  (*((volatile unsigned long *)(0x400FC014))) |= ulIntFlags;
}


x86 assembly (clang, -O0):
<HibernateIntEnable>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    $0x400fc014,%ecx
mov    (%rcx),%rcx
or     %rax,%rcx
mov    $0x400fc014,%eax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<HibernateIntEnable>:
or     %rdi,0x400fc014
40
ret

LLVM IR (-O0):
define void @HibernateIntEnable(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = load volatile i64, i64* inttoptr (i64 1074774036 to i64*)
%5 = or i64 %4, %3
store volatile i64 %5, i64* inttoptr (i64 1074774036 to i64*)
ret void
}

LLVM IR (-O2):
define void @HibernateIntEnable(i64 %0) {
%2 = load volatile i64, i64* inttoptr (i64 1074774036 to i64*)
%3 = or i64 %2, %0
store volatile i64 %3, i64* inttoptr (i64 1074774036 to i64*)
ret void
}
/* Type definitions */
struct stat {
  double st_size;
};

/* Variables and functions */
int /*<<< orphan*/ fstat(int, struct stat *);
double size_file(void *pvFile) {
  struct stat st;
  if (!fstat(*(int *)pvFile, &st))
    return st.st_size;
  return 1024;
}


x86 assembly (clang, -O0):
<size_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%edi
lea    -0x18(%rbp),%rsi
call   1030 <fstat@plt>
cmp    $0x0,%eax
jne    1143 <size_file+0x33>
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1150 <size_file+0x40>
movsd  0xeb5(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<size_file>:
push   %rax
mov    (%rdi),%edi
mov    %rsp,%rsi
call   1030 <fstat@plt>
test   %eax,%eax
je     1129 <size_file+0x19>
movsd  0xed9(%rip),%xmm0
pop    %rax
ret
movsd  (%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
%struct.stat = type { double }
define double @size_file(i8* %0) {
%2 = alloca double
%3 = alloca i8*
%4 = alloca %struct.stat
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = bitcast i8* %5 to i32*
%7 = load i32, i32* %6
%8 = call i32 @fstat(i32 %7, %struct.stat* %4)
%9 = icmp ne i32 %8, 0
br i1 %9, label %13, label %10
10: ; preds = %1
%11 = getelementptr inbounds %struct.stat, %struct.stat* %4, i32 0, i32 0
%12 = load double, double* %11
store double %12, double* %2
br label %14
13: ; preds = %1
store double 1.024000e+03, double* %2
br label %14
14: ; preds = %13, %10
%15 = load double, double* %2
ret double %15
}

LLVM IR (-O2):
%struct.stat = type { double }
define double @size_file(i8* nocapture %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = bitcast i8* %0 to i32*
%5 = load i32, i32* %4
%6 = call i32 @fstat(i32 %5, %struct.stat* %2)
%7 = icmp eq i32 %6, 0
%8 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%9 = load double, double* %8
%10 = select i1 %7, double %9, double 1.024000e+03
ret double %10
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *, char *);
int /*<<< orphan*/ stderr;
void version(void) { fprintf(stderr, "%s version %s\n", "klog", "1.1-dev"); }


x86 assembly (clang, -O0):
<version>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
lea    0xee4(%rip),%rdx
lea    0xee2(%rip),%rcx
call   1030 <fprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<version>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
lea    0xee8(%rip),%rdx
lea    0xee6(%rip),%rcx
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [15 x i8] c"%s version %s\0A\00"
@.str.1 = [5 x i8] c"klog\00"
@.str.2 = [8 x i8] c"1.1-dev\00"
define void @version() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [15 x i8] c"%s version %s\0A\00"
@.str.1 = [5 x i8] c"klog\00"
@.str.2 = [8 x i8] c"1.1-dev\00"
define void @version() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0))
ret void
}
int fun1(int i) {
  printf("in file [%s] func  [%s] : %d\n",
         "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
         "2022-01-22/02-19-57/repos/blackerliu/c.lang.kata/refs/heads/master/"
         "liborder/fun1.c",
         __FUNCTION__, i);
  fun2(i);
  return 0;
}


x86 assembly (clang, -O0):
<fun1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
lea    0xecb(%rip),%rdi
lea    0xee2(%rip),%rsi
lea    0xf6e(%rip),%rdx
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x4(%rbp),%edi
mov    $0x0,%al
call   1030 <fun2@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fun1>:
push   %rbx
mov    %edi,%ebx
lea    0xed6(%rip),%rdi
lea    0xeed(%rip),%rsi
lea    0xf79(%rip),%rdx
mov    %ebx,%ecx
xor    %eax,%eax
call   1040 <printf@plt>
mov    %ebx,%edi
xor    %eax,%eax
call   1030 <fun2@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [30 x i8] c"in file [%s] func [%s] : %d\0A\00"
@.str.1 = [147 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/blackerliu/c.lang.kata/refs/heads/master/liborder/fun1.c\00"
@__FUNCTION__.fun1 = [5 x i8] c"fun1\00"
define i32 @fun1(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([147 x i8], [147 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @__FUNCTION__.fun1, i64 0, i64 0), i32 %3)
%5 = load i32, i32* %2
%6 = call i32 (i32, ...) bitcast (i32 (...)* @fun2 to i32 (i32, ...)*)(i32 %5)
ret i32 0
}

LLVM IR (-O2):
@.str = [30 x i8] c"in file [%s] func [%s] : %d\0A\00"
@.str.1 = [147 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/blackerliu/c.lang.kata/refs/heads/master/liborder/fun1.c\00"
@__FUNCTION__.fun1 = [5 x i8] c"fun1\00"
define i32 @fun1(i32 %0) {
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([147 x i8], [147 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @__FUNCTION__.fun1, i64 0, i64 0), i32 %0)
%3 = tail call i32 (i32, ...) bitcast (i32 (...)* @fun2 to i32 (i32, ...)*)(i32 %0)
ret i32 0
}
/* Variables and functions */
int EINVAL;
__attribute__((visibility("default"))) int sd_event_source_get_signal(void *s) {
  return -EINVAL;
}


x86 assembly (clang, -O0):
<sd_event_source_get_signal>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
xor    %eax,%eax
mov    0x2ecf(%rip),%rcx
sub    (%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sd_event_source_get_signal>:
mov    0x2ed9(%rip),%rcx
xor    %eax,%eax
sub    (%rcx),%eax
ret

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

LLVM IR (-O2):
@EINVAL = global i32 0
define i32 @sd_event_source_get_signal(i8* nocapture readnone %0) {
%2 = load i32, i32* @EINVAL
%3 = sub nsw i32 0, %2
ret i32 %3
}
int max(int num1, int num2) { return num1 > num2 ? num1 : num2; }


x86 assembly (clang, -O0):
<max>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jle    1121 <max+0x21>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1127 <max+0x27>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<max>:
mov    %esi,%eax
cmp    %esi,%edi
cmovg  %edi,%eax
ret

LLVM IR (-O0):
define i32 @max(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 = icmp sgt i32 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i32, i32* %3
br label %12
10: ; preds = %2
%11 = load i32, i32* %4
br label %12
12: ; preds = %10, %8
%13 = phi i32 [ %9, %8 ], [ %11, %10 ]
ret i32 %13
}

LLVM IR (-O2):
define i32 @max(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}