xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ getchar();
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int main(void) {
  int aNumber;
  printf("Enter a number");
  scanf("%d", &aNumber);
  printf("You entered %d", aNumber);
  getchar();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xece(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x4(%rbp),%esi
lea    0xeaf(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xed5(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
mov    0x4(%rsp),%esi
lea    0xeb4(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [15 x i8] c"Enter a number\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [15 x i8] c"You entered %d\00"
define i32 @main() {
%1 = alloca i32
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0), i32 %4)
%6 = call i32 (...) @getchar()
ret i32 0
}

LLVM IR (-O2):
@.str = [15 x i8] c"Enter a number\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [15 x i8] c"You entered %d\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0), i32 %5)
%7 = call i32 (...) @getchar()
ret i32 0
}
int initialize(const char *config_file, void **handle) { return (1); }


x86 assembly (clang, -O0):
<initialize>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x1,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @initialize(i8* nocapture readnone %0, i8** nocapture readnone %1) {
ret i32 1
}
/* Type definitions */
struct can_frame {
  int *data;
};

/* Variables and functions */
void sdo_set_expediated_size(struct can_frame *frame, size_t size) {
  int n = 4 - size;
  frame->data[0] &= ~(3 << 2);
  frame->data[0] |= n << 2;
}


x86 assembly (clang, -O0):
<sdo_set_expediated_size>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x4,%eax
sub    -0x10(%rbp),%rax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    (%rax),%ecx
and    $0xfffffff3,%ecx
mov    %ecx,(%rax)
mov    -0x14(%rbp),%ecx
shl    $0x2,%ecx
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
or     (%rax),%ecx
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<sdo_set_expediated_size>:
mov    (%rdi),%rax
mov    (%rax),%ecx
and    $0xfffffff3,%ecx
shl    $0x2,%esi
mov    $0x10,%edx
sub    %esi,%edx
or     %ecx,%edx
mov    %edx,(%rax)
ret

LLVM IR (-O0):
%struct.can_frame = type { i32* }
define void @sdo_set_expediated_size(%struct.can_frame* %0, i64 %1) {
%3 = alloca %struct.can_frame*
%4 = alloca i64
%5 = alloca i32
store %struct.can_frame* %0, %struct.can_frame** %3
store i64 %1, i64* %4
%6 = load i64, i64* %4
%7 = sub i64 4, %6
%8 = trunc i64 %7 to i32
store i32 %8, i32* %5
%9 = load %struct.can_frame*, %struct.can_frame** %3
%10 = getelementptr inbounds %struct.can_frame, %struct.can_frame* %9, i32 0, i32 0
%11 = load i32*, i32** %10
%12 = getelementptr inbounds i32, i32* %11, i64 0
%13 = load i32, i32* %12
%14 = and i32 %13, -13
store i32 %14, i32* %12
%15 = load i32, i32* %5
%16 = shl i32 %15, 2
%17 = load %struct.can_frame*, %struct.can_frame** %3
%18 = getelementptr inbounds %struct.can_frame, %struct.can_frame* %17, i32 0, i32 0
%19 = load i32*, i32** %18
%20 = getelementptr inbounds i32, i32* %19, i64 0
%21 = load i32, i32* %20
%22 = or i32 %21, %16
store i32 %22, i32* %20
ret void
}

LLVM IR (-O2):
%struct.can_frame = type { i32* }
define void @sdo_set_expediated_size(%struct.can_frame* nocapture %0, i64 %1) {
%3 = trunc i64 %1 to i32
%4 = getelementptr inbounds %struct.can_frame, %struct.can_frame* %0, i64 0, i32 0
%5 = load i32*, i32** %4
%6 = load i32, i32* %5
%7 = and i32 %6, -13
%8 = mul i32 %3, -4
%9 = add i32 %8, 16
%10 = or i32 %7, %9
store i32 %10, i32* %5
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void _str_clean(char **str) { free(*str); }


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

x86 assembly (clang, -O2):
<_str_clean>:
mov    (%rdi),%rdi
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @_str_clean(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = tail call i32 @free(i8* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void print_usage(void) {
  fprintf(stderr, "usage: ipc-endian-test [-server]\n");
}


x86 assembly (clang, -O0):
<print_usage>:
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):
<print_usage>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
jmp    1030 <fprintf@plt>

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

LLVM IR (-O2):
@stderr = global i32 0
@.str = [34 x i8] c"usage: ipc-endian-test [-server]\0A\00"
define void @print_usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int int32_t;

/* Variables and functions */
float invSqrt(float x) {
  float halfx = 0.5f * x;
  float y = x;
  int32_t i = *(int32_t *)&y;
  i = 0x5f3759df - (i >> 1);
  y = *(float *)&i;
  y = y * (1.5f - (halfx * y * y));
  return y;
}


x86 assembly (clang, -O0):
<invSqrt>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  0xef3(%rip),%xmm0
mulss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%ecx
sar    $0x1,%ecx
mov    $0x5f3759df,%eax
sub    %ecx,%eax
mov    %eax,-0x10(%rbp)
movss  -0x10(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
mulss  -0xc(%rbp),%xmm1
movss  -0xc(%rbp),%xmm2
movd   %xmm1,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm1
mulss  %xmm2,%xmm1
movss  0xe8e(%rip),%xmm2
addss  %xmm2,%xmm1
mulss  %xmm1,%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<invSqrt>:
movd   %xmm0,%eax
sar    %eax
mov    $0x5f3759df,%ecx
sub    %eax,%ecx
movd   %ecx,%xmm1
mulss  0xee7(%rip),%xmm0
mulss  %xmm1,%xmm0
mulss  %xmm1,%xmm0
addss  0xedb(%rip),%xmm0
mulss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @invSqrt(float %0) {
%2 = alloca float
%3 = alloca float
%4 = alloca float
%5 = alloca i32
store float %0, float* %2
%6 = load float, float* %2
%7 = fmul float 5.000000e-01, %6
store float %7, float* %3
%8 = load float, float* %2
store float %8, float* %4
%9 = bitcast float* %4 to i32*
%10 = load i32, i32* %9
store i32 %10, i32* %5
%11 = load i32, i32* %5
%12 = ashr i32 %11, 1
%13 = sub nsw i32 1597463007, %12
store i32 %13, i32* %5
%14 = bitcast i32* %5 to float*
%15 = load float, float* %14
store float %15, float* %4
%16 = load float, float* %4
%17 = load float, float* %3
%18 = load float, float* %4
%19 = fmul float %17, %18
%20 = load float, float* %4
%21 = fneg float %19
%22 = call float @llvm.fmuladd.f32(float %21, float %20, float 1.500000e+00)
%23 = fmul float %16, %22
store float %23, float* %4
%24 = load float, float* %4
ret float %24
}

LLVM IR (-O2):
define float @invSqrt(float %0) {
%2 = bitcast float %0 to i32
%3 = ashr i32 %2, 1
%4 = sub nsw i32 1597463007, %3
%5 = bitcast i32 %4 to float
%6 = fmul float %0, -5.000000e-01
%7 = fmul float %6, %5
%8 = tail call float @llvm.fmuladd.f32(float %7, float %5, float 1.500000e+00)
%9 = fmul float %8, %5
ret float %9
}
/* Variables and functions */
int isdigit(const char d) {
  switch (d) {
  case '0':
  case '1':
  case '2':
  case '3':
  case '4':
  case '5':
  case '6':
  case '7':
  case '8':
  case '9':
    return 0;
  }
  return -1;
}


x86 assembly (clang, -O0):
<isdigit>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
add    $0xffffffd0,%eax
sub    $0x9,%eax
ja     112b <isdigit+0x2b>
jmp    111f <isdigit+0x1f>
movl   $0x0,-0x4(%rbp)
jmp    1132 <isdigit+0x32>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isdigit>:
add    $0xffffffc6,%edi
cmp    $0xfffffff6,%edi
sbb    %eax,%eax
ret

LLVM IR (-O0):
define i32 @isdigit(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
switch i32 %5, label %7 [
i32 48, label %6
i32 49, label %6
i32 50, label %6
i32 51, label %6
i32 52, label %6
i32 53, label %6
i32 54, label %6
i32 55, label %6
i32 56, label %6
i32 57, label %6
]
6: ; preds = %1, %1, %1, %1, %1, %1, %1, %1, %1, %1
store i32 0, i32* %2
br label %8
7: ; preds = %1
store i32 -1, i32* %2
br label %8
8: ; preds = %7, %6
%9 = load i32, i32* %2
ret i32 %9
}

LLVM IR (-O2):
define i32 @isdigit(i8 signext %0) {
%2 = sext i8 %0 to i32
%3 = add nsw i32 %2, -58
%4 = icmp ult i32 %3, -10
%5 = sext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ gen(char *);
void cgpopptr(void) { gen("pop\tbx"); }


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

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

LLVM IR (-O0):
@.str = [7 x i8] c"pop\09bx\00"
define void @cgpopptr() {
%1 = call i32 @gen(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"pop\09bx\00"
define void @cgpopptr() {
%1 = tail call i32 @gen(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef scalar_t__ useconds_t;

/* Variables and functions */
unsigned int usleep(scalar_t__);
void test(void) {
  useconds_t usec;
  unsigned result;
  usec = 0;
  result = usleep(usec);
}


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

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

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

LLVM IR (-O2):
define void @test() {
%1 = tail call i32 @usleep(i64 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isbdigit(int);
void t_isbdigit_0x99() {
  Assert_real((isbdigit(153) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isbdigit.c",
              770, ("isbdigit should be 0 for 0x99"));
}


x86 assembly (clang, -O0):
<t_isbdigit_0x99>:
push   %rbp
mov    %rsp,%rbp
mov    $0x99,%edi
call   1040 <isbdigit@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x302,%edx
lea    0xf5c(%rip),%rcx
call   1030 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isbdigit_0x99>:
push   %rax
mov    $0x99,%edi
call   1040 <isbdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf67(%rip),%rcx
mov    $0x302,%edx
pop    %rax
jmp    1030 <Assert_real@plt>

LLVM IR (-O0):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isbdigit.c\00"
@.str.1 = [30 x i8] c"isbdigit should be 0 for 0x99\00"
define void @t_isbdigit_0x99() {
%1 = call i64 @isbdigit(i32 153)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 770, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isbdigit.c\00"
@.str.1 = [30 x i8] c"isbdigit should be 0 for 0x99\00"
define void @t_isbdigit_0x99() {
%1 = tail call i64 @isbdigit(i32 153)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 770, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ eof_get_configdir(char *, size_t);
int /*<<< orphan*/ memset(char *, char, size_t);
int /*<<< orphan*/ strncat(char *, char *, size_t);
void eof_get_tp_dir(char buf[], size_t len) {
  memset(buf, '\0', len);
  eof_get_configdir(buf, len);
  strncat(buf,
          "/"
          "tp",
          len - 1);
}


x86 assembly (clang, -O0):
<eof_get_tp_dir>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
xor    %esi,%esi
call   1030 <memset@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1050 <eof_get_configdir@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
sub    $0x1,%rdx
lea    0xe91(%rip),%rsi
call   1040 <strncat@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<eof_get_tp_dir>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
xor    %esi,%esi
mov    %rbx,%rdx
call   1030 <memset@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1050 <eof_get_configdir@plt>
add    $0xffffffffffffffff,%rbx
lea    0xea6(%rip),%rsi
mov    %r14,%rdi
mov    %rbx,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <strncat@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"/tp\00"
define void @eof_get_tp_dir(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i8*, i8** %3
%6 = load i64, i64* %4
%7 = call i32 @memset(i8* %5, i8 signext 0, i64 %6)
%8 = load i8*, i8** %3
%9 = load i64, i64* %4
%10 = call i32 @eof_get_configdir(i8* %8, i64 %9)
%11 = load i8*, i8** %3
%12 = load i64, i64* %4
%13 = sub i64 %12, 1
%14 = call i32 @strncat(i8* %11, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i64 %13)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"/tp\00"
define void @eof_get_tp_dir(i8* %0, i64 %1) {
%3 = tail call i32 @memset(i8* %0, i8 signext 0, i64 %1)
%4 = tail call i32 @eof_get_configdir(i8* %0, i64 %1)
%5 = add i64 %1, -1
%6 = tail call i32 @strncat(i8* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i64 %5)
ret void
}
void debug_dma_sync_sg_for_cpu(struct device *dev, struct scatterlist *sg,
                               int nelems, int direction) {}


x86 assembly (clang, -O0):
<debug_dma_sync_sg_for_cpu>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.device = type opaque
%struct.scatterlist = type opaque
define void @debug_dma_sync_sg_for_cpu(%struct.device* %0, %struct.scatterlist* %1, i32 %2, i32 %3) {
%5 = alloca %struct.device*
%6 = alloca %struct.scatterlist*
%7 = alloca i32
%8 = alloca i32
store %struct.device* %0, %struct.device** %5
store %struct.scatterlist* %1, %struct.scatterlist** %6
store i32 %2, i32* %7
store i32 %3, i32* %8
ret void
}

LLVM IR (-O2):
%struct.device = type opaque
%struct.scatterlist = type opaque
define void @debug_dma_sync_sg_for_cpu(%struct.device* nocapture %0, %struct.scatterlist* nocapture %1, i32 %2, i32 %3) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __coverity_panic__();
void bogus() { __coverity_panic__(); }


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

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

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

LLVM IR (-O2):
define void @bogus() {
%1 = tail call i32 (...) @__coverity_panic__()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *);
void fprint_inc(FILE *stream) {
  fprintf(stream, "INC   A                         ");
}


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

x86 assembly (clang, -O2):
<fprint_inc>:
mov    %rdi,%rcx
lea    0xee6(%rip),%rdi
mov    $0x20,%esi
mov    $0x1,%edx
jmp    1030 <fwrite@plt>

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

LLVM IR (-O2):
@.str = [33 x i8] c"INC A \00"
define void @fprint_inc(i32* nocapture %0) {
%2 = tail call i64 @fwrite(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i64 32, i64 1, i32* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ScopeCreate(int /*<<< orphan*/, char *);
void StructInit() { ScopeCreate(0, "_ROOT_"); }


x86 assembly (clang, -O0):
<StructInit>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
lea    0xee3(%rip),%rsi
call   1030 <ScopeCreate@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<StructInit>:
lea    0xee9(%rip),%rsi
xor    %edi,%edi
jmp    1030 <ScopeCreate@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"_ROOT_\00"
define void @StructInit() {
%1 = call i32 @ScopeCreate(i32 0, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"_ROOT_\00"
define void @StructInit() {
%1 = tail call i32 @ScopeCreate(i32 0, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int arikkei_utf8_strlen(unsigned char const *);
int /*<<< orphan*/ arikkei_utf8_ucs2_strcpy(unsigned char const *,
                                            unsigned short *);
unsigned short *malloc(int);
unsigned short *arikkei_utf8_ucs2_strdup(const unsigned char *s) {
  unsigned short *d;
  int len;
  len = arikkei_utf8_strlen(s);
  d = malloc((len + 1) * sizeof(unsigned short));
  arikkei_utf8_ucs2_strcpy(s, d);
  return d;
}


x86 assembly (clang, -O0):
<arikkei_utf8_ucs2_strdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <arikkei_utf8_strlen@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
cltq
shl    $0x1,%rax
mov    %eax,%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1050 <arikkei_utf8_ucs2_strcpy@plt>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<arikkei_utf8_ucs2_strdup>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1030 <arikkei_utf8_strlen@plt>
lea    (%rax,%rax,1),%edi
add    $0x2,%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
mov    %r14,%rdi
mov    %rax,%rsi
call   1050 <arikkei_utf8_ucs2_strcpy@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i16* @arikkei_utf8_ucs2_strdup(i8* %0) {
%2 = alloca i8*
%3 = alloca i16*
%4 = alloca i32
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i32 @arikkei_utf8_strlen(i8* %5)
store i32 %6, i32* %4
%7 = load i32, i32* %4
%8 = add nsw i32 %7, 1
%9 = sext i32 %8 to i64
%10 = mul i64 %9, 2
%11 = trunc i64 %10 to i32
%12 = call i16* @malloc(i32 %11)
store i16* %12, i16** %3
%13 = load i8*, i8** %2
%14 = load i16*, i16** %3
%15 = call i32 @arikkei_utf8_ucs2_strcpy(i8* %13, i16* %14)
%16 = load i16*, i16** %3
ret i16* %16
}

LLVM IR (-O2):
define i16* @arikkei_utf8_ucs2_strdup(i8* %0) {
%2 = tail call i32 @arikkei_utf8_strlen(i8* %0)
%3 = shl i32 %2, 1
%4 = add i32 %3, 2
%5 = tail call i16* @malloc(i32 %4)
%6 = tail call i32 @arikkei_utf8_ucs2_strcpy(i8* %0, i16* %5)
ret i16* %5
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
uint8_t lcrand(uint8_t val) { return 0xFF & (3 * val + 3); }


x86 assembly (clang, -O0):
<lcrand>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
imul   $0x3,-0x4(%rbp),%eax
add    $0x3,%eax
and    $0xff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<lcrand>:
lea    (%rdi,%rdi,2),%eax
add    $0x3,%eax
movzbl %al,%eax
ret

LLVM IR (-O0):
define i32 @lcrand(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = mul nsw i32 3, %3
%5 = add nsw i32 %4, 3
%6 = and i32 255, %5
ret i32 %6
}

LLVM IR (-O2):
define i32 @lcrand(i32 %0) {
%2 = mul nsw i32 %0, 3
%3 = add nsw i32 %2, 3
%4 = and i32 %3, 255
ret i32 %4
}
/* Type definitions */
struct itimerspec {
  int dummy;
};

/* Variables and functions */
int syscall(int, int, int, struct itimerspec const *, struct itimerspec *);
int timerfd_settime(int fd, int flags, const struct itimerspec *new_value,
                    struct itimerspec *old_value) {
  return syscall(286, fd, flags, new_value, old_value);
}


x86 assembly (clang, -O0):
<timerfd_settime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    -0x10(%rbp),%rcx
mov    -0x18(%rbp),%r8
mov    $0x11e,%edi
call   1030 <syscall@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<timerfd_settime>:
mov    %rcx,%r8
mov    %rdx,%rcx
mov    %esi,%edx
mov    %edi,%esi
mov    $0x11e,%edi
jmp    1030 <syscall@plt>

LLVM IR (-O0):
%struct.itimerspec = type { i32 }
define i32 @timerfd_settime(i32 %0, i32 %1, %struct.itimerspec* %2, %struct.itimerspec* %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca %struct.itimerspec*
%8 = alloca %struct.itimerspec*
store i32 %0, i32* %5
store i32 %1, i32* %6
store %struct.itimerspec* %2, %struct.itimerspec** %7
store %struct.itimerspec* %3, %struct.itimerspec** %8
%9 = load i32, i32* %5
%10 = load i32, i32* %6
%11 = load %struct.itimerspec*, %struct.itimerspec** %7
%12 = load %struct.itimerspec*, %struct.itimerspec** %8
%13 = call i32 @syscall(i32 286, i32 %9, i32 %10, %struct.itimerspec* %11, %struct.itimerspec* %12)
ret i32 %13
}

LLVM IR (-O2):
%struct.itimerspec = type { i32 }
define i32 @timerfd_settime(i32 %0, i32 %1, %struct.itimerspec* %2, %struct.itimerspec* %3) {
%5 = tail call i32 @syscall(i32 286, i32 %0, i32 %1, %struct.itimerspec* %2, %struct.itimerspec* %3)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void found(void) { printf("I found a 'small' token! \n"); }


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

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

LLVM IR (-O0):
@.str = [27 x i8] c"I found a 'small' token! \0A\00"
define void @found() {
%1 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [26 x i8] c"I found a 'small' token! \00"
define void @found() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int UINT32_C(int);
uint32_t midr_get_part(uint32_t midr) {
  return (midr & UINT32_C(0x0000FFF0)) >> 4;
}


x86 assembly (clang, -O0):
<midr_get_part>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    $0xfff0,%edi
call   1030 <UINT32_C@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%eax
and    %ecx,%eax
sar    $0x4,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<midr_get_part>:
push   %rbx
mov    %edi,%ebx
mov    $0xfff0,%edi
call   1030 <UINT32_C@plt>
and    %ebx,%eax
sar    $0x4,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @midr_get_part(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @UINT32_C(i32 65520)
%5 = and i32 %3, %4
%6 = ashr i32 %5, 4
ret i32 %6
}

LLVM IR (-O2):
define i32 @midr_get_part(i32 %0) {
%2 = tail call i32 @UINT32_C(i32 65520)
%3 = and i32 %2, %0
%4 = ashr i32 %3, 4
ret i32 %4
}
float STSMaxFloat(float a, float b) { return a > b ? a : b; }


x86 assembly (clang, -O0):
<STSMaxFloat>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
ucomiss -0x8(%rbp),%xmm0
jbe    112c <STSMaxFloat+0x2c>
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
jmp    1136 <STSMaxFloat+0x36>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<STSMaxFloat>:
maxss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @STSMaxFloat(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = load float, float* %4
%7 = fcmp ogt float %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load float, float* %3
br label %12
10: ; preds = %2
%11 = load float, float* %4
br label %12
12: ; preds = %10, %8
%13 = phi float [ %9, %8 ], [ %11, %10 ]
ret float %13
}

LLVM IR (-O2):
define float @STSMaxFloat(float %0, float %1) {
%3 = fcmp ogt float %0, %1
%4 = select i1 %3, float %0, float %1
ret float %4
}
/* Type definitions */
struct rbtree {
  int dummy;
};
struct rbnode {
  int dummy;
};

/* Variables and functions */
struct rbnode *rbtree_insert3(struct rbtree *, struct rbnode *, int);
struct rbnode *rbtree_insert_replace(struct rbtree *rbtree,
                                     struct rbnode *data) {
  return rbtree_insert3(rbtree, data, 2);
}


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

x86 assembly (clang, -O2):
<rbtree_insert_replace>:
mov    $0x2,%edx
jmp    1030 <rbtree_insert3@plt>

LLVM IR (-O0):
%struct.rbtree = type { i32 }
%struct.rbnode = type { i32 }
define %struct.rbnode* @rbtree_insert_replace(%struct.rbtree* %0, %struct.rbnode* %1) {
%3 = alloca %struct.rbtree*
%4 = alloca %struct.rbnode*
store %struct.rbtree* %0, %struct.rbtree** %3
store %struct.rbnode* %1, %struct.rbnode** %4
%5 = load %struct.rbtree*, %struct.rbtree** %3
%6 = load %struct.rbnode*, %struct.rbnode** %4
%7 = call %struct.rbnode* @rbtree_insert3(%struct.rbtree* %5, %struct.rbnode* %6, i32 2)
ret %struct.rbnode* %7
}

LLVM IR (-O2):
%struct.rbtree = type { i32 }
%struct.rbnode = type { i32 }
define %struct.rbnode* @rbtree_insert_replace(%struct.rbtree* %0, %struct.rbnode* %1) {
%3 = tail call %struct.rbnode* @rbtree_insert3(%struct.rbtree* %0, %struct.rbnode* %1, i32 2)
ret %struct.rbnode* %3
}
/* Type definitions */
struct kbdiacrs {
  int dummy;
};
typedef int /*<<< orphan*/ m;

/* Variables and functions */
int main(void) {
  struct kbdiacrs m;
  (void)m;
  return sizeof(m);
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 4
}
int compare_unsigned_int(const void *a, const void *b) {
  unsigned int *a_i = (unsigned int *)a;
  unsigned int *b_i = (unsigned int *)b;
  if (*a_i < *b_i)
    return -1;
  else if (*a_i > *b_i)
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<compare_unsigned_int>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rax
mov    (%rax),%eax
mov    -0x28(%rbp),%rcx
cmp    (%rcx),%eax
jae    113a <compare_unsigned_int+0x3a>
movl   $0xffffffff,-0x4(%rbp)
jmp    115f <compare_unsigned_int+0x5f>
mov    -0x20(%rbp),%rax
mov    (%rax),%eax
mov    -0x28(%rbp),%rcx
cmp    (%rcx),%eax
jbe    1158 <compare_unsigned_int+0x58>
movl   $0x1,-0x4(%rbp)
jmp    115f <compare_unsigned_int+0x5f>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @compare_unsigned_int(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = bitcast i8* %1 to i32*
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = icmp ult i32 %5, %6
%8 = icmp ugt i32 %5, %6
%9 = zext i1 %8 to i32
%10 = select i1 %7, i32 -1, i32 %9
ret i32 %10
}
void up(int *sem) { *sem = 0; }


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

x86 assembly (clang, -O2):
<up>:
movl   $0x0,(%rdi)
ret

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

LLVM IR (-O2):
define void @up(i32* nocapture writeonly %0) {
store i32 0, i32* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ outportb(int, int);
void irq_remap() {
  outportb(0x20, 0x11);
  outportb(0xA0, 0x11);
  outportb(0x21, 0x20);
  outportb(0xA1, 0x28);
  outportb(0x21, 0x04);
  outportb(0xA1, 0x02);
  outportb(0x21, 0x01);
  outportb(0xA1, 0x01);
  outportb(0x21, 0x00);
  outportb(0xA1, 0x00);
}


x86 assembly (clang, -O0):
<irq_remap>:
push   %rbp
mov    %rsp,%rbp
mov    $0x20,%edi
mov    $0x11,%esi
call   1030 <outportb@plt>
mov    $0xa0,%edi
mov    $0x11,%esi
call   1030 <outportb@plt>
mov    $0x21,%edi
mov    $0x20,%esi
call   1030 <outportb@plt>
mov    $0xa1,%edi
mov    $0x28,%esi
call   1030 <outportb@plt>
mov    $0x21,%edi
mov    $0x4,%esi
call   1030 <outportb@plt>
mov    $0xa1,%edi
mov    $0x2,%esi
call   1030 <outportb@plt>
mov    $0x21,%edi
mov    $0x1,%esi
call   1030 <outportb@plt>
mov    $0xa1,%edi
mov    $0x1,%esi
call   1030 <outportb@plt>
mov    $0x21,%edi
xor    %esi,%esi
call   1030 <outportb@plt>
mov    $0xa1,%edi
xor    %esi,%esi
call   1030 <outportb@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<irq_remap>:
push   %rax
mov    $0x20,%edi
mov    $0x11,%esi
call   1030 <outportb@plt>
mov    $0xa0,%edi
mov    $0x11,%esi
call   1030 <outportb@plt>
mov    $0x21,%edi
mov    $0x20,%esi
call   1030 <outportb@plt>
mov    $0xa1,%edi
mov    $0x28,%esi
call   1030 <outportb@plt>
mov    $0x21,%edi
mov    $0x4,%esi
call   1030 <outportb@plt>
mov    $0xa1,%edi
mov    $0x2,%esi
call   1030 <outportb@plt>
mov    $0x21,%edi
mov    $0x1,%esi
call   1030 <outportb@plt>
mov    $0xa1,%edi
mov    $0x1,%esi
call   1030 <outportb@plt>
mov    $0x21,%edi
xor    %esi,%esi
call   1030 <outportb@plt>
mov    $0xa1,%edi
xor    %esi,%esi
pop    %rax
jmp    1030 <outportb@plt>

LLVM IR (-O0):
define void @irq_remap() {
%1 = call i32 @outportb(i32 32, i32 17)
%2 = call i32 @outportb(i32 160, i32 17)
%3 = call i32 @outportb(i32 33, i32 32)
%4 = call i32 @outportb(i32 161, i32 40)
%5 = call i32 @outportb(i32 33, i32 4)
%6 = call i32 @outportb(i32 161, i32 2)
%7 = call i32 @outportb(i32 33, i32 1)
%8 = call i32 @outportb(i32 161, i32 1)
%9 = call i32 @outportb(i32 33, i32 0)
%10 = call i32 @outportb(i32 161, i32 0)
ret void
}

LLVM IR (-O2):
define void @irq_remap() {
%1 = tail call i32 @outportb(i32 32, i32 17)
%2 = tail call i32 @outportb(i32 160, i32 17)
%3 = tail call i32 @outportb(i32 33, i32 32)
%4 = tail call i32 @outportb(i32 161, i32 40)
%5 = tail call i32 @outportb(i32 33, i32 4)
%6 = tail call i32 @outportb(i32 161, i32 2)
%7 = tail call i32 @outportb(i32 33, i32 1)
%8 = tail call i32 @outportb(i32 161, i32 1)
%9 = tail call i32 @outportb(i32 33, i32 0)
%10 = tail call i32 @outportb(i32 161, i32 0)
ret void
}
float m_product_cf(float n, float k) {
  int i = 1;
  float result = 1;
  for (i = 1; i <= k; ++i) {
    result = ((n - (k - i)) / i) * result;
  }
  return result;
}


x86 assembly (clang, -O0):
<m_product_cf>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
movss  0xee3(%rip),%xmm0
movss  %xmm0,-0x10(%rbp)
movl   $0x1,-0xc(%rbp)
cvtsi2ssl -0xc(%rbp),%xmm1
movss  -0x8(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jb     1174 <m_product_cf+0x74>
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
cvtsi2ssl -0xc(%rbp),%xmm2
subss  %xmm2,%xmm1
subss  %xmm1,%xmm0
cvtsi2ssl -0xc(%rbp),%xmm1
divss  %xmm1,%xmm0
mulss  -0x10(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1129 <m_product_cf+0x29>
movss  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<m_product_cf>:
movss  0xef8(%rip),%xmm2
ucomiss %xmm2,%xmm1
jb     1145 <m_product_cf+0x45>
movss  0xeeb(%rip),%xmm3
mov    $0x2,%eax
movaps %xmm3,%xmm2
nopl   (%rax)
movaps %xmm1,%xmm4
subss  %xmm3,%xmm4
movaps %xmm0,%xmm5
subss  %xmm4,%xmm5
divss  %xmm3,%xmm5
xorps  %xmm3,%xmm3
cvtsi2ss %eax,%xmm3
mulss  %xmm5,%xmm2
add    $0x1,%eax
ucomiss %xmm3,%xmm1
jae    1120 <m_product_cf+0x20>
movaps %xmm2,%xmm0
ret

LLVM IR (-O0):
define float @m_product_cf(float %0, float %1) {
%3 = alloca float
%4 = alloca float
%5 = alloca i32
%6 = alloca float
store float %0, float* %3
store float %1, float* %4
store i32 1, i32* %5
store float 1.000000e+00, float* %6
store i32 1, i32* %5
br label %7
7: ; preds = %24, %2
%8 = load i32, i32* %5
%9 = sitofp i32 %8 to float
%10 = load float, float* %4
%11 = fcmp ole float %9, %10
br i1 %11, label %12, label %27
12: ; preds = %7
%13 = load float, float* %3
%14 = load float, float* %4
%15 = load i32, i32* %5
%16 = sitofp i32 %15 to float
%17 = fsub float %14, %16
%18 = fsub float %13, %17
%19 = load i32, i32* %5
%20 = sitofp i32 %19 to float
%21 = fdiv float %18, %20
%22 = load float, float* %6
%23 = fmul float %21, %22
store float %23, float* %6
br label %24
24: ; preds = %12
%25 = load i32, i32* %5
%26 = add nsw i32 %25, 1
store i32 %26, i32* %5
br label %7
27: ; preds = %7
%28 = load float, float* %6
ret float %28
}

LLVM IR (-O2):
define float @m_product_cf(float %0, float %1) {
%3 = fcmp ult float %1, 1.000000e+00
br i1 %3, label %15, label %4
4: ; preds = %2, %4
%5 = phi float [ %13, %4 ], [ 1.000000e+00, %2 ]
%6 = phi float [ %11, %4 ], [ 1.000000e+00, %2 ]
%7 = phi i32 [ %12, %4 ], [ 1, %2 ]
%8 = fsub float %1, %5
%9 = fsub float %0, %8
%10 = fdiv float %9, %5
%11 = fmul float %6, %10
%12 = add nuw nsw i32 %7, 1
%13 = sitofp i32 %12 to float
%14 = fcmp ugt float %13, %1
br i1 %14, label %15, label %4
15: ; preds = %4, %2
%16 = phi float [ 1.000000e+00, %2 ], [ %11, %4 ]
ret float %16
}
/* Variables and functions */
double log(double);
double proportionToNegLnCauchy(double x, float cauchyParam) {
  return log((x / (cauchyParam * 256)) * (x / (cauchyParam * 256)) + 1.0);
}


x86 assembly (clang, -O0):
<proportionToNegLnCauchy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movss  %xmm1,-0xc(%rbp)
movsd  -0x8(%rbp),%xmm0
movss  0xed9(%rip),%xmm1
mulss  -0xc(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
divsd  %xmm1,%xmm0
movsd  -0x8(%rbp),%xmm1
movss  0xebf(%rip),%xmm2
mulss  -0xc(%rbp),%xmm2
cvtss2sd %xmm2,%xmm2
divsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  0xe9e(%rip),%xmm1
addsd  %xmm1,%xmm0
call   1030 <log@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<proportionToNegLnCauchy>:
mulss  0xee8(%rip),%xmm1
cvtss2sd %xmm1,%xmm1
divsd  %xmm1,%xmm0
mulsd  %xmm0,%xmm0
addsd  0xedc(%rip),%xmm0
jmp    1030 <log@plt>

LLVM IR (-O0):
define double @proportionToNegLnCauchy(double %0, float %1) {
%3 = alloca double
%4 = alloca float
store double %0, double* %3
store float %1, float* %4
%5 = load double, double* %3
%6 = load float, float* %4
%7 = fmul float %6, 2.560000e+02
%8 = fpext float %7 to double
%9 = fdiv double %5, %8
%10 = load double, double* %3
%11 = load float, float* %4
%12 = fmul float %11, 2.560000e+02
%13 = fpext float %12 to double
%14 = fdiv double %10, %13
%15 = call double @llvm.fmuladd.f64(double %9, double %14, double 1.000000e+00)
%16 = call double @log(double %15)
ret double %16
}

LLVM IR (-O2):
define double @proportionToNegLnCauchy(double %0, float %1) {
%3 = fmul float %1, 2.560000e+02
%4 = fpext float %3 to double
%5 = fdiv double %0, %4
%6 = tail call double @llvm.fmuladd.f64(double %5, double %5, double 1.000000e+00)
%7 = tail call double @log(double %6)
ret double %7
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
__attribute__((visibility("hidden"))) unsigned int log2u(unsigned int i) {
  unsigned int bit = 0;
  assert(i >= 2);
  while (i >>= 1)
    ++bit;
  return bit;
}


x86 assembly (clang, -O0):
<log2u>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x2,-0x4(%rbp)
setae  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x4(%rbp),%eax
shr    $0x1,%eax
mov    %eax,-0x4(%rbp)
cmp    $0x0,%eax
je     1153 <log2u+0x43>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1133 <log2u+0x23>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<log2u>:
push   %rbx
mov    %edi,%ebx
xor    %edi,%edi
cmp    $0x2,%ebx
setae  %dil
call   1030 <assert@plt>
xor    %eax,%eax
cmp    $0x2,%ebx
jb     113c <log2u+0x2c>
xor    %eax,%eax
mov    %ebx,%ecx
nopl   0x0(%rax)
shr    %ecx
add    $0x1,%eax
cmp    $0x3,%ebx
mov    %ecx,%ebx
ja     1130 <log2u+0x20>
pop    %rbx
ret

LLVM IR (-O0):
define hidden i32 @log2u(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
%4 = load i32, i32* %2
%5 = icmp uge i32 %4, 2
%6 = zext i1 %5 to i32
%7 = call i32 @assert(i32 %6)
br label %8
8: ; preds = %12, %1
%9 = load i32, i32* %2
%10 = lshr i32 %9, 1
store i32 %10, i32* %2
%11 = icmp ne i32 %10, 0
br i1 %11, label %12, label %15
12: ; preds = %8
%13 = load i32, i32* %3
%14 = add i32 %13, 1
store i32 %14, i32* %3
br label %8
15: ; preds = %8
%16 = load i32, i32* %3
ret i32 %16
}

LLVM IR (-O2):
define hidden i32 @log2u(i32 %0) {
%2 = icmp ugt i32 %0, 1
%3 = zext i1 %2 to i32
%4 = tail call i32 @assert(i32 %3)
%5 = icmp ult i32 %0, 2
br i1 %5, label %12, label %6
6: ; preds = %1, %6
%7 = phi i32 [ %10, %6 ], [ 0, %1 ]
%8 = phi i32 [ %9, %6 ], [ %0, %1 ]
%9 = lshr i32 %8, 1
%10 = add nuw nsw i32 %7, 1
%11 = icmp ult i32 %8, 4
br i1 %11, label %12, label %6
12: ; preds = %6, %1
%13 = phi i32 [ 0, %1 ], [ %10, %6 ]
ret i32 %13
}
void gtk_radio_button_set_group() {}


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

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

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

LLVM IR (-O2):
define void @gtk_radio_button_set_group() {
ret void
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ PASS(char *);
int /*<<< orphan*/ foo();
int main() {
  foo();
  PASS("rpath-nesting");
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <foo@plt>
lea    0xec3(%rip),%rdi
call   1040 <PASS@plt>
mov    0x2e97(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <foo@plt>
lea    0xed1(%rip),%rdi
call   1040 <PASS@plt>
mov    0x2ea5(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"rpath-nesting\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @foo()
%3 = call i32 @PASS(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* @EXIT_SUCCESS
ret i32 %4
}

LLVM IR (-O2):
@.str = [14 x i8] c"rpath-nesting\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = tail call i32 (...) @foo()
%2 = tail call i32 @PASS(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @EXIT_SUCCESS
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
extern void stbi_image_free(void *retval_from_stbi_load) {
  free(retval_from_stbi_load);
}


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

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

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

LLVM IR (-O2):
define void @stbi_image_free(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ anykey();
int /*<<< orphan*/ printf(char *);
void cry() {
  printf("Blood and destruction shall be so in use \nAnd dreadful objects so "
         "familiar \nThat mothers shall but smile when they behold \nTheir "
         "infants quarter\'d with the hands of war; \nAll pity choked with "
         "custom of fell deeds: \nAnd Caesar\'s spirit, ranging for revenge, "
         "\nWith Ate by his side come hot from hell, \nShall in these confines "
         "with a monarch\'s voice \nCry \'Havoc,\' and let slip the dogs of "
         "war; \nThat this foul deed shall smell above the earth \nWith "
         "carrion men, groaning for burial.\n\n");
  anykey();
}


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

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

LLVM IR (-O0):
@.str = [482 x i8] c"Blood and destruction shall be so in use \0AAnd dreadful objects so familiar \0AThat mothers shall but smile when they behold \0ATheir infants quarter'd with the hands of war; \0AAll pity choked with custom of fell deeds: \0AAnd Caesar's spirit, ranging for revenge, \0AWith Ate by his side come hot from hell, \0AShall in these confines with a monarch's voice \0ACry 'Havoc,' and let slip the dogs of war; \0AThat this foul deed shall smell above the earth \0AWith carrion men, groaning for burial.\0A\0A\00"
define void @cry() {
%1 = call i32 @printf(i8* getelementptr inbounds ([482 x i8], [482 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (...) @anykey()
ret void
}

LLVM IR (-O2):
@str = [481 x i8] c"Blood and destruction shall be so in use \0AAnd dreadful objects so familiar \0AThat mothers shall but smile when they behold \0ATheir infants quarter'd with the hands of war; \0AAll pity choked with custom of fell deeds: \0AAnd Caesar's spirit, ranging for revenge, \0AWith Ate by his side come hot from hell, \0AShall in these confines with a monarch's voice \0ACry 'Havoc,' and let slip the dogs of war; \0AThat this foul deed shall smell above the earth \0AWith carrion men, groaning for burial.\0A\00"
define void @cry() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([481 x i8], [481 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (...) @anykey()
ret void
}
int prog_rshift(int a, int b) { return (a >> b); }


x86 assembly (clang, -O0):
<prog_rshift>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
sar    %cl,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<prog_rshift>:
mov    %esi,%ecx
mov    %edi,%eax
sar    %cl,%eax
ret

LLVM IR (-O0):
define i32 @prog_rshift(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 = ashr i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @prog_rshift(i32 %0, i32 %1) {
%3 = ashr i32 %0, %1
ret i32 %3
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  int send_event;
};
typedef TYPE_1__ XGraphicsExposeEvent;

/* Variables and functions */
void set_XGraphicsExposeEvent_send_event(void *_p, int _v) {
  ((XGraphicsExposeEvent *)_p)->send_event = (int)_v;
}


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

x86 assembly (clang, -O2):
<set_XGraphicsExposeEvent_send_event>:
mov    %esi,(%rdi)
ret

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

LLVM IR (-O2):
define void @set_XGraphicsExposeEvent_send_event(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
store i32 %1, i32* %3
ret void
}