xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int main() {
  int i, j, k;
  i = k = 0;
  j = 7;
  while (i < 10) {
    i++;
    j = 7;
    k = 5;
  }
  assert(i == 10);
  assert(k);
  assert(j == 7);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x7,-0xc(%rbp)
cmpl   $0xa,-0x8(%rbp)
jge    115a <main+0x4a>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
movl   $0x7,-0xc(%rbp)
movl   $0x5,-0x10(%rbp)
jmp    1134 <main+0x24>
cmpl   $0xa,-0x8(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x10(%rbp),%edi
call   1030 <assert@plt>
cmpl   $0x7,-0xc(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %4
store i32 0, i32* %2
store i32 7, i32* %3
br label %5
5: ; preds = %8, %0
%6 = load i32, i32* %2
%7 = icmp slt i32 %6, 10
br i1 %7, label %8, label %11
8: ; preds = %5
%9 = load i32, i32* %2
%10 = add nsw i32 %9, 1
store i32 %10, i32* %2
store i32 7, i32* %3
store i32 5, i32* %4
br label %5
11: ; preds = %5
%12 = load i32, i32* %2
%13 = icmp eq i32 %12, 10
%14 = zext i1 %13 to i32
%15 = call i32 @assert(i32 %14)
%16 = load i32, i32* %4
%17 = call i32 @assert(i32 %16)
%18 = load i32, i32* %3
%19 = icmp eq i32 %18, 7
%20 = zext i1 %19 to i32
%21 = call i32 @assert(i32 %20)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @assert(i32 1)
%2 = tail call i32 @assert(i32 5)
%3 = tail call i32 @assert(i32 1)
ret i32 0
}
/* Variables and functions */
size_t strlen(const char *s) {
  const char *w = s;
  while (*w++)
    ;
  return w - s;
}


x86 assembly (clang, -O0):
<strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
cmpb   $0x0,(%rax)
je     112d <strlen+0x2d>
jmp    1110 <strlen+0x10>
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rcx
sub    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlen>:
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
cmpb   $0x0,(%rdi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <strlen+0x10>
ret

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

LLVM IR (-O2):
define i64 @strlen(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %4, %2 ]
%4 = getelementptr inbounds i8, i8* %3, i64 1
%5 = load i8, i8* %3
%6 = icmp eq i8 %5, 0
br i1 %6, label %7, label %2
7: ; preds = %2
%8 = ptrtoint i8* %4 to i64
%9 = ptrtoint i8* %0 to i64
%10 = sub i64 %8, %9
ret i64 %10
}
unsigned char f16(unsigned char x, long int y) {
  return (x << y) | (x >> (8 * sizeof(unsigned char) - y));
}


x86 assembly (clang, -O0):
<f16>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %rsi,-0x10(%rbp)
movzbl -0x1(%rbp),%eax
mov    -0x10(%rbp),%rcx
shl    %cl,%eax
movzbl -0x1(%rbp),%edx
mov    $0x8,%ecx
sub    -0x10(%rbp),%rcx
sar    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f16>:
mov    %rsi,%rcx
mov    %edi,%eax
rol    %cl,%al
ret

LLVM IR (-O0):
define zeroext i8 @f16(i8 zeroext %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 = zext i8 %5 to i32
%7 = load i64, i64* %4
%8 = trunc i64 %7 to i32
%9 = shl i32 %6, %8
%10 = load i8, i8* %3
%11 = zext i8 %10 to i32
%12 = load i64, i64* %4
%13 = sub i64 8, %12
%14 = trunc i64 %13 to i32
%15 = ashr i32 %11, %14
%16 = or i32 %9, %15
%17 = trunc i32 %16 to i8
ret i8 %17
}

LLVM IR (-O2):
define zeroext i8 @f16(i8 zeroext %0, i64 %1) {
%3 = trunc i64 %1 to i8
%4 = tail call i8 @llvm.fshl.i8(i8 %0, i8 %0, i8 %3)
ret i8 %4
}
int valuegen2(int i) { return 9 - i; }


x86 assembly (clang, -O0):
<valuegen2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0x9,%eax
sub    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<valuegen2>:
mov    $0x9,%eax
sub    %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @valuegen2(i32 %0) {
%2 = sub nsw i32 9, %0
ret i32 %2
}
double volume(double r) { return 4.0 / 3.0 * 3.141592654 * r * r * r; }


x86 assembly (clang, -O0):
<volume>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  0xeef(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
mulsd  -0x8(%rbp),%xmm0
mulsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<volume>:
movsd  0xef8(%rip),%xmm1
mulsd  %xmm0,%xmm1
mulsd  %xmm0,%xmm1
mulsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @volume(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fmul double 0x4010C1523836D8E0, %3
%5 = load double, double* %2
%6 = fmul double %4, %5
%7 = load double, double* %2
%8 = fmul double %6, %7
ret double %8
}

LLVM IR (-O2):
define double @volume(double %0) {
%2 = fmul double %0, 0x4010C1523836D8E0
%3 = fmul double %2, %0
%4 = fmul double %3, %0
ret double %4
}
/* Variables and functions */
int /*<<< orphan*/ write(char *, char *, char *);
void function_empty_urole() {
  write("json-task.json", "\"role\":\"%s\" ", "PUBLIC");
}


x86 assembly (clang, -O0):
<function_empty_urole>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
lea    0xeed(%rip),%rsi
lea    0xef3(%rip),%rdx
call   1030 <write@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<function_empty_urole>:
lea    0xee9(%rip),%rdi
lea    0xef1(%rip),%rsi
lea    0xef7(%rip),%rdx
jmp    1030 <write@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"json-task.json\00"
@.str.1 = [13 x i8] c"\22role\22:\22%s\22 \00"
@.str.2 = [7 x i8] c"PUBLIC\00"
define void @function_empty_urole() {
%1 = call i32 @write(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"json-task.json\00"
@.str.1 = [13 x i8] c"\22role\22:\22%s\22 \00"
@.str.2 = [7 x i8] c"PUBLIC\00"
define void @function_empty_urole() {
%1 = tail call i32 @write(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0))
ret void
}
/* Variables and functions */
double ceil(double);
double floor(double);
double yy_rnd(double f) {
  if (f < 0.0)
    return ceil(f - 0.5);
  return floor(f + 0.5);
}


x86 assembly (clang, -O0):
<yy_rnd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x10(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    115b <yy_rnd+0x3b>
movsd  -0x10(%rbp),%xmm0
movsd  0xeb8(%rip),%xmm1
subsd  %xmm1,%xmm0
call   1030 <ceil@plt>
movsd  %xmm0,-0x8(%rbp)
jmp    1172 <yy_rnd+0x52>
movsd  0xe9d(%rip),%xmm0
addsd  -0x10(%rbp),%xmm0
call   1040 <floor@plt>
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<yy_rnd>:
xorpd  %xmm1,%xmm1
ucomisd %xmm0,%xmm1
jbe    1137 <yy_rnd+0x17>
addsd  0xed6(%rip),%xmm0
jmp    1030 <ceil@plt>
addsd  0xec1(%rip),%xmm0
jmp    1040 <floor@plt>

LLVM IR (-O0):
define double @yy_rnd(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %3
%4 = load double, double* %3
%5 = fcmp olt double %4, 0.000000e+00
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load double, double* %3
%8 = fsub double %7, 5.000000e-01
%9 = call double @llvm.ceil.f64(double %8)
store double %9, double* %2
br label %14
10: ; preds = %1
%11 = load double, double* %3
%12 = fadd double %11, 5.000000e-01
%13 = call double @llvm.floor.f64(double %12)
store double %13, double* %2
br label %14
14: ; preds = %10, %6
%15 = load double, double* %2
ret double %15
}

LLVM IR (-O2):
define double @yy_rnd(double %0) {
%2 = fcmp olt double %0, 0.000000e+00
br i1 %2, label %3, label %6
3: ; preds = %1
%4 = fadd double %0, -5.000000e-01
%5 = tail call double @llvm.ceil.f64(double %4)
br label %9
6: ; preds = %1
%7 = fadd double %0, 5.000000e-01
%8 = tail call double @llvm.floor.f64(double %7)
br label %9
9: ; preds = %6, %3
%10 = phi double [ %5, %3 ], [ %8, %6 ]
ret double %10
}
void i2d_GENERAL_NAME(void) {}


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

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

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

LLVM IR (-O2):
define void @i2d_GENERAL_NAME() {
ret void
}
void vec3_neg(const float a[3], float out[3]) { vec3_mul(a, -1, out); }


x86 assembly (clang, -O0):
<vec3_neg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    $0xffffffff,%esi
mov    $0x0,%al
call   1030 <vec3_mul@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vec3_neg>:
mov    %rsi,%rdx
mov    $0xffffffff,%esi
xor    %eax,%eax
jmp    1030 <vec3_mul@plt>

LLVM IR (-O0):
define void @vec3_neg(float* %0, float* %1) {
%3 = alloca float*
%4 = alloca float*
store float* %0, float** %3
store float* %1, float** %4
%5 = load float*, float** %3
%6 = load float*, float** %4
%7 = call i32 (float*, i32, float*, ...) bitcast (i32 (...)* @vec3_mul to i32 (float*, i32, float*, ...)*)(float* %5, i32 -1, float* %6)
ret void
}

LLVM IR (-O2):
define void @vec3_neg(float* %0, float* %1) {
%3 = tail call i32 (float*, i32, float*, ...) bitcast (i32 (...)* @vec3_mul to i32 (float*, i32, float*, ...)*)(float* %0, i32 -1, float* %1)
ret void
}
void foo(void) { printf("Hello from %s!\n", __FUNCTION__); }


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
lea    0xeee(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
lea    0xee9(%rip),%rdi
lea    0xef2(%rip),%rsi
xor    %eax,%eax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"Hello from %s!\0A\00"
@__FUNCTION__.foo = [4 x i8] c"foo\00"
define void @foo() {
%1 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @__FUNCTION__.foo, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [16 x i8] c"Hello from %s!\0A\00"
@__FUNCTION__.foo = [4 x i8] c"foo\00"
define void @foo() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @__FUNCTION__.foo, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
uint32_t vmir_vm_arg32(const void **rfp) {
  const void *rf = *rfp = *rfp - 4;
  return *(uint32_t *)rf;
}


x86 assembly (clang, -O0):
<vmir_vm_arg32>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
add    $0xfffffffffffffffc,%rax
mov    -0x8(%rbp),%rcx
mov    %rax,(%rcx)
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<vmir_vm_arg32>:
mov    (%rdi),%rax
lea    -0x4(%rax),%rcx
mov    %rcx,(%rdi)
mov    -0x4(%rax),%eax
ret

LLVM IR (-O0):
define i32 @vmir_vm_arg32(i8** %0) {
%2 = alloca i8**
%3 = alloca i8*
store i8** %0, i8*** %2
%4 = load i8**, i8*** %2
%5 = load i8*, i8** %4
%6 = getelementptr i8, i8* %5, i64 -4
%7 = load i8**, i8*** %2
store i8* %6, i8** %7
store i8* %6, i8** %3
%8 = load i8*, i8** %3
%9 = bitcast i8* %8 to i32*
%10 = load i32, i32* %9
ret i32 %10
}

LLVM IR (-O2):
define i32 @vmir_vm_arg32(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = getelementptr i8, i8* %2, i64 -4
store i8* %3, i8** %0
%4 = bitcast i8* %3 to i32*
%5 = load i32, i32* %4
ret i32 %5
}
int uint2int(unsigned int x) { return x; }


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

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

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

LLVM IR (-O2):
define i32 @uint2int(i32 returned %0) {
ret i32 %0
}
void stats_cost_benefit_init(void) {}


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

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

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

LLVM IR (-O2):
define void @stats_cost_benefit_init() {
ret void
}
/* Variables and functions */
void *calloc(size_t, size_t);
int /*<<< orphan*/ erroFatalMemoria();
void *xcalloc(size_t n, size_t t) {
  void *p = calloc(n, t);
  if (!p)
    erroFatalMemoria();
  return p;
}


x86 assembly (clang, -O0):
<xcalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <calloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1153 <xcalloc+0x33>
mov    $0x0,%al
call   1030 <erroFatalMemoria@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xcalloc>:
push   %rbx
call   1040 <calloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1135 <xcalloc+0x15>
xor    %eax,%eax
call   1030 <erroFatalMemoria@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define noalias i8* @xcalloc(i64 %0, i64 %1) {
%3 = tail call i8* @calloc(i64 %0, i64 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 (...) @erroFatalMemoria()
br label %7
7: ; preds = %5, %2
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int a = 1 == 1;
  printf("%d", a);
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
mov    $0x1,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 1)
ret i32 0
}
void UI_method_set_opener(void) {}


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

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

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

LLVM IR (-O2):
define void @UI_method_set_opener() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
extern void xmlrpc_client_cleanup(void) {
  char *routine = "xmlrpc_client_cleanup";
  {
    fprintf(stderr, "%s: xmlrpc not implemented\n", routine);
    exit(1);
  }
}


x86 assembly (clang, -O0):
<xmlrpc_client_cleanup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    0x2ea6(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<xmlrpc_client_cleanup>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xee5(%rip),%rsi
lea    0xec8(%rip),%rdx
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [22 x i8] c"xmlrpc_client_cleanup\00"
@stderr = global i32 0
@.str.1 = [28 x i8] c"%s: xmlrpc not implemented\0A\00"
define void @xmlrpc_client_cleanup() {
%1 = alloca i8*
store i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8** %1
%2 = load i32, i32* @stderr
%3 = load i8*, i8** %1
%4 = call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0), i8* %3)
%5 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [22 x i8] c"xmlrpc_client_cleanup\00"
@stderr = global i32 0
@.str.1 = [28 x i8] c"%s: xmlrpc not implemented\0A\00"
define void @xmlrpc_client_cleanup() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, double, double);
double sqrt(double);
int main(int argc, char *arcv[]) {
  printf("sqrt"
         "(%g) = %g\n",
         3.0, sqrt(3.0));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movsd  0xec2(%rip),%xmm0
call   1040 <sqrt@plt>
movaps %xmm0,%xmm1
lea    0xebb(%rip),%rdi
movsd  0xeab(%rip),%xmm0
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xef8(%rip),%rdi
movsd  0xee0(%rip),%xmm0
movsd  0xee0(%rip),%xmm1
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [15 x i8] c"sqrt(%g) = %g\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call double @sqrt(double 3.000000e+00)
%7 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), double 3.000000e+00, double %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [15 x i8] c"sqrt(%g) = %g\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), double 3.000000e+00, double 0x3FFBB67AE8584CAA)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ bd2gcj(double, double, double *, double *);
int /*<<< orphan*/ gcj2wgs_exact(double, double, double *, double *);
void bd2wgs_exact(double bdlat, double bdlng, double *wgsLat, double *wgsLng) {
  double gcjlat, gcjlng;
  bd2gcj(bdlat, bdlng, &gcjlat, &gcjlng);
  gcj2wgs_exact(gcjlat, gcjlng, wgsLat, wgsLng);
}


x86 assembly (clang, -O0):
<bd2wgs_exact>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
mov    %rdi,-0x18(%rbp)
mov    %rsi,-0x20(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
lea    -0x28(%rbp),%rdi
lea    -0x30(%rbp),%rsi
call   1040 <bd2gcj@plt>
movsd  -0x28(%rbp),%xmm0
movsd  -0x30(%rbp),%xmm1
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1030 <gcj2wgs_exact@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bd2wgs_exact>:
push   %r14
push   %rbx
sub    $0x18,%rsp
mov    %rsi,%r14
mov    %rdi,%rbx
lea    0x10(%rsp),%rdi
lea    0x8(%rsp),%rsi
call   1040 <bd2gcj@plt>
movsd  0x10(%rsp),%xmm0
movsd  0x8(%rsp),%xmm1
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <gcj2wgs_exact@plt>
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @bd2wgs_exact(double %0, double %1, double* %2, double* %3) {
%5 = alloca double
%6 = alloca double
%7 = alloca double*
%8 = alloca double*
%9 = alloca double
%10 = alloca double
store double %0, double* %5
store double %1, double* %6
store double* %2, double** %7
store double* %3, double** %8
%11 = load double, double* %5
%12 = load double, double* %6
%13 = call i32 @bd2gcj(double %11, double %12, double* %9, double* %10)
%14 = load double, double* %9
%15 = load double, double* %10
%16 = load double*, double** %7
%17 = load double*, double** %8
%18 = call i32 @gcj2wgs_exact(double %14, double %15, double* %16, double* %17)
ret void
}

LLVM IR (-O2):
define void @bd2wgs_exact(double %0, double %1, double* %2, double* %3) {
%5 = alloca double
%6 = alloca double
%7 = bitcast double* %5 to i8*
%8 = bitcast double* %6 to i8*
%9 = call i32 @bd2gcj(double %0, double %1, double* %5, double* %6)
%10 = load double, double* %5
%11 = load double, double* %6
%12 = call i32 @gcj2wgs_exact(double %10, double %11, double* %2, double* %3)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ array;

/* Variables and functions */
int /*<<< orphan*/ es8(float *, int);
int main() {
  float array[] = {35.4, 46.7, 77.55, 11.1, 9.04, 0.75};
  es8(array, sizeof(array) / sizeof(array[0]));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    0xee1(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xede(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xedb(%rip),%rax
mov    %rax,-0x10(%rbp)
lea    -0x20(%rbp),%rdi
mov    $0x6,%esi
call   1030 <es8@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
mov    0xef5(%rip),%rax
mov    %rax,0x10(%rsp)
movaps 0xed9(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
mov    $0x6,%esi
call   1030 <es8@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.main.array = [6 x float] [float 0x4041B33340000000, float 0x40475999A0000000, float 0x4053633340000000, float 0x4026333340000000, float 0x4022147AE0000000, float 7.500000e-01]
define i32 @main() {
%1 = alloca [6 x float]
%2 = bitcast [6 x float]* %1 to i8*
%3 = getelementptr inbounds [6 x float], [6 x float]* %1, i64 0, i64 0
%4 = call i32 @es8(float* %3, i32 6)
ret i32 0
}

LLVM IR (-O2):
@__const.main.array = [6 x float] [float 0x4041B33340000000, float 0x40475999A0000000, float 0x4053633340000000, float 0x4026333340000000, float 0x4022147AE0000000, float 7.500000e-01]
define i32 @main() {
%1 = alloca [6 x float]
%2 = bitcast [6 x float]* %1 to i8*
%3 = getelementptr inbounds [6 x float], [6 x float]* %1, i64 0, i64 0
%4 = call i32 @es8(float* %3, i32 6)
ret i32 0
}
/* Variables and functions */
long i_sqrt(long);
int isprime(long k) {
  long y, z;
  y = i_sqrt(k);
  for (z = 2; z <= y; z++) {
    if ((k % z) == 0)
      return 0;
  }
  return 1;
}


x86 assembly (clang, -O0):
<isprime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <i_sqrt@plt>
mov    %rax,-0x18(%rbp)
movq   $0x2,-0x20(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x18(%rbp),%rax
jg     1175 <isprime+0x65>
mov    -0x10(%rbp),%rax
cqto
idivq  -0x20(%rbp)
cmp    $0x0,%rdx
jne    115f <isprime+0x4f>
movl   $0x0,-0x4(%rbp)
jmp    117c <isprime+0x6c>
jmp    1164 <isprime+0x54>
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    1131 <isprime+0x21>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isprime>:
push   %rbx
mov    %rdi,%rbx
call   1030 <i_sqrt@plt>
mov    $0x1,%ecx
cmp    $0x2,%rax
jl     1181 <isprime+0x71>
mov    $0x1,%esi
sub    %rax,%rsi
mov    $0x2,%edi
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rax
or     %rdi,%rax
shr    $0x20,%rax
je     1160 <isprime+0x50>
mov    %rbx,%rax
cqto
idiv   %rdi
test   %rdx,%rdx
jne    116b <isprime+0x5b>
jmp    117f <isprime+0x6f>
nopl   0x0(%rax,%rax,1)
mov    %ebx,%eax
xor    %edx,%edx
div    %edi
test   %rdx,%rdx
je     117f <isprime+0x6f>
lea    (%rsi,%rdi,1),%rax
add    $0x1,%rax
add    $0x1,%rdi
cmp    $0x2,%rax
jne    1140 <isprime+0x30>
jmp    1181 <isprime+0x71>
xor    %ecx,%ecx
mov    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @isprime(i64 %0) {
%2 = alloca i32
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
store i64 %0, i64* %3
%6 = load i64, i64* %3
%7 = call i64 @i_sqrt(i64 %6)
store i64 %7, i64* %4
store i64 2, i64* %5
br label %8
8: ; preds = %19, %1
%9 = load i64, i64* %5
%10 = load i64, i64* %4
%11 = icmp sle i64 %9, %10
br i1 %11, label %12, label %22
12: ; preds = %8
%13 = load i64, i64* %3
%14 = load i64, i64* %5
%15 = srem i64 %13, %14
%16 = icmp eq i64 %15, 0
br i1 %16, label %17, label %18
17: ; preds = %12
store i32 0, i32* %2
br label %23
18: ; preds = %12
br label %19
19: ; preds = %18
%20 = load i64, i64* %5
%21 = add nsw i64 %20, 1
store i64 %21, i64* %5
br label %8
22: ; preds = %8
store i32 1, i32* %2
br label %23
23: ; preds = %22, %17
%24 = load i32, i32* %2
ret i32 %24
}

LLVM IR (-O2):
define i32 @isprime(i64 %0) {
%2 = tail call i64 @i_sqrt(i64 %0)
%3 = icmp slt i64 %2, 2
br i1 %3, label %11, label %7
4: ; preds = %7
%5 = add nuw i64 %8, 1
%6 = icmp eq i64 %8, %2
br i1 %6, label %11, label %7
7: ; preds = %1, %4
%8 = phi i64 [ %5, %4 ], [ 2, %1 ]
%9 = srem i64 %0, %8
%10 = icmp eq i64 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %7, %4, %1
%12 = phi i32 [ 1, %1 ], [ 1, %4 ], [ 0, %7 ]
ret i32 %12
}
int test_imm_2Euint32_mem(unsigned int *val) {
  return ((*val) & (0x2E << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_2Euint32_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, 46
%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_2Euint32_mem(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = and i32 %2, 46
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Type definitions */
struct module {
  int dummy;
};

/* Variables and functions */
void *module_getsym(struct module *, char const *);
int /*<<< orphan*/ printf(char *, char const *);
int testVar(struct module *mod, const char *name, int val) {
  void *var = module_getsym(mod, name);
  if (!var) {
    printf("ERROR: Can't find %s\n", name);
  }
  return *((int *)var) == val;
}


x86 assembly (clang, -O0):
<testVar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <module_getsym@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    115f <testVar+0x3f>
mov    -0x10(%rbp),%rsi
lea    0xea6(%rip),%rdi
call   1040 <printf@plt>
mov    -0x20(%rbp),%rax
mov    (%rax),%eax
cmp    -0x14(%rbp),%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<testVar>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%r14d
mov    %rsi,%rbx
call   1030 <module_getsym@plt>
mov    %rax,%rbp
test   %rax,%rax
jne    1146 <testVar+0x26>
lea    0xec2(%rip),%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
xor    %eax,%eax
cmp    %r14d,0x0(%rbp)
sete   %al
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
%struct.module = type { i32 }
@.str = [22 x i8] c"ERROR: Can't find %s\0A\00"
define i32 @testVar(%struct.module* %0, i8* %1, i32 %2) {
%4 = alloca %struct.module*
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i8*
store %struct.module* %0, %struct.module** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%8 = load %struct.module*, %struct.module** %4
%9 = load i8*, i8** %5
%10 = call i8* @module_getsym(%struct.module* %8, i8* %9)
store i8* %10, i8** %7
%11 = load i8*, i8** %7
%12 = icmp ne i8* %11, null
br i1 %12, label %16, label %13
13: ; preds = %3
%14 = load i8*, i8** %5
%15 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* %14)
br label %16
16: ; preds = %13, %3
%17 = load i8*, i8** %7
%18 = bitcast i8* %17 to i32*
%19 = load i32, i32* %18
%20 = load i32, i32* %6
%21 = icmp eq i32 %19, %20
%22 = zext i1 %21 to i32
ret i32 %22
}

LLVM IR (-O2):
%struct.module = type { i32 }
@.str = [22 x i8] c"ERROR: Can't find %s\0A\00"
define i32 @testVar(%struct.module* %0, i8* %1, i32 %2) {
%4 = tail call i8* @module_getsym(%struct.module* %0, i8* %1)
%5 = icmp eq i8* %4, null
br i1 %5, label %6, label %8
6: ; preds = %3
%7 = tail call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* %1)
br label %8
8: ; preds = %6, %3
%9 = bitcast i8* %4 to i32*
%10 = load i32, i32* %9
%11 = icmp eq i32 %10, %2
%12 = zext i1 %11 to i32
ret i32 %12
}
/* Variables and functions */
char *strdup(char const *);
void array_append(const char **array, const char element[]) {
  while (*array) {
    array++;
  }
  *array = strdup(element);
}


x86 assembly (clang, -O0):
<array_append>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmpq   $0x0,(%rax)
je     113f <array_append+0x2f>
mov    -0x8(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x8(%rbp)
jmp    1120 <array_append+0x10>
mov    -0x10(%rbp),%rdi
call   1030 <strdup@plt>
mov    %rax,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<array_append>:
push   %rbx
mov    %rdi,%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
cmpq   $0x0,(%rbx)
lea    0x8(%rbx),%rbx
jne    1120 <array_append+0x10>
mov    %rsi,%rdi
call   1030 <strdup@plt>
mov    %rax,-0x8(%rbx)
pop    %rbx
ret

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

LLVM IR (-O2):
define void @array_append(i8** nocapture %0, i8* nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8** [ %0, %2 ], [ %7, %3 ]
%5 = load i8*, i8** %4
%6 = icmp eq i8* %5, null
%7 = getelementptr inbounds i8*, i8** %4, i64 1
br i1 %6, label %8, label %3
8: ; preds = %3
%9 = tail call i8* @strdup(i8* %1)
store i8* %9, i8** %4
ret void
}
/* Variables and functions */
char *put_hex_char(char *, int /*<<< orphan*/, int);
void byte_to_hex(char *dst, const unsigned char *src, unsigned len,
                 int upper_case) {
  while (len-- > 0) {
    dst = put_hex_char(dst, *src++, upper_case);
  }
  *dst = '\0';
}


x86 assembly (clang, -O0):
<byte_to_hex>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x14(%rbp)
cmp    $0x0,%eax
jbe    1161 <byte_to_hex+0x51>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movzbl (%rax),%esi
mov    -0x18(%rbp),%edx
call   1030 <put_hex_char@plt>
mov    %rax,-0x8(%rbp)
jmp    1126 <byte_to_hex+0x16>
mov    -0x8(%rbp),%rax
movb   $0x0,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<byte_to_hex>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rax
test   %edx,%edx
je     1148 <byte_to_hex+0x38>
mov    %ecx,%r14d
mov    %rsi,%r15
mov    %edx,%ebp
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
movzbl (%r15,%rbx,1),%esi
mov    %rax,%rdi
mov    %r14d,%edx
call   1030 <put_hex_char@plt>
add    $0x1,%rbx
cmp    %ebx,%ebp
jne    1130 <byte_to_hex+0x20>
movb   $0x0,(%rax)
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @byte_to_hex(i8* %0, i8* %1, i32 %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i32
store i8* %0, i8** %5
store i8* %1, i8** %6
store i32 %2, i32* %7
store i32 %3, i32* %8
br label %9
9: ; preds = %13, %4
%10 = load i32, i32* %7
%11 = add i32 %10, -1
store i32 %11, i32* %7
%12 = icmp ugt i32 %10, 0
br i1 %12, label %13, label %21
13: ; preds = %9
%14 = load i8*, i8** %5
%15 = load i8*, i8** %6
%16 = getelementptr inbounds i8, i8* %15, i32 1
store i8* %16, i8** %6
%17 = load i8, i8* %15
%18 = zext i8 %17 to i32
%19 = load i32, i32* %8
%20 = call i8* @put_hex_char(i8* %14, i32 %18, i32 %19)
store i8* %20, i8** %5
br label %9
21: ; preds = %9
%22 = load i8*, i8** %5
store i8 0, i8* %22
ret void
}

LLVM IR (-O2):
define void @byte_to_hex(i8* %0, i8* nocapture %1, i32 %2, i32 %3) {
%5 = icmp eq i32 %2, 0
br i1 %5, label %16, label %6
6: ; preds = %4, %6
%7 = phi i8* [ %14, %6 ], [ %0, %4 ]
%8 = phi i32 [ %10, %6 ], [ %2, %4 ]
%9 = phi i8* [ %11, %6 ], [ %1, %4 ]
%10 = add i32 %8, -1
%11 = getelementptr inbounds i8, i8* %9, i64 1
%12 = load i8, i8* %9
%13 = zext i8 %12 to i32
%14 = tail call i8* @put_hex_char(i8* %7, i32 %13, i32 %3)
%15 = icmp eq i32 %10, 0
br i1 %15, label %16, label %6
16: ; preds = %6, %4
%17 = phi i8* [ %0, %4 ], [ %14, %6 ]
store i8 0, i8* %17
ret void
}
int f10(unsigned x) { return x < 1 || x > 0x7fffffff; }


x86 assembly (clang, -O0):
<f10>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0x1,%al
cmpl   $0x1,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jb     1123 <f10+0x23>
cmpl   $0x7fffffff,-0x4(%rbp)
seta   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f10>:
xor    %eax,%eax
test   %edi,%edi
setle  %al
ret

LLVM IR (-O0):
define i32 @f10(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ult i32 %3, 1
br i1 %4, label %8, label %5
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp ugt i32 %6, 2147483647
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ true, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @f10(i32 %0) {
%2 = icmp slt i32 %0, 1
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
scalar_t__ islower(int);
int toupper(int c) {
  if (islower(c))
    c = c - 'a' + 'A';
  return c;
}


x86 assembly (clang, -O0):
<toupper>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <islower@plt>
cmp    $0x0,%rax
je     1139 <toupper+0x29>
mov    -0x4(%rbp),%eax
sub    $0x61,%eax
add    $0x41,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<toupper>:
push   %rbx
mov    %edi,%ebx
call   1030 <islower@plt>
lea    -0x20(%rbx),%ecx
test   %rax,%rax
cmove  %ebx,%ecx
mov    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @toupper(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i64 @islower(i32 %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i32, i32* %2
%8 = sub nsw i32 %7, 97
%9 = add nsw i32 %8, 65
store i32 %9, i32* %2
br label %10
10: ; preds = %6, %1
%11 = load i32, i32* %2
ret i32 %11
}

LLVM IR (-O2):
define i32 @toupper(i32 %0) {
%2 = tail call i64 @islower(i32 %0)
%3 = icmp eq i64 %2, 0
%4 = add nsw i32 %0, -32
%5 = select i1 %3, i32 %0, i32 %4
ret i32 %5
}
void glReadPixels(int x, int y, int width, int height, int format, int type,
                  void *data) {}


x86 assembly (clang, -O0):
<glReadPixels>:
push   %rbp
mov    %rsp,%rbp
mov    0x10(%rbp),%rax
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8d,-0x14(%rbp)
mov    %r9d,-0x18(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @glReadPixels(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5, i8* nocapture %6) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int main() {
  int a[3];
  a[0] = 'x';
  a[1] = 'y';
  a[2] = 'z';
  printf("hello world %d %d\n", a[0], a[1]);
  printf("hello world %d %d\n", *a, *(a + 1));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x78,-0x10(%rbp)
movl   $0x79,-0xc(%rbp)
movl   $0x7a,-0x8(%rbp)
mov    -0x10(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    0xebf(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    0xead(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xee8(%rip),%rbx
mov    %rbx,%rdi
mov    $0x78,%esi
mov    $0x79,%edx
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x78,%esi
mov    $0x79,%edx
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [19 x i8] c"hello world %d %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [3 x i32]
store i32 0, i32* %1
%3 = getelementptr inbounds [3 x i32], [3 x i32]* %2, i64 0, i64 0
store i32 120, i32* %3
%4 = getelementptr inbounds [3 x i32], [3 x i32]* %2, i64 0, i64 1
store i32 121, i32* %4
%5 = getelementptr inbounds [3 x i32], [3 x i32]* %2, i64 0, i64 2
store i32 122, i32* %5
%6 = getelementptr inbounds [3 x i32], [3 x i32]* %2, i64 0, i64 0
%7 = load i32, i32* %6
%8 = getelementptr inbounds [3 x i32], [3 x i32]* %2, i64 0, i64 1
%9 = load i32, i32* %8
%10 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %7, i32 %9)
%11 = getelementptr inbounds [3 x i32], [3 x i32]* %2, i64 0, i64 0
%12 = load i32, i32* %11
%13 = getelementptr inbounds [3 x i32], [3 x i32]* %2, i64 0, i64 0
%14 = getelementptr inbounds i32, i32* %13, i64 1
%15 = load i32, i32* %14
%16 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %12, i32 %15)
ret i32 0
}

LLVM IR (-O2):
@.str = [19 x i8] c"hello world %d %d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 120, i32 121)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 120, i32 121)
ret i32 0
}
/* Variables and functions */
scalar_t__ COND_CC();
int /*<<< orphan*/ EA_AL_8();
int /*<<< orphan*/ m68ki_write_8(int /*<<< orphan*/, int);
void m68k_op_scc_8_al(void) { m68ki_write_8(EA_AL_8(), COND_CC() ? 0xff : 0); }


x86 assembly (clang, -O0):
<m68k_op_scc_8_al>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <EA_AL_8@plt>
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1040 <COND_CC@plt>
mov    -0x4(%rbp),%edi
mov    %rax,%rcx
xor    %esi,%esi
mov    $0xff,%eax
cmp    $0x0,%rcx
cmovne %eax,%esi
call   1050 <m68ki_write_8@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<m68k_op_scc_8_al>:
push   %rbp
push   %rbx
push   %rax
xor    %ebp,%ebp
xor    %eax,%eax
call   1030 <EA_AL_8@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1040 <COND_CC@plt>
test   %rax,%rax
mov    $0xff,%esi
cmove  %ebp,%esi
mov    %ebx,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1050 <m68ki_write_8@plt>

LLVM IR (-O0):
define void @m68k_op_scc_8_al() {
%1 = call i32 (...) @EA_AL_8()
%2 = call i64 (...) @COND_CC()
%3 = icmp ne i64 %2, 0
%4 = zext i1 %3 to i64
%5 = select i1 %3, i32 255, i32 0
%6 = call i32 @m68ki_write_8(i32 %1, i32 %5)
ret void
}

LLVM IR (-O2):
define void @m68k_op_scc_8_al() {
%1 = tail call i32 (...) @EA_AL_8()
%2 = tail call i64 (...) @COND_CC()
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 0, i32 255
%5 = tail call i32 @m68ki_write_8(i32 %1, i32 %4)
ret void
}
int hexToInt(int h) {
  if (h >= '0' && h <= '9') {
    return h - '0';
  } else if (h >= 'a' && h <= 'f') {
    return h - 'a' + 10;
  } else if (h >= 'A' && h <= 'F') {
    return h - 'A' + 10;
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<hexToInt>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x30,-0x8(%rbp)
jl     1129 <hexToInt+0x29>
cmpl   $0x39,-0x8(%rbp)
jg     1129 <hexToInt+0x29>
mov    -0x8(%rbp),%eax
sub    $0x30,%eax
mov    %eax,-0x4(%rbp)
jmp    117a <hexToInt+0x7a>
cmpl   $0x61,-0x8(%rbp)
jl     114e <hexToInt+0x4e>
cmpl   $0x66,-0x8(%rbp)
jg     114e <hexToInt+0x4e>
mov    -0x8(%rbp),%eax
sub    $0x61,%eax
add    $0xa,%eax
mov    %eax,-0x4(%rbp)
jmp    117a <hexToInt+0x7a>
cmpl   $0x41,-0x8(%rbp)
jl     1173 <hexToInt+0x73>
cmpl   $0x46,-0x8(%rbp)
jg     1173 <hexToInt+0x73>
mov    -0x8(%rbp),%eax
sub    $0x41,%eax
add    $0xa,%eax
mov    %eax,-0x4(%rbp)
jmp    117a <hexToInt+0x7a>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hexToInt>:
lea    -0x30(%rdi),%eax
cmp    $0xa,%eax
jb     1124 <hexToInt+0x24>
lea    -0x61(%rdi),%eax
cmp    $0x5,%eax
ja     1116 <hexToInt+0x16>
add    $0xffffffa9,%edi
mov    %edi,%eax
ret
lea    -0x41(%rdi),%ecx
add    $0xffffffc9,%edi
xor    %eax,%eax
cmp    $0x6,%ecx
cmovb  %edi,%eax
ret

LLVM IR (-O0):
define i32 @hexToInt(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp sge i32 %4, 48
br i1 %5, label %6, label %12
6: ; preds = %1
%7 = load i32, i32* %3
%8 = icmp sle i32 %7, 57
br i1 %8, label %9, label %12
9: ; preds = %6
%10 = load i32, i32* %3
%11 = sub nsw i32 %10, 48
store i32 %11, i32* %2
br label %33
12: ; preds = %6, %1
%13 = load i32, i32* %3
%14 = icmp sge i32 %13, 97
br i1 %14, label %15, label %22
15: ; preds = %12
%16 = load i32, i32* %3
%17 = icmp sle i32 %16, 102
br i1 %17, label %18, label %22
18: ; preds = %15
%19 = load i32, i32* %3
%20 = sub nsw i32 %19, 97
%21 = add nsw i32 %20, 10
store i32 %21, i32* %2
br label %33
22: ; preds = %15, %12
%23 = load i32, i32* %3
%24 = icmp sge i32 %23, 65
br i1 %24, label %25, label %32
25: ; preds = %22
%26 = load i32, i32* %3
%27 = icmp sle i32 %26, 70
br i1 %27, label %28, label %32
28: ; preds = %25
%29 = load i32, i32* %3
%30 = sub nsw i32 %29, 65
%31 = add nsw i32 %30, 10
store i32 %31, i32* %2
br label %33
32: ; preds = %25, %22
store i32 0, i32* %2
br label %33
33: ; preds = %32, %28, %18, %9
%34 = load i32, i32* %2
ret i32 %34
}

LLVM IR (-O2):
define i32 @hexToInt(i32 %0) {
%2 = add i32 %0, -48
%3 = icmp ult i32 %2, 10
br i1 %3, label %14, label %4
4: ; preds = %1
%5 = add i32 %0, -97
%6 = icmp ult i32 %5, 6
br i1 %6, label %7, label %9
7: ; preds = %4
%8 = add nsw i32 %0, -87
br label %14
9: ; preds = %4
%10 = add i32 %0, -65
%11 = icmp ult i32 %10, 6
%12 = add nsw i32 %0, -55
%13 = select i1 %11, i32 %12, i32 0
br label %14
14: ; preds = %1, %9, %7
%15 = phi i32 [ %8, %7 ], [ %13, %9 ], [ %2, %1 ]
ret i32 %15
}
char backslash_curr(char curr) {
  static const char vals[] = {
      ['a'] = '\a', ['b'] = '\b', ['f'] = '\f', ['n'] = '\n',
      ['r'] = '\r', ['t'] = '\t', ['v'] = '\v', ['\''] = '\''};
  return vals[(int)curr];
}


x86 assembly (clang, -O0):
<backslash_curr>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
movslq %eax,%rcx
lea    0xee8(%rip),%rax
movsbl (%rax,%rcx,1),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<backslash_curr>:
movslq %edi,%rax
lea    0xef6(%rip),%rcx
mov    (%rax,%rcx,1),%al
ret

LLVM IR (-O0):
@backslash_curr.vals = internal constant [119 x i8] c"\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00'\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\07\08\00\00\00\0C\00\00\00\00\00\00\00\0A\00\00\00\0D\00\09\00\0B"
define signext i8 @backslash_curr(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = sext i32 %4 to i64
%6 = getelementptr inbounds [119 x i8], [119 x i8]* @backslash_curr.vals, i64 0, i64 %5
%7 = load i8, i8* %6
ret i8 %7
}

LLVM IR (-O2):
@backslash_curr.vals = internal unnamed_addr constant [119 x i8] c"\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00'\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\07\08\00\00\00\0C\00\00\00\00\00\00\00\0A\00\00\00\0D\00\09\00\0B"
define signext i8 @backslash_curr(i8 signext %0) {
%2 = sext i8 %0 to i64
%3 = getelementptr inbounds [119 x i8], [119 x i8]* @backslash_curr.vals, i64 0, i64 %2
%4 = load i8, i8* %3
ret i8 %4
}
int read(int fd, char *buf, int len) {}


x86 assembly (clang, -O0):
<read>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @read(i32 %0, i8* nocapture readnone %1, i32 %2) {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, unsigned long);
unsigned long sum1N(int);
unsigned long sumsq1N(int);
int main() {
  unsigned long int s1N, sq1N, t, diff;
  s1N = sum1N(100);
  sq1N = sumsq1N(100);
  diff = s1N * s1N - sq1N;
  printf("\nResult is %u", diff);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x64,%edi
call   1050 <sum1N@plt>
mov    %rax,-0x10(%rbp)
mov    $0x64,%edi
call   1040 <sumsq1N@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
imul   -0x10(%rbp),%rax
sub    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rsi
lea    0xe89(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x64,%edi
call   1050 <sum1N@plt>
mov    %rax,%rbx
mov    $0x64,%edi
call   1040 <sumsq1N@plt>
imul   %rbx,%rbx
sub    %rax,%rbx
lea    0xeaa(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"\0AResult is %u\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i64
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
store i32 0, i32* %1
%6 = call i64 @sum1N(i32 100)
store i64 %6, i64* %2
%7 = call i64 @sumsq1N(i32 100)
store i64 %7, i64* %3
%8 = load i64, i64* %2
%9 = load i64, i64* %2
%10 = mul i64 %8, %9
%11 = load i64, i64* %3
%12 = sub i64 %10, %11
store i64 %12, i64* %5
%13 = load i64, i64* %5
%14 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i64 %13)
ret i32 0
}

LLVM IR (-O2):
@.str = [14 x i8] c"\0AResult is %u\00"
define i32 @main() {
%1 = tail call i64 @sum1N(i32 100)
%2 = tail call i64 @sumsq1N(i32 100)
%3 = mul i64 %1, %1
%4 = sub i64 %3, %2
%5 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i64 %4)
ret i32 0
}
void TextMode(int Mode) {}


x86 assembly (clang, -O0):
<TextMode>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @TextMode(i32 %0) {
ret void
}