xunge/DecIR huggingface dataset:
/* Variables and functions */
double cos(double);
double sin(double);
double dqwgto(double x, double omega, double p2, double p3, double p4,
              int wgtfunc) {
  double omx;
  omx = omega * x;
  if (wgtfunc == 1)
    return cos(omx);
  else
    return sin(omx);
}


x86 assembly (clang, -O0):
<dqwgto>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  %xmm2,-0x20(%rbp)
movsd  %xmm3,-0x28(%rbp)
movsd  %xmm4,-0x30(%rbp)
mov    %edi,-0x34(%rbp)
movsd  -0x18(%rbp),%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x40(%rbp)
cmpl   $0x1,-0x34(%rbp)
jne    1171 <dqwgto+0x51>
movsd  -0x40(%rbp),%xmm0
call   1040 <cos@plt>
movsd  %xmm0,-0x8(%rbp)
jmp    1180 <dqwgto+0x60>
movsd  -0x40(%rbp),%xmm0
call   1030 <sin@plt>
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dqwgto>:
mulsd  %xmm1,%xmm0
cmp    $0x1,%edi
jne    112e <dqwgto+0xe>
jmp    1040 <cos@plt>
jmp    1030 <sin@plt>

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

LLVM IR (-O2):
define double @dqwgto(double %0, double %1, double %2, double %3, double %4, i32 %5) {
%7 = fmul double %0, %1
%8 = icmp eq i32 %5, 1
br i1 %8, label %9, label %11
9: ; preds = %6
%10 = tail call double @cos(double %7)
br label %13
11: ; preds = %6
%12 = tail call double @sin(double %7)
br label %13
13: ; preds = %11, %9
%14 = phi double [ %10, %9 ], [ %12, %11 ]
ret double %14
}
/* Variables and functions */
int /*<<< orphan*/ terror(char *);
void assertNotNull(void *p, char *msg) {
  if (p == NULL) {
    terror(msg);
  }
}


x86 assembly (clang, -O0):
<assertNotNull>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1134 <assertNotNull+0x24>
mov    -0x10(%rbp),%rdi
call   1030 <terror@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<assertNotNull>:
test   %rdi,%rdi
je     1116 <assertNotNull+0x6>
ret
mov    %rsi,%rdi
jmp    1030 <terror@plt>

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

LLVM IR (-O2):
define void @assertNotNull(i8* readnone %0, i8* %1) {
%3 = icmp eq i8* %0, null
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i32 @terror(i8* %1)
br label %6
6: ; preds = %4, %2
ret void
}
/* Variables and functions */
int signed_range(int, int);
int /*<<< orphan*/ wr2_1(int, int /*<<< orphan*/);
void test_wrd2_1(int n) {
  wr2_1(0, 0);
  wr2_1(signed_range((-1), (1)), 0);
  wr2_1(signed_range((0), (1)), 0);
  wr2_1(signed_range((1), (2)), 0);
  wr2_1(n, 0);
}


x86 assembly (clang, -O0):
<test_wrd2_1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
xor    %esi,%esi
mov    %esi,%edi
call   1040 <wr2_1@plt>
mov    $0xffffffff,%edi
mov    $0x1,%esi
call   1030 <signed_range@plt>
mov    %eax,%edi
xor    %esi,%esi
call   1040 <wr2_1@plt>
xor    %edi,%edi
mov    $0x1,%esi
call   1030 <signed_range@plt>
mov    %eax,%edi
xor    %esi,%esi
call   1040 <wr2_1@plt>
mov    $0x1,%edi
mov    $0x2,%esi
call   1030 <signed_range@plt>
mov    %eax,%edi
xor    %esi,%esi
call   1040 <wr2_1@plt>
mov    -0x4(%rbp),%edi
xor    %esi,%esi
call   1040 <wr2_1@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_wrd2_1>:
push   %rbx
mov    %edi,%ebx
xor    %edi,%edi
xor    %esi,%esi
call   1040 <wr2_1@plt>
mov    $0xffffffff,%edi
mov    $0x1,%esi
call   1030 <signed_range@plt>
mov    %eax,%edi
xor    %esi,%esi
call   1040 <wr2_1@plt>
xor    %edi,%edi
mov    $0x1,%esi
call   1030 <signed_range@plt>
mov    %eax,%edi
xor    %esi,%esi
call   1040 <wr2_1@plt>
mov    $0x1,%edi
mov    $0x2,%esi
call   1030 <signed_range@plt>
mov    %eax,%edi
xor    %esi,%esi
call   1040 <wr2_1@plt>
mov    %ebx,%edi
xor    %esi,%esi
pop    %rbx
jmp    1040 <wr2_1@plt>

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

LLVM IR (-O2):
define void @test_wrd2_1(i32 %0) {
%2 = tail call i32 @wr2_1(i32 0, i32 0)
%3 = tail call i32 @signed_range(i32 -1, i32 1)
%4 = tail call i32 @wr2_1(i32 %3, i32 0)
%5 = tail call i32 @signed_range(i32 0, i32 1)
%6 = tail call i32 @wr2_1(i32 %5, i32 0)
%7 = tail call i32 @signed_range(i32 1, i32 2)
%8 = tail call i32 @wr2_1(i32 %7, i32 0)
%9 = tail call i32 @wr2_1(i32 %0, i32 0)
ret void
}
char *langRomTypeExtRam64() { return "64kB External RAM"; }


x86 assembly (clang, -O0):
<langRomTypeExtRam64>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<langRomTypeExtRam64>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [18 x i8] c"64kB External RAM\00"
define i8* @langRomTypeExtRam64() {
ret i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [18 x i8] c"64kB External RAM\00"
define i8* @langRomTypeExtRam64() {
ret i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0)
}
void test_three(int x, int y) {
#pragma omp target
#pragma omp teams distribute parallel for simd collapse(1)
  for (int i = 0; i < x; i++)
    for (int i = 0; i < y; i++)
      ;
}


x86 assembly (clang, -O0):
<test_three>:
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_three+0x56>
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1143 <test_three+0x43>
jmp    1135 <test_three+0x35>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1124 <test_three+0x24>
jmp    1148 <test_three+0x48>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1111 <test_three+0x11>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @test_three(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_three(i32 %0, i32 %1) {
ret void
}
int test_ten(int TEN_10) { return TEN_10; }


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

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

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

LLVM IR (-O2):
define i32 @test_ten(i32 returned %0) {
ret i32 %0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
void Logging_lost_callback(int channel_id, int lost) {
  printf("0,0,%d,%d\n", channel_id, lost);
}


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

x86 assembly (clang, -O2):
<Logging_lost_callback>:
mov    %esi,%edx
mov    %edi,%esi
lea    0xee5(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [11 x i8] c"0,0,%d,%d\0A\00"
define void @Logging_lost_callback(i32 %0, i32 %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1)
ret void
}
/* Variables and functions */
int FileDescrForEntry(int);
int read(int, char *, int);
int SerialPortRead(int portNum, char *bufPtr, int bufSize) {
  int fDescr, count = 0;
  if ((fDescr = FileDescrForEntry(portNum)) < 0)
    return 0;
  count = read(fDescr, bufPtr, bufSize);
  if (count < 0)
    return 0;
  return count;
}


x86 assembly (clang, -O0):
<SerialPortRead>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x8(%rbp),%edi
call   1040 <FileDescrForEntry@plt>
mov    %eax,-0x18(%rbp)
cmp    $0x0,%eax
jge    1159 <SerialPortRead+0x39>
movl   $0x0,-0x4(%rbp)
jmp    1187 <SerialPortRead+0x67>
mov    -0x18(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <read@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
jge    1181 <SerialPortRead+0x61>
movl   $0x0,-0x4(%rbp)
jmp    1187 <SerialPortRead+0x67>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SerialPortRead>:
push   %rbp
push   %rbx
push   %rax
mov    %edx,%ebp
mov    %rsi,%rbx
call   1040 <FileDescrForEntry@plt>
test   %eax,%eax
js     1148 <SerialPortRead+0x28>
mov    %eax,%edi
mov    %rbx,%rsi
mov    %ebp,%edx
call   1030 <read@plt>
mov    %eax,%ecx
xor    %eax,%eax
test   %ecx,%ecx
cmovns %ecx,%eax
jmp    114a <SerialPortRead+0x2a>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @SerialPortRead(i32 %0, i8* nocapture %1, i32 %2) {
%4 = tail call i32 @FileDescrForEntry(i32 %0)
%5 = icmp slt i32 %4, 0
br i1 %5, label %10, label %6
6: ; preds = %3
%7 = tail call i32 @read(i32 %4, i8* %1, i32 %2)
%8 = icmp sgt i32 %7, 0
%9 = select i1 %8, i32 %7, i32 0
br label %10
10: ; preds = %6, %3
%11 = phi i32 [ 0, %3 ], [ %9, %6 ]
ret i32 %11
}
/* Type definitions */
struct shmid_ds {
  int shm_segsz;
};

/* Variables and functions */
int /*<<< orphan*/ IPC_STAT;
scalar_t__ shmctl(int, int /*<<< orphan*/, struct shmid_ds *);
int get_shmem_size(int shmid) {
  struct shmid_ds smem_ds;
  smem_ds.shm_segsz = 0;
  if (shmctl(shmid, IPC_STAT, &smem_ds) == 0)
    return smem_ds.shm_segsz;
  return 0;
}


x86 assembly (clang, -O0):
<get_shmem_size>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    0x2eb4(%rip),%rax
mov    (%rax),%esi
lea    -0x10(%rbp),%rdx
call   1030 <shmctl@plt>
cmp    $0x0,%rax
jne    114c <get_shmem_size+0x3c>
mov    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1153 <get_shmem_size+0x43>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_shmem_size>:
push   %rax
movl   $0x0,(%rsp)
mov    0x2ec1(%rip),%rax
mov    (%rax),%esi
mov    %rsp,%rdx
call   1030 <shmctl@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
jne    1136 <get_shmem_size+0x26>
mov    (%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.shmid_ds = type { i32 }
@IPC_STAT = global i32 0
define i32 @get_shmem_size(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca %struct.shmid_ds
store i32 %0, i32* %3
%5 = getelementptr inbounds %struct.shmid_ds, %struct.shmid_ds* %4, i32 0, i32 0
store i32 0, i32* %5
%6 = load i32, i32* %3
%7 = load i32, i32* @IPC_STAT
%8 = call i64 @shmctl(i32 %6, i32 %7, %struct.shmid_ds* %4)
%9 = icmp eq i64 %8, 0
br i1 %9, label %10, label %13
10: ; preds = %1
%11 = getelementptr inbounds %struct.shmid_ds, %struct.shmid_ds* %4, i32 0, i32 0
%12 = load i32, i32* %11
store i32 %12, i32* %2
br label %14
13: ; preds = %1
store i32 0, i32* %2
br label %14
14: ; preds = %13, %10
%15 = load i32, i32* %2
ret i32 %15
}

LLVM IR (-O2):
%struct.shmid_ds = type { i32 }
@IPC_STAT = global i32 0
define i32 @get_shmem_size(i32 %0) {
%2 = alloca %struct.shmid_ds
%3 = bitcast %struct.shmid_ds* %2 to i8*
%4 = getelementptr inbounds %struct.shmid_ds, %struct.shmid_ds* %2, i64 0, i32 0
store i32 0, i32* %4
%5 = load i32, i32* @IPC_STAT
%6 = call i64 @shmctl(i32 %0, i32 %5, %struct.shmid_ds* %2)
%7 = icmp eq i64 %6, 0
%8 = load i32, i32* %4
%9 = select i1 %7, i32 %8, i32 0
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ malloc_large(int);
int /*<<< orphan*/ malloc_random(int);
int malloc_random_test(int verbose) {
  malloc_random(verbose);
  malloc_random(verbose);
  malloc_random(verbose);
  malloc_large(verbose);
  malloc_large(verbose);
  malloc_large(verbose);
  return 0;
}


x86 assembly (clang, -O0):
<malloc_random_test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <malloc_random@plt>
mov    -0x4(%rbp),%edi
call   1030 <malloc_random@plt>
mov    -0x4(%rbp),%edi
call   1030 <malloc_random@plt>
mov    -0x4(%rbp),%edi
call   1040 <malloc_large@plt>
mov    -0x4(%rbp),%edi
call   1040 <malloc_large@plt>
mov    -0x4(%rbp),%edi
call   1040 <malloc_large@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<malloc_random_test>:
push   %rbx
mov    %edi,%ebx
call   1030 <malloc_random@plt>
mov    %ebx,%edi
call   1030 <malloc_random@plt>
mov    %ebx,%edi
call   1030 <malloc_random@plt>
mov    %ebx,%edi
call   1040 <malloc_large@plt>
mov    %ebx,%edi
call   1040 <malloc_large@plt>
mov    %ebx,%edi
call   1040 <malloc_large@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @malloc_random_test(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @malloc_random(i32 %3)
%5 = load i32, i32* %2
%6 = call i32 @malloc_random(i32 %5)
%7 = load i32, i32* %2
%8 = call i32 @malloc_random(i32 %7)
%9 = load i32, i32* %2
%10 = call i32 @malloc_large(i32 %9)
%11 = load i32, i32* %2
%12 = call i32 @malloc_large(i32 %11)
%13 = load i32, i32* %2
%14 = call i32 @malloc_large(i32 %13)
ret i32 0
}

LLVM IR (-O2):
define i32 @malloc_random_test(i32 %0) {
%2 = tail call i32 @malloc_random(i32 %0)
%3 = tail call i32 @malloc_random(i32 %0)
%4 = tail call i32 @malloc_random(i32 %0)
%5 = tail call i32 @malloc_large(i32 %0)
%6 = tail call i32 @malloc_large(i32 %0)
%7 = tail call i32 @malloc_large(i32 %0)
ret i32 0
}
int fibonacci(int N) {
  if (N < 0) {
    return -1;
  } else {
    if (N == 0) {
      return 0;
    } else {
      if (N == 1) {
        return 1;
      } else {
        return fibonacci(N - 1) + fibonacci(N - 2);
      }
    }
  }
}


x86 assembly (clang, -O0):
<fibonacci>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    1131 <fibonacci+0x21>
movl   $0xffffffff,-0x4(%rbp)
jmp    1180 <fibonacci+0x70>
cmpl   $0x0,-0x8(%rbp)
jne    1147 <fibonacci+0x37>
movl   $0x0,-0x4(%rbp)
jmp    1180 <fibonacci+0x70>
cmpl   $0x1,-0x8(%rbp)
jne    115d <fibonacci+0x4d>
movl   $0x1,-0x4(%rbp)
jmp    1180 <fibonacci+0x70>
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
call   1030 <fibonacci@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
sub    $0x2,%edi
call   1030 <fibonacci@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fibonacci>:
push   %rbp
push   %rbx
push   %rax
test   %edi,%edi
js     1136 <fibonacci+0x26>
mov    %edi,%ebx
xor    %ebp,%ebp
cmp    $0x2,%ebx
jb     1132 <fibonacci+0x22>
lea    -0x1(%rbx),%edi
call   1030 <fibonacci@plt>
add    %eax,%ebp
add    $0xfffffffe,%ebx
cmp    $0x2,%ebx
jae    1120 <fibonacci+0x10>
add    %ebp,%ebx
jmp    113b <fibonacci+0x2b>
mov    $0xffffffff,%ebx
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @fibonacci(i32 %0) {
%2 = icmp slt i32 %0, 0
br i1 %2, label %14, label %3
3: ; preds = %1, %7
%4 = phi i32 [ %10, %7 ], [ %0, %1 ]
%5 = phi i32 [ %11, %7 ], [ 0, %1 ]
%6 = icmp ult i32 %4, 2
br i1 %6, label %12, label %7
7: ; preds = %3
%8 = add nsw i32 %4, -1
%9 = tail call i32 @fibonacci(i32 %8)
%10 = add nsw i32 %4, -2
%11 = add nsw i32 %9, %5
br label %3
12: ; preds = %3
%13 = add nsw i32 %4, %5
br label %14
14: ; preds = %12, %1
%15 = phi i32 [ %13, %12 ], [ -1, %1 ]
ret i32 %15
}
/* Variables and functions */
int /*<<< orphan*/ update_vz_conf(float, float);
void vff_update_vz_conf(float vz_meas, float conf) {
  update_vz_conf(vz_meas, conf);
}


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

x86 assembly (clang, -O2):
<vff_update_vz_conf>:
jmp    1030 <update_vz_conf@plt>

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

LLVM IR (-O2):
define void @vff_update_vz_conf(float %0, float %1) {
%3 = tail call i32 @update_vz_conf(float %0, float %1)
ret void
}
const char *fpp_config_get_plugin_mime_type(void) {
  return "application/pdf::Portable Document Format";
}


x86 assembly (clang, -O0):
<fpp_config_get_plugin_mime_type>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fpp_config_get_plugin_mime_type>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [42 x i8] c"application/pdf::Portable Document Format\00"
define i8* @fpp_config_get_plugin_mime_type() {
ret i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [42 x i8] c"application/pdf::Portable Document Format\00"
define i8* @fpp_config_get_plugin_mime_type() {
ret i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0)
}
int atoi(const char *buf) {
  int ret = 0;
  while (*buf >= '0' && *buf <= '9') {
    ret *= 10;
    ret += *buf - '0';
    buf++;
  }
  return ret;
}


x86 assembly (clang, -O0):
<atoi>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x30,%ecx
mov    %al,-0xd(%rbp)
jl     1134 <atoi+0x34>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x39,%eax
setle  %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
test   $0x1,%al
jne    1144 <atoi+0x44>
jmp    116c <atoi+0x6c>
imul   $0xa,-0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
sub    $0x30,%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    110f <atoi+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<atoi>:
mov    (%rdi),%cl
lea    -0x30(%rcx),%edx
xor    %eax,%eax
cmp    $0x9,%dl
ja     113b <atoi+0x3b>
add    $0x1,%rdi
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movzbl %cl,%ecx
lea    (%rax,%rax,4),%eax
lea    (%rcx,%rax,2),%eax
add    $0xffffffd0,%eax
movzbl (%rdi),%ecx
lea    -0x30(%rcx),%edx
add    $0x1,%rdi
cmp    $0xa,%dl
jb     1120 <atoi+0x20>
ret

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

LLVM IR (-O2):
define i32 @atoi(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = add i8 %2, -48
%4 = icmp ult i8 %3, 10
br i1 %4, label %5, label %17
5: ; preds = %1, %5
%6 = phi i8 [ %14, %5 ], [ %2, %1 ]
%7 = phi i32 [ %12, %5 ], [ 0, %1 ]
%8 = phi i8* [ %13, %5 ], [ %0, %1 ]
%9 = zext i8 %6 to i32
%10 = mul nsw i32 %7, 10
%11 = add i32 %10, -48
%12 = add i32 %11, %9
%13 = getelementptr inbounds i8, i8* %8, i64 1
%14 = load i8, i8* %13
%15 = add i8 %14, -48
%16 = icmp ult i8 %15, 10
br i1 %16, label %5, label %17
17: ; preds = %5, %1
%18 = phi i32 [ 0, %1 ], [ %12, %5 ]
ret i32 %18
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
void fn_test1(void) {
  int ia, ib;
  ia++;
  ib++;
  printf("fn_test1: %d, %d\n", ia, ib);
}


x86 assembly (clang, -O0):
<fn_test1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [18 x i8] c"fn_test1: %d, %d\0A\00"
define void @fn_test1() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 undef, i32 undef)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ print(char *);
void list() {
  print("\n");
  print("\nlis: a list of commands\n");
  print("\ncalculator: caluclator +,-,/,*\n");
  print("\nver\n");
}


x86 assembly (clang, -O0):
<list>:
push   %rbp
mov    %rsp,%rbp
lea    0xf1e(%rip),%rdi
call   1030 <print@plt>
lea    0xed9(%rip),%rdi
call   1030 <print@plt>
lea    0xee7(%rip),%rdi
call   1030 <print@plt>
lea    0xefc(%rip),%rdi
call   1030 <print@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<list>:
push   %rax
lea    0xf21(%rip),%rdi
call   1030 <print@plt>
lea    0xedc(%rip),%rdi
call   1030 <print@plt>
lea    0xeea(%rip),%rdi
call   1030 <print@plt>
lea    0xeff(%rip),%rdi
pop    %rax
jmp    1030 <print@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"\0A\00"
@.str.1 = [26 x i8] c"\0Alis: a list of commands\0A\00"
@.str.2 = [33 x i8] c"\0Acalculator: caluclator +,-,/,*\0A\00"
@.str.3 = [6 x i8] c"\0Aver\0A\00"
define void @list() {
%1 = call i32 @print(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @print(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @print(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @print(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c"\0A\00"
@.str.1 = [26 x i8] c"\0Alis: a list of commands\0A\00"
@.str.2 = [33 x i8] c"\0Acalculator: caluclator +,-,/,*\0A\00"
@.str.3 = [6 x i8] c"\0Aver\0A\00"
define void @list() {
%1 = tail call i32 @print(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @print(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @print(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.2, i64 0, i64 0))
%4 = tail call i32 @print(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ jffs2_lzari_init();
int /*<<< orphan*/ jffs2_lzma_init();
int /*<<< orphan*/ jffs2_lzo_init();
int /*<<< orphan*/ jffs2_rtime_init();
int /*<<< orphan*/ jffs2_zlib_init();
int jffs2_compressors_init(void) {
  jffs2_zlib_init();
  jffs2_lzma_init();
  jffs2_rtime_init();
  jffs2_lzari_init();
  jffs2_lzo_init();
  return 0;
}


x86 assembly (clang, -O0):
<jffs2_compressors_init>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <jffs2_zlib_init@plt>
mov    $0x0,%al
call   1060 <jffs2_lzma_init@plt>
mov    $0x0,%al
call   1070 <jffs2_rtime_init@plt>
mov    $0x0,%al
call   1030 <jffs2_lzari_init@plt>
mov    $0x0,%al
call   1050 <jffs2_lzo_init@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<jffs2_compressors_init>:
push   %rax
xor    %eax,%eax
call   1040 <jffs2_zlib_init@plt>
xor    %eax,%eax
call   1060 <jffs2_lzma_init@plt>
xor    %eax,%eax
call   1070 <jffs2_rtime_init@plt>
xor    %eax,%eax
call   1030 <jffs2_lzari_init@plt>
xor    %eax,%eax
call   1050 <jffs2_lzo_init@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @jffs2_compressors_init() {
%1 = call i32 (...) @jffs2_zlib_init()
%2 = call i32 (...) @jffs2_lzma_init()
%3 = call i32 (...) @jffs2_rtime_init()
%4 = call i32 (...) @jffs2_lzari_init()
%5 = call i32 (...) @jffs2_lzo_init()
ret i32 0
}

LLVM IR (-O2):
define i32 @jffs2_compressors_init() {
%1 = tail call i32 (...) @jffs2_zlib_init()
%2 = tail call i32 (...) @jffs2_lzma_init()
%3 = tail call i32 (...) @jffs2_rtime_init()
%4 = tail call i32 (...) @jffs2_lzari_init()
%5 = tail call i32 (...) @jffs2_lzo_init()
ret i32 0
}
/* Variables and functions */
int sizepow2(size_t);
size_t reqcap(size_t len, size_t cap, size_t min) {
  if (cap < min)
    cap = min;
  if (cap < len)
    cap = sizepow2(len) << 2;
  return cap;
}


x86 assembly (clang, -O0):
<reqcap>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
jae    113a <reqcap+0x2a>
mov    -0x18(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x8(%rbp),%rax
jae    115a <reqcap+0x4a>
mov    -0x8(%rbp),%rdi
call   1030 <sizepow2@plt>
shl    $0x2,%eax
cltq
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<reqcap>:
mov    %rsi,%rax
cmp    %rdx,%rsi
cmovb  %rdx,%rax
cmp    %rdi,%rax
jae    112e <reqcap+0x1e>
push   %rax
call   1030 <sizepow2@plt>
shl    $0x2,%eax
cltq
add    $0x8,%rsp
ret

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

LLVM IR (-O2):
define i64 @reqcap(i64 %0, i64 %1, i64 %2) {
%4 = icmp ult i64 %1, %2
%5 = select i1 %4, i64 %2, i64 %1
%6 = icmp ult i64 %5, %0
br i1 %6, label %7, label %11
7: ; preds = %3
%8 = tail call i32 @sizepow2(i64 %0)
%9 = shl i32 %8, 2
%10 = sext i32 %9 to i64
br label %11
11: ; preds = %7, %3
%12 = phi i64 [ %10, %7 ], [ %5, %3 ]
ret i64 %12
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, float);
int main() {
  double num1 = 3;
  float num2 = 23;
  printf("Double : %lf\n", num1);
  printf("Float : %f\n", num2);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movsd  0xee1(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
movss  0xecc(%rip),%xmm0
movss  %xmm0,-0x14(%rbp)
movsd  -0x10(%rbp),%xmm0
cvtsd2ss %xmm0,%xmm0
lea    0xec7(%rip),%rdi
call   1030 <printf@plt>
movss  -0x14(%rbp),%xmm0
lea    0xec4(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xef0(%rip),%rdi
movss  0xee0(%rip),%xmm0
call   1030 <printf@plt>
lea    0xeea(%rip),%rdi
movss  0xed0(%rip),%xmm0
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"Double : %lf\0A\00"
@.str.1 = [12 x i8] c"Float : %f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
%3 = alloca float
store i32 0, i32* %1
store double 3.000000e+00, double* %2
store float 2.300000e+01, float* %3
%4 = load double, double* %2
%5 = fptrunc double %4 to float
%6 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), float %5)
%7 = load float, float* %3
%8 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), float %7)
ret i32 0
}

LLVM IR (-O2):
@.str = [14 x i8] c"Double : %lf\0A\00"
@.str.1 = [12 x i8] c"Float : %f\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), float 3.000000e+00)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), float 2.300000e+01)
ret i32 0
}
unsigned char UART1ReadChar(void) {
  while (((*(volatile unsigned long *)(0xE0010000 + 0x14)) & 0x01) == 0)
    ;
  return (*(volatile unsigned long *)(0xE0010000 + 0x00));
}


x86 assembly (clang, -O0):
<UART1ReadChar>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <UART1ReadChar+0x9>
mov    $0xe0010014,%eax
mov    (%rax),%rax
and    $0x1,%rax
cmp    $0x0,%rax
jne    1124 <UART1ReadChar+0x24>
jmp    1109 <UART1ReadChar+0x9>
mov    $0xe0010000,%eax
mov    (%rax),%rax
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<UART1ReadChar>:
mov    $0xe0010000,%eax
cs nopw 0x0(%rax,%rax,1)
nop
testq  $0x1,0x14(%rax)
je     1110 <UART1ReadChar+0x10>
mov    (%rax),%rax
ret

LLVM IR (-O0):
define zeroext i8 @UART1ReadChar() {
br label %1
1: ; preds = %5, %0
%2 = load volatile i64, i64* inttoptr (i64 3758161940 to i64*)
%3 = and i64 %2, 1
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %6
5: ; preds = %1
br label %1
6: ; preds = %1
%7 = load volatile i64, i64* inttoptr (i64 3758161920 to i64*)
%8 = trunc i64 %7 to i8
ret i8 %8
}

LLVM IR (-O2):
define zeroext i8 @UART1ReadChar() {
br label %1
1: ; preds = %1, %0
%2 = load volatile i64, i64* inttoptr (i64 3758161940 to i64*)
%3 = and i64 %2, 1
%4 = icmp eq i64 %3, 0
br i1 %4, label %1, label %5
5: ; preds = %1
%6 = load volatile i64, i64* inttoptr (i64 3758161920 to i64*)
%7 = trunc i64 %6 to i8
ret i8 %7
}
void INT_Excep_PERIB_INTB152(void) {}


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

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

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

LLVM IR (-O2):
define void @INT_Excep_PERIB_INTB152() {
ret void
}
int main(void) {
  int i;
  i = 42;
  return i;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 42
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ isascii(int);
void t_isascii_0x75() {
  Assert_real((isascii(117)),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isascii.c",
              590, ("isascii should be 1 for u"));
}


x86 assembly (clang, -O0):
<t_isascii_0x75>:
push   %rbp
mov    %rsp,%rbp
mov    $0x75,%edi
call   1030 <isascii@plt>
mov    %eax,%edi
lea    0xec9(%rip),%rsi
mov    $0x24e,%edx
lea    0xf65(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isascii_0x75>:
lea    0xee9(%rip),%rsi
lea    0xf8a(%rip),%rcx
mov    $0x1,%edi
mov    $0x24e,%edx
jmp    1030 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isascii.c\00"
@.str.1 = [26 x i8] c"isascii should be 1 for u\00"
define void @t_isascii_0x75() {
%1 = call i32 @isascii(i32 117)
%2 = call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 590, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isascii.c\00"
@.str.1 = [26 x i8] c"isascii should be 1 for u\00"
define void @t_isascii_0x75() {
%1 = tail call i32 @Assert_real(i32 1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 590, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int get_brightness();
int /*<<< orphan*/ set_brightness(int);
void dec_brightness() {
  int brightness;
  brightness = get_brightness();
  if (brightness > 0) {
    set_brightness(brightness - 1);
  }
}


x86 assembly (clang, -O0):
<dec_brightness>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <get_brightness@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jle    1147 <dec_brightness+0x27>
mov    -0x4(%rbp),%edi
sub    $0x1,%edi
call   1030 <set_brightness@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dec_brightness>:
push   %rax
xor    %eax,%eax
call   1040 <get_brightness@plt>
test   %eax,%eax
jle    1137 <dec_brightness+0x17>
add    $0xffffffff,%eax
mov    %eax,%edi
pop    %rax
jmp    1030 <set_brightness@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @dec_brightness() {
%1 = alloca i32
%2 = call i32 (...) @get_brightness()
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = icmp sgt i32 %3, 0
br i1 %4, label %5, label %9
5: ; preds = %0
%6 = load i32, i32* %1
%7 = sub nsw i32 %6, 1
%8 = call i32 @set_brightness(i32 %7)
br label %9
9: ; preds = %5, %0
ret void
}

LLVM IR (-O2):
define void @dec_brightness() {
%1 = tail call i32 (...) @get_brightness()
%2 = icmp sgt i32 %1, 0
br i1 %2, label %3, label %6
3: ; preds = %0
%4 = add nsw i32 %1, -1
%5 = tail call i32 @set_brightness(i32 %4)
br label %6
6: ; preds = %3, %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ scanf(char *, int *);
void insert_array(int tamanho, int *vetor) {
  int i;
  for (i = 0; i < tamanho; i += 1) {
    scanf("%d", &vetor[i]);
  }
}


x86 assembly (clang, -O0):
<insert_array>:
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    115b <insert_array+0x4b>
mov    -0x10(%rbp),%rsi
movslq -0x14(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rsi
lea    0xeb8(%rip),%rdi
call   1030 <scanf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1126 <insert_array+0x16>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<insert_array>:
push   %r15
push   %r14
push   %rbx
test   %edi,%edi
jle    1145 <insert_array+0x35>
mov    %rsi,%rbx
mov    %edi,%r15d
lea    0xeda(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <scanf@plt>
add    $0x4,%rbx
add    $0xffffffffffffffff,%r15
jne    1130 <insert_array+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define void @insert_array(i32 %0, i32* %1) {
%3 = icmp sgt i32 %0, 0
br i1 %3, label %4, label %12
4: ; preds = %2
%5 = zext i32 %0 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %10, %6 ]
%8 = getelementptr inbounds i32, i32* %1, i64 %7
%9 = tail call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %8)
%10 = add nuw nsw i64 %7, 1
%11 = icmp eq i64 %10, %5
br i1 %11, label %12, label %6
12: ; preds = %6, %2
ret void
}
/* Type definitions */
struct pipeduino {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ reader(struct pipeduino *);
void *reader_main(void *user) {
  struct pipeduino *state = (struct pipeduino *)user;
  reader(state);
  return NULL;
}


x86 assembly (clang, -O0):
<reader_main>:
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 <reader@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.pipeduino = type { i32 }
define i8* @reader_main(i8* %0) {
%2 = alloca i8*
%3 = alloca %struct.pipeduino*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = bitcast i8* %4 to %struct.pipeduino*
store %struct.pipeduino* %5, %struct.pipeduino** %3
%6 = load %struct.pipeduino*, %struct.pipeduino** %3
%7 = call i32 @reader(%struct.pipeduino* %6)
ret i8* null
}

LLVM IR (-O2):
%struct.pipeduino = type { i32 }
define noalias i8* @reader_main(i8* %0) {
%2 = bitcast i8* %0 to %struct.pipeduino*
%3 = tail call i32 @reader(%struct.pipeduino* %2)
ret i8* null
}
unsigned char *get_int16(unsigned char *buffer, int *val) {
  if (val) {
    int myval = (*buffer) + ((*(buffer + 1)) << 8);
    *val = myval;
  }
  return buffer + 2;
}


x86 assembly (clang, -O0):
<get_int16>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1137 <get_int16+0x37>
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
mov    -0x8(%rbp),%rcx
movzbl 0x1(%rcx),%ecx
shl    $0x8,%ecx
add    %ecx,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x8(%rbp),%rax
add    $0x2,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_int16>:
mov    %rdi,%rax
test   %rsi,%rsi
je     110d <get_int16+0xd>
movzwl (%rax),%ecx
mov    %ecx,(%rsi)
add    $0x2,%rax
ret

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

LLVM IR (-O2):
define i8* @get_int16(i8* %0, i32* writeonly %1) {
%3 = icmp eq i32* %1, null
br i1 %3, label %12, label %4
4: ; preds = %2
%5 = load i8, i8* %0
%6 = zext i8 %5 to i32
%7 = getelementptr inbounds i8, i8* %0, i64 1
%8 = load i8, i8* %7
%9 = zext i8 %8 to i32
%10 = shl nuw nsw i32 %9, 8
%11 = or i32 %10, %6
store i32 %11, i32* %1
br label %12
12: ; preds = %4, %2
%13 = getelementptr inbounds i8, i8* %0, i64 2
ret i8* %13
}
/* Variables and functions */
int /*<<< orphan*/ turn_to_heading();
int main(void) {
  turn_to_heading();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @turn_to_heading()
ret i32 0
}
unsigned char tic_str_compute_checksum(char *strbuf) {
  unsigned char chks = 0;
  while (*strbuf != '\0') {
    chks += *strbuf;
    strbuf++;
  }
  chks &= 0x3F;
  chks += 0x20;
  return (chks);
}


x86 assembly (clang, -O0):
<tic_str_compute_checksum>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movb   $0x0,-0x9(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     113d <tic_str_compute_checksum+0x3d>
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
movzbl -0x9(%rbp),%eax
add    %ecx,%eax
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    110c <tic_str_compute_checksum+0xc>
movzbl -0x9(%rbp),%eax
and    $0x3f,%eax
mov    %al,-0x9(%rbp)
movzbl -0x9(%rbp),%eax
add    $0x20,%eax
mov    %al,-0x9(%rbp)
movzbl -0x9(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<tic_str_compute_checksum>:
mov    (%rdi),%cl
test   %cl,%cl
je     1128 <tic_str_compute_checksum+0x28>
add    $0x1,%rdi
xor    %edx,%edx
nopl   0x0(%rax)
movzbl %cl,%eax
add    %edx,%eax
movzbl %al,%edx
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <tic_str_compute_checksum+0x10>
and    $0x3f,%al
add    $0x20,%al
ret
mov    $0x20,%al
ret

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

LLVM IR (-O2):
define zeroext i8 @tic_str_compute_checksum(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %18, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i32 [ %11, %4 ], [ 0, %1 ]
%7 = phi i8* [ %10, %4 ], [ %0, %1 ]
%8 = zext i8 %5 to i32
%9 = add nuw nsw i32 %6, %8
%10 = getelementptr inbounds i8, i8* %7, i64 1
%11 = and i32 %9, 255
%12 = load i8, i8* %10
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4
%15 = trunc i32 %9 to i8
%16 = and i8 %15, 63
%17 = add nuw nsw i8 %16, 32
br label %18
18: ; preds = %14, %1
%19 = phi i8 [ 32, %1 ], [ %17, %14 ]
ret i8 %19
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int strindex(char *, char);
int main() {
  int v = strindex("hello world", 'o');
  printf("return %d\n", v);
  return v;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xed8(%rip),%rdi
mov    $0x6f,%esi
call   1040 <strindex@plt>
mov    %eax,%ebx
lea    0xed1(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [12 x i8] c"hello world\00"
@.str.1 = [11 x i8] c"return %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @strindex(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8 signext 111)
store i32 %3, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i32 %4)
%6 = load i32, i32* %2
ret i32 %6
}

LLVM IR (-O2):
@.str = [12 x i8] c"hello world\00"
@.str.1 = [11 x i8] c"return %d\0A\00"
define i32 @main() {
%1 = tail call i32 @strindex(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8 signext 111)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i32 %1)
ret i32 %1
}
int dummy_init() { return (0); }


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

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

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

LLVM IR (-O2):
define i32 @dummy_init() {
ret i32 0
}