xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void limpa_tela() {
  printf("\e[H\e[2J");
  return;
}


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

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

LLVM IR (-O0):
@.str = [8 x i8] c"\1B[H\1B[2J\00"
define void @limpa_tela() {
%1 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"\1B[H\1B[2J\00"
define void @limpa_tela() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, unsigned int);
unsigned int square_unsigned(int);
int main(int argc, char *argv[]) {
  unsigned int ret = square_unsigned(2);
  if (ret != 4) {
    printf("Got %u instead of 4\n", ret);
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x2,%edi
call   1040 <square_unsigned@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x4,-0x14(%rbp)
je     1168 <main+0x48>
mov    -0x14(%rbp),%esi
lea    0xea9(%rip),%rdi
call   1030 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    116f <main+0x4f>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x2,%edi
call   1040 <square_unsigned@plt>
xor    %ecx,%ecx
cmp    $0x4,%eax
je     1145 <main+0x25>
lea    0xec7(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    $0x1,%ecx
mov    %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [21 x i8] c"Got %u instead of 4\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @square_unsigned(i32 2)
%4 = icmp eq i32 %3, 4
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 %3)
br label %7
7: ; preds = %2, %5
%8 = phi i32 [ 1, %5 ], [ 0, %2 ]
ret i32 %8
}
char *strsep(char **s, const char *ct) {
  char *sbegin = *s, *end;
  if (sbegin == ((void *)0))
    return ((void *)0);
  end = strpbrk(sbegin, ct);
  if (end)
    *end++ = '\0';
  *s = end;
  return sbegin;
}


x86 assembly (clang, -O0):
<strsep>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    1143 <strsep+0x33>
movq   $0x0,-0x8(%rbp)
jmp    1184 <strsep+0x74>
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <strpbrk@plt>
mov    %rax,-0x28(%rbp)
cmpq   $0x0,-0x28(%rbp)
je     1171 <strsep+0x61>
mov    -0x28(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x28(%rbp)
movb   $0x0,(%rax)
mov    -0x28(%rbp),%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strsep>:
push   %r14
push   %rbx
push   %rax
mov    (%rdi),%rbx
test   %rbx,%rbx
je     113d <strsep+0x2d>
mov    %rdi,%r14
mov    %rbx,%rdi
call   1030 <strpbrk@plt>
test   %rax,%rax
je     1138 <strsep+0x28>
mov    %rax,%rcx
add    $0x1,%rcx
movb   $0x0,(%rax)
jmp    113a <strsep+0x2a>
xor    %ecx,%ecx
mov    %rcx,(%r14)
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @strsep(i8** %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8**
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
store i8** %0, i8*** %4
store i8* %1, i8** %5
%8 = load i8**, i8*** %4
%9 = load i8*, i8** %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 %26
13: ; preds = %2
%14 = load i8*, i8** %6
%15 = load i8*, i8** %5
%16 = call i8* @strpbrk(i8* %14, i8* %15)
store i8* %16, i8** %7
%17 = load i8*, i8** %7
%18 = icmp ne i8* %17, null
br i1 %18, label %19, label %22
19: ; preds = %13
%20 = load i8*, i8** %7
%21 = getelementptr inbounds i8, i8* %20, i32 1
store i8* %21, i8** %7
store i8 0, i8* %20
br label %22
22: ; preds = %19, %13
%23 = load i8*, i8** %7
%24 = load i8**, i8*** %4
store i8* %23, i8** %24
%25 = load i8*, i8** %6
store i8* %25, i8** %3
br label %26
26: ; preds = %22, %12
%27 = load i8*, i8** %3
ret i8* %27
}

LLVM IR (-O2):
define i8* @strsep(i8** nocapture %0, i8* nocapture %1) {
%3 = load i8*, i8** %0
%4 = icmp eq i8* %3, null
br i1 %4, label %12, label %5
5: ; preds = %2
%6 = tail call i8* @strpbrk(i8* %3, i8* %1)
%7 = icmp eq i8* %6, null
br i1 %7, label %10, label %8
8: ; preds = %5
%9 = getelementptr inbounds i8, i8* %6, i64 1
store i8 0, i8* %6
br label %10
10: ; preds = %8, %5
%11 = phi i8* [ %9, %8 ], [ null, %5 ]
store i8* %11, i8** %0
br label %12
12: ; preds = %2, %10
ret i8* %3
}
/* Variables and functions */
int tolower(char);
int ceasar(char c) { return tolower(c) - 'a'; }


x86 assembly (clang, -O0):
<ceasar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edi
call   1030 <tolower@plt>
sub    $0x61,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ceasar>:
push   %rax
call   1030 <tolower@plt>
add    $0xffffff9f,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @ceasar(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = call i32 @tolower(i8 signext %3)
%5 = sub nsw i32 %4, 97
ret i32 %5
}

LLVM IR (-O2):
define i32 @ceasar(i8 signext %0) {
%2 = tail call i32 @tolower(i8 signext %0)
%3 = add nsw i32 %2, -97
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void stub1();
void choose_myFunc(void (*func_ptr)(void)) {
  printf("entering choose_myFunc\n");
  (*func_ptr)();
  printf("exiting choose_myFunc\n");
}


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

x86 assembly (clang, -O2):
<choose_myFunc>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rdi
call   1030 <puts@plt>
call   *%rbx
lea    0xeee(%rip),%rdi
pop    %rbx
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [24 x i8] c"entering choose_myFunc\0A\00"
@.str.1 = [23 x i8] c"exiting choose_myFunc\0A\00"
define void @choose_myFunc(void ()* %0) {
%2 = alloca void ()*
store void ()* %0, void ()** %2
%3 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%4 = load void ()*, void ()** %2
%5 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [23 x i8] c"entering choose_myFunc\00"
@str.2 = [22 x i8] c"exiting choose_myFunc\00"
define void @choose_myFunc(void ()* nocapture %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str, i64 0, i64 0))
tail call void %0()
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str.2, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void Usage(void) {
  printf("\n");
  printf("Usage:\n");
  printf("merge some file to then end of uboot\n");
  printf("merge_uboot.exe u-boot.bin infile outfile "
         "mode[secmonitor|secos|scp]\n\n");
}


x86 assembly (clang, -O0):
<Usage>:
push   %rbp
mov    %rsp,%rbp
lea    0xf58(%rip),%rdi
call   1030 <printf@plt>
lea    0xed9(%rip),%rdi
call   1030 <printf@plt>
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
lea    0xeef(%rip),%rdi
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<Usage>:
push   %rax
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xece(%rip),%rdi
call   1040 <puts@plt>
lea    0xec9(%rip),%rdi
call   1040 <puts@plt>
lea    0xee2(%rip),%rdi
pop    %rax
jmp    1040 <puts@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"\0A\00"
@.str.1 = [8 x i8] c"Usage:\0A\00"
@.str.2 = [38 x i8] c"merge some file to then end of uboot\0A\00"
@.str.3 = [71 x i8] c"merge_uboot.exe u-boot.bin infile outfile mode[secmonitor|secos|scp]\0A\0A\00"
define void @Usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([71 x i8], [71 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [7 x i8] c"Usage:\00"
@str.4 = [37 x i8] c"merge some file to then end of uboot\00"
@str.5 = [70 x i8] c"merge_uboot.exe u-boot.bin infile outfile mode[secmonitor|secos|scp]\0A\00"
define void @Usage() {
%1 = tail call i32 @putchar(i32 10)
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @str.4, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([70 x i8], [70 x i8]* @str.5, i64 0, i64 0))
ret void
}
int test_imm_A3uint8_mem(unsigned char *val) {
  return ((*val) & (-0xA3 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_A3uint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, 93
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int dwarf_get_ORD_name(unsigned int, char const **);
char const *ellipname(int, unsigned int, char const *, char *, int);
const char *get_ORD_name(unsigned int val_in, int printonerr) {
  const char *v = 0;
  int res = dwarf_get_ORD_name(val_in, &v);
  return ellipname(res, val_in, v, "ORD", printonerr);
}


x86 assembly (clang, -O0):
<get_ORD_name>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x10(%rbp),%rsi
call   1040 <dwarf_get_ORD_name@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rdx
mov    -0x8(%rbp),%r8d
lea    0xea6(%rip),%rcx
call   1030 <ellipname@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_ORD_name>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
movq   $0x0,(%rsp)
mov    %rsp,%rsi
call   1040 <dwarf_get_ORD_name@plt>
mov    (%rsp),%rdx
lea    0xebe(%rip),%rcx
mov    %eax,%edi
mov    %ebp,%esi
mov    %ebx,%r8d
call   1030 <ellipname@plt>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [4 x i8] c"ORD\00"
define i8* @get_ORD_name(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
store i8* null, i8** %5
%7 = load i32, i32* %3
%8 = call i32 @dwarf_get_ORD_name(i32 %7, i8** %5)
store i32 %8, i32* %6
%9 = load i32, i32* %6
%10 = load i32, i32* %3
%11 = load i8*, i8** %5
%12 = load i32, i32* %4
%13 = call i8* @ellipname(i32 %9, i32 %10, i8* %11, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %12)
ret i8* %13
}

LLVM IR (-O2):
@.str = [4 x i8] c"ORD\00"
define i8* @get_ORD_name(i32 %0, i32 %1) {
%3 = alloca i8*
%4 = bitcast i8** %3 to i8*
store i8* null, i8** %3
%5 = call i32 @dwarf_get_ORD_name(i32 %0, i8** %3)
%6 = load i8*, i8** %3
%7 = call i8* @ellipname(i32 %5, i32 %0, i8* %6, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i8* %7
}
int test_imm_1Auint64_lowword_reg(unsigned long long val) {
  return ((val) & (0x1A << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_1Auint64_lowword_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
and    $0x1a,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_1Auint64_lowword_reg>:
test   $0x1a,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_1Auint64_lowword_reg(i64 %0) {
%2 = and i64 %0, 26
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int hello() {
  printf("** This is not GNU Hello.  There is no built-in mail reader. **\n");
  return 0xe110;
}


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

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

LLVM IR (-O0):
@.str = [65 x i8] c"** This is not GNU Hello. There is no built-in mail reader. **\0A\00"
define i32 @hello() {
%1 = call i32 @printf(i8* getelementptr inbounds ([65 x i8], [65 x i8]* @.str, i64 0, i64 0))
ret i32 57616
}

LLVM IR (-O2):
@str = [64 x i8] c"** This is not GNU Hello. There is no built-in mail reader. **\00"
define i32 @hello() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([64 x i8], [64 x i8]* @str, i64 0, i64 0))
ret i32 57616
}
void XSetFontPath() {}


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

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

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

LLVM IR (-O2):
define void @XSetFontPath() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ getpid();
int kill(int /*<<< orphan*/, int);
int raise(int signal) { return kill(getpid(), signal); }


x86 assembly (clang, -O0):
<raise>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <getpid@plt>
mov    %eax,%edi
mov    -0x4(%rbp),%esi
call   1040 <kill@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<raise>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <getpid@plt>
mov    %eax,%edi
mov    %ebx,%esi
pop    %rbx
jmp    1040 <kill@plt>

LLVM IR (-O0):
define i32 @raise(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @getpid()
%4 = load i32, i32* %2
%5 = call i32 @kill(i32 %3, i32 %4)
ret i32 %5
}

LLVM IR (-O2):
define i32 @raise(i32 %0) {
%2 = tail call i32 (...) @getpid()
%3 = tail call i32 @kill(i32 %2, i32 %0)
ret i32 %3
}
__attribute__((always_)) void memcpy_fromio(void *to, const volatile void *from,
                                            unsigned len) {
  __memcpy_fromio(to, (unsigned long)from, len);
}


x86 assembly (clang, -O0):
<memcpy_fromio>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    $0x0,%al
call   1030 <__memcpy_fromio@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @memcpy_fromio(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = ptrtoint i8* %8 to i64
%10 = load i32, i32* %6
%11 = call i32 (i8*, i64, i32, ...) bitcast (i32 (...)* @__memcpy_fromio to i32 (i8*, i64, i32, ...)*)(i8* %7, i64 %9, i32 %10)
ret void
}

LLVM IR (-O2):
define void @memcpy_fromio(i8* %0, i8* %1, i32 %2) {
%4 = ptrtoint i8* %1 to i64
%5 = tail call i32 (i8*, i64, i32, ...) bitcast (i32 (...)* @__memcpy_fromio to i32 (i8*, i64, i32, ...)*)(i8* %0, i64 %4, i32 %2)
ret void
}
/* Variables and functions */
double SIN_0_180(double);
double SIN_180(double x) {
  if (x < 0)
    return -SIN_0_180(-x);
  else
    return SIN_0_180(x);
}


x86 assembly (clang, -O0):
<SIN_180>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x10(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    116d <SIN_180+0x5d>
movsd  -0x10(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
call   1030 <SIN_0_180@plt>
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    117c <SIN_180+0x6c>
movsd  -0x10(%rbp),%xmm0
call   1030 <SIN_0_180@plt>
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SIN_180>:
xorpd  %xmm1,%xmm1
ucomisd %xmm0,%xmm1
jbe    1132 <SIN_180+0x22>
push   %rax
xorpd  0xedd(%rip),%xmm0
call   1030 <SIN_0_180@plt>
xorpd  0xed0(%rip),%xmm0
pop    %rax
ret
jmp    1030 <SIN_0_180@plt>

LLVM IR (-O0):
define double @SIN_180(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %3
%4 = load double, double* %3
%5 = fcmp olt double %4, 0.000000e+00
br i1 %5, label %6, label %11
6: ; preds = %1
%7 = load double, double* %3
%8 = fneg double %7
%9 = call double @SIN_0_180(double %8)
%10 = fneg double %9
store double %10, double* %2
br label %14
11: ; preds = %1
%12 = load double, double* %3
%13 = call double @SIN_0_180(double %12)
store double %13, double* %2
br label %14
14: ; preds = %11, %6
%15 = load double, double* %2
ret double %15
}

LLVM IR (-O2):
define double @SIN_180(double %0) {
%2 = fcmp olt double %0, 0.000000e+00
br i1 %2, label %3, label %7
3: ; preds = %1
%4 = fneg double %0
%5 = tail call double @SIN_0_180(double %4)
%6 = fneg double %5
br label %9
7: ; preds = %1
%8 = tail call double @SIN_0_180(double %0)
br label %9
9: ; preds = %7, %3
%10 = phi double [ %6, %3 ], [ %8, %7 ]
ret double %10
}
/* Variables and functions */
double gauss_integral(double);
double symrange(double z) { return 2.0 * (gauss_integral(z) - 0.5); }


x86 assembly (clang, -O0):
<symrange>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <gauss_integral@plt>
movaps %xmm0,%xmm1
movsd  0xed6(%rip),%xmm0
subsd  %xmm0,%xmm1
movsd  0xec2(%rip),%xmm0
mulsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<symrange>:
push   %rax
call   1030 <gauss_integral@plt>
addsd  0xee2(%rip),%xmm0
addsd  %xmm0,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @symrange(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call double @gauss_integral(double %3)
%5 = fsub double %4, 5.000000e-01
%6 = fmul double 2.000000e+00, %5
ret double %6
}

LLVM IR (-O2):
define double @symrange(double %0) {
%2 = tail call double @gauss_integral(double %0)
%3 = fadd double %2, -5.000000e-01
%4 = fmul double %3, 2.000000e+00
ret double %4
}
/* Variables and functions */
int /*<<< orphan*/ arm_memio_ldrsb(int /*<<< orphan*/);
int /*<<< orphan*/ arm_memio_regdh_op();
void arm_ldrsb_reg() { arm_memio_ldrsb(arm_memio_regdh_op()); }


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

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

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

LLVM IR (-O2):
define void @arm_ldrsb_reg() {
%1 = tail call i32 (...) @arm_memio_regdh_op()
%2 = tail call i32 @arm_memio_ldrsb(i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ SIGALRM;
int /*<<< orphan*/ pause();
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ signal(int /*<<< orphan*/, void (*)(int));
int main() {
  void countdown(int);
  int set_ticker(int n_msecs);
  signal(SIGALRM, countdown);
  if (set_ticker(500) == -1)
    perror("set_ticker");
  else
    while (1) {
      pause();
    }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2e92(%rip),%rax
mov    (%rax),%edi
mov    0x2e79(%rip),%rsi
call   1030 <signal@plt>
mov    $0x1f4,%edi
call   1040 <set_ticker@plt>
cmp    $0xffffffff,%eax
jne    1188 <main+0x48>
lea    0xe82(%rip),%rdi
call   1060 <perror@plt>
jmp    1199 <main+0x59>
jmp    118d <main+0x4d>
mov    $0x0,%al
call   1050 <pause@plt>
jmp    118d <main+0x4d>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2ea0(%rip),%rax
mov    (%rax),%edi
mov    0x2e87(%rip),%rsi
call   1030 <signal@plt>
mov    $0x1f4,%edi
call   1040 <set_ticker@plt>
cmp    $0xffffffff,%eax
je     1179 <main+0x39>
cs nopw 0x0(%rax,%rax,1)
nop
xor    %eax,%eax
call   1050 <pause@plt>
jmp    1170 <main+0x30>
lea    0xe80(%rip),%rdi
call   1060 <perror@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@SIGALRM = global i32 0
@.str = [11 x i8] c"set_ticker\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = load i32, i32* @SIGALRM
%3 = call i32 @signal(i32 %2, void (i32)* @countdown)
%4 = call i32 @set_ticker(i32 500)
%5 = icmp eq i32 %4, -1
br i1 %5, label %6, label %8
6: ; preds = %0
%7 = call i32 @perror(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
br label %11
8: ; preds = %0
br label %9
9: ; preds = %8, %9
%10 = call i32 (...) @pause()
br label %9
11: ; preds = %6
ret i32 0
}

LLVM IR (-O2):
@SIGALRM = global i32 0
@.str = [11 x i8] c"set_ticker\00"
define i32 @main() {
%1 = load i32, i32* @SIGALRM
%2 = tail call i32 @signal(i32 %1, void (i32)* @countdown)
%3 = tail call i32 @set_ticker(i32 500)
%4 = icmp eq i32 %3, -1
br i1 %4, label %5, label %7
5: ; preds = %0
%6 = tail call i32 @perror(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
ret i32 0
7: ; preds = %0, %7
%8 = tail call i32 (...) @pause()
br label %7
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void output_unknown_return_value() { fprintf(stderr, " = ?\n"); }


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

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [6 x i8] c" = ?\0A\00"
define void @output_unknown_return_value() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [6 x i8] c" = ?\0A\00"
define void @output_unknown_return_value() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret void
}
int foo(int x, int y) { return x == y; }


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
xor    %eax,%eax
cmp    %esi,%edi
sete   %al
ret

LLVM IR (-O0):
define i32 @foo(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 eq i32 %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @foo(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
void parseheader(char *header) {}


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

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

LLVM IR (-O0):
define void @parseheader(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
ret void
}

LLVM IR (-O2):
define void @parseheader(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ newline();
int /*<<< orphan*/ output_with_tab(char *);
void gen_jump_case(void) {
  output_with_tab("jump cccase");
  newline();
}


x86 assembly (clang, -O0):
<gen_jump_case>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1040 <output_with_tab@plt>
mov    $0x0,%al
call   1030 <newline@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<gen_jump_case>:
push   %rax
lea    0xed8(%rip),%rdi
call   1040 <output_with_tab@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <newline@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"jump cccase\00"
define void @gen_jump_case() {
%1 = call i32 @output_with_tab(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (...) @newline()
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"jump cccase\00"
define void @gen_jump_case() {
%1 = tail call i32 @output_with_tab(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (...) @newline()
ret void
}
clrmes(f, n) int f, n;
{
  mlwrite("");
  return (1);
  f = f;
  n = n;
}


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

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

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define i32 @clrmes(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = call i32 (i8*, ...) bitcast (i32 (...)* @mlwrite to i32 (i8*, ...)*)(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
ret i32 1
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
define i32 @clrmes(i32 %0, i32 %1) {
%3 = tail call i32 (i8*, ...) bitcast (i32 (...)* @mlwrite to i32 (i8*, ...)*)(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
ret i32 1
}
void _dummyThreadCleanup(void *info) {}


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

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

LLVM IR (-O0):
define void @_dummyThreadCleanup(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
ret void
}

LLVM IR (-O2):
define void @_dummyThreadCleanup(i8* nocapture %0) {
ret void
}
/* Variables and functions */
scalar_t__ uwsgi_daemon_check_pid_reload(int);
int uwsgi_master_check_daemons_death(int diedpid) {
  if (uwsgi_daemon_check_pid_reload(diedpid)) {
    return -1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<uwsgi_master_check_daemons_death>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <uwsgi_daemon_check_pid_reload@plt>
cmp    $0x0,%rax
je     1139 <uwsgi_master_check_daemons_death+0x29>
movl   $0xffffffff,-0x4(%rbp)
jmp    1140 <uwsgi_master_check_daemons_death+0x30>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uwsgi_master_check_daemons_death>:
push   %rax
call   1030 <uwsgi_daemon_check_pid_reload@plt>
neg    %rax
sbb    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @uwsgi_master_check_daemons_death(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = call i64 @uwsgi_daemon_check_pid_reload(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 %9
8: ; preds = %1
store i32 0, i32* %2
br label %9
9: ; preds = %8, %7
%10 = load i32, i32* %2
ret i32 %10
}

LLVM IR (-O2):
define i32 @uwsgi_master_check_daemons_death(i32 %0) {
%2 = tail call i64 @uwsgi_daemon_check_pid_reload(i32 %0)
%3 = icmp ne i64 %2, 0
%4 = sext i1 %3 to i32
ret i32 %4
}
int loadgldriver(const char *a) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @loadgldriver(i8* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int f(int *);
int main(void) {
  int x = 5;
  int *p = &x;
  return f(p);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x5,-0x8(%rbp)
lea    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <f@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0x5,0x4(%rsp)
lea    0x4(%rsp),%rdi
call   1030 <f@plt>
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 5, i32* %1
%3 = call i32 @f(i32* %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ my_cold_memset(void *, int, int);
t(void *a, int b, int c) {
  if (a)
    my_cold_memset(a, b, 40);
}


x86 assembly (clang, -O0):
<t>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     113e <t+0x2e>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    $0x28,%edx
call   1030 <my_cold_memset@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<t>:
test   %rdi,%rdi
je     1124 <t+0x14>
push   %rax
mov    $0x28,%edx
call   1030 <my_cold_memset@plt>
add    $0x8,%rsp
ret

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

LLVM IR (-O2):
define i32 @t(i8* %0, i32 %1, i32 %2) {
%4 = icmp eq i8* %0, null
br i1 %4, label %7, label %5
5: ; preds = %3
%6 = tail call i32 @my_cold_memset(i8* %0, i32 %1, i32 40)
br label %7
7: ; preds = %5, %3
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int main() {
  unsigned char a = 1;
  a |= 2;
  assert(a == 3);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movb   $0x1,-0x5(%rbp)
movzbl -0x5(%rbp),%eax
or     $0x2,%eax
mov    %al,-0x5(%rbp)
movzbl -0x5(%rbp),%eax
cmp    $0x3,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%edi
call   1030 <assert@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
store i32 0, i32* %1
store i8 1, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = or i32 %4, 2
%6 = trunc i32 %5 to i8
store i8 %6, i8* %2
%7 = load i8, i8* %2
%8 = zext i8 %7 to i32
%9 = icmp eq i32 %8, 3
%10 = zext i1 %9 to i32
%11 = call i32 @assert(i32 %10)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @assert(i32 1)
ret i32 0
}
void opencl_nd_address_old(int linear_id, const unsigned int *dims,
                           unsigned int *id) {
  id[2] = linear_id / (dims[1] * dims[0]);
  id[1] = (linear_id / dims[0]) % dims[1];
  id[0] = (linear_id % dims[0]);
  return;
}


x86 assembly (clang, -O0):
<opencl_nd_address_old>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x10(%rbp),%rcx
mov    0x4(%rcx),%ecx
mov    -0x10(%rbp),%rdx
imul   (%rdx),%ecx
xor    %edx,%edx
div    %ecx
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,0x8(%rax)
mov    -0x4(%rbp),%eax
mov    -0x10(%rbp),%rcx
xor    %edx,%edx
divl   (%rcx)
mov    -0x10(%rbp),%rcx
xor    %edx,%edx
divl   0x4(%rcx)
mov    -0x18(%rbp),%rax
mov    %edx,0x4(%rax)
mov    -0x4(%rbp),%eax
mov    -0x10(%rbp),%rcx
xor    %edx,%edx
divl   (%rcx)
mov    -0x18(%rbp),%rax
mov    %edx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<opencl_nd_address_old>:
mov    %rdx,%r8
mov    (%rsi),%ecx
imul   0x4(%rsi),%ecx
mov    %edi,%eax
xor    %edx,%edx
div    %ecx
mov    %eax,0x8(%r8)
mov    %edi,%eax
xor    %edx,%edx
divl   (%rsi)
xor    %edx,%edx
divl   0x4(%rsi)
mov    %edx,0x4(%r8)
mov    %edi,%eax
xor    %edx,%edx
divl   (%rsi)
mov    %edx,(%r8)
ret

LLVM IR (-O0):
define void @opencl_nd_address_old(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 = getelementptr inbounds i32, i32* %8, i64 1
%10 = load i32, i32* %9
%11 = load i32*, i32** %5
%12 = getelementptr inbounds i32, i32* %11, i64 0
%13 = load i32, i32* %12
%14 = mul i32 %10, %13
%15 = udiv i32 %7, %14
%16 = load i32*, i32** %6
%17 = getelementptr inbounds i32, i32* %16, i64 2
store i32 %15, i32* %17
%18 = load i32, i32* %4
%19 = load i32*, i32** %5
%20 = getelementptr inbounds i32, i32* %19, i64 0
%21 = load i32, i32* %20
%22 = udiv i32 %18, %21
%23 = load i32*, i32** %5
%24 = getelementptr inbounds i32, i32* %23, i64 1
%25 = load i32, i32* %24
%26 = urem i32 %22, %25
%27 = load i32*, i32** %6
%28 = getelementptr inbounds i32, i32* %27, i64 1
store i32 %26, i32* %28
%29 = load i32, i32* %4
%30 = load i32*, i32** %5
%31 = getelementptr inbounds i32, i32* %30, i64 0
%32 = load i32, i32* %31
%33 = urem i32 %29, %32
%34 = load i32*, i32** %6
%35 = getelementptr inbounds i32, i32* %34, i64 0
store i32 %33, i32* %35
ret void
}

LLVM IR (-O2):
define void @opencl_nd_address_old(i32 %0, i32* nocapture %1, i32* nocapture writeonly %2) {
%4 = getelementptr inbounds i32, i32* %1, i64 1
%5 = load i32, i32* %4
%6 = load i32, i32* %1
%7 = mul i32 %6, %5
%8 = udiv i32 %0, %7
%9 = getelementptr inbounds i32, i32* %2, i64 2
store i32 %8, i32* %9
%10 = load i32, i32* %1
%11 = udiv i32 %0, %10
%12 = load i32, i32* %4
%13 = urem i32 %11, %12
%14 = getelementptr inbounds i32, i32* %2, i64 1
store i32 %13, i32* %14
%15 = load i32, i32* %1
%16 = urem i32 %0, %15
store i32 %16, i32* %2
ret void
}
/* Type definitions */
struct wiphy {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ wiphy_free(struct wiphy *);
int /*<<< orphan*/ wiphy_unregister(struct wiphy *);
void wlan_free_wiphy(struct wiphy *wiphy) {
  wiphy_unregister(wiphy);
  wiphy_free(wiphy);
}


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

x86 assembly (clang, -O2):
<wlan_free_wiphy>:
push   %rbx
mov    %rdi,%rbx
call   1030 <wiphy_unregister@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <wiphy_free@plt>

LLVM IR (-O0):
%struct.wiphy = type { i32 }
define void @wlan_free_wiphy(%struct.wiphy* %0) {
%2 = alloca %struct.wiphy*
store %struct.wiphy* %0, %struct.wiphy** %2
%3 = load %struct.wiphy*, %struct.wiphy** %2
%4 = call i32 @wiphy_unregister(%struct.wiphy* %3)
%5 = load %struct.wiphy*, %struct.wiphy** %2
%6 = call i32 @wiphy_free(%struct.wiphy* %5)
ret void
}

LLVM IR (-O2):
%struct.wiphy = type { i32 }
define void @wlan_free_wiphy(%struct.wiphy* %0) {
%2 = tail call i32 @wiphy_unregister(%struct.wiphy* %0)
%3 = tail call i32 @wiphy_free(%struct.wiphy* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void func1() { printf("void function called\n"); }


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

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

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

LLVM IR (-O2):
@str = [21 x i8] c"void function called\00"
define void @func1() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str, i64 0, i64 0))
ret void
}
/* Type definitions */
struct rtas_mt_scn {
  int dummy;
};
struct rtas_event {
  int dummy;
};

/* Variables and functions */
scalar_t__ get_re_scn(struct rtas_event *, int);
struct rtas_mt_scn *rtas_get_mt_scn(struct rtas_event *re) {
  return (struct rtas_mt_scn *)get_re_scn(re, 15);
}


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

x86 assembly (clang, -O2):
<rtas_get_mt_scn>:
mov    $0xf,%esi
jmp    1030 <get_re_scn@plt>

LLVM IR (-O0):
%struct.rtas_mt_scn = type { i32 }
%struct.rtas_event = type { i32 }
define %struct.rtas_mt_scn* @rtas_get_mt_scn(%struct.rtas_event* %0) {
%2 = alloca %struct.rtas_event*
store %struct.rtas_event* %0, %struct.rtas_event** %2
%3 = load %struct.rtas_event*, %struct.rtas_event** %2
%4 = call i64 @get_re_scn(%struct.rtas_event* %3, i32 15)
%5 = inttoptr i64 %4 to %struct.rtas_mt_scn*
ret %struct.rtas_mt_scn* %5
}

LLVM IR (-O2):
%struct.rtas_mt_scn = type { i32 }
%struct.rtas_event = type { i32 }
define %struct.rtas_mt_scn* @rtas_get_mt_scn(%struct.rtas_event* %0) {
%2 = tail call i64 @get_re_scn(%struct.rtas_event* %0, i32 15)
%3 = inttoptr i64 %2 to %struct.rtas_mt_scn*
ret %struct.rtas_mt_scn* %3
}
float tocelsius(float fah) { return (fah - 32) * (5.0 / 9.0); }


x86 assembly (clang, -O0):
<tocelsius>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
movss  0xef2(%rip),%xmm1
subss  %xmm1,%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xeda(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<tocelsius>:
addss  0xef8(%rip),%xmm0
cvtss2sd %xmm0,%xmm0
mulsd  0xef4(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
ret

LLVM IR (-O0):
define float @tocelsius(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fsub float %3, 3.200000e+01
%5 = fpext float %4 to double
%6 = fmul double %5, 0x3FE1C71C71C71C72
%7 = fptrunc double %6 to float
ret float %7
}

LLVM IR (-O2):
define float @tocelsius(float %0) {
%2 = fadd float %0, -3.200000e+01
%3 = fpext float %2 to double
%4 = fmul double %3, 0x3FE1C71C71C71C72
%5 = fptrunc double %4 to float
ret float %5
}
__attribute__((__no__)) void
do_nothing_trailing_hole_assigned_copy(struct test_trailing_hole *ptr) {
  if ((unsigned long)ptr > 0x2)
    return;
  else
    return;
}


x86 assembly (clang, -O0):
<do_nothing_trailing_hole_assigned_copy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmp    $0x2,%rax
jbe    111b <do_nothing_trailing_hole_assigned_copy+0x1b>
jmp    1120 <do_nothing_trailing_hole_assigned_copy+0x20>
jmp    1120 <do_nothing_trailing_hole_assigned_copy+0x20>
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.test_trailing_hole = type opaque
define void @do_nothing_trailing_hole_assigned_copy(%struct.test_trailing_hole* %0) {
%2 = alloca %struct.test_trailing_hole*
store %struct.test_trailing_hole* %0, %struct.test_trailing_hole** %2
%3 = load %struct.test_trailing_hole*, %struct.test_trailing_hole** %2
%4 = ptrtoint %struct.test_trailing_hole* %3 to i64
%5 = icmp ugt i64 %4, 2
br i1 %5, label %6, label %7
6: ; preds = %1
br label %8
7: ; preds = %1
br label %8
8: ; preds = %7, %6
ret void
}

LLVM IR (-O2):
%struct.test_trailing_hole = type opaque
define void @do_nothing_trailing_hole_assigned_copy(%struct.test_trailing_hole* nocapture %0) {
ret void
}
void ima_counts_get(struct file *file) { return; }


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

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

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

LLVM IR (-O2):
%struct.file = type opaque
define void @ima_counts_get(%struct.file* nocapture %0) {
ret void
}
/* Variables and functions */
scalar_t__ malloc(int);
int *foo() {
  int *res = (int *)malloc(3 * sizeof(int));
  res[0] = 0;
  return res;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0xc,%edi
call   1030 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movl   $0x0,(%rax)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
push   %rax
mov    $0xc,%edi
call   1030 <malloc@plt>
movl   $0x0,(%rax)
pop    %rcx
ret

LLVM IR (-O0):
define i32* @foo() {
%1 = alloca i32*
%2 = call i64 @malloc(i32 12)
%3 = inttoptr i64 %2 to i32*
store i32* %3, i32** %1
%4 = load i32*, i32** %1
%5 = getelementptr inbounds i32, i32* %4, i64 0
store i32 0, i32* %5
%6 = load i32*, i32** %1
ret i32* %6
}

LLVM IR (-O2):
define i32* @foo() {
%1 = tail call i64 @malloc(i32 12)
%2 = inttoptr i64 %1 to i32*
store i32 0, i32* %2
ret i32* %2
}
/* Variables and functions */
scalar_t__ in(int, int, int);
int u8islatinsigni(int n) {
  return in(n, 0xA1, 0xBF) || n == 0xD7 || n == 0xF7;
}


x86 assembly (clang, -O0):
<u8islatinsigni>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    $0xa1,%esi
mov    $0xbf,%edx
call   1030 <in@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x5(%rbp)
jne    115e <u8islatinsigni+0x4e>
mov    $0x1,%al
cmpl   $0xd7,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     115e <u8islatinsigni+0x4e>
cmpl   $0xf7,-0x4(%rbp)
sete   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<u8islatinsigni>:
push   %rbx
mov    %edi,%ebx
mov    $0xa1,%esi
mov    $0xbf,%edx
call   1030 <in@plt>
test   %rax,%rax
setne  %al
and    $0xffffffdf,%ebx
cmp    $0xd7,%ebx
sete   %cl
or     %al,%cl
movzbl %cl,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @u8islatinsigni(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i64 @in(i32 %3, i32 161, i32 191)
%5 = icmp ne i64 %4, 0
br i1 %5, label %12, label %6
6: ; preds = %1
%7 = load i32, i32* %2
%8 = icmp eq i32 %7, 215
br i1 %8, label %12, label %9
9: ; preds = %6
%10 = load i32, i32* %2
%11 = icmp eq i32 %10, 247
br label %12
12: ; preds = %9, %6, %1
%13 = phi i1 [ true, %6 ], [ true, %1 ], [ %11, %9 ]
%14 = zext i1 %13 to i32
ret i32 %14
}

LLVM IR (-O2):
define i32 @u8islatinsigni(i32 %0) {
%2 = tail call i64 @in(i32 %0, i32 161, i32 191)
%3 = icmp ne i64 %2, 0
%4 = and i32 %0, -33
%5 = icmp eq i32 %4, 215
%6 = or i1 %5, %3
%7 = zext i1 %6 to i32
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ KVM_CHECK_EXTENSION;
int ioctl(int, int /*<<< orphan*/, int);
int kvm_check_extension(int fd, int extension) {
  return ioctl(fd, KVM_CHECK_EXTENSION, extension);
}


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

x86 assembly (clang, -O2):
<kvm_check_extension>:
mov    %esi,%edx
mov    0x2ecf(%rip),%rax
mov    (%rax),%esi
jmp    1030 <ioctl@plt>

LLVM IR (-O0):
@KVM_CHECK_EXTENSION = global i32 0
define i32 @kvm_check_extension(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* @KVM_CHECK_EXTENSION
%7 = load i32, i32* %4
%8 = call i32 @ioctl(i32 %5, i32 %6, i32 %7)
ret i32 %8
}

LLVM IR (-O2):
@KVM_CHECK_EXTENSION = global i32 0
define i32 @kvm_check_extension(i32 %0, i32 %1) {
%3 = load i32, i32* @KVM_CHECK_EXTENSION
%4 = tail call i32 @ioctl(i32 %0, i32 %3, i32 %1)
ret i32 %4
}
unsigned numMallocCalls() { return 0; }


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

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

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

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

/* Variables and functions */
int spi_send(int *, int);
int led_clear() {
  uint8_t out[8 * 8] = {
      1, 0, 1, 0, 1, 0, 1, 0, 2, 0, 2, 0, 2, 0, 2, 0, 3, 0, 3, 0, 3, 0,
      3, 0, 4, 0, 4, 0, 4, 0, 4, 0, 5, 0, 5, 0, 5, 0, 5, 0, 6, 0, 6, 0,
      6, 0, 6, 0, 7, 0, 7, 0, 7, 0, 7, 0, 8, 0, 8, 0, 8, 0, 8, 0,
  };
  return spi_send(out, 8 * 8);
}


x86 assembly (clang, -O0):
<led_clear>:
push   %rbp
mov    %rsp,%rbp
sub    $0x100,%rsp
lea    -0x100(%rbp),%rdi
lea    0xec7(%rip),%rsi
mov    $0x100,%edx
call   1030 <memcpy@plt>
lea    -0x100(%rbp),%rdi
mov    $0x40,%esi
call   1040 <spi_send@plt>
add    $0x100,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<led_clear>:
push   %rbx
sub    $0x100,%rsp
lea    0xed1(%rip),%rsi
mov    %rsp,%rbx
mov    $0x100,%edx
mov    %rbx,%rdi
call   1030 <memcpy@plt>
mov    %rbx,%rdi
mov    $0x40,%esi
call   1040 <spi_send@plt>
add    $0x100,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.led_clear.out = [64 x i32] [i32 1, i32 0, i32 1, i32 0, i32 1, i32 0, i32 1, i32 0, i32 2, i32 0, i32 2, i32 0, i32 2, i32 0, i32 2, i32 0, i32 3, i32 0, i32 3, i32 0, i32 3, i32 0, i32 3, i32 0, i32 4, i32 0, i32 4, i32 0, i32 4, i32 0, i32 4, i32 0, i32 5, i32 0, i32 5, i32 0, i32 5, i32 0, i32 5, i32 0, i32 6, i32 0, i32 6, i32 0, i32 6, i32 0, i32 6, i32 0, i32 7, i32 0, i32 7, i32 0, i32 7, i32 0, i32 7, i32 0, i32 8, i32 0, i32 8, i32 0, i32 8, i32 0, i32 8, i32 0]
define i32 @led_clear() {
%1 = alloca [64 x i32]
%2 = bitcast [64 x i32]* %1 to i8*
%3 = getelementptr inbounds [64 x i32], [64 x i32]* %1, i64 0, i64 0
%4 = call i32 @spi_send(i32* %3, i32 64)
ret i32 %4
}

LLVM IR (-O2):
@__const.led_clear.out = [64 x i32] [i32 1, i32 0, i32 1, i32 0, i32 1, i32 0, i32 1, i32 0, i32 2, i32 0, i32 2, i32 0, i32 2, i32 0, i32 2, i32 0, i32 3, i32 0, i32 3, i32 0, i32 3, i32 0, i32 3, i32 0, i32 4, i32 0, i32 4, i32 0, i32 4, i32 0, i32 4, i32 0, i32 5, i32 0, i32 5, i32 0, i32 5, i32 0, i32 5, i32 0, i32 6, i32 0, i32 6, i32 0, i32 6, i32 0, i32 6, i32 0, i32 7, i32 0, i32 7, i32 0, i32 7, i32 0, i32 7, i32 0, i32 8, i32 0, i32 8, i32 0, i32 8, i32 0, i32 8, i32 0]
define i32 @led_clear() {
%1 = alloca [64 x i32]
%2 = bitcast [64 x i32]* %1 to i8*
%3 = getelementptr inbounds [64 x i32], [64 x i32]* %1, i64 0, i64 0
%4 = call i32 @spi_send(i32* %3, i32 64)
ret i32 %4
}