xunge/DecIR huggingface dataset:
/* Variables and functions */
char getchar();
int /*<<< orphan*/ printf(char *, int);
int main() {
  printf("%zd\n", sizeof(long));
  char ch2 = getchar();
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [5 x i8] c"%zd\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
store i32 0, i32* %1
%3 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 8)
%4 = call signext i8 (...) @getchar()
store i8 %4, i8* %2
ret i32 0
}

LLVM IR (-O2):
@.str = [5 x i8] c"%zd\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 8)
%2 = tail call signext i8 (...) @getchar()
ret i32 0
}
/* Type definitions */
struct RNAplex_args_info {
  int dummy;
};

/* Variables and functions */
int EXIT_SUCCESS;
int RNAplex_cmdline_parser_required(struct RNAplex_args_info *args_info,
                                    const char *prog_name) {
  (void)(args_info);
  (void)(prog_name);
  return EXIT_SUCCESS;
}


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

x86 assembly (clang, -O2):
<RNAplex_cmdline_parser_required>:
mov    0x2ed9(%rip),%rax
mov    (%rax),%eax
ret

LLVM IR (-O0):
%struct.RNAplex_args_info = type { i32 }
@EXIT_SUCCESS = global i32 0
define i32 @RNAplex_cmdline_parser_required(%struct.RNAplex_args_info* %0, i8* %1) {
%3 = alloca %struct.RNAplex_args_info*
%4 = alloca i8*
store %struct.RNAplex_args_info* %0, %struct.RNAplex_args_info** %3
store i8* %1, i8** %4
%5 = load %struct.RNAplex_args_info*, %struct.RNAplex_args_info** %3
%6 = load i8*, i8** %4
%7 = load i32, i32* @EXIT_SUCCESS
ret i32 %7
}

LLVM IR (-O2):
%struct.RNAplex_args_info = type { i32 }
@EXIT_SUCCESS = global i32 0
define i32 @RNAplex_cmdline_parser_required(%struct.RNAplex_args_info* nocapture readnone %0, i8* nocapture readnone %1) {
%3 = load i32, i32* @EXIT_SUCCESS
ret i32 %3
}
void *test_anti_range_134(long n) {
  extern void *alloc_anti_range_134(long) __attribute__((alloc_size(1)));
  if ((-0x7fffffffffffffffL - 1) + 2 <= n && n <= 2)
    n = (-0x7fffffffffffffffL - 1) + 2 - 1;
  return alloc_anti_range_134(n);
}


x86 assembly (clang, -O0):
<test_anti_range_134>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movabs $0x8000000000000002,%rax
cmp    -0x8(%rbp),%rax
jg     1149 <test_anti_range_134+0x39>
cmpq   $0x2,-0x8(%rbp)
jg     1149 <test_anti_range_134+0x39>
movabs $0x8000000000000001,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <alloc_anti_range_134@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_anti_range_134>:
movabs $0x8000000000000001,%rax
lea    (%rdi,%rax,1),%rcx
add    $0xfffffffffffffffd,%rcx
cmp    %rax,%rcx
cmovb  %rax,%rdi
jmp    1030 <alloc_anti_range_134@plt>

LLVM IR (-O0):
define i8* @test_anti_range_134(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = icmp sle i64 -9223372036854775806, %3
br i1 %4, label %5, label %9
5: ; preds = %1
%6 = load i64, i64* %2
%7 = icmp sle i64 %6, 2
br i1 %7, label %8, label %9
8: ; preds = %5
store i64 -9223372036854775807, i64* %2
br label %9
9: ; preds = %8, %5, %1
%10 = load i64, i64* %2
%11 = call i8* @alloc_anti_range_134(i64 %10)
ret i8* %11
}

LLVM IR (-O2):
define i8* @test_anti_range_134(i64 %0) {
%2 = add i64 %0, 9223372036854775806
%3 = icmp ult i64 %2, -9223372036854775807
%4 = select i1 %3, i64 -9223372036854775807, i64 %0
%5 = tail call i8* @alloc_anti_range_134(i64 %4)
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ error(char *, char *, char *);
void error_file(char *task, char *filename) {
  error("Error %s file %s.\n", task, filename);
}


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

x86 assembly (clang, -O2):
<error_file>:
mov    %rsi,%rdx
mov    %rdi,%rsi
lea    0xee3(%rip),%rdi
jmp    1030 <error@plt>

LLVM IR (-O0):
@.str = [19 x i8] c"Error %s file %s.\0A\00"
define void @error_file(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 = load i8*, i8** %4
%7 = call i32 @error(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* %5, i8* %6)
ret void
}

LLVM IR (-O2):
@.str = [19 x i8] c"Error %s file %s.\0A\00"
define void @error_file(i8* %0, i8* %1) {
%3 = tail call i32 @error(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ puts(char *);
void printElement(int data, int depth) {
  int i;
  printf("%02d(%02d)", data, depth);
  for (i = 0; i < depth; i++)
    printf("-");
  puts("");
}


x86 assembly (clang, -O0):
<printElement>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xec5(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1171 <printElement+0x51>
lea    0xeaf(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1149 <printElement+0x29>
lea    0xe92(%rip),%rdi
call   1030 <puts@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printElement>:
push   %rbx
mov    %esi,%ebx
mov    %edi,%esi
lea    0xed4(%rip),%rdi
mov    %ebx,%edx
xor    %eax,%eax
call   1040 <printf@plt>
test   %ebx,%ebx
jle    114f <printElement+0x2f>
nopl   0x0(%rax)
mov    $0x2d,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebx
jne    1140 <printElement+0x20>
mov    $0xa,%edi
pop    %rbx
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"%02d(%02d)\00"
@.str.1 = [2 x i8] c"-\00"
@.str.2 = [1 x i8] zeroinitializer
define void @printElement(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 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %6, i32 %7)
store i32 0, i32* %5
br label %9
9: ; preds = %15, %2
%10 = load i32, i32* %5
%11 = load i32, i32* %4
%12 = icmp slt i32 %10, %11
br i1 %12, label %13, label %18
13: ; preds = %9
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
br label %15
15: ; preds = %13
%16 = load i32, i32* %5
%17 = add nsw i32 %16, 1
store i32 %17, i32* %5
br label %9
18: ; preds = %9
%19 = call i32 @puts(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"%02d(%02d)\00"
define void @printElement(i32 %0, i32 %1) {
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1)
%4 = icmp sgt i32 %1, 0
br i1 %4, label %5, label %10
5: ; preds = %2, %5
%6 = phi i32 [ %8, %5 ], [ 0, %2 ]
%7 = tail call i32 @putchar(i32 45)
%8 = add nuw nsw i32 %6, 1
%9 = icmp eq i32 %8, %1
br i1 %9, label %10, label %5
10: ; preds = %5, %2
%11 = tail call i32 @putchar(i32 10)
ret void
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  unsigned long border_pixel;
};
typedef TYPE_1__ XSetWindowAttributes;

/* Variables and functions */
void set_XSetWindowAttributes_border_pixel(void *_p, unsigned long _v) {
  ((XSetWindowAttributes *)_p)->border_pixel = (unsigned long)_v;
}


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

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

LLVM IR (-O0):
%struct.TYPE_2__ = type { i64 }
define void @set_XSetWindowAttributes_border_pixel(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i64, i64* %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 i64 %5, i64* %8
ret void
}

LLVM IR (-O2):
define void @set_XSetWindowAttributes_border_pixel(i8* nocapture writeonly %0, i64 %1) {
%3 = bitcast i8* %0 to i64*
store i64 %1, i64* %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ pwm20ms();
int /*<<< orphan*/ pwmOn();
int /*<<< orphan*/ pwmSleep();
void pwmInit() {
  pwmSleep();
  pwm20ms();
  pwmOn();
}


x86 assembly (clang, -O0):
<pwmInit>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <pwmSleep@plt>
mov    $0x0,%al
call   1050 <pwm20ms@plt>
mov    $0x0,%al
call   1030 <pwmOn@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<pwmInit>:
push   %rax
xor    %eax,%eax
call   1040 <pwmSleep@plt>
xor    %eax,%eax
call   1050 <pwm20ms@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <pwmOn@plt>

LLVM IR (-O0):
define void @pwmInit() {
%1 = call i32 (...) @pwmSleep()
%2 = call i32 (...) @pwm20ms()
%3 = call i32 (...) @pwmOn()
ret void
}

LLVM IR (-O2):
define void @pwmInit() {
%1 = tail call i32 (...) @pwmSleep()
%2 = tail call i32 (...) @pwm20ms()
%3 = tail call i32 (...) @pwmOn()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, float);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int r;
  float v;
  scanf("%d", &r);
  v = 4.0f / 3.0f * 3.1415f * (r * r * r);
  printf("%f\n", v);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xece(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
imul   -0x8(%rbp),%eax
imul   -0x8(%rbp),%eax
cvtsi2ss %eax,%xmm1
movss  0xeaa(%rip),%xmm0
mulss  %xmm1,%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
lea    0xe9c(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xedc(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%eax
mov    %eax,%ecx
imul   %eax,%ecx
imul   %eax,%ecx
cvtsi2ss %ecx,%xmm0
mulss  0xeb6(%rip),%xmm0
lea    0xeb6(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"%f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca float
store i32 0, i32* %1
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%5 = load i32, i32* %2
%6 = load i32, i32* %2
%7 = mul nsw i32 %5, %6
%8 = load i32, i32* %2
%9 = mul nsw i32 %7, %8
%10 = sitofp i32 %9 to float
%11 = fmul float 0x4010C131E0000000, %10
store float %11, float* %3
%12 = load float, float* %3
%13 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), float %12)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"%f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = mul nsw i32 %4, %4
%6 = mul nsw i32 %5, %4
%7 = sitofp i32 %6 to float
%8 = fmul float %7, 0x4010C131E0000000
%9 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), float %8)
ret i32 0
}
__attribute__((visibility("hidden"))) __attribute__((aarch64_vector_pcs)) void
f_hidden_vpcs(void) {}


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

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

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

LLVM IR (-O2):
define hidden void @f_hidden_vpcs() {
ret void
}
int test_imm_7Duint16_mem(unsigned short *val) {
  return ((*val) & (-0x7D << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_7Duint16_mem>:
movzwl (%rdi),%eax
test   $0xff83,%eax
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_7Duint16_mem(i16* %0) {
%2 = alloca i16*
store i16* %0, i16** %2
%3 = load i16*, i16** %2
%4 = load i16, i16* %3
%5 = zext i16 %4 to i32
%6 = and i32 %5, -125
%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_7Duint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, -125
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ setup_parent(char *, int, char **);
int main(int argc, char *argv[]) { setup_parent("tcp", argc, argv); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rdx
lea    0xed3(%rip),%rdi
call   1030 <setup_parent@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    %rsi,%rdx
mov    %edi,%esi
lea    0xee3(%rip),%rdi
call   1030 <setup_parent@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"tcp\00"
define i32 @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 @setup_parent(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %5, i8** %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"tcp\00"
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @setup_parent(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %0, i8** %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ putc_serial(char);
void puts_serial(const char *str) {
  const char *s = str;
  while (*s) {
    putc_serial(*s++);
  }
  putc_serial('\n');
}


x86 assembly (clang, -O0):
<puts_serial>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     114d <puts_serial+0x3d>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movsbl (%rax),%edi
call   1030 <putc_serial@plt>
jmp    1124 <puts_serial+0x14>
mov    $0xa,%edi
call   1030 <putc_serial@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<puts_serial>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1133 <puts_serial+0x23>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movsbl %al,%edi
call   1030 <putc_serial@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <puts_serial+0x10>
mov    $0xa,%edi
pop    %rbx
jmp    1030 <putc_serial@plt>

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

LLVM IR (-O2):
define void @puts_serial(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %9, %4 ], [ %2, %1 ]
%6 = phi i8* [ %7, %4 ], [ %0, %1 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = tail call i32 @putc_serial(i8 signext %5)
%9 = load i8, i8* %7
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
%12 = tail call i32 @putc_serial(i8 signext 10)
ret void
}
void comm_gpu(int options) {}


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

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

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

LLVM IR (-O2):
define void @comm_gpu(i32 %0) {
ret void
}
/* Variables and functions */
double M_PI;
double rad_deg(double ang) { return ang / (M_PI / 180.0); }


x86 assembly (clang, -O0):
<rad_deg>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
mov    0x2ed3(%rip),%rax
movsd  (%rax),%xmm1
movsd  0xedf(%rip),%xmm2
divsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<rad_deg>:
mov    0x2ee1(%rip),%rax
movsd  (%rax),%xmm1
divsd  0xeed(%rip),%xmm1
divsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
@M_PI = global double 0.000000e+00
define double @rad_deg(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = load double, double* @M_PI
%5 = fdiv double %4, 1.800000e+02
%6 = fdiv double %3, %5
ret double %6
}

LLVM IR (-O2):
@M_PI = global double 0.000000e+00
define double @rad_deg(double %0) {
%2 = load double, double* @M_PI
%3 = fdiv double %2, 1.800000e+02
%4 = fdiv double %0, %3
ret double %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("Hello CAB202!\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 = [15 x i8] c"Hello CAB202!\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [14 x i8] c"Hello CAB202!\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
ret i32 0
}
void DMA_INT2_IRQHandler(void) {
  while (1) {
  }
}


x86 assembly (clang, -O0):
<DMA_INT2_IRQHandler>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <DMA_INT2_IRQHandler+0x9>
jmp    1109 <DMA_INT2_IRQHandler+0x9>

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

LLVM IR (-O0):
define void @DMA_INT2_IRQHandler() {
br label %1
1: ; preds = %0, %1
br label %1
}

LLVM IR (-O2):
define void @DMA_INT2_IRQHandler() {
br label %1
1: ; preds = %0, %1
br label %1
}
int d_eq_mr1(double *a1, double a2) { return (((*a1) == (a2))); }


x86 assembly (clang, -O0):
<d_eq_mr1>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
ucomisd -0x10(%rbp),%xmm0
sete   %al
setnp  %cl
and    %cl,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<d_eq_mr1>:
cmpeqsd (%rdi),%xmm0
movq   %xmm0,%rax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @d_eq_mr1(double* %0, double %1) {
%3 = alloca double*
%4 = alloca double
store double* %0, double** %3
store double %1, double* %4
%5 = load double*, double** %3
%6 = load double, double* %5
%7 = load double, double* %4
%8 = fcmp oeq double %6, %7
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @d_eq_mr1(double* nocapture %0, double %1) {
%3 = load double, double* %0
%4 = fcmp oeq double %3, %1
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Type definitions */
struct ac_buffer {
  int dummy;
};

/* Variables and functions */
int _buffer_write(struct ac_buffer *, double *, int);
int buffer_write_double(struct ac_buffer *buffer, double value) {
  return _buffer_write(buffer, &value, sizeof(double));
}


x86 assembly (clang, -O0):
<buffer_write_double>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x10(%rbp),%rsi
mov    $0x8,%edx
call   1030 <_buffer_write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<buffer_write_double>:
push   %rax
movsd  %xmm0,(%rsp)
mov    %rsp,%rsi
mov    $0x8,%edx
call   1030 <_buffer_write@plt>
pop    %rcx
ret

LLVM IR (-O0):
%struct.ac_buffer = type { i32 }
define i32 @buffer_write_double(%struct.ac_buffer* %0, double %1) {
%3 = alloca %struct.ac_buffer*
%4 = alloca double
store %struct.ac_buffer* %0, %struct.ac_buffer** %3
store double %1, double* %4
%5 = load %struct.ac_buffer*, %struct.ac_buffer** %3
%6 = call i32 @_buffer_write(%struct.ac_buffer* %5, double* %4, i32 8)
ret i32 %6
}

LLVM IR (-O2):
%struct.ac_buffer = type { i32 }
define i32 @buffer_write_double(%struct.ac_buffer* %0, double %1) {
%3 = alloca double
store double %1, double* %3
%4 = call i32 @_buffer_write(%struct.ac_buffer* %0, double* %3, i32 8)
ret i32 %4
}
void harfAdder(int *a, int *b, int *s, int *c) {
  *c = *a && *b;
  *s = (*a || *b) && (!*c);
}


x86 assembly (clang, -O0):
<harfAdder>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rcx
xor    %eax,%eax
cmpl   $0x0,(%rcx)
mov    %al,-0x21(%rbp)
je     1133 <harfAdder+0x33>
mov    -0x10(%rbp),%rax
cmpl   $0x0,(%rax)
setne  %al
mov    %al,-0x21(%rbp)
mov    -0x21(%rbp),%al
and    $0x1,%al
movzbl %al,%ecx
mov    -0x20(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x8(%rbp),%rax
cmpl   $0x0,(%rax)
jne    1160 <harfAdder+0x60>
mov    -0x10(%rbp),%rcx
xor    %eax,%eax
cmpl   $0x0,(%rcx)
mov    %al,-0x22(%rbp)
je     116f <harfAdder+0x6f>
mov    -0x20(%rbp),%rax
cmpl   $0x0,(%rax)
setne  %al
xor    $0xff,%al
mov    %al,-0x22(%rbp)
mov    -0x22(%rbp),%al
and    $0x1,%al
movzbl %al,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<harfAdder>:
cmpl   $0x0,(%rdi)
je     110f <harfAdder+0xf>
xor    %eax,%eax
cmpl   $0x0,(%rsi)
setne  %al
jmp    1111 <harfAdder+0x11>
xor    %eax,%eax
mov    %eax,(%rcx)
cmpl   $0x0,(%rdi)
jne    111d <harfAdder+0x1d>
cmpl   $0x0,(%rsi)
je     1123 <harfAdder+0x23>
xor    $0x1,%eax
mov    %eax,(%rdx)
ret
xor    %eax,%eax
mov    %eax,(%rdx)
ret

LLVM IR (-O0):
define void @harfAdder(i32* %0, i32* %1, i32* %2, i32* %3) {
%5 = alloca i32*
%6 = alloca i32*
%7 = alloca i32*
%8 = alloca i32*
store i32* %0, i32** %5
store i32* %1, i32** %6
store i32* %2, i32** %7
store i32* %3, i32** %8
%9 = load i32*, i32** %5
%10 = load i32, i32* %9
%11 = icmp ne i32 %10, 0
br i1 %11, label %12, label %16
12: ; preds = %4
%13 = load i32*, i32** %6
%14 = load i32, i32* %13
%15 = icmp ne i32 %14, 0
br label %16
16: ; preds = %12, %4
%17 = phi i1 [ false, %4 ], [ %15, %12 ]
%18 = zext i1 %17 to i32
%19 = load i32*, i32** %8
store i32 %18, i32* %19
%20 = load i32*, i32** %5
%21 = load i32, i32* %20
%22 = icmp ne i32 %21, 0
br i1 %22, label %27, label %23
23: ; preds = %16
%24 = load i32*, i32** %6
%25 = load i32, i32* %24
%26 = icmp ne i32 %25, 0
br i1 %26, label %27, label %32
27: ; preds = %23, %16
%28 = load i32*, i32** %8
%29 = load i32, i32* %28
%30 = icmp ne i32 %29, 0
%31 = xor i1 %30, true
br label %32
32: ; preds = %27, %23
%33 = phi i1 [ false, %23 ], [ %31, %27 ]
%34 = zext i1 %33 to i32
%35 = load i32*, i32** %7
store i32 %34, i32* %35
ret void
}

LLVM IR (-O2):
define void @harfAdder(i32* nocapture %0, i32* nocapture %1, i32* nocapture writeonly %2, i32* nocapture %3) {
%5 = load i32, i32* %0
%6 = icmp eq i32 %5, 0
br i1 %6, label %11, label %7
7: ; preds = %4
%8 = load i32, i32* %1
%9 = icmp ne i32 %8, 0
%10 = zext i1 %9 to i32
br label %11
11: ; preds = %7, %4
%12 = phi i32 [ 0, %4 ], [ %10, %7 ]
store i32 %12, i32* %3
%13 = load i32, i32* %0
%14 = icmp eq i32 %13, 0
br i1 %14, label %15, label %18
15: ; preds = %11
%16 = load i32, i32* %1
%17 = icmp eq i32 %16, 0
br i1 %17, label %20, label %18
18: ; preds = %15, %11
%19 = xor i32 %12, 1
br label %20
20: ; preds = %18, %15
%21 = phi i32 [ 0, %15 ], [ %19, %18 ]
store i32 %21, i32* %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  fprintf(stderr, "Usage: fixdep [-e] <depfile> <target> <cmdline>\n");
  fprintf(stderr, " -e  insert extra dependencies given on stdin\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    0x2ea0(%rip),%rax
mov    (%rax),%edi
lea    0xee8(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [49 x i8] c"Usage: fixdep [-e] <depfile> <target> <cmdline>\0A\00"
@.str.1 = [47 x i8] c" -e insert extra dependencies given on stdin\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stderr
%4 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.1, i64 0, i64 0))
%5 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [49 x i8] c"Usage: fixdep [-e] <depfile> <target> <cmdline>\0A\00"
@.str.1 = [47 x i8] c" -e insert extra dependencies given on stdin\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.1, i64 0, i64 0))
%5 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
unsigned int inl(unsigned long);
unsigned int sunxi_io_read(void *base, int offset) {
  return inl((unsigned long)(base + offset));
}


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

x86 assembly (clang, -O2):
<sunxi_io_read>:
movslq %esi,%rax
add    %rax,%rdi
jmp    1030 <inl@plt>

LLVM IR (-O0):
define i32 @sunxi_io_read(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = load i32, i32* %4
%7 = sext i32 %6 to i64
%8 = getelementptr i8, i8* %5, i64 %7
%9 = ptrtoint i8* %8 to i64
%10 = call i32 @inl(i64 %9)
ret i32 %10
}

LLVM IR (-O2):
define i32 @sunxi_io_read(i8* %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = getelementptr i8, i8* %0, i64 %3
%5 = ptrtoint i8* %4 to i64
%6 = tail call i32 @inl(i64 %5)
ret i32 %6
}
void glutDisplayFunc(void (*func)(void)) {}


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

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

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

LLVM IR (-O2):
define void @glutDisplayFunc(void ()* nocapture %0) {
ret void
}
/* Type definitions */
struct sigvec {
  int dummy;
};
struct sigaction {
  int dummy;
};

/* Variables and functions */
int sigvec(int, struct sigvec *, struct sigvec *);
int sigaction(int sig, const struct sigaction *act, struct sigaction *oldact) {
  return (sigvec(sig, (struct sigvec *)act, (struct sigvec *)oldact));
}


x86 assembly (clang, -O0):
<sigaction>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <sigvec@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sigaction>:
jmp    1030 <sigvec@plt>

LLVM IR (-O0):
%struct.sigaction = type { i32 }
%struct.sigvec = type { i32 }
define i32 @sigaction(i32 %0, %struct.sigaction* %1, %struct.sigaction* %2) {
%4 = alloca i32
%5 = alloca %struct.sigaction*
%6 = alloca %struct.sigaction*
store i32 %0, i32* %4
store %struct.sigaction* %1, %struct.sigaction** %5
store %struct.sigaction* %2, %struct.sigaction** %6
%7 = load i32, i32* %4
%8 = load %struct.sigaction*, %struct.sigaction** %5
%9 = bitcast %struct.sigaction* %8 to %struct.sigvec*
%10 = load %struct.sigaction*, %struct.sigaction** %6
%11 = bitcast %struct.sigaction* %10 to %struct.sigvec*
%12 = call i32 @sigvec(i32 %7, %struct.sigvec* %9, %struct.sigvec* %11)
ret i32 %12
}

LLVM IR (-O2):
%struct.sigaction = type { i32 }
%struct.sigvec = type { i32 }
define i32 @sigaction(i32 %0, %struct.sigaction* %1, %struct.sigaction* %2) {
%4 = bitcast %struct.sigaction* %1 to %struct.sigvec*
%5 = bitcast %struct.sigaction* %2 to %struct.sigvec*
%6 = tail call i32 @sigvec(i32 %0, %struct.sigvec* %4, %struct.sigvec* %5)
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ erase();
int /*<<< orphan*/ getch();
int /*<<< orphan*/ mvprintw(int, int, char *);
int get_options(int rows, int cols) {
  erase();
  mvprintw(rows / 2 - 3, (cols - 14) / 2, "Not yet implemented...");
  getch();
  return 0;
}


x86 assembly (clang, -O0):
<get_options>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <erase@plt>
mov    -0x4(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%edi
sub    $0x3,%edi
mov    -0x8(%rbp),%eax
sub    $0xe,%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%esi
lea    0xe94(%rip),%rdx
call   1050 <mvprintw@plt>
mov    $0x0,%al
call   1040 <getch@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_options>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
xor    %eax,%eax
call   1030 <erase@plt>
mov    %ebp,%edi
shr    $0x1f,%edi
add    %ebp,%edi
sar    %edi
add    $0xfffffffd,%edi
mov    %ebx,%eax
add    $0xfffffff2,%eax
shr    $0x1f,%eax
lea    (%rbx,%rax,1),%esi
add    $0xfffffff2,%esi
sar    %esi
lea    0xe9f(%rip),%rdx
call   1050 <mvprintw@plt>
xor    %eax,%eax
call   1040 <getch@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [23 x i8] c"Not yet implemented...\00"
define i32 @get_options(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = call i32 (...) @erase()
%6 = load i32, i32* %3
%7 = sdiv i32 %6, 2
%8 = sub nsw i32 %7, 3
%9 = load i32, i32* %4
%10 = sub nsw i32 %9, 14
%11 = sdiv i32 %10, 2
%12 = call i32 @mvprintw(i32 %8, i32 %11, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%13 = call i32 (...) @getch()
ret i32 0
}

LLVM IR (-O2):
@.str = [23 x i8] c"Not yet implemented...\00"
define i32 @get_options(i32 %0, i32 %1) {
%3 = tail call i32 (...) @erase()
%4 = sdiv i32 %0, 2
%5 = add nsw i32 %4, -3
%6 = add nsw i32 %1, -14
%7 = sdiv i32 %6, 2
%8 = tail call i32 @mvprintw(i32 %5, i32 %7, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%9 = tail call i32 (...) @getch()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ logInfo(char *, char const *);
void logSuccess(const char *a_cmd) { logInfo("%s succeeded\n", a_cmd); }


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

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

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

LLVM IR (-O2):
@.str = [14 x i8] c"%s succeeded\0A\00"
define void @logSuccess(i8* %0) {
%2 = tail call i32 @logInfo(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ DEBUG_ASSERT(int);
void LPCIntDisable(unsigned long ulBase, unsigned long ulIntFlags) {
  DEBUG_ASSERT(ulBase == 0x40080000);
  (*((volatile unsigned long *)(ulBase + 0x00000100))) &= ~ulIntFlags;
}


x86 assembly (clang, -O0):
<LPCIntDisable>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x40080000,-0x8(%rbp)
40
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <DEBUG_ASSERT@plt>
mov    -0x10(%rbp),%rdx
xor    $0xffffffffffffffff,%rdx
mov    -0x8(%rbp),%rax
mov    0x100(%rax),%rcx
and    %rdx,%rcx
mov    %rcx,0x100(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<LPCIntDisable>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
xor    %edi,%edi
cmp    $0x40080000,%r14
sete   %dil
call   1030 <DEBUG_ASSERT@plt>
not    %rbx
and    %rbx,0x100(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @LPCIntDisable(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = icmp eq i64 %5, 1074266112
%7 = zext i1 %6 to i32
%8 = call i32 @DEBUG_ASSERT(i32 %7)
%9 = load i64, i64* %4
%10 = xor i64 %9, -1
%11 = load i64, i64* %3
%12 = add i64 %11, 256
%13 = inttoptr i64 %12 to i64*
%14 = load volatile i64, i64* %13
%15 = and i64 %14, %10
store volatile i64 %15, i64* %13
ret void
}

LLVM IR (-O2):
define void @LPCIntDisable(i64 %0, i64 %1) {
%3 = icmp eq i64 %0, 1074266112
%4 = zext i1 %3 to i32
%5 = tail call i32 @DEBUG_ASSERT(i32 %4)
%6 = xor i64 %1, -1
%7 = add i64 %0, 256
%8 = inttoptr i64 %7 to i64*
%9 = load volatile i64, i64* %8
%10 = and i64 %9, %6
store volatile i64 %10, i64* %8
ret void
}
/* Type definitions */
struct stat {
  scalar_t__ st_size;
};

/* Variables and functions */
scalar_t__ fstat(int, struct stat *);
int /*<<< orphan*/ printf(char *);
int get_file_size(int fd) {
  struct stat buff;
  if (fstat(fd, &buff) != 0) {
    printf("error!\n");
    return 0;
  }
  return (int)buff.st_size;
}


x86 assembly (clang, -O0):
<get_file_size>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
lea    -0x10(%rbp),%rsi
call   1040 <fstat@plt>
cmp    $0x0,%rax
je     1159 <get_file_size+0x39>
lea    0xeb8(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    1160 <get_file_size+0x40>
mov    -0x10(%rbp),%rax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_file_size>:
push   %rax
mov    %rsp,%rsi
call   1040 <fstat@plt>
test   %rax,%rax
je     113e <get_file_size+0x1e>
lea    0xecb(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret
mov    (%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.stat = type { i64 }
@.str = [8 x i8] c"error!\0A\00"
define i32 @get_file_size(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca %struct.stat
store i32 %0, i32* %3
%5 = load i32, i32* %3
%6 = call i64 @fstat(i32 %5, %struct.stat* %4)
%7 = icmp ne i64 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %2
br label %14
10: ; preds = %1
%11 = getelementptr inbounds %struct.stat, %struct.stat* %4, i32 0, i32 0
%12 = load i64, i64* %11
%13 = trunc i64 %12 to i32
store i32 %13, i32* %2
br label %14
14: ; preds = %10, %8
%15 = load i32, i32* %2
ret i32 %15
}

LLVM IR (-O2):
%struct.stat = type { i64 }
@str = [7 x i8] c"error!\00"
define i32 @get_file_size(i32 %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i64 @fstat(i32 %0, %struct.stat* %2)
%5 = icmp eq i64 %4, 0
br i1 %5, label %8, label %6
6: ; preds = %1
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str, i64 0, i64 0))
br label %12
8: ; preds = %1
%9 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%10 = load i64, i64* %9
%11 = trunc i64 %10 to i32
br label %12
12: ; preds = %8, %6
%13 = phi i32 [ 0, %6 ], [ %11, %8 ]
ret i32 %13
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ _mm_load_ss(float *);
int /*<<< orphan*/ _mm_sqrt_ss(int /*<<< orphan*/);
int /*<<< orphan*/ _mm_store_ss(float *, int /*<<< orphan*/);
uint32_t determ_sqrt_float(uint32_t a) {
  uint32_t r;
  _mm_store_ss((float *)&r, _mm_sqrt_ss(_mm_load_ss((float *)&a)));
  return r;
}


x86 assembly (clang, -O0):
<determ_sqrt_float>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
lea    -0x4(%rbp),%rdi
call   1050 <_mm_load_ss@plt>
mov    %eax,%edi
call   1040 <_mm_sqrt_ss@plt>
mov    -0x10(%rbp),%rdi
mov    %eax,%esi
call   1030 <_mm_store_ss@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<determ_sqrt_float>:
push   %rax
mov    %edi,0x4(%rsp)
lea    0x4(%rsp),%rdi
call   1050 <_mm_load_ss@plt>
mov    %eax,%edi
call   1040 <_mm_sqrt_ss@plt>
mov    %rsp,%rdi
mov    %eax,%esi
call   1030 <_mm_store_ss@plt>
mov    (%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @determ_sqrt_float(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = bitcast i32* %3 to float*
%5 = bitcast i32* %2 to float*
%6 = call i32 @_mm_load_ss(float* %5)
%7 = call i32 @_mm_sqrt_ss(i32 %6)
%8 = call i32 @_mm_store_ss(float* %4, i32 %7)
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
define i32 @determ_sqrt_float(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = bitcast i32* %3 to i8*
%5 = bitcast i32* %3 to float*
%6 = bitcast i32* %2 to float*
%7 = call i32 @_mm_load_ss(float* %6)
%8 = call i32 @_mm_sqrt_ss(i32 %7)
%9 = call i32 @_mm_store_ss(float* %5, i32 %8)
%10 = load i32, i32* %3
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ EINVAL;
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ __set_errno(int /*<<< orphan*/);
int __rmdir(const char *path) {
  if (path == NULL) {
    __set_errno(EINVAL);
    return -1;
  }
  __set_errno(ENOSYS);
  return -1;
}


x86 assembly (clang, -O0):
<__rmdir>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1141 <__rmdir+0x31>
mov    0x2eaa(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1156 <__rmdir+0x46>
mov    0x2ea0(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__rmdir>:
push   %rax
test   %rdi,%rdi
jne    111f <__rmdir+0xf>
mov    0x2ebb(%rip),%rax
jmp    1126 <__rmdir+0x16>
mov    0x2ec2(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@EINVAL = global i32 0
@ENOSYS = global i32 0
define i32 @__rmdir(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = icmp eq i8* %4, null
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load i32, i32* @EINVAL
%8 = call i32 @__set_errno(i32 %7)
store i32 -1, i32* %2
br label %12
9: ; preds = %1
%10 = load i32, i32* @ENOSYS
%11 = call i32 @__set_errno(i32 %10)
store i32 -1, i32* %2
br label %12
12: ; preds = %9, %6
%13 = load i32, i32* %2
ret i32 %13
}

LLVM IR (-O2):
@EINVAL = global i32 0
@ENOSYS = global i32 0
define i32 @__rmdir(i8* readnone %0) {
%2 = icmp eq i8* %0, null
%3 = load i32, i32* @EINVAL
%4 = load i32, i32* @ENOSYS
%5 = select i1 %2, i32 %3, i32 %4
%6 = tail call i32 @__set_errno(i32 %5)
ret i32 -1
}
/* Variables and functions */
scalar_t__ CallBack0(int);
int /*<<< orphan*/ CheckRunningInMainThread(char *);
int GetDataFolderChangesCount(void) {
  if (!CheckRunningInMainThread("GetDataFolderChangesCount"))
    return 0;
  return (int)CallBack0(126);
}


x86 assembly (clang, -O0):
<GetDataFolderChangesCount>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
call   1030 <CheckRunningInMainThread@plt>
cmp    $0x0,%eax
jne    1149 <GetDataFolderChangesCount+0x29>
movl   $0x0,-0x4(%rbp)
jmp    1156 <GetDataFolderChangesCount+0x36>
mov    $0x7e,%edi
call   1040 <CallBack0@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GetDataFolderChangesCount>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <CheckRunningInMainThread@plt>
test   %eax,%eax
je     113d <GetDataFolderChangesCount+0x1d>
mov    $0x7e,%edi
call   1040 <CallBack0@plt>
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [26 x i8] c"GetDataFolderChangesCount\00"
define i32 @GetDataFolderChangesCount() {
%1 = alloca i32
%2 = call i32 @CheckRunningInMainThread(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%3 = icmp ne i32 %2, 0
br i1 %3, label %5, label %4
4: ; preds = %0
store i32 0, i32* %1
br label %8
5: ; preds = %0
%6 = call i64 @CallBack0(i32 126)
%7 = trunc i64 %6 to i32
store i32 %7, i32* %1
br label %8
8: ; preds = %5, %4
%9 = load i32, i32* %1
ret i32 %9
}

LLVM IR (-O2):
@.str = [26 x i8] c"GetDataFolderChangesCount\00"
define i32 @GetDataFolderChangesCount() {
%1 = tail call i32 @CheckRunningInMainThread(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%2 = icmp eq i32 %1, 0
br i1 %2, label %6, label %3
3: ; preds = %0
%4 = tail call i64 @CallBack0(i32 126)
%5 = trunc i64 %4 to i32
br label %6
6: ; preds = %0, %3
%7 = phi i32 [ %5, %3 ], [ 0, %0 ]
ret i32 %7
}
/* Variables and functions */
int stress_l1cache_set(char const *, char *, int);
int stress_l1cache_set_ways(const char *opt) {
  return stress_l1cache_set(opt, "l1cache-ways", 65536);
}


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

x86 assembly (clang, -O2):
<stress_l1cache_set_ways>:
lea    0xee9(%rip),%rsi
mov    $0x10000,%edx
jmp    1030 <stress_l1cache_set@plt>

LLVM IR (-O0):
@.str = [13 x i8] c"l1cache-ways\00"
define i32 @stress_l1cache_set_ways(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @stress_l1cache_set(i8* %3, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 65536)
ret i32 %4
}

LLVM IR (-O2):
@.str = [13 x i8] c"l1cache-ways\00"
define i32 @stress_l1cache_set_ways(i8* %0) {
%2 = tail call i32 @stress_l1cache_set(i8* %0, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 65536)
ret i32 %2
}
void unloadSharedObject(void *object) {}


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

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

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

LLVM IR (-O2):
define void @unloadSharedObject(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int fibonacci(int);
int lese_int();
int /*<<< orphan*/ printf(char *, int, int);
int main() {
  int n = lese_int();
  int f = fibonacci(n);
  printf("Fib(%d) = %d\n", n, f);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1050 <lese_int@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1040 <fibonacci@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    0xe9f(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1050 <lese_int@plt>
mov    %eax,%ebx
mov    %eax,%edi
call   1040 <fibonacci@plt>
lea    0xeb8(%rip),%rdi
mov    %ebx,%esi
mov    %eax,%edx
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"Fib(%d) = %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32 (...) @lese_int()
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = call i32 @fibonacci(i32 %5)
store i32 %6, i32* %3
%7 = load i32, i32* %2
%8 = load i32, i32* %3
%9 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %7, i32 %8)
ret i32 0
}

LLVM IR (-O2):
@.str = [14 x i8] c"Fib(%d) = %d\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @lese_int()
%2 = tail call i32 @fibonacci(i32 %1)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %1, i32 %2)
ret i32 0
}
void __declfirst(void) {}


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

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

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

LLVM IR (-O2):
define void @__declfirst() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int main(void) {
  abort();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @abort()
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ U_WMRNOTIMPLEMENTED_swap(char *, int);
void U_WMRC3_swap(char *record, int torev) {
  U_WMRNOTIMPLEMENTED_swap(record, torev);
}


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

x86 assembly (clang, -O2):
<U_WMRC3_swap>:
jmp    1030 <U_WMRNOTIMPLEMENTED_swap@plt>

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

LLVM IR (-O2):
define void @U_WMRC3_swap(i8* %0, i32 %1) {
%3 = tail call i32 @U_WMRNOTIMPLEMENTED_swap(i8* %0, i32 %1)
ret void
}