xunge/DecIR huggingface dataset:
/* Variables and functions */
char *getenv(char *);
scalar_t__ strncmp(char const *, char *, int);
const char *socket_wrapper_dir(void) {
  const char *s = getenv("SOCKET_WRAPPER_DIR");
  if (s == NULL) {
    return NULL;
  }
  if (strncmp(s, "./", 2) == 0) {
    s += 2;
  }
  return s;
}


x86 assembly (clang, -O0):
<socket_wrapper_dir>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
call   1030 <getenv@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1150 <socket_wrapper_dir+0x30>
movq   $0x0,-0x8(%rbp)
jmp    1183 <socket_wrapper_dir+0x63>
mov    -0x10(%rbp),%rdi
lea    0xeb8(%rip),%rsi
mov    $0x2,%edx
call   1040 <strncmp@plt>
cmp    $0x0,%rax
jne    117b <socket_wrapper_dir+0x5b>
mov    -0x10(%rbp),%rax
add    $0x2,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<socket_wrapper_dir>:
push   %rbx
lea    0xed8(%rip),%rdi
call   1030 <getenv@plt>
test   %rax,%rax
je     1157 <socket_wrapper_dir+0x37>
mov    %rax,%rbx
lea    0xed7(%rip),%rsi
mov    %rax,%rdi
mov    $0x2,%edx
call   1040 <strncmp@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
lea    (%rbx,%rcx,2),%rax
pop    %rbx
ret
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [19 x i8] c"SOCKET_WRAPPER_DIR\00"
@.str.1 = [3 x i8] c"./\00"
define i8* @socket_wrapper_dir() {
%1 = alloca i8*
%2 = alloca i8*
%3 = call i8* @getenv(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
store i8* %3, i8** %2
%4 = load i8*, i8** %2
%5 = icmp eq i8* %4, null
br i1 %5, label %6, label %7
6: ; preds = %0
store i8* null, i8** %1
br label %16
7: ; preds = %0
%8 = load i8*, i8** %2
%9 = call i64 @strncmp(i8* %8, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 2)
%10 = icmp eq i64 %9, 0
br i1 %10, label %11, label %14
11: ; preds = %7
%12 = load i8*, i8** %2
%13 = getelementptr inbounds i8, i8* %12, i64 2
store i8* %13, i8** %2
br label %14
14: ; preds = %11, %7
%15 = load i8*, i8** %2
store i8* %15, i8** %1
br label %16
16: ; preds = %14, %6
%17 = load i8*, i8** %1
ret i8* %17
}

LLVM IR (-O2):
@.str = [19 x i8] c"SOCKET_WRAPPER_DIR\00"
@.str.1 = [3 x i8] c"./\00"
define i8* @socket_wrapper_dir() {
%1 = tail call i8* @getenv(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%2 = icmp eq i8* %1, null
br i1 %2, label %8, label %3
3: ; preds = %0
%4 = tail call i64 @strncmp(i8* %1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 2)
%5 = icmp eq i64 %4, 0
%6 = select i1 %5, i64 2, i64 0
%7 = getelementptr i8, i8* %1, i64 %6
br label %8
8: ; preds = %0, %3
%9 = phi i8* [ %7, %3 ], [ null, %0 ]
ret i8* %9
}
/* Variables and functions */
char const *lsc_lookup(char const *);
const char *suf_color(const char *name, size_t len) {
  while (len--)
    if (name[len] == '.')
      return lsc_lookup(name + len);
  return 0;
}


x86 assembly (clang, -O0):
<suf_color>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0xffffffffffffffff,%rcx
mov    %rcx,-0x18(%rbp)
cmp    $0x0,%rax
je     1169 <suf_color+0x59>
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x2e,%eax
jne    1164 <suf_color+0x54>
mov    -0x10(%rbp),%rdi
add    -0x18(%rbp),%rdi
call   1030 <lsc_lookup@plt>
mov    %rax,-0x8(%rbp)
jmp    1171 <suf_color+0x61>
jmp    1120 <suf_color+0x10>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<suf_color>:
mov    %rsi,%rax
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
sub    $0x1,%rax
jb     1138 <suf_color+0x28>
cmpb   $0x2e,-0x1(%rdi,%rsi,1)
mov    %rax,%rsi
jne    1120 <suf_color+0x10>
add    %rax,%rdi
jmp    1030 <lsc_lookup@plt>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i8* @suf_color(i8* %0, i64 %1) {
br label %3
3: ; preds = %7, %2
%4 = phi i64 [ %1, %2 ], [ %5, %7 ]
%5 = add i64 %4, -1
%6 = icmp eq i64 %4, 0
br i1 %6, label %14, label %7
7: ; preds = %3
%8 = getelementptr inbounds i8, i8* %0, i64 %5
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 46
br i1 %10, label %11, label %3
11: ; preds = %7
%12 = getelementptr inbounds i8, i8* %0, i64 %5
%13 = tail call i8* @lsc_lookup(i8* %12)
br label %14
14: ; preds = %3, %11
%15 = phi i8* [ %13, %11 ], [ null, %3 ]
ret i8* %15
}
float obdConvert_0C(unsigned int A, unsigned int B, unsigned int C,
                    unsigned int D) {
  return (((float)A * 256.0) + (float)B) / 4.0f;
}


x86 assembly (clang, -O0):
<obdConvert_0C>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x4(%rbp),%eax
cvtsi2ss %rax,%xmm0
cvtss2sd %xmm0,%xmm0
mov    -0x8(%rbp),%eax
cvtsi2ss %rax,%xmm1
cvtss2sd %xmm1,%xmm1
movsd  0xed8(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  0xec0(%rip),%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<obdConvert_0C>:
mov    %edi,%eax
cvtsi2ss %rax,%xmm0
cvtss2sd %xmm0,%xmm0
mov    %esi,%eax
cvtsi2ss %rax,%xmm1
cvtss2sd %xmm1,%xmm1
mulsd  0xee2(%rip),%xmm0
addsd  %xmm1,%xmm0
mulsd  0xede(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
ret

LLVM IR (-O0):
define float @obdConvert_0C(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32, i32* %5
%10 = uitofp i32 %9 to float
%11 = fpext float %10 to double
%12 = load i32, i32* %6
%13 = uitofp i32 %12 to float
%14 = fpext float %13 to double
%15 = call double @llvm.fmuladd.f64(double %11, double 2.560000e+02, double %14)
%16 = fdiv double %15, 4.000000e+00
%17 = fptrunc double %16 to float
ret float %17
}

LLVM IR (-O2):
define float @obdConvert_0C(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = uitofp i32 %0 to float
%6 = fpext float %5 to double
%7 = uitofp i32 %1 to float
%8 = fpext float %7 to double
%9 = tail call double @llvm.fmuladd.f64(double %6, double 2.560000e+02, double %8)
%10 = fmul double %9, 2.500000e-01
%11 = fptrunc double %10 to float
ret float %11
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(int *, char *, int);
int get_word(char *p) {
  int v;
  memcpy(&v, p, 4);
  return v;
}


x86 assembly (clang, -O0):
<get_word>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdi
mov    $0x4,%edx
call   1030 <memcpy@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_word>:
push   %rax
mov    %rdi,%rsi
lea    0x4(%rsp),%rdi
mov    $0x4,%edx
call   1030 <memcpy@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @get_word(i8* %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = call i32 @memcpy(i32* %2, i8* %0, i32 4)
%5 = load i32, i32* %2
ret i32 %5
}
int sum(int n) {
  int r = 0;
  while (n > 0) {
    r += n;
    n--;
  }
  return r;
}


x86 assembly (clang, -O0):
<sum>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
jle    112f <sum+0x2f>
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x4(%rbp)
jmp    110e <sum+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sum>:
test   %edi,%edi
jle    1119 <sum+0x19>
lea    -0x1(%rdi),%eax
lea    -0x2(%rdi),%ecx
imul   %rax,%rcx
imul   %eax,%eax
shr    %rcx
add    %edi,%eax
sub    %ecx,%eax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @sum(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %14
3: ; preds = %1
%4 = add nsw i32 %0, -1
%5 = mul i32 %4, %4
%6 = zext i32 %4 to i33
%7 = add nsw i32 %0, -2
%8 = zext i32 %7 to i33
%9 = mul i33 %6, %8
%10 = lshr i33 %9, 1
%11 = trunc i33 %10 to i32
%12 = add i32 %5, %0
%13 = sub i32 %12, %11
br label %14
14: ; preds = %3, %1
%15 = phi i32 [ 0, %1 ], [ %13, %3 ]
ret i32 %15
}
/* Variables and functions */
char *notImplemented();
char *serverClientList(char *unused1, char *unused2, char *unused3) {
  (void)(unused1);
  (void)(unused2);
  (void)(unused3);
  return notImplemented();
}


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

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

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

LLVM IR (-O2):
define i8* @serverClientList(i8* nocapture readnone %0, i8* nocapture readnone %1, i8* nocapture readnone %2) {
%4 = tail call i8* (...) @notImplemented()
ret i8* %4
}
/* Type definitions */
typedef int /*<<< orphan*/ __u32;

/* Variables and functions */
void *nla_reserve(void **, int, int);
void nla_put_u32(void **ctx, int t, __u32 var) {
  void *data = nla_reserve(ctx, t, sizeof(__u32));
  *(__u32 *)data = var;
}


x86 assembly (clang, -O0):
<nla_put_u32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    $0x4,%edx
call   1030 <nla_reserve@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nla_put_u32>:
push   %rbx
mov    %edx,%ebx
mov    $0x4,%edx
call   1030 <nla_reserve@plt>
mov    %ebx,(%rax)
pop    %rbx
ret

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

LLVM IR (-O2):
define void @nla_put_u32(i8** %0, i32 %1, i32 %2) {
%4 = tail call i8* @nla_reserve(i8** %0, i32 %1, i32 4)
%5 = bitcast i8* %4 to i32*
store i32 %2, i32* %5
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, float);
main() {
  int radius = 10;
  float pi = 3.141592;
  int circle_area1;
  float circle_area2;
  circle_area1 = pi * radius * radius;
  circle_area2 = pi * radius * radius;
  printf("area1=%f\n", (float)circle_area1);
  printf("area2=%f\n", circle_area2);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0xa,-0x4(%rbp)
movss  0xed9(%rip),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
cvtsi2ssl -0x4(%rbp),%xmm1
mulss  %xmm1,%xmm0
cvtsi2ssl -0x4(%rbp),%xmm1
mulss  %xmm1,%xmm0
cvttss2si %xmm0,%eax
mov    %eax,-0xc(%rbp)
movss  -0x8(%rbp),%xmm0
cvtsi2ssl -0x4(%rbp),%xmm1
mulss  %xmm1,%xmm0
cvtsi2ssl -0x4(%rbp),%xmm1
mulss  %xmm1,%xmm0
movss  %xmm0,-0x10(%rbp)
cvtsi2ssl -0xc(%rbp),%xmm0
lea    0xe92(%rip),%rdi
call   1030 <printf@plt>
movss  -0x10(%rbp),%xmm0
lea    0xe8b(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [10 x i8] c"area1=%f\0A\00"
@.str.1 = [10 x i8] c"area2=%f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = alloca i32
%4 = alloca float
store i32 10, i32* %1
store float 0x400921FB00000000, float* %2
%5 = load float, float* %2
%6 = load i32, i32* %1
%7 = sitofp i32 %6 to float
%8 = fmul float %5, %7
%9 = load i32, i32* %1
%10 = sitofp i32 %9 to float
%11 = fmul float %8, %10
%12 = fptosi float %11 to i32
store i32 %12, i32* %3
%13 = load float, float* %2
%14 = load i32, i32* %1
%15 = sitofp i32 %14 to float
%16 = fmul float %13, %15
%17 = load i32, i32* %1
%18 = sitofp i32 %17 to float
%19 = fmul float %16, %18
store float %19, float* %4
%20 = load i32, i32* %3
%21 = sitofp i32 %20 to float
%22 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), float %21)
%23 = load float, float* %4
%24 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), float %23)
ret i32 0
}

LLVM IR (-O2):
@.str = [10 x i8] c"area1=%f\0A\00"
@.str.1 = [10 x i8] c"area2=%f\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), float 3.140000e+02)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), float 0x4073A28C20000000)
ret i32 0
}
/* Variables and functions */
double log(double);
double c_log(double arg0) { return log(arg0); }


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

x86 assembly (clang, -O2):
<c_log>:
jmp    1030 <log@plt>

LLVM IR (-O0):
define double @c_log(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call double @log(double %3)
ret double %4
}

LLVM IR (-O2):
define double @c_log(double %0) {
%2 = tail call double @log(double %0)
ret double %2
}
void swapValuesPositions(int *theArray, int leftPosition, int rightPosition) {
  int tmpPosition;
  tmpPosition = theArray[leftPosition];
  theArray[leftPosition] = theArray[rightPosition];
  theArray[rightPosition] = tmpPosition;
}


x86 assembly (clang, -O0):
<swapValuesPositions>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x14(%rbp),%edx
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
pop    %rbp
ret

x86 assembly (clang, -O2):
<swapValuesPositions>:
movslq %esi,%rax
mov    (%rdi,%rax,4),%ecx
movslq %edx,%rdx
mov    (%rdi,%rdx,4),%esi
mov    %esi,(%rdi,%rax,4)
mov    %ecx,(%rdi,%rdx,4)
ret

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

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

/* Variables and functions */
int getc(int /*<<< orphan*/ *);
int /*<<< orphan*/ ungetc(int, int /*<<< orphan*/ *);
void skipspaces(FILE *file) {
  int c;
  while (1) {
    c = getc(file);
    if (c != ' ' && c != '\r' && c != '\n') {
      ungetc(c, file);
      return;
    }
  }
}


x86 assembly (clang, -O0):
<skipspaces>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <getc@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x20,-0xc(%rbp)
je     1168 <skipspaces+0x48>
cmpl   $0xd,-0xc(%rbp)
je     1168 <skipspaces+0x48>
cmpl   $0xa,-0xc(%rbp)
je     1168 <skipspaces+0x48>
mov    -0xc(%rbp),%edi
mov    -0x8(%rbp),%rsi
call   1030 <ungetc@plt>
add    $0x10,%rsp
pop    %rbp
ret
jmp    112c <skipspaces+0xc>

x86 assembly (clang, -O2):
<skipspaces>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
movabs $0x100002400,%r14
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
call   1040 <getc@plt>
cmp    $0x20,%eax
ja     1155 <skipspaces+0x35>
mov    %eax,%ecx
bt     %rcx,%r14
jb     1140 <skipspaces+0x20>
mov    %eax,%edi
mov    %rbx,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <ungetc@plt>

LLVM IR (-O0):
define void @skipspaces(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
br label %4
4: ; preds = %1, %19
%5 = load i32*, i32** %2
%6 = call i32 @getc(i32* %5)
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = icmp ne i32 %7, 32
br i1 %8, label %9, label %19
9: ; preds = %4
%10 = load i32, i32* %3
%11 = icmp ne i32 %10, 13
br i1 %11, label %12, label %19
12: ; preds = %9
%13 = load i32, i32* %3
%14 = icmp ne i32 %13, 10
br i1 %14, label %15, label %19
15: ; preds = %12
%16 = load i32, i32* %3
%17 = load i32*, i32** %2
%18 = call i32 @ungetc(i32 %16, i32* %17)
ret void
19: ; preds = %12, %9, %4
br label %4
}

LLVM IR (-O2):
define void @skipspaces(i32* nocapture %0) {
br label %2
2: ; preds = %4, %1
%3 = tail call i32 @getc(i32* %0)
switch i32 %3, label %5 [
i32 32, label %4
i32 13, label %4
i32 10, label %4
]
4: ; preds = %2, %2, %2
br label %2
5: ; preds = %2
%6 = tail call i32 @ungetc(i32 %3, i32* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ FatalErrnoError(int, int, char *);
void *malloc(size_t);
void *Emalloc(size_t size) {
  void *res = malloc(size);
  FatalErrnoError(res == 0 && size != 0, 1, "malloc()");
  return res;
}


x86 assembly (clang, -O0):
<Emalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
xor    %eax,%eax
cmpq   $0x0,-0x10(%rbp)
mov    %al,-0x11(%rbp)
jne    1154 <Emalloc+0x34>
cmpq   $0x0,-0x8(%rbp)
setne  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
mov    $0x1,%esi
lea    0xe98(%rip),%rdx
call   1030 <FatalErrnoError@plt>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Emalloc>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1040 <malloc@plt>
mov    %rax,%r14
test   %rax,%rax
sete   %al
test   %rbx,%rbx
setne  %cl
and    %al,%cl
movzbl %cl,%edi
lea    0xeb9(%rip),%rdx
mov    $0x1,%esi
call   1030 <FatalErrnoError@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [9 x i8] c"malloc()\00"
define i8* @Emalloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp eq i8* %6, null
br i1 %7, label %8, label %11
8: ; preds = %1
%9 = load i64, i64* %2
%10 = icmp ne i64 %9, 0
br label %11
11: ; preds = %8, %1
%12 = phi i1 [ false, %1 ], [ %10, %8 ]
%13 = zext i1 %12 to i32
%14 = call i32 @FatalErrnoError(i32 %13, i32 1, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%15 = load i8*, i8** %3
ret i8* %15
}

LLVM IR (-O2):
@.str = [9 x i8] c"malloc()\00"
define noalias i8* @Emalloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
%4 = icmp ne i64 %0, 0
%5 = and i1 %4, %3
%6 = zext i1 %5 to i32
%7 = tail call i32 @FatalErrnoError(i32 %6, i32 1, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
ret i8* %2
}
/* Variables and functions */
char *malloc_x(int);
char *strcpy(char *, char const *);
int strlen(char const *);
char *str_dup(const char *s) {
  char *p = malloc_x((1 + strlen(s)) * sizeof(char));
  return strcpy(p, s);
}


x86 assembly (clang, -O0):
<str_dup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
add    $0x1,%eax
cltq
shl    $0x0,%rax
mov    %eax,%edi
call   1050 <malloc_x@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<str_dup>:
push   %rbx
mov    %rdi,%rbx
call   1040 <strlen@plt>
lea    0x1(%rax),%edi
call   1050 <malloc_x@plt>
mov    %rax,%rdi
mov    %rbx,%rsi
pop    %rbx
jmp    1030 <strcpy@plt>

LLVM IR (-O0):
define i8* @str_dup(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @strlen(i8* %4)
%6 = add nsw i32 1, %5
%7 = sext i32 %6 to i64
%8 = mul i64 %7, 1
%9 = trunc i64 %8 to i32
%10 = call i8* @malloc_x(i32 %9)
store i8* %10, i8** %3
%11 = load i8*, i8** %3
%12 = load i8*, i8** %2
%13 = call i8* @strcpy(i8* %11, i8* %12)
ret i8* %13
}

LLVM IR (-O2):
define i8* @str_dup(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = add nsw i32 %2, 1
%4 = tail call i8* @malloc_x(i32 %3)
%5 = tail call i8* @strcpy(i8* dereferenceable(1) %4, i8* dereferenceable(1) %0)
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ R_InitData();
int /*<<< orphan*/ R_InitLightTables();
int /*<<< orphan*/ R_InitPatches();
int /*<<< orphan*/ R_InitSkyMap();
int /*<<< orphan*/ R_InitTranslationTables();
int /*<<< orphan*/ R_InitView();
int /*<<< orphan*/ R_LoadTrigTables();
void R_Init(void) {
  R_LoadTrigTables();
  R_InitData();
  R_InitView();
  R_InitLightTables();
  R_InitSkyMap();
  R_InitTranslationTables();
  R_InitPatches();
}


x86 assembly (clang, -O0):
<R_Init>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <R_LoadTrigTables@plt>
mov    $0x0,%al
call   1070 <R_InitData@plt>
mov    $0x0,%al
call   1030 <R_InitView@plt>
mov    $0x0,%al
call   1050 <R_InitLightTables@plt>
mov    $0x0,%al
call   1080 <R_InitSkyMap@plt>
mov    $0x0,%al
call   1060 <R_InitTranslationTables@plt>
mov    $0x0,%al
call   1090 <R_InitPatches@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<R_Init>:
push   %rax
xor    %eax,%eax
call   1040 <R_LoadTrigTables@plt>
xor    %eax,%eax
call   1070 <R_InitData@plt>
xor    %eax,%eax
call   1030 <R_InitView@plt>
xor    %eax,%eax
call   1050 <R_InitLightTables@plt>
xor    %eax,%eax
call   1080 <R_InitSkyMap@plt>
xor    %eax,%eax
call   1060 <R_InitTranslationTables@plt>
xor    %eax,%eax
pop    %rcx
jmp    1090 <R_InitPatches@plt>

LLVM IR (-O0):
define void @R_Init() {
%1 = call i32 (...) @R_LoadTrigTables()
%2 = call i32 (...) @R_InitData()
%3 = call i32 (...) @R_InitView()
%4 = call i32 (...) @R_InitLightTables()
%5 = call i32 (...) @R_InitSkyMap()
%6 = call i32 (...) @R_InitTranslationTables()
%7 = call i32 (...) @R_InitPatches()
ret void
}

LLVM IR (-O2):
define void @R_Init() {
%1 = tail call i32 (...) @R_LoadTrigTables()
%2 = tail call i32 (...) @R_InitData()
%3 = tail call i32 (...) @R_InitView()
%4 = tail call i32 (...) @R_InitLightTables()
%5 = tail call i32 (...) @R_InitSkyMap()
%6 = tail call i32 (...) @R_InitTranslationTables()
%7 = tail call i32 (...) @R_InitPatches()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("Hello, PaperHouse!\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%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
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@str = [19 x i8] c"Hello, PaperHouse!\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int kl_streq(char const *, char const *);
int strlen(char const *);
int kl_streq_end(char const *str, char const *match) {
  int slen = strlen(str);
  int mlen = strlen(match);
  if (slen < mlen) {
    return 0;
  }
  return kl_streq(str + (slen - mlen), match);
}


x86 assembly (clang, -O0):
<kl_streq_end>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,-0x20(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x20(%rbp),%eax
jge    1160 <kl_streq_end+0x40>
movl   $0x0,-0x4(%rbp)
jmp    117b <kl_streq_end+0x5b>
mov    -0x10(%rbp),%rdi
mov    -0x1c(%rbp),%eax
sub    -0x20(%rbp),%eax
cltq
add    %rax,%rdi
mov    -0x18(%rbp),%rsi
call   1030 <kl_streq@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<kl_streq_end>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%rbx
call   1040 <strlen@plt>
mov    %eax,%ebp
mov    %r14,%rdi
call   1040 <strlen@plt>
sub    %eax,%ebp
jge    1144 <kl_streq_end+0x24>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret
movslq %ebp,%rax
add    %rax,%rbx
mov    %rbx,%rdi
mov    %r14,%rsi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <kl_streq@plt>

LLVM IR (-O0):
define i32 @kl_streq_end(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
%8 = load i8*, i8** %4
%9 = call i32 @strlen(i8* %8)
store i32 %9, i32* %6
%10 = load i8*, i8** %5
%11 = call i32 @strlen(i8* %10)
store i32 %11, i32* %7
%12 = load i32, i32* %6
%13 = load i32, i32* %7
%14 = icmp slt i32 %12, %13
br i1 %14, label %15, label %16
15: ; preds = %2
store i32 0, i32* %3
br label %25
16: ; preds = %2
%17 = load i8*, i8** %4
%18 = load i32, i32* %6
%19 = load i32, i32* %7
%20 = sub nsw i32 %18, %19
%21 = sext i32 %20 to i64
%22 = getelementptr inbounds i8, i8* %17, i64 %21
%23 = load i8*, i8** %5
%24 = call i32 @kl_streq(i8* %22, i8* %23)
store i32 %24, i32* %3
br label %25
25: ; preds = %16, %15
%26 = load i32, i32* %3
ret i32 %26
}

LLVM IR (-O2):
define i32 @kl_streq_end(i8* %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %0)
%4 = tail call i32 @strlen(i8* %1)
%5 = icmp slt i32 %3, %4
br i1 %5, label %11, label %6
6: ; preds = %2
%7 = sub nsw i32 %3, %4
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i8, i8* %0, i64 %8
%10 = tail call i32 @kl_streq(i8* %9, i8* %1)
br label %11
11: ; preds = %2, %6
%12 = phi i32 [ %10, %6 ], [ 0, %2 ]
ret i32 %12
}
int test_addOK(int x, int y) {
  int sum = x + y;
  return !(x < 0 && y < 0 && sum >= 0) && !(x > 0 && y > 0 && sum <= 0);
}


x86 assembly (clang, -O0):
<test_addOK>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    1136 <test_addOK+0x36>
cmpl   $0x0,-0x8(%rbp)
jge    1136 <test_addOK+0x36>
xor    %eax,%eax
cmpl   $0x0,-0xc(%rbp)
mov    %al,-0xd(%rbp)
jge    1166 <test_addOK+0x66>
xor    %eax,%eax
cmpl   $0x0,-0x4(%rbp)
mov    %al,-0xe(%rbp)
jle    115e <test_addOK+0x5e>
xor    %eax,%eax
cmpl   $0x0,-0x8(%rbp)
mov    %al,-0xe(%rbp)
jle    115e <test_addOK+0x5e>
cmpl   $0x0,-0xc(%rbp)
setle  %al
mov    %al,-0xe(%rbp)
mov    -0xe(%rbp),%al
xor    $0xff,%al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_addOK>:
lea    (%rsi,%rdi,1),%ecx
test   %edi,%esi
jns    110e <test_addOK+0xe>
xor    %eax,%eax
test   %ecx,%ecx
js     110e <test_addOK+0xe>
ret
test   %edi,%edi
setle  %al
test   %esi,%esi
setle  %dl
test   %ecx,%ecx
setg   %cl
or     %al,%dl
or     %cl,%dl
movzbl %dl,%eax
ret

LLVM IR (-O0):
define i32 @test_addOK(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = load i32, i32* %4
%8 = add nsw i32 %6, %7
store i32 %8, i32* %5
%9 = load i32, i32* %3
%10 = icmp slt i32 %9, 0
br i1 %10, label %11, label %17
11: ; preds = %2
%12 = load i32, i32* %4
%13 = icmp slt i32 %12, 0
br i1 %13, label %14, label %17
14: ; preds = %11
%15 = load i32, i32* %5
%16 = icmp sge i32 %15, 0
br i1 %16, label %29, label %17
17: ; preds = %14, %11, %2
%18 = load i32, i32* %3
%19 = icmp sgt i32 %18, 0
br i1 %19, label %20, label %26
20: ; preds = %17
%21 = load i32, i32* %4
%22 = icmp sgt i32 %21, 0
br i1 %22, label %23, label %26
23: ; preds = %20
%24 = load i32, i32* %5
%25 = icmp sle i32 %24, 0
br label %26
26: ; preds = %23, %20, %17
%27 = phi i1 [ false, %20 ], [ false, %17 ], [ %25, %23 ]
%28 = xor i1 %27, true
br label %29
29: ; preds = %26, %14
%30 = phi i1 [ false, %14 ], [ %28, %26 ]
%31 = zext i1 %30 to i32
ret i32 %31
}

LLVM IR (-O2):
define i32 @test_addOK(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
%4 = and i32 %1, %0
%5 = icmp slt i32 %4, 0
%6 = icmp sgt i32 %3, -1
%7 = select i1 %5, i1 %6, i1 false
br i1 %7, label %15, label %8
8: ; preds = %2
%9 = icmp slt i32 %0, 1
%10 = icmp slt i32 %1, 1
%11 = icmp sgt i32 %3, 0
%12 = or i1 %9, %10
%13 = select i1 %12, i1 true, i1 %11
%14 = zext i1 %13 to i32
br label %15
15: ; preds = %2, %8
%16 = phi i32 [ %14, %8 ], [ 0, %2 ]
ret i32 %16
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char *argv[]) {
  printf("(80 >> 1)"
         " -> %d\n",
         ((80 >> 1)));
  printf("(80 / 2)"
         " -> %d\n",
         ((80 / 2)));
  printf("(80 << 1)"
         " -> %d\n",
         ((80 << 1)));
  printf("(80 * 2)"
         " -> %d\n",
         ((80 * 2)));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xeda(%rip),%rdi
mov    $0x28,%esi
call   1030 <printf@plt>
lea    0xeda(%rip),%rdi
mov    $0x28,%esi
call   1030 <printf@plt>
lea    0xed9(%rip),%rdi
mov    $0xa0,%esi
call   1030 <printf@plt>
lea    0xed9(%rip),%rdi
mov    $0xa0,%esi
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    $0x28,%esi
call   1030 <printf@plt>
lea    0xee8(%rip),%rdi
mov    $0x28,%esi
call   1030 <printf@plt>
lea    0xee7(%rip),%rdi
mov    $0xa0,%esi
call   1030 <printf@plt>
lea    0xee7(%rip),%rdi
mov    $0xa0,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [17 x i8] c"(80 >> 1) -> %d\0A\00"
@.str.1 = [16 x i8] c"(80 / 2) -> %d\0A\00"
@.str.2 = [17 x i8] c"(80 << 1) -> %d\0A\00"
@.str.3 = [16 x i8] c"(80 * 2) -> %d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 40)
%6 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i32 40)
%7 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0), i32 160)
%8 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.3, i64 0, i64 0), i32 160)
ret i32 0
}

LLVM IR (-O2):
@.str = [17 x i8] c"(80 >> 1) -> %d\0A\00"
@.str.1 = [16 x i8] c"(80 / 2) -> %d\0A\00"
@.str.2 = [17 x i8] c"(80 << 1) -> %d\0A\00"
@.str.3 = [16 x i8] c"(80 * 2) -> %d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 40)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i32 40)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0), i32 160)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.3, i64 0, i64 0), i32 160)
ret i32 0
}
/* Variables and functions */
__attribute__((visibility("default"))) const char *
sd_ascii_is_valid(const char *s) {
  return NULL;
}


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

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

LLVM IR (-O0):
define i8* @sd_ascii_is_valid(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @sd_ascii_is_valid(i8* nocapture readnone %0) {
ret i8* null
}
/* Variables and functions */
scalar_t__ strcmp(char const *, char const *);
int oct_ne(const char *pat, const char *text) {
  return (strcmp(text, pat) != 0);
}


x86 assembly (clang, -O0):
<oct_ne>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
setne  %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<oct_ne>:
push   %rax
mov    %rdi,%rax
mov    %rsi,%rdi
mov    %rax,%rsi
call   1030 <strcmp@plt>
xor    %ecx,%ecx
test   %rax,%rax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @oct_ne(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = load i8*, i8** %3
%7 = call i64 @strcmp(i8* %5, i8* %6)
%8 = icmp ne i64 %7, 0
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @oct_ne(i8* %0, i8* %1) {
%3 = tail call i64 @strcmp(i8* %1, i8* %0)
%4 = icmp ne i64 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
void rl_redisplay(void) {}


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

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

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

LLVM IR (-O2):
define void @rl_redisplay() {
ret void
}
int __attribute__((visibility("default"))) lib3fun() { return 0; }


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

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

LLVM IR (-O0):
define i32 @lib3fun() {
ret i32 0
}

LLVM IR (-O2):
define i32 @lib3fun() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printk(char *);
int main() {
  printk("ceci est un test");
  for (;;)
    ;
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
call   1030 <printk@plt>
jmp    112b <main+0x1b>

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <printk@plt>
nopl   (%rax)
jmp    1120 <main+0x10>

LLVM IR (-O0):
@.str = [17 x i8] c"ceci est un test\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printk(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
br label %3
3: ; preds = %3, %0
br label %3
}

LLVM IR (-O2):
@.str = [17 x i8] c"ceci est un test\00"
define i32 @main() {
%1 = tail call i32 @printk(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
br label %2
2: ; preds = %2, %0
br label %2
}
void INT_Excep_PERIA_INTA215(void) {}


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

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

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

LLVM IR (-O2):
define void @INT_Excep_PERIA_INTA215() {
ret void
}
unsigned long int stress_hash(const int *p) { return *p; }


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

x86 assembly (clang, -O2):
<stress_hash>:
movslq (%rdi),%rax
ret

LLVM IR (-O0):
define i64 @stress_hash(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* %3
%5 = sext i32 %4 to i64
ret i64 %5
}

LLVM IR (-O2):
define i64 @stress_hash(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = sext i32 %2 to i64
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ IPPROTO_TCP;
int /*<<< orphan*/ TCP_QUICKACK;
int diminuto_ipc_set_socket(int, int /*<<< orphan*/, int /*<<< orphan*/, int);
int diminuto_ipc_set_quickack(int fd, int enable) {
  return diminuto_ipc_set_socket(fd, IPPROTO_TCP, TCP_QUICKACK, !!enable);
}


x86 assembly (clang, -O0):
<diminuto_ipc_set_quickack>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2ec0(%rip),%rax
mov    (%rax),%esi
mov    0x2eaf(%rip),%rax
mov    (%rax),%edx
cmpl   $0x0,-0x8(%rbp)
setne  %al
xor    $0xff,%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%ecx
call   1030 <diminuto_ipc_set_socket@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<diminuto_ipc_set_quickack>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%eax
mov    0x2ec0(%rip),%rcx
mov    (%rcx),%edx
xor    %ecx,%ecx
test   %esi,%esi
setne  %cl
mov    %eax,%esi
jmp    1030 <diminuto_ipc_set_socket@plt>

LLVM IR (-O0):
@IPPROTO_TCP = global i32 0
@TCP_QUICKACK = global i32 0
define i32 @diminuto_ipc_set_quickack(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* @IPPROTO_TCP
%7 = load i32, i32* @TCP_QUICKACK
%8 = load i32, i32* %4
%9 = icmp ne i32 %8, 0
%10 = xor i1 %9, true
%11 = xor i1 %10, true
%12 = zext i1 %11 to i32
%13 = call i32 @diminuto_ipc_set_socket(i32 %5, i32 %6, i32 %7, i32 %12)
ret i32 %13
}

LLVM IR (-O2):
@IPPROTO_TCP = global i32 0
@TCP_QUICKACK = global i32 0
define i32 @diminuto_ipc_set_quickack(i32 %0, i32 %1) {
%3 = load i32, i32* @IPPROTO_TCP
%4 = load i32, i32* @TCP_QUICKACK
%5 = icmp ne i32 %1, 0
%6 = zext i1 %5 to i32
%7 = tail call i32 @diminuto_ipc_set_socket(i32 %0, i32 %3, i32 %4, i32 %6)
ret i32 %7
}
double fdivide(double x, double y) { return x / y; }


x86 assembly (clang, -O0):
<fdivide>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
divsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<fdivide>:
divsd  %xmm1,%xmm0
ret

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

LLVM IR (-O2):
define double @fdivide(double %0, double %1) {
%3 = fdiv double %0, %1
ret double %3
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_mutex_t;

/* Variables and functions */
int __infer_nondet_int();
int pthread_mutex_trylock(pthread_mutex_t *mutex) {
  if (mutex == 0)
    while (1)
      ;
  return __infer_nondet_int();
}


x86 assembly (clang, -O0):
<pthread_mutex_trylock>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1131 <pthread_mutex_trylock+0x21>
jmp    112c <pthread_mutex_trylock+0x1c>
jmp    112c <pthread_mutex_trylock+0x1c>
mov    $0x0,%al
call   1030 <__infer_nondet_int@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pthread_mutex_trylock>:
test   %rdi,%rdi
je     1120 <pthread_mutex_trylock+0x10>
xor    %eax,%eax
jmp    1030 <__infer_nondet_int@plt>
nopl   0x0(%rax)
jmp    1120 <pthread_mutex_trylock+0x10>

LLVM IR (-O0):
define i32 @pthread_mutex_trylock(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = icmp eq i32* %3, null
br i1 %4, label %5, label %7
5: ; preds = %1
br label %6
6: ; preds = %5, %6
br label %6
7: ; preds = %1
%8 = call i32 (...) @__infer_nondet_int()
ret i32 %8
}

LLVM IR (-O2):
define i32 @pthread_mutex_trylock(i32* readnone %0) {
%2 = icmp eq i32* %0, null
br i1 %2, label %3, label %4
3: ; preds = %1, %3
br label %3
4: ; preds = %1
%5 = tail call i32 (...) @__infer_nondet_int()
ret i32 %5
}
int lua_handlers_init(void) { return 0; }


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

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

LLVM IR (-O0):
define i32 @lua_handlers_init() {
ret i32 0
}

LLVM IR (-O2):
define i32 @lua_handlers_init() {
ret i32 0
}
int cairo_code_draw_envDecayLabel_get_width() { return 7; }


x86 assembly (clang, -O0):
<cairo_code_draw_envDecayLabel_get_width>:
push   %rbp
mov    %rsp,%rbp
mov    $0x7,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @cairo_code_draw_envDecayLabel_get_width() {
ret i32 7
}

LLVM IR (-O2):
define i32 @cairo_code_draw_envDecayLabel_get_width() {
ret i32 7
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, unsigned long);
void *malloc(size_t);
int /*<<< orphan*/ stderr;
void *xmalloc(size_t size) {
  void *ptr = malloc(size);
  if (ptr) {
    return ptr;
  } else {
    fprintf(stderr, "ERROR(xmalloc): Unable to allocate %lu bytes.\n",
            (unsigned long)size);
    exit(EXIT_FAILURE);
    return 0;
  }
}


x86 assembly (clang, -O0):
<xmalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     115e <xmalloc+0x2e>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret
mov    0x2e7b(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xe8e(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e5a(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<xmalloc>:
push   %rbx
mov    %rdi,%rbx
call   1040 <malloc@plt>
test   %rax,%rax
je     1140 <xmalloc+0x10>
pop    %rbx
ret
mov    0x2e99(%rip),%rax
mov    (%rax),%edi
lea    0xeb0(%rip),%rsi
mov    %rbx,%rdx
call   1030 <fprintf@plt>
mov    0x2e79(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [47 x i8] c"ERROR(xmalloc): Unable to allocate %lu bytes.\0A\00"
@EXIT_FAILURE = global i32 0
define i8* @xmalloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = load i8*, i8** %3
ret i8* %9
10: ; preds = %1
%11 = load i32, i32* @stderr
%12 = load i64, i64* %2
%13 = call i32 @fprintf(i32 %11, i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0), i64 %12)
%14 = load i32, i32* @EXIT_FAILURE
%15 = call i32 @exit(i32 %14)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [47 x i8] c"ERROR(xmalloc): Unable to allocate %lu bytes.\0A\00"
@EXIT_FAILURE = global i32 0
define noalias i8* @xmalloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %5, label %4
4: ; preds = %1
ret i8* %2
5: ; preds = %1
%6 = load i32, i32* @stderr
%7 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0), i64 %0)
%8 = load i32, i32* @EXIT_FAILURE
%9 = tail call i32 @exit(i32 %8)
unreachable
}
int wpa_key_mgmt_sae(int akm) { return !!(akm & ((1 << (10)) | (1 << (11)))); }


x86 assembly (clang, -O0):
<wpa_key_mgmt_sae>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xc00,%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<wpa_key_mgmt_sae>:
xor    %eax,%eax
test   $0xc00,%edi
setne  %al
ret

LLVM IR (-O0):
define i32 @wpa_key_mgmt_sae(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 3072
%5 = icmp ne i32 %4, 0
%6 = xor i1 %5, true
%7 = xor i1 %6, true
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @wpa_key_mgmt_sae(i32 %0) {
%2 = and i32 %0, 3072
%3 = icmp ne i32 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
unsigned int __rdpkru(void) {
  unsigned int eax, edx;
  unsigned int ecx = 0;
  unsigned int pkru;
  asm volatile(".byte 0x0f,0x01,0xee\n\t" : "=a"(eax), "=d"(edx) : "c"(ecx));
  pkru = eax;
  return pkru;
}


x86 assembly (clang, -O0):
<__rdpkru>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
rdpkru
mov    %eax,-0x4(%rbp)
mov    %edx,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__rdpkru>:
xor    %ecx,%ecx
rdpkru
ret

LLVM IR (-O0):
define i32 @__rdpkru() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %3
%5 = load i32, i32* %3
%6 = call { i32, i32 } asm sideeffect ".byte 0x0f,0x01,0xee\0A\09", "={ax},={dx},{cx},~{dirflag},~{fpsr},~{flags}"(i32 %5)
%7 = extractvalue { i32, i32 } %6, 0
%8 = extractvalue { i32, i32 } %6, 1
store i32 %7, i32* %1
store i32 %8, i32* %2
%9 = load i32, i32* %1
store i32 %9, i32* %4
%10 = load i32, i32* %4
ret i32 %10
}

LLVM IR (-O2):
define i32 @__rdpkru() {
%1 = tail call { i32, i32 } asm sideeffect ".byte 0x0f,0x01,0xee\0A\09", "={ax},={dx},{cx},~{dirflag},~{fpsr},~{flags}"(i32 0)
%2 = extractvalue { i32, i32 } %1, 0
ret i32 %2
}
int addfunc(int a, int b) { return a + b; }


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

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

LLVM IR (-O0):
define i32 @addfunc(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 = add nsw i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @addfunc(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
ret i32 %3
}
/* Variables and functions */
int fsync(int);
int _commit(int fd) { return fsync(fd); }


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

x86 assembly (clang, -O2):
<_commit>:
jmp    1030 <fsync@plt>

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

LLVM IR (-O2):
define i32 @_commit(i32 %0) {
%2 = tail call i32 @fsync(i32 %0)
ret i32 %2
}
int OpenCOM(int portnum, char *port_zstr) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @OpenCOM(i32 %0, i8* nocapture readnone %1) {
ret i32 0
}