xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ isprint(int);
void t_isprint_0x24() {
  Assert_real((isprint(36)),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isprint.c",
              185, ("isprint should be 1 for $"));
}


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

x86 assembly (clang, -O2):
<t_isprint_0x24>:
push   %rax
mov    $0x24,%edi
call   1030 <isprint@plt>
lea    0xece(%rip),%rsi
lea    0xf6f(%rip),%rcx
mov    %eax,%edi
mov    $0xb9,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isprint.c\00"
@.str.1 = [26 x i8] c"isprint should be 1 for $\00"
define void @t_isprint_0x24() {
%1 = call i32 @isprint(i32 36)
%2 = call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 185, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isprint.c\00"
@.str.1 = [26 x i8] c"isprint should be 1 for $\00"
define void @t_isprint_0x24() {
%1 = tail call i32 @isprint(i32 36)
%2 = tail call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 185, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ mcp2515_set_msg(int /*<<< orphan*/, int /*<<< orphan*/,
                                   int /*<<< orphan*/ const *,
                                   int /*<<< orphan*/, int);
void mcp2515_set_msg_ext(uint8_t tx_buf, uint32_t id, const uint8_t *data,
                         uint8_t len) {
  mcp2515_set_msg(tx_buf, id, data, len, 1);
}


x86 assembly (clang, -O0):
<mcp2515_set_msg_ext>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0x10(%rbp),%rdx
mov    -0x14(%rbp),%ecx
mov    $0x1,%r8d
call   1030 <mcp2515_set_msg@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mcp2515_set_msg_ext>:
mov    $0x1,%r8d
jmp    1030 <mcp2515_set_msg@plt>

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

LLVM IR (-O2):
define void @mcp2515_set_msg_ext(i32 %0, i32 %1, i32* %2, i32 %3) {
%5 = tail call i32 @mcp2515_set_msg(i32 %0, i32 %1, i32* %2, i32 %3, i32 1)
ret void
}
/* Forward declarations */
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  int /*<<< orphan*/ r_info;
};
typedef TYPE_1__ Elf32_Rel;

/* Variables and functions */
int ELF32_R_TYPE(int /*<<< orphan*/);
int /*<<< orphan*/ w(int /*<<< orphan*/);
int arm_is_fake_mcount(Elf32_Rel const *rp) {
  switch (ELF32_R_TYPE(w(rp->r_info))) {
  case 10:
  case 28:
  case 1:
    return 0;
  }
  return 1;
}


x86 assembly (clang, -O0):
<arm_is_fake_mcount>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%edi
call   1040 <w@plt>
mov    %eax,%edi
call   1030 <ELF32_R_TYPE@plt>
mov    %eax,%ecx
mov    %ecx,-0x14(%rbp)
sub    $0x1,%eax
je     1173 <arm_is_fake_mcount+0x53>
jmp    1151 <arm_is_fake_mcount+0x31>
mov    -0x14(%rbp),%eax
sub    $0xa,%eax
je     1173 <arm_is_fake_mcount+0x53>
jmp    1162 <arm_is_fake_mcount+0x42>
mov    -0x14(%rbp),%eax
sub    $0x1c,%eax
jne    117f <arm_is_fake_mcount+0x5f>
jmp    1173 <arm_is_fake_mcount+0x53>
movl   $0x0,-0x4(%rbp)
jmp    1186 <arm_is_fake_mcount+0x66>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<arm_is_fake_mcount>:
push   %rax
mov    (%rdi),%edi
call   1040 <w@plt>
mov    %eax,%edi
call   1030 <ELF32_R_TYPE@plt>
cmp    $0x1c,%eax
ja     1144 <arm_is_fake_mcount+0x24>
mov    %eax,%ecx
xor    %eax,%eax
mov    $0x10000402,%edx
bt     %ecx,%edx
jae    1144 <arm_is_fake_mcount+0x24>
pop    %rcx
ret
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.TYPE_3__ = type { i32 }
define i32 @arm_is_fake_mcount(%struct.TYPE_3__* %0) {
%2 = alloca i32
%3 = alloca %struct.TYPE_3__*
store %struct.TYPE_3__* %0, %struct.TYPE_3__** %3
%4 = load %struct.TYPE_3__*, %struct.TYPE_3__** %3
%5 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %4, i32 0, i32 0
%6 = load i32, i32* %5
%7 = call i32 @w(i32 %6)
%8 = call i32 @ELF32_R_TYPE(i32 %7)
switch i32 %8, label %10 [
i32 10, label %9
i32 28, label %9
i32 1, label %9
]
9: ; preds = %1, %1, %1
store i32 0, i32* %2
br label %11
10: ; preds = %1
store i32 1, i32* %2
br label %11
11: ; preds = %10, %9
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
%struct.TYPE_3__ = type { i32 }
define i32 @arm_is_fake_mcount(%struct.TYPE_3__* nocapture %0) {
%2 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %0, i64 0, i32 0
%3 = load i32, i32* %2
%4 = tail call i32 @w(i32 %3)
%5 = tail call i32 @ELF32_R_TYPE(i32 %4)
switch i32 %5, label %6 [
i32 10, label %7
i32 28, label %7
i32 1, label %7
]
6: ; preds = %1
br label %7
7: ; preds = %1, %1, %1, %6
%8 = phi i32 [ 1, %6 ], [ 0, %1 ], [ 0, %1 ], [ 0, %1 ]
ret i32 %8
}
/* Variables and functions */
int umath_double_cos(double);
double umath_double_sec(double x) { return 1 / umath_double_cos(x); }


x86 assembly (clang, -O0):
<umath_double_sec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <umath_double_cos@plt>
mov    %eax,%ecx
mov    $0x1,%eax
cltd
idiv   %ecx
cvtsi2sd %eax,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<umath_double_sec>:
push   %rax
call   1030 <umath_double_cos@plt>
lea    0x1(%rax),%ecx
xor    %edx,%edx
cmp    $0x3,%ecx
cmovb  %eax,%edx
xorps  %xmm0,%xmm0
cvtsi2sd %edx,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @umath_double_sec(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call i32 @umath_double_cos(double %3)
%5 = sdiv i32 1, %4
%6 = sitofp i32 %5 to double
ret double %6
}

LLVM IR (-O2):
define double @umath_double_sec(double %0) {
%2 = tail call i32 @umath_double_cos(double %0)
%3 = add i32 %2, 1
%4 = icmp ult i32 %3, 3
%5 = select i1 %4, i32 %2, i32 0
%6 = sitofp i32 %5 to double
ret double %6
}
int sgs_isoneof(int chr, const char *str) {
  while (*str) {
    if (*str == chr)
      return 1;
    str++;
  }
  return 0;
}


x86 assembly (clang, -O0):
<sgs_isoneof>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1145 <sgs_isoneof+0x45>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    -0x8(%rbp),%eax
jne    1134 <sgs_isoneof+0x34>
movl   $0x1,-0x4(%rbp)
jmp    114c <sgs_isoneof+0x4c>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    110b <sgs_isoneof+0xb>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sgs_isoneof>:
mov    (%rsi),%cl
xor    %eax,%eax
test   %cl,%cl
je     1122 <sgs_isoneof+0x22>
add    $0x1,%rsi
nopl   0x0(%rax)
movsbl %cl,%ecx
cmp    %edi,%ecx
je     1123 <sgs_isoneof+0x23>
movzbl (%rsi),%ecx
add    $0x1,%rsi
test   %cl,%cl
jne    1110 <sgs_isoneof+0x10>
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @sgs_isoneof(i32 %0, i8* nocapture %1) {
%3 = load i8, i8* %1
%4 = icmp eq i8 %3, 0
br i1 %4, label %14, label %8
5: ; preds = %8
%6 = load i8, i8* %13
%7 = icmp eq i8 %6, 0
br i1 %7, label %14, label %8
8: ; preds = %2, %5
%9 = phi i8 [ %6, %5 ], [ %3, %2 ]
%10 = phi i8* [ %13, %5 ], [ %1, %2 ]
%11 = sext i8 %9 to i32
%12 = icmp eq i32 %11, %0
%13 = getelementptr inbounds i8, i8* %10, i64 1
br i1 %12, label %14, label %5
14: ; preds = %8, %5, %2
%15 = phi i32 [ 0, %2 ], [ 0, %5 ], [ 1, %8 ]
ret i32 %15
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ perror(int /*<<< orphan*/ *);
void *realloc(void *, size_t);
void *xrealloc(void *ptr, size_t size) {
  void *p = realloc(ptr, size);
  if (p == NULL) {
    perror(NULL);
    exit(EXIT_FAILURE);
  }
  return p;
}


x86 assembly (clang, -O0):
<xrealloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <realloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1173 <xrealloc+0x43>
xor    %eax,%eax
mov    %eax,%edi
call   1040 <perror@plt>
mov    0x2e74(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrealloc>:
push   %rax
call   1030 <realloc@plt>
test   %rax,%rax
je     113d <xrealloc+0xd>
pop    %rcx
ret
xor    %edi,%edi
call   1040 <perror@plt>
mov    0x2e95(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@EXIT_FAILURE = global i32 0
define i8* @xrealloc(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i8*
store i8* %0, i8** %3
store i64 %1, i64* %4
%6 = load i8*, i8** %3
%7 = load i64, i64* %4
%8 = call i8* @realloc(i8* %6, i64 %7)
store i8* %8, i8** %5
%9 = load i8*, i8** %5
%10 = icmp eq i8* %9, null
br i1 %10, label %11, label %15
11: ; preds = %2
%12 = call i32 @perror(i32* null)
%13 = load i32, i32* @EXIT_FAILURE
%14 = call i32 @exit(i32 %13)
unreachable
15: ; preds = %2
%16 = load i8*, i8** %5
ret i8* %16
}

LLVM IR (-O2):
@EXIT_FAILURE = global i32 0
define noalias i8* @xrealloc(i8* nocapture %0, i64 %1) {
%3 = tail call i8* @realloc(i8* %0, i64 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %9
5: ; preds = %2
%6 = tail call i32 @perror(i32* null)
%7 = load i32, i32* @EXIT_FAILURE
%8 = tail call i32 @exit(i32 %7)
unreachable
9: ; preds = %2
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ updateYoungObject(int *);
void updateYoungObjectsPhase(int *spaceStart, int *spaceEnd) {
  int *position = spaceStart;
  while (position < spaceEnd) {
    updateYoungObject(position);
    position += *position;
  }
}


x86 assembly (clang, -O0):
<updateYoungObjectsPhase>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x10(%rbp),%rax
jae    115c <updateYoungObjectsPhase+0x4c>
mov    -0x18(%rbp),%rdi
call   1030 <updateYoungObject@plt>
mov    -0x18(%rbp),%rax
mov    (%rax),%ecx
mov    -0x18(%rbp),%rax
movslq %ecx,%rcx
shl    $0x2,%rcx
add    %rcx,%rax
mov    %rax,-0x18(%rbp)
jmp    1128 <updateYoungObjectsPhase+0x18>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<updateYoungObjectsPhase>:
push   %r14
push   %rbx
push   %rax
cmp    %rsi,%rdi
jae    1134 <updateYoungObjectsPhase+0x24>
mov    %rsi,%r14
mov    %rdi,%rbx
nop
mov    %rbx,%rdi
call   1030 <updateYoungObject@plt>
movslq (%rbx),%rax
lea    (%rbx,%rax,4),%rbx
cmp    %r14,%rbx
jb     1120 <updateYoungObjectsPhase+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define void @updateYoungObjectsPhase(i32* %0, i32* readnone %1) {
%3 = icmp ult i32* %0, %1
br i1 %3, label %4, label %11
4: ; preds = %2, %4
%5 = phi i32* [ %9, %4 ], [ %0, %2 ]
%6 = tail call i32 @updateYoungObject(i32* %5)
%7 = load i32, i32* %5
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i32, i32* %5, i64 %8
%10 = icmp ult i32* %9, %1
br i1 %10, label %4, label %11
11: ; preds = %4, %2
ret void
}
/* Variables and functions */
long double sinl(long double);
long double libm_sinl(long double x) { return sinl(x); }


x86 assembly (clang, -O0):
<libm_sinl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
call   1030 <sinl@plt>
fld    %st(0)
fstp   %st(0)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<libm_sinl>:
jmp    1030 <sinl@plt>

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

LLVM IR (-O2):
define x86_fp80 @libm_sinl(x86_fp80 %0) {
%2 = tail call x86_fp80 @sinl(x86_fp80 %0)
ret x86_fp80 %2
}
/* Variables and functions */
void *xcalloc(size_t, size_t);
void *counted_xcalloc(size_t nmemb, size_t size, unsigned long long *counter) {
  if (size == 0 || nmemb == 0) {
    return NULL;
  }
  if (counter != NULL) {
    (*counter) += (size * nmemb);
  }
  return xcalloc(nmemb, size);
}


x86 assembly (clang, -O0):
<counted_xcalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     113a <counted_xcalloc+0x2a>
cmpq   $0x0,-0x10(%rbp)
jne    1147 <counted_xcalloc+0x37>
movq   $0x0,-0x8(%rbp)
jmp    1176 <counted_xcalloc+0x66>
cmpq   $0x0,-0x20(%rbp)
je     1165 <counted_xcalloc+0x55>
mov    -0x18(%rbp),%rcx
imul   -0x10(%rbp),%rcx
mov    -0x20(%rbp),%rax
add    (%rax),%rcx
mov    %rcx,(%rax)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <xcalloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<counted_xcalloc>:
test   %rdi,%rdi
je     112e <counted_xcalloc+0x1e>
test   %rsi,%rsi
je     112e <counted_xcalloc+0x1e>
test   %rdx,%rdx
je     1129 <counted_xcalloc+0x19>
mov    %rsi,%rax
imul   %rdi,%rax
add    %rax,(%rdx)
jmp    1030 <xcalloc@plt>
xor    %eax,%eax
ret

LLVM IR (-O0):
define i8* @counted_xcalloc(i64 %0, i64 %1, i64* %2) {
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i64
%7 = alloca i64*
store i64 %0, i64* %5
store i64 %1, i64* %6
store i64* %2, i64** %7
%8 = load i64, i64* %6
%9 = icmp eq i64 %8, 0
br i1 %9, label %13, label %10
10: ; preds = %3
%11 = load i64, i64* %5
%12 = icmp eq i64 %11, 0
br i1 %12, label %13, label %14
13: ; preds = %10, %3
store i8* null, i8** %4
br label %28
14: ; preds = %10
%15 = load i64*, i64** %7
%16 = icmp ne i64* %15, null
br i1 %16, label %17, label %24
17: ; preds = %14
%18 = load i64, i64* %6
%19 = load i64, i64* %5
%20 = mul i64 %18, %19
%21 = load i64*, i64** %7
%22 = load i64, i64* %21
%23 = add i64 %22, %20
store i64 %23, i64* %21
br label %24
24: ; preds = %17, %14
%25 = load i64, i64* %5
%26 = load i64, i64* %6
%27 = call i8* @xcalloc(i64 %25, i64 %26)
store i8* %27, i8** %4
br label %28
28: ; preds = %24, %13
%29 = load i8*, i8** %4
ret i8* %29
}

LLVM IR (-O2):
define i8* @counted_xcalloc(i64 %0, i64 %1, i64* %2) {
%4 = icmp eq i64 %1, 0
%5 = icmp eq i64 %0, 0
%6 = or i1 %5, %4
br i1 %6, label %15, label %7
7: ; preds = %3
%8 = icmp eq i64* %2, null
br i1 %8, label %13, label %9
9: ; preds = %7
%10 = mul i64 %1, %0
%11 = load i64, i64* %2
%12 = add i64 %11, %10
store i64 %12, i64* %2
br label %13
13: ; preds = %9, %7
%14 = tail call i8* @xcalloc(i64 %0, i64 %1)
br label %15
15: ; preds = %3, %13
%16 = phi i8* [ %14, %13 ], [ null, %3 ]
ret i8* %16
}
int main(int argc, char **argv) {
  if (0x123456789ABCDEF0 == 1311768467463790320)
    return 42;
  else
    return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
ret i32 42
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int display_msg(char *msg) {
  printf("<html><head><title>login error</title><meta 		"
         "http-equiv='Content-Type' content='text/html;		"
         "charset=utf-8'/>");
  printf("<body><div width=900px><div align=center><p><p><p>		"
         "<h1>%s<h1><br><p><p>",
         msg);
  printf("</div></body></html>\n");
  return 0;
}


x86 assembly (clang, -O0):
<display_msg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rsi
lea    0xf39(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf74(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<display_msg>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xf35(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xf6d(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [110 x i8] c"<html><head><title>login error</title><meta \09\09http-equiv='Content-Type' content='text/html;\09\09charset=utf-8'/>\00"
@.str.1 = [73 x i8] c"<body><div width=900px><div align=center><p><p><p>\09\09<h1>%s<h1><br><p><p>\00"
@.str.2 = [22 x i8] c"</div></body></html>\0A\00"
define i32 @display_msg(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([110 x i8], [110 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([73 x i8], [73 x i8]* @.str.1, i64 0, i64 0), i8* %4)
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [110 x i8] c"<html><head><title>login error</title><meta \09\09http-equiv='Content-Type' content='text/html;\09\09charset=utf-8'/>\00"
@.str.1 = [73 x i8] c"<body><div width=900px><div align=center><p><p><p>\09\09<h1>%s<h1><br><p><p>\00"
@str = [21 x i8] c"</div></body></html>\00"
define i32 @display_msg(i8* %0) {
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([110 x i8], [110 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([73 x i8], [73 x i8]* @.str.1, i64 0, i64 0), i8* %0)
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void sig_int(int signo) { printf("interrupt\n%% "); }


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

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

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

LLVM IR (-O2):
@.str = [14 x i8] c"interrupt\0A%% \00"
define void @sig_int(i32 %0) {
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
size_t fmt_ulong_base(char *, unsigned long, int);
size_t fmt_ulong(char *ptr, unsigned long val) {
  return fmt_ulong_base(ptr, val, 10);
}


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

x86 assembly (clang, -O2):
<fmt_ulong>:
mov    $0xa,%edx
jmp    1030 <fmt_ulong_base@plt>

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

LLVM IR (-O2):
define i64 @fmt_ulong(i8* %0, i64 %1) {
%3 = tail call i64 @fmt_ulong_base(i8* %0, i64 %1, i32 10)
ret i64 %3
}
int isupper(int c) {
  return ((unsigned char)c >= 'A' && (unsigned char)c <= 'Z');
}


x86 assembly (clang, -O0):
<isupper>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
movzbl %al,%ecx
xor    %eax,%eax
cmp    $0x41,%ecx
mov    %al,-0x5(%rbp)
jl     112a <isupper+0x2a>
mov    -0x4(%rbp),%eax
movzbl %al,%eax
cmp    $0x5a,%eax
setle  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isupper>:
movzbl %dil,%ecx
add    $0xffffffbf,%ecx
xor    %eax,%eax
cmp    $0x1a,%ecx
setb   %al
ret

LLVM IR (-O0):
define i32 @isupper(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = trunc i32 %3 to i8
%5 = zext i8 %4 to i32
%6 = icmp sge i32 %5, 65
br i1 %6, label %7, label %12
7: ; preds = %1
%8 = load i32, i32* %2
%9 = trunc i32 %8 to i8
%10 = zext i8 %9 to i32
%11 = icmp sle i32 %10, 90
br label %12
12: ; preds = %7, %1
%13 = phi i1 [ false, %1 ], [ %11, %7 ]
%14 = zext i1 %13 to i32
ret i32 %14
}

LLVM IR (-O2):
define i32 @isupper(i32 %0) {
%2 = and i32 %0, 255
%3 = add nsw i32 %2, -65
%4 = icmp ult i32 %3, 26
%5 = zext i1 %4 to i32
ret i32 %5
}
vdrpix() {}


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

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

LLVM IR (-O0):
define i32 @vdrpix() {
%1 = alloca i32
%2 = load i32, i32* %1
ret i32 %2
}

LLVM IR (-O2):
define i32 @vdrpix() {
ret i32 undef
}
/* Variables and functions */
scalar_t__ strstr(char const *, char const *);
char gotString(const char *asearch, const char *astring) {
  return (strstr(astring, asearch) ? 1 : 0);
}


x86 assembly (clang, -O0):
<gotString>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strstr@plt>
mov    %rax,%rdx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
movsbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gotString>:
push   %rax
mov    %rdi,%rax
mov    %rsi,%rdi
mov    %rax,%rsi
call   1030 <strstr@plt>
test   %rax,%rax
setne  %al
pop    %rcx
ret

LLVM IR (-O0):
define signext i8 @gotString(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = load i8*, i8** %3
%7 = call i64 @strstr(i8* %5, i8* %6)
%8 = icmp ne i64 %7, 0
%9 = zext i1 %8 to i64
%10 = select i1 %8, i32 1, i32 0
%11 = trunc i32 %10 to i8
ret i8 %11
}

LLVM IR (-O2):
define signext i8 @gotString(i8* %0, i8* %1) {
%3 = tail call i64 @strstr(i8* %1, i8* %0)
%4 = icmp ne i64 %3, 0
%5 = zext i1 %4 to i8
ret i8 %5
}
int test_imm_68int64_lowword_reg(long long val) {
  return ((val) & (0x68 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_68int64_lowword_reg>:
test   $0x68,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_68int64_lowword_reg(i64 %0) {
%2 = and i64 %0, 104
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ strlen(char const *);
int write(int, char const *, int /*<<< orphan*/);
int writes(int fd, const char *p) { return write(fd, p, strlen(p)); }


x86 assembly (clang, -O0):
<writes>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x1c(%rbp),%edi
mov    -0x18(%rbp),%rsi
mov    %eax,%edx
call   1030 <write@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<writes>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
mov    %rsi,%rdi
call   1040 <strlen@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %eax,%edx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <write@plt>

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

LLVM IR (-O2):
define i32 @writes(i32 %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %1)
%4 = tail call i32 @write(i32 %0, i8* %1, i32 %3)
ret i32 %4
}
/* Type definitions */
struct userlist_args_info {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ userlist_cmdline_parser_release(struct userlist_args_info *);
void userlist_cmdline_parser_free(struct userlist_args_info *args_info) {
  userlist_cmdline_parser_release(args_info);
}


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

x86 assembly (clang, -O2):
<userlist_cmdline_parser_free>:
jmp    1030 <userlist_cmdline_parser_release@plt>

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

LLVM IR (-O2):
%struct.userlist_args_info = type { i32 }
define void @userlist_cmdline_parser_free(%struct.userlist_args_info* %0) {
%2 = tail call i32 @userlist_cmdline_parser_release(%struct.userlist_args_info* %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void mumble_permissiondenied_callback(int32_t permission, int32_t channel_id,
                                      int32_t session, char *reason,
                                      int32_t deny_type, char *name,
                                      void *user_data) {
  printf("permissiondenied_callback\n");
}


x86 assembly (clang, -O0):
<mumble_permissiondenied_callback>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    0x10(%rbp),%rax
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %rcx,-0x18(%rbp)
mov    %r8d,-0x1c(%rbp)
mov    %r9,-0x28(%rbp)
lea    0xec8(%rip),%rdi
call   1030 <printf@plt>
add    $0x30,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [27 x i8] c"permissiondenied_callback\0A\00"
define void @mumble_permissiondenied_callback(i32 %0, i32 %1, i32 %2, i8* %3, i32 %4, i8* %5, i8* %6) {
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i8*
%12 = alloca i32
%13 = alloca i8*
%14 = alloca i8*
store i32 %0, i32* %8
store i32 %1, i32* %9
store i32 %2, i32* %10
store i8* %3, i8** %11
store i32 %4, i32* %12
store i8* %5, i8** %13
store i8* %6, i8** %14
%15 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [26 x i8] c"permissiondenied_callback\00"
define void @mumble_permissiondenied_callback(i32 %0, i32 %1, i32 %2, i8* nocapture readnone %3, i32 %4, i8* nocapture readnone %5, i8* nocapture readnone %6) {
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str, i64 0, i64 0))
ret void
}
void handle_48(int sig) {}


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

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

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

LLVM IR (-O2):
define void @handle_48(i32 %0) {
ret void
}
void INT_Excep_EXDMAC_EXDMAC1I(void) {}


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

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

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

LLVM IR (-O2):
define void @INT_Excep_EXDMAC_EXDMAC1I() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void topmhead(int osvers, int osrel, int ossub) {
  printf("  pid command  mem%% |   pid command  mem%% | "
         "  pid command  mem%%_top3_");
}


x86 assembly (clang, -O0):
<topmhead>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
lea    0xed8(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [73 x i8] c" pid command mem%% | pid command mem%% | pid command mem%%_top3_\00"
define void @topmhead(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = call i32 @printf(i8* getelementptr inbounds ([73 x i8], [73 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [73 x i8] c" pid command mem%% | pid command mem%% | pid command mem%%_top3_\00"
define void @topmhead(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([73 x i8], [73 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ setup_timer();
void timer_initialize(void) { setup_timer(); }


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

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

LLVM IR (-O0):
define void @timer_initialize() {
%1 = call i32 (...) @setup_timer()
ret void
}

LLVM IR (-O2):
define void @timer_initialize() {
%1 = tail call i32 (...) @setup_timer()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ dfs(char **, int, int);
void solveSudoku(char **board, int boardRowSize, int boardColSize) {
  dfs(board, boardRowSize, boardColSize);
}


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

x86 assembly (clang, -O2):
<solveSudoku>:
jmp    1030 <dfs@plt>

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

LLVM IR (-O2):
define void @solveSudoku(i8** %0, i32 %1, i32 %2) {
%4 = tail call i32 @dfs(i8** %0, i32 %1, i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fakeSystemHeaderCallInt(int *);
int *malloc(int);
void testPassToSystemHeaderFunctionIndirectly() {
  int *p = malloc(4);
  p++;
  fakeSystemHeaderCallInt(p);
}


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

x86 assembly (clang, -O2):
<testPassToSystemHeaderFunctionIndirectly>:
push   %rax
mov    $0x4,%edi
call   1040 <malloc@plt>
lea    0x4(%rax),%rdi
pop    %rax
jmp    1030 <fakeSystemHeaderCallInt@plt>

LLVM IR (-O0):
define void @testPassToSystemHeaderFunctionIndirectly() {
%1 = alloca i32*
%2 = call i32* @malloc(i32 4)
store i32* %2, i32** %1
%3 = load i32*, i32** %1
%4 = getelementptr inbounds i32, i32* %3, i32 1
store i32* %4, i32** %1
%5 = load i32*, i32** %1
%6 = call i32 @fakeSystemHeaderCallInt(i32* %5)
ret void
}

LLVM IR (-O2):
define void @testPassToSystemHeaderFunctionIndirectly() {
%1 = tail call i32* @malloc(i32 4)
%2 = getelementptr inbounds i32, i32* %1, i64 1
%3 = tail call i32 @fakeSystemHeaderCallInt(i32* %2)
ret void
}
unsigned int cvmx_coremask_range(unsigned int low, unsigned int high) {
  return ((0xFFFFFFFFu >> (31 - high + low)) << low);
}


x86 assembly (clang, -O0):
<cvmx_coremask_range>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0x1f,%ecx
sub    -0x8(%rbp),%ecx
add    -0x4(%rbp),%ecx
mov    $0xffffffff,%eax
shr    %cl,%eax
mov    -0x4(%rbp),%ecx
shl    %cl,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cvmx_coremask_range>:
mov    %edi,%ecx
sub    %esi,%ecx
add    $0x1f,%cl
mov    $0xffffffff,%eax
shr    %cl,%eax
mov    %edi,%ecx
shl    %cl,%eax
ret

LLVM IR (-O0):
define i32 @cvmx_coremask_range(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = sub i32 31, %5
%7 = load i32, i32* %3
%8 = add i32 %6, %7
%9 = lshr i32 -1, %8
%10 = load i32, i32* %3
%11 = shl i32 %9, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @cvmx_coremask_range(i32 %0, i32 %1) {
%3 = add i32 %0, 31
%4 = sub i32 %3, %1
%5 = lshr i32 -1, %4
%6 = shl i32 %5, %0
ret i32 %6
}
/* Type definitions */
struct Edge {
  int dummy;
};

/* Variables and functions */
struct Edge *edge_rot(struct Edge *);
struct Edge *edge_invRot(struct Edge *edge) {
  return edge_rot(edge_rot(edge_rot(edge)));
}


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

x86 assembly (clang, -O2):
<edge_invRot>:
push   %rax
call   1030 <edge_rot@plt>
mov    %rax,%rdi
call   1030 <edge_rot@plt>
mov    %rax,%rdi
pop    %rax
jmp    1030 <edge_rot@plt>

LLVM IR (-O0):
%struct.Edge = type { i32 }
define %struct.Edge* @edge_invRot(%struct.Edge* %0) {
%2 = alloca %struct.Edge*
store %struct.Edge* %0, %struct.Edge** %2
%3 = load %struct.Edge*, %struct.Edge** %2
%4 = call %struct.Edge* @edge_rot(%struct.Edge* %3)
%5 = call %struct.Edge* @edge_rot(%struct.Edge* %4)
%6 = call %struct.Edge* @edge_rot(%struct.Edge* %5)
ret %struct.Edge* %6
}

LLVM IR (-O2):
%struct.Edge = type { i32 }
define %struct.Edge* @edge_invRot(%struct.Edge* %0) {
%2 = tail call %struct.Edge* @edge_rot(%struct.Edge* %0)
%3 = tail call %struct.Edge* @edge_rot(%struct.Edge* %2)
%4 = tail call %struct.Edge* @edge_rot(%struct.Edge* %3)
ret %struct.Edge* %4
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
int strlenght(char *string) {
  int x = 0;
  puts(string);
  while (*string++)
    x++;
  return x;
}


x86 assembly (clang, -O0):
<strlenght>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <puts@plt>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
cmpb   $0x0,(%rax)
je     1152 <strlenght+0x42>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    112c <strlenght+0x1c>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlenght>:
push   %rbx
mov    %rdi,%rbx
call   1030 <puts@plt>
cmpb   $0x0,(%rbx)
je     112d <strlenght+0x1d>
xor    %eax,%eax
cmpb   $0x0,0x1(%rbx,%rax,1)
lea    0x1(%rax),%rax
jne    1120 <strlenght+0x10>
pop    %rbx
ret
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @strlenght(i8* nocapture %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) %0)
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %12, label %5
5: ; preds = %1, %5
%6 = phi i32 [ %9, %5 ], [ 0, %1 ]
%7 = phi i8* [ %8, %5 ], [ %0, %1 ]
%8 = getelementptr inbounds i8, i8* %7, i64 1
%9 = add nuw nsw i32 %6, 1
%10 = load i8, i8* %8
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %5
12: ; preds = %5, %1
%13 = phi i32 [ 0, %1 ], [ %9, %5 ]
ret i32 %13
}
/* Variables and functions */
char *strchr(char *, char);
int wycc_type_not_map(char *typ) {
  char *at;
  at = strchr(typ, '{');
  if (at != NULL) {
    return 0;
  };
  at = strchr(typ, '}');
  if (at != NULL) {
    return 0;
  };
  return 1;
}


x86 assembly (clang, -O0):
<wycc_type_not_map>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x7b,%esi
call   1030 <strchr@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1145 <wycc_type_not_map+0x35>
movl   $0x0,-0x4(%rbp)
jmp    1175 <wycc_type_not_map+0x65>
mov    -0x10(%rbp),%rdi
mov    $0x7d,%esi
call   1030 <strchr@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     116e <wycc_type_not_map+0x5e>
movl   $0x0,-0x4(%rbp)
jmp    1175 <wycc_type_not_map+0x65>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wycc_type_not_map>:
push   %rbx
mov    %rdi,%rbx
mov    $0x7b,%esi
call   1030 <strchr@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
je     112a <wycc_type_not_map+0x1a>
pop    %rbx
ret
mov    %rbx,%rdi
mov    $0x7d,%esi
call   1030 <strchr@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
sete   %al
pop    %rbx
ret

LLVM IR (-O0):
define i32 @wycc_type_not_map(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i8* @strchr(i8* %5, i8 signext 123)
store i8* %6, i8** %4
%7 = load i8*, i8** %4
%8 = icmp ne i8* %7, null
br i1 %8, label %9, label %10
9: ; preds = %1
store i32 0, i32* %2
br label %17
10: ; preds = %1
%11 = load i8*, i8** %3
%12 = call i8* @strchr(i8* %11, i8 signext 125)
store i8* %12, i8** %4
%13 = load i8*, i8** %4
%14 = icmp ne i8* %13, null
br i1 %14, label %15, label %16
15: ; preds = %10
store i32 0, i32* %2
br label %17
16: ; preds = %10
store i32 1, i32* %2
br label %17
17: ; preds = %16, %15, %9
%18 = load i32, i32* %2
ret i32 %18
}

LLVM IR (-O2):
define i32 @wycc_type_not_map(i8* %0) {
%2 = tail call i8* @strchr(i8* dereferenceable(1) %0, i8 signext 123)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = tail call i8* @strchr(i8* dereferenceable(1) %0, i8 signext 125)
%6 = icmp eq i8* %5, null
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %4, %1
%9 = phi i32 [ 0, %1 ], [ %7, %4 ]
ret i32 %9
}
/* Variables and functions */
double f_msangle(double, int /*<<< orphan*/);
double rootbysecand(double (*)(double, int /*<<< orphan*/), int /*<<< orphan*/,
                    double, double, double);
double newmoon(double jd) {
  double ERROR, x0, x1;
  ERROR = 0.0000001;
  x0 = jd - f_msangle(jd, 0) / 6.28318530717958647693 / 29.53;
  x1 = x0 + 0.5;
  return rootbysecand(f_msangle, 0, x0, x1, ERROR);
}


x86 assembly (clang, -O0):
<newmoon>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  0xef3(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x8(%rbp),%xmm0
xor    %edi,%edi
call   1040 <f_msangle@plt>
movaps %xmm0,%xmm1
movsd  -0x28(%rbp),%xmm0
movsd  0xec0(%rip),%xmm2
divsd  %xmm2,%xmm1
movsd  0xeac(%rip),%xmm2
divsd  %xmm2,%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  0xe8f(%rip),%xmm0
addsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm2
mov    0x2e57(%rip),%rdi
xor    %esi,%esi
call   1030 <rootbysecand@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<newmoon>:
push   %rax
movsd  %xmm0,(%rsp)
xor    %edi,%edi
call   1040 <f_msangle@plt>
divsd  0xedb(%rip),%xmm0
mov    0x2ebc(%rip),%rdi
divsd  0xed4(%rip),%xmm0
addsd  (%rsp),%xmm0
movsd  0xecf(%rip),%xmm1
addsd  %xmm0,%xmm1
movsd  0xecb(%rip),%xmm2
xor    %esi,%esi
pop    %rax
jmp    1030 <rootbysecand@plt>

LLVM IR (-O0):
define double @newmoon(double %0) {
%2 = alloca double
%3 = alloca double
%4 = alloca double
%5 = alloca double
store double %0, double* %2
store double 0x3E7AD7F29ABCAF48, double* %3
%6 = load double, double* %2
%7 = load double, double* %2
%8 = call double @f_msangle(double %7, i32 0)
%9 = fdiv double %8, 0x401921FB54442D18
%10 = fdiv double %9, 2.953000e+01
%11 = fsub double %6, %10
store double %11, double* %4
%12 = load double, double* %4
%13 = fadd double %12, 5.000000e-01
store double %13, double* %5
%14 = load double, double* %4
%15 = load double, double* %5
%16 = load double, double* %3
%17 = call double @rootbysecand(double (double, i32)* @f_msangle, i32 0, double %14, double %15, double %16)
ret double %17
}

LLVM IR (-O2):
define double @newmoon(double %0) {
%2 = tail call double @f_msangle(double %0, i32 0)
%3 = fdiv double %2, 0x401921FB54442D18
%4 = fdiv double %3, 2.953000e+01
%5 = fsub double %0, %4
%6 = fadd double %5, 5.000000e-01
%7 = tail call double @rootbysecand(double (double, i32)* @f_msangle, i32 0, double %5, double %6, double 0x3E7AD7F29ABCAF48)
ret double %7
}
/* Type definitions */
struct fds {
  int dummy;
};

/* Variables and functions */
int _slave_send_reply(struct fds *, int /*<<< orphan*/);
int _init_sync_send(struct fds *fds) { return _slave_send_reply(fds, 0); }


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

x86 assembly (clang, -O2):
<_init_sync_send>:
xor    %esi,%esi
jmp    1030 <_slave_send_reply@plt>

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

LLVM IR (-O2):
%struct.fds = type { i32 }
define i32 @_init_sync_send(%struct.fds* %0) {
%2 = tail call i32 @_slave_send_reply(%struct.fds* %0, i32 0)
ret i32 %2
}
int bump_tile_index(int dims, int *tcase) {
  int i;
  for (i = dims - 1; i >= 0; i--)
    if (tcase[i] == 1)
      return (i);
  return (-1);
}


x86 assembly (clang, -O0):
<bump_tile_index>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jl     114e <bump_tile_index+0x4e>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
cmpl   $0x1,(%rax,%rcx,4)
jne    113b <bump_tile_index+0x3b>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1155 <bump_tile_index+0x55>
jmp    1140 <bump_tile_index+0x40>
mov    -0x14(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
jmp    1114 <bump_tile_index+0x14>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bump_tile_index>:
mov    %edi,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
test   %eax,%eax
jle    1121 <bump_tile_index+0x21>
add    $0xffffffffffffffff,%rax
mov    %eax,%ecx
cmpl   $0x1,(%rsi,%rcx,4)
jne    1110 <bump_tile_index+0x10>
ret
mov    $0xffffffff,%eax
ret

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

LLVM IR (-O2):
define i32 @bump_tile_index(i32 %0, i32* nocapture %1) {
%3 = zext i32 %0 to i64
br label %4
4: ; preds = %9, %2
%5 = phi i64 [ %6, %9 ], [ %3, %2 ]
%6 = add nsw i64 %5, -1
%7 = trunc i64 %5 to i32
%8 = icmp sgt i32 %7, 0
br i1 %8, label %9, label %16
9: ; preds = %4
%10 = and i64 %6, 4294967295
%11 = getelementptr inbounds i32, i32* %1, i64 %10
%12 = load i32, i32* %11
%13 = icmp eq i32 %12, 1
br i1 %13, label %14, label %4
14: ; preds = %9
%15 = trunc i64 %6 to i32
br label %16
16: ; preds = %4, %14
%17 = phi i32 [ %15, %14 ], [ -1, %4 ]
ret i32 %17
}