xunge/DecIR huggingface dataset:
int testbit(c, map)
unsigned c;
char *map;
{
  if (c >= *(unsigned *)map)
    return 0;
  map += sizeof(unsigned);
  return (map[c >> 3] & (1 << (c & 0x07)));
}


x86 assembly (clang, -O0):
<testbit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    -0x10(%rbp),%rcx
cmp    (%rcx),%eax
jb     1126 <testbit+0x26>
movl   $0x0,-0x4(%rbp)
jmp    1156 <testbit+0x56>
mov    -0x10(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%ecx
shr    $0x3,%ecx
mov    %ecx,%ecx
movsbl (%rax,%rcx,1),%eax
mov    -0x8(%rbp),%ecx
and    $0x7,%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
and    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<testbit>:
xor    %eax,%eax
cmp    %edi,(%rsi)
jbe    1120 <testbit+0x20>
mov    %edi,%eax
shr    $0x3,%rax
movzbl 0x4(%rsi,%rax,1),%edx
and    $0x7,%dil
mov    $0x1,%eax
mov    %edi,%ecx
shl    %cl,%eax
and    %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @testbit(i32 %0, i8* nocapture %1) {
%3 = bitcast i8* %1 to i32*
%4 = load i32, i32* %3
%5 = icmp ugt i32 %4, %0
br i1 %5, label %6, label %16
6: ; preds = %2
%7 = getelementptr inbounds i8, i8* %1, i64 4
%8 = lshr i32 %0, 3
%9 = zext i32 %8 to i64
%10 = getelementptr inbounds i8, i8* %7, i64 %9
%11 = load i8, i8* %10
%12 = zext i8 %11 to i32
%13 = and i32 %0, 7
%14 = shl nuw nsw i32 1, %13
%15 = and i32 %14, %12
br label %16
16: ; preds = %2, %6
%17 = phi i32 [ %15, %6 ], [ 0, %2 ]
ret i32 %17
}
/* Variables and functions */
int close(int);
int os_close(int fd) { return close(fd); }


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

x86 assembly (clang, -O2):
<os_close>:
jmp    1030 <close@plt>

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

LLVM IR (-O2):
define i32 @os_close(i32 %0) {
%2 = tail call i32 @close(i32 %0)
ret i32 %2
}
void hclib_set_state(int wid, int state) {}


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

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

LLVM IR (-O0):
define void @hclib_set_state(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
ret void
}

LLVM IR (-O2):
define void @hclib_set_state(i32 %0, i32 %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ sca_write(int);
main() {
  int xx;
  char ac[] = "david gitlin";
  xx = 1045;
  sca_write(xx);
  printf("\n\nDone\n\n");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    0xed1(%rip),%rax
mov    %rax,-0x11(%rbp)
mov    0xecf(%rip),%eax
mov    %eax,-0x9(%rbp)
mov    0xeca(%rip),%al
mov    %al,-0x5(%rbp)
movl   $0x415,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <sca_write@plt>
lea    0xeb2(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x415,%edi
call   1040 <sca_write@plt>
lea    0xece(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@__const.main.ac = [13 x i8] c"david gitlin\00"
@.str = [9 x i8] c"\0A\0ADone\0A\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [13 x i8]
%3 = bitcast [13 x i8]* %2 to i8*
store i32 1045, i32* %1
%4 = load i32, i32* %1
%5 = call i32 @sca_write(i32 %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [8 x i8] c"\0A\0ADone\0A\00"
define i32 @main() {
%1 = tail call i32 @sca_write(i32 1045)
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Lcd8_Cmd(int);
void Lcd8_Set_Cursor(char a, char b) {
  if (a == 1)
    Lcd8_Cmd(0x80 + b);
  else if (a == 2)
    Lcd8_Cmd(0xC0 + b);
}


x86 assembly (clang, -O0):
<Lcd8_Set_Cursor>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x1,%eax
jne    1145 <Lcd8_Set_Cursor+0x35>
movsbl -0x2(%rbp),%edi
add    $0x80,%edi
call   1030 <Lcd8_Cmd@plt>
jmp    1166 <Lcd8_Set_Cursor+0x56>
movsbl -0x1(%rbp),%eax
cmp    $0x2,%eax
jne    1161 <Lcd8_Set_Cursor+0x51>
movsbl -0x2(%rbp),%edi
add    $0xc0,%edi
call   1030 <Lcd8_Cmd@plt>
jmp    1166 <Lcd8_Set_Cursor+0x56>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Lcd8_Set_Cursor>:
cmp    $0x1,%dil
je     1123 <Lcd8_Set_Cursor+0x13>
cmp    $0x2,%dil
jne    1133 <Lcd8_Set_Cursor+0x23>
mov    $0xc0,%eax
jmp    1128 <Lcd8_Set_Cursor+0x18>
mov    $0x80,%eax
movsbl %sil,%edi
add    %eax,%edi
jmp    1030 <Lcd8_Cmd@plt>
ret

LLVM IR (-O0):
define void @Lcd8_Set_Cursor(i8 signext %0, i8 signext %1) {
%3 = alloca i8
%4 = alloca i8
store i8 %0, i8* %3
store i8 %1, i8* %4
%5 = load i8, i8* %3
%6 = sext i8 %5 to i32
%7 = icmp eq i32 %6, 1
br i1 %7, label %8, label %13
8: ; preds = %2
%9 = load i8, i8* %4
%10 = sext i8 %9 to i32
%11 = add nsw i32 128, %10
%12 = call i32 @Lcd8_Cmd(i32 %11)
br label %23
13: ; preds = %2
%14 = load i8, i8* %3
%15 = sext i8 %14 to i32
%16 = icmp eq i32 %15, 2
br i1 %16, label %17, label %22
17: ; preds = %13
%18 = load i8, i8* %4
%19 = sext i8 %18 to i32
%20 = add nsw i32 192, %19
%21 = call i32 @Lcd8_Cmd(i32 %20)
br label %22
22: ; preds = %17, %13
br label %23
23: ; preds = %22, %8
ret void
}

LLVM IR (-O2):
define void @Lcd8_Set_Cursor(i8 signext %0, i8 signext %1) {
switch i8 %0, label %9 [
i8 1, label %4
i8 2, label %3
]
3: ; preds = %2
br label %4
4: ; preds = %2, %3
%5 = phi i32 [ 192, %3 ], [ 128, %2 ]
%6 = sext i8 %1 to i32
%7 = add nsw i32 %5, %6
%8 = tail call i32 @Lcd8_Cmd(i32 %7)
br label %9
9: ; preds = %4, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assertEqual(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ assertNotNull(void *);
int /*<<< orphan*/ mfree(void *);
void *mmalloc(int /*<<< orphan*/);
int /*<<< orphan*/ msize(void *);
void testMallocZero(void) {
  void *ptr = mmalloc(0);
  assertNotNull(ptr);
  assertEqual(0, msize(ptr));
  mfree(ptr);
}


x86 assembly (clang, -O0):
<testMallocZero>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xor    %edi,%edi
call   1040 <mmalloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <assertNotNull@plt>
mov    -0x8(%rbp),%rdi
call   1070 <msize@plt>
mov    %eax,%esi
xor    %edi,%edi
call   1050 <assertEqual@plt>
mov    -0x8(%rbp),%rdi
call   1060 <mfree@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<testMallocZero>:
push   %rbx
xor    %edi,%edi
call   1040 <mmalloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1030 <assertNotNull@plt>
mov    %rbx,%rdi
call   1070 <msize@plt>
xor    %edi,%edi
mov    %eax,%esi
call   1050 <assertEqual@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1060 <mfree@plt>

LLVM IR (-O0):
define void @testMallocZero() {
%1 = alloca i8*
%2 = call i8* @mmalloc(i32 0)
store i8* %2, i8** %1
%3 = load i8*, i8** %1
%4 = call i32 @assertNotNull(i8* %3)
%5 = load i8*, i8** %1
%6 = call i32 @msize(i8* %5)
%7 = call i32 @assertEqual(i32 0, i32 %6)
%8 = load i8*, i8** %1
%9 = call i32 @mfree(i8* %8)
ret void
}

LLVM IR (-O2):
define void @testMallocZero() {
%1 = tail call i8* @mmalloc(i32 0)
%2 = tail call i32 @assertNotNull(i8* %1)
%3 = tail call i32 @msize(i8* %1)
%4 = tail call i32 @assertEqual(i32 0, i32 %3)
%5 = tail call i32 @mfree(i8* %1)
ret void
}
__attribute__((no, noclone)) unsigned __int128 t161_2sub(unsigned __int128 y) {
  unsigned __int128 x = (-1);
  unsigned __int128 r;
  if (__builtin_sub_overflow(x, y, &r))
    bar();
  return r;
}


x86 assembly (clang, -O0):
<t161_2sub>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x20(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x20(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    %rcx,-0x28(%rbp)
mov    %rax,-0x30(%rbp)
movq   $0xffffffffffffffff,-0x38(%rbp)
ff
movq   $0xffffffffffffffff,-0x40(%rbp)
ff
mov    -0x40(%rbp),%rdx
mov    -0x38(%rbp),%rcx
mov    -0x30(%rbp),%rsi
mov    -0x28(%rbp),%rax
sub    %rsi,%rdx
sbb    %rax,%rcx
setb   %al
mov    %rdx,-0x50(%rbp)
mov    %rcx,-0x48(%rbp)
test   $0x1,%al
jne    116e <t161_2sub+0x5e>
jmp    1175 <t161_2sub+0x65>
mov    $0x0,%al
call   1030 <bar@plt>
mov    -0x50(%rbp),%rax
mov    -0x48(%rbp),%rcx
mov    %rcx,-0x8(%rbp)
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rdx
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<t161_2sub>:
mov    %rsi,%rdx
mov    %rdi,%rax
not    %rax
not    %rdx
ret

LLVM IR (-O0):
define { i64, i64 } @t161_2sub(i64 %0, i64 %1) {
%3 = alloca i128
%4 = alloca i128
%5 = alloca i128
%6 = alloca i128
%7 = alloca i128
%8 = bitcast i128* %4 to { i64, i64 }*
%9 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %8, i32 0, i32 0
store i64 %0, i64* %9
%10 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %8, i32 0, i32 1
store i64 %1, i64* %10
%11 = load i128, i128* %4
store i128 %11, i128* %5
store i128 -1, i128* %6
%12 = load i128, i128* %6
%13 = load i128, i128* %5
%14 = call { i128, i1 } @llvm.usub.with.overflow.i128(i128 %12, i128 %13)
%15 = extractvalue { i128, i1 } %14, 1
%16 = extractvalue { i128, i1 } %14, 0
store i128 %16, i128* %7
br i1 %15, label %17, label %19
17: ; preds = %2
%18 = call i32 (...) @bar()
br label %19
19: ; preds = %17, %2
%20 = load i128, i128* %7
store i128 %20, i128* %3
%21 = bitcast i128* %3 to { i64, i64 }*
%22 = load { i64, i64 }, { i64, i64 }* %21
ret { i64, i64 } %22
}

LLVM IR (-O2):
define { i64, i64 } @t161_2sub(i64 %0, i64 %1) {
%3 = zext i64 %1 to i128
%4 = shl nuw i128 %3, 64
%5 = zext i64 %0 to i128
%6 = or i128 %4, %5
%7 = xor i128 %6, -1
%8 = trunc i128 %7 to i64
%9 = lshr i128 %7, 64
%10 = trunc i128 %9 to i64
%11 = insertvalue { i64, i64 } poison, i64 %8, 0
%12 = insertvalue { i64, i64 } %11, i64 %10, 1
ret { i64, i64 } %12
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
int /*<<< orphan*/ assert(int);
int tblIdx(uint8_t *pc, int flag) {
  int mask = (((flag) >> 16) & 0x1FF);
  int shift = (((flag) >> 25) & 0x07);
  assert(mask <= 0xFF);
  return (*(uint8_t *)(pc + (((flag) >> 27) & 0x1F)) >> shift) & mask;
}


x86 assembly (clang, -O0):
<tblIdx>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
sar    $0x10,%eax
and    $0x1ff,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
sar    $0x19,%eax
and    $0x7,%eax
mov    %eax,-0x14(%rbp)
cmpl   $0xff,-0x10(%rbp)
setle  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
sar    $0x1b,%ecx
and    $0x1f,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%eax
mov    -0x14(%rbp),%ecx
sar    %cl,%eax
and    -0x10(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tblIdx>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %esi,%r15d
mov    %rdi,%r14
mov    %esi,%ebx
shr    $0x10,%ebx
and    $0x1ff,%ebx
mov    %esi,%ebp
shr    $0x19,%ebp
xor    %edi,%edi
cmp    $0x100,%ebx
setb   %dil
call   1030 <assert@plt>
shr    $0x1b,%r15d
mov    (%r14,%r15,4),%eax
and    $0x7,%bpl
mov    %ebp,%ecx
sar    %cl,%eax
and    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @tblIdx(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%7 = load i32, i32* %4
%8 = ashr i32 %7, 16
%9 = and i32 %8, 511
store i32 %9, i32* %5
%10 = load i32, i32* %4
%11 = ashr i32 %10, 25
%12 = and i32 %11, 7
store i32 %12, i32* %6
%13 = load i32, i32* %5
%14 = icmp sle i32 %13, 255
%15 = zext i1 %14 to i32
%16 = call i32 @assert(i32 %15)
%17 = load i32*, i32** %3
%18 = load i32, i32* %4
%19 = ashr i32 %18, 27
%20 = and i32 %19, 31
%21 = sext i32 %20 to i64
%22 = getelementptr inbounds i32, i32* %17, i64 %21
%23 = load i32, i32* %22
%24 = load i32, i32* %6
%25 = ashr i32 %23, %24
%26 = load i32, i32* %5
%27 = and i32 %25, %26
ret i32 %27
}

LLVM IR (-O2):
define i32 @tblIdx(i32* nocapture %0, i32 %1) {
%3 = lshr i32 %1, 16
%4 = and i32 %3, 511
%5 = lshr i32 %1, 25
%6 = and i32 %5, 7
%7 = icmp ult i32 %4, 256
%8 = zext i1 %7 to i32
%9 = tail call i32 @assert(i32 %8)
%10 = lshr i32 %1, 27
%11 = zext i32 %10 to i64
%12 = getelementptr inbounds i32, i32* %0, i64 %11
%13 = load i32, i32* %12
%14 = ashr i32 %13, %6
%15 = and i32 %14, %4
ret i32 %15
}
/* Variables and functions */
int /*<<< orphan*/ VIDEO_CONTINUE;
int ioctl(int, int /*<<< orphan*/);
int /*<<< orphan*/ perror(char *);
int videoContinue(int fd) {
  int ans;
  if ((ans = ioctl(fd, VIDEO_CONTINUE)) < 0) {
    perror("VIDEO CONTINUE: ");
    return -1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<videoContinue>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
mov    0x2eab(%rip),%rax
mov    (%rax),%esi
call   1030 <ioctl@plt>
mov    %eax,-0xc(%rbp)
cmp    $0x0,%eax
jge    1160 <videoContinue+0x40>
lea    0xeb1(%rip),%rdi
call   1040 <perror@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1167 <videoContinue+0x47>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<videoContinue>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%esi
call   1030 <ioctl@plt>
mov    %eax,%ecx
xor    %eax,%eax
test   %ecx,%ecx
js     1139 <videoContinue+0x19>
pop    %rcx
ret
lea    0xec0(%rip),%rdi
call   1040 <perror@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@VIDEO_CONTINUE = global i32 0
@.str = [17 x i8] c"VIDEO CONTINUE: \00"
define i32 @videoContinue(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
%5 = load i32, i32* %3
%6 = load i32, i32* @VIDEO_CONTINUE
%7 = call i32 @ioctl(i32 %5, i32 %6)
store i32 %7, i32* %4
%8 = icmp slt i32 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %1
%10 = call i32 @perror(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
store i32 -1, i32* %2
br label %12
11: ; preds = %1
store i32 0, i32* %2
br label %12
12: ; preds = %11, %9
%13 = load i32, i32* %2
ret i32 %13
}

LLVM IR (-O2):
@VIDEO_CONTINUE = global i32 0
@.str = [17 x i8] c"VIDEO CONTINUE: \00"
define i32 @videoContinue(i32 %0) {
%2 = load i32, i32* @VIDEO_CONTINUE
%3 = tail call i32 @ioctl(i32 %0, i32 %2)
%4 = icmp slt i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = tail call i32 @perror(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %1, %5
%8 = phi i32 [ -1, %5 ], [ 0, %1 ]
ret i32 %8
}
unsigned bitScan_fun_int(int x) {
  unsigned r = 0;
  int s = (x & 0x80000000);
  if (x == 0)
    return 31;
  while (((x <<= 1) & 0x80000000) == s)
    ++r;
  return r;
}


x86 assembly (clang, -O0):
<bitScan_fun_int>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%eax
and    $0x80000000,%eax
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    112f <bitScan_fun_int+0x2f>
movl   $0x1f,-0x4(%rbp)
jmp    115f <bitScan_fun_int+0x5f>
jmp    1134 <bitScan_fun_int+0x34>
mov    -0x8(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x8(%rbp)
and    $0x80000000,%eax
cmp    -0x10(%rbp),%eax
jne    1159 <bitScan_fun_int+0x59>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1134 <bitScan_fun_int+0x34>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bitScan_fun_int>:
test   %edi,%edi
je     111c <bitScan_fun_int+0x1c>
mov    $0xffffffff,%eax
mov    %edi,%ecx
nopl   0x0(%rax,%rax,1)
add    %ecx,%ecx
add    $0x1,%eax
mov    %ecx,%edx
xor    %edi,%edx
jns    1110 <bitScan_fun_int+0x10>
ret
mov    $0x1f,%eax
ret

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

LLVM IR (-O2):
define i32 @bitScan_fun_int(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %10, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %6, %3 ], [ %0, %1 ]
%5 = phi i32 [ %9, %3 ], [ 0, %1 ]
%6 = shl i32 %4, 1
%7 = xor i32 %6, %0
%8 = icmp sgt i32 %7, -1
%9 = add i32 %5, 1
br i1 %8, label %3, label %10
10: ; preds = %3, %1
%11 = phi i32 [ 31, %1 ], [ %5, %3 ]
ret i32 %11
}
/* Type definitions */
struct ylist_head {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ INIT_YLIST_HEAD(struct ylist_head *);
int /*<<< orphan*/ ylist_replace(struct ylist_head *, struct ylist_head *);
void ylist_replace_init(struct ylist_head *old, struct ylist_head *n) {
  ylist_replace(old, n);
  INIT_YLIST_HEAD(old);
}


x86 assembly (clang, -O0):
<ylist_replace_init>:
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   1040 <ylist_replace@plt>
mov    -0x8(%rbp),%rdi
call   1030 <INIT_YLIST_HEAD@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ylist_replace_init>:
push   %rbx
mov    %rdi,%rbx
call   1040 <ylist_replace@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <INIT_YLIST_HEAD@plt>

LLVM IR (-O0):
%struct.ylist_head = type { i32 }
define void @ylist_replace_init(%struct.ylist_head* %0, %struct.ylist_head* %1) {
%3 = alloca %struct.ylist_head*
%4 = alloca %struct.ylist_head*
store %struct.ylist_head* %0, %struct.ylist_head** %3
store %struct.ylist_head* %1, %struct.ylist_head** %4
%5 = load %struct.ylist_head*, %struct.ylist_head** %3
%6 = load %struct.ylist_head*, %struct.ylist_head** %4
%7 = call i32 @ylist_replace(%struct.ylist_head* %5, %struct.ylist_head* %6)
%8 = load %struct.ylist_head*, %struct.ylist_head** %3
%9 = call i32 @INIT_YLIST_HEAD(%struct.ylist_head* %8)
ret void
}

LLVM IR (-O2):
%struct.ylist_head = type { i32 }
define void @ylist_replace_init(%struct.ylist_head* %0, %struct.ylist_head* %1) {
%3 = tail call i32 @ylist_replace(%struct.ylist_head* %0, %struct.ylist_head* %1)
%4 = tail call i32 @INIT_YLIST_HEAD(%struct.ylist_head* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ handle_CONT(int /*<<< orphan*/);
int gen_CONT(void) {
  handle_CONT(0);
  return 0;
}


x86 assembly (clang, -O0):
<gen_CONT>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <handle_CONT@plt>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @gen_CONT() {
%1 = call i32 @handle_CONT(i32 0)
ret i32 0
}

LLVM IR (-O2):
define i32 @gen_CONT() {
%1 = tail call i32 @handle_CONT(i32 0)
ret i32 0
}
void *test_InterlockedCompareExchangePointer(void *volatile *Destination,
                                             void *Exchange, void *Comparand) {
  return _InterlockedCompareExchangePointer(Destination, Exchange, Comparand);
}


x86 assembly (clang, -O0):
<test_InterlockedCompareExchangePointer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    $0x0,%al
call   1030 <_InterlockedCompareExchangePointer@plt>
cltq
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i8* @test_InterlockedCompareExchangePointer(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*** %4
%8 = load i8*, i8** %5
%9 = load i8*, i8** %6
%10 = call i32 (i8**, i8*, i8*, ...) bitcast (i32 (...)* @_InterlockedCompareExchangePointer to i32 (i8**, i8*, i8*, ...)*)(i8** %7, i8* %8, i8* %9)
%11 = sext i32 %10 to i64
%12 = inttoptr i64 %11 to i8*
ret i8* %12
}

LLVM IR (-O2):
define i8* @test_InterlockedCompareExchangePointer(i8** %0, i8* %1, i8* %2) {
%4 = tail call i32 (i8**, i8*, i8*, ...) bitcast (i32 (...)* @_InterlockedCompareExchangePointer to i32 (i8**, i8*, i8*, ...)*)(i8** %0, i8* %1, i8* %2)
%5 = sext i32 %4 to i64
%6 = inttoptr i64 %5 to i8*
ret i8* %6
}
/* Type definitions */
struct timezone {
  int dummy;
};
struct timeval {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ SYS_gettimeofday;
long syscall(int /*<<< orphan*/, struct timeval *, struct timezone *);
long sys_gtod(struct timeval *tv, struct timezone *tz) {
  return syscall(SYS_gettimeofday, tv, tz);
}


x86 assembly (clang, -O0):
<sys_gtod>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2eb1(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
call   1030 <syscall@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sys_gtod>:
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    0x2ebb(%rip),%rax
mov    (%rax),%edi
jmp    1030 <syscall@plt>

LLVM IR (-O0):
%struct.timeval = type { i32 }
%struct.timezone = type { i32 }
@SYS_gettimeofday = global i32 0
define i64 @sys_gtod(%struct.timeval* %0, %struct.timezone* %1) {
%3 = alloca %struct.timeval*
%4 = alloca %struct.timezone*
store %struct.timeval* %0, %struct.timeval** %3
store %struct.timezone* %1, %struct.timezone** %4
%5 = load i32, i32* @SYS_gettimeofday
%6 = load %struct.timeval*, %struct.timeval** %3
%7 = load %struct.timezone*, %struct.timezone** %4
%8 = call i64 @syscall(i32 %5, %struct.timeval* %6, %struct.timezone* %7)
ret i64 %8
}

LLVM IR (-O2):
%struct.timeval = type { i32 }
%struct.timezone = type { i32 }
@SYS_gettimeofday = global i32 0
define i64 @sys_gtod(%struct.timeval* %0, %struct.timezone* %1) {
%3 = load i32, i32* @SYS_gettimeofday
%4 = tail call i64 @syscall(i32 %3, %struct.timeval* %0, %struct.timezone* %1)
ret i64 %4
}
/* Type definitions */
struct VectorBase {
  int dummy;
};
struct MPSegment {
  int dummy;
};

/* Variables and functions */
struct VectorBase *GetMPSegmentVector(struct MPSegment *, char const *);
struct VectorBase *mp_vector_result(struct MPSegment *handle,
                                    const char *code) {
  return GetMPSegmentVector(handle, code);
}


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

x86 assembly (clang, -O2):
<mp_vector_result>:
jmp    1030 <GetMPSegmentVector@plt>

LLVM IR (-O0):
%struct.VectorBase = type { i32 }
%struct.MPSegment = type { i32 }
define %struct.VectorBase* @mp_vector_result(%struct.MPSegment* %0, i8* %1) {
%3 = alloca %struct.MPSegment*
%4 = alloca i8*
store %struct.MPSegment* %0, %struct.MPSegment** %3
store i8* %1, i8** %4
%5 = load %struct.MPSegment*, %struct.MPSegment** %3
%6 = load i8*, i8** %4
%7 = call %struct.VectorBase* @GetMPSegmentVector(%struct.MPSegment* %5, i8* %6)
ret %struct.VectorBase* %7
}

LLVM IR (-O2):
%struct.VectorBase = type { i32 }
%struct.MPSegment = type { i32 }
define %struct.VectorBase* @mp_vector_result(%struct.MPSegment* %0, i8* %1) {
%3 = tail call %struct.VectorBase* @GetMPSegmentVector(%struct.MPSegment* %0, i8* %1)
ret %struct.VectorBase* %3
}
/* Variables and functions */
int /*<<< orphan*/ SHA1(unsigned char *, int /*<<< orphan*/, unsigned char *);
int /*<<< orphan*/ strlen(unsigned char *);
void sha1(unsigned char *obuf, unsigned char *ibuf) {
  SHA1(ibuf, strlen(ibuf), (unsigned char *)obuf);
}


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

x86 assembly (clang, -O2):
<sha1>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1030 <strlen@plt>
mov    %rbx,%rdi
mov    %eax,%esi
mov    %r14,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <SHA1@plt>

LLVM IR (-O0):
define void @sha1(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** %4
%7 = call i32 @strlen(i8* %6)
%8 = load i8*, i8** %3
%9 = call i32 @SHA1(i8* %5, i32 %7, i8* %8)
ret void
}

LLVM IR (-O2):
define void @sha1(i8* %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %1)
%4 = tail call i32 @SHA1(i8* %1, i32 %3, i8* %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ mpz_t;

/* Variables and functions */
size_t mpz_sizeinbase(int /*<<< orphan*/, int);
size_t gmpint_strlen(mpz_t *op, int base) { return mpz_sizeinbase(*op, base); }


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

x86 assembly (clang, -O2):
<gmpint_strlen>:
mov    (%rdi),%edi
jmp    1030 <mpz_sizeinbase@plt>

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

LLVM IR (-O2):
define i64 @gmpint_strlen(i32* nocapture %0, i32 %1) {
%3 = load i32, i32* %0
%4 = tail call i64 @mpz_sizeinbase(i32 %3, i32 %1)
ret i64 %4
}
extern void insw(unsigned short port, void *addr, unsigned long count) {
  __asm__ __volatile__("rep ; ins"
                       "w"
                       : "=D"(addr), "=c"(count)
                       : "d"(port), "0"(addr), "1"(count));
}


x86 assembly (clang, -O0):
<insw>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x2(%rbp),%dx
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rcx
rep insw (%dx),%es:(%rdi)
mov    %rdi,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<insw>:
mov    %rdx,%rcx
mov    %edi,%edx
mov    %rsi,%rdi
rep insw (%dx),%es:(%rdi)
ret

LLVM IR (-O0):
define void @insw(i16 zeroext %0, i8* %1, i64 %2) {
%4 = alloca i16
%5 = alloca i8*
%6 = alloca i64
store i16 %0, i16* %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%7 = load i16, i16* %4
%8 = load i8*, i8** %5
%9 = load i64, i64* %6
%10 = call { i8*, i64 } asm sideeffect "rep ; insw", "={di},={cx},{dx},0,1,~{dirflag},~{fpsr},~{flags}"(i16 %7, i8* %8, i64 %9)
%11 = extractvalue { i8*, i64 } %10, 0
%12 = extractvalue { i8*, i64 } %10, 1
store i8* %11, i8** %5
store i64 %12, i64* %6
ret void
}

LLVM IR (-O2):
define void @insw(i16 zeroext %0, i8* %1, i64 %2) {
%4 = tail call { i8*, i64 } asm sideeffect "rep ; insw", "={di},={cx},{dx},0,1,~{dirflag},~{fpsr},~{flags}"(i16 %0, i8* %1, i64 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void cmdReversePerlHelp() { printf("creates reverse shell via perl\n"); }


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

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

LLVM IR (-O0):
@.str = [32 x i8] c"creates reverse shell via perl\0A\00"
define void @cmdReversePerlHelp() {
%1 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [31 x i8] c"creates reverse shell via perl\00"
define void @cmdReversePerlHelp() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
scalar_t__ _chdir(char *);
int /*<<< orphan*/ _write_to_socket(char *);
int do_cdup(void) {
  if (_chdir("..") < 0) {
    return -1;
  } else {
    _write_to_socket("250 CDUP Command ok.\r\n");
    return 0;
  }
}


x86 assembly (clang, -O0):
<do_cdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
call   1040 <_chdir@plt>
cmp    $0x0,%rax
jge    114a <do_cdup+0x2a>
movl   $0xffffffff,-0x4(%rbp)
jmp    115d <do_cdup+0x3d>
lea    0xeb2(%rip),%rdi
call   1030 <_write_to_socket@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_cdup>:
push   %rax
lea    0xed8(%rip),%rdi
call   1040 <_chdir@plt>
test   %rax,%rax
js     1142 <do_cdup+0x22>
lea    0xeca(%rip),%rdi
call   1030 <_write_to_socket@plt>
xor    %eax,%eax
pop    %rcx
ret
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"..\00"
@.str.1 = [23 x i8] c"250 CDUP Command ok.\0D\0A\00"
define i32 @do_cdup() {
%1 = alloca i32
%2 = call i64 @_chdir(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%3 = icmp slt i64 %2, 0
br i1 %3, label %4, label %5
4: ; preds = %0
store i32 -1, i32* %1
br label %7
5: ; preds = %0
%6 = call i32 @_write_to_socket(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0))
store i32 0, i32* %1
br label %7
7: ; preds = %5, %4
%8 = load i32, i32* %1
ret i32 %8
}

LLVM IR (-O2):
@.str = [3 x i8] c"..\00"
@.str.1 = [23 x i8] c"250 CDUP Command ok.\0D\0A\00"
define i32 @do_cdup() {
%1 = tail call i64 @_chdir(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%2 = icmp slt i64 %1, 0
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 @_write_to_socket(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0))
br label %5
5: ; preds = %0, %3
%6 = phi i32 [ 0, %3 ], [ -1, %0 ]
ret i32 %6
}
/* Type definitions */
typedef int /*<<< orphan*/ regex_t;

/* Variables and functions */
char *malloc(size_t);
size_t regerror(int, int /*<<< orphan*/ *, char *, size_t);
char *get_regerror(int errcode, regex_t *compiled) {
  size_t length = regerror(errcode, compiled, NULL, 0);
  char *buffer = malloc(length);
  if (buffer == 0)
    return 0;
  (void)regerror(errcode, compiled, buffer, length);
  return buffer;
}


x86 assembly (clang, -O0):
<get_regerror>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0xc(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0xc(%rbp),%edi
mov    -0x18(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%ecx
mov    %rcx,%rdx
call   1030 <regerror@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x28(%rbp)
cmpq   $0x0,-0x28(%rbp)
jne    116b <get_regerror+0x4b>
movq   $0x0,-0x8(%rbp)
jmp    1187 <get_regerror+0x67>
mov    -0xc(%rbp),%edi
mov    -0x18(%rbp),%rsi
mov    -0x28(%rbp),%rdx
mov    -0x20(%rbp),%rcx
call   1030 <regerror@plt>
mov    -0x28(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_regerror>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %edi,%r15d
xor    %edx,%edx
xor    %ecx,%ecx
call   1030 <regerror@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1040 <malloc@plt>
mov    %rax,%rbp
test   %rax,%rax
je     115a <get_regerror+0x3a>
mov    %r15d,%edi
mov    %r14,%rsi
mov    %rbp,%rdx
mov    %rbx,%rcx
call   1030 <regerror@plt>
mov    %rbp,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define i8* @get_regerror(i32 %0, i32* %1) {
%3 = tail call i64 @regerror(i32 %0, i32* %1, i8* null, i64 0)
%4 = tail call i8* @malloc(i64 %3)
%5 = icmp eq i8* %4, null
br i1 %5, label %8, label %6
6: ; preds = %2
%7 = tail call i64 @regerror(i32 %0, i32* %1, i8* %4, i64 %3)
br label %8
8: ; preds = %2, %6
ret i8* %4
}
void gtk_label_get_line_wrap() {}


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

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

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

LLVM IR (-O2):
define void @gtk_label_get_line_wrap() {
ret void
}
/* Variables and functions */
char *U_WMRCORENONE_set(char *);
char *U_WMRSETDIBTODEV_set(void) {
  return U_WMRCORENONE_set("U_WMRSETDIBTODEV");
}


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

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

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

LLVM IR (-O2):
@.str = [17 x i8] c"U_WMRSETDIBTODEV\00"
define i8* @U_WMRSETDIBTODEV_set() {
%1 = tail call i8* @U_WMRCORENONE_set(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}
/* Variables and functions */
int /*<<< orphan*/ errno;
int /*<<< orphan*/ strerror(int /*<<< orphan*/);
int /*<<< orphan*/ test_error(char *, int, char *, char const *,
                              int /*<<< orphan*/);
void test_perror(const char *s) {
  test_error("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
             "2022-01-22/02-19-57/repos/papyrussolution/OpenPapyrus/refs/heads/"
             "master/Src/OSF/OpenSSL-111/test/testutil/tests.c",
             143, "%s: %s", s, strerror(errno));
}


x86 assembly (clang, -O0):
<test_perror>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    0x2ea5(%rip),%rax
mov    (%rax),%edi
call   1030 <strerror@plt>
mov    -0x10(%rbp),%rcx
mov    %eax,%r8d
lea    0xeb0(%rip),%rdi
mov    $0x8f,%esi
lea    0xf56(%rip),%rdx
call   1040 <test_error@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_perror>:
push   %rbx
mov    %rdi,%rbx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
call   1030 <strerror@plt>
lea    0xec7(%rip),%rdi
lea    0xf72(%rip),%rdx
mov    $0x8f,%esi
mov    %rbx,%rcx
mov    %eax,%r8d
pop    %rbx
jmp    1040 <test_error@plt>

LLVM IR (-O0):
@.str = [178 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/papyrussolution/OpenPapyrus/refs/heads/master/Src/OSF/OpenSSL-111/test/testutil/tests.c\00"
@.str.1 = [7 x i8] c"%s: %s\00"
@errno = global i32 0
define void @test_perror(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i32, i32* @errno
%5 = call i32 @strerror(i32 %4)
%6 = call i32 @test_error(i8* getelementptr inbounds ([178 x i8], [178 x i8]* @.str, i64 0, i64 0), i32 143, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* %3, i32 %5)
ret void
}

LLVM IR (-O2):
@.str = [178 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/papyrussolution/OpenPapyrus/refs/heads/master/Src/OSF/OpenSSL-111/test/testutil/tests.c\00"
@.str.1 = [7 x i8] c"%s: %s\00"
@errno = global i32 0
define void @test_perror(i8* %0) {
%2 = load i32, i32* @errno
%3 = tail call i32 @strerror(i32 %2)
%4 = tail call i32 @test_error(i8* getelementptr inbounds ([178 x i8], [178 x i8]* @.str, i64 0, i64 0), i32 143, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* %0, i32 %3)
ret void
}
/* Variables and functions */
float atof(char *);
char *getenv(char *);
float in_get_sys_prop_float(char *key) {
  float value = 0.0;
  char *ev = getenv(key);
  if (ev == NULL) {
    return -1;
  }
  value = atof(ev);
  return value;
}


x86 assembly (clang, -O0):
<in_get_sys_prop_float>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <getenv@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    115e <in_get_sys_prop_float+0x3e>
movss  0xeac(%rip),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    1176 <in_get_sys_prop_float+0x56>
mov    -0x20(%rbp),%rdi
call   1040 <atof@plt>
movss  %xmm0,-0x14(%rbp)
movss  -0x14(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<in_get_sys_prop_float>:
push   %rax
call   1030 <getenv@plt>
test   %rax,%rax
je     1134 <in_get_sys_prop_float+0x14>
mov    %rax,%rdi
pop    %rax
jmp    1040 <atof@plt>
movss  0xec4(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @in_get_sys_prop_float(i8* %0) {
%2 = alloca float
%3 = alloca i8*
%4 = alloca float
%5 = alloca i8*
store i8* %0, i8** %3
store float 0.000000e+00, float* %4
%6 = load i8*, i8** %3
%7 = call i8* @getenv(i8* %6)
store i8* %7, i8** %5
%8 = load i8*, i8** %5
%9 = icmp eq i8* %8, null
br i1 %9, label %10, label %11
10: ; preds = %1
store float -1.000000e+00, float* %2
br label %15
11: ; preds = %1
%12 = load i8*, i8** %5
%13 = call float @atof(i8* %12)
store float %13, float* %4
%14 = load float, float* %4
store float %14, float* %2
br label %15
15: ; preds = %11, %10
%16 = load float, float* %2
ret float %16
}

LLVM IR (-O2):
define float @in_get_sys_prop_float(i8* nocapture %0) {
%2 = tail call i8* @getenv(i8* %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call float @atof(i8* %2)
br label %6
6: ; preds = %1, %4
%7 = phi float [ %5, %4 ], [ -1.000000e+00, %1 ]
ret float %7
}
/* Variables and functions */
int check(int, int, int);
scalar_t__ is_prime(int);
int main(int argc, char **argv) {
  int number = 0, found = 0;
  do {
    number++;
    if (is_prime(number)) {
      found++;
    }
  } while (found < 10001);
  return check(7, 104743, number);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
call   1030 <is_prime@plt>
cmp    $0x0,%rax
je     1168 <main+0x48>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    116d <main+0x4d>
cmpl   $0x2711,-0x18(%rbp)
jl     1144 <main+0x24>
mov    -0x14(%rbp),%edx
mov    $0x7,%edi
mov    $0x19927,%esi
call   1040 <check@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
xor    %ebx,%ebx
xor    %ebp,%ebp
nopw   0x0(%rax,%rax,1)
add    $0x1,%ebx
mov    %ebx,%edi
call   1030 <is_prime@plt>
cmp    $0x1,%rax
sbb    $0xffffffff,%ebp
cmp    $0x2711,%ebp
jb     1130 <main+0x10>
mov    $0x7,%edi
mov    $0x19927,%esi
mov    %ebx,%edx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <check@plt>

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %6
store i32 0, i32* %7
br label %8
8: ; preds = %18, %2
%9 = load i32, i32* %6
%10 = add nsw i32 %9, 1
store i32 %10, i32* %6
%11 = load i32, i32* %6
%12 = call i64 @is_prime(i32 %11)
%13 = icmp ne i64 %12, 0
br i1 %13, label %14, label %17
14: ; preds = %8
%15 = load i32, i32* %7
%16 = add nsw i32 %15, 1
store i32 %16, i32* %7
br label %17
17: ; preds = %14, %8
br label %18
18: ; preds = %17
%19 = load i32, i32* %7
%20 = icmp slt i32 %19, 10001
br i1 %20, label %8, label %21
21: ; preds = %18
%22 = load i32, i32* %6
%23 = call i32 @check(i32 7, i32 104743, i32 %22)
ret i32 %23
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i32 [ 0, %2 ], [ %6, %3 ]
%5 = phi i32 [ 0, %2 ], [ %10, %3 ]
%6 = add nuw nsw i32 %4, 1
%7 = tail call i64 @is_prime(i32 %6)
%8 = icmp ne i64 %7, 0
%9 = zext i1 %8 to i32
%10 = add nuw nsw i32 %5, %9
%11 = icmp ult i32 %10, 10001
br i1 %11, label %3, label %12
12: ; preds = %3
%13 = tail call i32 @check(i32 7, i32 104743, i32 %6)
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ merge_runs(int *, int *, size_t);
void merge_sort_natural_internal(int array[], int temp[], size_t length) {
  bool unsorted = true;
  while (unsorted) {
    merge_runs(array, temp, length);
    unsorted = !merge_runs(temp, array, length);
  }
}


x86 assembly (clang, -O0):
<merge_sort_natural_internal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movl   $0x1,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
je     116c <merge_sort_natural_internal+0x5c>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <merge_runs@plt>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <merge_runs@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x1c(%rbp)
jmp    112b <merge_sort_natural_internal+0x1b>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<merge_sort_natural_internal>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%rbx
xchg   %ax,%ax
mov    %rbx,%rdi
mov    %r15,%rsi
mov    %r14,%rdx
call   1030 <merge_runs@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
mov    %r14,%rdx
call   1030 <merge_runs@plt>
test   %eax,%eax
je     1120 <merge_sort_natural_internal+0x10>
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @merge_sort_natural_internal(i32* %0, i32* %1, i64 %2) {
%4 = alloca i32*
%5 = alloca i32*
%6 = alloca i64
%7 = alloca i32
store i32* %0, i32** %4
store i32* %1, i32** %5
store i64 %2, i64* %6
store i32 1, i32* %7
br label %8
8: ; preds = %11, %3
%9 = load i32, i32* %7
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %23
11: ; preds = %8
%12 = load i32*, i32** %4
%13 = load i32*, i32** %5
%14 = load i64, i64* %6
%15 = call i32 @merge_runs(i32* %12, i32* %13, i64 %14)
%16 = load i32*, i32** %5
%17 = load i32*, i32** %4
%18 = load i64, i64* %6
%19 = call i32 @merge_runs(i32* %16, i32* %17, i64 %18)
%20 = icmp ne i32 %19, 0
%21 = xor i1 %20, true
%22 = zext i1 %21 to i32
store i32 %22, i32* %7
br label %8
23: ; preds = %8
ret void
}

LLVM IR (-O2):
define void @merge_sort_natural_internal(i32* %0, i32* %1, i64 %2) {
br label %4
4: ; preds = %3, %4
%5 = tail call i32 @merge_runs(i32* %0, i32* %1, i64 %2)
%6 = tail call i32 @merge_runs(i32* %1, i32* %0, i64 %2)
%7 = icmp eq i32 %6, 0
br i1 %7, label %4, label %8
8: ; preds = %4
ret void
}
char *cmalloc(new_len, old, old_len)
char *old;
int old_len;
{
  char *new = malloc(new_len);
  if (new != 0)
    memcpy(new, old, old_len);
  return (new);
}


x86 assembly (clang, -O0):
<cmalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
movslq -0x4(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     115b <cmalloc+0x3b>
mov    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rsi
movslq -0x14(%rbp),%rdx
call   1030 <memcpy@plt>
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmalloc>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%ebp
mov    %rsi,%r14
movslq %edi,%rdi
call   1040 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
je     1147 <cmalloc+0x27>
movslq %ebp,%rdx
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <memcpy@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define noalias i8* @cmalloc(i32 %0, i8* nocapture %1, i32 %2) {
%4 = sext i32 %0 to i64
%5 = tail call i8* @malloc(i64 %4)
%6 = icmp eq i8* %5, null
br i1 %6, label %9, label %7
7: ; preds = %3
%8 = sext i32 %2 to i64
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 %5, i8* align 1 %1, i64 %8, i1 false)
br label %9
9: ; preds = %7, %3
ret i8* %5
}
char *setbrk(x)
int x;
{
  char *i, *calloc();
  if ((i = calloc(x, 1)) == 0) {
    errprint("Core limit reached");
    edone(0100);
  }
  return (i);
}


x86 assembly (clang, -O0):
<setbrk>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x1,%esi
mov    $0x0,%al
call   1040 <calloc@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
jne    1172 <setbrk+0x42>
lea    0xea1(%rip),%rdi
mov    $0x0,%al
call   1050 <errprint@plt>
mov    $0x40,%edi
mov    $0x0,%al
call   1030 <edone@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<setbrk>:
push   %rbx
mov    $0x1,%esi
xor    %eax,%eax
call   1040 <calloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    115f <setbrk+0x2f>
lea    0xeb4(%rip),%rdi
xor    %eax,%eax
call   1050 <errprint@plt>
mov    $0x40,%edi
xor    %eax,%eax
call   1030 <edone@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [19 x i8] c"Core limit reached\00"
define i8* @setbrk(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i8* (i32, i32, ...) bitcast (i8* (...)* @calloc to i8* (i32, i32, ...)*)(i32 %4, i32 1)
store i8* %5, i8** %3
%6 = icmp eq i8* %5, null
br i1 %6, label %7, label %10
7: ; preds = %1
%8 = call i32 (i8*, ...) bitcast (i32 (...)* @errprint to i32 (i8*, ...)*)(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%9 = call i32 (i32, ...) bitcast (i32 (...)* @edone to i32 (i32, ...)*)(i32 64)
br label %10
10: ; preds = %7, %1
%11 = load i8*, i8** %3
ret i8* %11
}

LLVM IR (-O2):
@.str = [19 x i8] c"Core limit reached\00"
define i8* @setbrk(i32 %0) {
%2 = tail call i8* (i32, i32, ...) bitcast (i8* (...)* @calloc to i8* (i32, i32, ...)*)(i32 %0, i32 1)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = tail call i32 (i8*, ...) bitcast (i32 (...)* @errprint to i32 (i8*, ...)*)(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%6 = tail call i32 (i32, ...) bitcast (i32 (...)* @edone to i32 (i32, ...)*)(i32 64)
br label %7
7: ; preds = %4, %1
ret i8* %2
}