xunge/DecIR huggingface dataset:
/* Variables and functions */
void *malloc(size_t);
int /*<<< orphan*/ memset(void *, int /*<<< orphan*/, size_t);
void *mallocz(size_t size) {
  void *m = malloc(size);
  if (m)
    memset(m, 0, size);
  return m;
}


x86 assembly (clang, -O0):
<mallocz>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1153 <mallocz+0x33>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rdx
xor    %esi,%esi
call   1030 <memset@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mallocz>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
je     1141 <mallocz+0x21>
mov    %rbx,%rdi
xor    %esi,%esi
mov    %r14,%rdx
call   1030 <memset@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @mallocz(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @memset(i8* %2, i32 0, i64 %0)
br label %6
6: ; preds = %4, %1
ret i8* %2
}
int test_imm_33uint8_mem(unsigned char *val) {
  return ((*val) & (-0x33 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_33uint8_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, -51
%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_33uint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, -51
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
unsigned char core___core__Int___Numeric__to_b(long self) {
  unsigned char var;
  unsigned char var1;
  var1 = (unsigned char)self;
  var = var1;
  goto RET_LABEL;
RET_LABEL:;
  return var;
}


x86 assembly (clang, -O0):
<core___core__Int___Numeric__to_b>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %al,-0xa(%rbp)
mov    -0xa(%rbp),%al
mov    %al,-0x9(%rbp)
movzbl -0x9(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<core___core__Int___Numeric__to_b>:
mov    %rdi,%rax
ret

LLVM IR (-O0):
define zeroext i8 @core___core__Int___Numeric__to_b(i64 %0) {
%2 = alloca i64
%3 = alloca i8
%4 = alloca i8
store i64 %0, i64* %2
%5 = load i64, i64* %2
%6 = trunc i64 %5 to i8
store i8 %6, i8* %4
%7 = load i8, i8* %4
store i8 %7, i8* %3
br label %8
8: ; preds = %1
%9 = load i8, i8* %3
ret i8 %9
}

LLVM IR (-O2):
define zeroext i8 @core___core__Int___Numeric__to_b(i64 %0) {
%2 = trunc i64 %0 to i8
ret i8 %2
}
/* Variables and functions */
int /*<<< orphan*/ __console_tx_hex8(int, unsigned char);
void print_info_hex8(unsigned char value) { __console_tx_hex8(6, value); }


x86 assembly (clang, -O0):
<print_info_hex8>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    $0x6,%edi
movzbl -0x1(%rbp),%esi
call   1030 <__console_tx_hex8@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @print_info_hex8(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = call i32 @__console_tx_hex8(i32 6, i8 zeroext %3)
ret void
}

LLVM IR (-O2):
define void @print_info_hex8(i8 zeroext %0) {
%2 = tail call i32 @__console_tx_hex8(i32 6, i8 zeroext %0)
ret void
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  int res_h_errno;
};

/* Variables and functions */
TYPE_1__ *__res_state();
int *__h_errno(void) { return (&__res_state()->res_h_errno); }


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

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

LLVM IR (-O0):
%struct.TYPE_2__ = type { i32 }
define i32* @__h_errno() {
%1 = call %struct.TYPE_2__* (...) @__res_state()
%2 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %1, i32 0, i32 0
ret i32* %2
}

LLVM IR (-O2):
%struct.TYPE_2__ = type { i32 }
define i32* @__h_errno() {
%1 = tail call %struct.TYPE_2__* (...) @__res_state()
%2 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %1, i64 0, i32 0
ret i32* %2
}
void XtCvtStringToInitialState() {}


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

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

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

LLVM IR (-O2):
define void @XtCvtStringToInitialState() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ va_list;

/* Variables and functions */
int /*<<< orphan*/ vreportf(char *, char *, char const *, int /*<<< orphan*/);
void info_builtin(const char *fmt, va_list params) {
  vreportf("[I] ", "", fmt, params);
}


x86 assembly (clang, -O0):
<info_builtin>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdx
mov    -0xc(%rbp),%ecx
lea    0xed3(%rip),%rdi
lea    0xed0(%rip),%rsi
call   1030 <vreportf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<info_builtin>:
mov    %esi,%ecx
mov    %rdi,%rdx
lea    0xee4(%rip),%rdi
lea    0xee1(%rip),%rsi
jmp    1030 <vreportf@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"[I] \00"
@.str.1 = [1 x i8] zeroinitializer
define void @info_builtin(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 @vreportf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), i8* %5, i32 %6)
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"[I] \00"
@.str.1 = [1 x i8] zeroinitializer
define void @info_builtin(i8* %0, i32 %1) {
%3 = tail call i32 @vreportf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), i8* %0, i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void openerror(char *name) { printf("error opening %s\n", name); }


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

x86 assembly (clang, -O2):
<openerror>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [18 x i8] c"error opening %s\0A\00"
define void @openerror(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [18 x i8] c"error opening %s\0A\00"
define void @openerror(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ int64_t;

/* Variables and functions */
int __pmp_schedule_next(int, int /*<<< orphan*/ *, int /*<<< orphan*/ *,
                        int /*<<< orphan*/ *);
int __ompc_schedule_next_8(int global_id, int64_t *lower, int64_t *upper,
                           int64_t *inc) {
  int result;
  ;
  result = __pmp_schedule_next(global_id, lower, upper, inc);
  return result;
}


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

x86 assembly (clang, -O2):
<__ompc_schedule_next_8>:
jmp    1030 <__pmp_schedule_next@plt>

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

LLVM IR (-O2):
define i32 @__ompc_schedule_next_8(i32 %0, i32* %1, i32* %2, i32* %3) {
%5 = tail call i32 @__pmp_schedule_next(i32 %0, i32* %1, i32* %2, i32* %3)
ret i32 %5
}
/* Variables and functions */
size_t strlen(const char *const str) {
  size_t len = 0;
  while (str[len] != '\0') {
    len += 1;
  }
  return len;
}


x86 assembly (clang, -O0):
<strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1136 <strlen+0x36>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <strlen+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i64 @strlen(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ 0, %1 ], [ %7, %2 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = add i64 %3, 1
br i1 %6, label %8, label %2
8: ; preds = %2
ret i64 %3
}
long my_round(double in) {
  int i;
  i = in;
  if ((in - in) < 0.5)
    return (i);
  return (i + 1);
}


x86 assembly (clang, -O0):
<my_round>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
cvttsd2si -0x10(%rbp),%eax
mov    %eax,-0x14(%rbp)
movsd  -0x10(%rbp),%xmm1
subsd  -0x10(%rbp),%xmm1
movsd  0xedd(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    113a <my_round+0x3a>
movslq -0x14(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1146 <my_round+0x46>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
cltq
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_round>:
cvttsd2si %xmm0,%eax
subsd  %xmm0,%xmm0
movsd  0xef0(%rip),%xmm1
xor    %ecx,%ecx
ucomisd %xmm0,%xmm1
setbe  %cl
add    %eax,%ecx
movslq %ecx,%rax
ret

LLVM IR (-O0):
define i64 @my_round(double %0) {
%2 = alloca i64
%3 = alloca double
%4 = alloca i32
store double %0, double* %3
%5 = load double, double* %3
%6 = fptosi double %5 to i32
store i32 %6, i32* %4
%7 = load double, double* %3
%8 = load double, double* %3
%9 = fsub double %7, %8
%10 = fcmp olt double %9, 5.000000e-01
br i1 %10, label %11, label %14
11: ; preds = %1
%12 = load i32, i32* %4
%13 = sext i32 %12 to i64
store i64 %13, i64* %2
br label %18
14: ; preds = %1
%15 = load i32, i32* %4
%16 = add nsw i32 %15, 1
%17 = sext i32 %16 to i64
store i64 %17, i64* %2
br label %18
18: ; preds = %14, %11
%19 = load i64, i64* %2
ret i64 %19
}

LLVM IR (-O2):
define i64 @my_round(double %0) {
%2 = fptosi double %0 to i32
%3 = fsub double %0, %0
%4 = fcmp uge double %3, 5.000000e-01
%5 = zext i1 %4 to i32
%6 = add nsw i32 %5, %2
%7 = sext i32 %6 to i64
ret i64 %7
}
void BF_ENC(unsigned long LL, unsigned long R, unsigned long *S,
            unsigned long P) {
  LL ^= P;
  LL ^= (((S[(R >> 24L)] + S[0x0100 + ((R >> 16L) & 0xff)]) ^
          S[0x0200 + ((R >> 8L) & 0xff)]) +
         S[0x0300 + ((R)&0xff)]) &
        0xffffffff;
}


x86 assembly (clang, -O0):
<BF_ENC>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x20(%rbp),%rax
xor    -0x8(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x18(%rbp),%rax
mov    -0x10(%rbp),%rcx
shr    $0x18,%rcx
mov    (%rax,%rcx,8),%rax
mov    -0x18(%rbp),%rcx
mov    -0x10(%rbp),%rdx
shr    $0x10,%rdx
and    $0xff,%rdx
add    $0x100,%rdx
add    (%rcx,%rdx,8),%rax
mov    -0x18(%rbp),%rcx
mov    -0x10(%rbp),%rdx
shr    $0x8,%rdx
and    $0xff,%rdx
add    $0x200,%rdx
xor    (%rcx,%rdx,8),%rax
mov    -0x18(%rbp),%rcx
mov    -0x10(%rbp),%rdx
and    $0xff,%rdx
add    $0x300,%rdx
add    (%rcx,%rdx,8),%rax
movabs $0xffffffff,%rcx
and    %rcx,%rax
xor    -0x8(%rbp),%rax
mov    %rax,-0x8(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @BF_ENC(i64 %0, i64 %1, i64* %2, i64 %3) {
%5 = alloca i64
%6 = alloca i64
%7 = alloca i64*
%8 = alloca i64
store i64 %0, i64* %5
store i64 %1, i64* %6
store i64* %2, i64** %7
store i64 %3, i64* %8
%9 = load i64, i64* %8
%10 = load i64, i64* %5
%11 = xor i64 %10, %9
store i64 %11, i64* %5
%12 = load i64*, i64** %7
%13 = load i64, i64* %6
%14 = lshr i64 %13, 24
%15 = getelementptr inbounds i64, i64* %12, i64 %14
%16 = load i64, i64* %15
%17 = load i64*, i64** %7
%18 = load i64, i64* %6
%19 = lshr i64 %18, 16
%20 = and i64 %19, 255
%21 = add i64 256, %20
%22 = getelementptr inbounds i64, i64* %17, i64 %21
%23 = load i64, i64* %22
%24 = add i64 %16, %23
%25 = load i64*, i64** %7
%26 = load i64, i64* %6
%27 = lshr i64 %26, 8
%28 = and i64 %27, 255
%29 = add i64 512, %28
%30 = getelementptr inbounds i64, i64* %25, i64 %29
%31 = load i64, i64* %30
%32 = xor i64 %24, %31
%33 = load i64*, i64** %7
%34 = load i64, i64* %6
%35 = and i64 %34, 255
%36 = add i64 768, %35
%37 = getelementptr inbounds i64, i64* %33, i64 %36
%38 = load i64, i64* %37
%39 = add i64 %32, %38
%40 = and i64 %39, 4294967295
%41 = load i64, i64* %5
%42 = xor i64 %41, %40
store i64 %42, i64* %5
ret void
}

LLVM IR (-O2):
define void @BF_ENC(i64 %0, i64 %1, i64* nocapture %2, i64 %3) {
ret void
}
/* Variables and functions */
#define AF_INET 129
#define AF_INET6 128
int addr_unicast_masklen(int af) {
  switch (af) {
  case AF_INET:
    return 32;
  case AF_INET6:
    return 128;
  default:
    return -1;
  }
}


x86 assembly (clang, -O0):
<addr_unicast_masklen>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
sub    $0x80,%eax
je     113c <addr_unicast_masklen+0x3c>
jmp    111d <addr_unicast_masklen+0x1d>
mov    -0xc(%rbp),%eax
sub    $0x81,%eax
jne    1148 <addr_unicast_masklen+0x48>
jmp    1130 <addr_unicast_masklen+0x30>
movl   $0x20,-0x4(%rbp)
jmp    114f <addr_unicast_masklen+0x4f>
movl   $0x80,-0x4(%rbp)
jmp    114f <addr_unicast_masklen+0x4f>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<addr_unicast_masklen>:
cmp    $0x80,%edi
mov    $0xffffffff,%ecx
cmove  %edi,%ecx
cmp    $0x81,%edi
mov    $0x20,%eax
cmovne %ecx,%eax
ret

LLVM IR (-O0):
define i32 @addr_unicast_masklen(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %7 [
i32 129, label %5
i32 128, label %6
]
5: ; preds = %1
store i32 32, i32* %2
br label %8
6: ; preds = %1
store i32 128, i32* %2
br label %8
7: ; preds = %1
store i32 -1, i32* %2
br label %8
8: ; preds = %7, %6, %5
%9 = load i32, i32* %2
ret i32 %9
}

LLVM IR (-O2):
define i32 @addr_unicast_masklen(i32 %0) {
%2 = icmp eq i32 %0, 128
%3 = select i1 %2, i32 128, i32 -1
%4 = icmp eq i32 %0, 129
%5 = select i1 %4, i32 32, i32 %3
ret i32 %5
}
int testExe2Func(void) { return 123; }


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

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

LLVM IR (-O0):
define i32 @testExe2Func() {
ret i32 123
}

LLVM IR (-O2):
define i32 @testExe2Func() {
ret i32 123
}
int min_three(int a, int b, int c) {
  int i;
  i = a;
  if (b < i)
    i = b;
  if (c < i)
    i = c;
  return (i);
}


x86 assembly (clang, -O0):
<min_three>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1125 <min_three+0x25>
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1137 <min_three+0x37>
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<min_three>:
mov    %edi,%eax
cmp    %edi,%esi
cmovl  %esi,%eax
cmp    %edx,%eax
cmovg  %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @min_three(i32 %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %1, %0
%5 = select i1 %4, i32 %1, i32 %0
%6 = icmp sgt i32 %5, %2
%7 = select i1 %6, i32 %2, i32 %5
ret i32 %7
}
/* Variables and functions */
void *malloc(unsigned int);
void *fz_malloc_default(void *opaque, unsigned int size) {
  return malloc(size);
}


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

x86 assembly (clang, -O2):
<fz_malloc_default>:
mov    %esi,%edi
jmp    1030 <malloc@plt>

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

LLVM IR (-O2):
define noalias i8* @fz_malloc_default(i8* nocapture readnone %0, i32 %1) {
%3 = tail call i8* @malloc(i32 %1)
ret i8* %3
}
void I422ToARGB1555Row_AVX2() {}


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

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

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

LLVM IR (-O2):
define void @I422ToARGB1555Row_AVX2() {
ret void
}
/* Type definitions */
struct config {
  int dummy;
};

/* Variables and functions */
char const *strstr(char const *, char *);
int conf_command_unset(struct config *conf, const char *cmd, size_t len) {
  if (!conf || !len || strstr(cmd, "unset") != cmd)
    return 0;
  return 0;
}


x86 assembly (clang, -O0):
<conf_command_unset>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1154 <conf_command_unset+0x44>
cmpq   $0x0,-0x20(%rbp)
je     1154 <conf_command_unset+0x44>
mov    -0x18(%rbp),%rdi
lea    0xebb(%rip),%rsi
call   1030 <strstr@plt>
cmp    -0x18(%rbp),%rax
je     1160 <conf_command_unset+0x50>
movl   $0x0,-0x4(%rbp)
jmp    1167 <conf_command_unset+0x57>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.config = type { i32 }
@.str = [6 x i8] c"unset\00"
define i32 @conf_command_unset(%struct.config* %0, i8* %1, i64 %2) {
%4 = alloca i32
%5 = alloca %struct.config*
%6 = alloca i8*
%7 = alloca i64
store %struct.config* %0, %struct.config** %5
store i8* %1, i8** %6
store i64 %2, i64* %7
%8 = load %struct.config*, %struct.config** %5
%9 = icmp ne %struct.config* %8, null
br i1 %9, label %10, label %18
10: ; preds = %3
%11 = load i64, i64* %7
%12 = icmp ne i64 %11, 0
br i1 %12, label %13, label %18
13: ; preds = %10
%14 = load i8*, i8** %6
%15 = call i8* @strstr(i8* %14, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%16 = load i8*, i8** %6
%17 = icmp ne i8* %15, %16
br i1 %17, label %18, label %19
18: ; preds = %13, %10, %3
store i32 0, i32* %4
br label %20
19: ; preds = %13
store i32 0, i32* %4
br label %20
20: ; preds = %19, %18
%21 = load i32, i32* %4
ret i32 %21
}

LLVM IR (-O2):
%struct.config = type { i32 }
define i32 @conf_command_unset(%struct.config* readnone %0, i8* nocapture readnone %1, i64 %2) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ *strstr(char *, char *);
int AT_EXP_IPSTATUS(const unsigned char *RESP) {
  if (RESP == NULL) {
    return (0);
  }
  if (strstr((char *)RESP, "+IPSTATUS:") != NULL) {
    return (1);
  }
  return (0);
}


x86 assembly (clang, -O0):
<AT_EXP_IPSTATUS>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1133 <AT_EXP_IPSTATUS+0x23>
movl   $0x0,-0x4(%rbp)
jmp    1160 <AT_EXP_IPSTATUS+0x50>
mov    -0x10(%rbp),%rdi
lea    0xec2(%rip),%rsi
call   1030 <strstr@plt>
cmp    $0x0,%rax
je     1159 <AT_EXP_IPSTATUS+0x49>
movl   $0x1,-0x4(%rbp)
jmp    1160 <AT_EXP_IPSTATUS+0x50>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<AT_EXP_IPSTATUS>:
test   %rdi,%rdi
je     1132 <AT_EXP_IPSTATUS+0x22>
push   %rax
lea    0xee3(%rip),%rsi
call   1030 <strstr@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
add    $0x8,%rsp
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
@.str = [11 x i8] c"+IPSTATUS:\00"
define i32 @AT_EXP_IPSTATUS(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %7, label %3
3: ; preds = %1
%4 = tail call i32* @strstr(i8* %0, i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%5 = icmp ne i32* %4, null
%6 = zext i1 %5 to i32
br label %7
7: ; preds = %3, %1
%8 = phi i32 [ 0, %1 ], [ %6, %3 ]
ret i32 %8
}
int GenericVarindex(int *param, int ipg, int iv) { return iv + param[0] * ipg; }


x86 assembly (clang, -O0):
<GenericVarindex>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    -0x8(%rbp),%rcx
mov    (%rcx),%ecx
imul   -0xc(%rbp),%ecx
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<GenericVarindex>:
imul   (%rdi),%esi
lea    (%rsi,%rdx,1),%eax
ret

LLVM IR (-O0):
define i32 @GenericVarindex(i32* %0, i32 %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
store i32* %0, i32** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %6
%8 = load i32*, i32** %4
%9 = getelementptr inbounds i32, i32* %8, i64 0
%10 = load i32, i32* %9
%11 = load i32, i32* %5
%12 = mul nsw i32 %10, %11
%13 = add nsw i32 %7, %12
ret i32 %13
}

LLVM IR (-O2):
define i32 @GenericVarindex(i32* nocapture %0, i32 %1, i32 %2) {
%4 = load i32, i32* %0
%5 = mul nsw i32 %4, %1
%6 = add nsw i32 %5, %2
ret i32 %6
}
int addition(int x, int y) { return x + y; }


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

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

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

LLVM IR (-O2):
define i32 @addition(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
ret i32 %3
}
yyerror(msg) char *msg;
{
  extern long yypos;
  extern char *yylval;
  printf("line %d %s: %s\n", yypos, yylval, msg);
}


x86 assembly (clang, -O0):
<yyerror>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%rsi
mov    0x2ebb(%rip),%rax
mov    (%rax),%rdx
mov    -0x10(%rbp),%rcx
lea    0xec5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<yyerror>:
mov    %rdi,%rcx
mov    0x2ec6(%rip),%rax
mov    (%rax),%rsi
mov    0x2ec4(%rip),%rax
mov    (%rax),%rdx
lea    0xed2(%rip),%rdi
xor    %eax,%eax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"line %d %s: %s\0A\00"
@yypos = external global i64
@yylval = external global i8*
define i32 @yyerror(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i64, i64* @yypos
%5 = load i8*, i8** @yylval
%6 = load i8*, i8** %3
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i64 %4, i8* %5, i8* %6)
%8 = load i32, i32* %2
ret i32 %8
}

LLVM IR (-O2):
@.str = [16 x i8] c"line %d %s: %s\0A\00"
@yypos = external global i64
@yylval = external global i8*
define i32 @yyerror(i8* %0) {
%2 = load i64, i64* @yypos
%3 = load i8*, i8** @yylval
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i64 %2, i8* %3, i8* %0)
ret i32 undef
}
/* Variables and functions */
void *malloc(size_t);
void *aker_malloc(size_t size) { return malloc(size); }


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

x86 assembly (clang, -O2):
<aker_malloc>:
jmp    1030 <malloc@plt>

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

LLVM IR (-O2):
define noalias i8* @aker_malloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ cwrapper_q_sort_float_with_indices(float *, int *,
                                                      int /*<<< orphan*/, int);
void quicksort_float_with_indices_(float numbers[], int indices[],
                                   int *array_size) {
  cwrapper_q_sort_float_with_indices(numbers, indices, 0, (*array_size) - 1);
}


x86 assembly (clang, -O0):
<quicksort_float_with_indices_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rax
mov    (%rax),%ecx
sub    $0x1,%ecx
xor    %edx,%edx
call   1030 <cwrapper_q_sort_float_with_indices@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<quicksort_float_with_indices_>:
mov    (%rdx),%ecx
add    $0xffffffff,%ecx
xor    %edx,%edx
jmp    1030 <cwrapper_q_sort_float_with_indices@plt>

LLVM IR (-O0):
define void @quicksort_float_with_indices_(float* %0, i32* %1, i32* %2) {
%4 = alloca float*
%5 = alloca i32*
%6 = alloca i32*
store float* %0, float** %4
store i32* %1, i32** %5
store i32* %2, i32** %6
%7 = load float*, float** %4
%8 = load i32*, i32** %5
%9 = load i32*, i32** %6
%10 = load i32, i32* %9
%11 = sub nsw i32 %10, 1
%12 = call i32 @cwrapper_q_sort_float_with_indices(float* %7, i32* %8, i32 0, i32 %11)
ret void
}

LLVM IR (-O2):
define void @quicksort_float_with_indices_(float* %0, i32* %1, i32* nocapture %2) {
%4 = load i32, i32* %2
%5 = add nsw i32 %4, -1
%6 = tail call i32 @cwrapper_q_sort_float_with_indices(float* %0, i32* %1, i32 0, i32 %5)
ret void
}
/* Type definitions */
struct iax_session {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ destroy_session(struct iax_session *);
void iax_destroy(struct iax_session *session) { destroy_session(session); }


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

x86 assembly (clang, -O2):
<iax_destroy>:
jmp    1030 <destroy_session@plt>

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

LLVM IR (-O2):
%struct.iax_session = type { i32 }
define void @iax_destroy(%struct.iax_session* %0) {
%2 = tail call i32 @destroy_session(%struct.iax_session* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void parameter_error(void) {
  printf("Error in parameters\n");
  return;
}


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

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

LLVM IR (-O0):
@.str = [21 x i8] c"Error in parameters\0A\00"
define void @parameter_error() {
%1 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [20 x i8] c"Error in parameters\00"
define void @parameter_error() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int change(int number) {
  number *= 2;
  printf("\nIn function change, number = %d", number);
  return number;
}


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

x86 assembly (clang, -O2):
<change>:
push   %rbx
lea    (%rdi,%rdi,1),%ebx
lea    0xee5(%rip),%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [33 x i8] c"\0AIn function change, number = %d\00"
define i32 @change(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = mul nsw i32 %3, 2
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = load i32, i32* %2
ret i32 %7
}

LLVM IR (-O2):
@.str = [33 x i8] c"\0AIn function change, number = %d\00"
define i32 @change(i32 %0) {
%2 = shl nsw i32 %0, 1
%3 = tail call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i32 %2)
ret i32 %2
}
/* Variables and functions */
char *U_WMRCORENONE_set(char *);
char *U_WMRF8_set(void) { return U_WMRCORENONE_set("U_WMRF8"); }


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

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

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

LLVM IR (-O2):
@.str = [8 x i8] c"U_WMRF8\00"
define i8* @U_WMRF8_set() {
%1 = tail call i8* @U_WMRCORENONE_set(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
void print_version_and_exit() {
  printf("ClusterDuck controller version 0.0.1\nCopyright (c) 2009 Alistair "
         "Lynn\n\n");
  exit(0);
}


x86 assembly (clang, -O0):
<print_version_and_exit>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<print_version_and_exit>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [72 x i8] c"ClusterDuck controller version 0.0.1\0ACopyright (c) 2009 Alistair Lynn\0A\0A\00"
define void @print_version_and_exit() {
%1 = call i32 @printf(i8* getelementptr inbounds ([72 x i8], [72 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@str = [71 x i8] c"ClusterDuck controller version 0.0.1\0ACopyright (c) 2009 Alistair Lynn\0A\00"
define void @print_version_and_exit() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([71 x i8], [71 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 0)
unreachable
}
void v2i_ASN1_BIT_STRING(void) {}


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

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

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

LLVM IR (-O2):
define void @v2i_ASN1_BIT_STRING() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ isprint(int);
void t_isprint_0x56() {
  Assert_real((isprint(86)),
              "/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_isprint.c",
              435, ("isprint should be 1 for V"));
}


x86 assembly (clang, -O0):
<t_isprint_0x56>:
push   %rbp
mov    %rsp,%rbp
mov    $0x56,%edi
call   1030 <isprint@plt>
mov    %eax,%edi
lea    0xec9(%rip),%rsi
mov    $0x1b3,%edx
lea    0xf65(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isprint_0x56>:
push   %rax
mov    $0x56,%edi
call   1030 <isprint@plt>
lea    0xece(%rip),%rsi
lea    0xf6f(%rip),%rcx
mov    %eax,%edi
mov    $0x1b3,%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_isprint.c\00"
@.str.1 = [26 x i8] c"isprint should be 1 for V\00"
define void @t_isprint_0x56() {
%1 = call i32 @isprint(i32 86)
%2 = call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 435, i8* getelementptr inbounds ([26 x i8], [26 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_isprint.c\00"
@.str.1 = [26 x i8] c"isprint should be 1 for V\00"
define void @t_isprint_0x56() {
%1 = tail call i32 @isprint(i32 86)
%2 = tail call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 435, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ calcNthTriangle(int);
int main(void) {
  calcNthTriangle(10);
  calcNthTriangle(20);
  calcNthTriangle(50);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0xa,%edi
call   1030 <calcNthTriangle@plt>
mov    $0x14,%edi
call   1030 <calcNthTriangle@plt>
mov    $0x32,%edi
call   1030 <calcNthTriangle@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @calcNthTriangle(i32 10)
%3 = call i32 @calcNthTriangle(i32 20)
%4 = call i32 @calcNthTriangle(i32 50)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @calcNthTriangle(i32 10)
%2 = tail call i32 @calcNthTriangle(i32 20)
%3 = tail call i32 @calcNthTriangle(i32 50)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ fopen_write_file_test();
int main() { fopen_write_file_test(); }


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 (...) @fopen_write_file_test()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @fopen_write_file_test()
ret i32 0
}
/* Variables and functions */
float sqrt(float);
float W(float *d) { return sqrt(d[0] * d[0] + d[1] * d[1] + d[2] * d[2]); }


x86 assembly (clang, -O0):
<W>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm1
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm2
mov    -0x8(%rbp),%rax
movss  0x4(%rax),%xmm0
mov    -0x8(%rbp),%rax
mulss  0x4(%rax),%xmm0
mulss  %xmm2,%xmm1
addss  %xmm0,%xmm1
mov    -0x8(%rbp),%rax
movss  0x8(%rax),%xmm0
mov    -0x8(%rbp),%rax
movss  0x8(%rax),%xmm2
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
call   1030 <sqrt@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<W>:
movss  (%rdi),%xmm1
movss  0x4(%rdi),%xmm0
mulss  %xmm0,%xmm0
mulss  %xmm1,%xmm1
addss  %xmm0,%xmm1
movss  0x8(%rdi),%xmm0
mulss  %xmm0,%xmm0
addss  %xmm1,%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jb     113f <W+0x2f>
sqrtss %xmm0,%xmm0
ret
jmp    1030 <sqrt@plt>

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

LLVM IR (-O2):
define float @W(float* nocapture %0) {
%2 = load float, float* %0
%3 = getelementptr inbounds float, float* %0, i64 1
%4 = load float, float* %3
%5 = fmul float %4, %4
%6 = tail call float @llvm.fmuladd.f32(float %2, float %2, float %5)
%7 = getelementptr inbounds float, float* %0, i64 2
%8 = load float, float* %7
%9 = tail call float @llvm.fmuladd.f32(float %8, float %8, float %6)
%10 = tail call float @sqrt(float %9)
ret float %10
}
void test_save(struct record *record, int cpu) {}


x86 assembly (clang, -O0):
<test_save>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
%struct.record = type opaque
define void @test_save(%struct.record* nocapture %0, i32 %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ quick_sort_r(int *, int /*<<< orphan*/, int);
int quick_sort(int array[], int size) {
  quick_sort_r(array, 0, size);
  return 0;
}


x86 assembly (clang, -O0):
<quick_sort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
xor    %esi,%esi
call   1030 <quick_sort_r@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<quick_sort>:
push   %rax
mov    %esi,%edx
xor    %esi,%esi
call   1030 <quick_sort_r@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @quick_sort(i32* %0, i32 %1) {
%3 = tail call i32 @quick_sort_r(i32* %0, i32 0, i32 %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ __ESBMC_assume(void *);
void *malloc(unsigned int);
void *my_malloc(unsigned size) {
  void *p = malloc(size);
  __ESBMC_assume(p);
  return p;
}


x86 assembly (clang, -O0):
<my_malloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <__ESBMC_assume@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_malloc>:
push   %rbx
call   1040 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1030 <__ESBMC_assume@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @my_malloc(i32 %0) {
%2 = tail call i8* @malloc(i32 %0)
%3 = tail call i32 @__ESBMC_assume(i8* %2)
ret i8* %2
}
void DH_size(void) {}


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

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

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

LLVM IR (-O2):
define void @DH_size() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int, int);
int main() {
  int a = 10, b = 20, c = 30;
  printf("%d + %d = %d", a, b, c);
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [13 x i8] c"%d + %d = %d\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 10, i32 20, i32 30)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ video_printcolor(char const *, int, int);
void video_print(const char *s) { video_printcolor(s, 0x00, 0x07); }


x86 assembly (clang, -O0):
<video_print>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
xor    %esi,%esi
mov    $0x7,%edx
call   1030 <video_printcolor@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<video_print>:
xor    %esi,%esi
mov    $0x7,%edx
jmp    1030 <video_printcolor@plt>

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

LLVM IR (-O2):
define void @video_print(i8* %0) {
%2 = tail call i32 @video_printcolor(i8* %0, i32 0, i32 7)
ret void
}
void test_no_clause() {
  int i;
#pragma omp taskloop simd
  for (i = 0; i < 16; ++i)
    ;
#pragma omp taskloop simd
  ++i;
}


x86 assembly (clang, -O0):
<test_no_clause>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
cmpl   $0x10,-0x4(%rbp)
jge    1128 <test_no_clause+0x28>
jmp    111a <test_no_clause+0x1a>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    110b <test_no_clause+0xb>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @test_no_clause() {
ret void
}
void f(int *x, int *y, int *restrict p) {
  *x += *p;
  *y += *p;
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%ecx
mov    -0x8(%rbp),%rax
add    (%rax),%ecx
mov    %ecx,(%rax)
mov    -0x18(%rbp),%rax
mov    (%rax),%ecx
mov    -0x10(%rbp),%rax
add    (%rax),%ecx
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
mov    (%rdx),%eax
add    %eax,(%rdi)
add    %eax,(%rsi)
ret

LLVM IR (-O0):
define void @f(i32* %0, i32* %1, i32* noalias %2) {
%4 = alloca i32*
%5 = alloca i32*
%6 = alloca i32*
store i32* %0, i32** %4
store i32* %1, i32** %5
store i32* %2, i32** %6
%7 = load i32*, i32** %6
%8 = load i32, i32* %7
%9 = load i32*, i32** %4
%10 = load i32, i32* %9
%11 = add nsw i32 %10, %8
store i32 %11, i32* %9
%12 = load i32*, i32** %6
%13 = load i32, i32* %12
%14 = load i32*, i32** %5
%15 = load i32, i32* %14
%16 = add nsw i32 %15, %13
store i32 %16, i32* %14
ret void
}

LLVM IR (-O2):
define void @f(i32* nocapture %0, i32* nocapture %1, i32* noalias nocapture %2) {
%4 = load i32, i32* %2
%5 = load i32, i32* %0
%6 = add nsw i32 %5, %4
store i32 %6, i32* %0
%7 = load i32, i32* %1
%8 = add nsw i32 %7, %4
store i32 %8, i32* %1
ret void
}