xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stdout;
void write_stdout() { fprintf(stdout, "testing output to stdout\n"); }


x86 assembly (clang, -O0):
<write_stdout>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_stdout>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stdout = global i32 0
@.str = [26 x i8] c"testing output to stdout\0A\00"
define void @write_stdout() {
%1 = load i32, i32* @stdout
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [26 x i8] c"testing output to stdout\0A\00"
define void @write_stdout() {
%1 = load i32, i32* @stdout
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ delayUs(int);
void delayMs(unsigned char t) {
  while (t--) {
    delayUs(245);
    delayUs(245);
  }
}


x86 assembly (clang, -O0):
<delayMs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    -0x1(%rbp),%al
mov    %al,%cl
add    $0xff,%cl
mov    %cl,-0x1(%rbp)
cmp    $0x0,%al
je     114a <delayMs+0x3a>
mov    $0xf5,%edi
call   1030 <delayUs@plt>
mov    $0xf5,%edi
call   1030 <delayUs@plt>
jmp    111e <delayMs+0xe>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<delayMs>:
push   %rbx
test   %edi,%edi
je     1139 <delayMs+0x29>
mov    %edi,%ebx
nopw   0x0(%rax,%rax,1)
mov    $0xf5,%edi
call   1030 <delayUs@plt>
mov    $0xf5,%edi
call   1030 <delayUs@plt>
add    $0xff,%bl
jne    1120 <delayMs+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @delayMs(i8 zeroext %0) {
%2 = icmp eq i8 %0, 0
br i1 %2, label %9, label %3
3: ; preds = %1, %3
%4 = phi i8 [ %5, %3 ], [ %0, %1 ]
%5 = add i8 %4, -1
%6 = tail call i32 @delayUs(i32 245)
%7 = tail call i32 @delayUs(i32 245)
%8 = icmp eq i8 %5, 0
br i1 %8, label %9, label %3
9: ; preds = %3, %1
ret void
}
/* Variables and functions */
float expf(float);
float kneecurve(float x, float k, float linearthreshold) {
  return linearthreshold + (1.0f - expf(-k * (x - linearthreshold))) / k;
}


x86 assembly (clang, -O0):
<kneecurve>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x8(%rbp),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
movss  -0x4(%rbp),%xmm1
subss  -0xc(%rbp),%xmm1
mulss  %xmm1,%xmm0
call   1030 <expf@plt>
movaps %xmm0,%xmm2
movss  -0x10(%rbp),%xmm0
movss  0xe9a(%rip),%xmm1
subss  %xmm2,%xmm1
divss  -0x8(%rbp),%xmm1
addss  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<kneecurve>:
sub    $0x28,%rsp
movss  %xmm2,0xc(%rsp)
movaps %xmm1,0x10(%rsp)
movaps 0xeda(%rip),%xmm3
xorps  %xmm1,%xmm3
subss  %xmm2,%xmm0
mulss  %xmm3,%xmm0
call   1030 <expf@plt>
movss  0xed2(%rip),%xmm1
subss  %xmm0,%xmm1
divss  0x10(%rsp),%xmm1
addss  0xc(%rsp),%xmm1
movaps %xmm1,%xmm0
add    $0x28,%rsp
ret

LLVM IR (-O0):
define float @kneecurve(float %0, float %1, float %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca float
store float %0, float* %4
store float %1, float* %5
store float %2, float* %6
%7 = load float, float* %6
%8 = load float, float* %5
%9 = fneg float %8
%10 = load float, float* %4
%11 = load float, float* %6
%12 = fsub float %10, %11
%13 = fmul float %9, %12
%14 = call float @expf(float %13)
%15 = fsub float 1.000000e+00, %14
%16 = load float, float* %5
%17 = fdiv float %15, %16
%18 = fadd float %7, %17
ret float %18
}

LLVM IR (-O2):
define float @kneecurve(float %0, float %1, float %2) {
%4 = fneg float %1
%5 = fsub float %0, %2
%6 = fmul float %5, %4
%7 = tail call float @expf(float %6)
%8 = fsub float 1.000000e+00, %7
%9 = fdiv float %8, %1
%10 = fadd float %9, %2
ret float %10
}
void after_fork() {
  int i;
  char buf[16];
  for (i = 0; i < 16; i++) {
    buf[i] = i;
  }
  buf[16] = '\0';
}


x86 assembly (clang, -O0):
<after_fork>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
cmpl   $0x10,-0x4(%rbp)
jge    1130 <after_fork+0x30>
mov    -0x4(%rbp),%eax
mov    %al,%cl
movslq -0x4(%rbp),%rax
mov    %cl,-0x20(%rbp,%rax,1)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    110b <after_fork+0xb>
movb   $0x0,-0x10(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @after_fork() {
%1 = alloca i32
%2 = alloca [16 x i8]
store i32 0, i32* %1
br label %3
3: ; preds = %12, %0
%4 = load i32, i32* %1
%5 = icmp slt i32 %4, 16
br i1 %5, label %6, label %15
6: ; preds = %3
%7 = load i32, i32* %1
%8 = trunc i32 %7 to i8
%9 = load i32, i32* %1
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds [16 x i8], [16 x i8]* %2, i64 0, i64 %10
store i8 %8, i8* %11
br label %12
12: ; preds = %6
%13 = load i32, i32* %1
%14 = add nsw i32 %13, 1
store i32 %14, i32* %1
br label %3
15: ; preds = %3
%16 = getelementptr inbounds [16 x i8], [16 x i8]* %2, i64 0, i64 16
store i8 0, i8* %16
ret void
}

LLVM IR (-O2):
define void @after_fork() {
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t ntohl(uint32_t d) {
  return ((d & 0x000000ffUL) << 24) | ((d & 0x0000ff00UL) << 8) |
         ((d & 0x00ff0000UL) >> 8) | ((d & 0xff000000UL) >> 24);
}


x86 assembly (clang, -O0):
<ntohl>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movslq -0x4(%rbp),%rax
and    $0xff,%rax
shl    $0x18,%rax
movslq -0x4(%rbp),%rcx
and    $0xff00,%rcx
shl    $0x8,%rcx
or     %rcx,%rax
movslq -0x4(%rbp),%rcx
and    $0xff0000,%rcx
shr    $0x8,%rcx
or     %rcx,%rax
movslq -0x4(%rbp),%rcx
movabs $0xff000000,%rdx
and    %rdx,%rcx
shr    $0x18,%rcx
or     %rcx,%rax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @ntohl(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sext i32 %3 to i64
%5 = and i64 %4, 255
%6 = shl i64 %5, 24
%7 = load i32, i32* %2
%8 = sext i32 %7 to i64
%9 = and i64 %8, 65280
%10 = shl i64 %9, 8
%11 = or i64 %6, %10
%12 = load i32, i32* %2
%13 = sext i32 %12 to i64
%14 = and i64 %13, 16711680
%15 = lshr i64 %14, 8
%16 = or i64 %11, %15
%17 = load i32, i32* %2
%18 = sext i32 %17 to i64
%19 = and i64 %18, 4278190080
%20 = lshr i64 %19, 24
%21 = or i64 %16, %20
%22 = trunc i64 %21 to i32
ret i32 %22
}

LLVM IR (-O2):
define i32 @ntohl(i32 %0) {
%2 = call i32 @llvm.bswap.i32(i32 %0)
ret i32 %2
}
char *strupr(char *s) {
  char c;
  char *s0;
  s0 = s;
  while (c = *s) {
    *s = ((((c) >= 'a') && ((c) <= 'z')) ? (c) - '\x20' : (c));
    s += 1;
  }
  return s0;
}


x86 assembly (clang, -O0):
<strupr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x9(%rbp)
cmp    $0x0,%al
je     116d <strupr+0x6d>
movsbl -0x9(%rbp),%eax
cmp    $0x61,%eax
jl     114a <strupr+0x4a>
movsbl -0x9(%rbp),%eax
cmp    $0x7a,%eax
jg     114a <strupr+0x4a>
movsbl -0x9(%rbp),%eax
sub    $0x20,%eax
mov    %eax,-0x1c(%rbp)
jmp    1151 <strupr+0x51>
movsbl -0x9(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1110 <strupr+0x10>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strupr>:
mov    %rdi,%rax
mov    (%rdi),%dl
test   %dl,%dl
je     1133 <strupr+0x33>
lea    0x1(%rax),%rcx
nopl   (%rax)
lea    -0x61(%rdx),%esi
lea    -0x20(%rdx),%edi
cmp    $0x1a,%sil
movzbl %dl,%edx
movzbl %dil,%esi
cmovae %edx,%esi
mov    %sil,-0x1(%rcx)
movzbl (%rcx),%edx
add    $0x1,%rcx
test   %dl,%dl
jne    1110 <strupr+0x10>
ret

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

LLVM IR (-O2):
define i8* @strupr(i8* returned %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 i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i8* [ %11, %4 ], [ %0, %1 ]
%7 = add i8 %5, -97
%8 = icmp ult i8 %7, 26
%9 = add i8 %5, -32
%10 = select i1 %8, i8 %9, i8 %5
store i8 %10, i8* %6
%11 = getelementptr inbounds i8, i8* %6, i64 1
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4, %1
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void print_val(int val) { printf("%d\n", val); }


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define void @print_val(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
/* Variables and functions */
double maxf(double const, int /*<<< orphan*/);
int /*<<< orphan*/ minf(double const, double const);
double clampf(const double min, const double v, const double max) {
  return maxf(min, minf(v, max));
}


x86 assembly (clang, -O0):
<clampf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
call   1040 <minf@plt>
movsd  -0x20(%rbp),%xmm0
mov    %eax,%edi
call   1030 <maxf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clampf>:
push   %rax
movsd  %xmm0,(%rsp)
movaps %xmm1,%xmm0
movaps %xmm2,%xmm1
call   1040 <minf@plt>
movsd  (%rsp),%xmm0
mov    %eax,%edi
pop    %rax
jmp    1030 <maxf@plt>

LLVM IR (-O0):
define double @clampf(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%7 = load double, double* %4
%8 = load double, double* %5
%9 = load double, double* %6
%10 = call i32 @minf(double %8, double %9)
%11 = call double @maxf(double %7, i32 %10)
ret double %11
}

LLVM IR (-O2):
define double @clampf(double %0, double %1, double %2) {
%4 = tail call i32 @minf(double %1, double %2)
%5 = tail call double @maxf(double %0, i32 %4)
ret double %5
}
int test_imm_8Eint64_lowword_mem(long long *val) {
  return ((*val) & (0x8E << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_8Eint64_lowword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = and i64 %4, 142
%6 = icmp ne i64 %5, 0
%7 = zext i1 %6 to i64
%8 = select i1 %6, i32 -20, i32 -40
ret i32 %8
}

LLVM IR (-O2):
define i32 @test_imm_8Eint64_lowword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 142
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
int rmdir(char *dir) {}


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

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

LLVM IR (-O0):
define i32 @rmdir(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 @rmdir(i8* nocapture readnone %0) {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ ASM_FUNC(int);
unsigned char func(unsigned char arg0) {
  ASM_FUNC(3);
  return arg0 + 3;
}


x86 assembly (clang, -O0):
<func>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    $0x3,%edi
call   1030 <ASM_FUNC@plt>
movzbl -0x1(%rbp),%eax
add    $0x3,%eax
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<func>:
push   %rbx
mov    %edi,%ebx
mov    $0x3,%edi
call   1030 <ASM_FUNC@plt>
add    $0x3,%bl
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define zeroext i8 @func(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = call i32 @ASM_FUNC(i32 3)
%4 = load i8, i8* %2
%5 = zext i8 %4 to i32
%6 = add nsw i32 %5, 3
%7 = trunc i32 %6 to i8
ret i8 %7
}

LLVM IR (-O2):
define zeroext i8 @func(i8 zeroext %0) {
%2 = tail call i32 @ASM_FUNC(i32 3)
%3 = add i8 %0, 3
ret i8 %3
}
/* Type definitions */
struct sapi_event_data {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct sapi_event_data *);
void sapi_event_system_deinit(void *libctx) {
  struct sapi_event_data *evt = libctx;
  free(evt);
}


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

x86 assembly (clang, -O2):
<sapi_event_system_deinit>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
%struct.sapi_event_data = type { i32 }
define void @sapi_event_system_deinit(i8* nocapture %0) {
%2 = bitcast i8* %0 to %struct.sapi_event_data*
%3 = tail call i32 @free(%struct.sapi_event_data* %2)
ret void
}
void mls_context_destroy(struct context *c) {}


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

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

LLVM IR (-O0):
%struct.context = type opaque
define void @mls_context_destroy(%struct.context* %0) {
%2 = alloca %struct.context*
store %struct.context* %0, %struct.context** %2
ret void
}

LLVM IR (-O2):
%struct.context = type opaque
define void @mls_context_destroy(%struct.context* nocapture %0) {
ret void
}
/* Variables and functions */
int EXIT_SUCCESS;
float fahr2cel(float);
int /*<<< orphan*/ printf(char *, float, float);
int /*<<< orphan*/ scanf(char *, float *);
main() {
  float tf, tc;
  scanf("%f", &tf);
  tc = fahr2cel(tf);
  printf("%fF = %fC\n", tf, tc);
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
movss  -0x8(%rbp),%xmm0
call   1050 <fahr2cel@plt>
movss  %xmm0,-0xc(%rbp)
movss  -0x8(%rbp),%xmm0
movss  -0xc(%rbp),%xmm1
lea    0xe94(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e65(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
movss  0x4(%rsp),%xmm0
call   1050 <fahr2cel@plt>
movaps %xmm0,%xmm1
movss  0x4(%rsp),%xmm0
lea    0xea6(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e77(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%f\00"
@.str.1 = [11 x i8] c"%fF = %fC\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = alloca float
store i32 0, i32* %1
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float* %2)
%5 = load float, float* %2
%6 = call float @fahr2cel(float %5)
store float %6, float* %3
%7 = load float, float* %2
%8 = load float, float* %3
%9 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), float %7, float %8)
%10 = load i32, i32* @EXIT_SUCCESS
ret i32 %10
}

LLVM IR (-O2):
@.str = [3 x i8] c"%f\00"
@.str.1 = [11 x i8] c"%fF = %fC\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca float
%2 = bitcast float* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float* %1)
%4 = load float, float* %1
%5 = call float @fahr2cel(float %4)
%6 = load float, float* %1
%7 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), float %6, float %5)
%8 = load i32, i32* @EXIT_SUCCESS
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void print_help(char *argv[]) {
  printf("Usage: %s [OPTION]...\n\n"
         "Miscellaneous:\n"
         "  -h, --help\t\tprint help information and exit\n"
         "  -D, --debug\t\tset debug level\n"
         "  -V, --version\t\tprint version information and exit\n",
         argv[0]);
}


x86 assembly (clang, -O0):
<print_help>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rsi
lea    0xed6(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_help>:
mov    (%rdi),%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"Usage: %s [OPTION]...\0A\0AMiscellaneous:\0A -h, --help\09\09print help information and exit\0A -D, --debug\09\09set debug level\0A -V, --version\09\09print version information and exit\0A\00"
define void @print_help(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
%3 = load i8**, i8*** %2
%4 = getelementptr inbounds i8*, i8** %3, i64 0
%5 = load i8*, i8** %4
%6 = call i32 @printf(i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i8* %5)
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"Usage: %s [OPTION]...\0A\0AMiscellaneous:\0A -h, --help\09\09print help information and exit\0A -D, --debug\09\09set debug level\0A -V, --version\09\09print version information and exit\0A\00"
define void @print_help(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = tail call i32 @printf(i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i8* %2)
ret void
}
/* Type definitions */
struct rtas_post_scn {
  int dummy;
};
struct rtas_event {
  int dummy;
};

/* Variables and functions */
scalar_t__ get_re_scn(struct rtas_event *, int);
struct rtas_post_scn *rtas_get_post_scn(struct rtas_event *re) {
  return (struct rtas_post_scn *)get_re_scn(re, 8);
}


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

x86 assembly (clang, -O2):
<rtas_get_post_scn>:
mov    $0x8,%esi
jmp    1030 <get_re_scn@plt>

LLVM IR (-O0):
%struct.rtas_post_scn = type { i32 }
%struct.rtas_event = type { i32 }
define %struct.rtas_post_scn* @rtas_get_post_scn(%struct.rtas_event* %0) {
%2 = alloca %struct.rtas_event*
store %struct.rtas_event* %0, %struct.rtas_event** %2
%3 = load %struct.rtas_event*, %struct.rtas_event** %2
%4 = call i64 @get_re_scn(%struct.rtas_event* %3, i32 8)
%5 = inttoptr i64 %4 to %struct.rtas_post_scn*
ret %struct.rtas_post_scn* %5
}

LLVM IR (-O2):
%struct.rtas_post_scn = type { i32 }
%struct.rtas_event = type { i32 }
define %struct.rtas_post_scn* @rtas_get_post_scn(%struct.rtas_event* %0) {
%2 = tail call i64 @get_re_scn(%struct.rtas_event* %0, i32 8)
%3 = inttoptr i64 %2 to %struct.rtas_post_scn*
ret %struct.rtas_post_scn* %3
}
/* Variables and functions */
int _WRITE(int fd, const void *buf, size_t nbytes) { return 0; }


x86 assembly (clang, -O0):
<_WRITE>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @_WRITE(i32 %0, i8* nocapture readnone %1, i64 %2) {
ret i32 0
}
void fatal_halt() {
  __asm__ volatile("cli");
  for (;;)
    __asm__ volatile("hlt");
}


x86 assembly (clang, -O0):
<fatal_halt>:
push   %rbp
mov    %rsp,%rbp
cli
hlt
jmp    1105 <fatal_halt+0x5>

x86 assembly (clang, -O2):
<fatal_halt>:
cli
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
hlt
jmp    1110 <fatal_halt+0x10>

LLVM IR (-O0):
define void @fatal_halt() {
br label %1
1: ; preds = %1, %0
br label %1
}

LLVM IR (-O2):
define void @fatal_halt() {
tail call void asm sideeffect "cli", "~{dirflag},~{fpsr},~{flags}"()
br label %1
1: ; preds = %1, %0
tail call void asm sideeffect "hlt", "~{dirflag},~{fpsr},~{flags}"()
br label %1
}
void image_render() {}


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

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

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

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


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

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

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

LLVM IR (-O2):
define void @bn_mul_words() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ arm_mpy(int /*<<< orphan*/);
int /*<<< orphan*/ t16_mpy_op();
void t16_mul() { arm_mpy(t16_mpy_op()); }


x86 assembly (clang, -O0):
<t16_mul>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <t16_mpy_op@plt>
mov    %eax,%edi
call   1040 <arm_mpy@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t16_mul>:
push   %rax
xor    %eax,%eax
call   1030 <t16_mpy_op@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <arm_mpy@plt>

LLVM IR (-O0):
define void @t16_mul() {
%1 = call i32 (...) @t16_mpy_op()
%2 = call i32 @arm_mpy(i32 %1)
ret void
}

LLVM IR (-O2):
define void @t16_mul() {
%1 = tail call i32 (...) @t16_mpy_op()
%2 = tail call i32 @arm_mpy(i32 %1)
ret void
}
int emac1_etherstatsundersizepkts_set(
    unsigned int dev_id, union emac1_etherstatsundersizepkts_u *value) {
  return 1;
}


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

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

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

LLVM IR (-O2):
%union.emac1_etherstatsundersizepkts_u = type opaque
define i32 @emac1_etherstatsundersizepkts_set(i32 %0, %union.emac1_etherstatsundersizepkts_u* nocapture readnone %1) {
ret i32 1
}
int sum(int a, int b, int c) { return a + b + c; }


x86 assembly (clang, -O0):
<sum>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sum>:
lea    (%rdi,%rsi,1),%eax
add    %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @sum(i32 %0, i32 %1, i32 %2) {
%4 = add nsw i32 %1, %0
%5 = add nsw i32 %4, %2
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ system(char *);
void msg_welcome() {
  system("clear");
  printf(
      "                         ~~~ Welcome to Andoni's Markov Babbler ~~~\n");
  return;
}


x86 assembly (clang, -O0):
<msg_welcome>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <system@plt>
lea    0xecf(%rip),%rdi
call   1040 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<msg_welcome>:
push   %rax
lea    0xed8(%rip),%rdi
call   1040 <system@plt>
lea    0xed2(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"clear\00"
@.str.1 = [69 x i8] c" ~~~ Welcome to Andoni's Markov Babbler ~~~\0A\00"
define void @msg_welcome() {
%1 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([69 x i8], [69 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"clear\00"
@str = [68 x i8] c" ~~~ Welcome to Andoni's Markov Babbler ~~~\00"
define void @msg_welcome() {
%1 = tail call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([68 x i8], [68 x i8]* @str, i64 0, i64 0))
ret void
}
int to_disp(int c) {
  if ((c & 127) < ' ' || c == 127)
    c = '.';
  return c;
}


x86 assembly (clang, -O0):
<to_disp>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x7f,%eax
cmp    $0x20,%eax
jl     1120 <to_disp+0x20>
cmpl   $0x7f,-0x4(%rbp)
jne    1127 <to_disp+0x27>
movl   $0x2e,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<to_disp>:
test   $0x60,%dil
mov    $0x2e,%ecx
mov    %edi,%eax
cmove  %ecx,%eax
cmp    $0x7f,%edi
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @to_disp(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 127
%5 = icmp slt i32 %4, 32
br i1 %5, label %9, label %6
6: ; preds = %1
%7 = load i32, i32* %2
%8 = icmp eq i32 %7, 127
br i1 %8, label %9, label %10
9: ; preds = %6, %1
store i32 46, i32* %2
br label %10
10: ; preds = %9, %6
%11 = load i32, i32* %2
ret i32 %11
}

LLVM IR (-O2):
define i32 @to_disp(i32 %0) {
%2 = and i32 %0, 96
%3 = icmp eq i32 %2, 0
%4 = icmp eq i32 %0, 127
%5 = or i1 %4, %3
%6 = select i1 %5, i32 46, i32 %0
ret i32 %6
}
void test62_ArrMod_targetInit__I() {}


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

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

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

LLVM IR (-O2):
define void @test62_ArrMod_targetInit__I() {
ret void
}
void c_calobjf(int n, double *x, double *f, int *flag) {
  *flag = 0;
  *f = -x[0] * x[1] * x[2];
  return;
}


x86 assembly (clang, -O0):
<c_calobjf>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x20(%rbp),%rax
movl   $0x0,(%rax)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mov    -0x10(%rbp),%rax
mulsd  0x8(%rax),%xmm0
mov    -0x10(%rbp),%rax
mulsd  0x10(%rax),%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<c_calobjf>:
movl   $0x0,(%rcx)
movsd  (%rsi),%xmm0
xorpd  0xeee(%rip),%xmm0
mulsd  0x8(%rsi),%xmm0
mulsd  0x10(%rsi),%xmm0
movsd  %xmm0,(%rdx)
ret

LLVM IR (-O0):
define void @c_calobjf(i32 %0, double* %1, double* %2, i32* %3) {
%5 = alloca i32
%6 = alloca double*
%7 = alloca double*
%8 = alloca i32*
store i32 %0, i32* %5
store double* %1, double** %6
store double* %2, double** %7
store i32* %3, i32** %8
%9 = load i32*, i32** %8
store i32 0, i32* %9
%10 = load double*, double** %6
%11 = getelementptr inbounds double, double* %10, i64 0
%12 = load double, double* %11
%13 = fneg double %12
%14 = load double*, double** %6
%15 = getelementptr inbounds double, double* %14, i64 1
%16 = load double, double* %15
%17 = fmul double %13, %16
%18 = load double*, double** %6
%19 = getelementptr inbounds double, double* %18, i64 2
%20 = load double, double* %19
%21 = fmul double %17, %20
%22 = load double*, double** %7
store double %21, double* %22
ret void
}

LLVM IR (-O2):
define void @c_calobjf(i32 %0, double* nocapture %1, double* nocapture writeonly %2, i32* nocapture writeonly %3) {
store i32 0, i32* %3
%5 = load double, double* %1
%6 = fneg double %5
%7 = getelementptr inbounds double, double* %1, i64 1
%8 = load double, double* %7
%9 = fmul double %8, %6
%10 = getelementptr inbounds double, double* %1, i64 2
%11 = load double, double* %10
%12 = fmul double %9, %11
store double %12, double* %2
ret void
}
/* Variables and functions */
int isalpha(char);
int matchalpha(char c) { return isalpha(c); }


x86 assembly (clang, -O0):
<matchalpha>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edi
call   1030 <isalpha@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<matchalpha>:
jmp    1030 <isalpha@plt>

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

LLVM IR (-O2):
define i32 @matchalpha(i8 signext %0) {
%2 = tail call i32 @isalpha(i8 signext %0)
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_t;

/* Variables and functions */
int /*<<< orphan*/ pthread_self();
pthread_t Pthread_self(void) { return pthread_self(); }


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

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

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

LLVM IR (-O2):
define i32 @Pthread_self() {
%1 = tail call i32 (...) @pthread_self()
ret i32 %1
}
void BN_CTX_new(void) {}


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

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

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

LLVM IR (-O2):
define void @BN_CTX_new() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void global(char *s) {
  printf("\t.globl\t_%s\n", s);
  printf("\t.data\n");
  printf("\t.align %d\n", 4);
}


x86 assembly (clang, -O0):
<global>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xed9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xed8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xed2(%rip),%rdi
mov    $0x4,%esi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<global>:
push   %rax
mov    %rdi,%rsi
lea    0xed5(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xee0(%rip),%rdi
call   1030 <puts@plt>
lea    0xec8(%rip),%rdi
mov    $0x4,%esi
xor    %eax,%eax
pop    %rcx
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [13 x i8] c"\09.globl\09_%s\0A\00"
@.str.1 = [8 x i8] c"\09.data\0A\00"
@.str.2 = [12 x i8] c"\09.align %d\0A\00"
define void @global(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i32 4)
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c"\09.globl\09_%s\0A\00"
@.str.2 = [12 x i8] c"\09.align %d\0A\00"
@str = [7 x i8] c"\09.data\00"
define void @global(i8* %0) {
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i32 4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ begin_scan();
void primitive_begin_scan(void) { begin_scan(); }


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

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

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

LLVM IR (-O2):
define void @primitive_begin_scan() {
%1 = tail call i32 (...) @begin_scan()
ret void
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  unsigned long window;
};
typedef TYPE_1__ XFocusOutEvent;

/* Variables and functions */
void set_XFocusOutEvent_window(void *_p, unsigned long _v) {
  ((XFocusOutEvent *)_p)->window = (unsigned long)_v;
}


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

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

LLVM IR (-O0):
%struct.TYPE_2__ = type { i64 }
define void @set_XFocusOutEvent_window(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to %struct.TYPE_2__*
%8 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %7, i32 0, i32 0
store i64 %5, i64* %8
ret void
}

LLVM IR (-O2):
define void @set_XFocusOutEvent_window(i8* nocapture writeonly %0, i64 %1) {
%3 = bitcast i8* %0 to i64*
store i64 %1, i64* %3
ret void
}
int sign(double x) { return x < 0 ? -1 : 1; }


x86 assembly (clang, -O0):
<sign>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm1
xorps  %xmm0,%xmm0
mov    $0x1,%eax
mov    $0xffffffff,%ecx
ucomisd %xmm1,%xmm0
cmova  %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sign>:
xorpd  %xmm1,%xmm1
xor    %eax,%eax
ucomisd %xmm0,%xmm1
setbe  %al
add    %eax,%eax
add    $0xffffffff,%eax
ret

LLVM IR (-O0):
define i32 @sign(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fcmp olt double %3, 0.000000e+00
%5 = zext i1 %4 to i64
%6 = select i1 %4, i32 -1, i32 1
ret i32 %6
}

LLVM IR (-O2):
define i32 @sign(double %0) {
%2 = fcmp olt double %0, 0.000000e+00
%3 = select i1 %2, i32 -1, i32 1
ret i32 %3
}
char qsim_in() {
  char out;
  int ready;
  asm("cpuid;" : "=a"(ready) : "a"(0xc5b1fffe) : "%ebx", "%edx", "%ecx");
  if (!ready)
    exit(0);
  asm("cpuid;" : "=a"(out) : "a"(0xc5b1ffff) : "%ebx", "%edx", "%ecx");
  return out;
}


x86 assembly (clang, -O0):
<qsim_in>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
push   %rax
mov    $0xc5b1fffe,%eax
cpuid
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
jne    1131 <qsim_in+0x21>
xor    %edi,%edi
call   1030 <exit@plt>
mov    $0xc5b1ffff,%eax
cpuid
mov    %al,-0x9(%rbp)
movsbl -0x9(%rbp),%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<qsim_in>:
push   %rbx
mov    $0xc5b1fffe,%eax
cpuid
test   %eax,%eax
je     1125 <qsim_in+0x15>
mov    $0xc5b1ffff,%eax
cpuid
pop    %rbx
ret
xor    %edi,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
define signext i8 @qsim_in() {
%1 = alloca i8
%2 = alloca i32
%3 = call i32 asm "cpuid;", "={ax},{ax},~{ebx},~{edx},~{ecx},~{dirflag},~{fpsr},~{flags}"(i32 -978190338)
store i32 %3, i32* %2
%4 = load i32, i32* %2
%5 = icmp ne i32 %4, 0
br i1 %5, label %7, label %6
6: ; preds = %0
unreachable
7: ; preds = %0
%8 = call i8 asm "cpuid;", "={ax},{ax},~{ebx},~{edx},~{ecx},~{dirflag},~{fpsr},~{flags}"(i32 -978190337)
store i8 %8, i8* %1
%9 = load i8, i8* %1
ret i8 %9
}

LLVM IR (-O2):
define signext i8 @qsim_in() {
%1 = tail call i32 asm "cpuid;", "={ax},{ax},~{ebx},~{edx},~{ecx},~{dirflag},~{fpsr},~{flags}"(i32 -978190338)
%2 = icmp eq i32 %1, 0
br i1 %2, label %3, label %4
3: ; preds = %0
tail call void @exit(i32 0)
unreachable
4: ; preds = %0
%5 = tail call i8 asm "cpuid;", "={ax},{ax},~{ebx},~{edx},~{ecx},~{dirflag},~{fpsr},~{flags}"(i32 -978190337)
ret i8 %5
}
/* Variables and functions */
double RAND_MAX;
scalar_t__ rand();
double uniform(double a, double b) {
  return a + (b - a) * ((double)rand() / RAND_MAX);
}


x86 assembly (clang, -O0):
<uniform>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
subsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
movsd  -0x20(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
cvtsi2sd %rax,%xmm2
mov    0x2e90(%rip),%rax
divsd  (%rax),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uniform>:
sub    $0x18,%rsp
movsd  %xmm0,0x10(%rsp)
subsd  %xmm0,%xmm1
movsd  %xmm1,0x8(%rsp)
xor    %eax,%eax
call   1030 <rand@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
mov    0x2eae(%rip),%rax
divsd  (%rax),%xmm0
mulsd  0x8(%rsp),%xmm0
addsd  0x10(%rsp),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
@RAND_MAX = global double 0.000000e+00
define double @uniform(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 = load double, double* %4
%7 = load double, double* %3
%8 = fsub double %6, %7
%9 = call i64 (...) @rand()
%10 = sitofp i64 %9 to double
%11 = load double, double* @RAND_MAX
%12 = fdiv double %10, %11
%13 = call double @llvm.fmuladd.f64(double %8, double %12, double %5)
ret double %13
}

LLVM IR (-O2):
@RAND_MAX = global double 0.000000e+00
define double @uniform(double %0, double %1) {
%3 = fsub double %1, %0
%4 = tail call i64 (...) @rand()
%5 = sitofp i64 %4 to double
%6 = load double, double* @RAND_MAX
%7 = fdiv double %5, %6
%8 = tail call double @llvm.fmuladd.f64(double %3, double %7, double %0)
ret double %8
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
char *strdup(char *);
char *strtok_r(char *, char *, char **);
int _is_empty_string(char *string) {
  char *dup = strdup(string);
  char *scratch = NULL;
  char *delimiters = " \r\n\t";
  char *text = strtok_r(dup, delimiters, &scratch);
  if (text == NULL) {
    free(dup);
    return 1;
  }
  free(dup);
  return 0;
}


x86 assembly (clang, -O0):
<_is_empty_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <strdup@plt>
mov    %rax,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
lea    0xea8(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x28(%rbp),%rsi
lea    -0x20(%rbp),%rdx
call   1040 <strtok_r@plt>
mov    %rax,-0x30(%rbp)
cmpq   $0x0,-0x30(%rbp)
jne    1191 <_is_empty_string+0x61>
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
movl   $0x1,-0x4(%rbp)
jmp    11a1 <_is_empty_string+0x71>
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_is_empty_string>:
push   %rbp
push   %rbx
push   %rax
call   1050 <strdup@plt>
mov    %rax,%rbx
movq   $0x0,(%rsp)
lea    0xeb6(%rip),%rsi
mov    %rsp,%rdx
mov    %rax,%rdi
call   1040 <strtok_r@plt>
xor    %ebp,%ebp
test   %rax,%rax
sete   %bpl
mov    %rbx,%rdi
call   1030 <free@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [5 x i8] c" \0D\0A\09\00"
define i32 @_is_empty_string(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
store i8* %0, i8** %3
%8 = load i8*, i8** %3
%9 = call i8* @strdup(i8* %8)
store i8* %9, i8** %4
store i8* null, i8** %5
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8** %6
%10 = load i8*, i8** %4
%11 = load i8*, i8** %6
%12 = call i8* @strtok_r(i8* %10, i8* %11, i8** %5)
store i8* %12, i8** %7
%13 = load i8*, i8** %7
%14 = icmp eq i8* %13, null
br i1 %14, label %15, label %18
15: ; preds = %1
%16 = load i8*, i8** %4
%17 = call i32 @free(i8* %16)
store i32 1, i32* %2
br label %21
18: ; preds = %1
%19 = load i8*, i8** %4
%20 = call i32 @free(i8* %19)
store i32 0, i32* %2
br label %21
21: ; preds = %18, %15
%22 = load i32, i32* %2
ret i32 %22
}

LLVM IR (-O2):
@.str = [5 x i8] c" \0D\0A\09\00"
define i32 @_is_empty_string(i8* nocapture %0) {
%2 = alloca i8*
%3 = tail call i8* @strdup(i8* %0)
%4 = bitcast i8** %2 to i8*
store i8* null, i8** %2
%5 = call i8* @strtok_r(i8* %3, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8** %2)
%6 = icmp eq i8* %5, null
%7 = call i32 @free(i8* %3)
%8 = zext i1 %6 to i32
ret i32 %8
}
/* Variables and functions */
size_t lenstrarr(char **ptr_ptr) {
  size_t i = 0;
  while (ptr_ptr[i] != 0) {
    i += 1;
  }
  return i;
}


x86 assembly (clang, -O0):
<lenstrarr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
cmpq   $0x0,(%rax,%rcx,8)
je     1134 <lenstrarr+0x34>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <lenstrarr+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<lenstrarr>:
mov    $0xffffffffffffffff,%rax
nopw   0x0(%rax,%rax,1)
cmpq   $0x0,0x8(%rdi,%rax,8)
lea    0x1(%rax),%rax
jne    1110 <lenstrarr+0x10>
ret

LLVM IR (-O0):
define i64 @lenstrarr(i8** %0) {
%2 = alloca i8**
%3 = alloca i64
store i8** %0, i8*** %2
store i64 0, i64* %3
br label %4
4: ; preds = %10, %1
%5 = load i8**, i8*** %2
%6 = load i64, i64* %3
%7 = getelementptr inbounds i8*, i8** %5, i64 %6
%8 = load i8*, i8** %7
%9 = icmp ne i8* %8, null
br i1 %9, label %10, label %13
10: ; preds = %4
%11 = load i64, i64* %3
%12 = add i64 %11, 1
store i64 %12, i64* %3
br label %4
13: ; preds = %4
%14 = load i64, i64* %3
ret i64 %14
}

LLVM IR (-O2):
define i64 @lenstrarr(i8** nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ 0, %1 ], [ %7, %2 ]
%4 = getelementptr inbounds i8*, i8** %0, i64 %3
%5 = load i8*, i8** %4
%6 = icmp eq i8* %5, null
%7 = add i64 %3, 1
br i1 %6, label %8, label %2
8: ; preds = %2
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void sigint_handler(int sig, void *userdata) {
  char *mes;
  mes = (char *)userdata;
  printf("%s\n", mes);
}


x86 assembly (clang, -O0):
<sigint_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rsi
lea    0xece(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define void @sigint_handler(i32 %0, i8* %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %1)
ret void
}
void get_pm_boot_vector_symbol_address(unsigned *addr) {}


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

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

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

LLVM IR (-O2):
define void @get_pm_boot_vector_symbol_address(i32* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int func() {
  int temp;
  int a;
  int b;
  int c;
  int d;
  d = 9;
  if (a != b && a != c && b != c) {
    temp = a;
    a = b;
    b = c;
    c = temp;
    assert(a != b && a != c && b != c);
  }
  return 1;
}


x86 assembly (clang, -O0):
<func>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x9,-0x14(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
je     1196 <func+0x86>
mov    -0x8(%rbp),%eax
cmp    -0x10(%rbp),%eax
je     1196 <func+0x86>
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
je     1196 <func+0x86>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%ecx
xor    %eax,%eax
cmp    -0xc(%rbp),%ecx
mov    %al,-0x15(%rbp)
je     1189 <func+0x79>
mov    -0x8(%rbp),%ecx
xor    %eax,%eax
cmp    -0x10(%rbp),%ecx
mov    %al,-0x15(%rbp)
je     1189 <func+0x79>
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
setne  %al
mov    %al,-0x15(%rbp)
mov    -0x15(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    $0x1,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @func() {
ret i32 1
}