xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ memset(void *, int /*<<< orphan*/, size_t);
void *xmalloc(size_t);
void *xcalloc(size_t n, size_t size) {
  void *ptr = xmalloc(n * size);
  memset(ptr, 0, n * size);
  return ptr;
}


x86 assembly (clang, -O0):
<xcalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
imul   -0x10(%rbp),%rdi
call   1040 <xmalloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rdx
imul   -0x10(%rbp),%rdx
xor    %esi,%esi
call   1030 <memset@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xcalloc>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
imul   %rsi,%rbx
mov    %rbx,%rdi
call   1040 <xmalloc@plt>
mov    %rax,%r14
mov    %rax,%rdi
xor    %esi,%esi
mov    %rbx,%rdx
call   1030 <memset@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @xcalloc(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i8*
store i64 %0, i64* %3
store i64 %1, i64* %4
%6 = load i64, i64* %3
%7 = load i64, i64* %4
%8 = mul i64 %6, %7
%9 = call i8* @xmalloc(i64 %8)
store i8* %9, i8** %5
%10 = load i8*, i8** %5
%11 = load i64, i64* %3
%12 = load i64, i64* %4
%13 = mul i64 %11, %12
%14 = call i32 @memset(i8* %10, i32 0, i64 %13)
%15 = load i8*, i8** %5
ret i8* %15
}

LLVM IR (-O2):
define i8* @xcalloc(i64 %0, i64 %1) {
%3 = mul i64 %1, %0
%4 = tail call i8* @xmalloc(i64 %3)
%5 = tail call i32 @memset(i8* %4, i32 0, i64 %3)
ret i8* %4
}
/* Variables and functions */
char *strrchr(char const *, char);
const char *conf_basename(const char *fn) {
  const char *p;
  if ((p = strrchr(fn, '/')))
    return p + 1;
  return fn;
}


x86 assembly (clang, -O0):
<conf_basename>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x2f,%esi
call   1030 <strrchr@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
je     1149 <conf_basename+0x39>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1151 <conf_basename+0x41>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<conf_basename>:
push   %rbx
mov    %rdi,%rbx
mov    $0x2f,%esi
call   1030 <strrchr@plt>
lea    0x1(%rax),%rcx
test   %rax,%rax
cmove  %rbx,%rcx
mov    %rcx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @conf_basename(i8* %0) {
%2 = tail call i8* @strrchr(i8* dereferenceable(1) %0, i8 signext 47)
%3 = icmp eq i8* %2, null
%4 = getelementptr inbounds i8, i8* %2, i64 1
%5 = select i1 %3, i8* %0, i8* %4
ret i8* %5
}
/* Type definitions */
typedef size_t uint64_t;

/* Variables and functions */
void reduceLen64(char *name, uint64_t *len) {
  uint64_t i, l = *len;
  for (i = 0; i < l; ++i) {
    if (name[i] == 0) {
      *len = i;
      break;
    }
  }
}


x86 assembly (clang, -O0):
<reduceLen64>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x20(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x20(%rbp),%rax
jae    1168 <reduceLen64+0x68>
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
jne    1152 <reduceLen64+0x52>
mov    -0x18(%rbp),%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
jmp    1168 <reduceLen64+0x68>
jmp    1157 <reduceLen64+0x57>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    111f <reduceLen64+0x1f>
pop    %rbp
ret

x86 assembly (clang, -O2):
<reduceLen64>:
mov    (%rsi),%rax
test   %rax,%rax
je     111f <reduceLen64+0x1f>
xor    %ecx,%ecx
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,(%rdi,%rcx,1)
je     1120 <reduceLen64+0x20>
add    $0x1,%rcx
cmp    %rcx,%rax
jne    1110 <reduceLen64+0x10>
ret
mov    %rcx,(%rsi)
ret

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

LLVM IR (-O2):
define void @reduceLen64(i8* nocapture %0, i64* nocapture %1) {
%3 = load i64, i64* %1
%4 = icmp eq i64 %3, 0
br i1 %4, label %14, label %5
5: ; preds = %2, %11
%6 = phi i64 [ %12, %11 ], [ 0, %2 ]
%7 = getelementptr inbounds i8, i8* %0, i64 %6
%8 = load i8, i8* %7
%9 = icmp eq i8 %8, 0
br i1 %9, label %10, label %11
10: ; preds = %5
store i64 %6, i64* %1
br label %14
11: ; preds = %5
%12 = add nuw i64 %6, 1
%13 = icmp eq i64 %12, %3
br i1 %13, label %14, label %5
14: ; preds = %11, %2, %10
ret void
}
unsigned int fixed_16_16(double x) { return (unsigned int)(0.5 + x * 65536.0); }


x86 assembly (clang, -O0):
<fixed_16_16>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xeea(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xee6(%rip),%xmm1
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fixed_16_16>:
mulsd  0xef8(%rip),%xmm0
addsd  0xef8(%rip),%xmm0
cvttsd2si %xmm0,%rax
ret

LLVM IR (-O0):
define i32 @fixed_16_16(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call double @llvm.fmuladd.f64(double %3, double 6.553600e+04, double 5.000000e-01)
%5 = fptoui double %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @fixed_16_16(double %0) {
%2 = tail call double @llvm.fmuladd.f64(double %0, double 6.553600e+04, double 5.000000e-01)
%3 = fptoui double %2 to i32
ret i32 %3
}
void rop3_195_1_1(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  stk1 = T ^ S;
  stk1 = ~stk1;
  *D = (stk1 & (~S) & (~T)) | (*D & S) | (*D & T);
}


x86 assembly (clang, -O0):
<rop3_195_1_1>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
movzbl -0xa(%rbp),%eax
movzbl -0x9(%rbp),%ecx
xor    %ecx,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
xor    $0xffffffff,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
movzbl -0x9(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
movzbl -0xa(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
movzbl -0x9(%rbp),%edx
and    %edx,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
movzbl -0xa(%rbp),%edx
and    %edx,%ecx
or     %ecx,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rop3_195_1_1>:
mov    %edx,%eax
or     %sil,%al
not    %al
mov    (%rdi),%cl
and    %cl,%sil
or     %al,%sil
and    %dl,%cl
or     %sil,%cl
mov    %cl,(%rdi)
ret

LLVM IR (-O0):
define void @rop3_195_1_1(i8* %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
store i8* %0, i8** %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%8 = load i8, i8* %6
%9 = zext i8 %8 to i32
%10 = load i8, i8* %5
%11 = zext i8 %10 to i32
%12 = xor i32 %9, %11
%13 = trunc i32 %12 to i8
store i8 %13, i8* %7
%14 = load i8, i8* %7
%15 = zext i8 %14 to i32
%16 = xor i32 %15, -1
%17 = trunc i32 %16 to i8
store i8 %17, i8* %7
%18 = load i8, i8* %7
%19 = zext i8 %18 to i32
%20 = load i8, i8* %5
%21 = zext i8 %20 to i32
%22 = xor i32 %21, -1
%23 = and i32 %19, %22
%24 = load i8, i8* %6
%25 = zext i8 %24 to i32
%26 = xor i32 %25, -1
%27 = and i32 %23, %26
%28 = load i8*, i8** %4
%29 = load i8, i8* %28
%30 = zext i8 %29 to i32
%31 = load i8, i8* %5
%32 = zext i8 %31 to i32
%33 = and i32 %30, %32
%34 = or i32 %27, %33
%35 = load i8*, i8** %4
%36 = load i8, i8* %35
%37 = zext i8 %36 to i32
%38 = load i8, i8* %6
%39 = zext i8 %38 to i32
%40 = and i32 %37, %39
%41 = or i32 %34, %40
%42 = trunc i32 %41 to i8
%43 = load i8*, i8** %4
store i8 %42, i8* %43
ret void
}

LLVM IR (-O2):
define void @rop3_195_1_1(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = or i8 %2, %1
%5 = xor i8 %4, -1
%6 = load i8, i8* %0
%7 = and i8 %6, %1
%8 = or i8 %7, %5
%9 = and i8 %6, %2
%10 = or i8 %8, %9
store i8 %10, i8* %0
ret void
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
uint8_t et4000_mca_feedb(void *priv) { return 1; }


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @et4000_mca_feedb(i8* nocapture readnone %0) {
ret i32 1
}
int f(long long a, int b) {
  int c = (char)a * b;
  return c;
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movsbl %al,%eax
imul   -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
movsbl %dil,%eax
imul   %esi,%eax
ret

LLVM IR (-O0):
define i32 @f(i64 %0, i32 %1) {
%3 = alloca i64
%4 = alloca i32
%5 = alloca i32
store i64 %0, i64* %3
store i32 %1, i32* %4
%6 = load i64, i64* %3
%7 = trunc i64 %6 to i8
%8 = sext i8 %7 to i32
%9 = load i32, i32* %4
%10 = mul nsw i32 %8, %9
store i32 %10, i32* %5
%11 = load i32, i32* %5
ret i32 %11
}

LLVM IR (-O2):
define i32 @f(i64 %0, i32 %1) {
%3 = trunc i64 %0 to i32
%4 = shl i32 %3, 24
%5 = ashr exact i32 %4, 24
%6 = mul nsw i32 %5, %1
ret i32 %6
}
/* Type definitions */
struct gpio {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ gpio_mode(struct gpio *, int, int);
void gpio_a_init(int bit) { gpio_mode((struct gpio *)0x40010800, bit, 3 | 0); }


x86 assembly (clang, -O0):
<gpio_a_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
mov    $0x40010800,%edi
mov    $0x3,%edx
call   1030 <gpio_mode@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gpio_a_init>:
mov    %edi,%esi
mov    $0x40010800,%edi
mov    $0x3,%edx
jmp    1030 <gpio_mode@plt>

LLVM IR (-O0):
%struct.gpio = type { i32 }
define void @gpio_a_init(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @gpio_mode(%struct.gpio* inttoptr (i64 1073809408 to %struct.gpio*), i32 %3, i32 3)
ret void
}

LLVM IR (-O2):
%struct.gpio = type { i32 }
define void @gpio_a_init(i32 %0) {
%2 = tail call i32 @gpio_mode(%struct.gpio* inttoptr (i64 1073809408 to %struct.gpio*), i32 %0, i32 3)
ret void
}
/* Variables and functions */
int read(int, char *, int);
int serialport_readbyte(int fd) {
  char b[1];
  int n = read(fd, b, 1);
  if (n != 1)
    return -1;
  return b[0];
}


x86 assembly (clang, -O0):
<serialport_readbyte>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
lea    -0x9(%rbp),%rsi
mov    $0x1,%edx
call   1030 <read@plt>
mov    %eax,-0x10(%rbp)
cmpl   $0x1,-0x10(%rbp)
je     1145 <serialport_readbyte+0x35>
movl   $0xffffffff,-0x4(%rbp)
jmp    114c <serialport_readbyte+0x3c>
movsbl -0x9(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<serialport_readbyte>:
push   %rax
lea    0x7(%rsp),%rsi
mov    $0x1,%edx
call   1030 <read@plt>
cmp    $0x1,%eax
movsbl 0x7(%rsp),%ecx
mov    $0xffffffff,%eax
cmove  %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @serialport_readbyte(i32 %0) {
%2 = alloca [1 x i8]
%3 = getelementptr inbounds [1 x i8], [1 x i8]* %2, i64 0, i64 0
%4 = call i32 @read(i32 %0, i8* %3, i32 1)
%5 = icmp eq i32 %4, 1
%6 = load i8, i8* %3
%7 = sext i8 %6 to i32
%8 = select i1 %5, i32 %7, i32 -1
ret i32 %8
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ __setCHRBank0High(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ m22_SetChrROMBank0();
void m22_setParamsBXX1(uint16_t addr, uint8_t val) {
  __setCHRBank0High(addr, val);
  m22_SetChrROMBank0();
}


x86 assembly (clang, -O0):
<m22_setParamsBXX1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1040 <__setCHRBank0High@plt>
mov    $0x0,%al
call   1030 <m22_SetChrROMBank0@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<m22_setParamsBXX1>:
push   %rax
call   1040 <__setCHRBank0High@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <m22_SetChrROMBank0@plt>

LLVM IR (-O0):
define void @m22_setParamsBXX1(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 @__setCHRBank0High(i32 %5, i32 %6)
%8 = call i32 (...) @m22_SetChrROMBank0()
ret void
}

LLVM IR (-O2):
define void @m22_setParamsBXX1(i32 %0, i32 %1) {
%3 = tail call i32 @__setCHRBank0High(i32 %0, i32 %1)
%4 = tail call i32 (...) @m22_SetChrROMBank0()
ret void
}
int foo15() { return 15; }


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

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

LLVM IR (-O0):
define i32 @foo15() {
ret i32 15
}

LLVM IR (-O2):
define i32 @foo15() {
ret i32 15
}
/* Variables and functions */
int ENOTSUP;
int feclearexcept(int excepts) { return (excepts ? -ENOTSUP : 0); }


x86 assembly (clang, -O0):
<feclearexcept>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1124 <feclearexcept+0x24>
xor    %eax,%eax
mov    0x2ece(%rip),%rcx
sub    (%rcx),%eax
mov    %eax,-0x8(%rbp)
jmp    112e <feclearexcept+0x2e>
xor    %eax,%eax
mov    %eax,-0x8(%rbp)
jmp    112e <feclearexcept+0x2e>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<feclearexcept>:
mov    0x2ee1(%rip),%rcx
xor    %eax,%eax
sub    (%rcx),%eax
test   %edi,%edi
cmove  %edi,%eax
ret

LLVM IR (-O0):
@ENOTSUP = global i32 0
define i32 @feclearexcept(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ne i32 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* @ENOTSUP
%7 = sub nsw i32 0, %6
br label %9
8: ; preds = %1
br label %9
9: ; preds = %8, %5
%10 = phi i32 [ %7, %5 ], [ 0, %8 ]
ret i32 %10
}

LLVM IR (-O2):
@ENOTSUP = global i32 0
define i32 @feclearexcept(i32 %0) {
%2 = icmp eq i32 %0, 0
%3 = load i32, i32* @ENOTSUP
%4 = sub nsw i32 0, %3
%5 = select i1 %2, i32 0, i32 %4
ret i32 %5
}
/* Type definitions */
struct solo5_start_info {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ puts(char *);
int solo5_app_main(const struct solo5_start_info *si __attribute__((unused))) {
  puts("\n**** Solo5 standalone test_verbose ****\n\n");
  puts("SUCCESS\n");
  return 0;
}


x86 assembly (clang, -O0):
<solo5_app_main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rdi
call   1030 <puts@plt>
lea    0xefc(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.solo5_start_info = type { i32 }
@.str = [43 x i8] c"\0A**** Solo5 standalone test_verbose ****\0A\0A\00"
@.str.1 = [9 x i8] c"SUCCESS\0A\00"
define i32 @solo5_app_main(%struct.solo5_start_info* %0) {
%2 = alloca %struct.solo5_start_info*
store %struct.solo5_start_info* %0, %struct.solo5_start_info** %2
%3 = call i32 @puts(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @puts(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
%struct.solo5_start_info = type { i32 }
@.str = [43 x i8] c"\0A**** Solo5 standalone test_verbose ****\0A\0A\00"
@.str.1 = [9 x i8] c"SUCCESS\0A\00"
define i32 @solo5_app_main(%struct.solo5_start_info* nocapture readnone %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
char *strtoupper(char *str) {
  char *s = str;
  while (*s) {
    if (*s >= 'a' && *s <= 'z')
      *s -= ('a' - 'A');
    ++s;
  }
  return str;
}


x86 assembly (clang, -O0):
<strtoupper>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     115a <strtoupper+0x5a>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x61,%eax
jl     1149 <strtoupper+0x49>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x7a,%eax
jg     1149 <strtoupper+0x49>
mov    -0x10(%rbp),%rax
movsbl (%rax),%ecx
sub    $0x20,%ecx
mov    %cl,(%rax)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <strtoupper+0x10>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strtoupper>:
mov    %rdi,%rax
mov    (%rdi),%cl
test   %cl,%cl
je     112c <strtoupper+0x2c>
lea    0x1(%rax),%rdx
jmp    111b <strtoupper+0x1b>
nop
movzbl (%rdx),%ecx
add    $0x1,%rdx
test   %cl,%cl
je     112c <strtoupper+0x2c>
lea    -0x61(%rcx),%esi
cmp    $0x19,%sil
ja     1110 <strtoupper+0x10>
add    $0xe0,%cl
mov    %cl,-0x1(%rdx)
jmp    1110 <strtoupper+0x10>
ret

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

LLVM IR (-O2):
define i8* @strtoupper(i8* returned %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %15, label %4
4: ; preds = %1, %11
%5 = phi i8 [ %13, %11 ], [ %2, %1 ]
%6 = phi i8* [ %12, %11 ], [ %0, %1 ]
%7 = add i8 %5, -97
%8 = icmp ult i8 %7, 26
br i1 %8, label %9, label %11
9: ; preds = %4
%10 = add nsw i8 %5, -32
store i8 %10, i8* %6
br label %11
11: ; preds = %9, %4
%12 = getelementptr inbounds i8, i8* %6, i64 1
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %4
15: ; preds = %11, %1
ret i8* %0
}
_Bool fsm_set_option(unsigned long long option, void *value) { return 1; }


x86 assembly (clang, -O0):
<fsm_set_option>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x1,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fsm_set_option>:
mov    $0x1,%al
ret

LLVM IR (-O0):
define zeroext i1 @fsm_set_option(i64 %0, i8* %1) {
%3 = alloca i64
%4 = alloca i8*
store i64 %0, i64* %3
store i8* %1, i8** %4
ret i1 true
}

LLVM IR (-O2):
define zeroext i1 @fsm_set_option(i64 %0, i8* nocapture readnone %1) {
ret i1 true
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ memcpy(int /*<<< orphan*/ *, void const *const,
                          size_t const);
size_t string_sink(const void *const buf, const size_t len,
                   void *const stream) {
  uint8_t **ptr = (uint8_t **)stream;
  memcpy(*ptr, buf, len);
  *ptr += len;
  return len;
}


x86 assembly (clang, -O0):
<string_sink>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    (%rax),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
call   1030 <memcpy@plt>
mov    -0x10(%rbp),%rcx
mov    -0x20(%rbp),%rax
shl    $0x2,%rcx
add    (%rax),%rcx
mov    %rcx,(%rax)
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<string_sink>:
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rsi,%rbx
mov    %rdi,%rsi
mov    (%rdx),%rdi
mov    %rbx,%rdx
call   1030 <memcpy@plt>
lea    0x0(,%rbx,4),%rax
add    %rax,(%r14)
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i64 @string_sink(i8* %0, i64 %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i8*
%7 = alloca i32**
store i8* %0, i8** %4
store i64 %1, i64* %5
store i8* %2, i8** %6
%8 = load i8*, i8** %6
%9 = bitcast i8* %8 to i32**
store i32** %9, i32*** %7
%10 = load i32**, i32*** %7
%11 = load i32*, i32** %10
%12 = load i8*, i8** %4
%13 = load i64, i64* %5
%14 = call i32 @memcpy(i32* %11, i8* %12, i64 %13)
%15 = load i64, i64* %5
%16 = load i32**, i32*** %7
%17 = load i32*, i32** %16
%18 = getelementptr inbounds i32, i32* %17, i64 %15
store i32* %18, i32** %16
%19 = load i64, i64* %5
ret i64 %19
}

LLVM IR (-O2):
define i64 @string_sink(i8* %0, i64 returned %1, i8* nocapture %2) {
%4 = bitcast i8* %2 to i32**
%5 = load i32*, i32** %4
%6 = tail call i32 @memcpy(i32* %5, i8* %0, i64 %1)
%7 = load i32*, i32** %4
%8 = getelementptr inbounds i32, i32* %7, i64 %1
store i32* %8, i32** %4
ret i64 %1
}
/* Type definitions */
typedef int /*<<< orphan*/ uid_t;
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
int EINVAL;
__attribute__((visibility("default"))) int sd_pid_get_owner_uid(pid_t pid,
                                                                uid_t *uid) {
  return -EINVAL;
}


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

x86 assembly (clang, -O2):
<sd_pid_get_owner_uid>:
mov    0x2ed9(%rip),%rcx
xor    %eax,%eax
sub    (%rcx),%eax
ret

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

LLVM IR (-O2):
@EINVAL = global i32 0
define i32 @sd_pid_get_owner_uid(i32 %0, i32* nocapture readnone %1) {
%3 = load i32, i32* @EINVAL
%4 = sub nsw i32 0, %3
ret i32 %4
}
/* Variables and functions */
short inb(unsigned short);
int /*<<< orphan*/ outb(unsigned short, short);
void serial_disable_dlab(unsigned short com) {
  short currLineReg = inb((com + 3));
  outb((com + 3), currLineReg & 0x3F);
}


x86 assembly (clang, -O0):
<serial_disable_dlab>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%eax
add    $0x3,%eax
movzwl %ax,%edi
call   1040 <inb@plt>
mov    %ax,-0x4(%rbp)
movzwl -0x2(%rbp),%eax
add    $0x3,%eax
mov    %ax,%cx
movswl -0x4(%rbp),%eax
and    $0x3f,%eax
movzwl %cx,%edi
movswl %ax,%esi
call   1030 <outb@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<serial_disable_dlab>:
push   %rbx
add    $0x3,%edi
movzwl %di,%ebx
mov    %ebx,%edi
call   1040 <inb@plt>
and    $0x3f,%eax
mov    %ebx,%edi
mov    %eax,%esi
pop    %rbx
jmp    1030 <outb@plt>

LLVM IR (-O0):
define void @serial_disable_dlab(i16 zeroext %0) {
%2 = alloca i16
%3 = alloca i16
store i16 %0, i16* %2
%4 = load i16, i16* %2
%5 = zext i16 %4 to i32
%6 = add nsw i32 %5, 3
%7 = trunc i32 %6 to i16
%8 = call signext i16 @inb(i16 zeroext %7)
store i16 %8, i16* %3
%9 = load i16, i16* %2
%10 = zext i16 %9 to i32
%11 = add nsw i32 %10, 3
%12 = trunc i32 %11 to i16
%13 = load i16, i16* %3
%14 = sext i16 %13 to i32
%15 = and i32 %14, 63
%16 = trunc i32 %15 to i16
%17 = call i32 @outb(i16 zeroext %12, i16 signext %16)
ret void
}

LLVM IR (-O2):
define void @serial_disable_dlab(i16 zeroext %0) {
%2 = add i16 %0, 3
%3 = tail call signext i16 @inb(i16 zeroext %2)
%4 = and i16 %3, 63
%5 = tail call i32 @outb(i16 zeroext %2, i16 signext %4)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;

/* Variables and functions */
int /*<<< orphan*/ localtime(int /*<<< orphan*/ *);
int /*<<< orphan*/ strftime(char *, int, char *, int /*<<< orphan*/);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
void logTime(char *dbuf) {
  time_t tim;
  (void)time(&tim);
  strftime(dbuf, 20, "%b %e %H:%M:%S", localtime(&tim));
}


x86 assembly (clang, -O0):
<logTime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0xc(%rbp),%rdi
call   1040 <time@plt>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
lea    -0xc(%rbp),%rdi
call   1030 <localtime@plt>
mov    -0x18(%rbp),%rdi
mov    %eax,%ecx
mov    $0x14,%esi
lea    0xe98(%rip),%rdx
call   1050 <strftime@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<logTime>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
lea    0x4(%rsp),%r14
mov    %r14,%rdi
call   1040 <time@plt>
mov    %r14,%rdi
call   1030 <localtime@plt>
lea    0xead(%rip),%rdx
mov    %rbx,%rdi
mov    $0x14,%esi
mov    %eax,%ecx
call   1050 <strftime@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [15 x i8] c"%b %e %H:%M:%S\00"
define void @logTime(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = call i32 @time(i32* %3)
%5 = load i8*, i8** %2
%6 = call i32 @localtime(i32* %3)
%7 = call i32 @strftime(i8* %5, i32 20, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %6)
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"%b %e %H:%M:%S\00"
define void @logTime(i8* %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = call i32 @time(i32* %2)
%5 = call i32 @localtime(i32* %2)
%6 = call i32 @strftime(i8* %0, i32 20, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %5)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ w5100_write_byte(int, unsigned int);
void w5100_writeIR(unsigned data) { w5100_write_byte(0x0015, data); }


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

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

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

LLVM IR (-O2):
define void @w5100_writeIR(i32 %0) {
%2 = tail call i32 @w5100_write_byte(i32 21, i32 %0)
ret void
}
/* Type definitions */
struct cached_iconv {
  int dummy;
};

/* Variables and functions */
int cached_iconv_convert(struct cached_iconv *, int, int *);
int iconv_convert(void *baton, int from_char, int *to_char) {
  struct cached_iconv *ci = baton;
  return cached_iconv_convert(ci, from_char, to_char);
}


x86 assembly (clang, -O0):
<iconv_convert>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
call   1030 <cached_iconv_convert@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<iconv_convert>:
jmp    1030 <cached_iconv_convert@plt>

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

LLVM IR (-O2):
%struct.cached_iconv = type { i32 }
define i32 @iconv_convert(i8* %0, i32 %1, i32* %2) {
%4 = bitcast i8* %0 to %struct.cached_iconv*
%5 = tail call i32 @cached_iconv_convert(%struct.cached_iconv* %4, i32 %1, i32* %2)
ret i32 %5
}
int toupper(int c) {
  if (c >= 'a' && c <= 'z')
    return c - 'a' + 'A';
  else
    return c;
}


x86 assembly (clang, -O0):
<toupper>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x61,-0x8(%rbp)
jl     112c <toupper+0x2c>
cmpl   $0x7a,-0x8(%rbp)
jg     112c <toupper+0x2c>
mov    -0x8(%rbp),%eax
sub    $0x61,%eax
add    $0x41,%eax
mov    %eax,-0x4(%rbp)
jmp    1132 <toupper+0x32>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<toupper>:
lea    -0x61(%rdi),%ecx
lea    -0x20(%rdi),%eax
cmp    $0x1a,%ecx
cmovae %edi,%eax
ret

LLVM IR (-O0):
define i32 @toupper(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp sge i32 %4, 97
br i1 %5, label %6, label %13
6: ; preds = %1
%7 = load i32, i32* %3
%8 = icmp sle i32 %7, 122
br i1 %8, label %9, label %13
9: ; preds = %6
%10 = load i32, i32* %3
%11 = sub nsw i32 %10, 97
%12 = add nsw i32 %11, 65
store i32 %12, i32* %2
br label %15
13: ; preds = %6, %1
%14 = load i32, i32* %3
store i32 %14, i32* %2
br label %15
15: ; preds = %13, %9
%16 = load i32, i32* %2
ret i32 %16
}

LLVM IR (-O2):
define i32 @toupper(i32 %0) {
%2 = add i32 %0, -97
%3 = icmp ult i32 %2, 26
%4 = add nsw i32 %0, -32
%5 = select i1 %3, i32 %4, i32 %0
ret i32 %5
}
int axp_set_noe(int noe) {
  int ret = 0;
  return ret;
}


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

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

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

LLVM IR (-O2):
define i32 @axp_set_noe(i32 %0) {
ret i32 0
}
/* Type definitions */
struct __test_metadata {
  int dummy;
};
struct __fixture_variant_metadata {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ epoll35(struct __test_metadata *);
void wrapper_epoll35(struct __test_metadata *_metadata,
                     struct __fixture_variant_metadata *variant) {
  epoll35(_metadata);
}


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

x86 assembly (clang, -O2):
<wrapper_epoll35>:
jmp    1030 <epoll35@plt>

LLVM IR (-O0):
%struct.__test_metadata = type { i32 }
%struct.__fixture_variant_metadata = type { i32 }
define void @wrapper_epoll35(%struct.__test_metadata* %0, %struct.__fixture_variant_metadata* %1) {
%3 = alloca %struct.__test_metadata*
%4 = alloca %struct.__fixture_variant_metadata*
store %struct.__test_metadata* %0, %struct.__test_metadata** %3
store %struct.__fixture_variant_metadata* %1, %struct.__fixture_variant_metadata** %4
%5 = load %struct.__test_metadata*, %struct.__test_metadata** %3
%6 = call i32 @epoll35(%struct.__test_metadata* %5)
ret void
}

LLVM IR (-O2):
%struct.__test_metadata = type { i32 }
%struct.__fixture_variant_metadata = type { i32 }
define void @wrapper_epoll35(%struct.__test_metadata* %0, %struct.__fixture_variant_metadata* nocapture readnone %1) {
%3 = tail call i32 @epoll35(%struct.__test_metadata* %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uid_t;
struct passwd {
  char *pw_name;
};

/* Variables and functions */
struct passwd *getpwuid(int /*<<< orphan*/);
char *uid_name(uid_t uid) {
  struct passwd *pw = getpwuid(uid);
  return (pw != 0) ? pw->pw_name : 0;
}


x86 assembly (clang, -O0):
<uid_name>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <getpwuid@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1142 <uid_name+0x32>
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
jmp    114d <uid_name+0x3d>
xor    %eax,%eax
mov    %rax,-0x18(%rbp)
jmp    114d <uid_name+0x3d>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uid_name>:
push   %rax
call   1030 <getpwuid@plt>
test   %rax,%rax
je     1120 <uid_name+0x10>
mov    (%rax),%rax
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.passwd = type { i8* }
define i8* @uid_name(i32 %0) {
%2 = alloca i32
%3 = alloca %struct.passwd*
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call %struct.passwd* @getpwuid(i32 %4)
store %struct.passwd* %5, %struct.passwd** %3
%6 = load %struct.passwd*, %struct.passwd** %3
%7 = icmp ne %struct.passwd* %6, null
br i1 %7, label %8, label %12
8: ; preds = %1
%9 = load %struct.passwd*, %struct.passwd** %3
%10 = getelementptr inbounds %struct.passwd, %struct.passwd* %9, i32 0, i32 0
%11 = load i8*, i8** %10
br label %13
12: ; preds = %1
br label %13
13: ; preds = %12, %8
%14 = phi i8* [ %11, %8 ], [ null, %12 ]
ret i8* %14
}

LLVM IR (-O2):
%struct.passwd = type { i8* }
define i8* @uid_name(i32 %0) {
%2 = tail call %struct.passwd* @getpwuid(i32 %0)
%3 = icmp eq %struct.passwd* %2, null
br i1 %3, label %7, label %4
4: ; preds = %1
%5 = getelementptr inbounds %struct.passwd, %struct.passwd* %2, i64 0, i32 0
%6 = load i8*, i8** %5
br label %7
7: ; preds = %1, %4
%8 = phi i8* [ %6, %4 ], [ null, %1 ]
ret i8* %8
}
/* Variables and functions */
int /*<<< orphan*/ write(int, char *, int);
void Selective_WriteCharRaw(int fd, char ch) { write(fd, &ch, 1); }


x86 assembly (clang, -O0):
<Selective_WriteCharRaw>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %edi,-0x4(%rbp)
mov    %al,-0x5(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x5(%rbp),%rsi
mov    $0x1,%edx
call   1030 <write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Selective_WriteCharRaw>:
push   %rax
mov    %sil,0x7(%rsp)
lea    0x7(%rsp),%rsi
mov    $0x1,%edx
call   1030 <write@plt>
pop    %rax
ret

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

LLVM IR (-O2):
define void @Selective_WriteCharRaw(i32 %0, i8 signext %1) {
%3 = alloca i8
store i8 %1, i8* %3
%4 = call i32 @write(i32 %0, i8* %3, i32 1)
ret void
}
void JumpToApp(void) {
  void (*fptr)(void);
  fptr = (void (*)(void))0x9D004000;
  fptr();
}


x86 assembly (clang, -O0):
<JumpToApp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x9d004000,%eax
mov    %rax,-0x8(%rbp)
call   *-0x8(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<JumpToApp>:
mov    $0x9d004000,%eax
jmp    *%rax

LLVM IR (-O0):
define void @JumpToApp() {
%1 = alloca void ()*
store void ()* inttoptr (i64 2634039296 to void ()*), void ()** %1
%2 = load void ()*, void ()** %1
ret void
}

LLVM IR (-O2):
define void @JumpToApp() {
tail call void inttoptr (i64 2634039296 to void ()*)()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ cgincind(char *, char *, int);
void cginc2pi(int v) { cgincind("bx", "add", v); }


x86 assembly (clang, -O0):
<cginc2pi>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
lea    0xedb(%rip),%rdi
lea    0xed7(%rip),%rsi
call   1030 <cgincind@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cginc2pi>:
mov    %edi,%edx
lea    0xee7(%rip),%rdi
lea    0xee3(%rip),%rsi
jmp    1030 <cgincind@plt>

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

LLVM IR (-O2):
@.str = [3 x i8] c"bx\00"
@.str.1 = [4 x i8] c"add\00"
define void @cginc2pi(i32 %0) {
%2 = tail call i32 @cgincind(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %0)
ret void
}
/* Variables and functions */
unsigned char hexToNibble(int /*<<< orphan*/);
unsigned char hexToByte(char *hex) {
  unsigned char n = hexToNibble(*hex++);
  n <<= 4;
  n += hexToNibble(*hex++);
  return n;
}


x86 assembly (clang, -O0):
<hexToByte>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%edi
call   1030 <hexToNibble@plt>
mov    %al,-0x9(%rbp)
movzbl -0x9(%rbp),%eax
shl    $0x4,%eax
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%edi
call   1030 <hexToNibble@plt>
movzbl %al,%ecx
movzbl -0x9(%rbp),%eax
add    %ecx,%eax
mov    %al,-0x9(%rbp)
movzbl -0x9(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hexToByte>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
movsbl (%rdi),%edi
call   1030 <hexToNibble@plt>
mov    %eax,%ebx
shl    $0x4,%bl
movsbl 0x1(%r14),%edi
call   1030 <hexToNibble@plt>
add    %bl,%al
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define zeroext i8 @hexToByte(i8* %0) {
%2 = alloca i8*
%3 = alloca i8
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = getelementptr inbounds i8, i8* %4, i32 1
store i8* %5, i8** %2
%6 = load i8, i8* %4
%7 = sext i8 %6 to i32
%8 = call zeroext i8 @hexToNibble(i32 %7)
store i8 %8, i8* %3
%9 = load i8, i8* %3
%10 = zext i8 %9 to i32
%11 = shl i32 %10, 4
%12 = trunc i32 %11 to i8
store i8 %12, i8* %3
%13 = load i8*, i8** %2
%14 = getelementptr inbounds i8, i8* %13, i32 1
store i8* %14, i8** %2
%15 = load i8, i8* %13
%16 = sext i8 %15 to i32
%17 = call zeroext i8 @hexToNibble(i32 %16)
%18 = zext i8 %17 to i32
%19 = load i8, i8* %3
%20 = zext i8 %19 to i32
%21 = add nsw i32 %20, %18
%22 = trunc i32 %21 to i8
store i8 %22, i8* %3
%23 = load i8, i8* %3
ret i8 %23
}

LLVM IR (-O2):
define zeroext i8 @hexToByte(i8* nocapture %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 1
%3 = load i8, i8* %0
%4 = sext i8 %3 to i32
%5 = tail call zeroext i8 @hexToNibble(i32 %4)
%6 = shl i8 %5, 4
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = tail call zeroext i8 @hexToNibble(i32 %8)
%10 = add i8 %9, %6
ret i8 %10
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ sleep(int);
int /*<<< orphan*/ stderr;
void oom(const char *msg) {
  fprintf(stderr, "%s: Out of memory\n", msg);
  fflush(stderr);
  sleep(1);
  abort();
}


x86 assembly (clang, -O0):
<oom>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2e8d(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xea0(%rip),%rsi
call   1040 <fprintf@plt>
mov    0x2e74(%rip),%rax
mov    (%rax),%edi
call   1050 <fflush@plt>
mov    $0x1,%edi
call   1060 <sleep@plt>
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<oom>:
push   %rbx
mov    %rdi,%rdx
mov    0x2e95(%rip),%rbx
mov    (%rbx),%edi
lea    0xeac(%rip),%rsi
call   1040 <fprintf@plt>
mov    (%rbx),%edi
call   1050 <fflush@plt>
mov    $0x1,%edi
call   1060 <sleep@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [19 x i8] c"%s: Out of memory\0A\00"
define void @oom(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = load i32, i32* @stderr
%7 = call i32 @fflush(i32 %6)
%8 = call i32 @sleep(i32 1)
%9 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [19 x i8] c"%s: Out of memory\0A\00"
define void @oom(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = load i32, i32* @stderr
%5 = tail call i32 @fflush(i32 %4)
%6 = tail call i32 @sleep(i32 1)
%7 = tail call i32 (...) @abort()
unreachable
}
int util_str_cmp(char *str1, char *str2) {
  while (*str1 == *(str2++)) {
    if (*(str1++) == '\0')
      return 0;
  }
  return 1;
}


x86 assembly (clang, -O0):
<util_str_cmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
mov    -0x18(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x18(%rbp)
movsbl (%rcx),%ecx
cmp    %ecx,%eax
jne    1159 <util_str_cmp+0x59>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    1154 <util_str_cmp+0x54>
movl   $0x0,-0x4(%rbp)
jmp    1160 <util_str_cmp+0x60>
jmp    110c <util_str_cmp+0xc>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @util_str_cmp(i8* nocapture %0, i8* nocapture %1) {
br label %3
3: ; preds = %9, %2
%4 = phi i8* [ %0, %2 ], [ %11, %9 ]
%5 = phi i8* [ %1, %2 ], [ %10, %9 ]
%6 = load i8, i8* %4
%7 = load i8, i8* %5
%8 = icmp eq i8 %6, %7
br i1 %8, label %9, label %13
9: ; preds = %3
%10 = getelementptr inbounds i8, i8* %5, i64 1
%11 = getelementptr inbounds i8, i8* %4, i64 1
%12 = icmp eq i8 %6, 0
br i1 %12, label %13, label %3
13: ; preds = %3, %9
%14 = phi i32 [ 0, %9 ], [ 1, %3 ]
ret i32 %14
}
void reconstructeno_set_arrays(void) {}


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

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

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

LLVM IR (-O2):
define void @reconstructeno_set_arrays() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _wrpkru(unsigned int);
void extern wrpku_test(unsigned int key) { _wrpkru(key); }


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

x86 assembly (clang, -O2):
<wrpku_test>:
jmp    1030 <_wrpkru@plt>

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

LLVM IR (-O2):
define void @wrpku_test(i32 %0) {
%2 = tail call i32 @_wrpkru(i32 %0)
ret void
}
void mm_checkheap(int verbose) {}


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

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

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

LLVM IR (-O2):
define void @mm_checkheap(i32 %0) {
ret void
}
/* Variables and functions */
int string_array_length(const char *arr[]) {
  int count = 0;
  while (arr[count] != NULL) {
    count++;
  }
  return count;
}


x86 assembly (clang, -O0):
<string_array_length>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
cmpq   $0x0,(%rax,%rcx,8)
je     1130 <string_array_length+0x30>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <string_array_length+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<string_array_length>:
mov    $0xffffffff,%eax
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%eax
cmpq   $0x0,(%rdi)
lea    0x8(%rdi),%rdi
jne    1110 <string_array_length+0x10>
ret

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

LLVM IR (-O2):
define i32 @string_array_length(i8** nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ %7, %2 ], [ 0, %1 ]
%4 = getelementptr inbounds i8*, i8** %0, i64 %3
%5 = load i8*, i8** %4
%6 = icmp eq i8* %5, null
%7 = add nuw i64 %3, 1
br i1 %6, label %8, label %2
8: ; preds = %2
%9 = trunc i64 %3 to i32
ret i32 %9
}
int main() {
  int i = 5;
  if (__builtin_expect(i, 5)) {
    return 0;
  } else {
  ERROR:
    return 1;
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x5,-0x8(%rbp)
movslq -0x8(%rbp),%rax
cmp    $0x0,%rax
je     112c <main+0x2c>
movl   $0x0,-0x4(%rbp)
jmp    1138 <main+0x38>
jmp    1131 <main+0x31>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%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
store i32 0, i32* %1
store i32 5, i32* %2
%3 = load i32, i32* %2
%4 = sext i32 %3 to i64
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %0
store i32 0, i32* %1
br label %9
7: ; preds = %0
br label %8
8: ; preds = %7
store i32 1, i32* %1
br label %9
9: ; preds = %8, %6
%10 = load i32, i32* %1
ret i32 %10
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}