xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
void *malloc(int);
void *amalloc(int size) {
  void *p;
  void *pp;
  uint32_t *h;
  p = malloc(size + 8);
  if (((uint32_t)p & 0x3) == 0x0)
    h = (uint32_t *)p;
  else
    h = (uint32_t *)(((uint32_t)p & 0xfffffffc) + 4);
  *h = (uint32_t)p & 3;
  pp = (void *)(h + 1);
  return pp;
}


x86 assembly (clang, -O0):
<amalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
add    $0x8,%edi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
and    $0x3,%eax
cmp    $0x0,%eax
jne    1147 <amalloc+0x37>
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
jmp    1157 <amalloc+0x47>
mov    -0x10(%rbp),%rax
and    $0xfffffffc,%eax
add    $0x4,%eax
mov    %eax,%eax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    %eax,%ecx
and    $0x3,%ecx
mov    -0x20(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x20(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<amalloc>:
push   %rax
add    $0x8,%edi
call   1030 <malloc@plt>
lea    0x4(%rax),%ecx
and    $0xfffffffc,%ecx
mov    %eax,%edx
and    $0x3,%edx
cmovne %rcx,%rax
mov    %edx,(%rax)
add    $0x4,%rax
pop    %rcx
ret

LLVM IR (-O0):
define i8* @amalloc(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32*
store i32 %0, i32* %2
%6 = load i32, i32* %2
%7 = add nsw i32 %6, 8
%8 = call i8* @malloc(i32 %7)
store i8* %8, i8** %3
%9 = load i8*, i8** %3
%10 = ptrtoint i8* %9 to i32
%11 = and i32 %10, 3
%12 = icmp eq i32 %11, 0
br i1 %12, label %13, label %16
13: ; preds = %1
%14 = load i8*, i8** %3
%15 = bitcast i8* %14 to i32*
store i32* %15, i32** %5
br label %23
16: ; preds = %1
%17 = load i8*, i8** %3
%18 = ptrtoint i8* %17 to i32
%19 = and i32 %18, -4
%20 = add i32 %19, 4
%21 = zext i32 %20 to i64
%22 = inttoptr i64 %21 to i32*
store i32* %22, i32** %5
br label %23
23: ; preds = %16, %13
%24 = load i8*, i8** %3
%25 = ptrtoint i8* %24 to i32
%26 = and i32 %25, 3
%27 = load i32*, i32** %5
store i32 %26, i32* %27
%28 = load i32*, i32** %5
%29 = getelementptr inbounds i32, i32* %28, i64 1
%30 = bitcast i32* %29 to i8*
store i8* %30, i8** %4
%31 = load i8*, i8** %4
ret i8* %31
}

LLVM IR (-O2):
define i8* @amalloc(i32 %0) {
%2 = add nsw i32 %0, 8
%3 = tail call i8* @malloc(i32 %2)
%4 = ptrtoint i8* %3 to i64
%5 = trunc i64 %4 to i32
%6 = and i32 %5, 3
%7 = icmp eq i32 %6, 0
%8 = bitcast i8* %3 to i32*
%9 = add i64 %4, 4
%10 = and i64 %9, 4294967292
%11 = inttoptr i64 %10 to i32*
%12 = select i1 %7, i32* %8, i32* %11
store i32 %6, i32* %12
%13 = getelementptr inbounds i32, i32* %12, i64 1
%14 = bitcast i32* %13 to i8*
ret i8* %14
}
/* Variables and functions */
int /*<<< orphan*/ UART_PutChar(char);
void dh_putc(char ch) { UART_PutChar((char)ch); }


x86 assembly (clang, -O0):
<dh_putc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edi
call   1030 <UART_PutChar@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dh_putc>:
jmp    1030 <UART_PutChar@plt>

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

LLVM IR (-O2):
define void @dh_putc(i8 signext %0) {
%2 = tail call i32 @UART_PutChar(i8 signext %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
void type_crash(int a, short b, char c, unsigned long d, float f, double g) {
  int la;
  short lb;
  char lc;
  long ld;
  float lf;
  double lg;
  long ll;
  la = a;
  lb = b;
  lc = c;
  ld = ld;
  lf = lf;
  lg = lg;
  assert(0);
}


x86 assembly (clang, -O0):
<type_crash>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %dl,%al
mov    %si,%dx
mov    %edi,-0x4(%rbp)
mov    %dx,-0x6(%rbp)
mov    %al,-0x7(%rbp)
mov    %rcx,-0x10(%rbp)
movss  %xmm0,-0x14(%rbp)
movsd  %xmm1,-0x20(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0x6(%rbp),%ax
mov    %ax,-0x26(%rbp)
mov    -0x7(%rbp),%al
mov    %al,-0x27(%rbp)
mov    -0x30(%rbp),%rax
mov    %rax,-0x30(%rbp)
movss  -0x34(%rbp),%xmm0
movss  %xmm0,-0x34(%rbp)
movsd  -0x40(%rbp),%xmm0
movsd  %xmm0,-0x40(%rbp)
xor    %edi,%edi
call   1030 <assert@plt>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<type_crash>:
xor    %edi,%edi
jmp    1030 <assert@plt>

LLVM IR (-O0):
define void @type_crash(i32 %0, i16 signext %1, i8 signext %2, i64 %3, float %4, double %5) {
%7 = alloca i32
%8 = alloca i16
%9 = alloca i8
%10 = alloca i64
%11 = alloca float
%12 = alloca double
%13 = alloca i32
%14 = alloca i16
%15 = alloca i8
%16 = alloca i64
%17 = alloca float
%18 = alloca double
%19 = alloca i64
store i32 %0, i32* %7
store i16 %1, i16* %8
store i8 %2, i8* %9
store i64 %3, i64* %10
store float %4, float* %11
store double %5, double* %12
%20 = load i32, i32* %7
store i32 %20, i32* %13
%21 = load i16, i16* %8
store i16 %21, i16* %14
%22 = load i8, i8* %9
store i8 %22, i8* %15
%23 = load i64, i64* %16
store i64 %23, i64* %16
%24 = load float, float* %17
store float %24, float* %17
%25 = load double, double* %18
store double %25, double* %18
%26 = call i32 @assert(i32 0)
ret void
}

LLVM IR (-O2):
define void @type_crash(i32 %0, i16 signext %1, i8 signext %2, i64 %3, float %4, double %5) {
%7 = tail call i32 @assert(i32 0)
ret void
}
/* Type definitions */
struct rlimit {
  int rlim_cur;
  int rlim_max;
};

/* Variables and functions */
int /*<<< orphan*/ error(int, int /*<<< orphan*/, char *);
scalar_t__ setrlimit(int, struct rlimit *);
void apply_rlimit(int resource, int limit) {
  struct rlimit lim;
  lim.rlim_cur = lim.rlim_max = limit;
  if (setrlimit(resource, &lim) != 0)
    error(250, 0, "Error setting rlimit.");
}


x86 assembly (clang, -O0):
<apply_rlimit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x10(%rbp),%rsi
call   1030 <setrlimit@plt>
cmp    $0x0,%rax
je     1160 <apply_rlimit+0x40>
mov    $0xfa,%edi
xor    %esi,%esi
lea    0xea5(%rip),%rdx
call   1040 <error@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<apply_rlimit>:
push   %rax
mov    %esi,0x4(%rsp)
mov    %esi,(%rsp)
mov    %rsp,%rsi
call   1030 <setrlimit@plt>
test   %rax,%rax
je     1148 <apply_rlimit+0x28>
lea    0xec4(%rip),%rdx
mov    $0xfa,%edi
xor    %esi,%esi
call   1040 <error@plt>
pop    %rax
ret

LLVM IR (-O0):
%struct.rlimit = type { i32, i32 }
@.str = [22 x i8] c"Error setting rlimit.\00"
define void @apply_rlimit(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca %struct.rlimit
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
%7 = getelementptr inbounds %struct.rlimit, %struct.rlimit* %5, i32 0, i32 1
store i32 %6, i32* %7
%8 = getelementptr inbounds %struct.rlimit, %struct.rlimit* %5, i32 0, i32 0
store i32 %6, i32* %8
%9 = load i32, i32* %3
%10 = call i64 @setrlimit(i32 %9, %struct.rlimit* %5)
%11 = icmp ne i64 %10, 0
br i1 %11, label %12, label %14
12: ; preds = %2
%13 = call i32 @error(i32 250, i32 0, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
br label %14
14: ; preds = %12, %2
ret void
}

LLVM IR (-O2):
%struct.rlimit = type { i32, i32 }
@.str = [22 x i8] c"Error setting rlimit.\00"
define void @apply_rlimit(i32 %0, i32 %1) {
%3 = alloca %struct.rlimit
%4 = bitcast %struct.rlimit* %3 to i8*
%5 = getelementptr inbounds %struct.rlimit, %struct.rlimit* %3, i64 0, i32 1
store i32 %1, i32* %5
%6 = getelementptr inbounds %struct.rlimit, %struct.rlimit* %3, i64 0, i32 0
store i32 %1, i32* %6
%7 = call i64 @setrlimit(i32 %0, %struct.rlimit* %3)
%8 = icmp eq i64 %7, 0
br i1 %8, label %11, label %9
9: ; preds = %2
%10 = call i32 @error(i32 250, i32 0, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
br label %11
11: ; preds = %9, %2
ret void
}
int do_signbit_kf(__float128 *a) { return __builtin_signbit(*a); }


x86 assembly (clang, -O0):
<do_signbit_kf>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%rax
shr    $0x3f,%rax
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_signbit_kf>:
mov    0x8(%rdi),%rax
shr    $0x3f,%rax
ret

LLVM IR (-O0):
define i32 @do_signbit_kf(fp128* %0) {
%2 = alloca fp128*
store fp128* %0, fp128** %2
%3 = load fp128*, fp128** %2
%4 = load fp128, fp128* %3
%5 = bitcast fp128 %4 to i128
%6 = icmp slt i128 %5, 0
%7 = zext i1 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @do_signbit_kf(fp128* nocapture %0) {
%2 = bitcast fp128* %0 to i128*
%3 = load i128, i128* %2
%4 = lshr i128 %3, 127
%5 = trunc i128 %4 to i32
ret i32 %5
}
void systickEnable(const unsigned int period) {
  (*((volatile unsigned int *const)(0xe000e010 + 4))) = period;
  (*((volatile unsigned int *const)(0xe000e010 + 8))) = 5;
  (*((volatile unsigned int *const)(0xe000e010 + 0))) |=
      (1 << 0) | (1 << 1) | (1 << 2);
}


x86 assembly (clang, -O0):
<systickEnable>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
mov    $0xe000e014,%eax
mov    %ecx,(%rax)
mov    $0xe000e018,%eax
movl   $0x5,(%rax)
mov    $0xe000e010,%eax
mov    (%rax),%ecx
or     $0x7,%ecx
mov    $0xe000e010,%eax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<systickEnable>:
mov    $0xe000e010,%eax
mov    %edi,0x4(%rax)
movl   $0x5,0x8(%rax)
orl    $0x7,(%rax)
ret

LLVM IR (-O0):
define void @systickEnable(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
store volatile i32 %3, i32* inttoptr (i64 3758153748 to i32*)
store volatile i32 5, i32* inttoptr (i64 3758153752 to i32*)
%4 = load volatile i32, i32* inttoptr (i64 3758153744 to i32*)
%5 = or i32 %4, 7
store volatile i32 %5, i32* inttoptr (i64 3758153744 to i32*)
ret void
}

LLVM IR (-O2):
define void @systickEnable(i32 %0) {
store volatile i32 %0, i32* inttoptr (i64 3758153748 to i32*)
store volatile i32 5, i32* inttoptr (i64 3758153752 to i32*)
%2 = load volatile i32, i32* inttoptr (i64 3758153744 to i32*)
%3 = or i32 %2, 7
store volatile i32 %3, i32* inttoptr (i64 3758153744 to i32*)
ret void
}
/* Type definitions */
typedef int uint32_t;
typedef int uint16_t;

/* Variables and functions */
uint16_t read_16_le(unsigned char bytes[2]) {
  uint32_t result = 0;
  for (int i = 2 - 1; i >= 0; i--)
    result = (result << 8) | bytes[i];
  return result;
}


x86 assembly (clang, -O0):
<read_16_le>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x1,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
jl     1145 <read_16_le+0x45>
mov    -0xc(%rbp),%eax
shl    $0x8,%eax
mov    -0x8(%rbp),%rcx
movslq -0x10(%rbp),%rdx
movzbl (%rcx,%rdx,1),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x10(%rbp)
jmp    1116 <read_16_le+0x16>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_16_le>:
movzwl (%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @read_16_le(i8* nocapture %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 1
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = shl nuw nsw i32 %4, 8
%6 = load i8, i8* %0
%7 = zext i8 %6 to i32
%8 = or i32 %5, %7
ret i32 %8
}
adr0reg1(r0, r1, x0, x1, p0, p1) unsigned short r0, r1;
unsigned short *p0, *p1;
{
  if ((*((unsigned short *)10000000)) <= r1)
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<adr0reg1>:
push   %rbp
mov    %rsp,%rbp
mov    %esi,%eax
mov    %di,%si
mov    %si,-0x6(%rbp)
mov    %ax,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8,-0x18(%rbp)
mov    %r9,-0x20(%rbp)
mov    $0x989680,%eax
movzwl (%rax),%eax
movzwl -0x8(%rbp),%ecx
cmp    %ecx,%eax
jg     113f <adr0reg1+0x3f>
movl   $0x1,-0x4(%rbp)
jmp    1146 <adr0reg1+0x46>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<adr0reg1>:
movzwl 0x989680,%ecx
movzwl %si,%edx
xor    %eax,%eax
cmp    %ecx,%edx
setae  %al
ret

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

LLVM IR (-O2):
define i32 @adr0reg1(i32 %0, i32 %1, i32 %2, i32 %3, i16* nocapture readnone %4, i16* nocapture readnone %5) {
%7 = load i16, i16* inttoptr (i64 10000000 to i16*)
%8 = zext i16 %7 to i32
%9 = and i32 %1, 65535
%10 = icmp uge i32 %9, %8
%11 = zext i1 %10 to i32
ret i32 %11
}
void Hal_hook_rd_sgnebase(void) {}


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

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

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

LLVM IR (-O2):
define void @Hal_hook_rd_sgnebase() {
ret void
}
void ft_add_test_case(char **data, char *str, char *nl) {
  data[0] = str;
  data[1] = nl;
}


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

x86 assembly (clang, -O2):
<ft_add_test_case>:
mov    %rsi,(%rdi)
mov    %rdx,0x8(%rdi)
ret

LLVM IR (-O0):
define void @ft_add_test_case(i8** %0, i8* %1, i8* %2) {
%4 = alloca i8**
%5 = alloca i8*
%6 = alloca i8*
store i8** %0, i8*** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load i8*, i8** %5
%8 = load i8**, i8*** %4
%9 = getelementptr inbounds i8*, i8** %8, i64 0
store i8* %7, i8** %9
%10 = load i8*, i8** %6
%11 = load i8**, i8*** %4
%12 = getelementptr inbounds i8*, i8** %11, i64 1
store i8* %10, i8** %12
ret void
}

LLVM IR (-O2):
define void @ft_add_test_case(i8** nocapture writeonly %0, i8* %1, i8* %2) {
store i8* %1, i8** %0
%4 = getelementptr inbounds i8*, i8** %0, i64 1
store i8* %2, i8** %4
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ sleep(int);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ stdout;
int main() {
  while (1) {
    fprintf(stdout, "hello-out");
    fprintf(stderr, "hello-err");
    sleep(1);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2ea2(%rip),%rax
mov    (%rax),%edi
lea    0xec1(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e95(%rip),%rax
mov    (%rax),%edi
lea    0xeb6(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <sleep@plt>
jmp    112f <main+0xf>

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    0x2ea9(%rip),%r15
lea    0xeca(%rip),%r14
mov    0x2ea3(%rip),%r12
lea    0xec6(%rip),%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    (%r15),%edi
mov    %r14,%rsi
call   1030 <fprintf@plt>
mov    (%r12),%edi
mov    %rbx,%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <sleep@plt>
jmp    1150 <main+0x30>

LLVM IR (-O0):
@stdout = global i32 0
@.str = [10 x i8] c"hello-out\00"
@stderr = global i32 0
@.str.1 = [10 x i8] c"hello-err\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %0, %2
%3 = load i32, i32* @stdout
%4 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%5 = load i32, i32* @stderr
%6 = call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%7 = call i32 @sleep(i32 1)
br label %2
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [10 x i8] c"hello-out\00"
@stderr = global i32 0
@.str.1 = [10 x i8] c"hello-err\00"
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = load i32, i32* @stdout
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* @stderr
%5 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%6 = tail call i32 @sleep(i32 1)
br label %1
}
/* Variables and functions */
void *dm(size_t);
void *d2(size_t n) { return dm(n); }


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

x86 assembly (clang, -O2):
<d2>:
jmp    1030 <dm@plt>

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

LLVM IR (-O2):
define i8* @d2(i64 %0) {
%2 = tail call i8* @dm(i64 %0)
ret i8* %2
}
float area(float r) {
  float a = 0.0;
  a = 3.14 * r * r;
  return a;
}


x86 assembly (clang, -O0):
<area>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xede(%rip),%xmm0
mulsd  %xmm1,%xmm0
movss  -0x4(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<area>:
cvtss2sd %xmm0,%xmm0
movsd  0xef4(%rip),%xmm1
mulsd  %xmm0,%xmm1
mulsd  %xmm0,%xmm1
xorps  %xmm0,%xmm0
cvtsd2ss %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @area(float %0) {
%2 = alloca float
%3 = alloca float
store float %0, float* %2
store float 0.000000e+00, float* %3
%4 = load float, float* %2
%5 = fpext float %4 to double
%6 = fmul double 3.140000e+00, %5
%7 = load float, float* %2
%8 = fpext float %7 to double
%9 = fmul double %6, %8
%10 = fptrunc double %9 to float
store float %10, float* %3
%11 = load float, float* %3
ret float %11
}

LLVM IR (-O2):
define float @area(float %0) {
%2 = fpext float %0 to double
%3 = fmul double %2, 3.140000e+00
%4 = fmul double %3, %2
%5 = fptrunc double %4 to float
ret float %5
}
/* Variables and functions */
char *virt_getcwd(char *, size_t, int /*<<< orphan*/);
char *getcwd(char *buf, size_t size) { return virt_getcwd(buf, size, 0); }


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

x86 assembly (clang, -O2):
<getcwd>:
xor    %edx,%edx
jmp    1030 <virt_getcwd@plt>

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

LLVM IR (-O2):
define i8* @getcwd(i8* %0, i64 %1) {
%3 = tail call i8* @virt_getcwd(i8* %0, i64 %1, i32 0)
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ free(char *);
int /*<<< orphan*/ stderr;
void *ReturnWithError(char *errorMessage, int sock, char *recvBuf) {
  fprintf(stderr, "%s\n", errorMessage);
  if (sock >= 0)
    close(sock);
  if (recvBuf)
    free(recvBuf);
  return NULL;
}


x86 assembly (clang, -O0):
<ReturnWithError>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    0x2e96(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xea9(%rip),%rsi
call   1050 <fprintf@plt>
cmpl   $0x0,-0xc(%rbp)
jl     116e <ReturnWithError+0x3e>
mov    -0xc(%rbp),%edi
call   1040 <close@plt>
cmpq   $0x0,-0x18(%rbp)
je     1182 <ReturnWithError+0x52>
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ReturnWithError>:
push   %rbp
push   %rbx
push   %rax
mov    %rdx,%rbx
mov    %esi,%ebp
mov    %rdi,%rdx
mov    0x2e9e(%rip),%rax
mov    (%rax),%edi
lea    0xeb5(%rip),%rsi
call   1050 <fprintf@plt>
test   %ebp,%ebp
js     115b <ReturnWithError+0x2b>
mov    %ebp,%edi
call   1040 <close@plt>
test   %rbx,%rbx
je     1168 <ReturnWithError+0x38>
mov    %rbx,%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
@stderr = global i32 0
@.str = [4 x i8] c"%s\0A\00"
define noalias i8* @ReturnWithError(i8* %0, i32 %1, i8* %2) {
%4 = load i32, i32* @stderr
%5 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
%6 = icmp sgt i32 %1, -1
br i1 %6, label %7, label %9
7: ; preds = %3
%8 = tail call i32 @close(i32 %1)
br label %9
9: ; preds = %7, %3
%10 = icmp eq i8* %2, null
br i1 %10, label %13, label %11
11: ; preds = %9
%12 = tail call i32 @free(i8* %2)
br label %13
13: ; preds = %11, %9
ret i8* null
}
void clear_bitvector(unsigned int idx, int *bitvec) {
  unsigned int neighbor_id = idx;
  int dword = (neighbor_id >> 5);
  int bit = neighbor_id & 0x1F;
  unsigned int current_value = bitvec[dword];
  if ((current_value & (1 << bit))) {
    bitvec[dword] = current_value ^ (1 << bit);
  }
}


x86 assembly (clang, -O0):
<clear_bitvector>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
shr    $0x5,%eax
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%eax
and    $0x1f,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x20(%rbp)
mov    -0x20(%rbp),%eax
mov    -0x1c(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
and    %ecx,%eax
cmp    $0x0,%eax
je     1165 <clear_bitvector+0x65>
mov    -0x20(%rbp),%edx
mov    -0x1c(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
xor    %eax,%edx
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
pop    %rbp
ret

x86 assembly (clang, -O2):
<clear_bitvector>:
mov    %edi,%ecx
mov    %edi,%eax
shr    $0x5,%eax
mov    (%rsi,%rax,4),%edx
mov    $0x1,%edi
shl    %cl,%edi
bt     %ecx,%edx
jae    111b <clear_bitvector+0x1b>
xor    %edi,%edx
mov    %edx,(%rsi,%rax,4)
ret

LLVM IR (-O0):
define void @clear_bitvector(i32 %0, i32* %1) {
%3 = alloca i32
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %3
store i32* %1, i32** %4
%9 = load i32, i32* %3
store i32 %9, i32* %5
%10 = load i32, i32* %5
%11 = lshr i32 %10, 5
store i32 %11, i32* %6
%12 = load i32, i32* %5
%13 = and i32 %12, 31
store i32 %13, i32* %7
%14 = load i32*, i32** %4
%15 = load i32, i32* %6
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds i32, i32* %14, i64 %16
%18 = load i32, i32* %17
store i32 %18, i32* %8
%19 = load i32, i32* %8
%20 = load i32, i32* %7
%21 = shl i32 1, %20
%22 = and i32 %19, %21
%23 = icmp ne i32 %22, 0
br i1 %23, label %24, label %33
24: ; preds = %2
%25 = load i32, i32* %8
%26 = load i32, i32* %7
%27 = shl i32 1, %26
%28 = xor i32 %25, %27
%29 = load i32*, i32** %4
%30 = load i32, i32* %6
%31 = sext i32 %30 to i64
%32 = getelementptr inbounds i32, i32* %29, i64 %31
store i32 %28, i32* %32
br label %33
33: ; preds = %24, %2
ret void
}

LLVM IR (-O2):
define void @clear_bitvector(i32 %0, i32* nocapture %1) {
%3 = lshr i32 %0, 5
%4 = and i32 %0, 31
%5 = zext i32 %3 to i64
%6 = getelementptr inbounds i32, i32* %1, i64 %5
%7 = load i32, i32* %6
%8 = shl nuw i32 1, %4
%9 = and i32 %7, %8
%10 = icmp eq i32 %9, 0
br i1 %10, label %13, label %11
11: ; preds = %2
%12 = xor i32 %7, %8
store i32 %12, i32* %6
br label %13
13: ; preds = %11, %2
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
struct tm {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ localtime_r(int /*<<< orphan*/ const *, struct tm *);
void ez_localtime_r(const time_t *_time_t, struct tm *_tm) {
  localtime_r(_time_t, _tm);
}


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

x86 assembly (clang, -O2):
<ez_localtime_r>:
jmp    1030 <localtime_r@plt>

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

LLVM IR (-O2):
%struct.tm = type { i32 }
define void @ez_localtime_r(i32* %0, %struct.tm* %1) {
%3 = tail call i32 @localtime_r(i32* %0, %struct.tm* %1)
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ ASSERT(int);
void OneWireIntDisable(uint32_t ui32Base, uint32_t ui32IntFlags) {
  ASSERT(ui32Base == 0x400B6000);
  ASSERT((ui32IntFlags & ~(0x00000001 | 0x00000002 | 0x00000010 | 0x00000004 |
                           0x00000008)) == 0);
  (*((volatile uint32_t *)(ui32Base + 0x00000100))) &= ~ui32IntFlags;
}


x86 assembly (clang, -O0):
<OneWireIntDisable>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x400b6000,-0x4(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <ASSERT@plt>
mov    -0x8(%rbp),%eax
and    $0xffffffe0,%eax
cmp    $0x0,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <ASSERT@plt>
mov    -0x8(%rbp),%edx
xor    $0xffffffff,%edx
mov    -0x4(%rbp),%eax
add    $0x100,%eax
cltq
mov    (%rax),%ecx
and    %edx,%ecx
mov    %ecx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<OneWireIntDisable>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
xor    %edi,%edi
cmp    $0x400b6000,%ebp
sete   %dil
call   1030 <ASSERT@plt>
xor    %edi,%edi
cmp    $0x20,%ebx
setb   %dil
call   1030 <ASSERT@plt>
not    %ebx
movslq %ebp,%rax
and    %ebx,0x100(%rax)
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define void @OneWireIntDisable(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 = icmp eq i32 %5, 1074487296
%7 = zext i1 %6 to i32
%8 = call i32 @ASSERT(i32 %7)
%9 = load i32, i32* %4
%10 = and i32 %9, -32
%11 = icmp eq i32 %10, 0
%12 = zext i1 %11 to i32
%13 = call i32 @ASSERT(i32 %12)
%14 = load i32, i32* %4
%15 = xor i32 %14, -1
%16 = load i32, i32* %3
%17 = add nsw i32 %16, 256
%18 = sext i32 %17 to i64
%19 = inttoptr i64 %18 to i32*
%20 = load volatile i32, i32* %19
%21 = and i32 %20, %15
store volatile i32 %21, i32* %19
ret void
}

LLVM IR (-O2):
define void @OneWireIntDisable(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, 1074487296
%4 = zext i1 %3 to i32
%5 = tail call i32 @ASSERT(i32 %4)
%6 = icmp ult i32 %1, 32
%7 = zext i1 %6 to i32
%8 = tail call i32 @ASSERT(i32 %7)
%9 = xor i32 %1, -1
%10 = add nsw i32 %0, 256
%11 = sext i32 %10 to i64
%12 = inttoptr i64 %11 to i32*
%13 = load volatile i32, i32* %12
%14 = and i32 %13, %9
store volatile i32 %14, i32* %12
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
unsigned char *md2_file(unsigned char *, int /*<<< orphan*/ *);
unsigned char *hash_file_md2(unsigned char *out, FILE *fp) {
  return md2_file(out, fp);
}


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

x86 assembly (clang, -O2):
<hash_file_md2>:
jmp    1030 <md2_file@plt>

LLVM IR (-O0):
define i8* @hash_file_md2(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 i8* @md2_file(i8* %5, i32* %6)
ret i8* %7
}

LLVM IR (-O2):
define i8* @hash_file_md2(i8* %0, i32* %1) {
%3 = tail call i8* @md2_file(i8* %0, i32* %1)
ret i8* %3
}
void XcmsCIExyYToCIEXYZ() {}


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

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

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

LLVM IR (-O2):
define void @XcmsCIExyYToCIEXYZ() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(unsigned char *, unsigned char const *, int);
void clc_init_key(unsigned char *key, const unsigned char *data, int data_len) {
  memcpy(key, data, data_len);
}


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

x86 assembly (clang, -O2):
<clc_init_key>:
jmp    1030 <memcpy@plt>

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

LLVM IR (-O2):
define void @clc_init_key(i8* %0, i8* %1, i32 %2) {
%4 = tail call i32 @memcpy(i8* %0, i8* %1, i32 %2)
ret void
}
void _vPosClose() {}


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

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

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

LLVM IR (-O2):
define void @_vPosClose() {
ret void
}
int strlength(char *c) {
  int offset = 0;
  while (*(c + offset) != '\0')
    ++offset;
  return offset;
}


x86 assembly (clang, -O0):
<strlength>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1132 <strlength+0x32>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <strlength+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @strlength(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %3
br label %4
4: ; preds = %12, %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 = sext i8 %9 to i32
%11 = icmp ne i32 %10, 0
br i1 %11, label %12, label %15
12: ; preds = %4
%13 = load i32, i32* %3
%14 = add nsw i32 %13, 1
store i32 %14, i32* %3
br label %4
15: ; preds = %4
%16 = load i32, i32* %3
ret i32 %16
}

LLVM IR (-O2):
define i32 @strlength(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, 0
%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
}
void ft_striter(char *s, void (*f)(char *)) {
  while (*s != '\0') {
    (*f)(s);
    s++;
  }
}


x86 assembly (clang, -O0):
<ft_striter>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     113b <ft_striter+0x3b>
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rdi
call   *%rax
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1110 <ft_striter+0x10>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_striter>:
push   %r14
push   %rbx
push   %rax
cmpb   $0x0,(%rdi)
je     1120 <ft_striter+0x20>
mov    %rsi,%r14
mov    %rdi,%rbx
nop
mov    %rbx,%rdi
call   *%r14
cmpb   $0x0,0x1(%rbx)
lea    0x1(%rbx),%rbx
jne    1110 <ft_striter+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define void @ft_striter(i8* %0, void (i8*)* nocapture %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %10, label %5
5: ; preds = %2, %5
%6 = phi i8* [ %7, %5 ], [ %0, %2 ]
tail call void %1(i8* %6)
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = load i8, i8* %7
%9 = icmp eq i8 %8, 0
br i1 %9, label %10, label %5
10: ; preds = %5, %2
ret void
}
/* Type definitions */
struct expr_t {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ cmd_print_recursive(struct expr_t *, int /*<<< orphan*/,
                                       int /*<<< orphan*/, int /*<<< orphan*/);
void cmd_print(struct expr_t *cmd) { cmd_print_recursive(cmd, 0, 0, 0); }


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

x86 assembly (clang, -O2):
<cmd_print>:
xor    %esi,%esi
xor    %edx,%edx
xor    %ecx,%ecx
jmp    1030 <cmd_print_recursive@plt>

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

LLVM IR (-O2):
%struct.expr_t = type { i32 }
define void @cmd_print(%struct.expr_t* %0) {
%2 = tail call i32 @cmd_print_recursive(%struct.expr_t* %0, i32 0, i32 0, i32 0)
ret void
}
/* Variables and functions */
int snprintf(char *, size_t, char *, char *, char const *, char const *);
extern int fixture(char *buff, size_t n, const char *type, const char *file) {
  return snprintf(buff, n, "%s/%s/%s", "../fixtures", type, file);
}


x86 assembly (clang, -O0):
<fixture>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%r8
mov    -0x20(%rbp),%r9
lea    0xec1(%rip),%rdx
lea    0xec3(%rip),%rcx
call   1030 <snprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fixture>:
mov    %rcx,%r9
mov    %rdx,%r8
lea    0xee3(%rip),%rdx
lea    0xee5(%rip),%rcx
jmp    1030 <snprintf@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"%s/%s/%s\00"
@.str.1 = [12 x i8] c"../fixtures\00"
define i32 @fixture(i8* %0, i64 %1, i8* %2, i8* %3) {
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i8*
%8 = alloca i8*
store i8* %0, i8** %5
store i64 %1, i64* %6
store i8* %2, i8** %7
store i8* %3, i8** %8
%9 = load i8*, i8** %5
%10 = load i64, i64* %6
%11 = load i8*, i8** %7
%12 = load i8*, i8** %8
%13 = call i32 @snprintf(i8* %9, i64 %10, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i8* %11, i8* %12)
ret i32 %13
}

LLVM IR (-O2):
@.str = [9 x i8] c"%s/%s/%s\00"
@.str.1 = [12 x i8] c"../fixtures\00"
define i32 @fixture(i8* %0, i64 %1, i8* %2, i8* %3) {
%5 = tail call i32 @snprintf(i8* %0, i64 %1, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i8* %2, i8* %3)
ret i32 %5
}
int test(int i) {
  for (int n = 2; n < i; n++) {
    if (i % n == 0) {
      return 0;
    }
  }
  return 1;
}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
movl   $0x2,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1149 <test+0x49>
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
cmp    $0x0,%edx
jne    1136 <test+0x36>
movl   $0x0,-0x4(%rbp)
jmp    1150 <test+0x50>
jmp    113b <test+0x3b>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110e <test+0xe>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test>:
mov    $0x1,%eax
cmp    $0x3,%edi
jl     1139 <test+0x39>
xor    %eax,%eax
test   $0x1,%dil
je     1139 <test+0x39>
mov    $0x3,%eax
nopw   0x0(%rax,%rax,1)
mov    %eax,%ecx
cmp    %eax,%edi
je     1132 <test+0x32>
mov    %edi,%eax
cltd
idiv   %ecx
lea    0x1(%rcx),%eax
test   %edx,%edx
jne    1120 <test+0x20>
xor    %eax,%eax
cmp    %edi,%ecx
setge  %al
ret

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

LLVM IR (-O2):
define i32 @test(i32 %0) {
%2 = icmp sgt i32 %0, 2
br i1 %2, label %3, label %16
3: ; preds = %1
%4 = and i32 %0, 1
%5 = icmp eq i32 %4, 0
br i1 %5, label %16, label %6
6: ; preds = %3, %9
%7 = phi i32 [ %12, %9 ], [ 3, %3 ]
%8 = icmp eq i32 %7, %0
br i1 %8, label %13, label %9
9: ; preds = %6
%10 = srem i32 %0, %7
%11 = icmp eq i32 %10, 0
%12 = add nuw nsw i32 %7, 1
br i1 %11, label %13, label %6
13: ; preds = %6, %9
%14 = icmp sge i32 %7, %0
%15 = zext i1 %14 to i32
br label %16
16: ; preds = %13, %3, %1
%17 = phi i32 [ 1, %1 ], [ 0, %3 ], [ %15, %13 ]
ret i32 %17
}
/* Variables and functions */
unsigned char *__ziplistDelete(unsigned char *, unsigned char *, int);
unsigned char *ziplistDelete(unsigned char *zl, unsigned char **p) {
  size_t offset = *p - zl;
  zl = __ziplistDelete(zl, *p, 1);
  *p = zl + offset;
  return zl;
}


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

x86 assembly (clang, -O2):
<ziplistDelete>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    (%rsi),%rsi
mov    %rsi,%rbx
sub    %rdi,%rbx
mov    $0x1,%edx
call   1030 <__ziplistDelete@plt>
add    %rax,%rbx
mov    %rbx,(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @ziplistDelete(i8* %0, i8** nocapture %1) {
%3 = load i8*, i8** %1
%4 = ptrtoint i8* %3 to i64
%5 = ptrtoint i8* %0 to i64
%6 = sub i64 %4, %5
%7 = tail call i8* @__ziplistDelete(i8* %0, i8* %3, i32 1)
%8 = getelementptr inbounds i8, i8* %7, i64 %6
store i8* %8, i8** %1
ret i8* %7
}
int test_imm_03uint16_mem(unsigned short *val) {
  return ((*val) & (-0x03 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_03uint16_mem>:
movzwl (%rdi),%eax
test   $0xfffd,%eax
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_03uint16_mem(i16* %0) {
%2 = alloca i16*
store i16* %0, i16** %2
%3 = load i16*, i16** %2
%4 = load i16, i16* %3
%5 = zext i16 %4 to i32
%6 = and i32 %5, -3
%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_03uint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, -3
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
char *ft_strchar(const char *s1, const char *s2) {
  char *temp;
  while (*s2) {
    if ((temp = ft_strchr(s1, *s2)))
      return (temp);
    s2++;
  }
  return (((void *)0));
}


x86 assembly (clang, -O0):
<ft_strchar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmpb   $0x0,(%rax)
je     116d <ft_strchar+0x5d>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rax
movsbl (%rax),%esi
mov    $0x0,%al
call   1030 <ft_strchr@plt>
cltq
mov    %rax,-0x20(%rbp)
cmp    $0x0,%rax
je     115c <ft_strchar+0x4c>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1175 <ft_strchar+0x65>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1120 <ft_strchar+0x10>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_strchar>:
push   %r15
push   %r14
push   %rbx
mov    (%rsi),%al
test   %al,%al
je     114e <ft_strchar+0x3e>
mov    %rsi,%rbx
mov    %rdi,%r15
add    $0x1,%rbx
xor    %r14d,%r14d
nopl   0x0(%rax,%rax,1)
movsbl %al,%esi
mov    %r15,%rdi
xor    %eax,%eax
call   1030 <ft_strchr@plt>
test   %eax,%eax
jne    1153 <ft_strchar+0x43>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1130 <ft_strchar+0x20>
jmp    1156 <ft_strchar+0x46>
xor    %r14d,%r14d
jmp    1156 <ft_strchar+0x46>
movslq %eax,%r14
mov    %r14,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i8* @ft_strchar(i8* %0, i8* nocapture %1) {
%3 = load i8, i8* %1
%4 = icmp eq i8 %3, 0
br i1 %4, label %18, label %8
5: ; preds = %8
%6 = load i8, i8* %14
%7 = icmp eq i8 %6, 0
br i1 %7, label %18, label %8
8: ; preds = %2, %5
%9 = phi i8 [ %6, %5 ], [ %3, %2 ]
%10 = phi i8* [ %14, %5 ], [ %1, %2 ]
%11 = sext i8 %9 to i32
%12 = tail call i32 (i8*, i32, ...) bitcast (i32 (...)* @ft_strchr to i32 (i8*, i32, ...)*)(i8* %0, i32 %11)
%13 = icmp eq i32 %12, 0
%14 = getelementptr inbounds i8, i8* %10, i64 1
br i1 %13, label %5, label %15
15: ; preds = %8
%16 = sext i32 %12 to i64
%17 = inttoptr i64 %16 to i8*
br label %18
18: ; preds = %5, %2, %15
%19 = phi i8* [ %17, %15 ], [ null, %2 ], [ null, %5 ]
ret i8* %19
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ ffrprt(int /*<<< orphan*/, int);
int /*<<< orphan*/ stderr;
void printerror(int status) {
  if (status) {
    ffrprt(stderr, status);
    exit(status);
  }
  return;
}


x86 assembly (clang, -O0):
<printerror>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     114e <printerror+0x2e>
mov    0x2ea4(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%esi
call   1030 <ffrprt@plt>
mov    -0x4(%rbp),%edi
call   1040 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printerror>:
test   %edi,%edi
jne    1125 <printerror+0x5>
ret
push   %rbx
mov    %edi,%ebx
mov    0x2eb1(%rip),%rax
mov    (%rax),%edi
mov    %ebx,%esi
call   1030 <ffrprt@plt>
mov    %ebx,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
define void @printerror(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 %11
5: ; preds = %1
%6 = load i32, i32* @stderr
%7 = load i32, i32* %2
%8 = call i32 @ffrprt(i32 %6, i32 %7)
%9 = load i32, i32* %2
%10 = call i32 @exit(i32 %9)
unreachable
11: ; preds = %1
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
define void @printerror(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %7, label %3
3: ; preds = %1
%4 = load i32, i32* @stderr
%5 = tail call i32 @ffrprt(i32 %4, i32 %0)
%6 = tail call i32 @exit(i32 %0)
unreachable
7: ; preds = %1
ret void
}