xunge/DecIR huggingface dataset:
/* Variables and functions */
int errno;
int scalanative_errno() { return errno; }


x86 assembly (clang, -O0):
<scalanative_errno>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ed5(%rip),%rax
mov    (%rax),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@errno = global i32 0
define i32 @scalanative_errno() {
%1 = load i32, i32* @errno
ret i32 %1
}

LLVM IR (-O2):
@errno = global i32 0
define i32 @scalanative_errno() {
%1 = load i32, i32* @errno
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ wirth(int);
int main(int argc, char *argv[]) {
  wirth(100);
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @wirth(i32 100)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @wirth(i32 100)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ y;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int y;
  printf("%lu\n", sizeof(y));
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [5 x i8] c"%lu\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 4)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ adc8(int /*<<< orphan*/);
int /*<<< orphan*/ readmem65816(int /*<<< orphan*/);
int /*<<< orphan*/ zeropagex();
void adcZpx8(void) { adc8(readmem65816(zeropagex())); }


x86 assembly (clang, -O0):
<adcZpx8>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <zeropagex@plt>
mov    %eax,%edi
call   1050 <readmem65816@plt>
mov    %eax,%edi
call   1030 <adc8@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<adcZpx8>:
push   %rax
xor    %eax,%eax
call   1040 <zeropagex@plt>
mov    %eax,%edi
call   1050 <readmem65816@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <adc8@plt>

LLVM IR (-O0):
define void @adcZpx8() {
%1 = call i32 (...) @zeropagex()
%2 = call i32 @readmem65816(i32 %1)
%3 = call i32 @adc8(i32 %2)
ret void
}

LLVM IR (-O2):
define void @adcZpx8() {
%1 = tail call i32 (...) @zeropagex()
%2 = tail call i32 @readmem65816(i32 %1)
%3 = tail call i32 @adc8(i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int listen(int, int);
int /*<<< orphan*/ perror(char *);
void Listen(int sockfd, int backlog) {
  int error;
  error = listen(sockfd, backlog);
  if (error == -1) {
    perror("Listen");
    exit(1);
  }
}


x86 assembly (clang, -O0):
<Listen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <listen@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0xffffffff,-0xc(%rbp)
jne    116c <Listen+0x3c>
lea    0xea3(%rip),%rdi
call   1040 <perror@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Listen>:
push   %rax
call   1030 <listen@plt>
cmp    $0xffffffff,%eax
je     113d <Listen+0xd>
pop    %rax
ret
lea    0xebc(%rip),%rdi
call   1040 <perror@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"Listen\00"
define void @Listen(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 @listen(i32 %6, i32 %7)
store i32 %8, i32* %5
%9 = load i32, i32* %5
%10 = icmp eq i32 %9, -1
br i1 %10, label %11, label %14
11: ; preds = %2
%12 = call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%13 = call i32 @exit(i32 1)
unreachable
14: ; preds = %2
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"Listen\00"
define void @Listen(i32 %0, i32 %1) {
%3 = tail call i32 @listen(i32 %0, i32 %1)
%4 = icmp eq i32 %3, -1
br i1 %4, label %5, label %8
5: ; preds = %2
%6 = tail call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%7 = tail call i32 @exit(i32 1)
unreachable
8: ; preds = %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ malloc_or_die(size_t);
void *memcpy(int /*<<< orphan*/, void const *, size_t);
void *memdup_or_die(void const *memory, size_t size) {
  return memcpy(malloc_or_die(size), memory, size);
}


x86 assembly (clang, -O0):
<memdup_or_die>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <malloc_or_die@plt>
mov    %eax,%edi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
call   1030 <memcpy@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<memdup_or_die>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1040 <malloc_or_die@plt>
mov    %eax,%edi
mov    %r14,%rsi
mov    %rbx,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <memcpy@plt>

LLVM IR (-O0):
define i8* @memdup_or_die(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 = call i32 @malloc_or_die(i64 %5)
%7 = load i8*, i8** %3
%8 = load i64, i64* %4
%9 = call i8* @memcpy(i32 %6, i8* %7, i64 %8)
ret i8* %9
}

LLVM IR (-O2):
define i8* @memdup_or_die(i8* %0, i64 %1) {
%3 = tail call i32 @malloc_or_die(i64 %1)
%4 = tail call i8* @memcpy(i32 %3, i8* %0, i64 %1)
ret i8* %4
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
uint32_t test_tagged_nonint_enum2(uint32_t val) { return val; }


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

x86 assembly (clang, -O2):
<test_tagged_nonint_enum2>:
mov    %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @test_tagged_nonint_enum2(i32 returned %0) {
ret i32 %0
}
int test_07(char x, char *y, int z, int w) { return x & y[0] ? z : w; }


x86 assembly (clang, -O0):
<test_07>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
movsbl -0x1(%rbp),%eax
mov    -0x10(%rbp),%rcx
movsbl (%rcx),%ecx
and    %ecx,%eax
cmp    $0x0,%eax
je     1135 <test_07+0x35>
mov    -0x14(%rbp),%eax
mov    %eax,-0x1c(%rbp)
jmp    113b <test_07+0x3b>
mov    -0x18(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_07>:
mov    %edx,%eax
test   %dil,(%rsi)
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_07(i8 signext %0, i8* nocapture %1, i32 %2, i32 %3) {
%5 = load i8, i8* %1
%6 = and i8 %5, %0
%7 = icmp eq i8 %6, 0
%8 = select i1 %7, i32 %3, i32 %2
ret i32 %8
}
/* Variables and functions */
char *tabField(int);
char *hotSpotGetChr() {
  char *chr;
  chr = tabField(1);
  chr += 3;
  if (chr[0] == '0')
    chr++;
  return chr;
}


x86 assembly (clang, -O0):
<hotSpotGetChr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x1,%edi
call   1030 <tabField@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x3,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x30,%eax
jne    114e <hotSpotGetChr+0x3e>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hotSpotGetChr>:
push   %rax
mov    $0x1,%edi
call   1030 <tabField@plt>
lea    0x3(%rax),%rcx
lea    0x4(%rax),%rdx
cmpb   $0x30,0x3(%rax)
cmove  %rdx,%rcx
mov    %rcx,%rax
pop    %rcx
ret

LLVM IR (-O0):
define i8* @hotSpotGetChr() {
%1 = alloca i8*
%2 = call i8* @tabField(i32 1)
store i8* %2, i8** %1
%3 = load i8*, i8** %1
%4 = getelementptr inbounds i8, i8* %3, i64 3
store i8* %4, i8** %1
%5 = load i8*, i8** %1
%6 = getelementptr inbounds i8, i8* %5, i64 0
%7 = load i8, i8* %6
%8 = sext i8 %7 to i32
%9 = icmp eq i32 %8, 48
br i1 %9, label %10, label %13
10: ; preds = %0
%11 = load i8*, i8** %1
%12 = getelementptr inbounds i8, i8* %11, i32 1
store i8* %12, i8** %1
br label %13
13: ; preds = %10, %0
%14 = load i8*, i8** %1
ret i8* %14
}

LLVM IR (-O2):
define i8* @hotSpotGetChr() {
%1 = tail call i8* @tabField(i32 1)
%2 = getelementptr inbounds i8, i8* %1, i64 3
%3 = load i8, i8* %2
%4 = icmp eq i8 %3, 48
%5 = getelementptr inbounds i8, i8* %1, i64 4
%6 = select i1 %4, i8* %5, i8* %2
ret i8* %6
}
unsigned short checkSum(unsigned char sec1[], unsigned short offset) {
  short i = 0;
  unsigned short sum = 0;
  for (; i < 0x10; i++) {
    sum += *(sec1 + i + offset);
  }
  return sum;
}


x86 assembly (clang, -O0):
<checkSum>:
push   %rbp
mov    %rsp,%rbp
mov    %si,%ax
mov    %rdi,-0x8(%rbp)
mov    %ax,-0xa(%rbp)
movw   $0x0,-0xc(%rbp)
movw   $0x0,-0xe(%rbp)
movswl -0xc(%rbp),%eax
cmp    $0x10,%eax
jge    115c <checkSum+0x5c>
mov    -0x8(%rbp),%rax
movswl -0xc(%rbp),%ecx
movslq %ecx,%rcx
add    %rcx,%rax
movzwl -0xa(%rbp),%ecx
movslq %ecx,%rcx
movzbl (%rax,%rcx,1),%ecx
movzwl -0xe(%rbp),%eax
add    %ecx,%eax
mov    %ax,-0xe(%rbp)
mov    -0xc(%rbp),%ax
add    $0x1,%ax
mov    %ax,-0xc(%rbp)
jmp    111b <checkSum+0x1b>
movzwl -0xe(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<checkSum>:
mov    %esi,%eax
movdqu (%rdi,%rax,1),%xmm0
pxor   %xmm1,%xmm1
movdqa %xmm0,%xmm2
punpckhbw %xmm1,%xmm2
punpcklbw %xmm1,%xmm0
paddw  %xmm2,%xmm0
pshufd $0xee,%xmm0,%xmm1
paddw  %xmm0,%xmm1
pshufd $0x55,%xmm1,%xmm0
paddw  %xmm1,%xmm0
movdqa %xmm0,%xmm1
psrld  $0x10,%xmm1
paddw  %xmm0,%xmm1
movd   %xmm1,%eax
ret

LLVM IR (-O0):
define zeroext i16 @checkSum(i8* %0, i16 zeroext %1) {
%3 = alloca i8*
%4 = alloca i16
%5 = alloca i16
%6 = alloca i16
store i8* %0, i8** %3
store i16 %1, i16* %4
store i16 0, i16* %5
store i16 0, i16* %6
br label %7
7: ; preds = %27, %2
%8 = load i16, i16* %5
%9 = sext i16 %8 to i32
%10 = icmp slt i32 %9, 16
br i1 %10, label %11, label %30
11: ; preds = %7
%12 = load i8*, i8** %3
%13 = load i16, i16* %5
%14 = sext i16 %13 to i32
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i8, i8* %12, i64 %15
%17 = load i16, i16* %4
%18 = zext i16 %17 to i32
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds i8, i8* %16, i64 %19
%21 = load i8, i8* %20
%22 = zext i8 %21 to i32
%23 = load i16, i16* %6
%24 = zext i16 %23 to i32
%25 = add nsw i32 %24, %22
%26 = trunc i32 %25 to i16
store i16 %26, i16* %6
br label %27
27: ; preds = %11
%28 = load i16, i16* %5
%29 = add i16 %28, 1
store i16 %29, i16* %5
br label %7
30: ; preds = %7
%31 = load i16, i16* %6
ret i16 %31
}

LLVM IR (-O2):
define zeroext i16 @checkSum(i8* nocapture %0, i16 zeroext %1) {
%3 = zext i16 %1 to i64
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = bitcast i8* %4 to <16 x i8>*
%6 = load <16 x i8>, <16 x i8>* %5
%7 = zext <16 x i8> %6 to <16 x i16>
%8 = call i16 @llvm.vector.reduce.add.v16i16(<16 x i16> %7)
ret i16 %8
}
/* Variables and functions */
int /*<<< orphan*/ print_instr(char *);
void cgen_neg() {
  print_instr("li $t0 -1");
  print_instr("mul $a0 $a0 $t0");
}


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

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

LLVM IR (-O0):
@.str = [10 x i8] c"li $t0 -1\00"
@.str.1 = [16 x i8] c"mul $a0 $a0 $t0\00"
define void @cgen_neg() {
%1 = call i32 @print_instr(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @print_instr(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"li $t0 -1\00"
@.str.1 = [16 x i8] c"mul $a0 $a0 $t0\00"
define void @cgen_neg() {
%1 = tail call i32 @print_instr(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @print_instr(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ newline();
int /*<<< orphan*/ output_with_tab(char *);
void output_line(char *ptr) {
  output_with_tab(ptr);
  newline();
}


x86 assembly (clang, -O0):
<output_line>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <output_with_tab@plt>
mov    $0x0,%al
call   1030 <newline@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<output_line>:
push   %rax
call   1040 <output_with_tab@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <newline@plt>

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

LLVM IR (-O2):
define void @output_line(i8* %0) {
%2 = tail call i32 @output_with_tab(i8* %0)
%3 = tail call i32 (...) @newline()
ret void
}
/* Type definitions */
struct perf_event_attr {
  int dummy;
};
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
int /*<<< orphan*/ __NR_perf_event_open;
long syscall(int /*<<< orphan*/, struct perf_event_attr *, int /*<<< orphan*/,
             int, int, unsigned long);
long perf_event_open(struct perf_event_attr *event, pid_t pid, int cpu,
                     int group_id, unsigned long flags) {
  return syscall(__NR_perf_event_open, event, pid, cpu, group_id, flags);
}


x86 assembly (clang, -O0):
<perf_event_open>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8,-0x20(%rbp)
mov    0x2eb0(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
mov    -0x14(%rbp),%r8d
mov    -0x20(%rbp),%r9
call   1030 <syscall@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<perf_event_open>:
mov    %r8,%r9
mov    %ecx,%r8d
mov    %edx,%ecx
mov    %esi,%edx
mov    %rdi,%rsi
mov    0x2ebc(%rip),%rax
mov    (%rax),%edi
jmp    1030 <syscall@plt>

LLVM IR (-O0):
%struct.perf_event_attr = type { i32 }
@__NR_perf_event_open = global i32 0
define i64 @perf_event_open(%struct.perf_event_attr* %0, i32 %1, i32 %2, i32 %3, i64 %4) {
%6 = alloca %struct.perf_event_attr*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i64
store %struct.perf_event_attr* %0, %struct.perf_event_attr** %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i64 %4, i64* %10
%11 = load i32, i32* @__NR_perf_event_open
%12 = load %struct.perf_event_attr*, %struct.perf_event_attr** %6
%13 = load i32, i32* %7
%14 = load i32, i32* %8
%15 = load i32, i32* %9
%16 = load i64, i64* %10
%17 = call i64 @syscall(i32 %11, %struct.perf_event_attr* %12, i32 %13, i32 %14, i32 %15, i64 %16)
ret i64 %17
}

LLVM IR (-O2):
%struct.perf_event_attr = type { i32 }
@__NR_perf_event_open = global i32 0
define i64 @perf_event_open(%struct.perf_event_attr* %0, i32 %1, i32 %2, i32 %3, i64 %4) {
%6 = load i32, i32* @__NR_perf_event_open
%7 = tail call i64 @syscall(i32 %6, %struct.perf_event_attr* %0, i32 %1, i32 %2, i32 %3, i64 %4)
ret i64 %7
}
/* Variables and functions */
int nBit(char *);
int /*<<< orphan*/ printf(char *);
bool checkBit(char *filename) {
  if (nBit(filename) == 24)
    return true;
  else {
    printf("L'immagine non è a 24-bit");
    return false;
  }
}


x86 assembly (clang, -O0):
<checkBit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <nBit@plt>
cmp    $0x18,%eax
jne    114a <checkBit+0x2a>
movl   $0x1,-0x4(%rbp)
jmp    115d <checkBit+0x3d>
lea    0xeaf(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<checkBit>:
push   %rax
call   1040 <nBit@plt>
mov    %eax,%ecx
mov    $0x1,%eax
cmp    $0x18,%ecx
je     1140 <checkBit+0x20>
lea    0xec7(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [27 x i8] c"L'immagine non \C3\A8 a 24-bit\00"
define i32 @checkBit(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = call i32 @nBit(i8* %4)
%6 = icmp eq i32 %5, 24
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 1, i32* %2
br label %10
8: ; preds = %1
%9 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %2
br label %10
10: ; preds = %8, %7
%11 = load i32, i32* %2
ret i32 %11
}

LLVM IR (-O2):
@.str = [27 x i8] c"L'immagine non \C3\A8 a 24-bit\00"
define i32 @checkBit(i8* %0) {
%2 = tail call i32 @nBit(i8* %0)
%3 = icmp eq i32 %2, 24
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %1, %4
%7 = phi i32 [ 0, %4 ], [ 1, %1 ]
ret i32 %7
}
/* Variables and functions */
char *malloc(int);
char *memchr(char *, char, int);
int /*<<< orphan*/ memset(char *, int /*<<< orphan*/, int);
int /*<<< orphan*/ sink(char *);
void nowarn_memchr_cst_memset_cst(const void *s) {
  char *p = malloc(4);
  sink(p);
  p = memchr(p, '1', 4);
  memset(p, 0, 4);
}


x86 assembly (clang, -O0):
<nowarn_memchr_cst_memset_cst>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x4,%edi
call   1060 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <sink@plt>
mov    -0x10(%rbp),%rdi
mov    $0x31,%esi
mov    $0x4,%edx
call   1040 <memchr@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
xor    %esi,%esi
mov    $0x4,%edx
call   1030 <memset@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nowarn_memchr_cst_memset_cst>:
push   %rbx
mov    $0x4,%edi
call   1060 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1050 <sink@plt>
mov    %rbx,%rdi
mov    $0x31,%esi
mov    $0x4,%edx
call   1040 <memchr@plt>
mov    %rax,%rdi
xor    %esi,%esi
mov    $0x4,%edx
pop    %rbx
jmp    1030 <memset@plt>

LLVM IR (-O0):
define void @nowarn_memchr_cst_memset_cst(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = call i8* @malloc(i32 4)
store i8* %4, i8** %3
%5 = load i8*, i8** %3
%6 = call i32 @sink(i8* %5)
%7 = load i8*, i8** %3
%8 = call i8* @memchr(i8* %7, i8 signext 49, i32 4)
store i8* %8, i8** %3
%9 = load i8*, i8** %3
%10 = call i32 @memset(i8* %9, i32 0, i32 4)
ret void
}

LLVM IR (-O2):
define void @nowarn_memchr_cst_memset_cst(i8* nocapture readnone %0) {
%2 = tail call dereferenceable_or_null(4) i8* @malloc(i32 4)
%3 = tail call i32 @sink(i8* %2)
%4 = tail call i8* @memchr(i8* %2, i8 signext 49, i32 4)
%5 = tail call i32 @memset(i8* %4, i32 0, i32 4)
ret void
}
void mf_w_header_chunk(format, ntracks, division) int format, ntracks, division;
{
  unsigned long ident, length;
  ident = 0x4d546864L;
  length = 6;
  write32bit(ident);
  write32bit(length);
  write16bit(format);
  write16bit(ntracks);
  write16bit(division);
}


x86 assembly (clang, -O0):
<mf_w_header_chunk>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
movq   $0x4d546864,-0x18(%rbp)
4d
movq   $0x6,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
mov    $0x0,%al
call   1040 <write32bit@plt>
mov    -0x20(%rbp),%rdi
mov    $0x0,%al
call   1040 <write32bit@plt>
mov    -0x4(%rbp),%edi
mov    $0x0,%al
call   1030 <write16bit@plt>
mov    -0x8(%rbp),%edi
mov    $0x0,%al
call   1030 <write16bit@plt>
mov    -0xc(%rbp),%edi
mov    $0x0,%al
call   1030 <write16bit@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mf_w_header_chunk>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%r14d
mov    %esi,%ebp
mov    %edi,%ebx
mov    $0x4d546864,%edi
xor    %eax,%eax
call   1040 <write32bit@plt>
mov    $0x6,%edi
xor    %eax,%eax
call   1040 <write32bit@plt>
mov    %ebx,%edi
xor    %eax,%eax
call   1030 <write16bit@plt>
mov    %ebp,%edi
xor    %eax,%eax
call   1030 <write16bit@plt>
mov    %r14d,%edi
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <write16bit@plt>

LLVM IR (-O0):
define void @mf_w_header_chunk(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i64
%8 = alloca i64
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
store i64 1297377380, i64* %7
store i64 6, i64* %8
%9 = load i64, i64* %7
%10 = call i32 (i64, ...) bitcast (i32 (...)* @write32bit to i32 (i64, ...)*)(i64 %9)
%11 = load i64, i64* %8
%12 = call i32 (i64, ...) bitcast (i32 (...)* @write32bit to i32 (i64, ...)*)(i64 %11)
%13 = load i32, i32* %4
%14 = call i32 (i32, ...) bitcast (i32 (...)* @write16bit to i32 (i32, ...)*)(i32 %13)
%15 = load i32, i32* %5
%16 = call i32 (i32, ...) bitcast (i32 (...)* @write16bit to i32 (i32, ...)*)(i32 %15)
%17 = load i32, i32* %6
%18 = call i32 (i32, ...) bitcast (i32 (...)* @write16bit to i32 (i32, ...)*)(i32 %17)
ret void
}

LLVM IR (-O2):
define void @mf_w_header_chunk(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 (i64, ...) bitcast (i32 (...)* @write32bit to i32 (i64, ...)*)(i64 1297377380)
%5 = tail call i32 (i64, ...) bitcast (i32 (...)* @write32bit to i32 (i64, ...)*)(i64 6)
%6 = tail call i32 (i32, ...) bitcast (i32 (...)* @write16bit to i32 (i32, ...)*)(i32 %0)
%7 = tail call i32 (i32, ...) bitcast (i32 (...)* @write16bit to i32 (i32, ...)*)(i32 %1)
%8 = tail call i32 (i32, ...) bitcast (i32 (...)* @write16bit to i32 (i32, ...)*)(i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ brc(int /*<<< orphan*/, char);
da() { brc(0, 'c'); }


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

x86 assembly (clang, -O2):
<da>:
xor    %edi,%edi
mov    $0x63,%esi
jmp    1030 <brc@plt>

LLVM IR (-O0):
define i32 @da() {
%1 = alloca i32
%2 = call i32 @brc(i32 0, i8 signext 99)
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
define i32 @da() {
%1 = tail call i32 @brc(i32 0, i8 signext 99)
ret i32 undef
}
void intHandler(int dummy) { ; }


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

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

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

LLVM IR (-O2):
define void @intHandler(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, char *);
void doVersion() { printf("%s v%s\n", "bmsync", "0.7.6.1"); }


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

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

LLVM IR (-O0):
@.str = [8 x i8] c"%s v%s\0A\00"
@.str.1 = [7 x i8] c"bmsync\00"
@.str.2 = [8 x i8] c"0.7.6.1\00"
define void @doVersion() {
%1 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"%s v%s\0A\00"
@.str.1 = [7 x i8] c"bmsync\00"
@.str.2 = [8 x i8] c"0.7.6.1\00"
define void @doVersion() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ setFilename(char const *, int /*<<< orphan*/);
int /*<<< orphan*/ truncateCurrentFile();
__attribute__((visibility("hidden"))) void
__llvm_profile_set_filename(const char *Filename) {
  setFilename(Filename, 0);
  truncateCurrentFile();
}


x86 assembly (clang, -O0):
<__llvm_profile_set_filename>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
xor    %esi,%esi
call   1030 <setFilename@plt>
mov    $0x0,%al
call   1040 <truncateCurrentFile@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__llvm_profile_set_filename>:
push   %rax
xor    %esi,%esi
call   1030 <setFilename@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <truncateCurrentFile@plt>

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

LLVM IR (-O2):
define hidden void @__llvm_profile_set_filename(i8* %0) {
%2 = tail call i32 @setFilename(i8* %0, i32 0)
%3 = tail call i32 (...) @truncateCurrentFile()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ revCircBuffer_insertOneItem_headCorrect();
int /*<<< orphan*/ revCircBuffer_prependAllNoWrap_dataCorrect();
int /*<<< orphan*/ revCircBuffer_prependAllWrap_dataCorrect();
void test_revCircBuffer_all() {
  printf("================================ Testing Reverse Circular Buffer\n");
  revCircBuffer_insertOneItem_headCorrect();
  revCircBuffer_prependAllNoWrap_dataCorrect();
  revCircBuffer_prependAllWrap_dataCorrect();
  printf("================================ End Reverse Circular Buffer Test: "
         "Success\n");
}


x86 assembly (clang, -O0):
<test_revCircBuffer_all>:
push   %rbp
mov    %rsp,%rbp
lea    0xeb5(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1050 <revCircBuffer_insertOneItem_headCorrect@plt>
mov    $0x0,%al
call   1030 <revCircBuffer_prependAllNoWrap_dataCorrect@plt>
mov    $0x0,%al
call   1060 <revCircBuffer_prependAllWrap_dataCorrect@plt>
lea    0xed6(%rip),%rdi
call   1040 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_revCircBuffer_all>:
push   %rax
lea    0xeb8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1050 <revCircBuffer_insertOneItem_headCorrect@plt>
xor    %eax,%eax
call   1040 <revCircBuffer_prependAllNoWrap_dataCorrect@plt>
xor    %eax,%eax
call   1060 <revCircBuffer_prependAllWrap_dataCorrect@plt>
lea    0xed8(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [66 x i8] c"================================ Testing Reverse Circular Buffer\0A\00"
@.str.1 = [76 x i8] c"================================ End Reverse Circular Buffer Test: Success\0A\00"
define void @test_revCircBuffer_all() {
%1 = call i32 @printf(i8* getelementptr inbounds ([66 x i8], [66 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (...) @revCircBuffer_insertOneItem_headCorrect()
%3 = call i32 (...) @revCircBuffer_prependAllNoWrap_dataCorrect()
%4 = call i32 (...) @revCircBuffer_prependAllWrap_dataCorrect()
%5 = call i32 @printf(i8* getelementptr inbounds ([76 x i8], [76 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [65 x i8] c"================================ Testing Reverse Circular Buffer\00"
@str.2 = [75 x i8] c"================================ End Reverse Circular Buffer Test: Success\00"
define void @test_revCircBuffer_all() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([65 x i8], [65 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (...) @revCircBuffer_insertOneItem_headCorrect()
%3 = tail call i32 (...) @revCircBuffer_prependAllNoWrap_dataCorrect()
%4 = tail call i32 (...) @revCircBuffer_prependAllWrap_dataCorrect()
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([75 x i8], [75 x i8]* @str.2, i64 0, i64 0))
ret void
}
void foo6b() {}


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

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

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

LLVM IR (-O2):
define void @foo6b() {
ret void
}
int wscMsgStateUpdate(char *pBuf, int len) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @wscMsgStateUpdate(i8* nocapture readnone %0, i32 %1) {
ret i32 0
}
/* Variables and functions */
int round2_a();
int round1_d() { return round2_a(); }


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

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

LLVM IR (-O0):
define i32 @round1_d() {
%1 = call i32 (...) @round2_a()
ret i32 %1
}

LLVM IR (-O2):
define i32 @round1_d() {
%1 = tail call i32 (...) @round2_a()
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void yr_free(void *ptr) { free(ptr); }


x86 assembly (clang, -O0):
<yr_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):
<yr_free>:
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @yr_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 @yr_free(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void mk_wrapper_free(void *pointer) { free(pointer); }


x86 assembly (clang, -O0):
<mk_wrapper_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):
<mk_wrapper_free>:
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @mk_wrapper_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 @mk_wrapper_free(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ ssize_t;

/* Variables and functions */
int /*<<< orphan*/ syscall(int, char const *, char *, size_t);
ssize_t readlink(const char *path, char *buf, size_t bufsize) {
  return syscall(85, path, buf, bufsize);
}


x86 assembly (clang, -O0):
<readlink>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    $0x55,%edi
call   1030 <syscall@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<readlink>:
mov    %rdx,%rcx
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    $0x55,%edi
jmp    1030 <syscall@plt>

LLVM IR (-O0):
define i32 @readlink(i8* %0, i8* %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
store i8* %0, i8** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = load i64, i64* %6
%10 = call i32 @syscall(i32 85, i8* %7, i8* %8, i64 %9)
ret i32 %10
}

LLVM IR (-O2):
define i32 @readlink(i8* %0, i8* %1, i64 %2) {
%4 = tail call i32 @syscall(i32 85, i8* %0, i8* %1, i64 %2)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
main() {
  int x;
  switch (x) {
  case 0:
    goto end;
  default:
    x = 0;
  }
end:
  assert(x == 0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    -0x8(%rbp),%eax
test   %eax,%eax
jne    1134 <main+0x24>
jmp    112f <main+0x1f>
jmp    1140 <main+0x30>
movl   $0x0,-0x8(%rbp)
jmp    1140 <main+0x30>
cmpl   $0x0,-0x8(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = load i32, i32* %2
switch i32 %3, label %5 [
i32 0, label %4
]
4: ; preds = %0
br label %7
5: ; preds = %0
store i32 0, i32* %2
br label %6
6: ; preds = %5
br label %7
7: ; preds = %6, %4
%8 = load i32, i32* %2
%9 = icmp eq i32 %8, 0
%10 = zext i1 %9 to i32
%11 = call i32 @assert(i32 %10)
%12 = load i32, i32* %1
ret i32 %12
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @assert(i32 0)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ U_WMRCORE_SIZE16_swap(char *, int);
int /*<<< orphan*/ U_swap2(char *, int);
int /*<<< orphan*/ U_swap4(char *, int);
void U_WMRCORE_U32_N16_swap(char *record, int N16, int torev) {
  int off = 6;
  U_WMRCORE_SIZE16_swap(record, torev);
  U_swap4(record + off, 1);
  off += 4;
  U_swap2(record + off, N16);
}


x86 assembly (clang, -O0):
<U_WMRCORE_U32_N16_swap>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
movl   $0x6,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%esi
call   1050 <U_WMRCORE_SIZE16_swap@plt>
mov    -0x8(%rbp),%rdi
movslq -0x14(%rbp),%rax
add    %rax,%rdi
mov    $0x1,%esi
call   1030 <U_swap4@plt>
mov    -0x14(%rbp),%eax
add    $0x4,%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
movslq -0x14(%rbp),%rax
add    %rax,%rdi
mov    -0xc(%rbp),%esi
call   1040 <U_swap2@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<U_WMRCORE_U32_N16_swap>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
mov    %edx,%esi
call   1050 <U_WMRCORE_SIZE16_swap@plt>
lea    0x6(%rbx),%rdi
mov    $0x1,%esi
call   1030 <U_swap4@plt>
add    $0xa,%rbx
mov    %rbx,%rdi
mov    %ebp,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <U_swap2@plt>

LLVM IR (-O0):
define void @U_WMRCORE_U32_N16_swap(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
store i32 6, i32* %7
%8 = load i8*, i8** %4
%9 = load i32, i32* %6
%10 = call i32 @U_WMRCORE_SIZE16_swap(i8* %8, i32 %9)
%11 = load i8*, i8** %4
%12 = load i32, i32* %7
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i8, i8* %11, i64 %13
%15 = call i32 @U_swap4(i8* %14, i32 1)
%16 = load i32, i32* %7
%17 = add nsw i32 %16, 4
store i32 %17, i32* %7
%18 = load i8*, i8** %4
%19 = load i32, i32* %7
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds i8, i8* %18, i64 %20
%22 = load i32, i32* %5
%23 = call i32 @U_swap2(i8* %21, i32 %22)
ret void
}

LLVM IR (-O2):
define void @U_WMRCORE_U32_N16_swap(i8* %0, i32 %1, i32 %2) {
%4 = tail call i32 @U_WMRCORE_SIZE16_swap(i8* %0, i32 %2)
%5 = getelementptr inbounds i8, i8* %0, i64 6
%6 = tail call i32 @U_swap4(i8* %5, i32 1)
%7 = getelementptr inbounds i8, i8* %0, i64 10
%8 = tail call i32 @U_swap2(i8* %7, i32 %1)
ret void
}
/* Variables and functions */
int _ada_use_c2phc(int, int *, int *, double *);
int syscon_initialize_number_of_multprec_polynomials(int length) {
  int *b, fail;
  double *c;
  fail = _ada_use_c2phc(443, &length, b, c);
  return fail;
}


x86 assembly (clang, -O0):
<syscon_initialize_number_of_multprec_polynomials>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x10(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x1bb,%edi
lea    -0x4(%rbp),%rsi
call   1030 <_ada_use_c2phc@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<syscon_initialize_number_of_multprec_polynomials>:
push   %rax
mov    %edi,0x4(%rsp)
lea    0x4(%rsp),%rsi
mov    $0x1bb,%edi
call   1030 <_ada_use_c2phc@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @syscon_initialize_number_of_multprec_polynomials(i32 %0) {
%2 = alloca i32
%3 = alloca i32*
%4 = alloca i32
%5 = alloca double*
store i32 %0, i32* %2
%6 = load i32*, i32** %3
%7 = load double*, double** %5
%8 = call i32 @_ada_use_c2phc(i32 443, i32* %2, i32* %6, double* %7)
store i32 %8, i32* %4
%9 = load i32, i32* %4
ret i32 %9
}

LLVM IR (-O2):
define i32 @syscon_initialize_number_of_multprec_polynomials(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @_ada_use_c2phc(i32 443, i32* %2, i32* undef, double* undef)
ret i32 %3
}
void BSP_TimerSys_Init(unsigned int CFG0Prescale) {
  (*(volatile unsigned *)0x51000000) |= CFG0Prescale;
  (*(volatile unsigned *)0x51000008) = 0x007BBB0B;
  (*(volatile unsigned *)0x51000008) = 0x00488808;
}


x86 assembly (clang, -O0):
<BSP_TimerSys_Init>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x51000000,%ecx
mov    (%rcx),%ecx
or     %eax,%ecx
mov    $0x51000000,%eax
mov    %ecx,(%rax)
mov    $0x51000008,%eax
movl   $0x7bbb0b,(%rax)
mov    $0x51000008,%eax
movl   $0x488808,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<BSP_TimerSys_Init>:
or     %edi,0x51000000
movl   $0x7bbb0b,0x51000008
movl   $0x488808,0x51000008
ret

LLVM IR (-O0):
define void @BSP_TimerSys_Init(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load volatile i32, i32* inttoptr (i64 1358954496 to i32*)
%5 = or i32 %4, %3
store volatile i32 %5, i32* inttoptr (i64 1358954496 to i32*)
store volatile i32 8108811, i32* inttoptr (i64 1358954504 to i32*)
store volatile i32 4753416, i32* inttoptr (i64 1358954504 to i32*)
ret void
}

LLVM IR (-O2):
define void @BSP_TimerSys_Init(i32 %0) {
%2 = load volatile i32, i32* inttoptr (i64 1358954496 to i32*)
%3 = or i32 %2, %0
store volatile i32 %3, i32* inttoptr (i64 1358954496 to i32*)
store volatile i32 8108811, i32* inttoptr (i64 1358954504 to i32*)
store volatile i32 4753416, i32* inttoptr (i64 1358954504 to i32*)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ write(int, char *, int);
void ft_err(char *error) {
  while (*error != '\0') {
    write(2, error, 1);
    error++;
  }
}


x86 assembly (clang, -O0):
<ft_err>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1150 <ft_err+0x40>
mov    -0x8(%rbp),%rsi
mov    $0x2,%edi
mov    $0x1,%edx
call   1030 <write@plt>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    111c <ft_err+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_err>:
push   %rbx
cmpb   $0x0,(%rdi)
je     113c <ft_err+0x2c>
mov    %rdi,%rbx
nopl   0x0(%rax)
mov    $0x2,%edi
mov    %rbx,%rsi
mov    $0x1,%edx
call   1030 <write@plt>
cmpb   $0x0,0x1(%rbx)
lea    0x1(%rbx),%rbx
jne    1120 <ft_err+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @ft_err(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %10, label %4
4: ; preds = %1, %4
%5 = phi i8* [ %7, %4 ], [ %0, %1 ]
%6 = tail call i32 @write(i32 2, i8* %5, i32 1)
%7 = getelementptr inbounds i8, i8* %5, i64 1
%8 = load i8, i8* %7
%9 = icmp eq i8 %8, 0
br i1 %9, label %10, label %4
10: ; preds = %4, %1
ret void
}
unsigned long kallsyms_lookup_name(const char *name) { return 0; }


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

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

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

LLVM IR (-O2):
define i64 @kallsyms_lookup_name(i8* nocapture readnone %0) {
ret i64 0
}
/* Variables and functions */
int /*<<< orphan*/ db(int);
void pusha() { db(0x60); }


x86 assembly (clang, -O0):
<pusha>:
push   %rbp
mov    %rsp,%rbp
mov    $0x60,%edi
call   1030 <db@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<pusha>:
mov    $0x60,%edi
jmp    1030 <db@plt>

LLVM IR (-O0):
define void @pusha() {
%1 = call i32 @db(i32 96)
ret void
}

LLVM IR (-O2):
define void @pusha() {
%1 = tail call i32 @db(i32 96)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int DIS_le_creditos(void) {
  int cred;
  printf("Digite a quantidade de creditos:\n");
  scanf("%d", &cred);
  return cred;
}


x86 assembly (clang, -O0):
<DIS_le_creditos>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
call   1030 <printf@plt>
lea    0xee7(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<DIS_le_creditos>:
push   %rax
lea    0xedb(%rip),%rdi
call   1030 <puts@plt>
lea    0xecc(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [34 x i8] c"Digite a quantidade de creditos:\0A\00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @DIS_le_creditos() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 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
ret i32 %4
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%d\00"
@str = [33 x i8] c"Digite a quantidade de creditos:\00"
define i32 @DIS_le_creditos() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 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
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_indent(int num) {
  int i;
  for (i = 0; i < num; i++)
    printf("\t");
}


x86 assembly (clang, -O0):
<print_indent>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1148 <print_indent+0x38>
lea    0xecb(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1122 <print_indent+0x12>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @print_indent(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %8
3: ; preds = %1, %3
%4 = phi i32 [ %6, %3 ], [ 0, %1 ]
%5 = tail call i32 @putchar(i32 9)
%6 = add nuw nsw i32 %4, 1
%7 = icmp eq i32 %6, %0
br i1 %7, label %8, label %3
8: ; preds = %3, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ mcal_cpu_nop();
void __debug_mon_handler() {
  for (;;) {
    mcal_cpu_nop();
  }
}


x86 assembly (clang, -O0):
<__debug_mon_handler>:
push   %rbp
mov    %rsp,%rbp
jmp    1119 <__debug_mon_handler+0x9>
mov    $0x0,%al
call   1030 <mcal_cpu_nop@plt>
jmp    1119 <__debug_mon_handler+0x9>

x86 assembly (clang, -O2):
<__debug_mon_handler>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <mcal_cpu_nop@plt>
jmp    1120 <__debug_mon_handler+0x10>

LLVM IR (-O0):
define void @__debug_mon_handler() {
br label %1
1: ; preds = %1, %0
%2 = call i32 (...) @mcal_cpu_nop()
br label %1
}

LLVM IR (-O2):
define void @__debug_mon_handler() {
br label %1
1: ; preds = %1, %0
%2 = tail call i32 (...) @mcal_cpu_nop()
br label %1
}
void test_four(int x, int y) {
#pragma omp distribute parallel for simd collapse(2)
  for (int i = 0; i < x; i++)
    for (int i = 0; i < y; i++)
      ;
}


x86 assembly (clang, -O0):
<test_four>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1156 <test_four+0x56>
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1143 <test_four+0x43>
jmp    1135 <test_four+0x35>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1124 <test_four+0x24>
jmp    1148 <test_four+0x48>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1111 <test_four+0x11>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @test_four(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
store i32 0, i32* %5
br label %7
7: ; preds = %21, %2
%8 = load i32, i32* %5
%9 = load i32, i32* %3
%10 = icmp slt i32 %8, %9
br i1 %10, label %11, label %24
11: ; preds = %7
store i32 0, i32* %6
br label %12
12: ; preds = %17, %11
%13 = load i32, i32* %6
%14 = load i32, i32* %4
%15 = icmp slt i32 %13, %14
br i1 %15, label %16, label %20
16: ; preds = %12
br label %17
17: ; preds = %16
%18 = load i32, i32* %6
%19 = add nsw i32 %18, 1
store i32 %19, i32* %6
br label %12
20: ; preds = %12
br label %21
21: ; preds = %20
%22 = load i32, i32* %5
%23 = add nsw i32 %22, 1
store i32 %23, i32* %5
br label %7
24: ; preds = %7
ret void
}

LLVM IR (-O2):
define void @test_four(i32 %0, i32 %1) {
ret void
}
void ARGBToYRow_AVX2() {}


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

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

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

LLVM IR (-O2):
define void @ARGBToYRow_AVX2() {
ret void
}