xunge/DecIR huggingface dataset:
/* Type definitions */
typedef char uint8_t;

/* Variables and functions */
int countdelimiter(uint8_t *in_buf, char delimiter) {
  int c = 0;
  int d = 0;
  while (in_buf[c] != 0) {
    if (in_buf[c] == delimiter)
      d++;
    c++;
  }
  return d;
}


x86 assembly (clang, -O0):
<countdelimiter>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1160 <countdelimiter+0x60>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
movsbl -0x9(%rbp),%ecx
cmp    %ecx,%eax
jne    1152 <countdelimiter+0x52>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    111c <countdelimiter+0x1c>
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<countdelimiter>:
mov    (%rdi),%cl
test   %cl,%cl
je     1126 <countdelimiter+0x26>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
xor    %edx,%edx
cmp    %sil,%cl
sete   %dl
add    %edx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <countdelimiter+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @countdelimiter(i8* nocapture %0, i8 signext %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %16, label %5
5: ; preds = %2, %5
%6 = phi i64 [ %12, %5 ], [ 0, %2 ]
%7 = phi i8 [ %14, %5 ], [ %3, %2 ]
%8 = phi i32 [ %11, %5 ], [ 0, %2 ]
%9 = icmp eq i8 %7, %1
%10 = zext i1 %9 to i32
%11 = add nuw nsw i32 %8, %10
%12 = add nuw nsw i64 %6, 1
%13 = getelementptr inbounds i8, i8* %0, i64 %12
%14 = load i8, i8* %13
%15 = icmp eq i8 %14, 0
br i1 %15, label %16, label %5
16: ; preds = %5, %2
%17 = phi i32 [ 0, %2 ], [ %11, %5 ]
ret i32 %17
}
createHashIndex(int registerCode) { return registerCode % 11; }


x86 assembly (clang, -O0):
<createHashIndex>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xb,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<createHashIndex>:
movslq %edi,%rax
imul   $0x2e8ba2e9,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x21,%rcx
add    %edx,%ecx
lea    (%rcx,%rcx,4),%edx
lea    (%rcx,%rdx,2),%ecx
sub    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @createHashIndex(i32 %0) {
%2 = srem i32 %0, 11
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ DEBUG_ASSERT(int);
void I2STxRxDisable(unsigned long ulBase) {
  DEBUG_ASSERT(ulBase == 0x40054000);
  (*((volatile unsigned long *)(ulBase + 0x00000C00))) &=
      ~(0x00000001 | 0x00000002);
}


x86 assembly (clang, -O0):
<I2STxRxDisable>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x40054000,-0x8(%rbp)
40
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <DEBUG_ASSERT@plt>
mov    -0x8(%rbp),%rax
mov    0xc00(%rax),%rcx
and    $0xfffffffffffffffc,%rcx
mov    %rcx,0xc00(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<I2STxRxDisable>:
push   %rbx
mov    %rdi,%rbx
xor    %edi,%edi
cmp    $0x40054000,%rbx
sete   %dil
call   1030 <DEBUG_ASSERT@plt>
andq   $0xfffffffffffffffc,0xc00(%rbx)
fc
pop    %rbx
ret

LLVM IR (-O0):
define void @I2STxRxDisable(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = icmp eq i64 %3, 1074085888
%5 = zext i1 %4 to i32
%6 = call i32 @DEBUG_ASSERT(i32 %5)
%7 = load i64, i64* %2
%8 = add i64 %7, 3072
%9 = inttoptr i64 %8 to i64*
%10 = load volatile i64, i64* %9
%11 = and i64 %10, -4
store volatile i64 %11, i64* %9
ret void
}

LLVM IR (-O2):
define void @I2STxRxDisable(i64 %0) {
%2 = icmp eq i64 %0, 1074085888
%3 = zext i1 %2 to i32
%4 = tail call i32 @DEBUG_ASSERT(i32 %3)
%5 = add i64 %0, 3072
%6 = inttoptr i64 %5 to i64*
%7 = load volatile i64, i64* %6
%8 = and i64 %7, -4
store volatile i64 %8, i64* %6
ret void
}
/* Type definitions */
typedef unsigned int volatile uint32_t;
typedef unsigned int uint16_t;

/* Variables and functions */
__attribute__((always_)) uint32_t
mchp_espi_sram_bar_access_get(uintptr_t bar_addr) {
  return (*((volatile uint16_t *)(uintptr_t)(bar_addr)) >> 1u) & 0x03ul;
}


x86 assembly (clang, -O0):
<mchp_espi_sram_bar_access_get>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
shr    $0x1,%eax
mov    %eax,%eax
and    $0x3,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mchp_espi_sram_bar_access_get>:
mov    (%rdi),%eax
shr    %eax
and    $0x3,%eax
ret

LLVM IR (-O0):
define i32 @mchp_espi_sram_bar_access_get(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = inttoptr i64 %3 to i32*
%5 = load volatile i32, i32* %4
%6 = lshr i32 %5, 1
%7 = zext i32 %6 to i64
%8 = and i64 %7, 3
%9 = trunc i64 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @mchp_espi_sram_bar_access_get(i64 %0) {
%2 = inttoptr i64 %0 to i32*
%3 = load volatile i32, i32* %2
%4 = lshr i32 %3, 1
%5 = and i32 %4, 3
ret i32 %5
}
int isdivisable(int a, int n) {
  int i, y;
  for (i = 2; i <= n; i++) {
    if (a % i == 0 && n % i == 0) {
      y = i;
    }
  }
  return y;
}


x86 assembly (clang, -O0):
<isdivisable>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x2,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jg     1156 <isdivisable+0x56>
mov    -0x4(%rbp),%eax
cltd
idivl  -0xc(%rbp)
cmp    $0x0,%edx
jne    1143 <isdivisable+0x43>
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
cmp    $0x0,%edx
jne    1143 <isdivisable+0x43>
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    1148 <isdivisable+0x48>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1111 <isdivisable+0x11>
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isdivisable>:
cmp    $0x2,%esi
jge    1109 <isdivisable+0x9>
mov    %r9d,%eax
ret
mov    %esi,%r8d
neg    %esi
mov    $0x2,%ecx
jmp    112e <isdivisable+0x2e>
cs nopw 0x0(%rax,%rax,1)
nop
lea    (%rsi,%rcx,1),%eax
add    $0x1,%eax
add    $0x1,%ecx
cmp    $0x1,%eax
je     1105 <isdivisable+0x5>
mov    %edi,%eax
cltd
idiv   %ecx
test   %edx,%edx
jne    1120 <isdivisable+0x20>
mov    %r8d,%eax
cltd
idiv   %ecx
test   %edx,%edx
cmove  %ecx,%r9d
jmp    1120 <isdivisable+0x20>

LLVM IR (-O0):
define i32 @isdivisable(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 2, i32* %5
br label %7
7: ; preds = %24, %2
%8 = load i32, i32* %5
%9 = load i32, i32* %4
%10 = icmp sle i32 %8, %9
br i1 %10, label %11, label %27
11: ; preds = %7
%12 = load i32, i32* %3
%13 = load i32, i32* %5
%14 = srem i32 %12, %13
%15 = icmp eq i32 %14, 0
br i1 %15, label %16, label %23
16: ; preds = %11
%17 = load i32, i32* %4
%18 = load i32, i32* %5
%19 = srem i32 %17, %18
%20 = icmp eq i32 %19, 0
br i1 %20, label %21, label %23
21: ; preds = %16
%22 = load i32, i32* %5
store i32 %22, i32* %6
br label %23
23: ; preds = %21, %16, %11
br label %24
24: ; preds = %23
%25 = load i32, i32* %5
%26 = add nsw i32 %25, 1
store i32 %26, i32* %5
br label %7
27: ; preds = %7
%28 = load i32, i32* %6
ret i32 %28
}

LLVM IR (-O2):
define i32 @isdivisable(i32 %0, i32 %1) {
%3 = icmp slt i32 %1, 2
br i1 %3, label %17, label %4
4: ; preds = %2, %13
%5 = phi i32 [ %14, %13 ], [ undef, %2 ]
%6 = phi i32 [ %15, %13 ], [ 2, %2 ]
%7 = srem i32 %0, %6
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %13
9: ; preds = %4
%10 = srem i32 %1, %6
%11 = icmp eq i32 %10, 0
%12 = select i1 %11, i32 %6, i32 %5
br label %13
13: ; preds = %9, %4
%14 = phi i32 [ %5, %4 ], [ %12, %9 ]
%15 = add nuw i32 %6, 1
%16 = icmp eq i32 %6, %1
br i1 %16, label %17, label %4
17: ; preds = %13, %2
%18 = phi i32 [ undef, %2 ], [ %14, %13 ]
ret i32 %18
}
double Sleef_acos_u35(double x) { return __builtin_acos(x); }


x86 assembly (clang, -O0):
<Sleef_acos_u35>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <acos@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Sleef_acos_u35>:
jmp    1030 <acos@plt>

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

LLVM IR (-O2):
define double @Sleef_acos_u35(double %0) {
%2 = tail call double @acos(double %0)
ret double %2
}
int parent(int index) {
  if (index == 0)
    return 0;
  return (index - 1) / 2;
}


x86 assembly (clang, -O0):
<parent>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    111d <parent+0x1d>
movl   $0x0,-0x4(%rbp)
jmp    112e <parent+0x2e>
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<parent>:
test   %edi,%edi
je     1114 <parent+0x14>
mov    %edi,%eax
add    $0xffffffff,%eax
shr    $0x1f,%eax
add    %edi,%eax
add    $0xffffffff,%eax
sar    %eax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @parent(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %6, label %3
3: ; preds = %1
%4 = add nsw i32 %0, -1
%5 = sdiv i32 %4, 2
br label %6
6: ; preds = %1, %3
%7 = phi i32 [ %5, %3 ], [ 0, %1 ]
ret i32 %7
}
unsigned MUTEX_ENTER(unsigned volatile *x) {
  return __sync_lock_test_and_set(x, 0xFF);
}


x86 assembly (clang, -O0):
<MUTEX_ENTER>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rcx
mov    $0xff,%eax
xchg   %eax,(%rcx)
pop    %rbp
ret

x86 assembly (clang, -O2):
<MUTEX_ENTER>:
mov    $0xff,%eax
xchg   %eax,(%rdi)
ret

LLVM IR (-O0):
define i32 @MUTEX_ENTER(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = atomicrmw xchg i32* %3, i32 255 seq_cst
ret i32 %4
}

LLVM IR (-O2):
define i32 @MUTEX_ENTER(i32* nocapture %0) {
%2 = atomicrmw xchg i32* %0, i32 255 seq_cst
ret i32 %2
}
/* Variables and functions */
int rand();
int powerNudgeHealth(int hp) {
  if ((rand() % 10) >= 8)
    return hp * 2;
  else
    return hp / 2;
}


x86 assembly (clang, -O0):
<powerNudgeHealth>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
mov    $0xa,%ecx
cltd
idiv   %ecx
cmp    $0x8,%edx
jl     1141 <powerNudgeHealth+0x31>
mov    -0x8(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    114f <powerNudgeHealth+0x3f>
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<powerNudgeHealth>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <rand@plt>
cltq
imul   $0x66666667,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x22,%rcx
add    %edx,%ecx
add    %ecx,%ecx
lea    (%rcx,%rcx,4),%ecx
sub    %ecx,%eax
cmp    $0x8,%eax
jl     1140 <powerNudgeHealth+0x30>
add    %ebx,%ebx
jmp    114b <powerNudgeHealth+0x3b>
mov    %ebx,%eax
shr    $0x1f,%eax
add    %ebx,%eax
sar    %eax
mov    %eax,%ebx
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @powerNudgeHealth(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = call i32 (...) @rand()
%5 = srem i32 %4, 10
%6 = icmp sge i32 %5, 8
br i1 %6, label %7, label %10
7: ; preds = %1
%8 = load i32, i32* %3
%9 = mul nsw i32 %8, 2
store i32 %9, i32* %2
br label %13
10: ; preds = %1
%11 = load i32, i32* %3
%12 = sdiv i32 %11, 2
store i32 %12, i32* %2
br label %13
13: ; preds = %10, %7
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
define i32 @powerNudgeHealth(i32 %0) {
%2 = tail call i32 (...) @rand()
%3 = srem i32 %2, 10
%4 = icmp sgt i32 %3, 7
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = shl nsw i32 %0, 1
br label %9
7: ; preds = %1
%8 = sdiv i32 %0, 2
br label %9
9: ; preds = %7, %5
%10 = phi i32 [ %6, %5 ], [ %8, %7 ]
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ glutEntryFunc(int /*<<< orphan*/ *);
int /*<<< orphan*/ glutKeyboardFunc(int /*<<< orphan*/ *);
int /*<<< orphan*/ glutMotionFunc(int /*<<< orphan*/ *);
int /*<<< orphan*/ glutMouseFunc(int /*<<< orphan*/ *);
int /*<<< orphan*/ glutReshapeFunc(int /*<<< orphan*/ *);
int /*<<< orphan*/ glutSpecialFunc(int /*<<< orphan*/ *);
int /*<<< orphan*/ glutVisibilityFunc(int /*<<< orphan*/ *);
void removeCallbacks(void) {
  glutVisibilityFunc(NULL);
  glutReshapeFunc(NULL);
  glutKeyboardFunc(NULL);
  glutSpecialFunc(NULL);
  glutMouseFunc(NULL);
  glutMotionFunc(NULL);
  glutEntryFunc(NULL);
}


x86 assembly (clang, -O0):
<removeCallbacks>:
push   %rbp
mov    %rsp,%rbp
xor    %eax,%eax
mov    %eax,%edi
call   1050 <glutVisibilityFunc@plt>
xor    %eax,%eax
mov    %eax,%edi
call   1030 <glutReshapeFunc@plt>
xor    %eax,%eax
mov    %eax,%edi
call   1070 <glutKeyboardFunc@plt>
xor    %eax,%eax
mov    %eax,%edi
call   1080 <glutSpecialFunc@plt>
xor    %eax,%eax
mov    %eax,%edi
call   1090 <glutMouseFunc@plt>
xor    %eax,%eax
mov    %eax,%edi
call   1040 <glutMotionFunc@plt>
xor    %eax,%eax
mov    %eax,%edi
call   1060 <glutEntryFunc@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<removeCallbacks>:
push   %rax
xor    %edi,%edi
call   1050 <glutVisibilityFunc@plt>
xor    %edi,%edi
call   1030 <glutReshapeFunc@plt>
xor    %edi,%edi
call   1070 <glutKeyboardFunc@plt>
xor    %edi,%edi
call   1080 <glutSpecialFunc@plt>
xor    %edi,%edi
call   1090 <glutMouseFunc@plt>
xor    %edi,%edi
call   1040 <glutMotionFunc@plt>
xor    %edi,%edi
pop    %rax
jmp    1060 <glutEntryFunc@plt>

LLVM IR (-O0):
define void @removeCallbacks() {
%1 = call i32 @glutVisibilityFunc(i32* null)
%2 = call i32 @glutReshapeFunc(i32* null)
%3 = call i32 @glutKeyboardFunc(i32* null)
%4 = call i32 @glutSpecialFunc(i32* null)
%5 = call i32 @glutMouseFunc(i32* null)
%6 = call i32 @glutMotionFunc(i32* null)
%7 = call i32 @glutEntryFunc(i32* null)
ret void
}

LLVM IR (-O2):
define void @removeCallbacks() {
%1 = tail call i32 @glutVisibilityFunc(i32* null)
%2 = tail call i32 @glutReshapeFunc(i32* null)
%3 = tail call i32 @glutKeyboardFunc(i32* null)
%4 = tail call i32 @glutSpecialFunc(i32* null)
%5 = tail call i32 @glutMouseFunc(i32* null)
%6 = tail call i32 @glutMotionFunc(i32* null)
%7 = tail call i32 @glutEntryFunc(i32* null)
ret void
}
/* Variables and functions */
int getFanState(char const *);
int /*<<< orphan*/ output(char *, int);
void printFanState(const char *cmd) {
  int fan_state = getFanState(cmd);
  output("%d\n", fan_state);
}


x86 assembly (clang, -O0):
<printFanState>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <getFanState@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%esi
lea    0xebe(%rip),%rdi
call   1030 <output@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printFanState>:
push   %rax
call   1040 <getFanState@plt>
lea    0xed3(%rip),%rdi
mov    %eax,%esi
pop    %rax
jmp    1030 <output@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define void @printFanState(i8* %0) {
%2 = tail call i32 @getFanState(i8* %0)
%3 = tail call i32 @output(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %2)
ret void
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ printf(char *, char *);
int main(void) {
  char a[0];
  printf("%p\n", a);
  return EXIT_SUCCESS;
}


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%p\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca [0 x i8]
%2 = getelementptr inbounds [0 x i8], [0 x i8]* %1, i64 0, i64 0
%3 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = load i32, i32* @EXIT_SUCCESS
ret i32 %4
}
void fd56(int n) {
P0A:
  goto P0A;
  {
    typedef int(*b)[n];
  P01A:
    goto P01A;
    {
      typedef int(*c)[n];
    P012A:
      goto P012A;
      0;
    }
  p01B:
    goto p01B;
    goto a;
  P01B:
    goto P01B;
    {
      typedef int(*d)[n];
    P013A:
      goto P013A;
      0;
    }
  a:;
    typedef int(*e)[n];
  P014A:
    goto P014A;
    0;
  };
P0B:
  goto P0B;
  {
    typedef int(*f)[n];
  P02A:
    goto P02A;
    {
      typedef int(*g)[n];
    P024A:
      goto P024A;
      0;
    };
  P02B:
    goto P02B;
    {
      typedef int(*h)[n];
    P025A:
      goto P025A;
      0;
    };
  P02C:
    goto P02C;
    ;
    typedef int(*i)[n];
  P026A:
    goto P026A;
    0;
  };
P0C:
  goto P0C;
  ;
  typedef int(*j)[n];
P03A:
  goto P03A;
  0;
P03B:
  goto P03B;
}


x86 assembly (clang, -O0):
<fd56>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
jmp    1107 <fd56+0x7>

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

LLVM IR (-O0):
define void @fd56(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
br label %3
3: ; preds = %3, %1
br label %3
4: ; No predecessors!
%5 = load i32, i32* %2
%6 = zext i32 %5 to i64
br label %7
7: ; preds = %7, %4
br label %7
8: ; No predecessors!
%9 = load i32, i32* %2
%10 = zext i32 %9 to i64
br label %11
11: ; preds = %11, %8
br label %11
12: ; preds = %12
br label %12
13: ; preds = %13
br label %13
14: ; No predecessors!
%15 = load i32, i32* %2
%16 = zext i32 %15 to i64
br label %17
17: ; preds = %17, %14
br label %17
18: ; No predecessors!
%19 = load i32, i32* %2
%20 = zext i32 %19 to i64
br label %21
21: ; preds = %21, %18
br label %21
22: ; preds = %22
br label %22
23: ; No predecessors!
%24 = load i32, i32* %2
%25 = zext i32 %24 to i64
br label %26
26: ; preds = %26, %23
br label %26
27: ; No predecessors!
%28 = load i32, i32* %2
%29 = zext i32 %28 to i64
br label %30
30: ; preds = %30, %27
br label %30
31: ; preds = %31
br label %31
32: ; No predecessors!
%33 = load i32, i32* %2
%34 = zext i32 %33 to i64
br label %35
35: ; preds = %35, %32
br label %35
36: ; preds = %36
br label %36
37: ; No predecessors!
%38 = load i32, i32* %2
%39 = zext i32 %38 to i64
br label %40
40: ; preds = %40, %37
br label %40
41: ; preds = %41
br label %41
42: ; No predecessors!
%43 = load i32, i32* %2
%44 = zext i32 %43 to i64
br label %45
45: ; preds = %45, %42
br label %45
46: ; preds = %46
br label %46
}

LLVM IR (-O2):
define void @fd56(i32 %0) {
br label %2
2: ; preds = %2, %1
br label %2
}
/* Variables and functions */
int bd_register_fops();
int init_module(void) { return bd_register_fops(); }


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

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

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

LLVM IR (-O2):
define i32 @init_module() {
%1 = tail call i32 (...) @bd_register_fops()
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(void *, void *, int);
void mus_ulshort_to_char(unsigned char *j, unsigned short x) {
  unsigned char *ox = (unsigned char *)&x;
  memcpy((void *)j, (void *)ox, 2);
}


x86 assembly (clang, -O0):
<mus_ulshort_to_char>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %si,%ax
mov    %rdi,-0x8(%rbp)
mov    %ax,-0xa(%rbp)
lea    -0xa(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    $0x2,%edx
call   1030 <memcpy@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mus_ulshort_to_char>:
push   %rax
mov    %si,0x6(%rsp)
lea    0x6(%rsp),%rsi
mov    $0x2,%edx
call   1030 <memcpy@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @mus_ulshort_to_char(i8* %0, i16 zeroext %1) {
%3 = alloca i8*
%4 = alloca i16
%5 = alloca i8*
store i8* %0, i8** %3
store i16 %1, i16* %4
%6 = bitcast i16* %4 to i8*
store i8* %6, i8** %5
%7 = load i8*, i8** %3
%8 = load i8*, i8** %5
%9 = call i32 @memcpy(i8* %7, i8* %8, i32 2)
ret void
}

LLVM IR (-O2):
define void @mus_ulshort_to_char(i8* %0, i16 zeroext %1) {
%3 = alloca i16
store i16 %1, i16* %3
%4 = bitcast i16* %3 to i8*
%5 = call i32 @memcpy(i8* %0, i8* %4, i32 2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void eighteen(const int k) {
  int tmp = k;
  tmp = k * k;
  tmp += tmp;
  tmp *= tmp;
  tmp -= 1;
  printf("Result: %d\n", tmp);
}


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

x86 assembly (clang, -O2):
<eighteen>:
imul   %edi,%edi
lea    (%rdi,%rdi,1),%esi
imul   %esi,%esi
add    $0xffffffff,%esi
lea    0xedd(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"Result: %d\0A\00"
define void @eighteen(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
store i32 %4, i32* %3
%5 = load i32, i32* %2
%6 = load i32, i32* %2
%7 = mul nsw i32 %5, %6
store i32 %7, i32* %3
%8 = load i32, i32* %3
%9 = load i32, i32* %3
%10 = add nsw i32 %9, %8
store i32 %10, i32* %3
%11 = load i32, i32* %3
%12 = load i32, i32* %3
%13 = mul nsw i32 %12, %11
store i32 %13, i32* %3
%14 = load i32, i32* %3
%15 = sub nsw i32 %14, 1
store i32 %15, i32* %3
%16 = load i32, i32* %3
%17 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %16)
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"Result: %d\0A\00"
define void @eighteen(i32 %0) {
%2 = shl i32 %0, 1
%3 = mul i32 %2, %0
%4 = mul nsw i32 %3, %3
%5 = add nsw i32 %4, -1
%6 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %5)
ret void
}
/* Variables and functions */
int delDigitals(char *);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, char *);
int main() {
  char str[256];
  printf("input the string(max len 255): ");
  scanf("%[^\n]", str);
  int num = delDigitals(str);
  printf("Del %d numbers in str:%s\n", num, str);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x120,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeb7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x110(%rbp),%rsi
lea    0xec2(%rip),%rdi
call   1050 <scanf@plt>
lea    -0x110(%rbp),%rdi
call   1040 <delDigitals@plt>
mov    %eax,-0x114(%rbp)
mov    -0x114(%rbp),%esi
lea    -0x110(%rbp),%rdx
lea    0xe9d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x120,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x100,%rsp
lea    0xec1(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xed3(%rip),%rdi
mov    %rsp,%rbx
mov    %rbx,%rsi
call   1050 <scanf@plt>
mov    %rbx,%rdi
call   1040 <delDigitals@plt>
lea    0xebf(%rip),%rdi
mov    %eax,%esi
mov    %rbx,%rdx
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x100,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [32 x i8] c"input the string(max len 255): \00"
@.str.1 = [6 x i8] c"%[^\0A]\00"
@.str.2 = [26 x i8] c"Del %d numbers in str:%s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [256 x i8]
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
%5 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 0
%6 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* %5)
%7 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 0
%8 = call i32 @delDigitals(i8* %7)
store i32 %8, i32* %3
%9 = load i32, i32* %3
%10 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 0
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.2, i64 0, i64 0), i32 %9, i8* %10)
ret i32 0
}

LLVM IR (-O2):
@.str = [32 x i8] c"input the string(max len 255): \00"
@.str.1 = [6 x i8] c"%[^\0A]\00"
@.str.2 = [26 x i8] c"Del %d numbers in str:%s\0A\00"
define i32 @main() {
%1 = alloca [256 x i8]
%2 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* %2)
%5 = call i32 @delDigitals(i8* %2)
%6 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str.2, i64 0, i64 0), i32 %5, i8* %2)
ret i32 0
}
int get_salt_size(void) { return 160; }


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

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

LLVM IR (-O0):
define i32 @get_salt_size() {
ret i32 160
}

LLVM IR (-O2):
define i32 @get_salt_size() {
ret i32 160
}
int maze_solve_parse(int i, int argc, char *argv[]) { return i; }


x86 assembly (clang, -O0):
<maze_solve_parse>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @maze_solve_parse(i32 %0, i32 %1, i8** %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8**
store i32 %0, i32* %4
store i32 %1, i32* %5
store i8** %2, i8*** %6
%7 = load i32, i32* %4
ret i32 %7
}

LLVM IR (-O2):
define i32 @maze_solve_parse(i32 returned %0, i32 %1, i8** nocapture readnone %2) {
ret i32 %0
}
int fix_offset(int offset) {
  offset = (offset + 16384) % 16384;
  if (offset < 0) {
    offset += 16384;
  }
  return offset;
}


x86 assembly (clang, -O0):
<fix_offset>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x4000,%eax
mov    $0x4000,%ecx
cltd
idiv   %ecx
mov    %edx,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    112f <fix_offset+0x2f>
mov    -0x4(%rbp),%eax
add    $0x4000,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fix_offset>:
lea    0x4000(%rdi),%ecx
lea    0x7fff(%rdi),%eax
test   %ecx,%ecx
cmovns %ecx,%eax
and    $0xffffc000,%eax
sub    %eax,%ecx
neg    %eax
test   %ecx,%ecx
lea    0x8000(%rdi,%rax,1),%eax
cmovns %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @fix_offset(i32 %0) {
%2 = add nsw i32 %0, 16384
%3 = srem i32 %2, 16384
%4 = icmp slt i32 %3, 0
%5 = add nsw i32 %3, 16384
%6 = select i1 %4, i32 %5, i32 %3
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ serialWriteRaw(int, char *, int);
void serialWriteChar(int fd, char c) { serialWriteRaw(fd, &c, 1); }


x86 assembly (clang, -O0):
<serialWriteChar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %edi,-0x4(%rbp)
mov    %al,-0x5(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x5(%rbp),%rsi
mov    $0x1,%edx
call   1030 <serialWriteRaw@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<serialWriteChar>:
push   %rax
mov    %sil,0x7(%rsp)
lea    0x7(%rsp),%rsi
mov    $0x1,%edx
call   1030 <serialWriteRaw@plt>
pop    %rax
ret

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

LLVM IR (-O2):
define void @serialWriteChar(i32 %0, i8 signext %1) {
%3 = alloca i8
store i8 %1, i8* %3
%4 = call i32 @serialWriteRaw(i32 %0, i8* %3, i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ mywarnx(char *);
void zeroerror(void) { mywarnx("Unit reduces to zero"); }


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

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

LLVM IR (-O0):
@.str = [21 x i8] c"Unit reduces to zero\00"
define void @zeroerror() {
%1 = call i32 @mywarnx(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [21 x i8] c"Unit reduces to zero\00"
define void @zeroerror() {
%1 = tail call i32 @mywarnx(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
ret void
}
void putDebugChar(int c) {
  while (((*((char *)0xe0000)) & 0x7) != 0x7)
    ;
  *((char *)(0xe0000 + 3)) = c;
}


x86 assembly (clang, -O0):
<putDebugChar>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0xe0000,%eax
movsbl (%rax),%eax
and    $0x7,%eax
cmp    $0x7,%eax
je     1120 <putDebugChar+0x20>
jmp    1107 <putDebugChar+0x7>
mov    -0x4(%rbp),%eax
mov    %al,%cl
mov    $0xe0003,%eax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<putDebugChar>:
mov    0xe0000,%al
not    %al
test   $0x7,%al
jne    1120 <putDebugChar+0x20>
mov    %dil,0xe0003
ret
cs nopw 0x0(%rax,%rax,1)
jmp    1120 <putDebugChar+0x20>

LLVM IR (-O0):
define void @putDebugChar(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
br label %3
3: ; preds = %8, %1
%4 = load i8, i8* inttoptr (i64 917504 to i8*)
%5 = sext i8 %4 to i32
%6 = and i32 %5, 7
%7 = icmp ne i32 %6, 7
br i1 %7, label %8, label %9
8: ; preds = %3
br label %3
9: ; preds = %3
%10 = load i32, i32* %2
%11 = trunc i32 %10 to i8
store i8 %11, i8* inttoptr (i64 917507 to i8*)
ret void
}

LLVM IR (-O2):
define void @putDebugChar(i32 %0) {
%2 = load i8, i8* inttoptr (i64 917504 to i8*)
%3 = and i8 %2, 7
%4 = icmp eq i8 %3, 7
br i1 %4, label %6, label %5
5: ; preds = %1, %5
br label %5
6: ; preds = %1
%7 = trunc i32 %0 to i8
store i8 %7, i8* inttoptr (i64 917507 to i8*)
ret void
}
int maxVal(int a, int b) { return (a > b ? a : b); }


x86 assembly (clang, -O0):
<maxVal>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jle    1121 <maxVal+0x21>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1127 <maxVal+0x27>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<maxVal>:
mov    %esi,%eax
cmp    %esi,%edi
cmovg  %edi,%eax
ret

LLVM IR (-O0):
define i32 @maxVal(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 = icmp sgt i32 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i32, i32* %3
br label %12
10: ; preds = %2
%11 = load i32, i32* %4
br label %12
12: ; preds = %10, %8
%13 = phi i32 [ %9, %8 ], [ %11, %10 ]
ret i32 %13
}

LLVM IR (-O2):
define i32 @maxVal(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
/* Variables and functions */
int howmany(int, int);
int /*<<< orphan*/ memset(unsigned long *, int /*<<< orphan*/, int);
void bitmap_zero(unsigned long *addr, int size) {
  int len;
  len = howmany((size), 64) * sizeof(long);
  memset(addr, 0, len);
}


x86 assembly (clang, -O0):
<bitmap_zero>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%edi
mov    $0x40,%esi
call   1040 <howmany@plt>
cltq
shl    $0x3,%rax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%edx
xor    %esi,%esi
call   1030 <memset@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bitmap_zero>:
push   %rbx
mov    %rdi,%rbx
mov    %esi,%edi
mov    $0x40,%esi
call   1040 <howmany@plt>
lea    0x0(,%rax,8),%edx
mov    %rbx,%rdi
xor    %esi,%esi
pop    %rbx
jmp    1030 <memset@plt>

LLVM IR (-O0):
define void @bitmap_zero(i64* %0, i32 %1) {
%3 = alloca i64*
%4 = alloca i32
%5 = alloca i32
store i64* %0, i64** %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
%7 = call i32 @howmany(i32 %6, i32 64)
%8 = sext i32 %7 to i64
%9 = mul i64 %8, 8
%10 = trunc i64 %9 to i32
store i32 %10, i32* %5
%11 = load i64*, i64** %3
%12 = load i32, i32* %5
%13 = call i32 @memset(i64* %11, i32 0, i32 %12)
ret void
}

LLVM IR (-O2):
define void @bitmap_zero(i64* %0, i32 %1) {
%3 = tail call i32 @howmany(i32 %1, i32 64)
%4 = shl i32 %3, 3
%5 = tail call i32 @memset(i64* %0, i32 0, i32 %4)
ret void
}
const char (*g())[] { return &__FUNCTION__; }


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

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

LLVM IR (-O0):
@__FUNCTION__.g = [2 x i8] c"g\00"
define [0 x i8]* @g() {
ret [0 x i8]* bitcast ([2 x i8]* @__FUNCTION__.g to [0 x i8]*)
}

LLVM IR (-O2):
@__FUNCTION__.g = [2 x i8] c"g\00"
define [0 x i8]* @g() {
ret [0 x i8]* bitcast ([2 x i8]* @__FUNCTION__.g to [0 x i8]*)
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, char const *);
int /*<<< orphan*/ *stderr;
int /*<<< orphan*/ *stdout;
void helpAndExit(const char *progname, int status) {
  FILE *stream = stderr;
  ;
  if (status == EXIT_SUCCESS)
    stream = stdout;
  fprintf(stream, "Usage: %s [src] [dst]\n", progname);
  exit(status);
}


x86 assembly (clang, -O0):
<helpAndExit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    0x2eaa(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
mov    0x2e89(%rip),%rcx
cmp    (%rcx),%eax
jne    115d <helpAndExit+0x3d>
mov    0x2e82(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rdx
lea    0xe94(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0xc(%rbp),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<helpAndExit>:
push   %rbx
mov    %esi,%ebx
mov    %rdi,%rdx
mov    0x2ea3(%rip),%rax
cmp    %esi,(%rax)
jne    113a <helpAndExit+0x1a>
mov    0x2ea0(%rip),%rax
jmp    1141 <helpAndExit+0x21>
mov    0x2e9f(%rip),%rax
mov    (%rax),%rdi
lea    0xeb5(%rip),%rsi
call   1030 <fprintf@plt>
mov    %ebx,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32* null
@EXIT_SUCCESS = global i32 0
@stdout = global i32* null
@.str = [23 x i8] c"Usage: %s [src] [dst]\0A\00"
define void @helpAndExit(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** @stderr
store i32* %6, i32** %5
%7 = load i32, i32* %4
%8 = load i32, i32* @EXIT_SUCCESS
%9 = icmp eq i32 %7, %8
br i1 %9, label %10, label %12
10: ; preds = %2
%11 = load i32*, i32** @stdout
store i32* %11, i32** %5
br label %12
12: ; preds = %10, %2
%13 = load i32*, i32** %5
%14 = load i8*, i8** %3
%15 = call i32 @fprintf(i32* %13, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* %14)
%16 = load i32, i32* %4
%17 = call i32 @exit(i32 %16)
unreachable
}

LLVM IR (-O2):
@stderr = global i32* null
@EXIT_SUCCESS = global i32 0
@stdout = global i32* null
@.str = [23 x i8] c"Usage: %s [src] [dst]\0A\00"
define void @helpAndExit(i8* %0, i32 %1) {
%3 = load i32, i32* @EXIT_SUCCESS
%4 = icmp eq i32 %3, %1
%5 = load i32*, i32** @stdout
%6 = load i32*, i32** @stderr
%7 = select i1 %4, i32* %5, i32* %6
%8 = tail call i32 @fprintf(i32* %7, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* %0)
%9 = tail call i32 @exit(i32 %1)
unreachable
}
void rop3_150_0_0(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  stk2 = T ^ S;
  stk1 = *D ^ stk2;
  *D = stk1;
}


x86 assembly (clang, -O0):
<rop3_150_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
movzbl -0x9(%rbp),%ecx
xor    %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_150_0_0>:
xor    %edx,%esi
xor    %sil,(%rdi)
ret

LLVM IR (-O0):
define void @rop3_150_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
store i8* %0, i8** %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%9 = load i8, i8* %6
%10 = zext i8 %9 to i32
%11 = load i8, i8* %5
%12 = zext i8 %11 to i32
%13 = xor i32 %10, %12
%14 = trunc i32 %13 to i8
store i8 %14, i8* %8
%15 = load i8*, i8** %4
%16 = load i8, i8* %15
%17 = zext i8 %16 to i32
%18 = load i8, i8* %8
%19 = zext i8 %18 to i32
%20 = xor i32 %17, %19
%21 = trunc i32 %20 to i8
store i8 %21, i8* %7
%22 = load i8, i8* %7
%23 = load i8*, i8** %4
store i8 %22, i8* %23
ret void
}

LLVM IR (-O2):
define void @rop3_150_0_0(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = xor i8 %2, %1
%5 = load i8, i8* %0
%6 = xor i8 %4, %5
store i8 %6, i8* %0
ret void
}
void *ghcjs_currentDocument() { return 0; }


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

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

LLVM IR (-O0):
define i8* @ghcjs_currentDocument() {
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @ghcjs_currentDocument() {
ret i8* null
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void arrayPrint(int a[], int arraySize) {
  for (int i = 0; i < arraySize; i++) {
    printf("%i ", a[i]);
  }
  printf("\n");
}


x86 assembly (clang, -O0):
<arrayPrint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1159 <arrayPrint+0x49>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xebc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <arrayPrint+0x16>
lea    0xea4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<arrayPrint>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1157 <arrayPrint+0x37>
mov    %rdi,%r15
mov    %esi,%r12d
lea    0xec7(%rip),%r14
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
mov    (%r15,%rbx,4),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1140 <arrayPrint+0x20>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%i \00"
define void @arrayPrint(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %8
6: ; preds = %8, %2
%7 = tail call i32 @putchar(i32 10)
ret void
8: ; preds = %4, %8
%9 = phi i64 [ 0, %4 ], [ %13, %8 ]
%10 = getelementptr inbounds i32, i32* %0, i64 %9
%11 = load i32, i32* %10
%12 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %11)
%13 = add nuw nsw i64 %9, 1
%14 = icmp eq i64 %13, %5
br i1 %14, label %6, label %8
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ isalpha(int);
void t_isalpha_0x73() {
  Assert_real((isalpha(115)),
              "/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_isalpha.c",
              580, ("isalpha should be 1 for s"));
}


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

x86 assembly (clang, -O2):
<t_isalpha_0x73>:
push   %rax
mov    $0x73,%edi
call   1030 <isalpha@plt>
lea    0xece(%rip),%rsi
lea    0xf6f(%rip),%rcx
mov    %eax,%edi
mov    $0x244,%edx
pop    %rax
jmp    1040 <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_isalpha.c\00"
@.str.1 = [26 x i8] c"isalpha should be 1 for s\00"
define void @t_isalpha_0x73() {
%1 = call i32 @isalpha(i32 115)
%2 = call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 580, 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_isalpha.c\00"
@.str.1 = [26 x i8] c"isalpha should be 1 for s\00"
define void @t_isalpha_0x73() {
%1 = tail call i32 @isalpha(i32 115)
%2 = tail call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 580, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
double fpower(double base, int n) {
  if (n == 0)
    return 1;
  else
    return base * fpower(base, n - 1);
}


x86 assembly (clang, -O0):
<fpower>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x10(%rbp)
mov    %edi,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jne    113c <fpower+0x2c>
movsd  0xece(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1167 <fpower+0x57>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x10(%rbp),%xmm0
mov    -0x14(%rbp),%edi
sub    $0x1,%edi
call   1030 <fpower@plt>
movaps %xmm0,%xmm1
movsd  -0x20(%rbp),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fpower>:
push   %rax
test   %edi,%edi
je     1129 <fpower+0x19>
add    $0xffffffff,%edi
movsd  %xmm0,(%rsp)
call   1030 <fpower@plt>
mulsd  (%rsp),%xmm0
pop    %rax
ret
movsd  0xecf(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @fpower(double %0, i32 %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca i32
store double %0, double* %4
store i32 %1, i32* %5
%6 = load i32, i32* %5
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %2
store double 1.000000e+00, double* %3
br label %16
9: ; preds = %2
%10 = load double, double* %4
%11 = load double, double* %4
%12 = load i32, i32* %5
%13 = sub nsw i32 %12, 1
%14 = call double @fpower(double %11, i32 %13)
%15 = fmul double %10, %14
store double %15, double* %3
br label %16
16: ; preds = %9, %8
%17 = load double, double* %3
ret double %17
}

LLVM IR (-O2):
define double @fpower(double %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %4, label %6
4: ; preds = %2, %6
%5 = phi double [ %9, %6 ], [ 1.000000e+00, %2 ]
ret double %5
6: ; preds = %2
%7 = add nsw i32 %1, -1
%8 = tail call double @fpower(double %0, i32 %7)
%9 = fmul double %8, %0
br label %4
}