xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ ck_cls();
void cmdclrscn() { ck_cls(); }


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

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

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

LLVM IR (-O2):
define void @cmdclrscn() {
%1 = tail call i32 (...) @ck_cls()
ret void
}
int rand_index(int max) {
  int rand();
  return (rand() % max);
}


x86 assembly (clang, -O0):
<rand_index>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
cltd
idivl  -0x4(%rbp)
mov    %edx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rand_index>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <rand@plt>
cltd
idiv   %ebx
mov    %edx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @rand_index(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @rand()
%4 = load i32, i32* %2
%5 = srem i32 %3, %4
ret i32 %5
}

LLVM IR (-O2):
define i32 @rand_index(i32 %0) {
%2 = tail call i32 (...) @rand()
%3 = srem i32 %2, %0
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int main(int argc, char **argv) {
  int c;
  for (c = 0; c < argc; c++) {
    printf("%s\n", argv[c]);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    115f <main+0x4f>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rsi
lea    0xeb4(%rip),%rdi
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    112d <main+0x1d>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %edi,%edi
jle    1145 <main+0x35>
mov    %rsi,%r15
mov    %edi,%r12d
xor    %ebx,%ebx
lea    0xed5(%rip),%r14
nopl   0x0(%rax,%rax,1)
mov    (%r15,%rbx,8),%rsi
mov    %r14,%rdi
call   1030 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1130 <main+0x20>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %0 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i8*, i8** %1, i64 %7
%9 = load i8*, i8** %8
%10 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %9)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, char const *);
char *sprint_FAIL(char *s, const char *text) {
  sprintf(s, "%s:FAIL####", text);
  return s;
}


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

x86 assembly (clang, -O2):
<sprint_FAIL>:
push   %rbx
mov    %rsi,%rdx
mov    %rdi,%rbx
lea    0xee2(%rip),%rsi
call   1030 <sprintf@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [12 x i8] c"%s:FAIL####\00"
define i8* @sprint_FAIL(i8* returned writeonly %0, i8* %1) {
%3 = tail call i32 @sprintf(i8* dereferenceable(1) %0, i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %1)
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ pixel_avg_wxh(unsigned char *, int, unsigned char *, int,
                                 int, int);
void pixel_avg_2x2(unsigned char *pix1, int i_stride_pix1, unsigned char *pix2,
                   int i_stride_pix2) {
  pixel_avg_wxh(pix1, i_stride_pix1, pix2, i_stride_pix2, 2, 2);
}


x86 assembly (clang, -O0):
<pixel_avg_2x2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
mov    $0x2,%r9d
mov    %r9d,%r8d
call   1030 <pixel_avg_wxh@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pixel_avg_2x2>:
mov    $0x2,%r8d
mov    $0x2,%r9d
jmp    1030 <pixel_avg_wxh@plt>

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

LLVM IR (-O2):
define void @pixel_avg_2x2(i8* %0, i32 %1, i8* %2, i32 %3) {
%5 = tail call i32 @pixel_avg_wxh(i8* %0, i32 %1, i8* %2, i32 %3, i32 2, i32 2)
ret void
}
/* Type definitions */
struct wl_resource {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ wl_resource_post_event(struct wl_resource *, int);
void wl_data_device_send_drop(struct wl_resource *resource_) {
  wl_resource_post_event(resource_, 4);
}


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

x86 assembly (clang, -O2):
<wl_data_device_send_drop>:
mov    $0x4,%esi
jmp    1030 <wl_resource_post_event@plt>

LLVM IR (-O0):
%struct.wl_resource = type { i32 }
define void @wl_data_device_send_drop(%struct.wl_resource* %0) {
%2 = alloca %struct.wl_resource*
store %struct.wl_resource* %0, %struct.wl_resource** %2
%3 = load %struct.wl_resource*, %struct.wl_resource** %2
%4 = call i32 @wl_resource_post_event(%struct.wl_resource* %3, i32 4)
ret void
}

LLVM IR (-O2):
%struct.wl_resource = type { i32 }
define void @wl_data_device_send_drop(%struct.wl_resource* %0) {
%2 = tail call i32 @wl_resource_post_event(%struct.wl_resource* %0, i32 4)
ret void
}
/* Variables and functions */
int atoi(char *);
int highest(int);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ showHelp(char *);
int main(int argc, char **argv) {
  int num, result;
  if (argc != 2) {
    showHelp(argv[0]);
  } else {
    num = atoi(argv[1]);
    result = highest(num);
    printf("%d\n", result);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x8(%rbp)
je     1171 <main+0x31>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1030 <showHelp@plt>
jmp    119b <main+0x5b>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1060 <atoi@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
call   1040 <highest@plt>
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%esi
lea    0xe6a(%rip),%rdi
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
cmp    $0x2,%edi
jne    1166 <main+0x26>
mov    0x8(%rsi),%rdi
call   1060 <atoi@plt>
mov    %eax,%edi
call   1040 <highest@plt>
lea    0xea3(%rip),%rdi
mov    %eax,%esi
call   1050 <printf@plt>
jmp    116e <main+0x2e>
mov    (%rsi),%rdi
call   1030 <showHelp@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = load i32, i32* %4
%9 = icmp ne i32 %8, 2
br i1 %9, label %10, label %15
10: ; preds = %2
%11 = load i8**, i8*** %5
%12 = getelementptr inbounds i8*, i8** %11, i64 0
%13 = load i8*, i8** %12
%14 = call i32 @showHelp(i8* %13)
br label %24
15: ; preds = %2
%16 = load i8**, i8*** %5
%17 = getelementptr inbounds i8*, i8** %16, i64 1
%18 = load i8*, i8** %17
%19 = call i32 @atoi(i8* %18)
store i32 %19, i32* %6
%20 = load i32, i32* %6
%21 = call i32 @highest(i32 %20)
store i32 %21, i32* %7
%22 = load i32, i32* %7
%23 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %22)
br label %24
24: ; preds = %15, %10
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 2
br i1 %3, label %7, label %4
4: ; preds = %2
%5 = load i8*, i8** %1
%6 = tail call i32 @showHelp(i8* %5)
br label %13
7: ; preds = %2
%8 = getelementptr inbounds i8*, i8** %1, i64 1
%9 = load i8*, i8** %8
%10 = tail call i32 @atoi(i8* %9)
%11 = tail call i32 @highest(i32 %10)
%12 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %11)
br label %13
13: ; preds = %7, %4
ret i32 0
}
double divi(double a, double b, double c, double d) {
  return (b * c - a * d) / (c * c + d * d);
}


x86 assembly (clang, -O0):
<divi>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm2
movsd  -0x8(%rbp),%xmm1
mulsd  -0x20(%rbp),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  -0x18(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm3
movsd  -0x20(%rbp),%xmm2
mulsd  -0x20(%rbp),%xmm2
mulsd  %xmm3,%xmm1
addsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<divi>:
xorpd  0xef8(%rip),%xmm0
unpcklpd %xmm3,%xmm0
unpcklpd %xmm3,%xmm3
mulpd  %xmm3,%xmm0
unpcklpd %xmm2,%xmm1
unpcklpd %xmm2,%xmm2
mulpd  %xmm1,%xmm2
addpd  %xmm2,%xmm0
movapd %xmm0,%xmm1
unpckhpd %xmm0,%xmm1
divsd  %xmm1,%xmm0
ret

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

LLVM IR (-O2):
define double @divi(double %0, double %1, double %2, double %3) {
%5 = fneg double %0
%6 = insertelement <2 x double> poison, double %3, i64 0
%7 = shufflevector <2 x double> %6, <2 x double> poison, <2 x i32> zeroinitializer
%8 = insertelement <2 x double> poison, double %3, i64 1
%9 = insertelement <2 x double> %8, double %5, i64 0
%10 = fmul <2 x double> %7, %9
%11 = insertelement <2 x double> poison, double %1, i64 0
%12 = insertelement <2 x double> %11, double %2, i64 1
%13 = insertelement <2 x double> poison, double %2, i64 0
%14 = shufflevector <2 x double> %13, <2 x double> poison, <2 x i32> zeroinitializer
%15 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %12, <2 x double> %14, <2 x double> %10)
%16 = extractelement <2 x double> %15, i64 0
%17 = extractelement <2 x double> %15, i64 1
%18 = fdiv double %16, %17
ret double %18
}
unsigned char p_offset(unsigned char i) { return (i - 3); }


x86 assembly (clang, -O0):
<p_offset>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
sub    $0x3,%eax
movzbl %al,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define zeroext i8 @p_offset(i8 zeroext %0) {
%2 = add i8 %0, -3
ret i8 %2
}
/* Type definitions */
typedef int __m128i;

/* Variables and functions */
__m128i __attribute__((__always___, __nodebug__))
_mm_xor_si128(__m128i a, __m128i b) {
  return a ^ b;
}


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

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

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

LLVM IR (-O2):
define i32 @_mm_xor_si128(i32 %0, i32 %1) {
%3 = xor i32 %1, %0
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ my_sqrt(float);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ sscanf(char *, char *, float *);
int main(int argc, char *argv[]) {
  float x;
  if (argc < (1 + 1)) {
    printf("test_mysqrt <num>\n");
    return 0;
  }
  sscanf(argv[1], "%f", &x);
  my_sqrt(x);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x8(%rbp)
jge    1168 <main+0x38>
lea    0xea9(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    1191 <main+0x61>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe9c(%rip),%rsi
lea    -0x14(%rbp),%rdx
call   1040 <sscanf@plt>
movss  -0x14(%rbp),%xmm0
call   1050 <my_sqrt@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
cmp    $0x1,%edi
jg     1144 <main+0x14>
lea    0xec6(%rip),%rdi
call   1030 <puts@plt>
jmp    1164 <main+0x34>
mov    0x8(%rsi),%rdi
lea    0xeb1(%rip),%rsi
lea    0x4(%rsp),%rdx
call   1040 <sscanf@plt>
movss  0x4(%rsp),%xmm0
call   1050 <my_sqrt@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%f\00"
@str = [18 x i8] c"test_mysqrt <num>\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca float
%4 = bitcast float* %3 to i8*
%5 = icmp slt i32 %0, 2
br i1 %5, label %6, label %8
6: ; preds = %2
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str, i64 0, i64 0))
br label %14
8: ; preds = %2
%9 = getelementptr inbounds i8*, i8** %1, i64 1
%10 = load i8*, i8** %9
%11 = call i32 @sscanf(i8* %10, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %3)
%12 = load float, float* %3
%13 = call i32 @my_sqrt(float %12)
br label %14
14: ; preds = %8, %6
ret i32 0
}
/* Variables and functions */
void *original_malloc(size_t);
void *xmalloc(size_t size) {
  void *ret = original_malloc(size);
  return ret;
}


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

x86 assembly (clang, -O2):
<xmalloc>:
jmp    1030 <original_malloc@plt>

LLVM IR (-O0):
define i8* @xmalloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @original_malloc(i64 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
ret i8* %6
}

LLVM IR (-O2):
define i8* @xmalloc(i64 %0) {
%2 = tail call i8* @original_malloc(i64 %0)
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void clientDisconnected(void) {
  fprintf(stderr, "Disconnected from server!\n");
  abort();
}


x86 assembly (clang, -O0):
<clientDisconnected>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<clientDisconnected>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1040 <fprintf@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [27 x i8] c"Disconnected from server!\0A\00"
define void @clientDisconnected() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [27 x i8] c"Disconnected from server!\0A\00"
define void @clientDisconnected() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (...) @abort()
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ CX4_immediate_reg(int);
void CX4_op62(void) { CX4_immediate_reg(6); }


x86 assembly (clang, -O0):
<CX4_op62>:
push   %rbp
mov    %rsp,%rbp
mov    $0x6,%edi
call   1030 <CX4_immediate_reg@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<CX4_op62>:
mov    $0x6,%edi
jmp    1030 <CX4_immediate_reg@plt>

LLVM IR (-O0):
define void @CX4_op62() {
%1 = call i32 @CX4_immediate_reg(i32 6)
ret void
}

LLVM IR (-O2):
define void @CX4_op62() {
%1 = tail call i32 @CX4_immediate_reg(i32 6)
ret void
}
/* Variables and functions */
int booster_lxstat(int, char const *, void *);
int __lxstat(int ver, const char *path, void *buf) {
  return booster_lxstat(ver, path, buf);
}


x86 assembly (clang, -O0):
<__lxstat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <booster_lxstat@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__lxstat>:
jmp    1030 <booster_lxstat@plt>

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

LLVM IR (-O2):
define i32 @__lxstat(i32 %0, i8* %1, i8* %2) {
%4 = tail call i32 @booster_lxstat(i32 %0, i8* %1, i8* %2)
ret i32 %4
}
/* Variables and functions */
int *rec(int);
int /*<<< orphan*/ scanf(char *, int *);
main() {
  int *p;
  int i;
  scanf("%d", &i);
  p = rec(i);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1030 <scanf@plt>
mov    -0xc(%rbp),%edi
call   1040 <rec@plt>
mov    %rax,-0x8(%rbp)
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   1030 <scanf@plt>
mov    0x4(%rsp),%edi
call   1040 <rec@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
%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* @rec(i32 %4)
store i32* %5, i32** %1
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* @rec(i32 %4)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ zwave_sendClassCommand(unsigned int, int, int,
                                          unsigned char *, int);
void zwavecmd_multilevel_start_level_change(unsigned int id,
                                            unsigned int is_down) {
  unsigned char buf[2];
  if (is_down)
    buf[0] = 0x60;
  else
    buf[0] = 0x20;
  buf[1] = 0;
  zwave_sendClassCommand(id, 0x26, 0x04, buf, 2);
}


x86 assembly (clang, -O0):
<zwavecmd_multilevel_start_level_change>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1131 <zwavecmd_multilevel_start_level_change+0x21>
movb   $0x60,-0xa(%rbp)
jmp    1135 <zwavecmd_multilevel_start_level_change+0x25>
movb   $0x20,-0xa(%rbp)
movb   $0x0,-0x9(%rbp)
mov    -0x4(%rbp),%edi
lea    -0xa(%rbp),%rcx
mov    $0x26,%esi
mov    $0x4,%edx
mov    $0x2,%r8d
call   1030 <zwave_sendClassCommand@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<zwavecmd_multilevel_start_level_change>:
push   %rax
test   %esi,%esi
setne  %al
shl    $0x6,%al
or     $0x20,%al
mov    %al,0x6(%rsp)
movb   $0x0,0x7(%rsp)
lea    0x6(%rsp),%rcx
mov    $0x26,%esi
mov    $0x4,%edx
mov    $0x2,%r8d
call   1030 <zwave_sendClassCommand@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @zwavecmd_multilevel_start_level_change(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca [2 x i8]
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = getelementptr inbounds [2 x i8], [2 x i8]* %5, i64 0, i64 0
store i8 96, i8* %9
br label %12
10: ; preds = %2
%11 = getelementptr inbounds [2 x i8], [2 x i8]* %5, i64 0, i64 0
store i8 32, i8* %11
br label %12
12: ; preds = %10, %8
%13 = getelementptr inbounds [2 x i8], [2 x i8]* %5, i64 0, i64 1
store i8 0, i8* %13
%14 = load i32, i32* %3
%15 = getelementptr inbounds [2 x i8], [2 x i8]* %5, i64 0, i64 0
%16 = call i32 @zwave_sendClassCommand(i32 %14, i32 38, i32 4, i8* %15, i32 2)
ret void
}

LLVM IR (-O2):
define void @zwavecmd_multilevel_start_level_change(i32 %0, i32 %1) {
%3 = alloca [2 x i8]
%4 = getelementptr inbounds [2 x i8], [2 x i8]* %3, i64 0, i64 0
%5 = icmp eq i32 %1, 0
%6 = select i1 %5, i8 32, i8 96
store i8 %6, i8* %4
%7 = getelementptr inbounds [2 x i8], [2 x i8]* %3, i64 0, i64 1
store i8 0, i8* %7
%8 = call i32 @zwave_sendClassCommand(i32 %0, i32 38, i32 4, i8* %4, i32 2)
ret void
}
/* Type definitions */
struct typ {
  int dummy;
};

/* Variables and functions */
int memcmp(struct typ const **, struct typ const **, int);
int typ_ptr_cmp(const struct typ **a, const struct typ **b) {
  return memcmp(a, b, sizeof(*a));
}


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

x86 assembly (clang, -O2):
<typ_ptr_cmp>:
mov    $0x8,%edx
jmp    1030 <memcmp@plt>

LLVM IR (-O0):
%struct.typ = type { i32 }
define i32 @typ_ptr_cmp(%struct.typ** %0, %struct.typ** %1) {
%3 = alloca %struct.typ**
%4 = alloca %struct.typ**
store %struct.typ** %0, %struct.typ*** %3
store %struct.typ** %1, %struct.typ*** %4
%5 = load %struct.typ**, %struct.typ*** %3
%6 = load %struct.typ**, %struct.typ*** %4
%7 = call i32 @memcmp(%struct.typ** %5, %struct.typ** %6, i32 8)
ret i32 %7
}

LLVM IR (-O2):
%struct.typ = type { i32 }
define i32 @typ_ptr_cmp(%struct.typ** %0, %struct.typ** %1) {
%3 = tail call i32 @memcmp(%struct.typ** %0, %struct.typ** %1, i32 8)
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ ucontext_t;

/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ __set_errno(int /*<<< orphan*/);
int setcontext(const ucontext_t *ucp) {
  __set_errno(ENOSYS);
  return -1;
}


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

x86 assembly (clang, -O2):
<setcontext>:
push   %rax
mov    0x2ed0(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@ENOSYS = global i32 0
define i32 @setcontext(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32, i32* @ENOSYS
%4 = call i32 @__set_errno(i32 %3)
ret i32 -1
}

LLVM IR (-O2):
@ENOSYS = global i32 0
define i32 @setcontext(i32* nocapture readnone %0) {
%2 = load i32, i32* @ENOSYS
%3 = tail call i32 @__set_errno(i32 %2)
ret i32 -1
}
float *vec4_assign(float *result, float *a) {
  result[0] = a[0];
  result[1] = a[1];
  result[2] = a[2];
  result[3] = a[3];
  return result;
}


x86 assembly (clang, -O0):
<vec4_assign>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,(%rax)
mov    -0x10(%rbp),%rax
movss  0x4(%rax),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0x4(%rax)
mov    -0x10(%rbp),%rax
movss  0x8(%rax),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0x8(%rax)
mov    -0x10(%rbp),%rax
movss  0xc(%rax),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0xc(%rax)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<vec4_assign>:
mov    %rdi,%rax
movss  (%rsi),%xmm0
movss  %xmm0,(%rdi)
movss  0x4(%rsi),%xmm0
movss  %xmm0,0x4(%rdi)
movss  0x8(%rsi),%xmm0
movss  %xmm0,0x8(%rdi)
movss  0xc(%rsi),%xmm0
movss  %xmm0,0xc(%rdi)
ret

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

LLVM IR (-O2):
define float* @vec4_assign(float* returned writeonly %0, float* nocapture %1) {
%3 = load float, float* %1
store float %3, float* %0
%4 = getelementptr inbounds float, float* %1, i64 1
%5 = load float, float* %4
%6 = getelementptr inbounds float, float* %0, i64 1
store float %5, float* %6
%7 = getelementptr inbounds float, float* %1, i64 2
%8 = load float, float* %7
%9 = getelementptr inbounds float, float* %0, i64 2
store float %8, float* %9
%10 = getelementptr inbounds float, float* %1, i64 3
%11 = load float, float* %10
%12 = getelementptr inbounds float, float* %0, i64 3
store float %11, float* %12
ret float* %0
}
/* Variables and functions */
int /*<<< orphan*/ fgets(char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ stdin;
int main(int argc, char **argv) {
  char buf[20];
  fgets(buf, 21, stdin);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
mov    0x2ecd(%rip),%rax
mov    (%rax),%edx
mov    %rsp,%rdi
mov    $0x15,%esi
call   1030 <fgets@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@stdin = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [20 x i8]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = getelementptr inbounds [20 x i8], [20 x i8]* %6, i64 0, i64 0
%8 = load i32, i32* @stdin
%9 = call i32 @fgets(i8* %7, i32 21, i32 %8)
ret i32 0
}

LLVM IR (-O2):
@stdin = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [20 x i8]
%4 = getelementptr inbounds [20 x i8], [20 x i8]* %3, i64 0, i64 0
%5 = load i32, i32* @stdin
%6 = call i32 @fgets(i8* %4, i32 21, i32 %5)
ret i32 0
}
/* Variables and functions */
char *Memory(int, int);
int /*<<< orphan*/ memcpy(char *, char *, int);
char *Load(char *file, int filelen) {
  char *fb;
  fb = Memory(filelen + 3, sizeof(char));
  memcpy(fb, file, filelen);
  return (fb);
}


x86 assembly (clang, -O0):
<Load>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%edi
add    $0x3,%edi
mov    $0x1,%esi
call   1040 <Memory@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
call   1030 <memcpy@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Load>:
push   %r15
push   %r14
push   %rbx
mov    %esi,%r15d
mov    %rdi,%r14
lea    0x3(%r15),%edi
mov    $0x1,%esi
call   1040 <Memory@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
mov    %r15d,%edx
call   1030 <memcpy@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @Load(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i8*
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
%7 = add nsw i32 %6, 3
%8 = call i8* @Memory(i32 %7, i32 1)
store i8* %8, i8** %5
%9 = load i8*, i8** %5
%10 = load i8*, i8** %3
%11 = load i32, i32* %4
%12 = call i32 @memcpy(i8* %9, i8* %10, i32 %11)
%13 = load i8*, i8** %5
ret i8* %13
}

LLVM IR (-O2):
define i8* @Load(i8* %0, i32 %1) {
%3 = add nsw i32 %1, 3
%4 = tail call i8* @Memory(i32 %3, i32 1)
%5 = tail call i32 @memcpy(i8* %4, i8* %0, i32 %1)
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *,
                           char const *);
char *gettext(char *);
int /*<<< orphan*/ print_usage(int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
void print_error(void) {
  const char *program = "ypmatch";
  print_usage(stderr);
  fprintf(stderr,
          gettext("Try `%s --help' or `%s --usage' for more information.\n"),
          program, program);
}


x86 assembly (clang, -O0):
<print_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    0x2e96(%rip),%rax
mov    (%rax),%edi
call   1050 <print_usage@plt>
mov    0x2e88(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
lea    0xea4(%rip),%rdi
call   1030 <gettext@plt>
mov    -0xc(%rbp),%edi
mov    %rax,%rsi
mov    -0x8(%rbp),%rdx
mov    -0x8(%rbp),%rcx
call   1040 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_error>:
push   %rbx
mov    0x2ea8(%rip),%rbx
mov    (%rbx),%edi
call   1050 <print_usage@plt>
mov    (%rbx),%ebx
lea    0xec0(%rip),%rdi
call   1030 <gettext@plt>
lea    0xeac(%rip),%rcx
mov    %ebx,%edi
mov    %rax,%rsi
mov    %rcx,%rdx
pop    %rbx
jmp    1040 <fprintf@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"ypmatch\00"
@stderr = global i32 0
@.str.1 = [55 x i8] c"Try `%s --help' or `%s --usage' for more information.\0A\00"
define void @print_error() {
%1 = alloca i8*
store i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8** %1
%2 = load i32, i32* @stderr
%3 = call i32 @print_usage(i32 %2)
%4 = load i32, i32* @stderr
%5 = call i8* @gettext(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.1, i64 0, i64 0))
%6 = load i8*, i8** %1
%7 = load i8*, i8** %1
%8 = call i32 @fprintf(i32 %4, i8* %5, i8* %6, i8* %7)
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"ypmatch\00"
@stderr = global i32 0
@.str.1 = [55 x i8] c"Try `%s --help' or `%s --usage' for more information.\0A\00"
define void @print_error() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @print_usage(i32 %1)
%3 = load i32, i32* @stderr
%4 = tail call i8* @gettext(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.1, i64 0, i64 0))
%5 = tail call i32 @fprintf(i32 %3, i8* %4, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
struct sigaction {
  int dummy;
};

/* Variables and functions */
int _NSIG;
int __rt_sigaction(int, struct sigaction const *, struct sigaction *,
                   int /*<<< orphan*/, int);
int __libc_sigaction(int signum, const struct sigaction *act,
                     struct sigaction *oldact) {
  return __rt_sigaction(signum, act, oldact, 0, _NSIG / 8);
}


x86 assembly (clang, -O0):
<__libc_sigaction>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    0x2eb7(%rip),%rax
mov    (%rax),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
mov    -0x20(%rbp),%rdx
mov    %eax,%r8d
xor    %ecx,%ecx
call   1030 <__rt_sigaction@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__libc_sigaction>:
mov    0x2ed9(%rip),%rax
mov    (%rax),%eax
lea    0x7(%rax),%r8d
test   %eax,%eax
cmovns %eax,%r8d
sar    $0x3,%r8d
xor    %ecx,%ecx
jmp    1030 <__rt_sigaction@plt>

LLVM IR (-O0):
%struct.sigaction = type { i32 }
@_NSIG = global i32 0
define i32 @__libc_sigaction(i32 %0, %struct.sigaction* %1, %struct.sigaction* %2) {
%4 = alloca i32
%5 = alloca %struct.sigaction*
%6 = alloca %struct.sigaction*
store i32 %0, i32* %4
store %struct.sigaction* %1, %struct.sigaction** %5
store %struct.sigaction* %2, %struct.sigaction** %6
%7 = load i32, i32* %4
%8 = load %struct.sigaction*, %struct.sigaction** %5
%9 = load %struct.sigaction*, %struct.sigaction** %6
%10 = load i32, i32* @_NSIG
%11 = sdiv i32 %10, 8
%12 = call i32 @__rt_sigaction(i32 %7, %struct.sigaction* %8, %struct.sigaction* %9, i32 0, i32 %11)
ret i32 %12
}

LLVM IR (-O2):
%struct.sigaction = type { i32 }
@_NSIG = global i32 0
define i32 @__libc_sigaction(i32 %0, %struct.sigaction* %1, %struct.sigaction* %2) {
%4 = load i32, i32* @_NSIG
%5 = sdiv i32 %4, 8
%6 = tail call i32 @__rt_sigaction(i32 %0, %struct.sigaction* %1, %struct.sigaction* %2, i32 0, i32 %5)
ret i32 %6
}
/* Variables and functions */
int fun();
int test(void) { return fun() + 2 + 1; }


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <fun@plt>
add    $0x2,%eax
add    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test>:
push   %rax
xor    %eax,%eax
call   1030 <fun@plt>
add    $0x3,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @test() {
%1 = call i32 (...) @fun()
%2 = add nsw i32 %1, 2
%3 = add nsw i32 %2, 1
ret i32 %3
}

LLVM IR (-O2):
define i32 @test() {
%1 = tail call i32 (...) @fun()
%2 = add nsw i32 %1, 3
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ sigblock();
int /*<<< orphan*/ sigpause(int /*<<< orphan*/);
pause() { sigpause(sigblock()); }


x86 assembly (clang, -O0):
<pause>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <sigblock@plt>
mov    %eax,%edi
call   1030 <sigpause@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @pause() {
%1 = alloca i32
%2 = call i32 (...) @sigblock()
%3 = call i32 @sigpause(i32 %2)
%4 = load i32, i32* %1
ret i32 %4
}

LLVM IR (-O2):
define i32 @pause() {
%1 = tail call i32 (...) @sigblock()
%2 = tail call i32 @sigpause(i32 %1)
ret i32 undef
}
/* Variables and functions */
char *U_WMRCORENONE_set(char *);
char *U_WMRF6_set(void) { return U_WMRCORENONE_set("U_WMRF6"); }


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

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

LLVM IR (-O0):
@.str = [8 x i8] c"U_WMRF6\00"
define i8* @U_WMRF6_set() {
%1 = call i8* @U_WMRCORENONE_set(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}

LLVM IR (-O2):
@.str = [8 x i8] c"U_WMRF6\00"
define i8* @U_WMRF6_set() {
%1 = tail call i8* @U_WMRCORENONE_set(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}
void g_enum_get_value() {}


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

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

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

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


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

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

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

LLVM IR (-O2):
define void @XtCvtStringToBoolean() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ munmap(void *, unsigned long);
void release_file(void *data, unsigned long size) { munmap(data, size); }


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

x86 assembly (clang, -O2):
<release_file>:
jmp    1030 <munmap@plt>

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

LLVM IR (-O2):
define void @release_file(i8* %0, i64 %1) {
%3 = tail call i32 @munmap(i8* %0, i64 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
char *ftoa(double, int);
int /*<<< orphan*/ printf(char *, char *);
void vga_terminal_putfloat(double f) {
  char *s = ftoa(f, 2);
  printf("%s\n", s);
  free(s);
}


x86 assembly (clang, -O0):
<vga_terminal_putfloat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
mov    $0x2,%edi
call   1050 <ftoa@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
lea    0xea5(%rip),%rdi
call   1040 <printf@plt>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vga_terminal_putfloat>:
push   %rbx
mov    $0x2,%edi
call   1050 <ftoa@plt>
mov    %rax,%rbx
lea    0xebb(%rip),%rdi
mov    %rax,%rsi
call   1040 <printf@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define void @vga_terminal_putfloat(double %0) {
%2 = tail call i8* @ftoa(double %0, i32 2)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = tail call i32 @free(i8* %2)
ret void
}
/* Variables and functions */
long big2littlel(long);
scalar_t__ isLittleEndian();
long big2hostl(long num) {
  if (isLittleEndian())
    return big2littlel(num);
  return num;
}


x86 assembly (clang, -O0):
<big2hostl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <isLittleEndian@plt>
cmp    $0x0,%rax
je     114f <big2hostl+0x2f>
mov    -0x10(%rbp),%rdi
call   1040 <big2littlel@plt>
mov    %rax,-0x8(%rbp)
jmp    1157 <big2hostl+0x37>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<big2hostl>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <isLittleEndian@plt>
test   %rax,%rax
je     1139 <big2hostl+0x19>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <big2littlel@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i64 @big2hostl(i64 %0) {
%2 = tail call i64 (...) @isLittleEndian()
%3 = icmp eq i64 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i64 @big2littlel(i64 %0)
br label %6
6: ; preds = %1, %4
%7 = phi i64 [ %5, %4 ], [ %0, %1 ]
ret i64 %7
}
val_curGEN(bb_gen1, bb_gen2, bb_dmu, cc) int *bb_gen1, *bb_gen2, *bb_dmu, cc;
{
  int st;
  val_curGENState(&st, cc);
  val_gen1(bb_gen1, st);
  val_gen2(bb_gen2, st);
  val_gen_dmu(bb_dmu, st);
}


x86 assembly (clang, -O0):
<val_curGEN>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %ecx,-0x24(%rbp)
mov    -0x24(%rbp),%esi
lea    -0x28(%rbp),%rdi
mov    $0x0,%al
call   1050 <val_curGENState@plt>
mov    -0x10(%rbp),%rdi
mov    -0x28(%rbp),%esi
mov    $0x0,%al
call   1040 <val_gen1@plt>
mov    -0x18(%rbp),%rdi
mov    -0x28(%rbp),%esi
mov    $0x0,%al
call   1060 <val_gen2@plt>
mov    -0x20(%rbp),%rdi
mov    -0x28(%rbp),%esi
mov    $0x0,%al
call   1030 <val_gen_dmu@plt>
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<val_curGEN>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%rbx
lea    0xc(%rsp),%rdi
mov    %ecx,%esi
xor    %eax,%eax
call   1050 <val_curGENState@plt>
mov    0xc(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <val_gen1@plt>
mov    0xc(%rsp),%esi
mov    %r15,%rdi
xor    %eax,%eax
call   1060 <val_gen2@plt>
mov    0xc(%rsp),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1030 <val_gen_dmu@plt>
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i32 @val_curGEN(i32* %0, i32* %1, i32* %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32*
%7 = alloca i32*
%8 = alloca i32*
%9 = alloca i32
%10 = alloca i32
store i32* %0, i32** %6
store i32* %1, i32** %7
store i32* %2, i32** %8
store i32 %3, i32* %9
%11 = load i32, i32* %9
%12 = call i32 (i32*, i32, ...) bitcast (i32 (...)* @val_curGENState to i32 (i32*, i32, ...)*)(i32* %10, i32 %11)
%13 = load i32*, i32** %6
%14 = load i32, i32* %10
%15 = call i32 (i32*, i32, ...) bitcast (i32 (...)* @val_gen1 to i32 (i32*, i32, ...)*)(i32* %13, i32 %14)
%16 = load i32*, i32** %7
%17 = load i32, i32* %10
%18 = call i32 (i32*, i32, ...) bitcast (i32 (...)* @val_gen2 to i32 (i32*, i32, ...)*)(i32* %16, i32 %17)
%19 = load i32*, i32** %8
%20 = load i32, i32* %10
%21 = call i32 (i32*, i32, ...) bitcast (i32 (...)* @val_gen_dmu to i32 (i32*, i32, ...)*)(i32* %19, i32 %20)
%22 = load i32, i32* %5
ret i32 %22
}

LLVM IR (-O2):
define i32 @val_curGEN(i32* %0, i32* %1, i32* %2, i32 %3) {
%5 = alloca i32
%6 = bitcast i32* %5 to i8*
%7 = call i32 (i32*, i32, ...) bitcast (i32 (...)* @val_curGENState to i32 (i32*, i32, ...)*)(i32* %5, i32 %3)
%8 = load i32, i32* %5
%9 = call i32 (i32*, i32, ...) bitcast (i32 (...)* @val_gen1 to i32 (i32*, i32, ...)*)(i32* %0, i32 %8)
%10 = load i32, i32* %5
%11 = call i32 (i32*, i32, ...) bitcast (i32 (...)* @val_gen2 to i32 (i32*, i32, ...)*)(i32* %1, i32 %10)
%12 = load i32, i32* %5
%13 = call i32 (i32*, i32, ...) bitcast (i32 (...)* @val_gen_dmu to i32 (i32*, i32, ...)*)(i32* %2, i32 %12)
ret i32 undef
}
int test_imm_5Fint32_mem(int *val) {
  return ((*val) & (0x5F << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_5Fint32_mem(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = and i32 %2, 95
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}