xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void doMenu() {
  printf("1. Input record\n"
         "2. Calculate total and average score of course\n"
         "3. Sort in descending order by score\n"
         "4. Sort in ascending order by score\n"
         "5. Sort in ascending order by number\n"
         "6. Sort in dictionary order by name\n"
         "7. Search by number\n"
         "8. Search by name\n"
         "9. Statistic analysis\n"
         "10.List record\n"
         "0. Exit\n"
         "Please enter your choice: ");
}


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

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

LLVM IR (-O0):
@.str = [319 x i8] c"1. Input record\0A2. Calculate total and average score of course\0A3. Sort in descending order by score\0A4. Sort in ascending order by score\0A5. Sort in ascending order by number\0A6. Sort in dictionary order by name\0A7. Search by number\0A8. Search by name\0A9. Statistic analysis\0A10.List record\0A0. Exit\0APlease enter your choice: \00"
define void @doMenu() {
%1 = call i32 @printf(i8* getelementptr inbounds ([319 x i8], [319 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [319 x i8] c"1. Input record\0A2. Calculate total and average score of course\0A3. Sort in descending order by score\0A4. Sort in ascending order by score\0A5. Sort in ascending order by number\0A6. Sort in dictionary order by name\0A7. Search by number\0A8. Search by name\0A9. Statistic analysis\0A10.List record\0A0. Exit\0APlease enter your choice: \00"
define void @doMenu() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([319 x i8], [319 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char *argv[]) {
  int distance = 100;
  printf("you are %d miles away.\n", distance);
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [24 x i8] c"you are %d miles away.\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 100, i32* %6
%7 = load i32, i32* %6
%8 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 %7)
ret i32 0
}

LLVM IR (-O2):
@.str = [24 x i8] c"you are %d miles away.\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 100)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ gen_op_store_601_rtcu();
void spr_write_601_rtcu(void *opaque, int sprn) { gen_op_store_601_rtcu(); }


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

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

LLVM IR (-O0):
define void @spr_write_601_rtcu(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = call i32 (...) @gen_op_store_601_rtcu()
ret void
}

LLVM IR (-O2):
define void @spr_write_601_rtcu(i8* nocapture readnone %0, i32 %1) {
%3 = tail call i32 (...) @gen_op_store_601_rtcu()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Pause940(int);
int /*<<< orphan*/ Reset940(int);
void Shutdown940() {
  Reset940(1);
  Pause940(1);
}


x86 assembly (clang, -O0):
<Shutdown940>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1040 <Reset940@plt>
mov    $0x1,%edi
call   1030 <Pause940@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<Shutdown940>:
push   %rax
mov    $0x1,%edi
call   1040 <Reset940@plt>
mov    $0x1,%edi
pop    %rax
jmp    1030 <Pause940@plt>

LLVM IR (-O0):
define void @Shutdown940() {
%1 = call i32 @Reset940(i32 1)
%2 = call i32 @Pause940(i32 1)
ret void
}

LLVM IR (-O2):
define void @Shutdown940() {
%1 = tail call i32 @Reset940(i32 1)
%2 = tail call i32 @Pause940(i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ timer_init();
void tminit_() { timer_init(); }


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

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

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

LLVM IR (-O2):
define void @tminit_() {
%1 = tail call i32 (...) @timer_init()
ret void
}
char *RCSid() {
  return RCSid("$Id: parse.c,v 1.66.2.3 2012/10/31 20:14:44 sfeam Exp $");
}


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

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

LLVM IR (-O0):
@.str = [56 x i8] c"$Id: parse.c,v 1.66.2.3 2012/10/31 20:14:44 sfeam Exp $\00"
define i8* @RCSid() {
%1 = call i8* (i8*, ...) bitcast (i8* ()* @RCSid to i8* (i8*, ...)*)(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}

LLVM IR (-O2):
define noalias i8* @RCSid() {
br label %1
1: ; preds = %1, %0
br label %1
}
void clear(const int color) {
  char x, y;
  for (x = 0; x < 240; x++) {
    for (y = 0; y < 160; y++) {
      ((unsigned short *)0x6000000)[x + y * 240] = color;
    }
  }
}


x86 assembly (clang, -O0):
<clear>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movb   $0x0,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0xf0,%eax
jge    116e <clear+0x6e>
movb   $0x0,-0x6(%rbp)
movsbl -0x6(%rbp),%eax
cmp    $0xa0,%eax
jge    115c <clear+0x5c>
mov    -0x4(%rbp),%eax
mov    %ax,%dx
movsbl -0x5(%rbp),%eax
movsbl -0x6(%rbp),%ecx
imul   $0xf0,%ecx,%ecx
add    %ecx,%eax
movslq %eax,%rcx
mov    $0x6000000,%eax
mov    %dx,(%rax,%rcx,2)
mov    -0x6(%rbp),%al
add    $0x1,%al
mov    %al,-0x6(%rbp)
jmp    111e <clear+0x1e>
jmp    1161 <clear+0x61>
mov    -0x5(%rbp),%al
add    $0x1,%al
mov    %al,-0x5(%rbp)
jmp    110b <clear+0xb>
pop    %rbp
ret

x86 assembly (clang, -O2):
<clear>:
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movsbq %al,%rax
imul   $0x1e0,%rax,%rcx
mov    %di,0x6000000(%rcx)
add    $0x1,%al
jmp    1110 <clear+0x10>

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

LLVM IR (-O2):
define void @clear(i32 %0) {
%2 = trunc i32 %0 to i16
br label %3
3: ; preds = %3, %1
%4 = phi i8 [ 0, %1 ], [ %8, %3 ]
%5 = sext i8 %4 to i64
%6 = mul nsw i64 %5, 240
%7 = getelementptr inbounds i16, i16* inttoptr (i64 100663296 to i16*), i64 %6
store i16 %2, i16* %7
%8 = add i8 %4, 1
br label %3
}
double pop(double *stack, int *pos) {
  double val = stack[*pos];
  stack[*pos] = 0;
  (*pos)--;
  return val;
}


x86 assembly (clang, -O0):
<pop>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
movslq (%rcx),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
movslq (%rcx),%rcx
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
add    $0xffffffff,%ecx
mov    %ecx,(%rax)
movsd  -0x18(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<pop>:
movslq (%rsi),%rax
movsd  (%rdi,%rax,8),%xmm0
movq   $0x0,(%rdi,%rax,8)
add    $0xffffffff,%eax
mov    %eax,(%rsi)
ret

LLVM IR (-O0):
define double @pop(double* %0, i32* %1) {
%3 = alloca double*
%4 = alloca i32*
%5 = alloca double
store double* %0, double** %3
store i32* %1, i32** %4
%6 = load double*, double** %3
%7 = load i32*, i32** %4
%8 = load i32, i32* %7
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds double, double* %6, i64 %9
%11 = load double, double* %10
store double %11, double* %5
%12 = load double*, double** %3
%13 = load i32*, i32** %4
%14 = load i32, i32* %13
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds double, double* %12, i64 %15
store double 0.000000e+00, double* %16
%17 = load i32*, i32** %4
%18 = load i32, i32* %17
%19 = add nsw i32 %18, -1
store i32 %19, i32* %17
%20 = load double, double* %5
ret double %20
}

LLVM IR (-O2):
define double @pop(double* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %1
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds double, double* %0, i64 %4
%6 = load double, double* %5
store double 0.000000e+00, double* %5
%7 = add nsw i32 %3, -1
store i32 %7, i32* %1
ret double %6
}
int test_imm_A0uint8_reg(unsigned char val) {
  return ((val) & (-0xA0 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_A0uint8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%edx
and    $0xffffff60,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_A0uint8_reg(i8 zeroext %0) {
%2 = and i8 %0, 96
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
void wpas_p2p_ap_deinit(struct wpa_supplicant *wpa_s) {}


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

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

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

LLVM IR (-O2):
%struct.wpa_supplicant = type opaque
define void @wpas_p2p_ap_deinit(%struct.wpa_supplicant* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ pthread_exit(int /*<<< orphan*/);
int /*<<< orphan*/ sleep(int);
void *th(void *v) {
  sleep(1);
  pthread_exit(0);
}


x86 assembly (clang, -O0):
<th>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    $0x1,%edi
call   1040 <sleep@plt>
xor    %edi,%edi
call   1030 <pthread_exit@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<th>:
push   %rax
mov    $0x1,%edi
call   1040 <sleep@plt>
xor    %edi,%edi
pop    %rax
jmp    1030 <pthread_exit@plt>

LLVM IR (-O0):
define i8* @th(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %3
%4 = call i32 @sleep(i32 1)
%5 = call i32 @pthread_exit(i32 0)
%6 = load i8*, i8** %2
ret i8* %6
}

LLVM IR (-O2):
define noalias i8* @th(i8* nocapture readnone %0) {
%2 = tail call i32 @sleep(i32 1)
%3 = tail call i32 @pthread_exit(i32 0)
ret i8* undef
}
/* Variables and functions */
int /*<<< orphan*/ db(int);
void sahf() { db(0x9E); }


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

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

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

LLVM IR (-O2):
define void @sahf() {
%1 = tail call i32 @db(i32 158)
ret void
}
/* Variables and functions */
int printUsage();
int runProgram(int, char **);
int main(int argc, char **argv) {
  if (argc != 8)
    return printUsage();
  return runProgram(argc, argv);
}


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)
cmpl   $0x8,-0x8(%rbp)
je     114f <main+0x2f>
mov    $0x0,%al
call   1040 <printUsage@plt>
mov    %eax,-0x4(%rbp)
jmp    115e <main+0x3e>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <runProgram@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
cmp    $0x8,%edi
jne    112f <main+0xf>
mov    $0x8,%edi
jmp    1030 <runProgram@plt>
xor    %eax,%eax
jmp    1040 <printUsage@plt>

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 = load i32, i32* %4
%7 = icmp ne i32 %6, 8
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = call i32 (...) @printUsage()
store i32 %9, i32* %3
br label %14
10: ; preds = %2
%11 = load i32, i32* %4
%12 = load i8**, i8*** %5
%13 = call i32 @runProgram(i32 %11, i8** %12)
store i32 %13, i32* %3
br label %14
14: ; preds = %10, %8
%15 = load i32, i32* %3
ret i32 %15
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = icmp eq i32 %0, 8
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i32 (...) @printUsage()
br label %8
6: ; preds = %2
%7 = tail call i32 @runProgram(i32 8, i8** %1)
br label %8
8: ; preds = %6, %4
%9 = phi i32 [ %5, %4 ], [ %7, %6 ]
ret i32 %9
}
int get_next_sensor(int sensor_number) {
  if (sensor_number < 3 - 1) {
    return sensor_number + 1;
  } else {
    return -1;
  }
}


x86 assembly (clang, -O0):
<get_next_sensor>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x2,-0x8(%rbp)
jge    111f <get_next_sensor+0x1f>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1126 <get_next_sensor+0x26>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_next_sensor>:
lea    0x1(%rdi),%ecx
cmp    $0x2,%edi
mov    $0xffffffff,%eax
cmovl  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @get_next_sensor(i32 %0) {
%2 = icmp slt i32 %0, 2
%3 = add nsw i32 %0, 1
%4 = select i1 %2, i32 %3, i32 -1
ret i32 %4
}
void mm_free(int size, double **matrix) {
  int i;
  for (i = 0; i < size; i++) {
    free(matrix[i]);
  }
  free(matrix);
}


x86 assembly (clang, -O0):
<mm_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1151 <mm_free+0x41>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <free@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1126 <mm_free+0x16>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mm_free>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
test   %edi,%edi
jle    1142 <mm_free+0x32>
mov    %edi,%r15d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    (%r14,%rbx,8),%rdi
call   1030 <free@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <mm_free+0x20>
mov    %r14,%rdi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @mm_free(i32 %0, double** nocapture %1) {
%3 = icmp sgt i32 %0, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %0 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds double*, double** %1, i64 %7
%9 = bitcast double** %8 to i8**
%10 = load i8*, i8** %9
tail call void @free(i8* %10)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
%14 = bitcast double** %1 to i8*
tail call void @free(i8* %14)
ret void
}
/* Variables and functions */
char *findname(unsigned char, char const *);
char const *strchar(unsigned char);
char const *strdefbyte(unsigned char byte, char const *prefix) {
  char const *name;
  name = findname(byte, prefix);
  if (name)
    return name;
  else if (byte == 0)
    return "0";
  else
    return strchar(byte);
}


x86 assembly (clang, -O0):
<strdefbyte>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %dil,%al
mov    %al,-0x9(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x9(%rbp),%al
mov    -0x18(%rbp),%rsi
movzbl %al,%edi
call   1030 <findname@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     115d <strdefbyte+0x3d>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1187 <strdefbyte+0x67>
movzbl -0x9(%rbp),%eax
cmp    $0x0,%eax
jne    117a <strdefbyte+0x5a>
lea    0xe8f(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1187 <strdefbyte+0x67>
movzbl -0x9(%rbp),%edi
call   1040 <strchar@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strdefbyte>:
push   %rbx
mov    %edi,%ebx
call   1030 <findname@plt>
test   %rax,%rax
je     112f <strdefbyte+0xf>
pop    %rbx
ret
test   %bl,%bl
je     113c <strdefbyte+0x1c>
movzbl %bl,%edi
pop    %rbx
jmp    1040 <strchar@plt>
lea    0xebd(%rip),%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [2 x i8] c"0\00"
define i8* @strdefbyte(i8 zeroext %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8
%5 = alloca i8*
%6 = alloca i8*
store i8 %0, i8* %4
store i8* %1, i8** %5
%7 = load i8, i8* %4
%8 = load i8*, i8** %5
%9 = call i8* @findname(i8 zeroext %7, i8* %8)
store i8* %9, i8** %6
%10 = load i8*, i8** %6
%11 = icmp ne i8* %10, null
br i1 %11, label %12, label %14
12: ; preds = %2
%13 = load i8*, i8** %6
store i8* %13, i8** %3
br label %22
14: ; preds = %2
%15 = load i8, i8* %4
%16 = zext i8 %15 to i32
%17 = icmp eq i32 %16, 0
br i1 %17, label %18, label %19
18: ; preds = %14
store i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8** %3
br label %22
19: ; preds = %14
%20 = load i8, i8* %4
%21 = call i8* @strchar(i8 zeroext %20)
store i8* %21, i8** %3
br label %22
22: ; preds = %19, %18, %12
%23 = load i8*, i8** %3
ret i8* %23
}

LLVM IR (-O2):
@.str = [2 x i8] c"0\00"
define i8* @strdefbyte(i8 zeroext %0, i8* %1) {
%3 = tail call i8* @findname(i8 zeroext %0, i8* %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %9
5: ; preds = %2
%6 = icmp eq i8 %0, 0
br i1 %6, label %9, label %7
7: ; preds = %5
%8 = tail call i8* @strchar(i8 zeroext %0)
br label %9
9: ; preds = %5, %2, %7
%10 = phi i8* [ %8, %7 ], [ %3, %2 ], [ getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), %5 ]
ret i8* %10
}
double return_double(double value) { return value; }


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

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

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

LLVM IR (-O2):
define double @return_double(double returned %0) {
ret double %0
}
/* Variables and functions */
int /*<<< orphan*/ japi_drawpixel(int, int, int);
void j_drawpixel(int arg0, int arg1, int arg2) {
  japi_drawpixel(arg0, arg1, arg2);
}


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

x86 assembly (clang, -O2):
<j_drawpixel>:
jmp    1030 <japi_drawpixel@plt>

LLVM IR (-O0):
define void @j_drawpixel(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = call i32 @japi_drawpixel(i32 %7, i32 %8, i32 %9)
ret void
}

LLVM IR (-O2):
define void @j_drawpixel(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @japi_drawpixel(i32 %0, i32 %1, i32 %2)
ret void
}
/* Variables and functions */
void *__memset(void *bufptr, int value, size_t size) {
  unsigned char *b = bufptr;
  for (size_t s = 0; s < size; s++)
    *b++ = value;
  return bufptr;
}


x86 assembly (clang, -O0):
<__memset>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
movq   $0x0,-0x28(%rbp)
mov    -0x28(%rbp),%rax
cmp    -0x18(%rbp),%rax
jae    1154 <__memset+0x54>
mov    -0xc(%rbp),%eax
mov    %al,%cl
mov    -0x20(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x20(%rbp)
mov    %cl,(%rax)
mov    -0x28(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x28(%rbp)
jmp    111f <__memset+0x1f>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__memset>:
push   %rbx
mov    %rdi,%rbx
test   %rdx,%rdx
je     1121 <__memset+0x11>
mov    %rbx,%rdi
call   1030 <memset@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @__memset(i8* returned writeonly %0, i32 %1, i64 %2) {
%4 = icmp eq i64 %2, 0
br i1 %4, label %7, label %5
5: ; preds = %3
%6 = trunc i32 %1 to i8
br label %7
7: ; preds = %5, %3
ret i8* %0
}
/* Variables and functions */
float math_asinf(float);
float call_asinf(float x) { return math_asinf(x); }


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

x86 assembly (clang, -O2):
<call_asinf>:
jmp    1030 <math_asinf@plt>

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

LLVM IR (-O2):
define float @call_asinf(float %0) {
%2 = tail call float @math_asinf(float %0)
ret float %2
}
/* Type definitions */
typedef int /*<<< orphan*/ uint_fast8_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ color(int /*<<< orphan*/, int /*<<< orphan*/,
                         int /*<<< orphan*/, int);
uint32_t applicate_color_raw(uint_fast8_t c[3]) {
  return color(c[0], c[1], c[2], 255);
}


x86 assembly (clang, -O0):
<applicate_color_raw>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%esi
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%edx
mov    $0xff,%ecx
call   1030 <color@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<applicate_color_raw>:
mov    (%rdi),%eax
mov    0x4(%rdi),%esi
mov    0x8(%rdi),%edx
mov    %eax,%edi
mov    $0xff,%ecx
jmp    1030 <color@plt>

LLVM IR (-O0):
define i32 @applicate_color_raw(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 0
%5 = load i32, i32* %4
%6 = load i32*, i32** %2
%7 = getelementptr inbounds i32, i32* %6, i64 1
%8 = load i32, i32* %7
%9 = load i32*, i32** %2
%10 = getelementptr inbounds i32, i32* %9, i64 2
%11 = load i32, i32* %10
%12 = call i32 @color(i32 %5, i32 %8, i32 %11, i32 255)
ret i32 %12
}

LLVM IR (-O2):
define i32 @applicate_color_raw(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = getelementptr inbounds i32, i32* %0, i64 1
%4 = load i32, i32* %3
%5 = getelementptr inbounds i32, i32* %0, i64 2
%6 = load i32, i32* %5
%7 = tail call i32 @color(i32 %2, i32 %4, i32 %6, i32 255)
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ position(int /*<<< orphan*/);
int /*<<< orphan*/ prepaint(int /*<<< orphan*/);
void repaint() { prepaint(position((0))); }


x86 assembly (clang, -O0):
<repaint>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <position@plt>
mov    %eax,%edi
call   1040 <prepaint@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @repaint() {
%1 = call i32 @position(i32 0)
%2 = call i32 @prepaint(i32 %1)
ret void
}

LLVM IR (-O2):
define void @repaint() {
%1 = tail call i32 @position(i32 0)
%2 = tail call i32 @prepaint(i32 %1)
ret void
}
int HLT(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @HLT() {
ret i32 0
}
unsigned int mask_to_cidr(unsigned int netmask) {
  unsigned int cidr;
  for (cidr = 0; netmask > 0; cidr++) {
    netmask &= (netmask - 1);
  }
  return cidr;
}


x86 assembly (clang, -O0):
<mask_to_cidr>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
jbe    1132 <mask_to_cidr+0x32>
mov    -0x4(%rbp),%eax
sub    $0x1,%eax
and    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    110e <mask_to_cidr+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mask_to_cidr>:
xor    %eax,%eax
test   %edi,%edi
je     111c <mask_to_cidr+0x1c>
cs nopw 0x0(%rax,%rax,1)
lea    -0x1(%rdi),%ecx
add    $0x1,%eax
and    %edi,%ecx
mov    %ecx,%edi
jne    1110 <mask_to_cidr+0x10>
ret

LLVM IR (-O0):
define i32 @mask_to_cidr(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
br label %4
4: ; preds = %12, %1
%5 = load i32, i32* %2
%6 = icmp ugt i32 %5, 0
br i1 %6, label %7, label %15
7: ; preds = %4
%8 = load i32, i32* %2
%9 = sub i32 %8, 1
%10 = load i32, i32* %2
%11 = and i32 %10, %9
store i32 %11, i32* %2
br label %12
12: ; preds = %7
%13 = load i32, i32* %3
%14 = add i32 %13, 1
store i32 %14, i32* %3
br label %4
15: ; preds = %4
%16 = load i32, i32* %3
ret i32 %16
}

LLVM IR (-O2):
define i32 @mask_to_cidr(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %10, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %8, %3 ], [ 0, %1 ]
%5 = phi i32 [ %7, %3 ], [ %0, %1 ]
%6 = add i32 %5, -1
%7 = and i32 %6, %5
%8 = add i32 %4, 1
%9 = icmp eq i32 %7, 0
br i1 %9, label %10, label %3
10: ; preds = %3, %1
%11 = phi i32 [ 0, %1 ], [ %8, %3 ]
ret i32 %11
}
/* Variables and functions */
char *_GetVersion();
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, char *);
void PrintVersion(char const *_) {
  printf("lcdgameemu %s\n", _GetVersion());
  exit(255);
}


x86 assembly (clang, -O0):
<PrintVersion>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1040 <_GetVersion@plt>
mov    %rax,%rsi
lea    0xeb3(%rip),%rdi
call   1030 <printf@plt>
mov    $0xff,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<PrintVersion>:
push   %rax
xor    %eax,%eax
call   1040 <_GetVersion@plt>
lea    0xec1(%rip),%rdi
mov    %rax,%rsi
call   1030 <printf@plt>
mov    $0xff,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"lcdgameemu %s\0A\00"
define void @PrintVersion(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i8* (...) @_GetVersion()
%4 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = call i32 @exit(i32 255)
unreachable
}

LLVM IR (-O2):
@.str = [15 x i8] c"lcdgameemu %s\0A\00"
define void @PrintVersion(i8* nocapture readnone %0) {
%2 = tail call i8* (...) @_GetVersion()
%3 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = tail call i32 @exit(i32 255)
unreachable
}
/* Variables and functions */
unsigned long __udivdi3(unsigned long, unsigned long);
__attribute((no)) unsigned long __umoddi3(unsigned long a, unsigned long b) {
  unsigned long r;
  r = __udivdi3(a, b);
  r = r * b;
  r = a - r;
  return r;
}


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

x86 assembly (clang, -O2):
<__umoddi3>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <__udivdi3@plt>
imul   %r14,%rax
sub    %rax,%rbx
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i64 @__umoddi3(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%6 = load i64, i64* %3
%7 = load i64, i64* %4
%8 = call i64 @__udivdi3(i64 %6, i64 %7)
store i64 %8, i64* %5
%9 = load i64, i64* %5
%10 = load i64, i64* %4
%11 = mul i64 %9, %10
store i64 %11, i64* %5
%12 = load i64, i64* %3
%13 = load i64, i64* %5
%14 = sub i64 %12, %13
store i64 %14, i64* %5
%15 = load i64, i64* %5
ret i64 %15
}

LLVM IR (-O2):
define i64 @__umoddi3(i64 %0, i64 %1) {
%3 = tail call i64 @__udivdi3(i64 %0, i64 %1)
%4 = mul i64 %3, %1
%5 = sub i64 %0, %4
ret i64 %5
}
/* Variables and functions */
int /*<<< orphan*/ close_game(long);
int /*<<< orphan*/ gexit(long);
void exit_game(long code) {
  close_game(code);
  gexit(code);
}


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

x86 assembly (clang, -O2):
<exit_game>:
push   %rbx
mov    %rdi,%rbx
call   1030 <close_game@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <gexit@plt>

LLVM IR (-O0):
define void @exit_game(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i32 @close_game(i64 %3)
%5 = load i64, i64* %2
%6 = call i32 @gexit(i64 %5)
ret void
}

LLVM IR (-O2):
define void @exit_game(i64 %0) {
%2 = tail call i32 @close_game(i64 %0)
%3 = tail call i32 @gexit(i64 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ mediaAluno(int **);
int /*<<< orphan*/ mediaTurma(int **);
main() {
  int mat[6][3] = {{5, 7, 4}, {5, 6, 7}, {3, 5, 2},
                   {4, 5, 6}, {8, 9, 7}, {2, 6, 4}};
  mediaAluno(mat);
  mediaTurma(mat);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
lea    -0x50(%rbp),%rdi
lea    0xebd(%rip),%rsi
mov    $0x48,%edx
call   1040 <memcpy@plt>
lea    -0x50(%rbp),%rdi
call   1050 <mediaAluno@plt>
lea    -0x50(%rbp),%rdi
call   1030 <mediaTurma@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x50,%rsp
mov    0xf14(%rip),%rax
mov    %rax,0x40(%rsp)
movaps 0xef8(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
movaps 0xedc(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xec0(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xea4(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1040 <mediaAluno@plt>
mov    %rbx,%rdi
call   1030 <mediaTurma@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@__const.main.mat = [6 x [3 x i32]] [[3 x i32] [i32 5, i32 7, i32 4], [3 x i32] [i32 5, i32 6, i32 7], [3 x i32] [i32 3, i32 5, i32 2], [3 x i32] [i32 4, i32 5, i32 6], [3 x i32] [i32 8, i32 9, i32 7], [3 x i32] [i32 2, i32 6, i32 4]]
define i32 @main() {
%1 = alloca [6 x [3 x i32]]
%2 = bitcast [6 x [3 x i32]]* %1 to i8*
%3 = bitcast [6 x [3 x i32]]* %1 to i32**
%4 = call i32 @mediaAluno(i32** %3)
%5 = call i32 @mediaTurma(i32** %3)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ error(char *, char *);
void errorFile(char *n) {
  error("Unable to open, read, write or close file \"%s\"\n", n);
}


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

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

LLVM IR (-O0):
@.str = [48 x i8] c"Unable to open, read, write or close file \22%s\22\0A\00"
define void @errorFile(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @error(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [48 x i8] c"Unable to open, read, write or close file \22%s\22\0A\00"
define void @errorFile(i8* %0) {
%2 = tail call i32 @error(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
struct s3c24x0_timers *s3c24x0_get_base_timers(void) {
  return (struct s3c24x0_timers *)0x15100000;
}


x86 assembly (clang, -O0):
<s3c24x0_get_base_timers>:
push   %rbp
mov    %rsp,%rbp
mov    $0x15100000,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.s3c24x0_timers = type opaque
define %struct.s3c24x0_timers* @s3c24x0_get_base_timers() {
ret %struct.s3c24x0_timers* inttoptr (i64 353370112 to %struct.s3c24x0_timers*)
}

LLVM IR (-O2):
%struct.s3c24x0_timers = type opaque
define %struct.s3c24x0_timers* @s3c24x0_get_base_timers() {
ret %struct.s3c24x0_timers* inttoptr (i64 353370112 to %struct.s3c24x0_timers*)
}
/* Type definitions */
typedef scalar_t__ wchar_t;

/* Variables and functions */
scalar_t__ wcslen(scalar_t__ const *);
scalar_t__ *wmemccpy(scalar_t__ *, scalar_t__ const *, scalar_t__, scalar_t__);
wchar_t *wcsccpy(wchar_t *restrict whither, const wchar_t *restrict whence,
                 wchar_t c) {
  wchar_t *r = wmemccpy(whither, whence, c, wcslen(whence) + 1);
  if (r)
    *r = 0;
  return r;
}


x86 assembly (clang, -O0):
<wcsccpy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <wcslen@plt>
mov    -0x38(%rbp),%rdi
mov    -0x30(%rbp),%rsi
mov    -0x28(%rbp),%rdx
mov    %rax,%rcx
add    $0x1,%rcx
call   1040 <wmemccpy@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     1187 <wcsccpy+0x67>
mov    -0x20(%rbp),%rax
movq   $0x0,(%rax)
mov    -0x20(%rbp),%rax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wcsccpy>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %rsi,%rbx
mov    %rdi,%r15
mov    %rsi,%rdi
call   1030 <wcslen@plt>
lea    0x1(%rax),%rcx
mov    %r15,%rdi
mov    %rbx,%rsi
mov    %r14,%rdx
call   1040 <wmemccpy@plt>
test   %rax,%rax
je     1154 <wcsccpy+0x34>
movq   $0x0,(%rax)
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i64* @wcsccpy(i64* noalias %0, i64* noalias %1, i64 %2) {
%4 = alloca i64*
%5 = alloca i64*
%6 = alloca i64
%7 = alloca i64*
store i64* %0, i64** %4
store i64* %1, i64** %5
store i64 %2, i64* %6
%8 = load i64*, i64** %4
%9 = load i64*, i64** %5
%10 = load i64, i64* %6
%11 = load i64*, i64** %5
%12 = call i64 @wcslen(i64* %11)
%13 = add nsw i64 %12, 1
%14 = call i64* @wmemccpy(i64* %8, i64* %9, i64 %10, i64 %13)
store i64* %14, i64** %7
%15 = load i64*, i64** %7
%16 = icmp ne i64* %15, null
br i1 %16, label %17, label %19
17: ; preds = %3
%18 = load i64*, i64** %7
store i64 0, i64* %18
br label %19
19: ; preds = %17, %3
%20 = load i64*, i64** %7
ret i64* %20
}

LLVM IR (-O2):
define i64* @wcsccpy(i64* noalias %0, i64* noalias %1, i64 %2) {
%4 = tail call i64 @wcslen(i64* %1)
%5 = add nsw i64 %4, 1
%6 = tail call i64* @wmemccpy(i64* %0, i64* %1, i64 %2, i64 %5)
%7 = icmp eq i64* %6, null
br i1 %7, label %9, label %8
8: ; preds = %3
store i64 0, i64* %6
br label %9
9: ; preds = %8, %3
ret i64* %6
}
void __attribute__((visibility("default")))
border_e_horizontal_special_sand_n(unsigned char *pic, unsigned char *mirr) {
  *pic = 0x2D;
  *mirr = 0x02;
}


x86 assembly (clang, -O0):
<border_e_horizontal_special_sand_n>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movb   $0x2d,(%rax)
mov    -0x10(%rbp),%rax
movb   $0x2,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<border_e_horizontal_special_sand_n>:
movb   $0x2d,(%rdi)
movb   $0x2,(%rsi)
ret

LLVM IR (-O0):
define void @border_e_horizontal_special_sand_n(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
store i8 45, i8* %5
%6 = load i8*, i8** %4
store i8 2, i8* %6
ret void
}

LLVM IR (-O2):
define void @border_e_horizontal_special_sand_n(i8* nocapture writeonly %0, i8* nocapture writeonly %1) {
store i8 45, i8* %0
store i8 2, i8* %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ unlink(char *);
void cleanupcb_unlink(void *_fname) {
  char *fname = (char *)_fname;
  unlink(fname);
}


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

x86 assembly (clang, -O2):
<cleanupcb_unlink>:
jmp    1030 <unlink@plt>

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

LLVM IR (-O2):
define void @cleanupcb_unlink(i8* nocapture %0) {
%2 = tail call i32 @unlink(i8* %0)
ret void
}
int __libc_current_sigrtmin(void) { return -1; }


x86 assembly (clang, -O0):
<__libc_current_sigrtmin>:
push   %rbp
mov    %rsp,%rbp
mov    $0xffffffff,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @__libc_current_sigrtmin() {
ret i32 -1
}

LLVM IR (-O2):
define i32 @__libc_current_sigrtmin() {
ret i32 -1
}
/* Variables and functions */
int RAND_MAX;
int rand();
int heads() { return rand() < RAND_MAX / 2; }


x86 assembly (clang, -O0):
<heads>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <rand@plt>
mov    %eax,-0x4(%rbp)
mov    0x2ebf(%rip),%rax
mov    (%rax),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x4(%rbp),%eax
cmp    %ecx,%eax
setl   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<heads>:
push   %rax
xor    %eax,%eax
call   1030 <rand@plt>
mov    0x2ec9(%rip),%rcx
mov    (%rcx),%ecx
mov    %ecx,%edx
shr    $0x1f,%edx
add    %ecx,%edx
sar    %edx
xor    %ecx,%ecx
cmp    %edx,%eax
setl   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@RAND_MAX = global i32 0
define i32 @heads() {
%1 = call i32 (...) @rand()
%2 = load i32, i32* @RAND_MAX
%3 = sdiv i32 %2, 2
%4 = icmp slt i32 %1, %3
%5 = zext i1 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
@RAND_MAX = global i32 0
define i32 @heads() {
%1 = tail call i32 (...) @rand()
%2 = load i32, i32* @RAND_MAX
%3 = sdiv i32 %2, 2
%4 = icmp slt i32 %1, %3
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
char *my_alloc2(int, int);
int test6(int len, int align) {
  int i;
  char *p = my_alloc2(align, len);
  return ((long int)p) & 15;
}


x86 assembly (clang, -O0):
<test6>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x4(%rbp),%esi
call   1030 <my_alloc2@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
and    $0xf,%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test6>:
push   %rax
mov    %edi,%eax
mov    %esi,%edi
mov    %eax,%esi
call   1030 <my_alloc2@plt>
and    $0xf,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @test6(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8*
store i32 %0, i32* %3
store i32 %1, i32* %4
%7 = load i32, i32* %4
%8 = load i32, i32* %3
%9 = call i8* @my_alloc2(i32 %7, i32 %8)
store i8* %9, i8** %6
%10 = load i8*, i8** %6
%11 = ptrtoint i8* %10 to i64
%12 = and i64 %11, 15
%13 = trunc i64 %12 to i32
ret i32 %13
}

LLVM IR (-O2):
define i32 @test6(i32 %0, i32 %1) {
%3 = tail call i8* @my_alloc2(i32 %1, i32 %0)
%4 = ptrtoint i8* %3 to i64
%5 = trunc i64 %4 to i32
%6 = and i32 %5, 15
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(void) {
  int ret = 0;
  printf("hello, world \n");
  return ret;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
lea    0xed3(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%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, world \0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* %2
ret i32 %4
}

LLVM IR (-O2):
@str = [14 x i8] c"hello, world \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
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ SEEK_SET;
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ fseek(int /*<<< orphan*/ *, int, int /*<<< orphan*/);
int /*<<< orphan*/ fwrite(long *, int, int, int /*<<< orphan*/ *);
void closesoundout(FILE *file, long totalCount) {
  long bytes;
  fseek(file, 8, SEEK_SET);
  bytes = totalCount * 2;
  fwrite(&bytes, 4, 1, file);
  fclose(file);
}


x86 assembly (clang, -O0):
<closesoundout>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2e95(%rip),%rax
mov    (%rax),%edx
mov    $0x8,%esi
call   1040 <fseek@plt>
mov    -0x10(%rbp),%rax
shl    $0x1,%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rcx
lea    -0x18(%rbp),%rdi
mov    $0x4,%esi
mov    $0x1,%edx
call   1050 <fwrite@plt>
mov    -0x8(%rbp),%rdi
call   1030 <fclose@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<closesoundout>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    0x2e9f(%rip),%rax
mov    (%rax),%edx
mov    $0x8,%esi
call   1040 <fseek@plt>
add    %rbx,%rbx
mov    %rbx,(%rsp)
mov    %rsp,%rdi
mov    $0x4,%esi
mov    $0x1,%edx
mov    %r14,%rcx
call   1050 <fwrite@plt>
mov    %r14,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <fclose@plt>

LLVM IR (-O0):
@SEEK_SET = global i32 0
define void @closesoundout(i32* %0, i64 %1) {
%3 = alloca i32*
%4 = alloca i64
%5 = alloca i64
store i32* %0, i32** %3
store i64 %1, i64* %4
%6 = load i32*, i32** %3
%7 = load i32, i32* @SEEK_SET
%8 = call i32 @fseek(i32* %6, i32 8, i32 %7)
%9 = load i64, i64* %4
%10 = mul nsw i64 %9, 2
store i64 %10, i64* %5
%11 = load i32*, i32** %3
%12 = call i32 @fwrite(i64* %5, i32 4, i32 1, i32* %11)
%13 = load i32*, i32** %3
%14 = call i32 @fclose(i32* %13)
ret void
}

LLVM IR (-O2):
@SEEK_SET = global i32 0
define void @closesoundout(i32* nocapture %0, i64 %1) {
%3 = alloca i64
%4 = bitcast i64* %3 to i8*
%5 = load i32, i32* @SEEK_SET
%6 = tail call i32 @fseek(i32* %0, i32 8, i32 %5)
%7 = shl nsw i64 %1, 1
store i64 %7, i64* %3
%8 = call i32 @fwrite(i64* %3, i32 4, i32 1, i32* %0)
%9 = tail call i32 @fclose(i32* %0)
ret void
}
void INT_Excep_PERIA_INTA221(void) {}


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

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

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

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