xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ fatal(char *);
void usage() {
  fatal("Usage: logwrapper [-x] BINARY [ARGS ...]\n"
        "\n"
        "Forks and executes BINARY ARGS, redirecting stdout and stderr to\n"
        "the Android logging system. Tag is set to BINARY, priority is\n"
        "always LOG_INFO.\n"
        "\n"
        "-x: Causes logwrapper to SIGSEGV when BINARY terminates\n"
        "    fault address is set to the status of wait()\n");
}


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

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

LLVM IR (-O0):
@.str = [293 x i8] c"Usage: logwrapper [-x] BINARY [ARGS ...]\0A\0AForks and executes BINARY ARGS, redirecting stdout and stderr to\0Athe Android logging system. Tag is set to BINARY, priority is\0Aalways LOG_INFO.\0A\0A-x: Causes logwrapper to SIGSEGV when BINARY terminates\0A fault address is set to the status of wait()\0A\00"
define void @usage() {
%1 = call i32 @fatal(i8* getelementptr inbounds ([293 x i8], [293 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [293 x i8] c"Usage: logwrapper [-x] BINARY [ARGS ...]\0A\0AForks and executes BINARY ARGS, redirecting stdout and stderr to\0Athe Android logging system. Tag is set to BINARY, priority is\0Aalways LOG_INFO.\0A\0A-x: Causes logwrapper to SIGSEGV when BINARY terminates\0A fault address is set to the status of wait()\0A\00"
define void @usage() {
%1 = tail call i32 @fatal(i8* getelementptr inbounds ([293 x i8], [293 x i8]* @.str, i64 0, i64 0))
ret void
}
void ptrace_sandbox_permit_select(struct pt_sandbox *p_sandbox) {
  (void)p_sandbox;
}


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

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

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

LLVM IR (-O2):
%struct.pt_sandbox = type opaque
define void @ptrace_sandbox_permit_select(%struct.pt_sandbox* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ test_fat();
void test_fat_command(void) { test_fat(); }


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

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

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

LLVM IR (-O2):
define void @test_fat_command() {
%1 = tail call i32 (...) @test_fat()
ret void
}
/* Type definitions */
struct ts_platform_data {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ disable_irq(unsigned int);
void board_disable_irq(const struct ts_platform_data *pdata, unsigned int irq) {
  disable_irq(irq);
}


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

x86 assembly (clang, -O2):
<board_disable_irq>:
mov    %esi,%edi
jmp    1030 <disable_irq@plt>

LLVM IR (-O0):
%struct.ts_platform_data = type { i32 }
define void @board_disable_irq(%struct.ts_platform_data* %0, i32 %1) {
%3 = alloca %struct.ts_platform_data*
%4 = alloca i32
store %struct.ts_platform_data* %0, %struct.ts_platform_data** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = call i32 @disable_irq(i32 %5)
ret void
}

LLVM IR (-O2):
%struct.ts_platform_data = type { i32 }
define void @board_disable_irq(%struct.ts_platform_data* nocapture readnone %0, i32 %1) {
%3 = tail call i32 @disable_irq(i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ perror(char const *);
void childcheck(const char *fname, int result) {
  if (result != 0) {
    perror(fname);
    exit(1);
  }
}


x86 assembly (clang, -O0):
<childcheck>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     114c <childcheck+0x2c>
mov    -0x8(%rbp),%rdi
call   1030 <perror@plt>
mov    $0x1,%edi
call   1040 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<childcheck>:
test   %esi,%esi
jne    1125 <childcheck+0x5>
ret
push   %rax
call   1030 <perror@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define void @childcheck(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %11
7: ; preds = %2
%8 = load i8*, i8** %3
%9 = call i32 @perror(i8* %8)
%10 = call i32 @exit(i32 1)
unreachable
11: ; preds = %2
ret void
}

LLVM IR (-O2):
define void @childcheck(i8* nocapture %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %7, label %4
4: ; preds = %2
%5 = tail call i32 @perror(i8* %0)
%6 = tail call i32 @exit(i32 1)
unreachable
7: ; preds = %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ cPrintf(char *);
void help02(void) {
  cPrintf("  a                 assemble starting at PC\n");
  cPrintf("  a  <addr>         assemble starting at <addr>\n");
}


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

x86 assembly (clang, -O2):
<help02>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <cPrintf@plt>
lea    0xf09(%rip),%rdi
pop    %rax
jmp    1030 <cPrintf@plt>

LLVM IR (-O0):
@.str = [45 x i8] c" a assemble starting at PC\0A\00"
@.str.1 = [49 x i8] c" a <addr> assemble starting at <addr>\0A\00"
define void @help02() {
%1 = call i32 @cPrintf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @cPrintf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [45 x i8] c" a assemble starting at PC\0A\00"
@.str.1 = [49 x i8] c" a <addr> assemble starting at <addr>\0A\00"
define void @help02() {
%1 = tail call i32 @cPrintf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @cPrintf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
void *malloc(size_t);
void *Malloc(size_t size) { return malloc(size); }


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

x86 assembly (clang, -O2):
<Malloc>:
jmp    1030 <malloc@plt>

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

LLVM IR (-O2):
define noalias i8* @Malloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
ret i8* %2
}
/* Variables and functions */
scalar_t__ islower(int);
scalar_t__ isupper(int);
int isalpha(int c) {
  if (isupper(c) != 0)
    return 1;
  if (islower(c) != 0)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<isalpha>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1040 <isupper@plt>
cmp    $0x0,%rax
je     1149 <isalpha+0x29>
movl   $0x1,-0x4(%rbp)
jmp    116e <isalpha+0x4e>
mov    -0x8(%rbp),%edi
call   1030 <islower@plt>
cmp    $0x0,%rax
je     1167 <isalpha+0x47>
movl   $0x1,-0x4(%rbp)
jmp    116e <isalpha+0x4e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isalpha>:
push   %rbx
mov    %edi,%ebx
call   1040 <isupper@plt>
mov    %rax,%rcx
mov    $0x1,%eax
test   %rcx,%rcx
je     1137 <isalpha+0x17>
pop    %rbx
ret
mov    %ebx,%edi
call   1030 <islower@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @isalpha(i32 %0) {
%2 = tail call i64 @isupper(i32 %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = tail call i64 @islower(i32 %0)
%6 = icmp ne i64 %5, 0
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %4, %1
%9 = phi i32 [ 1, %1 ], [ %7, %4 ]
ret i32 %9
}
int clamp(int value, int min, int max) {
  return (value < min ? min : (value > max ? max : value));
}


x86 assembly (clang, -O0):
<clamp>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1124 <clamp+0x24>
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    1147 <clamp+0x47>
mov    -0x4(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    113b <clamp+0x3b>
mov    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
jmp    1141 <clamp+0x41>
mov    -0x4(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<clamp>:
mov    %edx,%eax
cmp    %edx,%edi
cmovle %edi,%eax
cmp    %esi,%edi
cmovl  %esi,%eax
ret

LLVM IR (-O0):
define i32 @clamp(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 = icmp slt i32 %7, %8
br i1 %9, label %10, label %12
10: ; preds = %3
%11 = load i32, i32* %5
br label %22
12: ; preds = %3
%13 = load i32, i32* %4
%14 = load i32, i32* %6
%15 = icmp sgt i32 %13, %14
br i1 %15, label %16, label %18
16: ; preds = %12
%17 = load i32, i32* %6
br label %20
18: ; preds = %12
%19 = load i32, i32* %4
br label %20
20: ; preds = %18, %16
%21 = phi i32 [ %17, %16 ], [ %19, %18 ]
br label %22
22: ; preds = %20, %10
%23 = phi i32 [ %11, %10 ], [ %21, %20 ]
ret i32 %23
}

LLVM IR (-O2):
define i32 @clamp(i32 %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %0, %1
%5 = icmp sgt i32 %0, %2
%6 = select i1 %5, i32 %2, i32 %0
%7 = select i1 %4, i32 %1, i32 %6
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, short);
int main() {
  short int x = 1372;
  char a;
  a = *(&x);
  printf("a= %c\n", a);
  printf("cont a: %x\n", a);
  printf("cont end x: %X\n", *(&x));
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movw   $0x55c,-0x6(%rbp)
mov    -0x6(%rbp),%ax
mov    %al,-0x7(%rbp)
movsbl -0x7(%rbp),%eax
lea    0xeb9(%rip),%rdi
movswl %ax,%esi
call   1030 <printf@plt>
movsbl -0x7(%rbp),%eax
lea    0xead(%rip),%rdi
movswl %ax,%esi
call   1030 <printf@plt>
lea    0xeaa(%rip),%rdi
movswl -0x6(%rbp),%esi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
mov    $0x5c,%esi
call   1030 <printf@plt>
lea    0xece(%rip),%rdi
mov    $0x5c,%esi
call   1030 <printf@plt>
lea    0xec9(%rip),%rdi
mov    $0x55c,%esi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"a= %c\0A\00"
@.str.1 = [12 x i8] c"cont a: %x\0A\00"
@.str.2 = [16 x i8] c"cont end x: %X\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i16
%3 = alloca i8
store i32 0, i32* %1
store i16 1372, i16* %2
%4 = load i16, i16* %2
%5 = trunc i16 %4 to i8
store i8 %5, i8* %3
%6 = load i8, i8* %3
%7 = sext i8 %6 to i16
%8 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i16 signext %7)
%9 = load i8, i8* %3
%10 = sext i8 %9 to i16
%11 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i16 signext %10)
%12 = load i16, i16* %2
%13 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), i16 signext %12)
%14 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [7 x i8] c"a= %c\0A\00"
@.str.1 = [12 x i8] c"cont a: %x\0A\00"
@.str.2 = [16 x i8] c"cont end x: %X\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i16 signext 92)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i16 signext 92)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), i16 signext 1372)
%4 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ outl(int /*<<< orphan*/, unsigned int);
int /*<<< orphan*/ outw(int, unsigned int);
void vp_del_vq(unsigned int ioaddr, int queue_index) {
  outw(queue_index, ioaddr + 14);
  outl(0, ioaddr + 8);
}


x86 assembly (clang, -O0):
<vp_del_vq>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x4(%rbp),%esi
add    $0xe,%esi
call   1040 <outw@plt>
mov    -0x4(%rbp),%esi
add    $0x8,%esi
xor    %edi,%edi
call   1030 <outl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vp_del_vq>:
push   %rbx
mov    %esi,%eax
mov    %edi,%ebx
lea    0xe(%rbx),%esi
mov    %eax,%edi
call   1040 <outw@plt>
add    $0x8,%ebx
xor    %edi,%edi
mov    %ebx,%esi
pop    %rbx
jmp    1030 <outl@plt>

LLVM IR (-O0):
define void @vp_del_vq(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 = load i32, i32* %3
%7 = add i32 %6, 14
%8 = call i32 @outw(i32 %5, i32 %7)
%9 = load i32, i32* %3
%10 = add i32 %9, 8
%11 = call i32 @outl(i32 0, i32 %10)
ret void
}

LLVM IR (-O2):
define void @vp_del_vq(i32 %0, i32 %1) {
%3 = add i32 %0, 14
%4 = tail call i32 @outw(i32 %1, i32 %3)
%5 = add i32 %0, 8
%6 = tail call i32 @outl(i32 0, i32 %5)
ret void
}
int do_604() { return 604; }


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

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

LLVM IR (-O0):
define i32 @do_604() {
ret i32 604
}

LLVM IR (-O2):
define i32 @do_604() {
ret i32 604
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, unsigned int, unsigned int);
void np_set_cursor_pos(unsigned x, unsigned y) {
  printf("%c[%d;%df", 0x1B, y, x);
}


x86 assembly (clang, -O0):
<np_set_cursor_pos>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%edx
mov    -0x4(%rbp),%ecx
lea    0xed5(%rip),%rdi
mov    $0x1b,%esi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<np_set_cursor_pos>:
mov    %esi,%edx
mov    %edi,%ecx
lea    0xee5(%rip),%rdi
mov    $0x1b,%esi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"%c[%d;%df\00"
define void @np_set_cursor_pos(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 = load i32, i32* %3
%7 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 27, i32 %5, i32 %6)
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"%c[%d;%df\00"
define void @np_set_cursor_pos(i32 %0, i32 %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 27, i32 %1, i32 %0)
ret void
}
/* Variables and functions */
int SubEvt_id(void *);
int /*<<< orphan*/ SubEvt_setId(void *, int);
int SubEvt_clrDataError(void *my) {
  SubEvt_setId(my, SubEvt_id(my) & ~0x80000000UL);
}


x86 assembly (clang, -O0):
<SubEvt_clrDataError>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <SubEvt_id@plt>
mov    -0x18(%rbp),%rdi
cltq
movabs $0xffffffff7fffffff,%rcx
ff ff ff
and    %rcx,%rax
mov    %eax,%esi
call   1030 <SubEvt_setId@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SubEvt_clrDataError>:
push   %rbx
mov    %rdi,%rbx
call   1040 <SubEvt_id@plt>
and    $0x7fffffff,%eax
mov    %rbx,%rdi
mov    %eax,%esi
pop    %rbx
jmp    1030 <SubEvt_setId@plt>

LLVM IR (-O0):
define i32 @SubEvt_clrDataError(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = load i8*, i8** %3
%6 = call i32 @SubEvt_id(i8* %5)
%7 = sext i32 %6 to i64
%8 = and i64 %7, -2147483649
%9 = trunc i64 %8 to i32
%10 = call i32 @SubEvt_setId(i8* %4, i32 %9)
%11 = load i32, i32* %2
ret i32 %11
}

LLVM IR (-O2):
define i32 @SubEvt_clrDataError(i8* %0) {
%2 = tail call i32 @SubEvt_id(i8* %0)
%3 = and i32 %2, 2147483647
%4 = tail call i32 @SubEvt_setId(i8* %0, i32 %3)
ret i32 undef
}
/* Variables and functions */
char *malloc(size_t);
int /*<<< orphan*/ memcpy(char *, char const *, size_t);
char *kcn_str_dup(const char *s0, size_t len) {
  char *s;
  s = malloc(len + 1);
  if (s == NULL)
    return NULL;
  memcpy(s, s0, len);
  s[len] = '\0';
  return s;
}


x86 assembly (clang, -O0):
<kcn_str_dup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
add    $0x1,%rdi
call   1040 <malloc@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    1159 <kcn_str_dup+0x39>
movq   $0x0,-0x8(%rbp)
jmp    117e <kcn_str_dup+0x5e>
mov    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <memcpy@plt>
mov    -0x20(%rbp),%rax
mov    -0x18(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<kcn_str_dup>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%r15
lea    0x1(%rsi),%rdi
call   1040 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
je     114f <kcn_str_dup+0x2f>
mov    %rbx,%rdi
mov    %r15,%rsi
mov    %r14,%rdx
call   1030 <memcpy@plt>
movb   $0x0,(%rbx,%r14,1)
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i8* @kcn_str_dup(i8* %0, i64 %1) {
%3 = add i64 %1, 1
%4 = tail call i8* @malloc(i64 %3)
%5 = icmp eq i8* %4, null
br i1 %5, label %9, label %6
6: ; preds = %2
%7 = tail call i32 @memcpy(i8* %4, i8* %0, i64 %1)
%8 = getelementptr inbounds i8, i8* %4, i64 %1
store i8 0, i8* %8
br label %9
9: ; preds = %2, %6
ret i8* %4
}
/* Variables and functions */
int ggT(int, int);
int mui(int d, int m) {
  int k = 1;
  if (ggT(d, m) != 1)
    return -1;
  while (1) {
    if ((m * k + 1) % d == 0)
      return ((m * k + 1) / d);
    k++;
  }
}


x86 assembly (clang, -O0):
<mui>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x1,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1030 <ggT@plt>
cmp    $0x1,%eax
je     1145 <mui+0x35>
movl   $0xffffffff,-0x4(%rbp)
jmp    1185 <mui+0x75>
jmp    114a <mui+0x3a>
mov    -0xc(%rbp),%eax
imul   -0x10(%rbp),%eax
add    $0x1,%eax
cltd
idivl  -0x8(%rbp)
cmp    $0x0,%edx
jne    1177 <mui+0x67>
mov    -0xc(%rbp),%eax
imul   -0x10(%rbp),%eax
add    $0x1,%eax
cltd
idivl  -0x8(%rbp)
mov    %eax,-0x4(%rbp)
jmp    1185 <mui+0x75>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    114a <mui+0x3a>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mui>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
call   1030 <ggT@plt>
mov    %eax,%ecx
mov    $0xffffffff,%eax
cmp    $0x1,%ecx
jne    113b <mui+0x2b>
lea    0x1(%rbx),%ecx
nopl   0x0(%rax,%rax,1)
mov    %ecx,%eax
cltd
idiv   %ebp
add    %ebx,%ecx
test   %edx,%edx
jne    1130 <mui+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @mui(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 1, i32* %6
%7 = load i32, i32* %4
%8 = load i32, i32* %5
%9 = call i32 @ggT(i32 %7, i32 %8)
%10 = icmp ne i32 %9, 1
br i1 %10, label %11, label %12
11: ; preds = %2
store i32 -1, i32* %3
br label %31
12: ; preds = %2
br label %13
13: ; preds = %12, %28
%14 = load i32, i32* %5
%15 = load i32, i32* %6
%16 = mul nsw i32 %14, %15
%17 = add nsw i32 %16, 1
%18 = load i32, i32* %4
%19 = srem i32 %17, %18
%20 = icmp eq i32 %19, 0
br i1 %20, label %21, label %28
21: ; preds = %13
%22 = load i32, i32* %5
%23 = load i32, i32* %6
%24 = mul nsw i32 %22, %23
%25 = add nsw i32 %24, 1
%26 = load i32, i32* %4
%27 = sdiv i32 %25, %26
store i32 %27, i32* %3
br label %31
28: ; preds = %13
%29 = load i32, i32* %6
%30 = add nsw i32 %29, 1
store i32 %30, i32* %6
br label %13
31: ; preds = %21, %11
%32 = load i32, i32* %3
ret i32 %32
}

LLVM IR (-O2):
define i32 @mui(i32 %0, i32 %1) {
%3 = tail call i32 @ggT(i32 %0, i32 %1)
%4 = icmp eq i32 %3, 1
br i1 %4, label %5, label %13
5: ; preds = %2, %5
%6 = phi i32 [ %12, %5 ], [ 1, %2 ]
%7 = mul nsw i32 %6, %1
%8 = add nsw i32 %7, 1
%9 = srem i32 %8, %0
%10 = sdiv i32 %8, %0
%11 = icmp eq i32 %9, 0
%12 = add nuw nsw i32 %6, 1
br i1 %11, label %13, label %5
13: ; preds = %5, %2
%14 = phi i32 [ -1, %2 ], [ %10, %5 ]
ret i32 %14
}
char declet(int number) {
  if ((number % 2) == 0)
    return 'A' + (number - 100) / 2;
  else
    return 'a' + (number - 101) / 2;
}


x86 assembly (clang, -O0):
<declet>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1134 <declet+0x34>
mov    -0x8(%rbp),%eax
sub    $0x64,%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
add    $0x41,%eax
mov    %al,-0x1(%rbp)
jmp    1148 <declet+0x48>
mov    -0x8(%rbp),%eax
sub    $0x65,%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
add    $0x61,%eax
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<declet>:
mov    %edi,%ecx
and    $0x1,%ecx
cmp    $0x1,%ecx
adc    $0x0,%edi
shl    $0x5,%cl
mov    %edi,%eax
add    $0xffffff9b,%eax
shr    $0x1f,%eax
add    %edi,%eax
add    $0xffffff9b,%eax
shr    %eax
add    %cl,%al
add    $0x41,%al
ret

LLVM IR (-O0):
define signext i8 @declet(i32 %0) {
%2 = alloca i8
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = srem i32 %4, 2
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %13
7: ; preds = %1
%8 = load i32, i32* %3
%9 = sub nsw i32 %8, 100
%10 = sdiv i32 %9, 2
%11 = add nsw i32 65, %10
%12 = trunc i32 %11 to i8
store i8 %12, i8* %2
br label %19
13: ; preds = %1
%14 = load i32, i32* %3
%15 = sub nsw i32 %14, 101
%16 = sdiv i32 %15, 2
%17 = add nsw i32 97, %16
%18 = trunc i32 %17 to i8
store i8 %18, i8* %2
br label %19
19: ; preds = %13, %7
%20 = load i8, i8* %2
ret i8 %20
}

LLVM IR (-O2):
define signext i8 @declet(i32 %0) {
%2 = and i32 %0, 1
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 -100, i32 -101
%5 = select i1 %3, i8 65, i8 97
%6 = add nsw i32 %4, %0
%7 = sdiv i32 %6, 2
%8 = trunc i32 %7 to i8
%9 = add i8 %5, %8
ret i8 %9
}
void do_sndc(int argc, char *argv[], int start) {
  (void)argc;
  (void)argv;
  (void)start;
}


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

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

LLVM IR (-O0):
define void @do_sndc(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
ret void
}

LLVM IR (-O2):
define void @do_sndc(i32 %0, i8** nocapture %1, i32 %2) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ displayArray(int *, int);
int /*<<< orphan*/ sortArray(int *, int);
int main() {
  int arr[10] = {23, 2, 0, 4, 56, 3, 7, 8, 98, 1};
  sortArray(arr, 10);
  displayArray(arr, 10);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
lea    -0x30(%rbp),%rdi
lea    0xebd(%rip),%rsi
mov    $0x28,%edx
call   1040 <memcpy@plt>
lea    -0x30(%rbp),%rdi
mov    $0xa,%esi
call   1030 <sortArray@plt>
lea    -0x30(%rbp),%rdi
mov    $0xa,%esi
call   1050 <displayArray@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x30,%rsp
mov    0xef4(%rip),%rax
mov    %rax,0x20(%rsp)
movaps 0xed8(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xebc(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0xa,%esi
call   1030 <sortArray@plt>
mov    %rbx,%rdi
mov    $0xa,%esi
call   1040 <displayArray@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.arr = [10 x i32] [i32 23, i32 2, i32 0, i32 4, i32 56, i32 3, i32 7, i32 8, i32 98, i32 1]
define i32 @main() {
%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 @sortArray(i32* %3, i32 10)
%5 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
%6 = call i32 @displayArray(i32* %5, i32 10)
ret i32 0
}

LLVM IR (-O2):
@__const.main.arr = [10 x i32] [i32 23, i32 2, i32 0, i32 4, i32 56, i32 3, i32 7, i32 8, i32 98, i32 1]
define i32 @main() {
%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 @sortArray(i32* %3, i32 10)
%5 = call i32 @displayArray(i32* %3, i32 10)
ret i32 0
}
/* Variables and functions */
scalar_t__ my_fabs(float);
float my_floor(scalar_t__);
float my_rint(float x) {
  float t = my_floor(my_fabs(x) + 0.5);
  return (x < 0.0) ? -t : t;
}


x86 assembly (clang, -O0):
<my_rint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
call   1040 <my_fabs@plt>
cvtsi2sd %rax,%xmm0
movsd  0xebc(%rip),%xmm1
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%rdi
call   1030 <my_floor@plt>
movss  %xmm0,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
xorps  %xmm0,%xmm0
ucomisd %xmm1,%xmm0
jbe    1189 <my_rint+0x69>
movss  -0x8(%rbp),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
movss  %xmm0,-0xc(%rbp)
jmp    1193 <my_rint+0x73>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_rint>:
sub    $0x18,%rsp
movaps %xmm0,(%rsp)
call   1040 <my_fabs@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
addsd  0xec3(%rip),%xmm0
cvttsd2si %xmm0,%rdi
call   1030 <my_floor@plt>
movapd 0xec1(%rip),%xmm1
xorpd  %xmm0,%xmm1
xorps  %xmm2,%xmm2
movaps (%rsp),%xmm3
cmpltss %xmm2,%xmm3
movaps %xmm3,%xmm2
andnps %xmm0,%xmm2
andps  %xmm1,%xmm3
orps   %xmm2,%xmm3
movaps %xmm3,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define float @my_rint(float %0) {
%2 = alloca float
%3 = alloca float
store float %0, float* %2
%4 = load float, float* %2
%5 = call i64 @my_fabs(float %4)
%6 = sitofp i64 %5 to double
%7 = fadd double %6, 5.000000e-01
%8 = fptosi double %7 to i64
%9 = call float @my_floor(i64 %8)
store float %9, float* %3
%10 = load float, float* %2
%11 = fpext float %10 to double
%12 = fcmp olt double %11, 0.000000e+00
br i1 %12, label %13, label %16
13: ; preds = %1
%14 = load float, float* %3
%15 = fneg float %14
br label %18
16: ; preds = %1
%17 = load float, float* %3
br label %18
18: ; preds = %16, %13
%19 = phi float [ %15, %13 ], [ %17, %16 ]
ret float %19
}

LLVM IR (-O2):
define float @my_rint(float %0) {
%2 = tail call i64 @my_fabs(float %0)
%3 = sitofp i64 %2 to double
%4 = fadd double %3, 5.000000e-01
%5 = fptosi double %4 to i64
%6 = tail call float @my_floor(i64 %5)
%7 = fcmp olt float %0, 0.000000e+00
%8 = fneg float %6
%9 = select i1 %7, float %8, float %6
ret float %9
}
int pathconN_nm8_n_out(void) { return 2; }


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

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

LLVM IR (-O0):
define i32 @pathconN_nm8_n_out() {
ret i32 2
}

LLVM IR (-O2):
define i32 @pathconN_nm8_n_out() {
ret i32 2
}
/* Type definitions */
struct iwreq {
  int /*<<< orphan*/ ifr_name;
};

/* Variables and functions */
int /*<<< orphan*/ IFNAMSIZ;
int ioctl(int, int, struct iwreq *);
int /*<<< orphan*/ strncpy(int /*<<< orphan*/, char const *,
                           int /*<<< orphan*/);
int iw_set_ext(int skfd, const char *ifname, int request_id,
               struct iwreq *pwrq) {
  strncpy(pwrq->ifr_name, ifname, IFNAMSIZ);
  return (ioctl(skfd, request_id, pwrq));
}


x86 assembly (clang, -O0):
<iw_set_ext>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rsi
mov    0x2e99(%rip),%rax
mov    (%rax),%edx
call   1030 <strncpy@plt>
mov    -0x4(%rbp),%edi
mov    -0x14(%rbp),%esi
mov    -0x20(%rbp),%rdx
call   1040 <ioctl@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<iw_set_ext>:
push   %rbp
push   %r14
push   %rbx
mov    %rcx,%rbx
mov    %edx,%r14d
mov    %edi,%ebp
mov    (%rcx),%edi
mov    0x2eab(%rip),%rax
mov    (%rax),%edx
call   1030 <strncpy@plt>
mov    %ebp,%edi
mov    %r14d,%esi
mov    %rbx,%rdx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <ioctl@plt>

LLVM IR (-O0):
%struct.iwreq = type { i32 }
@IFNAMSIZ = global i32 0
define i32 @iw_set_ext(i32 %0, i8* %1, i32 %2, %struct.iwreq* %3) {
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i32
%8 = alloca %struct.iwreq*
store i32 %0, i32* %5
store i8* %1, i8** %6
store i32 %2, i32* %7
store %struct.iwreq* %3, %struct.iwreq** %8
%9 = load %struct.iwreq*, %struct.iwreq** %8
%10 = getelementptr inbounds %struct.iwreq, %struct.iwreq* %9, i32 0, i32 0
%11 = load i32, i32* %10
%12 = load i8*, i8** %6
%13 = load i32, i32* @IFNAMSIZ
%14 = call i32 @strncpy(i32 %11, i8* %12, i32 %13)
%15 = load i32, i32* %5
%16 = load i32, i32* %7
%17 = load %struct.iwreq*, %struct.iwreq** %8
%18 = call i32 @ioctl(i32 %15, i32 %16, %struct.iwreq* %17)
ret i32 %18
}

LLVM IR (-O2):
%struct.iwreq = type { i32 }
@IFNAMSIZ = global i32 0
define i32 @iw_set_ext(i32 %0, i8* %1, i32 %2, %struct.iwreq* %3) {
%5 = getelementptr inbounds %struct.iwreq, %struct.iwreq* %3, i64 0, i32 0
%6 = load i32, i32* %5
%7 = load i32, i32* @IFNAMSIZ
%8 = tail call i32 @strncpy(i32 %6, i8* %1, i32 %7)
%9 = tail call i32 @ioctl(i32 %0, i32 %2, %struct.iwreq* %3)
ret i32 %9
}
/* Type definitions */
struct AsyncCallback {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct AsyncCallback *);
void free_async_callback(struct AsyncCallback *callback) {
  do {
    ;
  } while (0);
  free(callback);
}


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

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

LLVM IR (-O0):
%struct.AsyncCallback = type { i32 }
define void @free_async_callback(%struct.AsyncCallback* %0) {
%2 = alloca %struct.AsyncCallback*
store %struct.AsyncCallback* %0, %struct.AsyncCallback** %2
br label %3
3: ; preds = %1
br label %4
4: ; preds = %3
%5 = load %struct.AsyncCallback*, %struct.AsyncCallback** %2
%6 = call i32 @free(%struct.AsyncCallback* %5)
ret void
}

LLVM IR (-O2):
%struct.AsyncCallback = type { i32 }
define void @free_async_callback(%struct.AsyncCallback* nocapture %0) {
%2 = tail call i32 @free(%struct.AsyncCallback* %0)
ret void
}
int alignof_int() {
  struct s {
    char x;
    int y;
  };
  return sizeof(char) + (sizeof(struct s) - (sizeof(char) + sizeof(int)));
}


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

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

LLVM IR (-O0):
define i32 @alignof_int() {
ret i32 4
}

LLVM IR (-O2):
define i32 @alignof_int() {
ret i32 4
}
/* Variables and functions */
bool interruptsEnabled() {
  unsigned char psw = *(volatile unsigned char *)0xFFFA;
  return psw & 0x80;
}


x86 assembly (clang, -O0):
<interruptsEnabled>:
push   %rbp
mov    %rsp,%rbp
mov    $0xfffa,%eax
mov    (%rax),%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
and    $0x80,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<interruptsEnabled>:
movzbl 0xfffa,%eax
and    $0xffffff80,%eax
ret

LLVM IR (-O0):
define i32 @interruptsEnabled() {
%1 = alloca i8
%2 = load volatile i8, i8* inttoptr (i64 65530 to i8*)
store i8 %2, i8* %1
%3 = load i8, i8* %1
%4 = zext i8 %3 to i32
%5 = and i32 %4, 128
ret i32 %5
}

LLVM IR (-O2):
define i32 @interruptsEnabled() {
%1 = load volatile i8, i8* inttoptr (i64 65530 to i8*)
%2 = and i8 %1, -128
%3 = zext i8 %2 to i32
ret i32 %3
}
/* Variables and functions */
char getchar();
void input(char *dest) {
  int i = 0;
  char c;
  while (i < 255 && (c = getchar()) != '\n')
    dest[i++] = c;
  dest[i] = '\0';
}


x86 assembly (clang, -O0):
<input>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
xor    %eax,%eax
cmpl   $0xff,-0xc(%rbp)
mov    %al,-0xe(%rbp)
jge    114b <input+0x3b>
mov    $0x0,%al
call   1030 <getchar@plt>
mov    %al,-0xd(%rbp)
movsbl %al,%eax
cmp    $0xa,%eax
setne  %al
mov    %al,-0xe(%rbp)
mov    -0xe(%rbp),%al
test   $0x1,%al
jne    115b <input+0x4b>
jmp    1178 <input+0x68>
mov    -0xd(%rbp),%dl
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
mov    %ecx,%esi
add    $0x1,%esi
mov    %esi,-0xc(%rbp)
movslq %ecx,%rcx
mov    %dl,(%rax,%rcx,1)
jmp    1123 <input+0x13>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<input>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
xor    %ebx,%ebx
nopl   0x0(%rax)
xor    %eax,%eax
call   1030 <getchar@plt>
cmp    $0xa,%al
je     1141 <input+0x31>
mov    %al,(%r14,%rbx,1)
add    $0x1,%rbx
cmp    $0xff,%rbx
jne    1120 <input+0x10>
mov    $0xff,%ebx
mov    %ebx,%eax
movb   $0x0,(%r14,%rax,1)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @input(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i8
store i8* %0, i8** %2
store i32 0, i32* %3
br label %5
5: ; preds = %14, %1
%6 = load i32, i32* %3
%7 = icmp slt i32 %6, 255
br i1 %7, label %8, label %12
8: ; preds = %5
%9 = call signext i8 (...) @getchar()
store i8 %9, i8* %4
%10 = sext i8 %9 to i32
%11 = icmp ne i32 %10, 10
br label %12
12: ; preds = %8, %5
%13 = phi i1 [ false, %5 ], [ %11, %8 ]
br i1 %13, label %14, label %21
14: ; preds = %12
%15 = load i8, i8* %4
%16 = load i8*, i8** %2
%17 = load i32, i32* %3
%18 = add nsw i32 %17, 1
store i32 %18, i32* %3
%19 = sext i32 %17 to i64
%20 = getelementptr inbounds i8, i8* %16, i64 %19
store i8 %15, i8* %20
br label %5
21: ; preds = %12
%22 = load i8*, i8** %2
%23 = load i32, i32* %3
%24 = sext i32 %23 to i64
%25 = getelementptr inbounds i8, i8* %22, i64 %24
store i8 0, i8* %25
ret void
}

LLVM IR (-O2):
define void @input(i8* nocapture writeonly %0) {
br label %2
2: ; preds = %1, %6
%3 = phi i64 [ 0, %1 ], [ %7, %6 ]
%4 = tail call signext i8 (...) @getchar()
%5 = icmp eq i8 %4, 10
br i1 %5, label %10, label %6
6: ; preds = %2
%7 = add nuw nsw i64 %3, 1
%8 = getelementptr inbounds i8, i8* %0, i64 %3
store i8 %4, i8* %8
%9 = icmp eq i64 %7, 255
br i1 %9, label %10, label %2
10: ; preds = %6, %2
%11 = phi i64 [ 255, %6 ], [ %3, %2 ]
%12 = and i64 %11, 4294967295
%13 = getelementptr inbounds i8, i8* %0, i64 %12
store i8 0, i8* %13
ret void
}
int isurlsafe(const char ch) {
  return ((ch >= 'a' && ch <= 'z') || (ch >= 'A' && ch <= 'Z') ||
          (ch >= '0' && ch <= '9'));
}


x86 assembly (clang, -O0):
<isurlsafe>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x61,%eax
jl     1129 <isurlsafe+0x29>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x7a,%ecx
mov    %al,-0x2(%rbp)
jle    116d <isurlsafe+0x6d>
movsbl -0x1(%rbp),%eax
cmp    $0x41,%eax
jl     1148 <isurlsafe+0x48>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x5a,%ecx
mov    %al,-0x2(%rbp)
jle    116d <isurlsafe+0x6d>
movsbl -0x1(%rbp),%ecx
xor    %eax,%eax
cmp    $0x30,%ecx
mov    %al,-0x3(%rbp)
jl     1167 <isurlsafe+0x67>
movsbl -0x1(%rbp),%eax
cmp    $0x39,%eax
setle  %al
mov    %al,-0x3(%rbp)
mov    -0x3(%rbp),%al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isurlsafe>:
mov    %edi,%eax
and    $0xdf,%al
add    $0xbf,%al
cmp    $0x1a,%al
setb   %al
add    $0xd0,%dil
cmp    $0xa,%dil
setb   %cl
or     %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @isurlsafe(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp sge i32 %4, 97
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp sle i32 %8, 122
br i1 %9, label %28, label %10
10: ; preds = %6, %1
%11 = load i8, i8* %2
%12 = sext i8 %11 to i32
%13 = icmp sge i32 %12, 65
br i1 %13, label %14, label %18
14: ; preds = %10
%15 = load i8, i8* %2
%16 = sext i8 %15 to i32
%17 = icmp sle i32 %16, 90
br i1 %17, label %28, label %18
18: ; preds = %14, %10
%19 = load i8, i8* %2
%20 = sext i8 %19 to i32
%21 = icmp sge i32 %20, 48
br i1 %21, label %22, label %26
22: ; preds = %18
%23 = load i8, i8* %2
%24 = sext i8 %23 to i32
%25 = icmp sle i32 %24, 57
br label %26
26: ; preds = %22, %18
%27 = phi i1 [ false, %18 ], [ %25, %22 ]
br label %28
28: ; preds = %26, %14, %6
%29 = phi i1 [ true, %14 ], [ true, %6 ], [ %27, %26 ]
%30 = zext i1 %29 to i32
ret i32 %30
}

LLVM IR (-O2):
define i32 @isurlsafe(i8 signext %0) {
%2 = and i8 %0, -33
%3 = add i8 %2, -65
%4 = icmp ult i8 %3, 26
%5 = add i8 %0, -48
%6 = icmp ult i8 %5, 10
%7 = or i1 %6, %4
%8 = zext i1 %7 to i32
ret i32 %8
}
struct nouveau_screen *nouveau_screen(struct pipe_screen *pscreen) {
  return (struct nouveau_screen *)pscreen;
}


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

x86 assembly (clang, -O2):
<nouveau_screen>:
mov    %rdi,%rax
ret

LLVM IR (-O0):
%struct.nouveau_screen = type opaque
%struct.pipe_screen = type opaque
define %struct.nouveau_screen* @nouveau_screen(%struct.pipe_screen* %0) {
%2 = alloca %struct.pipe_screen*
store %struct.pipe_screen* %0, %struct.pipe_screen** %2
%3 = load %struct.pipe_screen*, %struct.pipe_screen** %2
%4 = bitcast %struct.pipe_screen* %3 to %struct.nouveau_screen*
ret %struct.nouveau_screen* %4
}

LLVM IR (-O2):
%struct.nouveau_screen = type opaque
%struct.pipe_screen = type opaque
define %struct.nouveau_screen* @nouveau_screen(%struct.pipe_screen* readnone %0) {
%2 = bitcast %struct.pipe_screen* %0 to %struct.nouveau_screen*
ret %struct.nouveau_screen* %2
}
/* Variables and functions */
char *fileLoadL(char const *, int /*<<< orphan*/ *);
char *fileLoad(const char *filename) { return fileLoadL(filename, NULL); }


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

x86 assembly (clang, -O2):
<fileLoad>:
xor    %esi,%esi
jmp    1030 <fileLoadL@plt>

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

LLVM IR (-O2):
define i8* @fileLoad(i8* %0) {
%2 = tail call i8* @fileLoadL(i8* %0, i32* null)
ret i8* %2
}
int main() {
  int x, y, q = 0;
  while (1) {
    x = x - y;
    q++;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%eax
sub    -0xc(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    %eax,-0x8(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    %eax,-0x10(%rbp)
jmp    1112 <main+0x12>

x86 assembly (clang, -O2):
<main>:
jmp    1100 <main>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %4
br label %5
5: ; preds = %0, %5
%6 = load i32, i32* %2
%7 = load i32, i32* %3
%8 = sub nsw i32 %6, %7
store i32 %8, i32* %2
%9 = load i32, i32* %4
%10 = add nsw i32 %9, 1
store i32 %10, i32* %4
br label %5
}

LLVM IR (-O2):
define i32 @main() {
br label %1
1: ; preds = %1, %0
br label %1
}
/* Type definitions */
typedef int __le16;

/* Variables and functions */
int cpu_to_le16(int);
int ieee80211_is_qos_nullfunc(__le16 fc) {
  return (fc & cpu_to_le16(0x000c | 0x00f0)) == cpu_to_le16(0x0008 | 0x00C0);
}


x86 assembly (clang, -O0):
<ieee80211_is_qos_nullfunc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    $0xfc,%edi
call   1030 <cpu_to_le16@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
and    %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    $0xc8,%edi
call   1030 <cpu_to_le16@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%eax
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ieee80211_is_qos_nullfunc>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
mov    $0xfc,%edi
call   1030 <cpu_to_le16@plt>
mov    %eax,%ebp
and    %ebx,%ebp
mov    $0xc8,%edi
call   1030 <cpu_to_le16@plt>
xor    %ecx,%ecx
cmp    %eax,%ebp
sete   %cl
mov    %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @ieee80211_is_qos_nullfunc(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @cpu_to_le16(i32 252)
%5 = and i32 %3, %4
%6 = call i32 @cpu_to_le16(i32 200)
%7 = icmp eq i32 %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @ieee80211_is_qos_nullfunc(i32 %0) {
%2 = tail call i32 @cpu_to_le16(i32 252)
%3 = and i32 %2, %0
%4 = tail call i32 @cpu_to_le16(i32 200)
%5 = icmp eq i32 %3, %4
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argn, char *argv[]) {
  printf("lophilo\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)
lea    0xed3(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [9 x i8] c"lophilo\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 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [8 x i8] c"lophilo\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
struct rw_semaphore {
  int dummy;
};

/* Variables and functions */
int __down_write_trylock(struct rw_semaphore *);
int down_write_trylock(struct rw_semaphore *sem) {
  int ret;
  ;
  ret = __down_write_trylock(sem);
  ;
  return ret;
}


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

x86 assembly (clang, -O2):
<down_write_trylock>:
jmp    1030 <__down_write_trylock@plt>

LLVM IR (-O0):
%struct.rw_semaphore = type { i32 }
define i32 @down_write_trylock(%struct.rw_semaphore* %0) {
%2 = alloca %struct.rw_semaphore*
%3 = alloca i32
store %struct.rw_semaphore* %0, %struct.rw_semaphore** %2
%4 = load %struct.rw_semaphore*, %struct.rw_semaphore** %2
%5 = call i32 @__down_write_trylock(%struct.rw_semaphore* %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
ret i32 %6
}

LLVM IR (-O2):
%struct.rw_semaphore = type { i32 }
define i32 @down_write_trylock(%struct.rw_semaphore* %0) {
%2 = tail call i32 @__down_write_trylock(%struct.rw_semaphore* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ MiiStationRead(int, int);
void PhyInterruptAck(void) {
  MiiStationRead(1, 1);
  MiiStationRead(18, 1);
}


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

x86 assembly (clang, -O2):
<PhyInterruptAck>:
push   %rax
mov    $0x1,%edi
mov    $0x1,%esi
call   1030 <MiiStationRead@plt>
mov    $0x12,%edi
mov    $0x1,%esi
pop    %rax
jmp    1030 <MiiStationRead@plt>

LLVM IR (-O0):
define void @PhyInterruptAck() {
%1 = call i32 @MiiStationRead(i32 1, i32 1)
%2 = call i32 @MiiStationRead(i32 18, i32 1)
ret void
}

LLVM IR (-O2):
define void @PhyInterruptAck() {
%1 = tail call i32 @MiiStationRead(i32 1, i32 1)
%2 = tail call i32 @MiiStationRead(i32 18, i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int, int, int);
void FillArea(int x1, int y1, int x2, int y2) {
  printf(";%d;%d;%d;%d", x1, y1, x2, y2);
}


x86 assembly (clang, -O0):
<FillArea>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    -0xc(%rbp),%ecx
mov    -0x10(%rbp),%r8d
lea    0xec8(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<FillArea>:
mov    %ecx,%r8d
mov    %edx,%ecx
mov    %esi,%edx
mov    %edi,%esi
lea    0xee0(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [13 x i8] c";%d;%d;%d;%d\00"
define void @FillArea(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1, i32 %2, i32 %3)
ret void
}