xunge/DecIR huggingface dataset:
/* Type definitions */
struct timespec {
  scalar_t__ tv_nsec;
  scalar_t__ tv_sec;
};

/* Variables and functions */
double timespec_to_double_ns(struct timespec *t) {
  double sec = ((double)t->tv_sec) * 1000000000.0;
  double nsec = (double)t->tv_nsec;
  return sec + nsec;
}


x86 assembly (clang, -O0):
<timespec_to_double_ns>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cvtsi2sdq 0x8(%rax),%xmm0
movsd  0xee6(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cvtsi2sdq (%rax),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
addsd  -0x18(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<timespec_to_double_ns>:
cvtsi2sdq 0x8(%rdi),%xmm1
mulsd  0xef2(%rip),%xmm1
cvtsi2sdq (%rdi),%xmm0
addsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
%struct.timespec = type { i64, i64 }
define double @timespec_to_double_ns(%struct.timespec* %0) {
%2 = alloca %struct.timespec*
%3 = alloca double
%4 = alloca double
store %struct.timespec* %0, %struct.timespec** %2
%5 = load %struct.timespec*, %struct.timespec** %2
%6 = getelementptr inbounds %struct.timespec, %struct.timespec* %5, i32 0, i32 1
%7 = load i64, i64* %6
%8 = sitofp i64 %7 to double
%9 = fmul double %8, 1.000000e+09
store double %9, double* %3
%10 = load %struct.timespec*, %struct.timespec** %2
%11 = getelementptr inbounds %struct.timespec, %struct.timespec* %10, i32 0, i32 0
%12 = load i64, i64* %11
%13 = sitofp i64 %12 to double
store double %13, double* %4
%14 = load double, double* %3
%15 = load double, double* %4
%16 = fadd double %14, %15
ret double %16
}

LLVM IR (-O2):
%struct.timespec = type { i64, i64 }
define double @timespec_to_double_ns(%struct.timespec* nocapture %0) {
%2 = getelementptr inbounds %struct.timespec, %struct.timespec* %0, i64 0, i32 1
%3 = load i64, i64* %2
%4 = sitofp i64 %3 to double
%5 = fmul double %4, 1.000000e+09
%6 = getelementptr inbounds %struct.timespec, %struct.timespec* %0, i64 0, i32 0
%7 = load i64, i64* %6
%8 = sitofp i64 %7 to double
%9 = fadd double %5, %8
ret double %9
}
/* Variables and functions */
int /*<<< orphan*/ popNumber();
int /*<<< orphan*/ pushNumber(int /*<<< orphan*/);
int /*<<< orphan*/ tan(int /*<<< orphan*/);
void basTan() { pushNumber(tan(popNumber())); }


x86 assembly (clang, -O0):
<basTan>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1050 <popNumber@plt>
mov    %eax,%edi
call   1030 <tan@plt>
mov    %eax,%edi
call   1040 <pushNumber@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<basTan>:
push   %rax
xor    %eax,%eax
call   1050 <popNumber@plt>
mov    %eax,%edi
call   1030 <tan@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <pushNumber@plt>

LLVM IR (-O0):
define void @basTan() {
%1 = call i32 (...) @popNumber()
%2 = call i32 @tan(i32 %1)
%3 = call i32 @pushNumber(i32 %2)
ret void
}

LLVM IR (-O2):
define void @basTan() {
%1 = tail call i32 (...) @popNumber()
%2 = tail call i32 @tan(i32 %1)
%3 = tail call i32 @pushNumber(i32 %2)
ret void
}
void larger_state_FN() {
  int i = 0, k = 0;
  while (k < 100) {
    i++;
    if (i >= 10000) {
      k++;
      i = 0;
    }
  }
}


x86 assembly (clang, -O0):
<larger_state_FN>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x64,-0x8(%rbp)
jge    1147 <larger_state_FN+0x47>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
cmpl   $0x2710,-0x4(%rbp)
jl     1142 <larger_state_FN+0x42>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
movl   $0x0,-0x4(%rbp)
jmp    1112 <larger_state_FN+0x12>
pop    %rbp
ret

x86 assembly (clang, -O2):
<larger_state_FN>:
xor    %eax,%eax
xor    %ecx,%ecx
xor    %edx,%edx
cs nopw 0x0(%rax,%rax,1)
xor    %esi,%esi
cmp    $0x270f,%edx
lea    0x1(%rdx),%edx
setge  %sil
cmovge %eax,%edx
add    %esi,%ecx
cmp    $0x64,%ecx
jb     1110 <larger_state_FN+0x10>
ret

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

LLVM IR (-O2):
define void @larger_state_FN() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 0, %0 ], [ %8, %1 ]
%3 = phi i32 [ 0, %0 ], [ %6, %1 ]
%4 = add nsw i32 %3, 1
%5 = icmp sgt i32 %3, 9998
%6 = select i1 %5, i32 0, i32 %4
%7 = zext i1 %5 to i32
%8 = add nuw nsw i32 %2, %7
%9 = icmp ult i32 %8, 100
br i1 %9, label %1, label %10
10: ; preds = %1
ret void
}
int screen_control(int game_state) {
  int sub_state = 0;
  while (game_state > -1) {
    if (game_state == 0) {
    } else if (game_state == 1) {
    } else if (game_state == 2) {
    } else if (game_state == 3) {
    } else if (game_state == 4) {
    } else if (game_state == 5) {
    }
  }
  return -1;
}


x86 assembly (clang, -O0):
<screen_control>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0xffffffff,-0x4(%rbp)
jle    1190 <screen_control+0x90>
cmpl   $0x0,-0x4(%rbp)
jne    1127 <screen_control+0x27>
jmp    118b <screen_control+0x8b>
cmpl   $0x1,-0x4(%rbp)
jne    1136 <screen_control+0x36>
jmp    1186 <screen_control+0x86>
cmpl   $0x2,-0x4(%rbp)
jne    1145 <screen_control+0x45>
jmp    1181 <screen_control+0x81>
cmpl   $0x3,-0x4(%rbp)
jne    1154 <screen_control+0x54>
jmp    117c <screen_control+0x7c>
cmpl   $0x4,-0x4(%rbp)
jne    1163 <screen_control+0x63>
jmp    1177 <screen_control+0x77>
cmpl   $0x5,-0x4(%rbp)
jne    1172 <screen_control+0x72>
jmp    1172 <screen_control+0x72>
jmp    1177 <screen_control+0x77>
jmp    117c <screen_control+0x7c>
jmp    1181 <screen_control+0x81>
jmp    1186 <screen_control+0x86>
jmp    118b <screen_control+0x8b>
jmp    110e <screen_control+0xe>
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<screen_control>:
test   %edi,%edi
js     1112 <screen_control+0x12>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
jmp    1110 <screen_control+0x10>
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
define i32 @screen_control(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
br label %4
4: ; preds = %36, %1
%5 = load i32, i32* %2
%6 = icmp sgt i32 %5, -1
br i1 %6, label %7, label %37
7: ; preds = %4
%8 = load i32, i32* %2
%9 = icmp eq i32 %8, 0
br i1 %9, label %10, label %11
10: ; preds = %7
br label %36
11: ; preds = %7
%12 = load i32, i32* %2
%13 = icmp eq i32 %12, 1
br i1 %13, label %14, label %15
14: ; preds = %11
br label %35
15: ; preds = %11
%16 = load i32, i32* %2
%17 = icmp eq i32 %16, 2
br i1 %17, label %18, label %19
18: ; preds = %15
br label %34
19: ; preds = %15
%20 = load i32, i32* %2
%21 = icmp eq i32 %20, 3
br i1 %21, label %22, label %23
22: ; preds = %19
br label %33
23: ; preds = %19
%24 = load i32, i32* %2
%25 = icmp eq i32 %24, 4
br i1 %25, label %26, label %27
26: ; preds = %23
br label %32
27: ; preds = %23
%28 = load i32, i32* %2
%29 = icmp eq i32 %28, 5
br i1 %29, label %30, label %31
30: ; preds = %27
br label %31
31: ; preds = %30, %27
br label %32
32: ; preds = %31, %26
br label %33
33: ; preds = %32, %22
br label %34
34: ; preds = %33, %18
br label %35
35: ; preds = %34, %14
br label %36
36: ; preds = %35, %10
br label %4
37: ; preds = %4
ret i32 -1
}

LLVM IR (-O2):
define i32 @screen_control(i32 %0) {
%2 = icmp sgt i32 %0, -1
br i1 %2, label %3, label %4
3: ; preds = %1, %3
br label %3
4: ; preds = %1
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ DEBUG_ASSERT(int);
void ComparatorConfigure(unsigned long ulBase, unsigned long ulComp,
                         unsigned long ulConfig) {
  DEBUG_ASSERT(ulBase == 0x4003C000);
  DEBUG_ASSERT(ulComp < 3);
  (*((volatile unsigned long *)(ulBase + (ulComp * 0x20) + 0x00000024))) =
      ulConfig;
}


x86 assembly (clang, -O0):
<ComparatorConfigure>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
cmpq   $0x4003c000,-0x8(%rbp)
40
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <DEBUG_ASSERT@plt>
cmpq   $0x3,-0x10(%rbp)
setb   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <DEBUG_ASSERT@plt>
mov    -0x18(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rdx
shl    $0x5,%rdx
add    %rdx,%rax
mov    %rcx,0x24(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ComparatorConfigure>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %rsi,%rbx
mov    %rdi,%r15
xor    %edi,%edi
cmp    $0x4003c000,%r15
sete   %dil
call   1030 <DEBUG_ASSERT@plt>
xor    %edi,%edi
cmp    $0x3,%rbx
setb   %dil
call   1030 <DEBUG_ASSERT@plt>
shl    $0x5,%rbx
mov    %r14,0x24(%r15,%rbx,1)
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @ComparatorConfigure(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* %4
%8 = icmp eq i64 %7, 1073987584
%9 = zext i1 %8 to i32
%10 = call i32 @DEBUG_ASSERT(i32 %9)
%11 = load i64, i64* %5
%12 = icmp ult i64 %11, 3
%13 = zext i1 %12 to i32
%14 = call i32 @DEBUG_ASSERT(i32 %13)
%15 = load i64, i64* %6
%16 = load i64, i64* %4
%17 = load i64, i64* %5
%18 = mul i64 %17, 32
%19 = add i64 %16, %18
%20 = add i64 %19, 36
%21 = inttoptr i64 %20 to i64*
store volatile i64 %15, i64* %21
ret void
}

LLVM IR (-O2):
define void @ComparatorConfigure(i64 %0, i64 %1, i64 %2) {
%4 = icmp eq i64 %0, 1073987584
%5 = zext i1 %4 to i32
%6 = tail call i32 @DEBUG_ASSERT(i32 %5)
%7 = icmp ult i64 %1, 3
%8 = zext i1 %7 to i32
%9 = tail call i32 @DEBUG_ASSERT(i32 %8)
%10 = shl i64 %1, 5
%11 = add i64 %0, 36
%12 = add i64 %11, %10
%13 = inttoptr i64 %12 to i64*
store volatile i64 %2, i64* %13
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int a = 0;
  int b = 1;
  printf("%d\n", b / a);
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 poison)
ret i32 0
}
void junk2(void) { long gtexews; }


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

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

LLVM IR (-O0):
define void @junk2() {
%1 = alloca i64
ret void
}

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


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

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

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

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


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

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

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

LLVM IR (-O2):
define void @X509_NAME_print() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
void usage(void) {
  printf("\ntron [-h] [-v] [-num num] [-rate rate] [-string string]\n\n");
  exit(0);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [59 x i8] c"\0Atron [-h] [-v] [-num num] [-rate rate] [-string string]\0A\0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@str = [58 x i8] c"\0Atron [-h] [-v] [-num num] [-rate rate] [-string string]\0A\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([58 x i8], [58 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 0)
unreachable
}
void rop3_116_0_0(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  unsigned char stk3;
  stk3 = T ^ *D;
  stk2 = S | stk3;
  stk1 = *D ^ stk2;
  *D = stk1;
}


x86 assembly (clang, -O0):
<rop3_116_0_0>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
movzbl -0xa(%rbp),%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
xor    %ecx,%eax
mov    %al,-0xd(%rbp)
movzbl -0x9(%rbp),%eax
movzbl -0xd(%rbp),%ecx
or     %ecx,%eax
mov    %al,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
movzbl -0xc(%rbp),%ecx
xor    %ecx,%eax
mov    %al,-0xb(%rbp)
mov    -0xb(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rop3_116_0_0>:
mov    (%rdi),%al
xor    %al,%dl
or     %sil,%dl
xor    %al,%dl
mov    %dl,(%rdi)
ret

LLVM IR (-O0):
define void @rop3_116_0_0(i8* %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
%9 = alloca i8
store i8* %0, i8** %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%10 = load i8, i8* %6
%11 = zext i8 %10 to i32
%12 = load i8*, i8** %4
%13 = load i8, i8* %12
%14 = zext i8 %13 to i32
%15 = xor i32 %11, %14
%16 = trunc i32 %15 to i8
store i8 %16, i8* %9
%17 = load i8, i8* %5
%18 = zext i8 %17 to i32
%19 = load i8, i8* %9
%20 = zext i8 %19 to i32
%21 = or i32 %18, %20
%22 = trunc i32 %21 to i8
store i8 %22, i8* %8
%23 = load i8*, i8** %4
%24 = load i8, i8* %23
%25 = zext i8 %24 to i32
%26 = load i8, i8* %8
%27 = zext i8 %26 to i32
%28 = xor i32 %25, %27
%29 = trunc i32 %28 to i8
store i8 %29, i8* %7
%30 = load i8, i8* %7
%31 = load i8*, i8** %4
store i8 %30, i8* %31
ret void
}

LLVM IR (-O2):
define void @rop3_116_0_0(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = load i8, i8* %0
%5 = xor i8 %4, %2
%6 = or i8 %5, %1
%7 = xor i8 %6, %4
store i8 %7, i8* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ work(int, int);
void wrong1(int n) {
#pragma omp parallel default(shared)
  {
    int i, j;
#pragma omp for
    for (i = 0; i < n; i++) {
#pragma omp for
      for (j = 0; j < n; j++)
        work(i, j);
    }
  }
}


x86 assembly (clang, -O0):
<wrong1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    116d <wrong1+0x5d>
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    115a <wrong1+0x4a>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1030 <work@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1135 <wrong1+0x25>
jmp    115f <wrong1+0x4f>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1122 <wrong1+0x12>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wrong1>:
push   %rbp
push   %r14
push   %rbx
test   %edi,%edi
jle    1149 <wrong1+0x39>
mov    %edi,%r14d
xor    %ebp,%ebp
nopl   (%rax)
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %ebp,%edi
mov    %ebx,%esi
call   1030 <work@plt>
add    $0x1,%ebx
cmp    %ebx,%r14d
jne    1130 <wrong1+0x20>
add    $0x1,%ebp
cmp    %r14d,%ebp
jne    1120 <wrong1+0x10>
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define void @wrong1(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %13
3: ; preds = %1, %10
%4 = phi i32 [ %11, %10 ], [ 0, %1 ]
br label %5
5: ; preds = %3, %5
%6 = phi i32 [ %8, %5 ], [ 0, %3 ]
%7 = tail call i32 @work(i32 %4, i32 %6)
%8 = add nuw nsw i32 %6, 1
%9 = icmp eq i32 %8, %0
br i1 %9, label %10, label %5
10: ; preds = %5
%11 = add nuw nsw i32 %4, 1
%12 = icmp eq i32 %11, %0
br i1 %12, label %13, label %3
13: ; preds = %10, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ endwin();
int /*<<< orphan*/ isendwin();
void endui(void) {
  if (!isendwin())
    endwin();
}


x86 assembly (clang, -O0):
<endui>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <isendwin@plt>
cmp    $0x0,%eax
jne    113b <endui+0x1b>
mov    $0x0,%al
call   1030 <endwin@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<endui>:
push   %rax
xor    %eax,%eax
call   1040 <isendwin@plt>
test   %eax,%eax
je     112e <endui+0xe>
pop    %rax
ret
xor    %eax,%eax
pop    %rcx
jmp    1030 <endwin@plt>

LLVM IR (-O0):
define void @endui() {
%1 = call i32 (...) @isendwin()
%2 = icmp ne i32 %1, 0
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = call i32 (...) @endwin()
br label %5
5: ; preds = %3, %0
ret void
}

LLVM IR (-O2):
define void @endui() {
%1 = tail call i32 (...) @isendwin()
%2 = icmp eq i32 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 (...) @endwin()
br label %5
5: ; preds = %3, %0
ret void
}
int in_interrupt(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @in_interrupt() {
ret i32 0
}
int double_val(int x) { return x * 2; }


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

x86 assembly (clang, -O2):
<double_val>:
lea    (%rdi,%rdi,1),%eax
ret

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

LLVM IR (-O2):
define i32 @double_val(i32 %0) {
%2 = shl nsw i32 %0, 1
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;

/* Variables and functions */
char *ctime(int /*<<< orphan*/ *);
int strlen(char *);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
char *Getdate(void) {
  int len;
  time_t t;
  char *p;
  t = time((time_t *)0);
  p = ctime(&t);
  len = strlen(p);
  *(p + len - 1) = '\0';
  return p;
}


x86 assembly (clang, -O0):
<Getdate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xor    %eax,%eax
mov    %eax,%edi
call   1050 <time@plt>
mov    %eax,-0x8(%rbp)
lea    -0x8(%rbp),%rdi
call   1030 <ctime@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,-0x4(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x4(%rbp),%rcx
movb   $0x0,-0x1(%rax,%rcx,1)
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Getdate>:
push   %rbx
sub    $0x10,%rsp
xor    %edi,%edi
call   1050 <time@plt>
mov    %eax,0xc(%rsp)
lea    0xc(%rsp),%rdi
call   1030 <ctime@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1040 <strlen@plt>
cltq
movb   $0x0,-0x1(%rbx,%rax,1)
mov    %rbx,%rax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i8* @Getdate() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i8*
%4 = call i32 @time(i32* null)
store i32 %4, i32* %2
%5 = call i8* @ctime(i32* %2)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = call i32 @strlen(i8* %6)
store i32 %7, i32* %1
%8 = load i8*, i8** %3
%9 = load i32, i32* %1
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i8, i8* %8, i64 %10
%12 = getelementptr inbounds i8, i8* %11, i64 -1
store i8 0, i8* %12
%13 = load i8*, i8** %3
ret i8* %13
}

LLVM IR (-O2):
define i8* @Getdate() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @time(i32* null)
store i32 %3, i32* %1
%4 = call i8* @ctime(i32* %1)
%5 = call i32 @strlen(i8* %4)
%6 = sext i32 %5 to i64
%7 = getelementptr inbounds i8, i8* %4, i64 %6
%8 = getelementptr inbounds i8, i8* %7, i64 -1
store i8 0, i8* %8
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ DMA2_CHANNEL4_ISR();
int /*<<< orphan*/ DMA2_CHANNEL5_ISR();
void DMA2_CHANNEL4_5_ISR(void) {
  DMA2_CHANNEL4_ISR();
  DMA2_CHANNEL5_ISR();
}


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

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

LLVM IR (-O0):
define void @DMA2_CHANNEL4_5_ISR() {
%1 = call i32 (...) @DMA2_CHANNEL4_ISR()
%2 = call i32 (...) @DMA2_CHANNEL5_ISR()
ret void
}

LLVM IR (-O2):
define void @DMA2_CHANNEL4_5_ISR() {
%1 = tail call i32 (...) @DMA2_CHANNEL4_ISR()
%2 = tail call i32 (...) @DMA2_CHANNEL5_ISR()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ kputchar(int);
void stdoutPutChar(void *p, char c) { kputchar((int)c); }


x86 assembly (clang, -O0):
<stdoutPutChar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
movsbl -0x9(%rbp),%edi
call   1030 <kputchar@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stdoutPutChar>:
mov    %esi,%edi
jmp    1030 <kputchar@plt>

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

LLVM IR (-O2):
define void @stdoutPutChar(i8* nocapture readnone %0, i8 signext %1) {
%3 = sext i8 %1 to i32
%4 = tail call i32 @kputchar(i32 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ func1();
int /*<<< orphan*/ func2();
int /*<<< orphan*/ func3();
int /*<<< orphan*/ func4();
int /*<<< orphan*/ func5();
int /*<<< orphan*/ func6();
int /*<<< orphan*/ outside_scope();
int main() {
  func1();
  func2();
  func3();
  func4();
  func5();
  func6();
  outside_scope();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1050 <func1@plt>
mov    $0x0,%al
call   1070 <func2@plt>
mov    $0x0,%al
call   1030 <func3@plt>
mov    $0x0,%al
call   1060 <func4@plt>
mov    $0x0,%al
call   1040 <func5@plt>
mov    $0x0,%al
call   1090 <func6@plt>
mov    $0x0,%al
call   1080 <outside_scope@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1050 <func1@plt>
xor    %eax,%eax
call   1070 <func2@plt>
xor    %eax,%eax
call   1030 <func3@plt>
xor    %eax,%eax
call   1060 <func4@plt>
xor    %eax,%eax
call   1040 <func5@plt>
xor    %eax,%eax
call   1090 <func6@plt>
xor    %eax,%eax
call   1080 <outside_scope@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 (...) @func1()
%2 = call i32 (...) @func2()
%3 = call i32 (...) @func3()
%4 = call i32 (...) @func4()
%5 = call i32 (...) @func5()
%6 = call i32 (...) @func6()
%7 = call i32 (...) @outside_scope()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @func1()
%2 = tail call i32 (...) @func2()
%3 = tail call i32 (...) @func3()
%4 = tail call i32 (...) @func4()
%5 = tail call i32 (...) @func5()
%6 = tail call i32 (...) @func6()
%7 = tail call i32 (...) @outside_scope()
ret i32 0
}
int test_imm_28int32_mem(int *val) {
  return ((*val) & (0x28 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_28int32_mem>:
testb  $0x28,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_28int32_mem(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* %3
%5 = and i32 %4, 40
%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_28int32_mem(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = and i32 %2, 40
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Type definitions */
struct stat {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ log_info(char *, char *);
int /*<<< orphan*/ mkpath(char *);
int stat(char *, struct stat *);
void check_path(char *path) {
  struct stat st;
  if (stat(path, &st) == -1) {
    log_info("creating directory path %s\n", path);
    mkpath(path);
  } else {
    log_info("directory path %s found\n", path);
  }
}


x86 assembly (clang, -O0):
<check_path>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <stat@plt>
cmp    $0xffffffff,%eax
jne    1170 <check_path+0x40>
mov    -0x8(%rbp),%rsi
lea    0xea3(%rip),%rdi
call   1030 <log_info@plt>
mov    -0x8(%rbp),%rdi
call   1050 <mkpath@plt>
jmp    1180 <check_path+0x50>
mov    -0x8(%rbp),%rsi
lea    0xea1(%rip),%rdi
call   1030 <log_info@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_path>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
lea    0x8(%rsp),%rsi
call   1040 <stat@plt>
cmp    $0xffffffff,%eax
je     115b <check_path+0x2b>
lea    0xece(%rip),%rdi
mov    %rbx,%rsi
add    $0x10,%rsp
pop    %rbx
jmp    1030 <log_info@plt>
lea    0xe9e(%rip),%rdi
mov    %rbx,%rsi
call   1030 <log_info@plt>
mov    %rbx,%rdi
add    $0x10,%rsp
pop    %rbx
jmp    1050 <mkpath@plt>

LLVM IR (-O0):
%struct.stat = type { i32 }
@.str = [28 x i8] c"creating directory path %s\0A\00"
@.str.1 = [25 x i8] c"directory path %s found\0A\00"
define void @check_path(i8* %0) {
%2 = alloca i8*
%3 = alloca %struct.stat
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @stat(i8* %4, %struct.stat* %3)
%6 = icmp eq i32 %5, -1
br i1 %6, label %7, label %12
7: ; preds = %1
%8 = load i8*, i8** %2
%9 = call i32 @log_info(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i8* %8)
%10 = load i8*, i8** %2
%11 = call i32 @mkpath(i8* %10)
br label %15
12: ; preds = %1
%13 = load i8*, i8** %2
%14 = call i32 @log_info(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0), i8* %13)
br label %15
15: ; preds = %12, %7
ret void
}

LLVM IR (-O2):
%struct.stat = type { i32 }
@.str = [28 x i8] c"creating directory path %s\0A\00"
@.str.1 = [25 x i8] c"directory path %s found\0A\00"
define void @check_path(i8* %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i32 @stat(i8* %0, %struct.stat* %2)
%5 = icmp eq i32 %4, -1
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = tail call i32 @log_info(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i8* %0)
%8 = tail call i32 @mkpath(i8* %0)
br label %11
9: ; preds = %1
%10 = tail call i32 @log_info(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0), i8* %0)
br label %11
11: ; preds = %9, %6
ret void
}
unsigned long long getTime(void) {
  unsigned long lo, hi;
  unsigned long long output;
  __asm__ __volatile__("xorl %%eax, %%eax\n"
                       "cpuid\n"
                       "rdtsc\n"
                       : "=a"(lo), "=d"(hi)
                       :
                       : "%ebx", "%ecx");
  output = (unsigned long long)hi << 32 | lo;
  return output;
}


x86 assembly (clang, -O0):
<getTime>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
xor    %eax,%eax
cpuid
rdtsc
mov    %rax,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rax
shl    $0x20,%rax
or     -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<getTime>:
push   %rbx
xor    %eax,%eax
cpuid
rdtsc
shl    $0x20,%rdx
or     %rdx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i64 @getTime() {
%1 = alloca i64
%2 = alloca i64
%3 = alloca i64
%4 = call { i64, i64 } asm sideeffect "xorl %eax, %eax\0Acpuid\0Ardtsc\0A", "={ax},={dx},~{ebx},~{ecx},~{dirflag},~{fpsr},~{flags}"()
%5 = extractvalue { i64, i64 } %4, 0
%6 = extractvalue { i64, i64 } %4, 1
store i64 %5, i64* %1
store i64 %6, i64* %2
%7 = load i64, i64* %2
%8 = shl i64 %7, 32
%9 = load i64, i64* %1
%10 = or i64 %8, %9
store i64 %10, i64* %3
%11 = load i64, i64* %3
ret i64 %11
}

LLVM IR (-O2):
define i64 @getTime() {
%1 = tail call { i64, i64 } asm sideeffect "xorl %eax, %eax\0Acpuid\0Ardtsc\0A", "={ax},={dx},~{ebx},~{ecx},~{dirflag},~{fpsr},~{flags}"()
%2 = extractvalue { i64, i64 } %1, 0
%3 = extractvalue { i64, i64 } %1, 1
%4 = shl i64 %3, 32
%5 = or i64 %4, %2
ret i64 %5
}
void ns_yet_another_symbol(void) {
  int i;
  for (i = 0; i < 100;)
    i++;
}


x86 assembly (clang, -O0):
<ns_yet_another_symbol>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
cmpl   $0x64,-0x4(%rbp)
jge    1123 <ns_yet_another_symbol+0x23>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    110b <ns_yet_another_symbol+0xb>
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @ns_yet_another_symbol() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int);
int /*<<< orphan*/ stderr;
void show_usage(int ret) {
  fprintf(stderr, "\nERR:%d\nUsage: omnius [msg_in_key] [msg_out_key]\n", ret);
  return;
}


x86 assembly (clang, -O0):
<show_usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2ebe(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%edx
lea    0xed2(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<show_usage>:
mov    %edi,%edx
mov    0x2ec7(%rip),%rax
mov    (%rax),%edi
lea    0xede(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [50 x i8] c"\0AERR:%d\0AUsage: omnius [msg_in_key] [msg_out_key]\0A\00"
define void @show_usage(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @stderr
%4 = load i32, i32* %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str, i64 0, i64 0), i32 %4)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [50 x i8] c"\0AERR:%d\0AUsage: omnius [msg_in_key] [msg_out_key]\0A\00"
define void @show_usage(i32 %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
/* Variables and functions */
long GetBorderHeight66();
long getborderheight() { return GetBorderHeight66(); }


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

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

LLVM IR (-O0):
define i64 @getborderheight() {
%1 = call i64 (...) @GetBorderHeight66()
ret i64 %1
}

LLVM IR (-O2):
define i64 @getborderheight() {
%1 = tail call i64 (...) @GetBorderHeight66()
ret i64 %1
}
long double test_ldexpl(long double x, int y) { return __builtin_ldexpl(x, y); }


x86 assembly (clang, -O0):
<test_ldexpl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
mov    %edi,-0x14(%rbp)
fldt   -0x10(%rbp)
mov    -0x14(%rbp),%edi
mov    %rsp,%rax
fstpt  (%rax)
call   1030 <ldexpl@plt>
fld    %st(0)
fstp   %st(0)
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_ldexpl>:
jmp    1030 <ldexpl@plt>

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

LLVM IR (-O2):
define x86_fp80 @test_ldexpl(x86_fp80 %0, i32 %1) {
%3 = tail call x86_fp80 @ldexpl(x86_fp80 %0, i32 %1)
ret x86_fp80 %3
}
int i1(int *base) { return base[-00400001]; }


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

x86 assembly (clang, -O2):
<i1>:
mov    -0x80004(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @i1(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 -131073
%5 = load i32, i32* %4
ret i32 %5
}

LLVM IR (-O2):
define i32 @i1(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 -131073
%3 = load i32, i32* %2
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ readl(void *);
uint32_t read_pxpen(unsigned port) {
  return readl((void *)0xb0010000 + (port * 0x100) + (0x70));
}


x86 assembly (clang, -O0):
<read_pxpen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x8,%eax
mov    %eax,%eax
mov    $0xb0010000,%edi
add    %rax,%rdi
add    $0x70,%rdi
call   1030 <readl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_pxpen>:
shl    $0x8,%edi
mov    $0xb0010070,%eax
add    %rax,%rdi
jmp    1030 <readl@plt>

LLVM IR (-O0):
define i32 @read_pxpen(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = mul i32 %3, 256
%5 = zext i32 %4 to i64
%6 = getelementptr i8, i8* inttoptr (i64 2952855552 to i8*), i64 %5
%7 = getelementptr i8, i8* %6, i64 112
%8 = call i32 @readl(i8* %7)
ret i32 %8
}

LLVM IR (-O2):
define i32 @read_pxpen(i32 %0) {
%2 = shl i32 %0, 8
%3 = zext i32 %2 to i64
%4 = getelementptr i8, i8* inttoptr (i64 2952855552 to i8*), i64 %3
%5 = getelementptr i8, i8* %4, i64 112
%6 = tail call i32 @readl(i8* %5)
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ __builtin_wasm_memory_init(int, int /*<<< orphan*/, void *,
                                              int, int);
void memory_init(void *dest, int offset, int size) {
  __builtin_wasm_memory_init(3, 0, dest, offset, size);
}


x86 assembly (clang, -O0):
<memory_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rdx
mov    -0xc(%rbp),%ecx
mov    -0x10(%rbp),%r8d
mov    $0x3,%edi
xor    %esi,%esi
call   1030 <__builtin_wasm_memory_init@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<memory_init>:
mov    %edx,%r8d
mov    %esi,%ecx
mov    %rdi,%rdx
mov    $0x3,%edi
xor    %esi,%esi
jmp    1030 <__builtin_wasm_memory_init@plt>

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

LLVM IR (-O2):
define void @memory_init(i8* %0, i32 %1, i32 %2) {
%4 = tail call i32 @__builtin_wasm_memory_init(i32 3, i32 0, i8* %0, i32 %1, i32 %2)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
int __syscall_setpgid(int /*<<< orphan*/, int /*<<< orphan*/);
int setpgid(pid_t pid, pid_t pgid) { return (__syscall_setpgid(pid, pgid)); }


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

x86 assembly (clang, -O2):
<setpgid>:
jmp    1030 <__syscall_setpgid@plt>

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

LLVM IR (-O2):
define i32 @setpgid(i32 %0, i32 %1) {
%3 = tail call i32 @__syscall_setpgid(i32 %0, i32 %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(char *, char const *, unsigned char);
scalar_t__ strlen(char const *);
unsigned char copy_to_pascal(char *dest, const char *src) {
  unsigned char len = (unsigned char)strlen(src);
  dest[0] = len;
  memcpy(dest + 1, src, len);
  return len;
}


x86 assembly (clang, -O0):
<copy_to_pascal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%rdi
add    $0x1,%rdi
mov    -0x10(%rbp),%rsi
mov    -0x11(%rbp),%al
movzbl %al,%edx
call   1040 <memcpy@plt>
movzbl -0x11(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<copy_to_pascal>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%rbx
mov    %rsi,%rdi
call   1030 <strlen@plt>
mov    %rax,%r15
mov    %r15b,(%rbx)
add    $0x1,%rbx
movzbl %r15b,%edx
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <memcpy@plt>
mov    %r15d,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define zeroext i8 @copy_to_pascal(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %4
%7 = call i64 @strlen(i8* %6)
%8 = trunc i64 %7 to i8
store i8 %8, i8* %5
%9 = load i8, i8* %5
%10 = load i8*, i8** %3
%11 = getelementptr inbounds i8, i8* %10, i64 0
store i8 %9, i8* %11
%12 = load i8*, i8** %3
%13 = getelementptr inbounds i8, i8* %12, i64 1
%14 = load i8*, i8** %4
%15 = load i8, i8* %5
%16 = call i32 @memcpy(i8* %13, i8* %14, i8 zeroext %15)
%17 = load i8, i8* %5
ret i8 %17
}

LLVM IR (-O2):
define zeroext i8 @copy_to_pascal(i8* %0, i8* %1) {
%3 = tail call i64 @strlen(i8* dereferenceable(1) %1)
%4 = trunc i64 %3 to i8
store i8 %4, i8* %0
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = tail call i32 @memcpy(i8* %5, i8* %1, i8 zeroext %4)
ret i8 %4
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isodigit(int);
void t_isodigit_0x8e() {
  Assert_real((isodigit(142) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isodigit.c",
              715, ("isodigit should be 0 for 0x8e"));
}


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

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

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

LLVM IR (-O2):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isodigit.c\00"
@.str.1 = [30 x i8] c"isodigit should be 0 for 0x8e\00"
define void @t_isodigit_0x8e() {
%1 = tail call i64 @isodigit(i32 142)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 715, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char);
void printMove(int n, char fromPeg, char toPeg) {
  printf("Move disk %d", n);
  printf(" from %c", fromPeg);
  printf(" to %c.\n", toPeg);
}


x86 assembly (clang, -O0):
<printMove>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dl,%al
mov    %sil,%cl
mov    %edi,-0x4(%rbp)
mov    %cl,-0x5(%rbp)
mov    %al,-0x6(%rbp)
mov    -0x4(%rbp),%eax
lea    0xed0(%rip),%rdi
movsbl %al,%esi
call   1030 <printf@plt>
lea    0xece(%rip),%rdi
movsbl -0x5(%rbp),%esi
call   1030 <printf@plt>
lea    0xec7(%rip),%rdi
movsbl -0x6(%rbp),%esi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printMove>:
push   %rbp
push   %rbx
push   %rax
mov    %edx,%ebx
mov    %esi,%ebp
movsbl %dil,%esi
lea    0xede(%rip),%rdi
call   1030 <printf@plt>
lea    0xedf(%rip),%rdi
mov    %ebp,%esi
call   1030 <printf@plt>
lea    0xeda(%rip),%rdi
mov    %ebx,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [13 x i8] c"Move disk %d\00"
@.str.1 = [9 x i8] c" from %c\00"
@.str.2 = [9 x i8] c" to %c.\0A\00"
define void @printMove(i32 %0, i8 signext %1, i8 signext %2) {
%4 = alloca i32
%5 = alloca i8
%6 = alloca i8
store i32 %0, i32* %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%7 = load i32, i32* %4
%8 = trunc i32 %7 to i8
%9 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8 signext %8)
%10 = load i8, i8* %5
%11 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i8 signext %10)
%12 = load i8, i8* %6
%13 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i8 signext %12)
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c"Move disk %d\00"
@.str.1 = [9 x i8] c" from %c\00"
@.str.2 = [9 x i8] c" to %c.\0A\00"
define void @printMove(i32 %0, i8 signext %1, i8 signext %2) {
%4 = trunc i32 %0 to i8
%5 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8 signext %4)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i8 signext %1)
%7 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i8 signext %2)
ret void
}
unsigned f1(unsigned x) { return (x % 5) % 5; }


x86 assembly (clang, -O0):
<f1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x5,%ecx
xor    %edx,%edx
div    %ecx
mov    %edx,%eax
mov    $0x5,%ecx
xor    %edx,%edx
div    %ecx
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f1>:
mov    %edi,%eax
mov    %edi,%ecx
mov    $0xcccccccd,%edx
imul   %rcx,%rdx
shr    $0x22,%rdx
lea    (%rdx,%rdx,4),%ecx
sub    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @f1(i32 %0) {
%2 = urem i32 %0, 5
ret i32 %2
}
int is_correct_length(char *egn) {
  int digit_counter = 0;
  while (egn[digit_counter] != '\0') {
    digit_counter++;
  }
  if (digit_counter > 10) {
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<is_correct_length>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1132 <is_correct_length+0x32>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    110f <is_correct_length+0xf>
cmpl   $0xa,-0x14(%rbp)
jle    1148 <is_correct_length+0x48>
movl   $0x1,-0x4(%rbp)
jmp    114f <is_correct_length+0x4f>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_correct_length>:
mov    $0xffffffff,%ecx
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%ecx
cmpb   $0x0,(%rdi)
lea    0x1(%rdi),%rdi
jne    1110 <is_correct_length+0x10>
xor    %eax,%eax
cmp    $0xb,%ecx
setae  %al
ret

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

LLVM IR (-O2):
define i32 @is_correct_length(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ %7, %2 ], [ 0, %1 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = add nuw i64 %3, 1
br i1 %6, label %8, label %2
8: ; preds = %2
%9 = trunc i64 %3 to i32
%10 = icmp ugt i32 %9, 10
%11 = zext i1 %10 to i32
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ _exit(int /*<<< orphan*/);
int main(int argc, char **argv) { _exit(0); }


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
call   1030 <_exit@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 = call i32 @_exit(i32 0)
unreachable
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @_exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf(".");
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @putchar(i32 46)
ret i32 0
}