xunge/DecIR huggingface dataset:
double dv3_dot(double *a, double *b) {
  return a[0] * b[0] + a[1] * b[1] + a[2] * b[2];
}


x86 assembly (clang, -O0):
<dv3_dot>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm1
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm2
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm0
mov    -0x10(%rbp),%rax
mulsd  0x8(%rax),%xmm0
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
mov    -0x8(%rbp),%rax
movsd  0x10(%rax),%xmm0
mov    -0x10(%rbp),%rax
movsd  0x10(%rax),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<dv3_dot>:
movsd  0x8(%rdi),%xmm0
mulsd  0x8(%rsi),%xmm0
movsd  (%rdi),%xmm1
mulsd  (%rsi),%xmm1
addsd  %xmm0,%xmm1
movsd  0x10(%rdi),%xmm0
mulsd  0x10(%rsi),%xmm0
addsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @dv3_dot(double* %0, double* %1) {
%3 = alloca double*
%4 = alloca double*
store double* %0, double** %3
store double* %1, double** %4
%5 = load double*, double** %3
%6 = getelementptr inbounds double, double* %5, i64 0
%7 = load double, double* %6
%8 = load double*, double** %4
%9 = getelementptr inbounds double, double* %8, i64 0
%10 = load double, double* %9
%11 = load double*, double** %3
%12 = getelementptr inbounds double, double* %11, i64 1
%13 = load double, double* %12
%14 = load double*, double** %4
%15 = getelementptr inbounds double, double* %14, i64 1
%16 = load double, double* %15
%17 = fmul double %13, %16
%18 = call double @llvm.fmuladd.f64(double %7, double %10, double %17)
%19 = load double*, double** %3
%20 = getelementptr inbounds double, double* %19, i64 2
%21 = load double, double* %20
%22 = load double*, double** %4
%23 = getelementptr inbounds double, double* %22, i64 2
%24 = load double, double* %23
%25 = call double @llvm.fmuladd.f64(double %21, double %24, double %18)
ret double %25
}

LLVM IR (-O2):
define double @dv3_dot(double* nocapture %0, double* nocapture %1) {
%3 = load double, double* %0
%4 = load double, double* %1
%5 = getelementptr inbounds double, double* %0, i64 1
%6 = load double, double* %5
%7 = getelementptr inbounds double, double* %1, i64 1
%8 = load double, double* %7
%9 = fmul double %6, %8
%10 = tail call double @llvm.fmuladd.f64(double %3, double %4, double %9)
%11 = getelementptr inbounds double, double* %0, i64 2
%12 = load double, double* %11
%13 = getelementptr inbounds double, double* %1, i64 2
%14 = load double, double* %13
%15 = tail call double @llvm.fmuladd.f64(double %12, double %14, double %10)
ret double %15
}
/* Type definitions */
struct timespec {
  int dummy;
};
typedef int /*<<< orphan*/ pthread_mutex_t;
typedef int /*<<< orphan*/ pthread_cond_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pthread_cond_timedwait(pthread_cond_t *cond, pthread_mutex_t *mutex,
                           const struct timespec *abstime) {
  printf("pthread_cond_timedwait\n");
  return 0;
}


x86 assembly (clang, -O0):
<pthread_cond_timedwait>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
%struct.timespec = type { i32 }
@str = [23 x i8] c"pthread_cond_timedwait\00"
define i32 @pthread_cond_timedwait(i32* nocapture readnone %0, i32* nocapture readnone %1, %struct.timespec* nocapture readnone %2) {
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ va_list;

/* Variables and functions */
int formatted_scan(int /*<<< orphan*/, char const *, int /*<<< orphan*/);
int /*<<< orphan*/ stdin;
int vscanf(const char *format, va_list ap) {
  return (formatted_scan(stdin, format, ap));
}


x86 assembly (clang, -O0):
<vscanf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    0x2ec2(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
call   1030 <formatted_scan@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vscanf>:
mov    %esi,%edx
mov    %rdi,%rsi
mov    0x2ecc(%rip),%rax
mov    (%rax),%edi
jmp    1030 <formatted_scan@plt>

LLVM IR (-O0):
@stdin = global i32 0
define i32 @vscanf(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* @stdin
%6 = load i8*, i8** %3
%7 = load i32, i32* %4
%8 = call i32 @formatted_scan(i32 %5, i8* %6, i32 %7)
ret i32 %8
}

LLVM IR (-O2):
@stdin = global i32 0
define i32 @vscanf(i8* %0, i32 %1) {
%3 = load i32, i32* @stdin
%4 = tail call i32 @formatted_scan(i32 %3, i8* %0, i32 %1)
ret i32 %4
}
int __isleap(unsigned year) {
  if (year & 3)
    return 0;
  year %= 400;
  if (!(year -= 100))
    return 0;
  if (!(year -= 100))
    return 0;
  if (!(year -= 100))
    return 0;
  return 1;
}


x86 assembly (clang, -O0):
<__isleap>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
and    $0x3,%eax
cmp    $0x0,%eax
je     1122 <__isleap+0x22>
movl   $0x0,-0x4(%rbp)
jmp    1192 <__isleap+0x92>
mov    -0x8(%rbp),%eax
mov    $0x190,%ecx
xor    %edx,%edx
div    %ecx
mov    %edx,-0x8(%rbp)
mov    -0x8(%rbp),%eax
sub    $0x64,%eax
mov    %eax,-0x8(%rbp)
cmp    $0x0,%eax
jne    114f <__isleap+0x4f>
movl   $0x0,-0x4(%rbp)
jmp    1192 <__isleap+0x92>
mov    -0x8(%rbp),%eax
sub    $0x64,%eax
mov    %eax,-0x8(%rbp)
cmp    $0x0,%eax
jne    116d <__isleap+0x6d>
movl   $0x0,-0x4(%rbp)
jmp    1192 <__isleap+0x92>
mov    -0x8(%rbp),%eax
sub    $0x64,%eax
mov    %eax,-0x8(%rbp)
cmp    $0x0,%eax
jne    118b <__isleap+0x8b>
movl   $0x0,-0x4(%rbp)
jmp    1192 <__isleap+0x92>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__isleap>:
xor    %eax,%eax
test   $0x3,%dil
je     1109 <__isleap+0x9>
ret
mov    %edi,%ecx
imul   $0x51eb851f,%rcx,%rcx
shr    $0x27,%rcx
imul   $0x190,%ecx,%ecx
sub    %ecx,%edi
cmp    $0x64,%edi
je     1108 <__isleap+0x8>
cmp    $0xc8,%edi
je     1108 <__isleap+0x8>
cmp    $0x12c,%edi
je     1108 <__isleap+0x8>
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @__isleap(i32 %0) {
%2 = and i32 %0, 3
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = urem i32 %0, 400
switch i32 %5, label %6 [
i32 100, label %7
i32 200, label %7
i32 300, label %7
]
6: ; preds = %4
br label %7
7: ; preds = %4, %4, %4, %1, %6
%8 = phi i32 [ 1, %6 ], [ 0, %1 ], [ 0, %4 ], [ 0, %4 ], [ 0, %4 ]
ret i32 %8
}
int maxProfitCooldown(int *prices, int pricesSize) { return 0; }


x86 assembly (clang, -O0):
<maxProfitCooldown>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @maxProfitCooldown(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
ret i32 0
}

LLVM IR (-O2):
define i32 @maxProfitCooldown(i32* nocapture readnone %0, i32 %1) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ emsMark();
void ems_mark_(void) { emsMark(); }


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

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

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

LLVM IR (-O2):
define void @ems_mark_() {
%1 = tail call i32 (...) @emsMark()
ret void
}
/* Type definitions */
struct STATE_DATA {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ append_action(struct STATE_DATA *, char const *);
int append_entry_copy(struct STATE_DATA *, int, int, int /*<<< orphan*/);
int append_entry(struct STATE_DATA *sd, int time, int phase, const char *str) {
  return append_entry_copy(sd, time, phase, append_action(sd, str));
}


x86 assembly (clang, -O0):
<append_entry>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <append_action@plt>
mov    -0x28(%rbp),%rdi
mov    -0x20(%rbp),%esi
mov    -0x1c(%rbp),%edx
mov    %eax,%ecx
call   1040 <append_entry_copy@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<append_entry>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%r14d
mov    %esi,%ebp
mov    %rdi,%rbx
mov    %rcx,%rsi
call   1030 <append_action@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
mov    %r14d,%edx
mov    %eax,%ecx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <append_entry_copy@plt>

LLVM IR (-O0):
%struct.STATE_DATA = type { i32 }
define i32 @append_entry(%struct.STATE_DATA* %0, i32 %1, i32 %2, i8* %3) {
%5 = alloca %struct.STATE_DATA*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i8*
store %struct.STATE_DATA* %0, %struct.STATE_DATA** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i8* %3, i8** %8
%9 = load %struct.STATE_DATA*, %struct.STATE_DATA** %5
%10 = load i32, i32* %6
%11 = load i32, i32* %7
%12 = load %struct.STATE_DATA*, %struct.STATE_DATA** %5
%13 = load i8*, i8** %8
%14 = call i32 @append_action(%struct.STATE_DATA* %12, i8* %13)
%15 = call i32 @append_entry_copy(%struct.STATE_DATA* %9, i32 %10, i32 %11, i32 %14)
ret i32 %15
}

LLVM IR (-O2):
%struct.STATE_DATA = type { i32 }
define i32 @append_entry(%struct.STATE_DATA* %0, i32 %1, i32 %2, i8* %3) {
%5 = tail call i32 @append_action(%struct.STATE_DATA* %0, i8* %3)
%6 = tail call i32 @append_entry_copy(%struct.STATE_DATA* %0, i32 %1, i32 %2, i32 %5)
ret i32 %6
}
int digit(char c) { return '0' <= c && c <= '9'; }


x86 assembly (clang, -O0):
<digit>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edx
xor    %eax,%eax
mov    $0x30,%ecx
cmp    %edx,%ecx
mov    %al,-0x2(%rbp)
jg     112d <digit+0x2d>
movsbl -0x1(%rbp),%eax
cmp    $0x39,%eax
setle  %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<digit>:
add    $0xd0,%dil
xor    %eax,%eax
cmp    $0xa,%dil
setb   %al
ret

LLVM IR (-O0):
define i32 @digit(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp sle i32 48, %4
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp sle i32 %8, 57
br label %10
10: ; preds = %6, %1
%11 = phi i1 [ false, %1 ], [ %9, %6 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @digit(i8 signext %0) {
%2 = add i8 %0, -48
%3 = icmp ult i8 %2, 10
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, float, float);
int main() {
  for (float fahrenheit = -100; fahrenheit <= 300; fahrenheit += 15) {
    float celsius = (5.0 / 9.0) * (fahrenheit - 32);
    printf("%3.0f°F = %6.2f°C\n", fahrenheit, celsius);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movss  0xed9(%rip),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  0xed0(%rip),%xmm0
ucomiss -0x8(%rbp),%xmm0
jb     1195 <main+0x85>
movss  -0x8(%rbp),%xmm0
movss  0xebd(%rip),%xmm1
subss  %xmm1,%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xeb5(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0x8(%rbp),%xmm0
movss  -0xc(%rbp),%xmm1
lea    0xe9f(%rip),%rdi
call   1030 <printf@plt>
movss  0xe86(%rip),%xmm0
addss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x8(%rbp)
jmp    112c <main+0x1c>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
mov    $0xffffff8d,%ebp
lea    0xef1(%rip),%rbx
nop
add    $0xf,%ebp
xorps  %xmm0,%xmm0
cvtsi2ss %ebp,%xmm0
movaps %xmm0,%xmm1
addss  0xecb(%rip),%xmm1
cvtss2sd %xmm1,%xmm1
mulsd  0xec7(%rip),%xmm1
cvtsd2ss %xmm1,%xmm1
mov    %rbx,%rdi
call   1030 <printf@plt>
cmp    $0x11d,%ebp
jle    1120 <main+0x10>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [21 x i8] c"%3.0f\C2\B0F = %6.2f\C2\B0C\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = alloca float
store i32 0, i32* %1
store float -1.000000e+02, float* %2
br label %4
4: ; preds = %16, %0
%5 = load float, float* %2
%6 = fcmp ole float %5, 3.000000e+02
br i1 %6, label %7, label %19
7: ; preds = %4
%8 = load float, float* %2
%9 = fsub float %8, 3.200000e+01
%10 = fpext float %9 to double
%11 = fmul double 0x3FE1C71C71C71C72, %10
%12 = fptrunc double %11 to float
store float %12, float* %3
%13 = load float, float* %2
%14 = load float, float* %3
%15 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), float %13, float %14)
br label %16
16: ; preds = %7
%17 = load float, float* %2
%18 = fadd float %17, 1.500000e+01
store float %18, float* %2
br label %4
19: ; preds = %4
%20 = load i32, i32* %1
ret i32 %20
}

LLVM IR (-O2):
@.str = [21 x i8] c"%3.0f\C2\B0F = %6.2f\C2\B0C\0A\00"
define i32 @main() {
br label %2
1: ; preds = %2
ret i32 0
2: ; preds = %0, %2
%3 = phi i32 [ -100, %0 ], [ %10, %2 ]
%4 = sitofp i32 %3 to float
%5 = fadd float %4, -3.200000e+01
%6 = fpext float %5 to double
%7 = fmul double %6, 0x3FE1C71C71C71C72
%8 = fptrunc double %7 to float
%9 = tail call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), float %4, float %8)
%10 = add nsw i32 %3, 15
%11 = icmp sgt i32 %3, 285
br i1 %11, label %1, label %2
}
/* Variables and functions */
int /*<<< orphan*/ free(int *);
int *malloc(int);
void mem_leak() {
  int *i_leak = malloc(5 * sizeof(int));
  free(i_leak);
}


x86 assembly (clang, -O0):
<mem_leak>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x14,%edi
call   1040 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mem_leak>:
push   %rax
mov    $0x14,%edi
call   1040 <malloc@plt>
mov    %rax,%rdi
pop    %rax
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @mem_leak() {
%1 = alloca i32*
%2 = call i32* @malloc(i32 20)
store i32* %2, i32** %1
%3 = load i32*, i32** %1
%4 = call i32 @free(i32* %3)
ret void
}

LLVM IR (-O2):
define void @mem_leak() {
%1 = tail call i32* @malloc(i32 20)
%2 = tail call i32 @free(i32* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ out1fmt(char *, char *);
int versioncmd(int argc, char **argv) {
  out1fmt("%s\n", "13.0.16a");
  return 0;
}


x86 assembly (clang, -O0):
<versioncmd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xeda(%rip),%rdi
lea    0xed7(%rip),%rsi
call   1030 <out1fmt@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [9 x i8] c"13.0.16a\00"
define i32 @versioncmd(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = call i32 @out1fmt(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [9 x i8] c"13.0.16a\00"
define i32 @versioncmd(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @out1fmt(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
int func_b(int b) {
  b = b + 2;
  return b;
}


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

x86 assembly (clang, -O2):
<func_b>:
lea    0x2(%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @func_b(i32 %0) {
%2 = add nsw i32 %0, 2
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ prt(int /*<<< orphan*/, int, int /*<<< orphan*/,
                       int /*<<< orphan*/);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int n;
  scanf("%d", &n);
  prt(0, n, 0, 0);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%esi
xor    %ecx,%ecx
mov    %ecx,%edi
mov    %ecx,%edx
call   1030 <prt@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%esi
xor    %edi,%edi
xor    %edx,%edx
xor    %ecx,%ecx
call   1030 <prt@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = call i32 @prt(i32 0, i32 %4, i32 0, i32 0)
ret i32 0
}
int isValueEnd(char c) {
  if (c == ' ' || c == ':' || c == ';' || c == ']' || c == '\n' || c == '\t')
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<isValueEnd>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x20,%eax
je     1158 <isValueEnd+0x58>
movsbl -0x5(%rbp),%eax
cmp    $0x3a,%eax
je     1158 <isValueEnd+0x58>
movsbl -0x5(%rbp),%eax
cmp    $0x3b,%eax
je     1158 <isValueEnd+0x58>
movsbl -0x5(%rbp),%eax
cmp    $0x5d,%eax
je     1158 <isValueEnd+0x58>
movsbl -0x5(%rbp),%eax
cmp    $0xa,%eax
je     1158 <isValueEnd+0x58>
movsbl -0x5(%rbp),%eax
cmp    $0x9,%eax
jne    1164 <isValueEnd+0x64>
movl   $0x1,-0x4(%rbp)
jmp    116b <isValueEnd+0x6b>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isValueEnd>:
mov    $0x1,%eax
lea    -0x20(%rdi),%ecx
cmp    $0x3d,%cl
ja     1120 <isValueEnd+0x20>
movzbl %cl,%ecx
movabs $0x200000000c000001,%rdx
bt     %rcx,%rdx
jb     112a <isValueEnd+0x2a>
add    $0xf7,%dil
cmp    $0x2,%dil
jae    112b <isValueEnd+0x2b>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @isValueEnd(i8 signext %0) {
switch i8 %0, label %2 [
i8 93, label %3
i8 59, label %3
i8 58, label %3
i8 32, label %3
i8 10, label %3
i8 9, label %3
]
2: ; preds = %1
br label %3
3: ; preds = %1, %1, %1, %1, %1, %1, %2
%4 = phi i32 [ 0, %2 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ]
ret i32 %4
}
unsigned long pax_close_kernel(void) { return 0; }


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

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

LLVM IR (-O0):
define i64 @pax_close_kernel() {
ret i64 0
}

LLVM IR (-O2):
define i64 @pax_close_kernel() {
ret i64 0
}
/* Variables and functions */
int PAPI_library_init(int);
void PAPIF_LIBRARY_INIT(int *check) { *check = PAPI_library_init(*check); }


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

x86 assembly (clang, -O2):
<PAPIF_LIBRARY_INIT>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%edi
call   1030 <PAPI_library_init@plt>
mov    %eax,(%rbx)
pop    %rbx
ret

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

LLVM IR (-O2):
define void @PAPIF_LIBRARY_INIT(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = tail call i32 @PAPI_library_init(i32 %2)
store i32 %3, i32* %0
ret void
}
/* Type definitions */
typedef int uint8_t;
typedef int uint16_t;

/* Variables and functions */
uint8_t instruction_extension_extract_da(uint16_t instruction) {
  return (instruction >> 0x0F) & 0x01;
}


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

x86 assembly (clang, -O2):
<instruction_extension_extract_da>:
mov    %edi,%eax
shr    $0xf,%eax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @instruction_extension_extract_da(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = ashr i32 %3, 15
%5 = and i32 %4, 1
ret i32 %5
}

LLVM IR (-O2):
define i32 @instruction_extension_extract_da(i32 %0) {
%2 = lshr i32 %0, 15
%3 = and i32 %2, 1
ret i32 %3
}
int sdr_get_reservation(unsigned char *res_id, int fdev) { return (-1); }


x86 assembly (clang, -O0):
<sdr_get_reservation>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    $0xffffffff,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @sdr_get_reservation(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
ret i32 -1
}

LLVM IR (-O2):
define i32 @sdr_get_reservation(i8* nocapture readnone %0, i32 %1) {
ret i32 -1
}
int _fstat(int fd, struct stat *stat) { return -1; }


x86 assembly (clang, -O0):
<_fstat>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0xffffffff,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.stat = type opaque
define i32 @_fstat(i32 %0, %struct.stat* %1) {
%3 = alloca i32
%4 = alloca %struct.stat*
store i32 %0, i32* %3
store %struct.stat* %1, %struct.stat** %4
ret i32 -1
}

LLVM IR (-O2):
%struct.stat = type opaque
define i32 @_fstat(i32 %0, %struct.stat* nocapture readnone %1) {
ret i32 -1
}
void av_bprint_append_data() {}


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

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

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

LLVM IR (-O2):
define void @av_bprint_append_data() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int f();
int main() {
  if (f() != 3) {
    abort();
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <f@plt>
cmp    $0x3,%eax
je     113b <main+0x1b>
mov    $0x0,%al
call   1030 <abort@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <f@plt>
cmp    $0x3,%eax
jne    1131 <main+0x11>
xor    %eax,%eax
pop    %rcx
ret
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 (...) @f()
%2 = icmp ne i32 %1, 3
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = call i32 (...) @abort()
unreachable
5: ; preds = %0
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @f()
%2 = icmp eq i32 %1, 3
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 (...) @abort()
unreachable
5: ; preds = %0
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ feof(int /*<<< orphan*/ *);
int /*<<< orphan*/ fgetc(int /*<<< orphan*/ *);
int /*<<< orphan*/ fputc(int /*<<< orphan*/, int /*<<< orphan*/ *);
int adpcm8_nodecode(FILE *fi, FILE *fo) {
  while (!feof(fi))
    fputc(fgetc(fi), fo);
}


x86 assembly (clang, -O0):
<adpcm8_nodecode>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <feof@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    115e <adpcm8_nodecode+0x2e>
jmp    1177 <adpcm8_nodecode+0x47>
mov    -0x10(%rbp),%rdi
call   1030 <fgetc@plt>
mov    %eax,%edi
mov    -0x18(%rbp),%rsi
call   1040 <fputc@plt>
jmp    1140 <adpcm8_nodecode+0x10>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<adpcm8_nodecode>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
nopw   0x0(%rax,%rax,1)
call   1050 <feof@plt>
test   %eax,%eax
jne    1160 <adpcm8_nodecode+0x30>
mov    %rbx,%rdi
call   1030 <fgetc@plt>
mov    %eax,%edi
mov    %r14,%rsi
call   1040 <fputc@plt>
mov    %rbx,%rdi
jmp    1140 <adpcm8_nodecode+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @adpcm8_nodecode(i32* %0, i32* %1) {
%3 = alloca i32
%4 = alloca i32*
%5 = alloca i32*
store i32* %0, i32** %4
store i32* %1, i32** %5
br label %6
6: ; preds = %11, %2
%7 = load i32*, i32** %4
%8 = call i32 @feof(i32* %7)
%9 = icmp ne i32 %8, 0
%10 = xor i1 %9, true
br i1 %10, label %11, label %16
11: ; preds = %6
%12 = load i32*, i32** %4
%13 = call i32 @fgetc(i32* %12)
%14 = load i32*, i32** %5
%15 = call i32 @fputc(i32 %13, i32* %14)
br label %6
16: ; preds = %6
%17 = load i32, i32* %3
ret i32 %17
}

LLVM IR (-O2):
define i32 @adpcm8_nodecode(i32* nocapture %0, i32* nocapture %1) {
%3 = tail call i32 @feof(i32* %0)
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %10
5: ; preds = %2, %5
%6 = tail call i32 @fgetc(i32* %0)
%7 = tail call i32 @fputc(i32 %6, i32* %1)
%8 = tail call i32 @feof(i32* %0)
%9 = icmp eq i32 %8, 0
br i1 %9, label %5, label %10
10: ; preds = %5, %2
ret i32 undef
}
int _dlclose(void *ptr) {}


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

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

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

LLVM IR (-O2):
define i32 @_dlclose(i8* nocapture readnone %0) {
ret i32 undef
}
/* Type definitions */
typedef scalar_t__ volatile uint8_t;

/* Variables and functions */
uint8_t volatile_fetch_sub_u8(volatile uint8_t *dest, uint8_t val) {
  uint8_t result = *dest;
  *dest = result - val;
  return result;
}


x86 assembly (clang, -O0):
<volatile_fetch_sub_u8>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rcx
mov    -0x10(%rbp),%rax
sub    %rax,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<volatile_fetch_sub_u8>:
mov    %rsi,-0x8(%rsp)
mov    (%rdi),%rax
mov    %rax,-0x10(%rsp)
mov    -0x10(%rsp),%rax
sub    -0x8(%rsp),%rax
mov    %rax,(%rdi)
mov    -0x10(%rsp),%rax
ret

LLVM IR (-O0):
define i64 @volatile_fetch_sub_u8(i64* %0, i64 %1) {
%3 = alloca i64*
%4 = alloca i64
%5 = alloca i64
store i64* %0, i64** %3
store volatile i64 %1, i64* %4
%6 = load i64*, i64** %3
%7 = load volatile i64, i64* %6
store volatile i64 %7, i64* %5
%8 = load volatile i64, i64* %5
%9 = load volatile i64, i64* %4
%10 = sub nsw i64 %8, %9
%11 = load i64*, i64** %3
store volatile i64 %10, i64* %11
%12 = load volatile i64, i64* %5
ret i64 %12
}

LLVM IR (-O2):
define i64 @volatile_fetch_sub_u8(i64* %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store volatile i64 %1, i64* %3
%5 = bitcast i64* %4 to i8*
%6 = load volatile i64, i64* %0
store volatile i64 %6, i64* %4
%7 = load volatile i64, i64* %4
%8 = load volatile i64, i64* %3
%9 = sub nsw i64 %7, %8
store volatile i64 %9, i64* %0
%10 = load volatile i64, i64* %4
ret i64 %10
}
/* Type definitions */
typedef void uint8_t;
typedef int uint64_t;

/* Variables and functions */
int /*<<< orphan*/ sg_put_unaligned_be32(int, void *);
void sg_put_unaligned_be64(uint64_t val, void *p) {
  sg_put_unaligned_be32(val >> 32, p);
  sg_put_unaligned_be32(val, (uint8_t *)p + 4);
}


x86 assembly (clang, -O0):
<sg_put_unaligned_be64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x20,%ecx
sar    %cl,%edi
mov    -0x10(%rbp),%rsi
call   1030 <sg_put_unaligned_be32@plt>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
add    $0x4,%rsi
call   1030 <sg_put_unaligned_be32@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sg_put_unaligned_be64>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
call   1030 <sg_put_unaligned_be32@plt>
add    $0x4,%rbx
mov    %ebp,%edi
mov    %rbx,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <sg_put_unaligned_be32@plt>

LLVM IR (-O0):
define void @sg_put_unaligned_be64(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i32, i32* %3
%6 = ashr i32 %5, 32
%7 = load i8*, i8** %4
%8 = call i32 @sg_put_unaligned_be32(i32 %6, i8* %7)
%9 = load i32, i32* %3
%10 = load i8*, i8** %4
%11 = getelementptr i8, i8* %10, i64 4
%12 = call i32 @sg_put_unaligned_be32(i32 %9, i8* %11)
ret void
}

LLVM IR (-O2):
define void @sg_put_unaligned_be64(i32 %0, i8* %1) {
%3 = tail call i32 @sg_put_unaligned_be32(i32 poison, i8* %1)
%4 = getelementptr i8, i8* %1, i64 4
%5 = tail call i32 @sg_put_unaligned_be32(i32 %0, i8* %4)
ret void
}
void pswp(void *A, void *B) {
  void **a = A, **b = B, *p;
  p = *a, *a = *b, *b = p;
}


x86 assembly (clang, -O0):
<pswp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rax
mov    (%rax),%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x28(%rbp),%rcx
mov    -0x20(%rbp),%rax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<pswp>:
mov    (%rdi),%rax
mov    (%rsi),%rcx
mov    %rcx,(%rdi)
mov    %rax,(%rsi)
ret

LLVM IR (-O0):
define void @pswp(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8**
%6 = alloca i8**
%7 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%8 = load i8*, i8** %3
%9 = bitcast i8* %8 to i8**
store i8** %9, i8*** %5
%10 = load i8*, i8** %4
%11 = bitcast i8* %10 to i8**
store i8** %11, i8*** %6
%12 = load i8**, i8*** %5
%13 = load i8*, i8** %12
store i8* %13, i8** %7
%14 = load i8**, i8*** %6
%15 = load i8*, i8** %14
%16 = load i8**, i8*** %5
store i8* %15, i8** %16
%17 = load i8*, i8** %7
%18 = load i8**, i8*** %6
store i8* %17, i8** %18
ret void
}

LLVM IR (-O2):
define void @pswp(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i8**
%4 = bitcast i8* %1 to i8**
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
store i8* %6, i8** %3
store i8* %5, i8** %4
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(char *, char *, int);
int strlen(char *);
void insert_item(char *item, char **shared_buffer, char *shared_start) {
  int n = strlen(item);
  memcpy(*shared_buffer, item, n);
  *shared_buffer = *shared_buffer + n;
}


x86 assembly (clang, -O0):
<insert_item>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x1c(%rbp),%edx
call   1040 <memcpy@plt>
mov    -0x10(%rbp),%rax
mov    (%rax),%rcx
movslq -0x1c(%rbp),%rax
add    %rax,%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<insert_item>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <strlen@plt>
mov    %eax,%ebp
mov    (%r14),%rdi
mov    %rbx,%rsi
mov    %eax,%edx
call   1040 <memcpy@plt>
movslq %ebp,%rax
add    %rax,(%r14)
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define void @insert_item(i8* %0, i8** nocapture %1, i8* nocapture readnone %2) {
%4 = tail call i32 @strlen(i8* %0)
%5 = load i8*, i8** %1
%6 = tail call i32 @memcpy(i8* %5, i8* %0, i32 %4)
%7 = load i8*, i8** %1
%8 = sext i32 %4 to i64
%9 = getelementptr inbounds i8, i8* %7, i64 %8
store i8* %9, i8** %1
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int EOF;
int fgetc(int /*<<< orphan*/ *);
int taille_fichier(FILE *f) {
  int car;
  int i = 0;
  do {
    car = fgetc(f);
    i++;
  } while (car != EOF);
  return i;
}


x86 assembly (clang, -O0):
<taille_fichier>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <fgetc@plt>
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
mov    0x2ea6(%rip),%rcx
cmp    (%rcx),%eax
jne    1123 <taille_fichier+0x13>
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<taille_fichier>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
xor    %ebx,%ebx
mov    0x2ec7(%rip),%r15
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %r14,%rdi
call   1030 <fgetc@plt>
add    $0x1,%ebx
cmp    (%r15),%eax
jne    1130 <taille_fichier+0x20>
mov    %ebx,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@EOF = global i32 0
define i32 @taille_fichier(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
%4 = alloca i32
store i32* %0, i32** %2
store i32 0, i32* %4
br label %5
5: ; preds = %10, %1
%6 = load i32*, i32** %2
%7 = call i32 @fgetc(i32* %6)
store i32 %7, i32* %3
%8 = load i32, i32* %4
%9 = add nsw i32 %8, 1
store i32 %9, i32* %4
br label %10
10: ; preds = %5
%11 = load i32, i32* %3
%12 = load i32, i32* @EOF
%13 = icmp ne i32 %11, %12
br i1 %13, label %5, label %14
14: ; preds = %10
%15 = load i32, i32* %4
ret i32 %15
}

LLVM IR (-O2):
@EOF = global i32 0
define i32 @taille_fichier(i32* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i32 [ 0, %1 ], [ %5, %2 ]
%4 = tail call i32 @fgetc(i32* %0)
%5 = add nuw nsw i32 %3, 1
%6 = load i32, i32* @EOF
%7 = icmp eq i32 %4, %6
br i1 %7, label %8, label %2
8: ; preds = %2
ret i32 %5
}
/* Variables and functions */
scalar_t__ SIG_IGN;
void *signal_set(int, void *, int /*<<< orphan*/ *);
void *signal_ignore(int signo) {
  return signal_set(signo, (void *)SIG_IGN, NULL);
}


x86 assembly (clang, -O0):
<signal_ignore>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2ec3(%rip),%rax
mov    (%rax),%rsi
xor    %eax,%eax
mov    %eax,%edx
call   1030 <signal_set@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<signal_ignore>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%rsi
xor    %edx,%edx
jmp    1030 <signal_set@plt>

LLVM IR (-O0):
@SIG_IGN = global i64 0
define i8* @signal_ignore(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i64, i64* @SIG_IGN
%5 = inttoptr i64 %4 to i8*
%6 = call i8* @signal_set(i32 %3, i8* %5, i32* null)
ret i8* %6
}

LLVM IR (-O2):
@SIG_IGN = global i64 0
define i8* @signal_ignore(i32 %0) {
%2 = load i64, i64* @SIG_IGN
%3 = inttoptr i64 %2 to i8*
%4 = tail call i8* @signal_set(i32 %0, i8* %3, i32* null)
ret i8* %4
}
unsigned short __atomic_exchange_2(volatile void *atom, unsigned short value,
                                   int memorder) {
  unsigned short xchg;
  unsigned short cmp;
  __atomic_load((unsigned short *)atom, (unsigned short *)&cmp, 0);
  do {
    xchg = (value);
  } while (
      !__atomic_compare_exchange((unsigned short *)atom, &cmp, &xchg, 1, 5, 5));
  return cmp;
}


x86 assembly (clang, -O0):
<__atomic_exchange_2>:
push   %rbp
mov    %rsp,%rbp
mov    %si,%ax
mov    %rdi,-0x8(%rbp)
mov    %ax,-0xa(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%ax
mov    %ax,-0x14(%rbp)
mov    -0xa(%rbp),%ax
mov    %ax,-0x12(%rbp)
mov    -0x8(%rbp),%rcx
mov    -0x14(%rbp),%ax
mov    -0x12(%rbp),%dx
lock cmpxchg %dx,(%rcx)
mov    %ax,%cx
sete   %al
mov    %al,-0x19(%rbp)
mov    %cx,-0x18(%rbp)
test   $0x1,%al
jne    1153 <__atomic_exchange_2+0x53>
mov    -0x18(%rbp),%ax
mov    %ax,-0x14(%rbp)
mov    -0x19(%rbp),%al
and    $0x1,%al
mov    %al,-0x15(%rbp)
mov    -0x15(%rbp),%al
xor    $0xff,%al
test   $0x1,%al
jne    111d <__atomic_exchange_2+0x1d>
movzwl -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__atomic_exchange_2>:
movzwl (%rdi),%eax
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %eax,%ecx
lock cmpxchg %si,(%rdi)
jne    1110 <__atomic_exchange_2+0x10>
mov    %ecx,%eax
ret

LLVM IR (-O0):
define zeroext i16 @__atomic_exchange_2(i8* %0, i16 zeroext %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i16
%6 = alloca i32
%7 = alloca i16
%8 = alloca i16
%9 = alloca i8
store i8* %0, i8** %4
store i16 %1, i16* %5
store i32 %2, i32* %6
%10 = load i8*, i8** %4
%11 = bitcast i8* %10 to i16*
%12 = load atomic i16, i16* %11 monotonic
store i16 %12, i16* %8
br label %13
13: ; preds = %24, %3
%14 = load i16, i16* %5
store i16 %14, i16* %7
br label %15
15: ; preds = %13
%16 = load i8*, i8** %4
%17 = bitcast i8* %16 to i16*
%18 = load i16, i16* %8
%19 = load i16, i16* %7
%20 = cmpxchg weak i16* %17, i16 %18, i16 %19 seq_cst seq_cst
%21 = extractvalue { i16, i1 } %20, 0
%22 = extractvalue { i16, i1 } %20, 1
br i1 %22, label %24, label %23
23: ; preds = %15
store i16 %21, i16* %8
br label %24
24: ; preds = %23, %15
%25 = zext i1 %22 to i8
store i8 %25, i8* %9
%26 = load i8, i8* %9
%27 = trunc i8 %26 to i1
%28 = xor i1 %27, true
br i1 %28, label %13, label %29
29: ; preds = %24
%30 = load i16, i16* %8
ret i16 %30
}

LLVM IR (-O2):
define zeroext i16 @__atomic_exchange_2(i8* nocapture %0, i16 zeroext %1, i32 %2) {
%4 = bitcast i8* %0 to i16*
%5 = load atomic i16, i16* %4 monotonic
br label %6
6: ; preds = %6, %3
%7 = phi i16 [ %5, %3 ], [ %10, %6 ]
%8 = cmpxchg weak i16* %4, i16 %7, i16 %1 seq_cst seq_cst
%9 = extractvalue { i16, i1 } %8, 1
%10 = extractvalue { i16, i1 } %8, 0
br i1 %9, label %11, label %6
11: ; preds = %6
ret i16 %7
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ unlink(char *);
void daemon_kill(int sig) {
  unlink("/var/run/netled.pid");
  exit(0);
}


x86 assembly (clang, -O0):
<daemon_kill>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xece(%rip),%rdi
call   1030 <unlink@plt>
xor    %edi,%edi
call   1040 <exit@plt>

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

LLVM IR (-O0):
@.str = [20 x i8] c"/var/run/netled.pid\00"
define void @daemon_kill(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @unlink(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [20 x i8] c"/var/run/netled.pid\00"
define void @daemon_kill(i32 %0) {
%2 = tail call i32 @unlink(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 0)
unreachable
}
void limiterror(message) char *message;
{
  error2error("compiler limit exceeded - ", message);
  finishup();
}


x86 assembly (clang, -O0):
<limiterror>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec9(%rip),%rdi
mov    $0x0,%al
call   1040 <error2error@plt>
mov    $0x0,%al
call   1030 <finishup@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<limiterror>:
push   %rax
mov    %rdi,%rsi
lea    0xed5(%rip),%rdi
xor    %eax,%eax
call   1040 <error2error@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <finishup@plt>

LLVM IR (-O0):
@.str = [27 x i8] c"compiler limit exceeded - \00"
define void @limiterror(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @error2error to i32 (i8*, i8*, ...)*)(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = call i32 (...) @finishup()
ret void
}

LLVM IR (-O2):
@.str = [27 x i8] c"compiler limit exceeded - \00"
define void @limiterror(i8* %0) {
%2 = tail call i32 (i8*, i8*, ...) bitcast (i32 (...)* @error2error to i32 (i8*, i8*, ...)*)(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 (...) @finishup()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128i;

/* Variables and functions */
int /*<<< orphan*/ _mm_ror_epi32(int /*<<< orphan*/, int);
__attribute__((always_)) __m128i rot7_128(__m128i x) {
  return _mm_ror_epi32(x, 7);
}


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

x86 assembly (clang, -O2):
<rot7_128>:
mov    $0x7,%esi
jmp    1030 <_mm_ror_epi32@plt>

LLVM IR (-O0):
define i32 @rot7_128(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @_mm_ror_epi32(i32 %3, i32 7)
ret i32 %4
}

LLVM IR (-O2):
define i32 @rot7_128(i32 %0) {
%2 = tail call i32 @_mm_ror_epi32(i32 %0, i32 7)
ret i32 %2
}
/* Variables and functions */
int caca_rand(int, int);
int get_random_dither(void) { return caca_rand(0x00, 0x100); }


x86 assembly (clang, -O0):
<get_random_dither>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
mov    $0x100,%esi
call   1030 <caca_rand@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_random_dither>:
xor    %edi,%edi
mov    $0x100,%esi
jmp    1030 <caca_rand@plt>

LLVM IR (-O0):
define i32 @get_random_dither() {
%1 = call i32 @caca_rand(i32 0, i32 256)
ret i32 %1
}

LLVM IR (-O2):
define i32 @get_random_dither() {
%1 = tail call i32 @caca_rand(i32 0, i32 256)
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ sleep_milliseconds(unsigned long);
void Delay(unsigned long delay) { sleep_milliseconds(delay); }


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

x86 assembly (clang, -O2):
<Delay>:
jmp    1030 <sleep_milliseconds@plt>

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

LLVM IR (-O2):
define void @Delay(i64 %0) {
%2 = tail call i32 @sleep_milliseconds(i64 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, char *);
void print_error_5(char *message) {
  printf("can not open the file : %s , please check this error --> exit\n",
         message);
  exit(105);
}


x86 assembly (clang, -O0):
<print_error_5>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
mov    $0x69,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<print_error_5>:
push   %rax
mov    %rdi,%rsi
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x69,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [63 x i8] c"can not open the file : %s , please check this error --> exit\0A\00"
define void @print_error_5(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = call i32 @exit(i32 105)
unreachable
}

LLVM IR (-O2):
@.str = [63 x i8] c"can not open the file : %s , please check this error --> exit\0A\00"
define void @print_error_5(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @exit(i32 105)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ runMainThread();
int main(void) {
  runMainThread();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @runMainThread()
ret i32 0
}
signed int signedint_ignoring_unsignedchar(signed int x, unsigned char y) {
  return x;
}


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

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

LLVM IR (-O0):
define i32 @signedint_ignoring_unsignedchar(i32 %0, i8 zeroext %1) {
%3 = alloca i32
%4 = alloca i8
store i32 %0, i32* %3
store i8 %1, i8* %4
%5 = load i32, i32* %3
ret i32 %5
}

LLVM IR (-O2):
define i32 @signedint_ignoring_unsignedchar(i32 returned %0, i8 zeroext %1) {
ret i32 %0
}