xunge/DecIR huggingface dataset:
/* Variables and functions */
char *malloc(int);
char *refstr_alloc(size_t len) {
  char *r = malloc(sizeof(unsigned int) + len + 1);
  if (!r)
    return NULL;
  *(unsigned int *)r = 1;
  r += sizeof(unsigned int);
  r[len] = '\0';
  return r;
}


x86 assembly (clang, -O0):
<refstr_alloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x4,%rax
add    $0x1,%rax
mov    %eax,%edi
call   1030 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    114b <refstr_alloc+0x3b>
movq   $0x0,-0x8(%rbp)
jmp    1175 <refstr_alloc+0x65>
mov    -0x18(%rbp),%rax
movl   $0x1,(%rax)
mov    -0x18(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    -0x10(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<refstr_alloc>:
push   %rbx
mov    %rdi,%rbx
add    $0x5,%edi
call   1030 <malloc@plt>
test   %rax,%rax
je     1135 <refstr_alloc+0x25>
mov    %rax,%rcx
movl   $0x1,(%rax)
add    $0x4,%rax
movb   $0x0,0x4(%rcx,%rbx,1)
pop    %rbx
ret
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define noalias i8* @refstr_alloc(i64 %0) {
%2 = trunc i64 %0 to i32
%3 = add i32 %2, 5
%4 = tail call i8* @malloc(i32 %3)
%5 = icmp eq i8* %4, null
br i1 %5, label %10, label %6
6: ; preds = %1
%7 = bitcast i8* %4 to i32*
store i32 1, i32* %7
%8 = getelementptr inbounds i8, i8* %4, i64 4
%9 = getelementptr inbounds i8, i8* %8, i64 %0
store i8 0, i8* %9
br label %10
10: ; preds = %1, %6
%11 = phi i8* [ %8, %6 ], [ null, %1 ]
ret i8* %11
}
int test_imm_5Fuint8_mem(unsigned char *val) {
  return ((*val) & (0x5F << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_5Fuint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, 95
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int rand();
int main() {
  printf("%d \n", 100000000);
  for (long int i = 0; i < 100000000; i++) {
    printf("%d \n", rand() % 100000000);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
mov    $0x5f5e100,%esi
call   1030 <printf@plt>
movq   $0x0,-0x10(%rbp)
cmpq   $0x5f5e100,-0x10(%rbp)
05
jge    1184 <main+0x64>
mov    $0x0,%al
call   1040 <rand@plt>
mov    $0x5f5e100,%ecx
cltd
idiv   %ecx
mov    %edx,%esi
lea    0xe92(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1148 <main+0x28>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
lea    0xed5(%rip),%r14
mov    %r14,%rdi
mov    $0x5f5e100,%esi
call   1030 <printf@plt>
mov    $0x5f5e100,%ebx
nopl   (%rax)
xor    %eax,%eax
call   1040 <rand@plt>
movslq %eax,%rsi
imul   $0x55e63b89,%rsi,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x39,%rax
add    %ecx,%eax
imul   $0x5f5e100,%eax,%eax
sub    %eax,%esi
mov    %r14,%rdi
call   1030 <printf@plt>
add    $0xffffffffffffffff,%rbx
jne    1140 <main+0x20>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [5 x i8] c"%d \0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 100000000)
br label %3
2: ; preds = %3
ret i32 0
3: ; preds = %0, %3
%4 = phi i64 [ 0, %0 ], [ %8, %3 ]
%5 = tail call i32 (...) @rand()
%6 = srem i32 %5, 100000000
%7 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %6)
%8 = add nuw nsw i64 %4, 1
%9 = icmp eq i64 %8, 100000000
br i1 %9, label %2, label %3
}
RCU_DEF_INIT_FUNC(user_m2_destroy, param) {}


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

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

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

LLVM IR (-O2):
define i32 @RCU_DEF_INIT_FUNC(i32 %0, i32 %1) {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ iterate_matrix();
int /*<<< orphan*/ print_matrix();
int main(int argc, const char *argv[]) {
  iterate_matrix();
  print_matrix();
  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    $0x0,%al
call   1030 <iterate_matrix@plt>
mov    $0x0,%al
call   1040 <print_matrix@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <iterate_matrix@plt>
xor    %eax,%eax
call   1040 <print_matrix@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 = call i32 (...) @iterate_matrix()
%7 = call i32 (...) @print_matrix()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @iterate_matrix()
%4 = tail call i32 (...) @print_matrix()
ret i32 0
}
/* Variables and functions */
float floorf(float);
float ceilf(float value) {
  float floorval = floorf(value);
  if (value > floorval)
    return floorval + 1.0;
  return floorval;
}


x86 assembly (clang, -O0):
<ceilf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
call   1030 <floorf@plt>
movss  %xmm0,-0xc(%rbp)
movss  -0x8(%rbp),%xmm0
ucomiss -0xc(%rbp),%xmm0
jbe    115e <ceilf+0x4e>
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xeb4(%rip),%xmm1
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    1168 <ceilf+0x58>
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ceilf>:
push   %rax
movss  %xmm0,0x4(%rsp)
call   1030 <floorf@plt>
movss  0xedc(%rip),%xmm2
addss  %xmm0,%xmm2
movaps %xmm0,%xmm1
cmpltss 0x4(%rsp),%xmm1
andps  %xmm1,%xmm2
andnps %xmm0,%xmm1
orps   %xmm2,%xmm1
movaps %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @ceilf(float %0) {
%2 = alloca float
%3 = alloca float
%4 = alloca float
store float %0, float* %3
%5 = load float, float* %3
%6 = call float @llvm.floor.f32(float %5)
store float %6, float* %4
%7 = load float, float* %3
%8 = load float, float* %4
%9 = fcmp ogt float %7, %8
br i1 %9, label %10, label %15
10: ; preds = %1
%11 = load float, float* %4
%12 = fpext float %11 to double
%13 = fadd double %12, 1.000000e+00
%14 = fptrunc double %13 to float
store float %14, float* %2
br label %17
15: ; preds = %1
%16 = load float, float* %4
store float %16, float* %2
br label %17
17: ; preds = %15, %10
%18 = load float, float* %2
ret float %18
}

LLVM IR (-O2):
define float @ceilf(float %0) {
%2 = tail call float @llvm.floor.f32(float %0)
%3 = fcmp olt float %2, %0
%4 = fadd float %2, 1.000000e+00
%5 = select i1 %3, float %4, float %2
ret float %5
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
__attribute__((__weak__, __always___)) void softboundmpx_free(void *ptr) {
  free(ptr);
}


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

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

LLVM IR (-O0):
define weak void @softboundmpx_free(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @free(i8* %3)
ret void
}

LLVM IR (-O2):
define weak void @softboundmpx_free(i8* %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
const char *get_shortmsg_from_status_code(int status_code) {
  if (status_code == 200) {
    return "OK";
  }
  if (status_code == 304) {
    return "NOT MODIFIED";
  }
  if (status_code == 404) {
    return "NOT FOUND";
  }
  return "UNKNOWN";
}


x86 assembly (clang, -O0):
<get_shortmsg_from_status_code>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
cmpl   $0xc8,-0xc(%rbp)
jne    1124 <get_shortmsg_from_status_code+0x24>
lea    0xee5(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1169 <get_shortmsg_from_status_code+0x69>
cmpl   $0x130,-0xc(%rbp)
jne    1141 <get_shortmsg_from_status_code+0x41>
lea    0xecb(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1169 <get_shortmsg_from_status_code+0x69>
cmpl   $0x194,-0xc(%rbp)
jne    115e <get_shortmsg_from_status_code+0x5e>
lea    0xebb(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1169 <get_shortmsg_from_status_code+0x69>
lea    0xeb5(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_shortmsg_from_status_code>:
cmp    $0xc8,%edi
je     1120 <get_shortmsg_from_status_code+0x20>
cmp    $0x194,%edi
je     1128 <get_shortmsg_from_status_code+0x28>
cmp    $0x130,%edi
jne    1130 <get_shortmsg_from_status_code+0x30>
lea    0xee4(%rip),%rax
ret
lea    0xed9(%rip),%rax
ret
lea    0xee1(%rip),%rax
ret
lea    0xee3(%rip),%rax
ret

LLVM IR (-O0):
@.str = [3 x i8] c"OK\00"
@.str.1 = [13 x i8] c"NOT MODIFIED\00"
@.str.2 = [10 x i8] c"NOT FOUND\00"
@.str.3 = [8 x i8] c"UNKNOWN\00"
define i8* @get_shortmsg_from_status_code(i32 %0) {
%2 = alloca i8*
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp eq i32 %4, 200
br i1 %5, label %6, label %7
6: ; preds = %1
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8** %2
br label %16
7: ; preds = %1
%8 = load i32, i32* %3
%9 = icmp eq i32 %8, 304
br i1 %9, label %10, label %11
10: ; preds = %7
store i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i8** %2
br label %16
11: ; preds = %7
%12 = load i32, i32* %3
%13 = icmp eq i32 %12, 404
br i1 %13, label %14, label %15
14: ; preds = %11
store i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), i8** %2
br label %16
15: ; preds = %11
store i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0), i8** %2
br label %16
16: ; preds = %15, %14, %10, %6
%17 = load i8*, i8** %2
ret i8* %17
}

LLVM IR (-O2):
@.str = [3 x i8] c"OK\00"
@.str.1 = [13 x i8] c"NOT MODIFIED\00"
@.str.2 = [10 x i8] c"NOT FOUND\00"
@.str.3 = [8 x i8] c"UNKNOWN\00"
define i8* @get_shortmsg_from_status_code(i32 %0) {
switch i32 %0, label %4 [
i32 200, label %5
i32 304, label %2
i32 404, label %3
]
2: ; preds = %1
br label %5
3: ; preds = %1
br label %5
4: ; preds = %1
br label %5
5: ; preds = %1, %4, %3, %2
%6 = phi i8* [ getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), %2 ], [ getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), %3 ], [ getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0), %4 ], [ getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), %1 ]
ret i8* %6
}
void print_reconf(struct dhcpv6_option *opt,
                  void (*print)(const char *fmt, ...)) {}


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

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

LLVM IR (-O0):
%struct.dhcpv6_option = type opaque
define void @print_reconf(%struct.dhcpv6_option* %0, void (i8*, ...)* %1) {
%3 = alloca %struct.dhcpv6_option*
%4 = alloca void (i8*, ...)*
store %struct.dhcpv6_option* %0, %struct.dhcpv6_option** %3
store void (i8*, ...)* %1, void (i8*, ...)** %4
ret void
}

LLVM IR (-O2):
%struct.dhcpv6_option = type opaque
define void @print_reconf(%struct.dhcpv6_option* nocapture %0, void (i8*, ...)* nocapture %1) {
ret void
}
/* Variables and functions */
scalar_t__ asin(double);
long double asinl(long double x) { return (long double)asin((double)x); }


x86 assembly (clang, -O0):
<asinl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
fstpl  -0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
call   1030 <asin@plt>
mov    %rax,-0x18(%rbp)
fildll -0x18(%rbp)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<asinl>:
sub    $0x18,%rsp
fldt   0x20(%rsp)
fstpl  0x8(%rsp)
movsd  0x8(%rsp),%xmm0
call   1030 <asin@plt>
mov    %rax,0x10(%rsp)
fildll 0x10(%rsp)
add    $0x18,%rsp
ret

LLVM IR (-O0):
define x86_fp80 @asinl(x86_fp80 %0) {
%2 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %2
%3 = load x86_fp80, x86_fp80* %2
%4 = fptrunc x86_fp80 %3 to double
%5 = call i64 @asin(double %4)
%6 = sitofp i64 %5 to x86_fp80
ret x86_fp80 %6
}

LLVM IR (-O2):
define x86_fp80 @asinl(x86_fp80 %0) {
%2 = fptrunc x86_fp80 %0 to double
%3 = tail call i64 @asin(double %2)
%4 = sitofp i64 %3 to x86_fp80
ret x86_fp80 %4
}
/* Variables and functions */
char *exmul(char *, char *);
char *exexp(char *s, int n) {
  if (n <= 1) {
    return s;
  } else {
    return exmul(s, exexp(s, n - 1));
  }
}


x86 assembly (clang, -O0):
<exexp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
cmpl   $0x1,-0x14(%rbp)
jg     1146 <exexp+0x26>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    116d <exexp+0x4d>
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
sub    $0x1,%esi
call   1040 <exexp@plt>
mov    -0x20(%rbp),%rdi
mov    %rax,%rsi
call   1030 <exmul@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<exexp>:
push   %rbx
mov    %rdi,%rbx
cmp    $0x1,%esi
jg     112e <exexp+0xe>
mov    %rbx,%rax
pop    %rbx
ret
add    $0xffffffff,%esi
mov    %rbx,%rdi
call   1040 <exexp@plt>
mov    %rbx,%rdi
mov    %rax,%rsi
pop    %rbx
jmp    1030 <exmul@plt>

LLVM IR (-O0):
define i8* @exexp(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
%6 = load i32, i32* %5
%7 = icmp sle i32 %6, 1
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i8*, i8** %4
store i8* %9, i8** %3
br label %17
10: ; preds = %2
%11 = load i8*, i8** %4
%12 = load i8*, i8** %4
%13 = load i32, i32* %5
%14 = sub nsw i32 %13, 1
%15 = call i8* @exexp(i8* %12, i32 %14)
%16 = call i8* @exmul(i8* %11, i8* %15)
store i8* %16, i8** %3
br label %17
17: ; preds = %10, %8
%18 = load i8*, i8** %3
ret i8* %18
}

LLVM IR (-O2):
define i8* @exexp(i8* %0, i32 %1) {
%3 = icmp slt i32 %1, 2
br i1 %3, label %4, label %6
4: ; preds = %2, %6
%5 = phi i8* [ %9, %6 ], [ %0, %2 ]
ret i8* %5
6: ; preds = %2
%7 = add nsw i32 %1, -1
%8 = tail call i8* @exexp(i8* %0, i32 %7)
%9 = tail call i8* @exmul(i8* %0, i8* %8)
br label %4
}
/* Type definitions */
struct stat {
  int dummy;
};

/* Variables and functions */
scalar_t__ inc_addr(void *, int);
int lstat(char const *, struct stat *);
int bad_lstat(void *addr) {
  return lstat((const char *)addr, (struct stat *)inc_addr(addr, 1));
}


x86 assembly (clang, -O0):
<bad_lstat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x1,%esi
call   1040 <inc_addr@plt>
mov    -0x10(%rbp),%rdi
mov    %rax,%rsi
call   1030 <lstat@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bad_lstat>:
push   %rbx
mov    %rdi,%rbx
mov    $0x1,%esi
call   1040 <inc_addr@plt>
mov    %rbx,%rdi
mov    %rax,%rsi
pop    %rbx
jmp    1030 <lstat@plt>

LLVM IR (-O0):
%struct.stat = type { i32 }
define i32 @bad_lstat(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @inc_addr(i8* %4, i32 1)
%6 = inttoptr i64 %5 to %struct.stat*
%7 = call i32 @lstat(i8* %3, %struct.stat* %6)
ret i32 %7
}

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @bad_lstat(i8* %0) {
%2 = tail call i64 @inc_addr(i8* %0, i32 1)
%3 = inttoptr i64 %2 to %struct.stat*
%4 = tail call i32 @lstat(i8* %0, %struct.stat* %3)
ret i32 %4
}
/* Type definitions */
struct prompt {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ prompt_Continue(struct prompt *);
void prompt_TimedContinue(void *v) { prompt_Continue((struct prompt *)v); }


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

x86 assembly (clang, -O2):
<prompt_TimedContinue>:
jmp    1030 <prompt_Continue@plt>

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

LLVM IR (-O2):
%struct.prompt = type { i32 }
define void @prompt_TimedContinue(i8* %0) {
%2 = bitcast i8* %0 to %struct.prompt*
%3 = tail call i32 @prompt_Continue(%struct.prompt* %2)
ret void
}
/* Type definitions */
struct geometry_struct {
  int dummy;
};

/* Variables and functions */
int cone_overlaps_cylinder(struct geometry_struct *, struct geometry_struct *);
int cylinder_overlaps_cone(struct geometry_struct *geometry_cylinder,
                           struct geometry_struct *geometry_cone) {
  return cone_overlaps_cylinder(geometry_cone, geometry_cylinder);
}


x86 assembly (clang, -O0):
<cylinder_overlaps_cone>:
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 <cone_overlaps_cylinder@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cylinder_overlaps_cone>:
mov    %rdi,%rax
mov    %rsi,%rdi
mov    %rax,%rsi
jmp    1030 <cone_overlaps_cylinder@plt>

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

LLVM IR (-O2):
%struct.geometry_struct = type { i32 }
define i32 @cylinder_overlaps_cone(%struct.geometry_struct* %0, %struct.geometry_struct* %1) {
%3 = tail call i32 @cone_overlaps_cylinder(%struct.geometry_struct* %1, %struct.geometry_struct* %0)
ret i32 %3
}
int snd_usb_autoresume(struct snd_usb_audio *chip) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.snd_usb_audio = type opaque
define i32 @snd_usb_autoresume(%struct.snd_usb_audio* nocapture readnone %0) {
ret i32 0
}
int get_msg_type(char msg[]) {
  if (msg[2] == 'S') {
    return 1;
  } else if (msg[2] == 'T') {
    return 2;
  }
  return 0;
}


x86 assembly (clang, -O0):
<get_msg_type>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl 0x2(%rax),%eax
cmp    $0x53,%eax
jne    1125 <get_msg_type+0x25>
movl   $0x1,-0x4(%rbp)
jmp    114e <get_msg_type+0x4e>
mov    -0x10(%rbp),%rax
movsbl 0x2(%rax),%eax
cmp    $0x54,%eax
jne    1142 <get_msg_type+0x42>
movl   $0x2,-0x4(%rbp)
jmp    114e <get_msg_type+0x4e>
jmp    1147 <get_msg_type+0x47>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_msg_type>:
mov    0x2(%rdi),%al
xor    %ecx,%ecx
cmp    $0x54,%al
sete   %cl
add    %ecx,%ecx
cmp    $0x53,%al
mov    $0x1,%eax
cmovne %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @get_msg_type(i8* nocapture %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 2
%3 = load i8, i8* %2
%4 = icmp eq i8 %3, 84
%5 = select i1 %4, i32 2, i32 0
%6 = icmp eq i8 %3, 83
%7 = select i1 %6, i32 1, i32 %5
ret i32 %7
}
/* Variables and functions */
int add(char *);
bool add_test_different_delimiter() {
  if (add("//z\n3,5z1") == 9)
    return true;
  return false;
}


x86 assembly (clang, -O0):
<add_test_different_delimiter>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
call   1030 <add@plt>
cmp    $0x9,%eax
jne    1139 <add_test_different_delimiter+0x29>
movl   $0x1,-0x4(%rbp)
jmp    1140 <add_test_different_delimiter+0x30>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<add_test_different_delimiter>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <add@plt>
xor    %ecx,%ecx
cmp    $0x9,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [10 x i8] c"//z\0A3,5z1\00"
define i32 @add_test_different_delimiter() {
%1 = alloca i32
%2 = call i32 @add(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i32 %2, 9
br i1 %3, label %4, label %5
4: ; preds = %0
store i32 1, i32* %1
br label %6
5: ; preds = %0
store i32 0, i32* %1
br label %6
6: ; preds = %5, %4
%7 = load i32, i32* %1
ret i32 %7
}

LLVM IR (-O2):
@.str = [10 x i8] c"//z\0A3,5z1\00"
define i32 @add_test_different_delimiter() {
%1 = tail call i32 @add(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%2 = icmp eq i32 %1, 9
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Type definitions */
typedef int uint8_t;
typedef int uint32_t;

/* Variables and functions */
__attribute__((unused)) void from_tpm_uint32(const uint8_t *buffer,
                                             uint32_t *x) {
  *x = ((buffer[0] << 24) | (buffer[1] << 16) | (buffer[2] << 8) | buffer[3]);
}


x86 assembly (clang, -O0):
<from_tpm_uint32>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
shl    $0x18,%ecx
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%eax
shl    $0x10,%eax
or     %eax,%ecx
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%eax
shl    $0x8,%eax
or     %eax,%ecx
mov    -0x8(%rbp),%rax
or     0xc(%rax),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<from_tpm_uint32>:
mov    (%rdi),%eax
mov    0x4(%rdi),%ecx
shl    $0x18,%eax
shl    $0x10,%ecx
or     %eax,%ecx
mov    0x8(%rdi),%eax
shl    $0x8,%eax
or     %ecx,%eax
or     0xc(%rdi),%eax
mov    %eax,(%rsi)
ret

LLVM IR (-O0):
define void @from_tpm_uint32(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 = getelementptr inbounds i32, i32* %5, i64 0
%7 = load i32, i32* %6
%8 = shl i32 %7, 24
%9 = load i32*, i32** %3
%10 = getelementptr inbounds i32, i32* %9, i64 1
%11 = load i32, i32* %10
%12 = shl i32 %11, 16
%13 = or i32 %8, %12
%14 = load i32*, i32** %3
%15 = getelementptr inbounds i32, i32* %14, i64 2
%16 = load i32, i32* %15
%17 = shl i32 %16, 8
%18 = or i32 %13, %17
%19 = load i32*, i32** %3
%20 = getelementptr inbounds i32, i32* %19, i64 3
%21 = load i32, i32* %20
%22 = or i32 %18, %21
%23 = load i32*, i32** %4
store i32 %22, i32* %23
ret void
}

LLVM IR (-O2):
define void @from_tpm_uint32(i32* nocapture %0, i32* nocapture writeonly %1) {
%3 = load i32, i32* %0
%4 = shl i32 %3, 24
%5 = getelementptr inbounds i32, i32* %0, i64 1
%6 = load i32, i32* %5
%7 = shl i32 %6, 16
%8 = or i32 %7, %4
%9 = getelementptr inbounds i32, i32* %0, i64 2
%10 = load i32, i32* %9
%11 = shl i32 %10, 8
%12 = or i32 %8, %11
%13 = getelementptr inbounds i32, i32* %0, i64 3
%14 = load i32, i32* %13
%15 = or i32 %12, %14
store i32 %15, i32* %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char);
int main(int argc, char **argv) {
  int iterator = 0;
  while (iterator <= 255) {
    printf("%c\n", (char)iterator);
    iterator++;
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0xff,-0x14(%rbp)
jg     115a <main+0x4a>
mov    -0x14(%rbp),%eax
lea    0xebc(%rip),%rdi
movsbl %al,%esi
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    112d <main+0x1d>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
xor    %ebp,%ebp
lea    0xee4(%rip),%rbx
nopl   0x0(%rax)
movsbl %bpl,%esi
mov    %rbx,%rdi
call   1030 <printf@plt>
add    $0x1,%ebp
cmp    $0x100,%ebp
jne    1120 <main+0x10>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%c\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
br label %3
3: ; preds = %2, %3
%4 = phi i32 [ 0, %2 ], [ %7, %3 ]
%5 = trunc i32 %4 to i8
%6 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8 signext %5)
%7 = add nuw nsw i32 %4, 1
%8 = icmp eq i32 %7, 256
br i1 %8, label %9, label %3
9: ; preds = %3
ret i32 0
}
int regulator_unregister_notifier(struct regulator *regulator,
                                  struct notifier_block *nb) {
  return 0;
}


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

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

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

LLVM IR (-O2):
%struct.regulator = type opaque
%struct.notifier_block = type opaque
define i32 @regulator_unregister_notifier(%struct.regulator* nocapture readnone %0, %struct.notifier_block* nocapture readnone %1) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, double);
void dump_ranking(double *R, int N) {
  int i;
  for (i = 0; i < N; i++) {
    printf("%d: %f\n", i, R[i]);
  }
}


x86 assembly (clang, -O0):
<dump_ranking>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    115c <dump_ranking+0x4c>
mov    -0x10(%rbp),%esi
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
lea    0xeb7(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <dump_ranking+0x16>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [8 x i8] c"%d: %f\0A\00"
define void @dump_ranking(double* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %14
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %12, %6 ]
%8 = getelementptr inbounds double, double* %0, i64 %7
%9 = load double, double* %8
%10 = trunc i64 %7 to i32
%11 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %10, double %9)
%12 = add nuw nsw i64 %7, 1
%13 = icmp eq i64 %12, %5
br i1 %13, label %14, label %6
14: ; preds = %6, %2
ret void
}
/* Type definitions */
struct tree {
  int dummy;
};

/* Variables and functions */
double calc_tree(struct tree *);
double op_mul(struct tree *left, struct tree *right) {
  return calc_tree(left) * calc_tree(right);
}


x86 assembly (clang, -O0):
<op_mul>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <calc_tree@plt>
movsd  %xmm0,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <calc_tree@plt>
movaps %xmm0,%xmm1
movsd  -0x18(%rbp),%xmm0
mulsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<op_mul>:
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%rbx
call   1030 <calc_tree@plt>
movsd  %xmm0,0x8(%rsp)
mov    %rbx,%rdi
call   1030 <calc_tree@plt>
mulsd  0x8(%rsp),%xmm0
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.tree = type { i32 }
define double @op_mul(%struct.tree* %0, %struct.tree* %1) {
%3 = alloca %struct.tree*
%4 = alloca %struct.tree*
store %struct.tree* %0, %struct.tree** %3
store %struct.tree* %1, %struct.tree** %4
%5 = load %struct.tree*, %struct.tree** %3
%6 = call double @calc_tree(%struct.tree* %5)
%7 = load %struct.tree*, %struct.tree** %4
%8 = call double @calc_tree(%struct.tree* %7)
%9 = fmul double %6, %8
ret double %9
}

LLVM IR (-O2):
%struct.tree = type { i32 }
define double @op_mul(%struct.tree* %0, %struct.tree* %1) {
%3 = tail call double @calc_tree(%struct.tree* %0)
%4 = tail call double @calc_tree(%struct.tree* %1)
%5 = fmul double %3, %4
ret double %5
}
/* Variables and functions */
long double expl(long double);
long double logl(long double);
long double powl(long double b, long double e) { return expl(e * logl(b)); }


x86 assembly (clang, -O0):
<powl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
fldt   0x20(%rbp)
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fstpt  -0x20(%rbp)
fldt   -0x20(%rbp)
fstpt  -0x2c(%rbp)
fldt   -0x10(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
call   1030 <logl@plt>
fldt   -0x2c(%rbp)
fmulp  %st,%st(1)
mov    %rsp,%rax
fstpt  (%rax)
call   1040 <expl@plt>
fld    %st(0)
fstp   %st(0)
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<powl>:
sub    $0x28,%rsp
fldt   0x40(%rsp)
fstpt  0x1c(%rsp)
fldt   0x30(%rsp)
fstpt  (%rsp)
call   1030 <logl@plt>
fldt   0x1c(%rsp)
fmulp  %st,%st(1)
fstpt  (%rsp)
call   1040 <expl@plt>
add    $0x28,%rsp
ret

LLVM IR (-O0):
define x86_fp80 @powl(x86_fp80 %0, x86_fp80 %1) {
%3 = alloca x86_fp80
%4 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %3
store x86_fp80 %1, x86_fp80* %4
%5 = load x86_fp80, x86_fp80* %4
%6 = load x86_fp80, x86_fp80* %3
%7 = call x86_fp80 @logl(x86_fp80 %6)
%8 = fmul x86_fp80 %5, %7
%9 = call x86_fp80 @expl(x86_fp80 %8)
ret x86_fp80 %9
}

LLVM IR (-O2):
define x86_fp80 @powl(x86_fp80 %0, x86_fp80 %1) {
%3 = tail call x86_fp80 @logl(x86_fp80 %0)
%4 = fmul x86_fp80 %3, %1
%5 = tail call x86_fp80 @expl(x86_fp80 %4)
ret x86_fp80 %5
}
void f16(void) { extern int a16[]; }


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

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

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

LLVM IR (-O2):
define void @f16() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isspace(int);
void t_isspace_0xa5() {
  Assert_real((isspace(165) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isspace.c",
              830, ("isspace should be 0 for 0xa5"));
}


x86 assembly (clang, -O0):
<t_isspace_0xa5>:
push   %rbp
mov    %rsp,%rbp
mov    $0xa5,%edi
call   1030 <isspace@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x33e,%edx
lea    0xf5b(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isspace_0xa5>:
push   %rax
mov    $0xa5,%edi
call   1030 <isspace@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x33e,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isspace.c\00"
@.str.1 = [29 x i8] c"isspace should be 0 for 0xa5\00"
define void @t_isspace_0xa5() {
%1 = call i64 @isspace(i32 165)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 830, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isspace.c\00"
@.str.1 = [29 x i8] c"isspace should be 0 for 0xa5\00"
define void @t_isspace_0xa5() {
%1 = tail call i64 @isspace(i32 165)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 830, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int _start() {
  volatile int a = 2;
  volatile int b = 5;
  volatile int c = a + b;
  volatile int d = a * c;
  volatile int e = d / 4;
  return d;
}


x86 assembly (clang, -O0):
<_start>:
push   %rbp
mov    %rsp,%rbp
movl   $0x2,-0x4(%rbp)
movl   $0x5,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
add    %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    -0xc(%rbp),%ecx
imul   %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_start>:
movl   $0x2,-0x10(%rsp)
movl   $0x5,-0x8(%rsp)
mov    -0x10(%rsp),%eax
add    -0x8(%rsp),%eax
mov    %eax,-0xc(%rsp)
mov    -0x10(%rsp),%eax
imul   -0xc(%rsp),%eax
mov    %eax,-0x14(%rsp)
mov    -0x14(%rsp),%eax
lea    0x3(%rax),%ecx
test   %eax,%eax
cmovns %eax,%ecx
sar    $0x2,%ecx
mov    %ecx,-0x4(%rsp)
mov    -0x14(%rsp),%eax
ret

LLVM IR (-O0):
define i32 @_start() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store volatile i32 2, i32* %1
store volatile i32 5, i32* %2
%6 = load volatile i32, i32* %1
%7 = load volatile i32, i32* %2
%8 = add nsw i32 %6, %7
store volatile i32 %8, i32* %3
%9 = load volatile i32, i32* %1
%10 = load volatile i32, i32* %3
%11 = mul nsw i32 %9, %10
store volatile i32 %11, i32* %4
%12 = load volatile i32, i32* %4
%13 = sdiv i32 %12, 4
store volatile i32 %13, i32* %5
%14 = load volatile i32, i32* %4
ret i32 %14
}

LLVM IR (-O2):
define i32 @_start() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = bitcast i32* %1 to i8*
store volatile i32 2, i32* %1
%7 = bitcast i32* %2 to i8*
store volatile i32 5, i32* %2
%8 = bitcast i32* %3 to i8*
%9 = load volatile i32, i32* %1
%10 = load volatile i32, i32* %2
%11 = add nsw i32 %10, %9
store volatile i32 %11, i32* %3
%12 = bitcast i32* %4 to i8*
%13 = load volatile i32, i32* %1
%14 = load volatile i32, i32* %3
%15 = mul nsw i32 %14, %13
store volatile i32 %15, i32* %4
%16 = bitcast i32* %5 to i8*
%17 = load volatile i32, i32* %4
%18 = sdiv i32 %17, 4
store volatile i32 %18, i32* %5
%19 = load volatile i32, i32* %4
ret i32 %19
}
void getThingy(unsigned char header[][54], int offset, int *thingy) {
  *thingy = *(int *)((char *)header[0] + offset);
}


x86 assembly (clang, -O0):
<getThingy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,1),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<getThingy>:
movslq %esi,%rax
mov    (%rdi,%rax,1),%eax
mov    %eax,(%rdx)
ret

LLVM IR (-O0):
define void @getThingy([54 x i8]* %0, i32 %1, i32* %2) {
%4 = alloca [54 x i8]*
%5 = alloca i32
%6 = alloca i32*
store [54 x i8]* %0, [54 x i8]** %4
store i32 %1, i32* %5
store i32* %2, i32** %6
%7 = load [54 x i8]*, [54 x i8]** %4
%8 = getelementptr inbounds [54 x i8], [54 x i8]* %7, i64 0
%9 = getelementptr inbounds [54 x i8], [54 x i8]* %8, i64 0, i64 0
%10 = load i32, i32* %5
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds i8, i8* %9, i64 %11
%13 = bitcast i8* %12 to i32*
%14 = load i32, i32* %13
%15 = load i32*, i32** %6
store i32 %14, i32* %15
ret void
}

LLVM IR (-O2):
define void @getThingy([54 x i8]* nocapture %0, i32 %1, i32* nocapture writeonly %2) {
%4 = sext i32 %1 to i64
%5 = getelementptr inbounds [54 x i8], [54 x i8]* %0, i64 0, i64 %4
%6 = bitcast i8* %5 to i32*
%7 = load i32, i32* %6
store i32 %7, i32* %2
ret void
}
/* Type definitions */
typedef int time_t;
struct stat {
  int st_mtime;
};

/* Variables and functions */
int access(char const *, int /*<<< orphan*/);
scalar_t__ stat(char const *, struct stat *);
time_t fdate(const char *filename) {
  struct stat st;
  if (access(filename, 0) == -1)
    return (-1);
  if (stat(filename, &st) != 0)
    return (-1);
  return (st.st_mtime);
}


x86 assembly (clang, -O0):
<fdate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
xor    %esi,%esi
call   1040 <access@plt>
cmp    $0xffffffff,%eax
jne    114c <fdate+0x2c>
movl   $0xffffffff,-0x4(%rbp)
jmp    1175 <fdate+0x55>
mov    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1030 <stat@plt>
cmp    $0x0,%rax
je     116f <fdate+0x4f>
movl   $0xffffffff,-0x4(%rbp)
jmp    1175 <fdate+0x55>
mov    -0x18(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fdate>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
xor    %esi,%esi
call   1040 <access@plt>
mov    $0xffffffff,%ebp
cmp    $0xffffffff,%eax
je     114a <fdate+0x2a>
mov    %rsp,%rsi
mov    %rbx,%rdi
call   1030 <stat@plt>
test   %rax,%rax
jne    114a <fdate+0x2a>
mov    (%rsp),%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
define i32 @fdate(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca %struct.stat
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i32 @access(i8* %5, i32 0)
%7 = icmp eq i32 %6, -1
br i1 %7, label %8, label %9
8: ; preds = %1
store i32 -1, i32* %2
br label %17
9: ; preds = %1
%10 = load i8*, i8** %3
%11 = call i64 @stat(i8* %10, %struct.stat* %4)
%12 = icmp ne i64 %11, 0
br i1 %12, label %13, label %14
13: ; preds = %9
store i32 -1, i32* %2
br label %17
14: ; preds = %9
%15 = getelementptr inbounds %struct.stat, %struct.stat* %4, i32 0, i32 0
%16 = load i32, i32* %15
store i32 %16, i32* %2
br label %17
17: ; preds = %14, %13, %8
%18 = load i32, i32* %2
ret i32 %18
}

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @fdate(i8* %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = tail call i32 @access(i8* %0, i32 0)
%5 = icmp eq i32 %4, -1
br i1 %5, label %12, label %6
6: ; preds = %1
%7 = call i64 @stat(i8* %0, %struct.stat* %2)
%8 = icmp eq i64 %7, 0
br i1 %8, label %9, label %12
9: ; preds = %6
%10 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%11 = load i32, i32* %10
br label %12
12: ; preds = %6, %1, %9
%13 = phi i32 [ %11, %9 ], [ -1, %1 ], [ -1, %6 ]
ret i32 %13
}
int main(void) {
  int x = 1;
  int y = 2;
  int z = x + y;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x1,-0x4(%rbp)
movl   $0x2,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 1, i32* %1
store i32 2, i32* %2
%4 = load i32, i32* %1
%5 = load i32, i32* %2
%6 = add nsw i32 %4, %5
store i32 %6, i32* %3
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
int get_system_cpu_arc() {
  return 64;
  return 86;
}


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

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

LLVM IR (-O0):
define i32 @get_system_cpu_arc() {
ret i32 64
}

LLVM IR (-O2):
define i32 @get_system_cpu_arc() {
ret i32 64
}
void g_ascii_xdigit_value() {}


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

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

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

LLVM IR (-O2):
define void @g_ascii_xdigit_value() {
ret void
}
float clampMinMaxFloat(float val, float min, float max) {
  if (val < min)
    return min;
  if (val > max)
    return max;
  return val;
}


x86 assembly (clang, -O0):
<clampMinMaxFloat>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x8(%rbp)
movss  %xmm1,-0xc(%rbp)
movss  %xmm2,-0x10(%rbp)
movss  -0x8(%rbp),%xmm1
movss  -0xc(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jbe    1135 <clampMinMaxFloat+0x35>
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    115d <clampMinMaxFloat+0x5d>
movss  -0x8(%rbp),%xmm0
ucomiss -0x10(%rbp),%xmm0
jbe    1153 <clampMinMaxFloat+0x53>
movss  -0x10(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    115d <clampMinMaxFloat+0x5d>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<clampMinMaxFloat>:
minss  %xmm0,%xmm2
cmpltss %xmm1,%xmm0
movaps %xmm0,%xmm3
andnps %xmm2,%xmm3
andps  %xmm1,%xmm0
orps   %xmm3,%xmm0
ret

LLVM IR (-O0):
define float @clampMinMaxFloat(float %0, float %1, float %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca float
%7 = alloca float
store float %0, float* %5
store float %1, float* %6
store float %2, float* %7
%8 = load float, float* %5
%9 = load float, float* %6
%10 = fcmp olt float %8, %9
br i1 %10, label %11, label %13
11: ; preds = %3
%12 = load float, float* %6
store float %12, float* %4
br label %21
13: ; preds = %3
%14 = load float, float* %5
%15 = load float, float* %7
%16 = fcmp ogt float %14, %15
br i1 %16, label %17, label %19
17: ; preds = %13
%18 = load float, float* %7
store float %18, float* %4
br label %21
19: ; preds = %13
%20 = load float, float* %5
store float %20, float* %4
br label %21
21: ; preds = %19, %17, %11
%22 = load float, float* %4
ret float %22
}

LLVM IR (-O2):
define float @clampMinMaxFloat(float %0, float %1, float %2) {
%4 = fcmp olt float %0, %1
%5 = fcmp ogt float %0, %2
%6 = select i1 %5, float %2, float %0
%7 = select i1 %4, float %1, float %6
ret float %7
}