xunge/DecIR huggingface dataset:
double f4_cb_send_pre_double_double_double_double_double(
    double (*cb)(double, double, double, double, double)) {
  double r = 66.0;
  return cb(8.25, 9.25, 10.25, 11.25, r) + 1.0;
}


x86 assembly (clang, -O0):
<f4_cb_send_pre_double_double_double_double_double>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movsd  0xf14(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsd  -0x10(%rbp),%xmm4
movsd  0xede(%rip),%xmm0
movsd  0xede(%rip),%xmm1
movsd  0xede(%rip),%xmm2
movsd  0xede(%rip),%xmm3
call   *%rax
movsd  0xeb4(%rip),%xmm1
addsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f4_cb_send_pre_double_double_double_double_double>:
push   %rax
movsd  0xef7(%rip),%xmm0
movsd  0xef7(%rip),%xmm1
movsd  0xef7(%rip),%xmm2
movsd  0xef7(%rip),%xmm3
movsd  0xef7(%rip),%xmm4
call   *%rdi
addsd  0xef5(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @f4_cb_send_pre_double_double_double_double_double(double (double, double, double, double, double)* %0) {
%2 = alloca double (double, double, double, double, double)*
%3 = alloca double
store double (double, double, double, double, double)* %0, double (double, double, double, double, double)** %2
store double 6.600000e+01, double* %3
%4 = load double (double, double, double, double, double)*, double (double, double, double, double, double)** %2
%5 = load double, double* %3
%6 = call double %4(double 8.250000e+00, double 9.250000e+00, double 1.025000e+01, double 1.125000e+01, double %5)
%7 = fadd double %6, 1.000000e+00
ret double %7
}

LLVM IR (-O2):
define double @f4_cb_send_pre_double_double_double_double_double(double (double, double, double, double, double)* nocapture %0) {
%2 = tail call double %0(double 8.250000e+00, double 9.250000e+00, double 1.025000e+01, double 1.125000e+01, double 6.600000e+01)
%3 = fadd double %2, 1.000000e+00
ret double %3
}
void copy(char source[], char target[]) {
  int i, j;
  i = j = 0;
  while ((target[i++] = source[j++]) != '\0')
    ;
}


x86 assembly (clang, -O0):
<copy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x18(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%ecx
mov    %ecx,%edx
add    $0x1,%edx
mov    %edx,-0x18(%rbp)
movslq %ecx,%rcx
mov    (%rax,%rcx,1),%al
mov    -0x10(%rbp),%rcx
mov    -0x14(%rbp),%edx
mov    %edx,%esi
add    $0x1,%esi
mov    %esi,-0x14(%rbp)
movslq %edx,%rdx
mov    %al,(%rcx,%rdx,1)
movsbl %al,%eax
cmp    $0x0,%eax
je     1155 <copy+0x55>
jmp    111a <copy+0x1a>
pop    %rbp
ret

x86 assembly (clang, -O2):
<copy>:
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movzbl (%rdi,%rax,1),%ecx
mov    %cl,(%rsi,%rax,1)
add    $0x1,%rax
test   %cl,%cl
jne    1110 <copy+0x10>
ret

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

LLVM IR (-O2):
define void @copy(i8* nocapture %0, i8* nocapture writeonly %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i64 [ %5, %3 ], [ 0, %2 ]
%5 = add nuw i64 %4, 1
%6 = getelementptr inbounds i8, i8* %0, i64 %4
%7 = load i8, i8* %6
%8 = getelementptr inbounds i8, i8* %1, i64 %4
store i8 %7, i8* %8
%9 = icmp eq i8 %7, 0
br i1 %9, label %10, label %3
10: ; preds = %3
ret void
}
int v9fs_get_acl(struct inode *inode, struct p9_fid *fid) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.inode = type opaque
%struct.p9_fid = type opaque
define i32 @v9fs_get_acl(%struct.inode* nocapture readnone %0, %struct.p9_fid* nocapture readnone %1) {
ret i32 0
}
int test_imm_98int32_mem(int *val) {
  return ((*val) & (0x98 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_98int32_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, 152
%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_98int32_mem(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = and i32 %2, 152
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ write(int, int /*<<< orphan*/ *, int);
void printerr(char *errmsg) {
  while (*errmsg)
    write(2, &*errmsg++, 1);
}


x86 assembly (clang, -O0):
<printerr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     114c <printerr+0x3c>
mov    -0x8(%rbp),%rsi
mov    %rsi,%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    $0x2,%edi
mov    $0x1,%edx
call   1030 <write@plt>
jmp    111c <printerr+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printerr>:
push   %r14
push   %rbx
push   %rax
cmpb   $0x0,(%rdi)
je     113f <printerr+0x2f>
mov    %rdi,%rbx
nopl   0x0(%rax)
lea    0x1(%rbx),%r14
mov    $0x2,%edi
mov    %rbx,%rsi
mov    $0x1,%edx
call   1030 <write@plt>
cmpb   $0x0,0x1(%rbx)
mov    %r14,%rbx
jne    1120 <printerr+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define void @printerr(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i8* [ %6, %4 ], [ %0, %1 ]
%6 = getelementptr inbounds i8, i8* %5, i64 1
%7 = bitcast i8* %5 to i32*
%8 = tail call i32 @write(i32 2, i32* %7, i32 1)
%9 = load i8, i8* %6
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
ret void
}
f(int i) {}


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

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

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

LLVM IR (-O2):
define i32 @f(i32 %0) {
ret i32 undef
}
void fc18(int n) {
  {
    typedef int(*b)[n];
    goto a;
  a : {
    typedef int(*c)[n];
    0;
  }
    {
      typedef int(*d)[n];
      0;
    };
    typedef int(*e)[n];
    0;
  };
  {
    typedef int(*f)[n];
    {
      typedef int(*g)[n];
      0;
    };
    {
      typedef int(*h)[n];
      0;
    };
    ;
    typedef int(*i)[n];
    0;
  };
  ;
  typedef int(*j)[n];
  0;
}


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

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

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

LLVM IR (-O2):
define void @fc18(i32 %0) {
ret void
}
unsigned char hexval(unsigned char v) {
  if (v >= 'a' && v <= 'f')
    v = v - 'a' + 10;
  else if (v >= '0' && v <= '9')
    v = v - '0';
  return v;
}


x86 assembly (clang, -O0):
<hexval>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
cmp    $0x61,%eax
jl     1136 <hexval+0x36>
movzbl -0x1(%rbp),%eax
cmp    $0x66,%eax
jg     1136 <hexval+0x36>
movzbl -0x1(%rbp),%eax
sub    $0x61,%eax
add    $0xa,%eax
mov    %al,-0x1(%rbp)
jmp    115f <hexval+0x5f>
movzbl -0x1(%rbp),%eax
cmp    $0x30,%eax
jl     115a <hexval+0x5a>
movzbl -0x1(%rbp),%eax
cmp    $0x39,%eax
jg     115a <hexval+0x5a>
movzbl -0x1(%rbp),%eax
sub    $0x30,%eax
mov    %al,-0x1(%rbp)
jmp    115f <hexval+0x5f>
movzbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hexval>:
lea    -0x61(%rdi),%eax
lea    -0x57(%rdi),%ecx
lea    -0x30(%rdi),%edx
cmp    $0xa,%dl
movzbl %dl,%edx
cmovae %edi,%edx
cmp    $0x6,%al
movzbl %cl,%eax
cmovae %edx,%eax
ret

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

LLVM IR (-O2):
define zeroext i8 @hexval(i8 zeroext %0) {
%2 = add i8 %0, -97
%3 = icmp ult i8 %2, 6
%4 = add nsw i8 %0, -87
%5 = add i8 %0, -48
%6 = icmp ult i8 %5, 10
%7 = select i1 %6, i8 %5, i8 %0
%8 = select i1 %3, i8 %4, i8 %7
ret i8 %8
}
/* Variables and functions */
int M_PI;
float cos(float);
float inSine(float t, float b, float c, float d) {
  return -c * cos(t / d * (M_PI / 2)) + c + b;
}


x86 assembly (clang, -O0):
<inSine>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  %xmm3,-0x10(%rbp)
movss  -0xc(%rbp),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x4(%rbp),%xmm0
divss  -0x10(%rbp),%xmm0
mov    0x2e94(%rip),%rax
mov    (%rax),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cvtsi2ss %eax,%xmm1
mulss  %xmm1,%xmm0
call   1030 <cos@plt>
movaps %xmm0,%xmm2
movss  -0x14(%rbp),%xmm0
movss  -0xc(%rbp),%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
addss  -0x8(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<inSine>:
push   %rax
movss  %xmm2,(%rsp)
movss  %xmm1,0x4(%rsp)
divss  %xmm3,%xmm0
mov    0x2ec1(%rip),%rax
mov    (%rax),%eax
mov    %eax,%ecx
shr    $0x1f,%ecx
add    %eax,%ecx
sar    %ecx
xorps  %xmm1,%xmm1
cvtsi2ss %ecx,%xmm1
mulss  %xmm1,%xmm0
call   1030 <cos@plt>
movss  (%rsp),%xmm1
mulss  %xmm1,%xmm0
subss  %xmm0,%xmm1
addss  0x4(%rsp),%xmm1
movaps %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
@M_PI = global i32 0
define float @inSine(float %0, float %1, float %2, float %3) {
%5 = alloca float
%6 = alloca float
%7 = alloca float
%8 = alloca float
store float %0, float* %5
store float %1, float* %6
store float %2, float* %7
store float %3, float* %8
%9 = load float, float* %7
%10 = fneg float %9
%11 = load float, float* %5
%12 = load float, float* %8
%13 = fdiv float %11, %12
%14 = load i32, i32* @M_PI
%15 = sdiv i32 %14, 2
%16 = sitofp i32 %15 to float
%17 = fmul float %13, %16
%18 = call float @cos(float %17)
%19 = load float, float* %7
%20 = call float @llvm.fmuladd.f32(float %10, float %18, float %19)
%21 = load float, float* %6
%22 = fadd float %20, %21
ret float %22
}

LLVM IR (-O2):
@M_PI = global i32 0
define float @inSine(float %0, float %1, float %2, float %3) {
%5 = fneg float %2
%6 = fdiv float %0, %3
%7 = load i32, i32* @M_PI
%8 = sdiv i32 %7, 2
%9 = sitofp i32 %8 to float
%10 = fmul float %6, %9
%11 = tail call float @cos(float %10)
%12 = tail call float @llvm.fmuladd.f32(float %5, float %11, float %2)
%13 = fadd float %12, %1
ret float %13
}
/* Variables and functions */
int strncasecmp(char const *, char const *, int);
int strcasecmp(const char *s1, const char *s2) {
  return strncasecmp(s1, s2, -1);
}


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

x86 assembly (clang, -O2):
<strcasecmp>:
mov    $0xffffffff,%edx
jmp    1030 <strncasecmp@plt>

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

LLVM IR (-O2):
define i32 @strcasecmp(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32 @strncasecmp(i8* %0, i8* %1, i32 -1)
ret i32 %3
}
/* Type definitions */
struct timeval {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
void test_gettimeofday() {
  struct timeval time = {};
  gettimeofday(&time, NULL);
}


x86 assembly (clang, -O0):
<test_gettimeofday>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x8(%rbp),%rdi
xor    %esi,%esi
mov    $0x4,%edx
call   1040 <memset@plt>
lea    -0x8(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_gettimeofday>:
push   %rax
movl   $0x0,(%rsp)
mov    %rsp,%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
pop    %rax
ret

LLVM IR (-O0):
%struct.timeval = type { i32 }
define void @test_gettimeofday() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
ret void
}

LLVM IR (-O2):
%struct.timeval = type { i32 }
define void @test_gettimeofday() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
store i32 0, i32* %3
%4 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
ret void
}
/* Variables and functions */
int f305(int *);
int f306(int *p) { return f305(p); }


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

x86 assembly (clang, -O2):
<f306>:
jmp    1030 <f305@plt>

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

LLVM IR (-O2):
define i32 @f306(i32* %0) {
%2 = tail call i32 @f305(i32* %0)
ret i32 %2
}
void putstring(int pos, char *text, int c, char color) {
  asm volatile("movl $0x9, %%eax; int $0x80"
               :
               : "b"(pos), "c"(text), "d"(c), "S"(color));
}


x86 assembly (clang, -O0):
<putstring>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
mov    %cl,%al
mov    %edi,-0xc(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
mov    %al,-0x1d(%rbp)
mov    -0xc(%rbp),%ebx
mov    -0x18(%rbp),%rcx
mov    -0x1c(%rbp),%edx
mov    -0x1d(%rbp),%sil
mov    $0x9,%eax
int    $0x80
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<putstring>:
push   %rbx
mov    %ecx,%eax
mov    %rsi,%rcx
mov    %edi,%ebx
mov    %eax,%esi
mov    $0x9,%eax
int    $0x80
pop    %rbx
ret

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

LLVM IR (-O2):
define void @putstring(i32 %0, i8* %1, i32 %2, i8 signext %3) {
tail call void asm sideeffect "movl $$0x9, %eax; int $$0x80", "{bx},{cx},{dx},{si},~{dirflag},~{fpsr},~{flags}"(i32 %0, i8* %1, i32 %2, i8 %3)
ret void
}
char *__get_cmdline() { return (""); }


x86 assembly (clang, -O0):
<__get_cmdline>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__get_cmdline>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define i8* @__get_cmdline() {
ret i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
define i8* @__get_cmdline() {
ret i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ gmx_wham(int, char **);
int main(int argc, char *argv[]) {
  gmx_wham(argc, argv);
  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)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <gmx_wham@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
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 = load i32, i32* %4
%7 = load i8**, i8*** %5
%8 = call i32 @gmx_wham(i32 %6, i8** %7)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @gmx_wham(i32 %0, i8** %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ _exit(int);
int /*<<< orphan*/ ft_putendl(char const *);
void die(const char *str, int status) {
  ft_putendl(str);
  _exit(status);
}


x86 assembly (clang, -O0):
<die>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <ft_putendl@plt>
mov    -0xc(%rbp),%edi
call   1030 <_exit@plt>

x86 assembly (clang, -O2):
<die>:
push   %rbx
mov    %esi,%ebx
call   1040 <ft_putendl@plt>
mov    %ebx,%edi
call   1030 <_exit@plt>

LLVM IR (-O0):
define void @die(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = call i32 @ft_putendl(i8* %5)
%7 = load i32, i32* %4
%8 = call i32 @_exit(i32 %7)
unreachable
}

LLVM IR (-O2):
define void @die(i8* %0, i32 %1) {
%3 = tail call i32 @ft_putendl(i8* %0)
%4 = tail call i32 @_exit(i32 %1)
unreachable
}
/* Type definitions */
typedef long time_t;

/* Variables and functions */
int /*<<< orphan*/ time(long *);
long current_time() {
  time_t tp;
  time(&tp);
  return tp;
}


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

x86 assembly (clang, -O2):
<current_time>:
push   %rax
mov    %rsp,%rdi
call   1030 <time@plt>
mov    (%rsp),%rax
pop    %rcx
ret

LLVM IR (-O0):
define i64 @current_time() {
%1 = alloca i64
%2 = call i32 @time(i64* %1)
%3 = load i64, i64* %1
ret i64 %3
}

LLVM IR (-O2):
define i64 @current_time() {
%1 = alloca i64
%2 = bitcast i64* %1 to i8*
%3 = call i32 @time(i64* %1)
%4 = load i64, i64* %1
ret i64 %4
}
/* Variables and functions */
int _ada_use_c2phc(int, int *, int *, double *);
int copy_target_system_to_container(void) {
  int *a, *b, fail;
  double *c;
  fail = _ada_use_c2phc(1, a, b, c);
  return fail;
}


x86 assembly (clang, -O0):
<copy_target_system_to_container>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x1,%edi
call   1030 <_ada_use_c2phc@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<copy_target_system_to_container>:
mov    $0x1,%edi
jmp    1030 <_ada_use_c2phc@plt>

LLVM IR (-O0):
define i32 @copy_target_system_to_container() {
%1 = alloca i32*
%2 = alloca i32*
%3 = alloca i32
%4 = alloca double*
%5 = load i32*, i32** %1
%6 = load i32*, i32** %2
%7 = load double*, double** %4
%8 = call i32 @_ada_use_c2phc(i32 1, i32* %5, i32* %6, double* %7)
store i32 %8, i32* %3
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
define i32 @copy_target_system_to_container() {
%1 = tail call i32 @_ada_use_c2phc(i32 1, i32* undef, i32* undef, double* undef)
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int digitalRead(int pin) {
  printf("digitalRead - warning\n");
  return 1;
}


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

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

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

LLVM IR (-O2):
@str = [22 x i8] c"digitalRead - warning\00"
define i32 @digitalRead(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str, i64 0, i64 0))
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ free(double *);
void destroyBelief(double *b) {
  if (b != NULL)
    do {
      if (b) {
        free(b);
        b = 0;
      }
    } while (0);
}


x86 assembly (clang, -O0):
<destroyBelief>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1152 <destroyBelief+0x42>
jmp    112c <destroyBelief+0x1c>
cmpq   $0x0,-0x8(%rbp)
je     1148 <destroyBelief+0x38>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
movq   $0x0,-0x8(%rbp)
jmp    114d <destroyBelief+0x3d>
jmp    1152 <destroyBelief+0x42>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<destroyBelief>:
test   %rdi,%rdi
je     111a <destroyBelief+0xa>
jmp    1030 <free@plt>
ret

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

LLVM IR (-O2):
define void @destroyBelief(double* %0) {
%2 = icmp eq double* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @free(double* %0)
br label %5
5: ; preds = %3, %1
ret void
}
int func(int n) {
  int vla[n], i;
  for (i = 0; i < n; i++)
    vla[i] = i;
  return n;
}


x86 assembly (clang, -O0):
<func>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %rsp,%rcx
mov    %rcx,-0x10(%rbp)
lea    0xf(,%rax,4),%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x28(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1161 <func+0x61>
mov    -0x28(%rbp),%rax
mov    -0x1c(%rbp),%edx
movslq -0x1c(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1139 <func+0x39>
mov    -0x4(%rbp),%eax
mov    -0x10(%rbp),%rcx
mov    %rcx,%rsp
mov    %rbp,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @func(i32 returned %0) {
ret i32 %0
}
int mtherr(str, val)
char *str;
int val;
{
  printf("Math error %s, value %d\n", str, val);
  return val;
}


x86 assembly (clang, -O0):
<mtherr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
lea    0xed3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mtherr>:
push   %rbx
mov    %esi,%ebx
mov    %rdi,%rsi
lea    0xee3(%rip),%rdi
mov    %ebx,%edx
xor    %eax,%eax
call   1030 <printf@plt>
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [25 x i8] c"Math error %s, value %d\0A\00"
define i32 @mtherr(i8* %0, i32 returned %1) {
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %1)
ret i32 %1
}
void __attribute__((fastcall)) test1(void) {}


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

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

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

LLVM IR (-O2):
define void @test1() {
ret void
}
/* Variables and functions */
double exp(double);
double pdfStandard(double x) { return (exp(-0.5 * x * x) / 2.506628274631); }


x86 assembly (clang, -O0):
<pdfStandard>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  0xee3(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
mulsd  -0x8(%rbp),%xmm0
call   1030 <exp@plt>
movsd  0xec4(%rip),%xmm1
divsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pdfStandard>:
push   %rax
movsd  0xee7(%rip),%xmm1
mulsd  %xmm0,%xmm1
mulsd  %xmm1,%xmm0
call   1030 <exp@plt>
divsd  0xeda(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @pdfStandard(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fmul double -5.000000e-01, %3
%5 = load double, double* %2
%6 = fmul double %4, %5
%7 = call double @exp(double %6)
%8 = fdiv double %7, 0x40040D931FF62704
ret double %8
}

LLVM IR (-O2):
define double @pdfStandard(double %0) {
%2 = fmul double %0, -5.000000e-01
%3 = fmul double %2, %0
%4 = tail call double @exp(double %3)
%5 = fdiv double %4, 0x40040D931FF62704
ret double %5
}
/* Variables and functions */
int errno;
int syscall(int, int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/,
            int /*<<< orphan*/, int /*<<< orphan*/);
int fork() {
  int ret = syscall(2, 0, 0, 0, 0, 0);
  if (ret < 0) {
    errno = -ret;
    return -1;
  }
  return ret;
}


x86 assembly (clang, -O0):
<fork>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x2,%edi
xor    %r9d,%r9d
mov    %r9d,%esi
mov    %r9d,%edx
mov    %r9d,%ecx
mov    %r9d,%r8d
call   1030 <syscall@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    1158 <fork+0x48>
xor    %ecx,%ecx
sub    -0x8(%rbp),%ecx
mov    0x2e96(%rip),%rax
mov    %ecx,(%rax)
movl   $0xffffffff,-0x4(%rbp)
jmp    115e <fork+0x4e>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fork>:
push   %rax
mov    $0x2,%edi
xor    %esi,%esi
xor    %edx,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
xor    %r9d,%r9d
call   1030 <syscall@plt>
test   %eax,%eax
js     112d <fork+0x1d>
pop    %rcx
ret
neg    %eax
mov    0x2eaa(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@errno = global i32 0
define i32 @fork() {
%1 = alloca i32
%2 = alloca i32
%3 = call i32 @syscall(i32 2, i32 0, i32 0, i32 0, i32 0, i32 0)
store i32 %3, i32* %2
%4 = load i32, i32* %2
%5 = icmp slt i32 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %0
%7 = load i32, i32* %2
%8 = sub nsw i32 0, %7
store i32 %8, i32* @errno
store i32 -1, i32* %1
br label %11
9: ; preds = %0
%10 = load i32, i32* %2
store i32 %10, i32* %1
br label %11
11: ; preds = %9, %6
%12 = load i32, i32* %1
ret i32 %12
}

LLVM IR (-O2):
@errno = global i32 0
define i32 @fork() {
%1 = tail call i32 @syscall(i32 2, i32 0, i32 0, i32 0, i32 0, i32 0)
%2 = icmp slt i32 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = sub nsw i32 0, %1
store i32 %4, i32* @errno
br label %5
5: ; preds = %0, %3
%6 = phi i32 [ -1, %3 ], [ %1, %0 ]
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void Zfree(void *p) {
  if (p)
    free(p);
}


x86 assembly (clang, -O0):
<Zfree>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1130 <Zfree+0x20>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Zfree>:
test   %rdi,%rdi
je     111a <Zfree+0xa>
jmp    1030 <free@plt>
ret

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

LLVM IR (-O2):
define void @Zfree(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @free(i8* %0)
br label %5
5: ; preds = %3, %1
ret void
}
void testfunc_01(volatile const char *ap, volatile char *bp, char val) {
  bp[0] = ap[15];
  bp[2] = ap[5];
  bp[9] = ap[7];
  bp[0] = ap[15];
  bp[4] = val;
  bp[14] = val;
}


x86 assembly (clang, -O0):
<testfunc_01>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %al,-0x11(%rbp)
mov    -0x8(%rbp),%rax
mov    0xf(%rax),%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
mov    0x5(%rax),%cl
mov    -0x10(%rbp),%rax
mov    %cl,0x2(%rax)
mov    -0x8(%rbp),%rax
mov    0x7(%rax),%cl
mov    -0x10(%rbp),%rax
mov    %cl,0x9(%rax)
mov    -0x8(%rbp),%rax
mov    0xf(%rax),%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
mov    -0x11(%rbp),%cl
mov    -0x10(%rbp),%rax
mov    %cl,0x4(%rax)
mov    -0x11(%rbp),%cl
mov    -0x10(%rbp),%rax
mov    %cl,0xe(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<testfunc_01>:
mov    0xf(%rdi),%al
mov    %al,(%rsi)
mov    0x5(%rdi),%al
mov    %al,0x2(%rsi)
mov    0x7(%rdi),%al
mov    %al,0x9(%rsi)
mov    0xf(%rdi),%al
mov    %al,(%rsi)
mov    %dl,0x4(%rsi)
mov    %dl,0xe(%rsi)
ret

LLVM IR (-O0):
define void @testfunc_01(i8* %0, i8* %1, i8 signext %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 = getelementptr inbounds i8, i8* %7, i64 15
%9 = load volatile i8, i8* %8
%10 = load i8*, i8** %5
%11 = getelementptr inbounds i8, i8* %10, i64 0
store volatile i8 %9, i8* %11
%12 = load i8*, i8** %4
%13 = getelementptr inbounds i8, i8* %12, i64 5
%14 = load volatile i8, i8* %13
%15 = load i8*, i8** %5
%16 = getelementptr inbounds i8, i8* %15, i64 2
store volatile i8 %14, i8* %16
%17 = load i8*, i8** %4
%18 = getelementptr inbounds i8, i8* %17, i64 7
%19 = load volatile i8, i8* %18
%20 = load i8*, i8** %5
%21 = getelementptr inbounds i8, i8* %20, i64 9
store volatile i8 %19, i8* %21
%22 = load i8*, i8** %4
%23 = getelementptr inbounds i8, i8* %22, i64 15
%24 = load volatile i8, i8* %23
%25 = load i8*, i8** %5
%26 = getelementptr inbounds i8, i8* %25, i64 0
store volatile i8 %24, i8* %26
%27 = load i8, i8* %6
%28 = load i8*, i8** %5
%29 = getelementptr inbounds i8, i8* %28, i64 4
store volatile i8 %27, i8* %29
%30 = load i8, i8* %6
%31 = load i8*, i8** %5
%32 = getelementptr inbounds i8, i8* %31, i64 14
store volatile i8 %30, i8* %32
ret void
}

LLVM IR (-O2):
define void @testfunc_01(i8* %0, i8* %1, i8 signext %2) {
%4 = getelementptr inbounds i8, i8* %0, i64 15
%5 = load volatile i8, i8* %4
store volatile i8 %5, i8* %1
%6 = getelementptr inbounds i8, i8* %0, i64 5
%7 = load volatile i8, i8* %6
%8 = getelementptr inbounds i8, i8* %1, i64 2
store volatile i8 %7, i8* %8
%9 = getelementptr inbounds i8, i8* %0, i64 7
%10 = load volatile i8, i8* %9
%11 = getelementptr inbounds i8, i8* %1, i64 9
store volatile i8 %10, i8* %11
%12 = load volatile i8, i8* %4
store volatile i8 %12, i8* %1
%13 = getelementptr inbounds i8, i8* %1, i64 4
store volatile i8 %2, i8* %13
%14 = getelementptr inbounds i8, i8* %1, i64 14
store volatile i8 %2, i8* %14
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Sct_Init(int);
void pwmConfig(void) { Sct_Init(1000); }


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

x86 assembly (clang, -O2):
<pwmConfig>:
mov    $0x3e8,%edi
jmp    1030 <Sct_Init@plt>

LLVM IR (-O0):
define void @pwmConfig() {
%1 = call i32 @Sct_Init(i32 1000)
ret void
}

LLVM IR (-O2):
define void @pwmConfig() {
%1 = tail call i32 @Sct_Init(i32 1000)
ret void
}
int b_f() { return 10; }


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

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

LLVM IR (-O0):
define i32 @b_f() {
ret i32 10
}

LLVM IR (-O2):
define i32 @b_f() {
ret i32 10
}
const char *hello_get_msg() { return "Hello world\n"; }


x86 assembly (clang, -O0):
<hello_get_msg>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hello_get_msg>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [13 x i8] c"Hello world\0A\00"
define i8* @hello_get_msg() {
ret i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [13 x i8] c"Hello world\0A\00"
define i8* @hello_get_msg() {
ret i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ determine_endianness();
int /*<<< orphan*/ init_compile_options();
int /*<<< orphan*/ init_units();
int /*<<< orphan*/ init_variables();
int /*<<< orphan*/ random_seed_i4(int /*<<< orphan*/ *, int /*<<< orphan*/ *,
                                  int /*<<< orphan*/ *);
int /*<<< orphan*/ set_fpu();
void __attribute__((constructor)) init(void) {
  determine_endianness();
  init_variables();
  init_units();
  set_fpu();
  init_compile_options();
  random_seed_i4(NULL, NULL, NULL);
}


x86 assembly (clang, -O0):
<init>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1080 <determine_endianness@plt>
mov    $0x0,%al
call   1030 <init_variables@plt>
mov    $0x0,%al
call   1050 <init_units@plt>
mov    $0x0,%al
call   1060 <set_fpu@plt>
mov    $0x0,%al
call   1040 <init_compile_options@plt>
xor    %eax,%eax
mov    %eax,%edx
mov    %rdx,%rdi
mov    %rdx,%rsi
call   1070 <random_seed_i4@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<init>:
push   %rax
xor    %eax,%eax
call   1080 <determine_endianness@plt>
xor    %eax,%eax
call   1030 <init_variables@plt>
xor    %eax,%eax
call   1050 <init_units@plt>
xor    %eax,%eax
call   1060 <set_fpu@plt>
xor    %eax,%eax
call   1040 <init_compile_options@plt>
xor    %edi,%edi
xor    %esi,%esi
xor    %edx,%edx
pop    %rax
jmp    1070 <random_seed_i4@plt>

LLVM IR (-O0):
@llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @init, i8* null }]
define void @init() {
%1 = call i32 (...) @determine_endianness()
%2 = call i32 (...) @init_variables()
%3 = call i32 (...) @init_units()
%4 = call i32 (...) @set_fpu()
%5 = call i32 (...) @init_compile_options()
%6 = call i32 @random_seed_i4(i32* null, i32* null, i32* null)
ret void
}

LLVM IR (-O2):
@llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @init, i8* null }]
define void @init() {
%1 = tail call i32 (...) @determine_endianness()
%2 = tail call i32 (...) @init_variables()
%3 = tail call i32 (...) @init_units()
%4 = tail call i32 (...) @set_fpu()
%5 = tail call i32 (...) @init_compile_options()
%6 = tail call i32 @random_seed_i4(i32* null, i32* null, i32* null)
ret void
}
/* Variables and functions */
int /*<<< orphan*/
UpnpResponse_RemoteIOClient_RemoteIO_GetPeerConnection(void *, char *);
int /*<<< orphan*/ printf(char *);
void UpnpRemoteIOClient_RemoteIO_GetPeerConnection(void *upnptoken) {
  printf("Invoke: UpnpRemoteIOClient_RemoteIO_GetPeerConnection();\r\n");
  UpnpResponse_RemoteIOClient_RemoteIO_GetPeerConnection(upnptoken,
                                                         "Sample String");
}


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

x86 assembly (clang, -O2):
<UpnpRemoteIOClient_RemoteIO_GetPeerConnection>:
push   %rbx
mov    %rdi,%rbx
lea    0xee3(%rip),%rdi
call   1030 <puts@plt>
lea    0xec9(%rip),%rsi
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <UpnpResponse_RemoteIOClient_RemoteIO_GetPeerConnection@plt>

LLVM IR (-O0):
@.str = [59 x i8] c"Invoke: UpnpRemoteIOClient_RemoteIO_GetPeerConnection();\0D\0A\00"
@.str.1 = [14 x i8] c"Sample String\00"
define void @UpnpRemoteIOClient_RemoteIO_GetPeerConnection(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @printf(i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i32 @UpnpResponse_RemoteIOClient_RemoteIO_GetPeerConnection(i8* %4, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str.1 = [14 x i8] c"Sample String\00"
@str = [58 x i8] c"Invoke: UpnpRemoteIOClient_RemoteIO_GetPeerConnection();\0D\00"
define void @UpnpRemoteIOClient_RemoteIO_GetPeerConnection(i8* %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([58 x i8], [58 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @UpnpResponse_RemoteIOClient_RemoteIO_GetPeerConnection(i8* %0, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
void sht_reverse(short *array, size_t n) {
  short *end = array + n;
  short t;
  while (--end > array) {
    t = *end;
    *end = *array;
    *array++ = t;
  }
}


x86 assembly (clang, -O0):
<sht_reverse>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
shl    $0x1,%rcx
add    %rcx,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0xfffffffffffffffe,%rax
mov    %rax,-0x18(%rbp)
cmp    -0x8(%rbp),%rax
jbe    1169 <sht_reverse+0x69>
mov    -0x18(%rbp),%rax
mov    (%rax),%ax
mov    %ax,-0x1a(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%cx
mov    -0x18(%rbp),%rax
mov    %cx,(%rax)
mov    -0x1a(%rbp),%cx
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x2,%rdx
mov    %rdx,-0x8(%rbp)
mov    %cx,(%rax)
jmp    111f <sht_reverse+0x1f>
pop    %rbp
ret

x86 assembly (clang, -O2):
<sht_reverse>:
lea    (%rdi,%rsi,2),%rax
add    $0xfffffffffffffffe,%rax
cmp    %rdi,%rax
jbe    113e <sht_reverse+0x3e>
add    $0x2,%rdi
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movzwl (%rax),%ecx
movzwl -0x2(%rdi),%edx
mov    %dx,(%rax)
mov    %cx,-0x2(%rdi)
add    $0xfffffffffffffffe,%rax
lea    0x2(%rdi),%rcx
cmp    %rdi,%rax
mov    %rcx,%rdi
ja     1120 <sht_reverse+0x20>
ret

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

LLVM IR (-O2):
define void @sht_reverse(i16* %0, i64 %1) {
%3 = getelementptr inbounds i16, i16* %0, i64 %1
%4 = getelementptr inbounds i16, i16* %3, i64 -1
%5 = icmp ugt i16* %4, %0
br i1 %5, label %6, label %14
6: ; preds = %2, %6
%7 = phi i16* [ %12, %6 ], [ %4, %2 ]
%8 = phi i16* [ %11, %6 ], [ %0, %2 ]
%9 = load i16, i16* %7
%10 = load i16, i16* %8
store i16 %10, i16* %7
%11 = getelementptr inbounds i16, i16* %8, i64 1
store i16 %9, i16* %8
%12 = getelementptr inbounds i16, i16* %7, i64 -1
%13 = icmp ugt i16* %12, %11
br i1 %13, label %6, label %14
14: ; preds = %6, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
void xt_net_server_socket_destroy(int serversocket) {
  if (serversocket != -1) {
    close(serversocket);
  }
}


x86 assembly (clang, -O0):
<xt_net_server_socket_destroy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0xffffffff,-0x4(%rbp)
je     112d <xt_net_server_socket_destroy+0x1d>
mov    -0x4(%rbp),%edi
call   1030 <close@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xt_net_server_socket_destroy>:
cmp    $0xffffffff,%edi
je     111a <xt_net_server_socket_destroy+0xa>
jmp    1030 <close@plt>
ret

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

LLVM IR (-O2):
define void @xt_net_server_socket_destroy(i32 %0) {
%2 = icmp eq i32 %0, -1
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @close(i32 %0)
br label %5
5: ; preds = %3, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(void) {
  printf("Hello Universe!");
  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 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [16 x i8] c"Hello Universe!\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
typedef scalar_t__ pid_t;

/* Variables and functions */
int /*<<< orphan*/ execvp(char *, char **);
scalar_t__ fork();
int main(int argc, char *argv[]) {
  (void)argc;
  pid_t ret;
  if ((ret = fork()))
    return (ret < 0);
  execvp(argv[1], &argv[1]);
  return 1;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1040 <fork@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
je     1160 <main+0x40>
cmpq   $0x0,-0x18(%rbp)
setl   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
jmp    117c <main+0x5c>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
mov    -0x10(%rbp),%rsi
add    $0x8,%rsi
call   1030 <execvp@plt>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    %rsi,%rbx
xor    %eax,%eax
call   1040 <fork@plt>
test   %rax,%rax
je     1136 <main+0x16>
shr    $0x3f,%rax
pop    %rbx
ret
mov    0x8(%rbx),%rdi
add    $0x8,%rbx
mov    %rbx,%rsi
call   1030 <execvp@plt>
mov    $0x1,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i64 (...) @fork()
%4 = icmp eq i64 %3, 0
br i1 %4, label %8, label %5
5: ; preds = %2
%6 = lshr i64 %3, 63
%7 = trunc i64 %6 to i32
br label %12
8: ; preds = %2
%9 = getelementptr inbounds i8*, i8** %1, i64 1
%10 = load i8*, i8** %9
%11 = tail call i32 @execvp(i8* %10, i8** %9)
br label %12
12: ; preds = %8, %5
%13 = phi i32 [ %7, %5 ], [ 1, %8 ]
ret i32 %13
}