xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ size;

/* Variables and functions */
int strlen(char *);
int /*<<< orphan*/ write(int, ...);
int sendCmd(int ctrlSocket, char *cmd) {
  int size = strlen(cmd);
  write(ctrlSocket, &size, sizeof(size));
  write(ctrlSocket, cmd, strlen(cmd));
  return 0;
}


x86 assembly (clang, -O0):
<sendCmd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,-0x14(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x14(%rbp),%rsi
mov    $0x4,%edx
mov    $0x0,%al
call   1030 <write@plt>
mov    -0x4(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x24(%rbp),%edi
mov    -0x20(%rbp),%rsi
mov    %eax,%edx
mov    $0x0,%al
call   1030 <write@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sendCmd>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
mov    %rsi,%rdi
call   1040 <strlen@plt>
mov    %eax,0x4(%rsp)
lea    0x4(%rsp),%rsi
mov    $0x4,%edx
mov    %ebp,%edi
xor    %eax,%eax
call   1030 <write@plt>
mov    %rbx,%rdi
call   1040 <strlen@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %eax,%edx
xor    %eax,%eax
call   1030 <write@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @sendCmd(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i32
store i32 %0, i32* %3
store i8* %1, i8** %4
%6 = load i8*, i8** %4
%7 = call i32 @strlen(i8* %6)
store i32 %7, i32* %5
%8 = load i32, i32* %3
%9 = call i32 (i32, ...) @write(i32 %8, i32* %5, i64 4)
%10 = load i32, i32* %3
%11 = load i8*, i8** %4
%12 = load i8*, i8** %4
%13 = call i32 @strlen(i8* %12)
%14 = call i32 (i32, ...) @write(i32 %10, i8* %11, i32 %13)
ret i32 0
}

LLVM IR (-O2):
define i32 @sendCmd(i32 %0, i8* %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = tail call i32 @strlen(i8* %1)
store i32 %5, i32* %3
%6 = call i32 (i32, ...) @write(i32 %0, i32* %3, i64 4)
%7 = call i32 @strlen(i8* %1)
%8 = call i32 (i32, ...) @write(i32 %0, i8* %1, i32 %7)
ret i32 0
}
unsigned char inb(unsigned short port) {
  unsigned char ret;
  __asm__ __volatile__("inb %1, %0" : "=a"(ret) : "Nd"(port));
  return ret;
}


x86 assembly (clang, -O0):
<inb>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    -0x2(%rbp),%dx
in     (%dx),%al
mov    %al,-0x3(%rbp)
movzbl -0x3(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<inb>:
mov    %edi,%edx
in     (%dx),%al
ret

LLVM IR (-O0):
define zeroext i8 @inb(i16 zeroext %0) {
%2 = alloca i16
%3 = alloca i8
store i16 %0, i16* %2
%4 = load i16, i16* %2
%5 = call i8 asm sideeffect "inb $1, $0", "={ax},N{dx},~{dirflag},~{fpsr},~{flags}"(i16 %4)
store i8 %5, i8* %3
%6 = load i8, i8* %3
ret i8 %6
}

LLVM IR (-O2):
define zeroext i8 @inb(i16 zeroext %0) {
%2 = tail call i8 asm sideeffect "inb $1, $0", "={ax},N{dx},~{dirflag},~{fpsr},~{flags}"(i16 %0)
ret i8 %2
}
/* Variables and functions */
int /*<<< orphan*/ gpio_free(int);
int /*<<< orphan*/ gpio_set_value(int, int /*<<< orphan*/);
int /*<<< orphan*/ msleep(int);
void off_hw_setting(void) {
  gpio_set_value(51, 0);
  msleep(10);
  gpio_free(11);
  msleep(100);
}


x86 assembly (clang, -O0):
<off_hw_setting>:
push   %rbp
mov    %rsp,%rbp
mov    $0x33,%edi
xor    %esi,%esi
call   1050 <gpio_set_value@plt>
mov    $0xa,%edi
call   1040 <msleep@plt>
mov    $0xb,%edi
call   1030 <gpio_free@plt>
mov    $0x64,%edi
call   1040 <msleep@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<off_hw_setting>:
push   %rax
mov    $0x33,%edi
xor    %esi,%esi
call   1050 <gpio_set_value@plt>
mov    $0xa,%edi
call   1040 <msleep@plt>
mov    $0xb,%edi
call   1030 <gpio_free@plt>
mov    $0x64,%edi
pop    %rax
jmp    1040 <msleep@plt>

LLVM IR (-O0):
define void @off_hw_setting() {
%1 = call i32 @gpio_set_value(i32 51, i32 0)
%2 = call i32 @msleep(i32 10)
%3 = call i32 @gpio_free(i32 11)
%4 = call i32 @msleep(i32 100)
ret void
}

LLVM IR (-O2):
define void @off_hw_setting() {
%1 = tail call i32 @gpio_set_value(i32 51, i32 0)
%2 = tail call i32 @msleep(i32 10)
%3 = tail call i32 @gpio_free(i32 11)
%4 = tail call i32 @msleep(i32 100)
ret void
}
/* Type definitions */
struct task_struct {
  int dummy;
};

/* Variables and functions */
int task_nice(struct task_struct *);
__attribute__((always_)) int task_nice_ioprio(struct task_struct *task) {
  return (task_nice(task) + 20) / 5;
}


x86 assembly (clang, -O0):
<task_nice_ioprio>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <task_nice@plt>
add    $0x14,%eax
mov    $0x5,%ecx
cltd
idiv   %ecx
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<task_nice_ioprio>:
push   %rax
call   1030 <task_nice@plt>
add    $0x14,%eax
cltq
imul   $0x66666667,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x21,%rax
add    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.task_struct = type { i32 }
define i32 @task_nice_ioprio(%struct.task_struct* %0) {
%2 = alloca %struct.task_struct*
store %struct.task_struct* %0, %struct.task_struct** %2
%3 = load %struct.task_struct*, %struct.task_struct** %2
%4 = call i32 @task_nice(%struct.task_struct* %3)
%5 = add nsw i32 %4, 20
%6 = sdiv i32 %5, 5
ret i32 %6
}

LLVM IR (-O2):
%struct.task_struct = type { i32 }
define i32 @task_nice_ioprio(%struct.task_struct* %0) {
%2 = tail call i32 @task_nice(%struct.task_struct* %0)
%3 = add nsw i32 %2, 20
%4 = sdiv i32 %3, 5
ret i32 %4
}
/* Variables and functions */
int fabs(double);
int AproxEqualOrGt(double a, double b) {
  if (fabs(a - b) < 1e-6 || a > b)
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<AproxEqualOrGt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
subsd  -0x18(%rbp),%xmm0
call   1030 <fabs@plt>
cvtsi2sd %eax,%xmm1
movsd  0xec3(%rip),%xmm0
ucomisd %xmm1,%xmm0
ja     1157 <AproxEqualOrGt+0x47>
movsd  -0x10(%rbp),%xmm0
ucomisd -0x18(%rbp),%xmm0
jbe    1163 <AproxEqualOrGt+0x53>
movl   $0x1,-0x4(%rbp)
jmp    116a <AproxEqualOrGt+0x5a>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<AproxEqualOrGt>:
sub    $0x18,%rsp
movsd  %xmm1,0x8(%rsp)
movsd  %xmm0,0x10(%rsp)
subsd  %xmm1,%xmm0
call   1030 <fabs@plt>
test   %eax,%eax
setle  %al
movsd  0x10(%rsp),%xmm0
ucomisd 0x8(%rsp),%xmm0
seta   %cl
or     %al,%cl
movzbl %cl,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
define i32 @AproxEqualOrGt(double %0, double %1) {
%3 = alloca i32
%4 = alloca double
%5 = alloca double
store double %0, double* %4
store double %1, double* %5
%6 = load double, double* %4
%7 = load double, double* %5
%8 = fsub double %6, %7
%9 = call i32 @fabs(double %8)
%10 = sitofp i32 %9 to double
%11 = fcmp olt double %10, 0x3EB0C6F7A0B5ED8D
br i1 %11, label %16, label %12
12: ; preds = %2
%13 = load double, double* %4
%14 = load double, double* %5
%15 = fcmp ogt double %13, %14
br i1 %15, label %16, label %17
16: ; preds = %12, %2
store i32 1, i32* %3
br label %18
17: ; preds = %12
store i32 0, i32* %3
br label %18
18: ; preds = %17, %16
%19 = load i32, i32* %3
ret i32 %19
}

LLVM IR (-O2):
define i32 @AproxEqualOrGt(double %0, double %1) {
%3 = fsub double %0, %1
%4 = tail call i32 @fabs(double %3)
%5 = icmp slt i32 %4, 1
%6 = fcmp ogt double %0, %1
%7 = or i1 %6, %5
%8 = zext i1 %7 to i32
ret i32 %8
}
long test_mul(long a, long b) {
  long t;
  int i;
  for (i = 0; i < 100; i++) {
    t = a * b;
    t += 153;
    a = t - a * 17;
    b = t + b * 13333;
  }
  return a;
}


x86 assembly (clang, -O0):
<test_mul>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x1c(%rbp)
cmpl   $0x64,-0x1c(%rbp)
jge    1169 <test_mul+0x69>
mov    -0x8(%rbp),%rax
imul   -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x99,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
imul   $0x11,-0x8(%rbp),%rcx
sub    %rcx,%rax
mov    %rax,-0x8(%rbp)
mov    -0x18(%rbp),%rax
imul   $0x3415,-0x10(%rbp),%rcx
add    %rcx,%rax
mov    %rax,-0x10(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1113 <test_mul+0x13>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_mul>:
mov    %rdi,%rax
mov    $0x64,%ecx
nopl   0x0(%rax,%rax,1)
mov    %rax,%rdx
shl    $0x4,%rdx
add    %rax,%rdx
imul   %rsi,%rax
neg    %rdx
add    %rax,%rdx
add    $0x99,%rdx
imul   $0x3415,%rsi,%rsi
add    %rax,%rsi
add    $0x99,%rsi
mov    %rdx,%rax
shl    $0x4,%rax
add    %rdx,%rax
imul   %rsi,%rdx
neg    %rax
add    %rdx,%rax
add    $0x99,%rax
imul   $0x3415,%rsi,%rsi
add    %rdx,%rsi
add    $0x99,%rsi
add    $0xfffffffe,%ecx
jne    1110 <test_mul+0x10>
ret

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

LLVM IR (-O2):
define i64 @test_mul(i64 %0, i64 %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i32 [ 0, %2 ], [ %19, %3 ]
%5 = phi i64 [ %0, %2 ], [ %16, %3 ]
%6 = phi i64 [ %1, %2 ], [ %18, %3 ]
%7 = mul nsw i64 %5, %6
%8 = add nsw i64 %7, 153
%9 = mul i64 %5, -17
%10 = add i64 %8, %9
%11 = mul nsw i64 %6, 13333
%12 = add nsw i64 %8, %11
%13 = mul nsw i64 %10, %12
%14 = add nsw i64 %13, 153
%15 = mul i64 %10, -17
%16 = add i64 %14, %15
%17 = mul nsw i64 %12, 13333
%18 = add nsw i64 %14, %17
%19 = add nuw nsw i32 %4, 2
%20 = icmp eq i32 %19, 100
br i1 %20, label %21, label %3
21: ; preds = %3
ret i64 %16
}
char *str_append(char *dst, int len, const char *src) {
  while ((len-- > 0) && *src)
    *dst++ = *src++;
  return dst;
}


x86 assembly (clang, -O0):
<str_append>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0xc(%rbp),%ecx
mov    %ecx,%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x19(%rbp)
jle    1138 <str_append+0x38>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
setne  %al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
test   $0x1,%al
jne    1148 <str_append+0x48>
jmp    116f <str_append+0x6f>
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x18(%rbp)
mov    (%rax),%cl
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %cl,(%rax)
jmp    110f <str_append+0xf>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<str_append>:
mov    %rdi,%rax
test   %esi,%esi
jle    1129 <str_append+0x29>
add    $0x1,%esi
nopw   0x0(%rax,%rax,1)
movzbl (%rdx),%ecx
test   %cl,%cl
je     1129 <str_append+0x29>
add    $0x1,%rdx
mov    %cl,(%rax)
add    $0x1,%rax
add    $0xffffffff,%esi
cmp    $0x1,%esi
jg     1110 <str_append+0x10>
ret

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

LLVM IR (-O2):
define i8* @str_append(i8* writeonly %0, i32 %1, i8* nocapture %2) {
%4 = icmp sgt i32 %1, 0
br i1 %4, label %5, label %16
5: ; preds = %3, %11
%6 = phi i32 [ %12, %11 ], [ %1, %3 ]
%7 = phi i8* [ %13, %11 ], [ %2, %3 ]
%8 = phi i8* [ %14, %11 ], [ %0, %3 ]
%9 = load i8, i8* %7
%10 = icmp eq i8 %9, 0
br i1 %10, label %16, label %11
11: ; preds = %5
%12 = add nsw i32 %6, -1
%13 = getelementptr inbounds i8, i8* %7, i64 1
%14 = getelementptr inbounds i8, i8* %8, i64 1
store i8 %9, i8* %8
%15 = icmp sgt i32 %6, 1
br i1 %15, label %5, label %16
16: ; preds = %5, %11, %3
%17 = phi i8* [ %0, %3 ], [ %14, %11 ], [ %8, %5 ]
ret i8* %17
}
/* Type definitions */
typedef int /*<<< orphan*/ int32_t;
typedef int /*<<< orphan*/ int16_t;

/* Variables and functions */
int /*<<< orphan*/ L_mult(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ L_sub_c(int /*<<< orphan*/, int /*<<< orphan*/);
int32_t L_msuNs(int32_t L_var3, int16_t var1, int16_t var2) {
  int32_t L_var_out;
  L_var_out = L_mult(var1, var2);
  L_var_out = L_sub_c(L_var3, L_var_out);
  return (L_var_out);
}


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

x86 assembly (clang, -O2):
<L_msuNs>:
push   %rbx
mov    %edi,%ebx
mov    %esi,%edi
mov    %edx,%esi
call   1030 <L_mult@plt>
mov    %ebx,%edi
mov    %eax,%esi
pop    %rbx
jmp    1040 <L_sub_c@plt>

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

LLVM IR (-O2):
define i32 @L_msuNs(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @L_mult(i32 %1, i32 %2)
%5 = tail call i32 @L_sub_c(i32 %0, i32 %4)
ret i32 %5
}
int hash1(void *key) {
  char *str = (char *)key;
  int i;
  int r = 0;
  for (i = 0; str[i] != '\0'; i++)
    r += str[i];
  return r;
}


x86 assembly (clang, -O0):
<hash1>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
movl   $0x0,-0x18(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1153 <hash1+0x53>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
add    -0x18(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    111e <hash1+0x1e>
mov    -0x18(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash1>:
mov    (%rdi),%cl
test   %cl,%cl
je     1121 <hash1+0x21>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
movsbl %cl,%ecx
add    %ecx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <hash1+0x10>
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @hash1(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
store i8* %0, i8** %2
%6 = load i8*, i8** %2
store i8* %6, i8** %3
store i32 0, i32* %5
store i32 0, i32* %4
br label %7
7: ; preds = %24, %1
%8 = load i8*, i8** %3
%9 = load i32, i32* %4
%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 %27
15: ; preds = %7
%16 = load i8*, i8** %3
%17 = load i32, i32* %4
%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 i32, i32* %5
%23 = add nsw i32 %22, %21
store i32 %23, i32* %5
br label %24
24: ; preds = %15
%25 = load i32, i32* %4
%26 = add nsw i32 %25, 1
store i32 %26, i32* %4
br label %7
27: ; preds = %7
%28 = load i32, i32* %5
ret i32 %28
}

LLVM IR (-O2):
define i32 @hash1(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %14, label %4
4: ; preds = %1, %4
%5 = phi i64 [ %10, %4 ], [ 0, %1 ]
%6 = phi i8 [ %12, %4 ], [ %2, %1 ]
%7 = phi i32 [ %9, %4 ], [ 0, %1 ]
%8 = sext i8 %6 to i32
%9 = add nsw i32 %7, %8
%10 = add nuw nsw i64 %5, 1
%11 = getelementptr inbounds i8, i8* %0, i64 %10
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4, %1
%15 = phi i32 [ 0, %1 ], [ %9, %4 ]
ret i32 %15
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ store_tracks(char *);
int main(int argc, char *argv[]) {
  if (argc < 2) {
    printf("select directory\r\n");
    return -1;
  }
  store_tracks(argv[1]);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x8(%rbp)
jge    1158 <main+0x38>
lea    0xeb9(%rip),%rdi
call   1030 <printf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    116c <main+0x4c>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1040 <store_tracks@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
cmp    $0x1,%edi
jg     1139 <main+0x19>
lea    0xed3(%rip),%rdi
call   1030 <puts@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret
mov    0x8(%rsi),%rdi
call   1040 <store_tracks@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [19 x i8] c"select directory\0D\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* %4
%7 = icmp slt i32 %6, 2
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
store i32 -1, i32* %3
br label %15
10: ; preds = %2
%11 = load i8**, i8*** %5
%12 = getelementptr inbounds i8*, i8** %11, i64 1
%13 = load i8*, i8** %12
%14 = call i32 @store_tracks(i8* %13)
store i32 0, i32* %3
br label %15
15: ; preds = %10, %8
%16 = load i32, i32* %3
ret i32 %16
}

LLVM IR (-O2):
@str = [18 x i8] c"select directory\0D\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp slt i32 %0, 2
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str, i64 0, i64 0))
br label %10
6: ; preds = %2
%7 = getelementptr inbounds i8*, i8** %1, i64 1
%8 = load i8*, i8** %7
%9 = tail call i32 @store_tracks(i8* %8)
br label %10
10: ; preds = %6, %4
%11 = phi i32 [ -1, %4 ], [ 0, %6 ]
ret i32 %11
}
/* Type definitions */
typedef int /*<<< orphan*/ __u8;
typedef int __u32;

/* Variables and functions */
void __put_unaligned_2(__u32 __v, register __u8 *__p) {
  *__p++ = __v;
  *__p++ = __v >> 8;
}


x86 assembly (clang, -O0):
<__put_unaligned_2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %rax,%rdx
add    $0x4,%rdx
mov    %rdx,-0x10(%rbp)
mov    %ecx,(%rax)
mov    -0x4(%rbp),%ecx
sar    $0x8,%ecx
mov    -0x10(%rbp),%rax
mov    %rax,%rdx
add    $0x4,%rdx
mov    %rdx,-0x10(%rbp)
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<__put_unaligned_2>:
mov    %edi,(%rsi)
sar    $0x8,%edi
mov    %edi,0x4(%rsi)
ret

LLVM IR (-O0):
define void @__put_unaligned_2(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 = getelementptr inbounds i32, i32* %6, i32 1
store i32* %7, i32** %4
store i32 %5, i32* %6
%8 = load i32, i32* %3
%9 = ashr i32 %8, 8
%10 = load i32*, i32** %4
%11 = getelementptr inbounds i32, i32* %10, i32 1
store i32* %11, i32** %4
store i32 %9, i32* %10
ret void
}

LLVM IR (-O2):
define void @__put_unaligned_2(i32 %0, i32* nocapture writeonly %1) {
%3 = getelementptr inbounds i32, i32* %1, i64 1
store i32 %0, i32* %1
%4 = ashr i32 %0, 8
store i32 %4, i32* %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ parseWords(char *);
void map(char *fName) { parseWords(fName); }


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

x86 assembly (clang, -O2):
<map>:
jmp    1030 <parseWords@plt>

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

LLVM IR (-O2):
define void @map(i8* %0) {
%2 = tail call i32 @parseWords(i8* %0)
ret void
}
double ipow(double base, int exp) {
  double result = 1.;
  while (exp > 0) {
    if (exp & 1)
      result *= base;
    exp >>= 1;
    base *= base;
  }
  return result;
}


x86 assembly (clang, -O0):
<ipow>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
mov    %edi,-0xc(%rbp)
movsd  0xeec(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
cmpl   $0x0,-0xc(%rbp)
jle    115e <ipow+0x5e>
mov    -0xc(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     1141 <ipow+0x41>
movsd  -0x8(%rbp),%xmm0
mulsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
mov    -0xc(%rbp),%eax
sar    $0x1,%eax
mov    %eax,-0xc(%rbp)
movsd  -0x8(%rbp),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1119 <ipow+0x19>
movsd  -0x18(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<ipow>:
test   %edi,%edi
jle    1148 <ipow+0x48>
movsd  0xef4(%rip),%xmm2
movapd %xmm2,%xmm1
jmp    1133 <ipow+0x33>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mulsd  %xmm3,%xmm1
mov    %edi,%eax
shr    %eax
mulsd  %xmm0,%xmm0
cmp    $0x1,%edi
mov    %eax,%edi
jbe    1143 <ipow+0x43>
movapd %xmm2,%xmm3
test   $0x1,%dil
je     1120 <ipow+0x20>
movapd %xmm0,%xmm3
jmp    1120 <ipow+0x20>
movapd %xmm1,%xmm0
ret
movsd  0xeb0(%rip),%xmm0
ret

LLVM IR (-O0):
define double @ipow(double %0, i32 %1) {
%3 = alloca double
%4 = alloca i32
%5 = alloca double
store double %0, double* %3
store i32 %1, i32* %4
store double 1.000000e+00, double* %5
br label %6
6: ; preds = %17, %2
%7 = load i32, i32* %4
%8 = icmp sgt i32 %7, 0
br i1 %8, label %9, label %23
9: ; preds = %6
%10 = load i32, i32* %4
%11 = and i32 %10, 1
%12 = icmp ne i32 %11, 0
br i1 %12, label %13, label %17
13: ; preds = %9
%14 = load double, double* %3
%15 = load double, double* %5
%16 = fmul double %15, %14
store double %16, double* %5
br label %17
17: ; preds = %13, %9
%18 = load i32, i32* %4
%19 = ashr i32 %18, 1
store i32 %19, i32* %4
%20 = load double, double* %3
%21 = load double, double* %3
%22 = fmul double %21, %20
store double %22, double* %3
br label %6
23: ; preds = %6
%24 = load double, double* %5
ret double %24
}

LLVM IR (-O2):
define double @ipow(double %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %15
4: ; preds = %2, %4
%5 = phi double [ %11, %4 ], [ 1.000000e+00, %2 ]
%6 = phi i32 [ %12, %4 ], [ %1, %2 ]
%7 = phi double [ %13, %4 ], [ %0, %2 ]
%8 = and i32 %6, 1
%9 = icmp eq i32 %8, 0
%10 = select i1 %9, double 1.000000e+00, double %7
%11 = fmul double %5, %10
%12 = lshr i32 %6, 1
%13 = fmul double %7, %7
%14 = icmp ult i32 %6, 2
br i1 %14, label %15, label %4
15: ; preds = %4, %2
%16 = phi double [ 1.000000e+00, %2 ], [ %11, %4 ]
ret double %16
}
void gdk_gc_set_tile() {}


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

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

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

LLVM IR (-O2):
define void @gdk_gc_set_tile() {
ret void
}
/* Variables and functions */
void VIDDummyDeInit(void) {}


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

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

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

LLVM IR (-O2):
define void @VIDDummyDeInit() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ CALL(int);
main() {
  int max = 0x7fffffff;
  CALL(max);
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @CALL(i32 2147483647)
ret i32 0
}
double rad2deg(double ang) { return ang * 180.0 / 3.141592653589793; }


x86 assembly (clang, -O0):
<rad2deg>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  0xef7(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  0xee2(%rip),%xmm1
divsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<rad2deg>:
mulsd  0xef8(%rip),%xmm0
divsd  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define double @rad2deg(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fmul double %3, 1.800000e+02
%5 = fdiv double %4, 0x400921FB54442D18
ret double %5
}

LLVM IR (-O2):
define double @rad2deg(double %0) {
%2 = fmul double %0, 1.800000e+02
%3 = fdiv double %2, 0x400921FB54442D18
ret double %3
}
void jit_notify_freed_code(void) {}


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

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

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

LLVM IR (-O2):
define void @jit_notify_freed_code() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_pid_file_check_running() {
  printf("NOT IMPLEMENTED:"
         "pa_pid_file_check_running"
         "\n");
}


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

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

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

LLVM IR (-O2):
@str = [42 x i8] c"NOT IMPLEMENTED:pa_pid_file_check_running\00"
define i32 @pa_pid_file_check_running() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ enable_firewall();
int get_int();
int /*<<< orphan*/ menu_action(int);
int /*<<< orphan*/ menu_show();
int main() {
  int opt = 1;
  enable_firewall();
  while (opt) {
    menu_show();
    opt = get_int();
    menu_action(opt);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
mov    $0x0,%al
call   1030 <enable_firewall@plt>
cmpl   $0x0,-0x8(%rbp)
je     1185 <main+0x45>
mov    $0x0,%al
call   1040 <menu_show@plt>
mov    $0x0,%al
call   1060 <get_int@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1050 <menu_action@plt>
jmp    115d <main+0x1d>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1030 <enable_firewall@plt>
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1040 <menu_show@plt>
xor    %eax,%eax
call   1060 <get_int@plt>
mov    %eax,%ebx
mov    %eax,%edi
call   1050 <menu_action@plt>
test   %ebx,%ebx
jne    1150 <main+0x10>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 1, i32* %2
%3 = call i32 (...) @enable_firewall()
br label %4
4: ; preds = %7, %0
%5 = load i32, i32* %2
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %12
7: ; preds = %4
%8 = call i32 (...) @menu_show()
%9 = call i32 (...) @get_int()
store i32 %9, i32* %2
%10 = load i32, i32* %2
%11 = call i32 @menu_action(i32 %10)
br label %4
12: ; preds = %4
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @enable_firewall()
br label %2
2: ; preds = %0, %2
%3 = tail call i32 (...) @menu_show()
%4 = tail call i32 (...) @get_int()
%5 = tail call i32 @menu_action(i32 %4)
%6 = icmp eq i32 %4, 0
br i1 %6, label %7, label %2
7: ; preds = %2
ret i32 0
}
/* Variables and functions */
int anetTcpGenericConnect(char *, char *, int, int /*<<< orphan*/ *,
                          int /*<<< orphan*/);
int anetTcpConnect(char *err, char *addr, int port) {
  return anetTcpGenericConnect(err, addr, port, NULL, 0);
}


x86 assembly (clang, -O0):
<anetTcpConnect>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
xor    %eax,%eax
mov    %eax,%ecx
xor    %r8d,%r8d
call   1030 <anetTcpGenericConnect@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<anetTcpConnect>:
xor    %ecx,%ecx
xor    %r8d,%r8d
jmp    1030 <anetTcpGenericConnect@plt>

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

LLVM IR (-O2):
define i32 @anetTcpConnect(i8* %0, i8* %1, i32 %2) {
%4 = tail call i32 @anetTcpGenericConnect(i8* %0, i8* %1, i32 %2, i32* null, i32 0)
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
size_t fread(void *, size_t, size_t, int /*<<< orphan*/ *);
size_t fread_int(void *ptr, size_t size, size_t nitems, FILE *stream) {
  return fread(ptr, size, nitems, stream);
}


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

x86 assembly (clang, -O2):
<fread_int>:
jmp    1030 <fread@plt>

LLVM IR (-O0):
define i64 @fread_int(i8* %0, i64 %1, i64 %2, i32* %3) {
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i64
%8 = alloca i32*
store i8* %0, i8** %5
store i64 %1, i64* %6
store i64 %2, i64* %7
store i32* %3, i32** %8
%9 = load i8*, i8** %5
%10 = load i64, i64* %6
%11 = load i64, i64* %7
%12 = load i32*, i32** %8
%13 = call i64 @fread(i8* %9, i64 %10, i64 %11, i32* %12)
ret i64 %13
}

LLVM IR (-O2):
define i64 @fread_int(i8* nocapture %0, i64 %1, i64 %2, i32* nocapture %3) {
%5 = tail call i64 @fread(i8* %0, i64 %1, i64 %2, i32* %3)
ret i64 %5
}
/* Type definitions */
struct stat {
  int dummy;
};

/* Variables and functions */
int lstat(char const *, struct stat *);
int __gnat_florist_lstat(const char *path, struct stat *buf) {
  return lstat(path, buf);
}


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

x86 assembly (clang, -O2):
<__gnat_florist_lstat>:
jmp    1030 <lstat@plt>

LLVM IR (-O0):
%struct.stat = type { i32 }
define i32 @__gnat_florist_lstat(i8* %0, %struct.stat* %1) {
%3 = alloca i8*
%4 = alloca %struct.stat*
store i8* %0, i8** %3
store %struct.stat* %1, %struct.stat** %4
%5 = load i8*, i8** %3
%6 = load %struct.stat*, %struct.stat** %4
%7 = call i32 @lstat(i8* %5, %struct.stat* %6)
ret i32 %7
}

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @__gnat_florist_lstat(i8* nocapture %0, %struct.stat* nocapture %1) {
%3 = tail call i32 @lstat(i8* %0, %struct.stat* %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ lineprint2(char *, long, unsigned char *, char *);
int /*<<< orphan*/ sprintf(char *, char *, char *, unsigned char);
void immed(char *outf, long ctr, unsigned char *op, char *str) {
  char buf[256];
  sprintf(buf, "%-4s #$%02X", str, *(op + 1));
  lineprint2(outf, ctr, op, buf);
}


x86 assembly (clang, -O0):
<immed>:
push   %rbp
mov    %rsp,%rbp
sub    $0x120,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
lea    -0x120(%rbp),%rdi
mov    -0x20(%rbp),%rdx
mov    -0x18(%rbp),%rax
lea    0xeaf(%rip),%rsi
movzbl 0x1(%rax),%ecx
call   1040 <sprintf@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
lea    -0x120(%rbp),%rcx
call   1030 <lineprint2@plt>
add    $0x120,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<immed>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x108,%rsp
mov    %rdx,%rbx
mov    %rsi,%r14
mov    %rdi,%r15
movzbl 0x1(%rdx),%eax
lea    0xebe(%rip),%rsi
mov    %rsp,%r12
mov    %r12,%rdi
mov    %rcx,%rdx
mov    %eax,%ecx
call   1040 <sprintf@plt>
mov    %r15,%rdi
mov    %r14,%rsi
mov    %rbx,%rdx
mov    %r12,%rcx
call   1030 <lineprint2@plt>
add    $0x108,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [12 x i8] c"%-4s #$%02X\00"
define void @immed(i8* %0, i64 %1, i8* %2, i8* %3) {
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca [256 x i8]
store i8* %0, i8** %5
store i64 %1, i64* %6
store i8* %2, i8** %7
store i8* %3, i8** %8
%10 = getelementptr inbounds [256 x i8], [256 x i8]* %9, i64 0, i64 0
%11 = load i8*, i8** %8
%12 = load i8*, i8** %7
%13 = getelementptr inbounds i8, i8* %12, i64 1
%14 = load i8, i8* %13
%15 = call i32 @sprintf(i8* %10, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %11, i8 zeroext %14)
%16 = load i8*, i8** %5
%17 = load i64, i64* %6
%18 = load i8*, i8** %7
%19 = getelementptr inbounds [256 x i8], [256 x i8]* %9, i64 0, i64 0
%20 = call i32 @lineprint2(i8* %16, i64 %17, i8* %18, i8* %19)
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"%-4s #$%02X\00"
define void @immed(i8* %0, i64 %1, i8* %2, i8* %3) {
%5 = alloca [256 x i8]
%6 = getelementptr inbounds [256 x i8], [256 x i8]* %5, i64 0, i64 0
%7 = getelementptr inbounds i8, i8* %2, i64 1
%8 = load i8, i8* %7
%9 = call i32 @sprintf(i8* %6, i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %3, i8 zeroext %8)
%10 = call i32 @lineprint2(i8* %0, i64 %1, i8* %2, i8* %6)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isalpha(int);
void t_isalpha_0x28() {
  Assert_real((isalpha(40) == 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_isalpha.c",
              205, ("isalpha should be 0 for ("));
}


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

x86 assembly (clang, -O2):
<t_isalpha_0x28>:
push   %rax
mov    $0x28,%edi
call   1030 <isalpha@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0xcd,%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 0 for (\00"
define void @t_isalpha_0x28() {
%1 = call i64 @isalpha(i32 40)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 205, 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 0 for (\00"
define void @t_isalpha_0x28() {
%1 = tail call i64 @isalpha(i32 40)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 205, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int Operand_ulabel8_decode(unsigned int *valp) {
  unsigned ulabel8_0, imm8_0;
  imm8_0 = *valp & 0xff;
  ulabel8_0 = 0x4 + (((0) << 8) | imm8_0);
  *valp = ulabel8_0;
  return 0;
}


x86 assembly (clang, -O0):
<Operand_ulabel8_decode>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
and    $0xff,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
or     $0x0,%eax
add    $0x4,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Operand_ulabel8_decode>:
movzbl (%rdi),%eax
add    $0x4,%eax
mov    %eax,(%rdi)
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @Operand_ulabel8_decode(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
%4 = alloca i32
store i32* %0, i32** %2
%5 = load i32*, i32** %2
%6 = load i32, i32* %5
%7 = and i32 %6, 255
store i32 %7, i32* %4
%8 = load i32, i32* %4
%9 = or i32 0, %8
%10 = add i32 4, %9
store i32 %10, i32* %3
%11 = load i32, i32* %3
%12 = load i32*, i32** %2
store i32 %11, i32* %12
ret i32 0
}

LLVM IR (-O2):
define i32 @Operand_ulabel8_decode(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = and i32 %2, 255
%4 = add nuw nsw i32 %3, 4
store i32 %4, i32* %0
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_t;

/* Variables and functions */
int /*<<< orphan*/ pthread_cancel(int /*<<< orphan*/);
int /*<<< orphan*/ pthread_join(int /*<<< orphan*/, int /*<<< orphan*/ *);
void stop_thread(pthread_t *pth) {
  if (pth) {
    pthread_cancel(*pth);
    pthread_join(*pth, NULL);
  }
}


x86 assembly (clang, -O0):
<stop_thread>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1151 <stop_thread+0x31>
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
call   1040 <pthread_cancel@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <pthread_join@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stop_thread>:
test   %rdi,%rdi
je     113a <stop_thread+0x1a>
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%edi
call   1040 <pthread_cancel@plt>
mov    (%rbx),%edi
xor    %esi,%esi
pop    %rbx
jmp    1030 <pthread_join@plt>
ret

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

LLVM IR (-O2):
define void @stop_thread(i32* %0) {
%2 = icmp eq i32* %0, null
br i1 %2, label %8, label %3
3: ; preds = %1
%4 = load i32, i32* %0
%5 = tail call i32 @pthread_cancel(i32 %4)
%6 = load i32, i32* %0
%7 = tail call i32 @pthread_join(i32 %6, i32* null)
br label %8
8: ; preds = %3, %1
ret void
}
/* Variables and functions */
int getxattr(const char *path, const char *name, char *value, size_t size) {
  return 0;
}


x86 assembly (clang, -O0):
<getxattr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @getxattr(i8* %0, i8* %1, i8* %2, i64 %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i64
store i8* %0, i8** %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store i64 %3, i64* %8
ret i32 0
}

LLVM IR (-O2):
define i32 @getxattr(i8* nocapture readnone %0, i8* nocapture readnone %1, i8* nocapture readnone %2, i64 %3) {
ret i32 0
}
/* Variables and functions */
char *realloc(char *, int);
char *extend_string(char *str, int cur_len, int ex_len) {
  str = realloc(str, (cur_len * sizeof(char)) + (ex_len * sizeof(char)) +
                         (1 * sizeof(char)));
  str[cur_len] = 0;
  return str;
}


x86 assembly (clang, -O0):
<extend_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
movslq -0xc(%rbp),%rax
shl    $0x0,%rax
movslq -0x10(%rbp),%rcx
shl    $0x0,%rcx
add    %rcx,%rax
add    $0x1,%rax
mov    %eax,%esi
call   1030 <realloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<extend_string>:
push   %rbx
movslq %esi,%rbx
lea    (%rbx,%rdx,1),%esi
add    $0x1,%esi
call   1030 <realloc@plt>
movb   $0x0,(%rax,%rbx,1)
pop    %rbx
ret

LLVM IR (-O0):
define i8* @extend_string(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 = sext i32 %8 to i64
%10 = mul i64 %9, 1
%11 = load i32, i32* %6
%12 = sext i32 %11 to i64
%13 = mul i64 %12, 1
%14 = add i64 %10, %13
%15 = add i64 %14, 1
%16 = trunc i64 %15 to i32
%17 = call i8* @realloc(i8* %7, i32 %16)
store i8* %17, i8** %4
%18 = load i8*, i8** %4
%19 = load i32, i32* %5
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds i8, i8* %18, i64 %20
store i8 0, i8* %21
%22 = load i8*, i8** %4
ret i8* %22
}

LLVM IR (-O2):
define i8* @extend_string(i8* %0, i32 %1, i32 %2) {
%4 = sext i32 %1 to i64
%5 = add i32 %1, 1
%6 = add i32 %5, %2
%7 = tail call i8* @realloc(i8* %0, i32 %6)
%8 = getelementptr inbounds i8, i8* %7, i64 %4
store i8 0, i8* %8
ret i8* %7
}
/* Variables and functions */
int RAND_status();
int mongoc_rand_status(void) { return RAND_status(); }


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

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

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

LLVM IR (-O2):
define i32 @mongoc_rand_status() {
%1 = tail call i32 (...) @RAND_status()
ret i32 %1
}
/* Type definitions */
struct __sk_buff {
  int dummy;
};
typedef int /*<<< orphan*/ __u8;

/* Variables and functions */
int skb_load_bytes(struct __sk_buff *, int, int /*<<< orphan*/ *, int);
int eth_load_saddr(struct __sk_buff *skb, __u8 *mac, int off) {
  return skb_load_bytes(skb, off + 6, mac, 6);
}


x86 assembly (clang, -O0):
<eth_load_saddr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
add    $0x6,%esi
mov    -0x10(%rbp),%rdx
mov    $0x6,%ecx
call   1030 <skb_load_bytes@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<eth_load_saddr>:
mov    %rsi,%rax
lea    0x6(%rdx),%esi
mov    %rax,%rdx
mov    $0x6,%ecx
jmp    1030 <skb_load_bytes@plt>

LLVM IR (-O0):
%struct.__sk_buff = type { i32 }
define i32 @eth_load_saddr(%struct.__sk_buff* %0, i32* %1, i32 %2) {
%4 = alloca %struct.__sk_buff*
%5 = alloca i32*
%6 = alloca i32
store %struct.__sk_buff* %0, %struct.__sk_buff** %4
store i32* %1, i32** %5
store i32 %2, i32* %6
%7 = load %struct.__sk_buff*, %struct.__sk_buff** %4
%8 = load i32, i32* %6
%9 = add nsw i32 %8, 6
%10 = load i32*, i32** %5
%11 = call i32 @skb_load_bytes(%struct.__sk_buff* %7, i32 %9, i32* %10, i32 6)
ret i32 %11
}

LLVM IR (-O2):
%struct.__sk_buff = type { i32 }
define i32 @eth_load_saddr(%struct.__sk_buff* %0, i32* %1, i32 %2) {
%4 = add nsw i32 %2, 6
%5 = tail call i32 @skb_load_bytes(%struct.__sk_buff* %0, i32 %4, i32* %1, i32 6)
ret i32 %5
}
/* Variables and functions */
size_t lrand(size_t rand, size_t lower, size_t upper) {
  return rand % (upper - lower + 1) + lower;
}


x86 assembly (clang, -O0):
<lrand>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
sub    -0x10(%rbp),%rcx
add    $0x1,%rcx
xor    %edx,%edx
div    %rcx
mov    %rdx,%rax
add    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<lrand>:
mov    %rdx,%rcx
mov    %rdi,%rax
sub    %rsi,%rcx
add    $0x1,%rcx
mov    %rdi,%rdx
or     %rcx,%rdx
shr    $0x20,%rdx
je     1125 <lrand+0x25>
xor    %edx,%edx
div    %rcx
mov    %rdx,%rax
add    %rsi,%rax
ret
xor    %edx,%edx
div    %ecx
mov    %edx,%eax
add    %rsi,%rax
ret

LLVM IR (-O0):
define i64 @lrand(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 = load i64, i64* %6
%9 = load i64, i64* %5
%10 = sub i64 %8, %9
%11 = add i64 %10, 1
%12 = urem i64 %7, %11
%13 = load i64, i64* %5
%14 = add i64 %12, %13
ret i64 %14
}

LLVM IR (-O2):
define i64 @lrand(i64 %0, i64 %1, i64 %2) {
%4 = sub i64 1, %1
%5 = add i64 %4, %2
%6 = urem i64 %0, %5
%7 = add i64 %6, %1
ret i64 %7
}
/* Variables and functions */
int /*<<< orphan*/ absolute();
int /*<<< orphan*/ writememw65816(int /*<<< orphan*/, int /*<<< orphan*/);
void stzAbs16(void) { writememw65816(absolute(), 0); }


x86 assembly (clang, -O0):
<stzAbs16>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <absolute@plt>
mov    %eax,%edi
xor    %esi,%esi
call   1030 <writememw65816@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<stzAbs16>:
push   %rax
xor    %eax,%eax
call   1040 <absolute@plt>
mov    %eax,%edi
xor    %esi,%esi
pop    %rax
jmp    1030 <writememw65816@plt>

LLVM IR (-O0):
define void @stzAbs16() {
%1 = call i32 (...) @absolute()
%2 = call i32 @writememw65816(i32 %1, i32 0)
ret void
}

LLVM IR (-O2):
define void @stzAbs16() {
%1 = tail call i32 (...) @absolute()
%2 = tail call i32 @writememw65816(i32 %1, i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
void handle_fizz(unsigned long int const i) {
  (void)i;
  (void)puts("fizz");
}


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

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

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

LLVM IR (-O2):
@.str = [5 x i8] c"fizz\00"
define void @handle_fizz(i64 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret void
}
void caller_2_1_1_1_2_1_2() {}


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

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

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

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