xunge/DecIR huggingface dataset:
unsigned long venc_get_pixel_clock(void) {
  WARN("%s: VENC not compiled in, returning pclk as 0\n", __func__);
  return 0;
}


x86 assembly (clang, -O0):
<venc_get_pixel_clock>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
lea    0xf0d(%rip),%rsi
mov    $0x0,%al
call   1030 <WARN@plt>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [47 x i8] c"%s: VENC not compiled in, returning pclk as 0\0A\00"
@__func__.venc_get_pixel_clock = [21 x i8] c"venc_get_pixel_clock\00"
define i64 @venc_get_pixel_clock() {
%1 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @WARN to i32 (i8*, i8*, ...)*)(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([21 x i8], [21 x i8]* @__func__.venc_get_pixel_clock, i64 0, i64 0))
ret i64 0
}

LLVM IR (-O2):
@.str = [47 x i8] c"%s: VENC not compiled in, returning pclk as 0\0A\00"
@__func__.venc_get_pixel_clock = [21 x i8] c"venc_get_pixel_clock\00"
define i64 @venc_get_pixel_clock() {
%1 = tail call i32 (i8*, i8*, ...) bitcast (i32 (...)* @WARN to i32 (i8*, i8*, ...)*)(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([21 x i8], [21 x i8]* @__func__.venc_get_pixel_clock, i64 0, i64 0))
ret i64 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  fprintf(stderr, "Usage: kallsyms [--all-symbols] < in.map > out.S\n");
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [50 x i8] c"Usage: kallsyms [--all-symbols] < in.map > out.S\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [50 x i8] c"Usage: kallsyms [--all-symbols] < in.map > out.S\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
int f(char t[]) { return t[0] - t[-1]; }


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
mov    -0x8(%rbp),%rcx
movsbl -0x1(%rcx),%ecx
sub    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
movsbl (%rdi),%eax
movsbl -0x1(%rdi),%ecx
sub    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @f(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = sext i8 %2 to i32
%4 = getelementptr inbounds i8, i8* %0, i64 -1
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = sub nsw i32 %3, %6
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ all_tests(int, int);
int main() {
  all_tests(0, 0);
  all_tests(1, 2);
  all_tests(4, 3);
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @all_tests(i32 0, i32 0)
%2 = tail call i32 @all_tests(i32 1, i32 2)
%3 = tail call i32 @all_tests(i32 4, i32 3)
ret i32 0
}
int special_div(int a, int b) {
  int t = (a >= (b << 1));
  a -= t * (b << 1);
  return (t << 1) + (a >= b);
}


x86 assembly (clang, -O0):
<special_div>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
shl    $0x1,%ecx
cmp    %ecx,%eax
setge  %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%eax
shl    $0x1,%eax
imul   %eax,%ecx
mov    -0x4(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0xc(%rbp),%eax
shl    $0x1,%eax
mov    -0x4(%rbp),%ecx
cmp    -0x8(%rbp),%ecx
setge  %cl
and    $0x1,%cl
movzbl %cl,%ecx
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<special_div>:
lea    (%rsi,%rsi,1),%eax
xor    %ecx,%ecx
xor    %edx,%edx
cmp    %edi,%eax
setle  %dl
cmovle %eax,%ecx
sub    %ecx,%edi
xor    %eax,%eax
cmp    %esi,%edi
setge  %al
lea    (%rax,%rdx,2),%eax
ret

LLVM IR (-O0):
define i32 @special_div(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = load i32, i32* %4
%8 = shl i32 %7, 1
%9 = icmp sge i32 %6, %8
%10 = zext i1 %9 to i32
store i32 %10, i32* %5
%11 = load i32, i32* %5
%12 = load i32, i32* %4
%13 = shl i32 %12, 1
%14 = mul nsw i32 %11, %13
%15 = load i32, i32* %3
%16 = sub nsw i32 %15, %14
store i32 %16, i32* %3
%17 = load i32, i32* %5
%18 = shl i32 %17, 1
%19 = load i32, i32* %3
%20 = load i32, i32* %4
%21 = icmp sge i32 %19, %20
%22 = zext i1 %21 to i32
%23 = add nsw i32 %18, %22
ret i32 %23
}

LLVM IR (-O2):
define i32 @special_div(i32 %0, i32 %1) {
%3 = shl i32 %1, 1
%4 = icmp sgt i32 %3, %0
%5 = select i1 %4, i32 0, i32 %3
%6 = sub nsw i32 %0, %5
%7 = select i1 %4, i32 0, i32 2
%8 = icmp sge i32 %6, %1
%9 = zext i1 %8 to i32
%10 = or i32 %7, %9
ret i32 %10
}
int kcpinit() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @kcpinit() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ solve(int *, int /*<<< orphan*/);
main() {
  int board[64];
  for (int i = 0; i < 64; i++)
    board[i] = 0;
  solve(board, 0);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x120,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x114(%rbp)
cmpl   $0x40,-0x114(%rbp)
jge    115f <main+0x4f>
movslq -0x114(%rbp),%rax
movl   $0x0,-0x110(%rbp,%rax,4)
mov    -0x114(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x114(%rbp)
jmp    112c <main+0x1c>
lea    -0x110(%rbp),%rdi
xor    %esi,%esi
call   1030 <solve@plt>
xor    %eax,%eax
add    $0x120,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x108,%rsp
xorps  %xmm0,%xmm0
movaps %xmm0,0xf0(%rsp)
movaps %xmm0,0xe0(%rsp)
movaps %xmm0,0xd0(%rsp)
movaps %xmm0,0xc0(%rsp)
movaps %xmm0,0xb0(%rsp)
movaps %xmm0,0xa0(%rsp)
movaps %xmm0,0x90(%rsp)
movaps %xmm0,0x80(%rsp)
movaps %xmm0,0x70(%rsp)
movaps %xmm0,0x60(%rsp)
movaps %xmm0,0x50(%rsp)
movaps %xmm0,0x40(%rsp)
movaps %xmm0,0x30(%rsp)
movaps %xmm0,0x20(%rsp)
movaps %xmm0,0x10(%rsp)
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
xor    %esi,%esi
call   1030 <solve@plt>
xor    %eax,%eax
add    $0x108,%rsp
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca [64 x i32]
%3 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %3
br label %4
4: ; preds = %11, %0
%5 = load i32, i32* %3
%6 = icmp slt i32 %5, 64
br i1 %6, label %7, label %14
7: ; preds = %4
%8 = load i32, i32* %3
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds [64 x i32], [64 x i32]* %2, i64 0, i64 %9
store i32 0, i32* %10
br label %11
11: ; preds = %7
%12 = load i32, i32* %3
%13 = add nsw i32 %12, 1
store i32 %13, i32* %3
br label %4
14: ; preds = %4
%15 = getelementptr inbounds [64 x i32], [64 x i32]* %2, i64 0, i64 0
%16 = call i32 @solve(i32* %15, i32 0)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%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 @solve(i32* %3, i32 0)
ret i32 0
}
/* Variables and functions */
scalar_t__ unknown();
int test15() { (void)(0 || unknown()); }


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

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

LLVM IR (-O0):
define i32 @test15() {
%1 = alloca i32
%2 = call i64 (...) @unknown()
%3 = icmp ne i64 %2, 0
%4 = zext i1 %3 to i32
%5 = load i32, i32* %1
ret i32 %5
}

LLVM IR (-O2):
define i32 @test15() {
%1 = tail call i64 (...) @unknown()
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ device_close();
int /*<<< orphan*/ device_loop();
int /*<<< orphan*/ device_open();
int /*<<< orphan*/ init(int, char **);
void main(int argc, char **argv) {
  init(argc, argv);
  device_open();
  device_loop();
  device_close();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1040 <init@plt>
mov    $0x0,%al
call   1030 <device_open@plt>
mov    $0x0,%al
call   1060 <device_loop@plt>
mov    $0x0,%al
call   1050 <device_close@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
call   1040 <init@plt>
xor    %eax,%eax
call   1030 <device_open@plt>
xor    %eax,%eax
call   1060 <device_loop@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <device_close@plt>

LLVM IR (-O0):
define void @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = load i32, i32* %3
%6 = load i8**, i8*** %4
%7 = call i32 @init(i32 %5, i8** %6)
%8 = call i32 (...) @device_open()
%9 = call i32 (...) @device_loop()
%10 = call i32 (...) @device_close()
ret void
}

LLVM IR (-O2):
define void @main(i32 %0, i8** %1) {
%3 = tail call i32 @init(i32 %0, i8** %1)
%4 = tail call i32 (...) @device_open()
%5 = tail call i32 (...) @device_loop()
%6 = tail call i32 (...) @device_close()
ret void
}
/* Type definitions */
struct _Locale_collate {
  int dummy;
};

/* Variables and functions */
void _Locale_collate_destroy(struct _Locale_collate *lcol) {}


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

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

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

LLVM IR (-O2):
%struct._Locale_collate = type { i32 }
define void @_Locale_collate_destroy(%struct._Locale_collate* nocapture %0) {
ret void
}
void g_io_channel_unref() {}


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

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

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

LLVM IR (-O2):
define void @g_io_channel_unref() {
ret void
}
int test_imm_31uint8_mem(unsigned char *val) {
  return ((*val) & (0x31 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_31uint8_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, 49
%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_31uint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, 49
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ f(int);
void f2(int n) {
  if (n < 3)
    return;
  n--;
  f(n);
  assert(1);
}


x86 assembly (clang, -O0):
<f2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x3,-0x4(%rbp)
jge    113a <f2+0x1a>
jmp    1155 <f2+0x35>
mov    -0x4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <f@plt>
mov    $0x1,%edi
call   1040 <assert@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f2>:
cmp    $0x3,%edi
jge    1126 <f2+0x6>
ret
push   %rax
add    $0xffffffff,%edi
call   1030 <f@plt>
mov    $0x1,%edi
pop    %rax
jmp    1040 <assert@plt>

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

LLVM IR (-O2):
define void @f2(i32 %0) {
%2 = icmp slt i32 %0, 3
br i1 %2, label %7, label %3
3: ; preds = %1
%4 = add nsw i32 %0, -1
%5 = tail call i32 @f(i32 %4)
%6 = tail call i32 @assert(i32 1)
br label %7
7: ; preds = %1, %3
ret void
}
void gf8mul_00000111(void) {
  __asm__ __volatile__("\tpxor    %xmm7, %xmm6\n"
                       "\tpxor    %xmm7, %xmm5\n"
                       "\tpxor    %xmm7, %xmm4\n"
                       "\tpxor    %xmm7, %xmm3\n"
                       "\tpxor    %xmm7, %xmm2\n"
                       "\tpxor    %xmm7, %xmm1\n"
                       "\tpxor    %xmm6, %xmm7\n"
                       "\tpxor    %xmm6, %xmm4\n"
                       "\tpxor    %xmm6, %xmm3\n"
                       "\tpxor    %xmm6, %xmm2\n"
                       "\tpxor    %xmm6, %xmm1\n"
                       "\tpxor    %xmm6, %xmm0\n"
                       "\tpxor    %xmm7, %xmm6\n"
                       "\tpxor    %xmm5, %xmm7\n"
                       "\tpxor    %xmm5, %xmm6\n"
                       "\tpxor    %xmm4, %xmm6\n"
                       "\tpxor    %xmm4, %xmm5\n"
                       "\tpxor    %xmm3, %xmm5\n"
                       "\tpxor    %xmm3, %xmm4\n"
                       "\tpxor    %xmm2, %xmm4\n"
                       "\tpxor    %xmm2, %xmm3\n"
                       "\tpxor    %xmm1, %xmm3\n"
                       "\tpxor    %xmm1, %xmm2\n"
                       "\tpxor    %xmm0, %xmm2\n"
                       "\tpxor    %xmm0, %xmm1\n");
}


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
pxor   %xmm7,%xmm6
pxor   %xmm7,%xmm5
pxor   %xmm7,%xmm4
pxor   %xmm7,%xmm3
pxor   %xmm7,%xmm2
pxor   %xmm7,%xmm1
pxor   %xmm6,%xmm7
pxor   %xmm6,%xmm4
pxor   %xmm6,%xmm3
pxor   %xmm6,%xmm2
pxor   %xmm6,%xmm1
pxor   %xmm6,%xmm0
pxor   %xmm7,%xmm6
pxor   %xmm5,%xmm7
pxor   %xmm5,%xmm6
pxor   %xmm4,%xmm6
pxor   %xmm4,%xmm5
pxor   %xmm3,%xmm5
pxor   %xmm3,%xmm4
pxor   %xmm2,%xmm4
pxor   %xmm2,%xmm3
pxor   %xmm1,%xmm3
pxor   %xmm1,%xmm2
pxor   %xmm0,%xmm2
pxor   %xmm0,%xmm1
pop    %rbp
ret

x86 assembly (clang, -O2):
pxor   %xmm7,%xmm6
pxor   %xmm7,%xmm5
pxor   %xmm7,%xmm4
pxor   %xmm7,%xmm3
pxor   %xmm7,%xmm2
pxor   %xmm7,%xmm1
pxor   %xmm6,%xmm7
pxor   %xmm6,%xmm4
pxor   %xmm6,%xmm3
pxor   %xmm6,%xmm2
pxor   %xmm6,%xmm1
pxor   %xmm6,%xmm0
pxor   %xmm7,%xmm6
pxor   %xmm5,%xmm7
pxor   %xmm5,%xmm6
pxor   %xmm4,%xmm6
pxor   %xmm4,%xmm5
pxor   %xmm3,%xmm5
pxor   %xmm3,%xmm4
pxor   %xmm2,%xmm4
pxor   %xmm2,%xmm3
pxor   %xmm1,%xmm3
pxor   %xmm1,%xmm2
pxor   %xmm0,%xmm2
pxor   %xmm0,%xmm1
ret

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

LLVM IR (-O2):
define void @gf8mul_00000111() {
tail call void asm sideeffect "\09pxor %xmm7, %xmm6\0A\09pxor %xmm7, %xmm5\0A\09pxor %xmm7, %xmm4\0A\09pxor %xmm7, %xmm3\0A\09pxor %xmm7, %xmm2\0A\09pxor %xmm7, %xmm1\0A\09pxor %xmm6, %xmm7\0A\09pxor %xmm6, %xmm4\0A\09pxor %xmm6, %xmm3\0A\09pxor %xmm6, %xmm2\0A\09pxor %xmm6, %xmm1\0A\09pxor %xmm6, %xmm0\0A\09pxor %xmm7, %xmm6\0A\09pxor %xmm5, %xmm7\0A\09pxor %xmm5, %xmm6\0A\09pxor %xmm4, %xmm6\0A\09pxor %xmm4, %xmm5\0A\09pxor %xmm3, %xmm5\0A\09pxor %xmm3, %xmm4\0A\09pxor %xmm2, %xmm4\0A\09pxor %xmm2, %xmm3\0A\09pxor %xmm1, %xmm3\0A\09pxor %xmm1, %xmm2\0A\09pxor %xmm0, %xmm2\0A\09pxor %xmm0, %xmm1\0A", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
void scamper_icmp6_close(int fd) {
  close(fd);
  return;
}


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

x86 assembly (clang, -O2):
<scamper_icmp6_close>:
jmp    1030 <close@plt>

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

LLVM IR (-O2):
define void @scamper_icmp6_close(i32 %0) {
%2 = tail call i32 @close(i32 %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;
typedef int /*<<< orphan*/ __le16;

/* Variables and functions */
int /*<<< orphan*/ htole16(int /*<<< orphan*/);
__le16 cpu_to_le16(uint16_t x) { return (__le16)htole16(x); }


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

x86 assembly (clang, -O2):
<cpu_to_le16>:
jmp    1030 <htole16@plt>

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

LLVM IR (-O2):
define i32 @cpu_to_le16(i32 %0) {
%2 = tail call i32 @htole16(i32 %0)
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_cond_t;

/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ __set_errno(int /*<<< orphan*/);
int pthread_cond_signal(pthread_cond_t *cond) {
  __set_errno(ENOSYS);
  return -1;
}


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

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

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

LLVM IR (-O2):
@ENOSYS = global i32 0
define i32 @pthread_cond_signal(i32* nocapture readnone %0) {
%2 = load i32, i32* @ENOSYS
%3 = tail call i32 @__set_errno(i32 %2)
ret i32 -1
}
/* Variables and functions */
int PAPI_num_events(int);
void papif_num_events_(int *EventCode, int *count) {
  *count = PAPI_num_events(*EventCode);
}


x86 assembly (clang, -O0):
<papif_num_events_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
call   1030 <PAPI_num_events@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<papif_num_events_>:
push   %rbx
mov    %rsi,%rbx
mov    (%rdi),%edi
call   1030 <PAPI_num_events@plt>
mov    %eax,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @papif_num_events_(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* %5
%7 = call i32 @PAPI_num_events(i32 %6)
%8 = load i32*, i32** %4
store i32 %7, i32* %8
ret void
}

LLVM IR (-O2):
define void @papif_num_events_(i32* nocapture %0, i32* nocapture writeonly %1) {
%3 = load i32, i32* %0
%4 = tail call i32 @PAPI_num_events(i32 %3)
store i32 %4, i32* %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __get_cpuid_max(int /*<<< orphan*/, int /*<<< orphan*/);
int main() {
  __get_cpuid_max(0, 0);
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @__get_cpuid_max(i32 0, i32 0)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
scalar_t__ is_prime(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int /*<<< orphan*/ *);
int main() {
  int32_t n;
  scanf("%ld", &n);
  if (is_prime(n)) {
    printf("sim");
  } else {
    printf("nao");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x8(%rbp),%edi
call   1040 <is_prime@plt>
cmp    $0x0,%rax
je     1172 <main+0x42>
lea    0xe9c(%rip),%rdi
call   1030 <printf@plt>
jmp    117e <main+0x4e>
lea    0xe8f(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
mov    0x4(%rsp),%edi
call   1040 <is_prime@plt>
test   %rax,%rax
lea    0xeb3(%rip),%rax
lea    0xea8(%rip),%rdi
cmove  %rax,%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%ld\00"
@.str.1 = [4 x i8] c"sim\00"
@.str.2 = [4 x i8] c"nao\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = call i64 @is_prime(i32 %4)
%6 = icmp eq i64 %5, 0
%7 = select i1 %6, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0)
%8 = call i32 @printf(i8* dereferenceable(1) %7)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ abort();
char *strdup(char const *);
char *xstrdup(const char *s) {
  if ((s = strdup(s)) == NULL)
    abort();
  return (char *)s;
}


x86 assembly (clang, -O0):
<xstrdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strdup@plt>
mov    %rax,-0x8(%rbp)
cmp    $0x0,%rax
jne    114a <xstrdup+0x2a>
mov    $0x0,%al
call   1030 <abort@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xstrdup>:
push   %rax
call   1040 <strdup@plt>
test   %rax,%rax
je     112d <xstrdup+0xd>
pop    %rcx
ret
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define i8* @xstrdup(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i8* @strdup(i8* %3)
store i8* %4, i8** %2
%5 = icmp eq i8* %4, null
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = call i32 (...) @abort()
unreachable
8: ; preds = %1
%9 = load i8*, i8** %2
ret i8* %9
}

LLVM IR (-O2):
define noalias i8* @xstrdup(i8* nocapture %0) {
%2 = tail call i8* @strdup(i8* %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 (...) @abort()
unreachable
6: ; preds = %1
ret i8* %2
}
/* Type definitions */
union bpf_attr {
  int map_fd;
  int /*<<< orphan*/ value;
  int /*<<< orphan*/ key;
};
typedef int /*<<< orphan*/ attr;

/* Variables and functions */
int /*<<< orphan*/ BPF_MAP_UPDATE_ELEM;
int /*<<< orphan*/ __NR_bpf;
int /*<<< orphan*/ ptr_to_u64(void *);
int syscall(int /*<<< orphan*/, int /*<<< orphan*/, union bpf_attr *, int);
int bpf_update_elem(int fd, void *key, void *value) {
  union bpf_attr attr = {
      .map_fd = fd,
      .key = ptr_to_u64(key),
      .value = ptr_to_u64(value),
  };
  return syscall(__NR_bpf, BPF_MAP_UPDATE_ELEM, &attr, sizeof(attr));
}


x86 assembly (clang, -O0):
<bpf_update_elem>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <ptr_to_u64@plt>
mov    %eax,-0x20(%rbp)
mov    0x2e92(%rip),%rax
mov    (%rax),%edi
mov    0x2e91(%rip),%rax
mov    (%rax),%esi
lea    -0x20(%rbp),%rdx
mov    $0x4,%ecx
call   1040 <syscall@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bpf_update_elem>:
push   %rax
mov    %rdx,%rdi
call   1030 <ptr_to_u64@plt>
mov    %eax,(%rsp)
mov    0x2ea5(%rip),%rax
mov    (%rax),%edi
mov    0x2ea4(%rip),%rax
mov    (%rax),%esi
mov    %rsp,%rdx
mov    $0x4,%ecx
call   1040 <syscall@plt>
pop    %rcx
ret

LLVM IR (-O0):
%union.bpf_attr = type { i32 }
@__NR_bpf = global i32 0
@BPF_MAP_UPDATE_ELEM = global i32 0
define i32 @bpf_update_elem(i32 %0, i8* %1, i8* %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca %union.bpf_attr
store i32 %0, i32* %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%8 = bitcast %union.bpf_attr* %7 to i32*
%9 = load i8*, i8** %6
%10 = call i32 @ptr_to_u64(i8* %9)
store i32 %10, i32* %8
%11 = load i32, i32* @__NR_bpf
%12 = load i32, i32* @BPF_MAP_UPDATE_ELEM
%13 = call i32 @syscall(i32 %11, i32 %12, %union.bpf_attr* %7, i32 4)
ret i32 %13
}

LLVM IR (-O2):
%union.bpf_attr = type { i32 }
@__NR_bpf = global i32 0
@BPF_MAP_UPDATE_ELEM = global i32 0
define i32 @bpf_update_elem(i32 %0, i8* nocapture readnone %1, i8* %2) {
%4 = alloca %union.bpf_attr
%5 = bitcast %union.bpf_attr* %4 to i8*
%6 = getelementptr inbounds %union.bpf_attr, %union.bpf_attr* %4, i64 0, i32 0
%7 = tail call i32 @ptr_to_u64(i8* %2)
store i32 %7, i32* %6
%8 = load i32, i32* @__NR_bpf
%9 = load i32, i32* @BPF_MAP_UPDATE_ELEM
%10 = call i32 @syscall(i32 %8, i32 %9, %union.bpf_attr* %4, i32 4)
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ adddep(char *);
void adddep2(char *file, char *line) {
  line = line;
  adddep(file);
}


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

x86 assembly (clang, -O2):
<adddep2>:
jmp    1030 <adddep@plt>

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

LLVM IR (-O2):
define void @adddep2(i8* %0, i8* nocapture readnone %1) {
%3 = tail call i32 @adddep(i8* %0)
ret void
}
void BusyWaitCounterC__0__Counter__overflow(void) {}


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

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

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

LLVM IR (-O2):
define void @BusyWaitCounterC__0__Counter__overflow() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_tabs(unsigned tabs) {
  int i = 0;
  for (i = 0; i < tabs; i++)
    printf("\t");
}


x86 assembly (clang, -O0):
<print_tabs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jae    114f <print_tabs+0x3f>
lea    0xec4(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1129 <print_tabs+0x19>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_tabs>:
push   %rbx
test   %edi,%edi
je     112f <print_tabs+0x1f>
mov    %edi,%ebx
nopw   0x0(%rax,%rax,1)
mov    $0x9,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebx
jne    1120 <print_tabs+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @print_tabs(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %8, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %6, %3 ], [ 0, %1 ]
%5 = tail call i32 @putchar(i32 9)
%6 = add nuw i32 %4, 1
%7 = icmp eq i32 %6, %0
br i1 %7, label %8, label %3
8: ; preds = %3, %1
ret void
}
unsigned int comlen(char *p, char *q) {
  unsigned int ret = 0;
  while (*p && *p++ == *q++)
    ret++;
  return ret;
}


x86 assembly (clang, -O0):
<comlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x15(%rbp)
je     1154 <comlen+0x54>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%eax
mov    -0x10(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x10(%rbp)
movsbl (%rcx),%ecx
cmp    %ecx,%eax
sete   %al
mov    %al,-0x15(%rbp)
mov    -0x15(%rbp),%al
test   $0x1,%al
jne    1164 <comlen+0x64>
jmp    1172 <comlen+0x72>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1113 <comlen+0x13>
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<comlen>:
mov    (%rdi),%cl
xor    %eax,%eax
test   %cl,%cl
je     1122 <comlen+0x22>
nopl   0x0(%rax,%rax,1)
cmp    (%rsi,%rax,1),%cl
jne    1122 <comlen+0x22>
movzbl 0x1(%rdi,%rax,1),%ecx
add    $0x1,%rax
test   %cl,%cl
jne    1110 <comlen+0x10>
ret

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

LLVM IR (-O2):
define i32 @comlen(i8* nocapture %0, i8* nocapture %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %18, label %5
5: ; preds = %2, %12
%6 = phi i8 [ %16, %12 ], [ %3, %2 ]
%7 = phi i32 [ %15, %12 ], [ 0, %2 ]
%8 = phi i8* [ %13, %12 ], [ %1, %2 ]
%9 = phi i8* [ %14, %12 ], [ %0, %2 ]
%10 = load i8, i8* %8
%11 = icmp eq i8 %6, %10
br i1 %11, label %12, label %18
12: ; preds = %5
%13 = getelementptr inbounds i8, i8* %8, i64 1
%14 = getelementptr inbounds i8, i8* %9, i64 1
%15 = add i32 %7, 1
%16 = load i8, i8* %14
%17 = icmp eq i8 %16, 0
br i1 %17, label %18, label %5
18: ; preds = %5, %12, %2
%19 = phi i32 [ 0, %2 ], [ %15, %12 ], [ %7, %5 ]
ret i32 %19
}
/* Variables and functions */
scalar_t__ getfloat(double *);
int /*<<< orphan*/ printf(char *, double);
int main() {
  double foo;
  double *bar = &foo;
  while (getfloat(bar) > 0) {
    printf("%f\n", foo);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <getfloat@plt>
cmp    $0x0,%rax
jle    1160 <main+0x40>
movsd  -0x10(%rbp),%xmm0
lea    0xeaa(%rip),%rdi
call   1030 <printf@plt>
jmp    1137 <main+0x17>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    %rsp,%rdi
call   1040 <getfloat@plt>
test   %rax,%rax
jle    115a <main+0x3a>
lea    0xec8(%rip),%r14
mov    %rsp,%rbx
nopl   0x0(%rax,%rax,1)
movsd  (%rsp),%xmm0
mov    %r14,%rdi
call   1030 <printf@plt>
mov    %rbx,%rdi
call   1040 <getfloat@plt>
test   %rax,%rax
jg     1140 <main+0x20>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%f\0A\00"
define i32 @main() {
%1 = alloca double
%2 = bitcast double* %1 to i8*
%3 = call i64 @getfloat(double* %1)
%4 = icmp sgt i64 %3, 0
br i1 %4, label %5, label %10
5: ; preds = %0, %5
%6 = load double, double* %1
%7 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double %6)
%8 = call i64 @getfloat(double* %1)
%9 = icmp sgt i64 %8, 0
br i1 %9, label %5, label %10
10: ; preds = %5, %0
ret i32 0
}
/* Variables and functions */
int set_setting(char *, int);
int enable_setting(char *path) { return set_setting(path, 1); }


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

x86 assembly (clang, -O2):
<enable_setting>:
mov    $0x1,%esi
jmp    1030 <set_setting@plt>

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

LLVM IR (-O2):
define i32 @enable_setting(i8* %0) {
%2 = tail call i32 @set_setting(i8* %0, i32 1)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ errno;
int getsockopt(int sockfd, int level, int optname, void *optval,
               unsigned int *optlen) {
  errno = ENOSYS;
  return -1;
}


x86 assembly (clang, -O0):
<getsockopt>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %rcx,-0x18(%rbp)
mov    %r8,-0x20(%rbp)
mov    0x2ecc(%rip),%rax
mov    (%rax),%ecx
mov    0x2eb3(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getsockopt>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%eax
mov    0x2ec8(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @getsockopt(i32 %0, i32 %1, i32 %2, i8* %3, i32* %4) {
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i8*
%10 = alloca i32*
store i32 %0, i32* %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i8* %3, i8** %9
store i32* %4, i32** %10
%11 = load i32, i32* @ENOSYS
store i32 %11, i32* @errno
ret i32 -1
}

LLVM IR (-O2):
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @getsockopt(i32 %0, i32 %1, i32 %2, i8* nocapture readnone %3, i32* nocapture readnone %4) {
%6 = load i32, i32* @ENOSYS
store i32 %6, i32* @errno
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ print(char *);
int /*<<< orphan*/ printid(char *);
void main() {
  char b[4];
  char a;
  a = b[1] = '1';
  a = '1';
  print("b 1");
  printid(b);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movb   $0x31,-0x3(%rbp)
movb   $0x31,-0x5(%rbp)
movb   $0x31,-0x5(%rbp)
lea    0xec5(%rip),%rdi
call   1030 <print@plt>
lea    -0x4(%rbp),%rdi
call   1040 <printid@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movb   $0x31,0x5(%rsp)
lea    0xed3(%rip),%rdi
call   1030 <print@plt>
lea    0x4(%rsp),%rdi
call   1040 <printid@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [4 x i8] c"b 1\00"
define void @main() {
%1 = alloca [4 x i8]
%2 = alloca i8
%3 = getelementptr inbounds [4 x i8], [4 x i8]* %1, i64 0, i64 1
store i8 49, i8* %3
store i8 49, i8* %2
store i8 49, i8* %2
%4 = call i32 @print(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%5 = getelementptr inbounds [4 x i8], [4 x i8]* %1, i64 0, i64 0
%6 = call i32 @printid(i8* %5)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"b 1\00"
define void @main() {
%1 = alloca [4 x i8]
%2 = getelementptr inbounds [4 x i8], [4 x i8]* %1, i64 0, i64 0
%3 = getelementptr inbounds [4 x i8], [4 x i8]* %1, i64 0, i64 1
store i8 49, i8* %3
%4 = tail call i32 @print(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @printid(i8* %2)
ret void
}
void SpinYetAgain() {
  volatile unsigned int count = 0;
  int i;
  for (i = 0; i < 1000; i++) {
    count++;
  }
}


x86 assembly (clang, -O0):
<SpinYetAgain>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x3e8,-0x8(%rbp)
jge    1136 <SpinYetAgain+0x36>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1112 <SpinYetAgain+0x12>
pop    %rbp
ret

x86 assembly (clang, -O2):
<SpinYetAgain>:
movl   $0x0,-0x4(%rsp)
mov    $0x3e8,%eax
nopl   (%rax)
addl   $0x1,-0x4(%rsp)
addl   $0x1,-0x4(%rsp)
addl   $0x1,-0x4(%rsp)
addl   $0x1,-0x4(%rsp)
addl   $0x1,-0x4(%rsp)
add    $0xfffffffb,%eax
jne    1110 <SpinYetAgain+0x10>
ret

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

LLVM IR (-O2):
define void @SpinYetAgain() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store volatile i32 0, i32* %1
br label %3
3: ; preds = %3, %0
%4 = phi i32 [ 0, %0 ], [ %15, %3 ]
%5 = load volatile i32, i32* %1
%6 = add i32 %5, 1
store volatile i32 %6, i32* %1
%7 = load volatile i32, i32* %1
%8 = add i32 %7, 1
store volatile i32 %8, i32* %1
%9 = load volatile i32, i32* %1
%10 = add i32 %9, 1
store volatile i32 %10, i32* %1
%11 = load volatile i32, i32* %1
%12 = add i32 %11, 1
store volatile i32 %12, i32* %1
%13 = load volatile i32, i32* %1
%14 = add i32 %13, 1
store volatile i32 %14, i32* %1
%15 = add nuw nsw i32 %4, 5
%16 = icmp eq i32 %15, 1000
br i1 %16, label %17, label %3
17: ; preds = %3
ret void
}
/* Variables and functions */
scalar_t__ random_rand();
double random_double(const double max) {
  return (max * (((double)random_rand()) / (double)(unsigned int)0xFFFFFFFF));
}


x86 assembly (clang, -O0):
<random_double>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
mov    $0x0,%al
call   1030 <random_rand@plt>
movsd  -0x10(%rbp),%xmm0
cvtsi2sd %rax,%xmm1
movsd  0xec0(%rip),%xmm2
divsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<random_double>:
push   %rax
movsd  %xmm0,(%rsp)
xor    %eax,%eax
call   1030 <random_rand@plt>
cvtsi2sd %rax,%xmm1
divsd  0xed6(%rip),%xmm1
movsd  (%rsp),%xmm0
mulsd  %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @random_double(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call i64 (...) @random_rand()
%5 = sitofp i64 %4 to double
%6 = fdiv double %5, 0x41EFFFFFFFE00000
%7 = fmul double %3, %6
ret double %7
}

LLVM IR (-O2):
define double @random_double(double %0) {
%2 = tail call i64 (...) @random_rand()
%3 = sitofp i64 %2 to double
%4 = fdiv double %3, 0x41EFFFFFFFE00000
%5 = fmul double %4, %0
ret double %5
}
/* Variables and functions */
int /*<<< orphan*/ atan2k(int /*<<< orphan*/, int /*<<< orphan*/);
double mulsign(int /*<<< orphan*/, double);
int /*<<< orphan*/ sqrt(int);
int /*<<< orphan*/ xfabs(double);
double xasin(double d) {
  return mulsign(atan2k(xfabs(d), sqrt((1 + d) * (1 - d))), d);
}


x86 assembly (clang, -O0):
<xasin>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1050 <xfabs@plt>
mov    %eax,-0xc(%rbp)
movsd  0xe9e(%rip),%xmm0
addsd  -0x8(%rbp),%xmm0
movsd  0xe91(%rip),%xmm1
subsd  -0x8(%rbp),%xmm1
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
call   1060 <sqrt@plt>
mov    -0xc(%rbp),%edi
mov    %eax,%esi
call   1040 <atan2k@plt>
mov    %eax,%edi
movsd  -0x8(%rbp),%xmm0
call   1030 <mulsign@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xasin>:
push   %rbx
sub    $0x10,%rsp
movsd  %xmm0,0x8(%rsp)
call   1050 <xfabs@plt>
mov    %eax,%ebx
movsd  0xea6(%rip),%xmm0
movsd  0x8(%rsp),%xmm2
movapd %xmm2,%xmm1
addsd  %xmm0,%xmm1
subsd  %xmm2,%xmm0
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
call   1060 <sqrt@plt>
mov    %ebx,%edi
mov    %eax,%esi
call   1040 <atan2k@plt>
mov    %eax,%edi
movsd  0x8(%rsp),%xmm0
add    $0x10,%rsp
pop    %rbx
jmp    1030 <mulsign@plt>

LLVM IR (-O0):
define double @xasin(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call i32 @xfabs(double %3)
%5 = load double, double* %2
%6 = fadd double 1.000000e+00, %5
%7 = load double, double* %2
%8 = fsub double 1.000000e+00, %7
%9 = fmul double %6, %8
%10 = fptosi double %9 to i32
%11 = call i32 @sqrt(i32 %10)
%12 = call i32 @atan2k(i32 %4, i32 %11)
%13 = load double, double* %2
%14 = call double @mulsign(i32 %12, double %13)
ret double %14
}

LLVM IR (-O2):
define double @xasin(double %0) {
%2 = tail call i32 @xfabs(double %0)
%3 = fadd double %0, 1.000000e+00
%4 = fsub double 1.000000e+00, %0
%5 = fmul double %3, %4
%6 = fptosi double %5 to i32
%7 = tail call i32 @sqrt(i32 %6)
%8 = tail call i32 @atan2k(i32 %2, i32 %7)
%9 = tail call double @mulsign(i32 %8, double %0)
ret double %9
}
/* Variables and functions */
char *default_environment_path_get(void) { return NULL; }


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

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

LLVM IR (-O0):
define i8* @default_environment_path_get() {
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @default_environment_path_get() {
ret i8* null
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
main() {
  printf("Hello World\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%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 = [13 x i8] c"Hello World\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [12 x i8] c"Hello World\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void afficherInt(void *integer) { printf("%d\n", *(int *)integer); }


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

x86 assembly (clang, -O2):
<afficherInt>:
mov    (%rdi),%esi
lea    0xee7(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
define void @afficherInt(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to i32*
%5 = load i32, i32* %4
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %5)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define void @afficherInt(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %3)
ret void
}
int cmp_list_key(const void *a, const void *b) {
  return ((*(int *)(a)) - (*(int *)(b)));
}


x86 assembly (clang, -O0):
<cmp_list_key>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    -0x10(%rbp),%rcx
sub    (%rcx),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @cmp_list_key(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = bitcast i8* %5 to i32*
%7 = load i32, i32* %6
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i32*
%10 = load i32, i32* %9
%11 = sub nsw i32 %7, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @cmp_list_key(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = sub nsw i32 %4, %6
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void print_string(char *string) { printf("%s\n", string); }


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define void @print_string(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}