xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ pthread_condattr_t;
typedef int /*<<< orphan*/ clockid_t;

/* Variables and functions */
int /*<<< orphan*/ CLOCK_REALTIME;
scalar_t__ check_initialized(int /*<<< orphan*/ const *);
int pthread_condattr_getclock(const pthread_condattr_t *attr,
                              clockid_t *clock_id) {
  if (check_initialized(attr)) {
    return -1;
  }
  *clock_id = CLOCK_REALTIME;
  return 0;
}


x86 assembly (clang, -O0):
<pthread_condattr_getclock>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <check_initialized@plt>
cmp    $0x0,%rax
je     113f <pthread_condattr_getclock+0x2f>
movl   $0xffffffff,-0x4(%rbp)
jmp    1155 <pthread_condattr_getclock+0x45>
mov    0x2e9a(%rip),%rax
mov    (%rax),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pthread_condattr_getclock>:
push   %rbx
mov    %rsi,%rbx
call   1030 <check_initialized@plt>
mov    %rax,%rcx
mov    $0xffffffff,%eax
test   %rcx,%rcx
je     1128 <pthread_condattr_getclock+0x18>
pop    %rbx
ret
mov    0x2eb1(%rip),%rax
mov    (%rax),%eax
mov    %eax,(%rbx)
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@CLOCK_REALTIME = global i32 0
define i32 @pthread_condattr_getclock(i32* %0, i32* nocapture writeonly %1) {
%3 = tail call i64 @check_initialized(i32* %0)
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = load i32, i32* @CLOCK_REALTIME
store i32 %6, i32* %1
br label %7
7: ; preds = %2, %5
%8 = phi i32 [ 0, %5 ], [ -1, %2 ]
ret i32 %8
}
XCopyGC() {}


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

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

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

LLVM IR (-O2):
define i32 @XCopyGC() {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
unsigned long long int strtoull(const char *restrict str,
                                char **restrict endptr, int base) {
  (void)str;
  (void)endptr;
  (void)base;
  puts("strtoull: not implemented");
  return 0;
}


x86 assembly (clang, -O0):
<strtoull>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
lea    0xed6(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [26 x i8] c"strtoull: not implemented\00"
define i64 @strtoull(i8* noalias %0, i8** noalias %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8**
%6 = alloca i32
store i8* %0, i8** %4
store i8** %1, i8*** %5
store i32 %2, i32* %6
%7 = load i8*, i8** %4
%8 = load i8**, i8*** %5
%9 = load i32, i32* %6
%10 = call i32 @puts(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
ret i64 0
}

LLVM IR (-O2):
@.str = [26 x i8] c"strtoull: not implemented\00"
define i64 @strtoull(i8* noalias nocapture readnone %0, i8** noalias nocapture readnone %1, i32 %2) {
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
ret i64 0
}
/* Variables and functions */
char EOF;
char getchar();
int main() {
  char c;
  int i = 0;
  int limit = 0;
  for (;;) {
    if (i < limit - 1)
      if ((c = getchar()) != '\n')
        if (c != EOF)
          ++i;
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0xc(%rbp),%eax
mov    -0x10(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    117d <main+0x6d>
mov    $0x0,%al
call   1030 <getchar@plt>
mov    %al,-0x5(%rbp)
movsbl %al,%eax
cmp    $0xa,%eax
je     1178 <main+0x68>
movsbl -0x5(%rbp),%eax
mov    0x2e89(%rip),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
je     1173 <main+0x63>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1178 <main+0x68>
jmp    117d <main+0x6d>
jmp    112d <main+0x1d>

x86 assembly (clang, -O2):
<main>:
jmp    1100 <main>

LLVM IR (-O0):
@EOF = global i8 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %3
store i32 0, i32* %4
br label %5
5: ; preds = %25, %0
%6 = load i32, i32* %3
%7 = load i32, i32* %4
%8 = sub nsw i32 %7, 1
%9 = icmp slt i32 %6, %8
br i1 %9, label %10, label %25
10: ; preds = %5
%11 = call signext i8 (...) @getchar()
store i8 %11, i8* %2
%12 = sext i8 %11 to i32
%13 = icmp ne i32 %12, 10
br i1 %13, label %14, label %24
14: ; preds = %10
%15 = load i8, i8* %2
%16 = sext i8 %15 to i32
%17 = load i8, i8* @EOF
%18 = sext i8 %17 to i32
%19 = icmp ne i32 %16, %18
br i1 %19, label %20, label %23
20: ; preds = %14
%21 = load i32, i32* %3
%22 = add nsw i32 %21, 1
store i32 %22, i32* %3
br label %23
23: ; preds = %20, %14
br label %24
24: ; preds = %23, %10
br label %25
25: ; preds = %24, %5
br label %5
}

LLVM IR (-O2):
@EOF = global i8 0
define i32 @main() {
br label %1
1: ; preds = %1, %0
br label %1
}
long long fll4(long long j, short *b, long long i) { return j + b[i]; }


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

x86 assembly (clang, -O2):
<fll4>:
movswq (%rsi,%rdx,2),%rax
add    %rdi,%rax
ret

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

LLVM IR (-O2):
define i64 @fll4(i64 %0, i16* nocapture %1, i64 %2) {
%4 = getelementptr inbounds i16, i16* %1, i64 %2
%5 = load i16, i16* %4
%6 = sext i16 %5 to i64
%7 = add nsw i64 %6, %0
ret i64 %7
}
int fun447() { return 447; }


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

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

LLVM IR (-O0):
define i32 @fun447() {
ret i32 447
}

LLVM IR (-O2):
define i32 @fun447() {
ret i32 447
}
int fun1266() { return 1266; }


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

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

LLVM IR (-O0):
define i32 @fun1266() {
ret i32 1266
}

LLVM IR (-O2):
define i32 @fun1266() {
ret i32 1266
}
void ppo0() {}


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

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

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

LLVM IR (-O2):
define void @ppo0() {
ret void
}
setMac() {
  char *bufor;
  scanf("%s", bufor);
  return bufor;
}


x86 assembly (clang, -O0):
<setMac>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    -0x8(%rbp),%rsi
lea    0xedd(%rip),%rdi
mov    $0x0,%al
call   1030 <scanf@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<setMac>:
lea    0xee9(%rip),%rdi
xor    %eax,%eax
jmp    1030 <scanf@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
define i32 @setMac() {
%1 = alloca i8*
%2 = load i8*, i8** %1
%3 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = load i8*, i8** %1
%5 = ptrtoint i8* %4 to i32
ret i32 %5
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define i32 @setMac() {
%1 = tail call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* undef)
ret i32 undef
}
void test3(_Complex int *x) { *x = ~*x; }


x86 assembly (clang, -O0):
<test3>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edx
xor    %ecx,%ecx
sub    0x4(%rax),%ecx
mov    -0x8(%rbp),%rax
mov    %edx,(%rax)
mov    %ecx,0x4(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<test3>:
negl   0x4(%rdi)
ret

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

LLVM IR (-O2):
define void @test3({ i32, i32 }* nocapture %0) {
%2 = getelementptr inbounds { i32, i32 }, { i32, i32 }* %0, i64 0, i32 1
%3 = load i32, i32* %2
%4 = sub i32 0, %3
store i32 %4, i32* %2
ret void
}
int main(void) {
  char *p = (char *)0xE000000;
  return ((int (*)(void))p)();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0xe000000,%eax
mov    %rax,-0x10(%rbp)
call   *-0x10(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
store i32 0, i32* %1
store i8* inttoptr (i64 234881024 to i8*), i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to i32 ()*
%5 = call i32 %4()
ret i32 %5
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 inttoptr (i64 234881024 to i32 ()*)()
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ laguna_writeb(int, int);
void __svgalib_laguna_outcrtc(int i, int d) {
  if (i > 0x1e)
    return;
  laguna_writeb(i * 4, d);
}


x86 assembly (clang, -O0):
<__svgalib_laguna_outcrtc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x1e,-0x4(%rbp)
jle    112d <__svgalib_laguna_outcrtc+0x1d>
jmp    113b <__svgalib_laguna_outcrtc+0x2b>
mov    -0x4(%rbp),%edi
shl    $0x2,%edi
mov    -0x8(%rbp),%esi
call   1030 <laguna_writeb@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__svgalib_laguna_outcrtc>:
cmp    $0x1e,%edi
jle    1116 <__svgalib_laguna_outcrtc+0x6>
ret
shl    $0x2,%edi
jmp    1030 <laguna_writeb@plt>

LLVM IR (-O0):
define void @__svgalib_laguna_outcrtc(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = icmp sgt i32 %5, 30
br i1 %6, label %7, label %8
7: ; preds = %2
br label %13
8: ; preds = %2
%9 = load i32, i32* %3
%10 = mul nsw i32 %9, 4
%11 = load i32, i32* %4
%12 = call i32 @laguna_writeb(i32 %10, i32 %11)
br label %13
13: ; preds = %8, %7
ret void
}

LLVM IR (-O2):
define void @__svgalib_laguna_outcrtc(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, 30
br i1 %3, label %7, label %4
4: ; preds = %2
%5 = shl nsw i32 %0, 2
%6 = tail call i32 @laguna_writeb(i32 %5, i32 %1)
br label %7
7: ; preds = %2, %4
ret void
}
/* Variables and functions */
int /*<<< orphan*/ opt_warning(char *);
void opt_UNDELIM_deprecated() {
  opt_warning("OPT_UNDELIM and OPT_UNDELIMC are deprecated...");
  opt_warning("You should use positional options instead.");
  opt_warning(
      "If this warning message is a problem, then recompile the source");
  opt_warning("with the symbol OPT_DEPRECATED_OK defined.");
}


x86 assembly (clang, -O0):
<opt_UNDELIM_deprecated>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <opt_warning@plt>
lea    0xf08(%rip),%rdi
call   1030 <opt_warning@plt>
lea    0xf27(%rip),%rdi
call   1030 <opt_warning@plt>
lea    0xf5b(%rip),%rdi
call   1030 <opt_warning@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<opt_UNDELIM_deprecated>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <opt_warning@plt>
lea    0xf0b(%rip),%rdi
call   1030 <opt_warning@plt>
lea    0xf2a(%rip),%rdi
call   1030 <opt_warning@plt>
lea    0xf5e(%rip),%rdi
pop    %rax
jmp    1030 <opt_warning@plt>

LLVM IR (-O0):
@.str = [47 x i8] c"OPT_UNDELIM and OPT_UNDELIMC are deprecated...\00"
@.str.1 = [43 x i8] c"You should use positional options instead.\00"
@.str.2 = [64 x i8] c"If this warning message is a problem, then recompile the source\00"
@.str.3 = [43 x i8] c"with the symbol OPT_DEPRECATED_OK defined.\00"
define void @opt_UNDELIM_deprecated() {
%1 = call i32 @opt_warning(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @opt_warning(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @opt_warning(i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @opt_warning(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [47 x i8] c"OPT_UNDELIM and OPT_UNDELIMC are deprecated...\00"
@.str.1 = [43 x i8] c"You should use positional options instead.\00"
@.str.2 = [64 x i8] c"If this warning message is a problem, then recompile the source\00"
@.str.3 = [43 x i8] c"with the symbol OPT_DEPRECATED_OK defined.\00"
define void @opt_UNDELIM_deprecated() {
%1 = tail call i32 @opt_warning(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @opt_warning(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @opt_warning(i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str.2, i64 0, i64 0))
%4 = tail call i32 @opt_warning(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.3, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
void test_vmvn_u8x8(uint8_t *__restrict__ dest, uint8_t *a) {
  int i;
  for (i = 0; i < 8; i++) {
    dest[i] = ~a[i];
  }
}


x86 assembly (clang, -O0):
<test_vmvn_u8x8>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x8,-0x14(%rbp)
jge    1144 <test_vmvn_u8x8+0x44>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
xor    $0xffffffff,%edx
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1113 <test_vmvn_u8x8+0x13>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_vmvn_u8x8>:
movdqu (%rsi),%xmm0
pcmpeqd %xmm1,%xmm1
pxor   %xmm1,%xmm0
movdqu %xmm0,(%rdi)
movdqu 0x10(%rsi),%xmm0
pxor   %xmm1,%xmm0
movdqu %xmm0,0x10(%rdi)
ret

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

LLVM IR (-O2):
define void @test_vmvn_u8x8(i32* noalias nocapture writeonly %0, i32* nocapture %1) {
%3 = bitcast i32* %1 to <4 x i32>*
%4 = load <4 x i32>, <4 x i32>* %3
%5 = xor <4 x i32> %4, <i32 -1, i32 -1, i32 -1, i32 -1>
%6 = bitcast i32* %0 to <4 x i32>*
store <4 x i32> %5, <4 x i32>* %6
%7 = getelementptr inbounds i32, i32* %1, i64 4
%8 = getelementptr inbounds i32, i32* %0, i64 4
%9 = bitcast i32* %7 to <4 x i32>*
%10 = load <4 x i32>, <4 x i32>* %9
%11 = xor <4 x i32> %10, <i32 -1, i32 -1, i32 -1, i32 -1>
%12 = bitcast i32* %8 to <4 x i32>*
store <4 x i32> %11, <4 x i32>* %12
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _my_log(char *, int, char *, char *, int, char const *);
void log_info(const char *errstr) {
  do {
    _my_log("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
            "2022-01-22/02-19-57/repos/zhongliangkang/twemproxy41/refs/heads/"
            "master/migrate/transfer.c",
            441, "[ INFO ] at %s:%d ,info: %s\n",
            "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
            "2022-01-22/02-19-57/repos/zhongliangkang/twemproxy41/refs/heads/"
            "master/migrate/transfer.c",
            441, errstr);
  } while (0);
}


x86 assembly (clang, -O0):
<log_info>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%r9
lea    0xed9(%rip),%rcx
mov    $0x1b9,%r8d
lea    0xf66(%rip),%rdx
mov    %rcx,%rdi
mov    %r8d,%esi
call   1030 <_my_log@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<log_info>:
mov    %rdi,%r9
lea    0xf80(%rip),%rdx
lea    0xedf(%rip),%rcx
mov    %rcx,%rdi
mov    $0x1b9,%esi
mov    $0x1b9,%r8d
jmp    1030 <_my_log@plt>

LLVM IR (-O0):
@.str = [154 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/zhongliangkang/twemproxy41/refs/heads/master/migrate/transfer.c\00"
@.str.1 = [29 x i8] c"[ INFO ] at %s:%d ,info: %s\0A\00"
define void @log_info(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %1
%4 = load i8*, i8** %2
%5 = call i32 @_my_log(i8* getelementptr inbounds ([154 x i8], [154 x i8]* @.str, i64 0, i64 0), i32 441, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([154 x i8], [154 x i8]* @.str, i64 0, i64 0), i32 441, i8* %4)
br label %6
6: ; preds = %3
ret void
}

LLVM IR (-O2):
@.str = [154 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/zhongliangkang/twemproxy41/refs/heads/master/migrate/transfer.c\00"
@.str.1 = [29 x i8] c"[ INFO ] at %s:%d ,info: %s\0A\00"
define void @log_info(i8* %0) {
%2 = tail call i32 @_my_log(i8* getelementptr inbounds ([154 x i8], [154 x i8]* @.str, i64 0, i64 0), i32 441, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([154 x i8], [154 x i8]* @.str, i64 0, i64 0), i32 441, i8* %0)
ret void
}
/* Variables and functions */
scalar_t__ memcmp(char *, char *, int);
int k_equal(char *node_key, char *key, int node_k_len, int key_length) {
  if (node_k_len != key_length)
    return (0);
  if (memcmp(node_key, key, key_length) == 0)
    return (1);
  return (0);
}


x86 assembly (clang, -O0):
<k_equal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
mov    %ecx,-0x20(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x20(%rbp),%eax
je     113e <k_equal+0x2e>
movl   $0x0,-0x4(%rbp)
jmp    116b <k_equal+0x5b>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%edx
call   1030 <memcmp@plt>
cmp    $0x0,%rax
jne    1164 <k_equal+0x54>
movl   $0x1,-0x4(%rbp)
jmp    116b <k_equal+0x5b>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<k_equal>:
xor    %eax,%eax
cmp    %ecx,%edx
jne    112b <k_equal+0x1b>
push   %rax
call   1030 <memcmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
sete   %al
add    $0x8,%rsp
ret

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

LLVM IR (-O2):
define i32 @k_equal(i8* %0, i8* %1, i32 %2, i32 %3) {
%5 = icmp eq i32 %2, %3
br i1 %5, label %6, label %10
6: ; preds = %4
%7 = tail call i64 @memcmp(i8* %0, i8* %1, i32 %2)
%8 = icmp eq i64 %7, 0
%9 = zext i1 %8 to i32
br label %10
10: ; preds = %6, %4
%11 = phi i32 [ 0, %4 ], [ %9, %6 ]
ret i32 %11
}
/* Type definitions */
struct vink_arena {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ memset(void *, int /*<<< orphan*/, size_t);
void *vink_arena_alloc(struct vink_arena *, size_t);
void *vink_arena_calloc(struct vink_arena *arena, size_t size) {
  void *result;
  result = vink_arena_alloc(arena, size);
  if (!result)
    return 0;
  memset(result, 0, size);
  return result;
}


x86 assembly (clang, -O0):
<vink_arena_calloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <vink_arena_alloc@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    1159 <vink_arena_calloc+0x39>
movq   $0x0,-0x8(%rbp)
jmp    1170 <vink_arena_calloc+0x50>
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rdx
xor    %esi,%esi
call   1040 <memset@plt>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
%struct.vink_arena = type { i32 }
define i8* @vink_arena_calloc(%struct.vink_arena* %0, i64 %1) {
%3 = tail call i8* @vink_arena_alloc(%struct.vink_arena* %0, i64 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 @memset(i8* %3, i32 0, i64 %1)
br label %7
7: ; preds = %2, %5
ret i8* %3
}
void RTSemRWRequestWriteDebug(void) {}


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

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

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

LLVM IR (-O2):
define void @RTSemRWRequestWriteDebug() {
ret void
}
char *mtp3_state(int state) {
  switch (state) {
  case 0:
    return "DOWN";
  case 1:
    return "UP";
  default:
    return "UNKNOWN";
  }
}


x86 assembly (clang, -O0):
<mtp3_state>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
test   %eax,%eax
je     112b <mtp3_state+0x2b>
jmp    111a <mtp3_state+0x1a>
mov    -0x10(%rbp),%eax
sub    $0x1,%eax
je     113b <mtp3_state+0x3b>
jmp    114b <mtp3_state+0x4b>
lea    0xece(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1156 <mtp3_state+0x56>
lea    0xec3(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1156 <mtp3_state+0x56>
lea    0xeb6(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mtp3_state>:
cmp    $0x1,%edi
lea    0xefb(%rip),%rax
lea    0xef7(%rip),%rcx
cmove  %rax,%rcx
test   %edi,%edi
lea    0xee2(%rip),%rax
cmovne %rcx,%rax
ret

LLVM IR (-O0):
@.str = [5 x i8] c"DOWN\00"
@.str.1 = [3 x i8] c"UP\00"
@.str.2 = [8 x i8] c"UNKNOWN\00"
define i8* @mtp3_state(i32 %0) {
%2 = alloca i8*
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %7 [
i32 0, label %5
i32 1, label %6
]
5: ; preds = %1
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8** %2
br label %8
6: ; preds = %1
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8** %2
br label %8
7: ; preds = %1
store i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i8** %2
br label %8
8: ; preds = %7, %6, %5
%9 = load i8*, i8** %2
ret i8* %9
}

LLVM IR (-O2):
@.str = [5 x i8] c"DOWN\00"
@.str.1 = [3 x i8] c"UP\00"
@.str.2 = [8 x i8] c"UNKNOWN\00"
define i8* @mtp3_state(i32 %0) {
%2 = icmp eq i32 %0, 1
%3 = select i1 %2, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0)
%4 = icmp eq i32 %0, 0
%5 = select i1 %4, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %3
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(char **, char *, int);
void brnflip_flip_32_in_place(char *x) {
  char temp[4];
  memcpy(&temp, x, 4);
  x[0] = temp[3];
  x[1] = temp[2];
  x[2] = temp[1];
  x[3] = temp[0];
}


x86 assembly (clang, -O0):
<brnflip_flip_32_in_place>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0xc(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    $0x4,%edx
call   1030 <memcpy@plt>
mov    -0x9(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0xa(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x1(%rax)
mov    -0xb(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x2(%rax)
mov    -0xc(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x3(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<brnflip_flip_32_in_place>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
lea    0xc(%rsp),%rdi
mov    %rbx,%rsi
mov    $0x4,%edx
call   1030 <memcpy@plt>
mov    0xf(%rsp),%al
mov    %al,(%rbx)
mov    0xe(%rsp),%al
mov    %al,0x1(%rbx)
mov    0xd(%rsp),%al
mov    %al,0x2(%rbx)
mov    0xc(%rsp),%al
mov    %al,0x3(%rbx)
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
define void @brnflip_flip_32_in_place(i8* %0) {
%2 = alloca [4 x i8]
%3 = getelementptr inbounds [4 x i8], [4 x i8]* %2, i64 0, i64 0
%4 = bitcast [4 x i8]* %2 to i8**
%5 = call i32 @memcpy(i8** %4, i8* %0, i32 4)
%6 = getelementptr inbounds [4 x i8], [4 x i8]* %2, i64 0, i64 3
%7 = load i8, i8* %6
store i8 %7, i8* %0
%8 = getelementptr inbounds [4 x i8], [4 x i8]* %2, i64 0, i64 2
%9 = load i8, i8* %8
%10 = getelementptr inbounds i8, i8* %0, i64 1
store i8 %9, i8* %10
%11 = getelementptr inbounds [4 x i8], [4 x i8]* %2, i64 0, i64 1
%12 = load i8, i8* %11
%13 = getelementptr inbounds i8, i8* %0, i64 2
store i8 %12, i8* %13
%14 = load i8, i8* %3
%15 = getelementptr inbounds i8, i8* %0, i64 3
store i8 %14, i8* %15
ret void
}
void smsandh_destroy(struct smsandh *sandh __attribute__((unused))) {}


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

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

LLVM IR (-O0):
%struct.smsandh = type opaque
define void @smsandh_destroy(%struct.smsandh* %0) {
%2 = alloca %struct.smsandh*
store %struct.smsandh* %0, %struct.smsandh** %2
ret void
}

LLVM IR (-O2):
%struct.smsandh = type opaque
define void @smsandh_destroy(%struct.smsandh* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ enable_servos();
int /*<<< orphan*/ set_servo_position(int, int);
void servo_initialize(int port0_position, int port1_position,
                      int port2_position, int port3_position) {
  set_servo_position(0, port0_position);
  set_servo_position(1, port1_position);
  set_servo_position(2, port2_position);
  set_servo_position(3, port3_position);
  enable_servos();
}


x86 assembly (clang, -O0):
<servo_initialize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x4(%rbp),%esi
xor    %edi,%edi
call   1040 <set_servo_position@plt>
mov    -0x8(%rbp),%esi
mov    $0x1,%edi
call   1040 <set_servo_position@plt>
mov    -0xc(%rbp),%esi
mov    $0x2,%edi
call   1040 <set_servo_position@plt>
mov    -0x10(%rbp),%esi
mov    $0x3,%edi
call   1040 <set_servo_position@plt>
mov    $0x0,%al
call   1030 <enable_servos@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<servo_initialize>:
push   %rbp
push   %r14
push   %rbx
mov    %ecx,%r14d
mov    %edx,%ebp
mov    %esi,%ebx
mov    %edi,%esi
xor    %edi,%edi
call   1040 <set_servo_position@plt>
mov    $0x1,%edi
mov    %ebx,%esi
call   1040 <set_servo_position@plt>
mov    $0x2,%edi
mov    %ebp,%esi
call   1040 <set_servo_position@plt>
mov    $0x3,%edi
mov    %r14d,%esi
call   1040 <set_servo_position@plt>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <enable_servos@plt>

LLVM IR (-O0):
define void @servo_initialize(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 = call i32 @set_servo_position(i32 0, i32 %9)
%11 = load i32, i32* %6
%12 = call i32 @set_servo_position(i32 1, i32 %11)
%13 = load i32, i32* %7
%14 = call i32 @set_servo_position(i32 2, i32 %13)
%15 = load i32, i32* %8
%16 = call i32 @set_servo_position(i32 3, i32 %15)
%17 = call i32 (...) @enable_servos()
ret void
}

LLVM IR (-O2):
define void @servo_initialize(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = tail call i32 @set_servo_position(i32 0, i32 %0)
%6 = tail call i32 @set_servo_position(i32 1, i32 %1)
%7 = tail call i32 @set_servo_position(i32 2, i32 %2)
%8 = tail call i32 @set_servo_position(i32 3, i32 %3)
%9 = tail call i32 (...) @enable_servos()
ret void
}
/* Variables and functions */
unsigned long atoi(char *);
char *getenv(char *);
long long int getfilesize_env() {
  unsigned long tContentLength = 0;
  char *cContentLength = NULL;
  if (getenv("CONTENT_LENGTH") != NULL) {
    cContentLength = getenv("CONTENT_LENGTH");
    tContentLength = atoi(cContentLength);
  } else
    return -1;
  return tContentLength;
}


x86 assembly (clang, -O0):
<getfilesize_env>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movq   $0x0,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
lea    0xec1(%rip),%rdi
call   1030 <getenv@plt>
cmp    $0x0,%rax
je     1170 <getfilesize_env+0x50>
lea    0xeab(%rip),%rdi
call   1030 <getenv@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <atoi@plt>
mov    %rax,-0x10(%rbp)
jmp    117d <getfilesize_env+0x5d>
movq   $0xffffffffffffffff,-0x8(%rbp)
ff
jmp    1185 <getfilesize_env+0x65>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getfilesize_env>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <getenv@plt>
test   %rax,%rax
je     113b <getfilesize_env+0x1b>
mov    %rax,%rdi
pop    %rax
jmp    1040 <atoi@plt>
mov    $0xffffffffffffffff,%rax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [15 x i8] c"CONTENT_LENGTH\00"
define i64 @getfilesize_env() {
%1 = tail call i8* @getenv(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%2 = icmp eq i8* %1, null
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i64 @atoi(i8* %1)
br label %5
5: ; preds = %0, %3
%6 = phi i64 [ %4, %3 ], [ -1, %0 ]
ret i64 %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void usage() { printf("Usage:  dump <addr>\n"); }


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

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

LLVM IR (-O0):
@.str = [21 x i8] c"Usage: dump <addr>\0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [20 x i8] c"Usage: dump <addr>\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int atoi(char const *);
int /*<<< orphan*/ display(int);
int main(int argc, char const *argv[]) {
  int n = atoi(argv[1]);
  display(n);
  return 0;
}


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)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1040 <atoi@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
call   1030 <display@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x8(%rsi),%rdi
call   1040 <atoi@plt>
mov    %eax,%edi
call   1030 <display@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = load i8**, i8*** %5
%8 = getelementptr inbounds i8*, i8** %7, i64 1
%9 = load i8*, i8** %8
%10 = call i32 @atoi(i8* %9)
store i32 %10, i32* %6
%11 = load i32, i32* %6
%12 = call i32 @display(i32 %11)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = load i8*, i8** %3
%5 = tail call i32 @atoi(i8* %4)
%6 = tail call i32 @display(i32 %5)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ SIOCATMARK;
scalar_t__ ioctl(int, int /*<<< orphan*/, int *);
int sockatmark(int sockfd) {
  int flag;
  if (ioctl(sockfd, SIOCATMARK, &flag) < 0)
    return -1;
  return (flag != 0);
}


x86 assembly (clang, -O0):
<sockatmark>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
mov    0x2ebb(%rip),%rax
mov    (%rax),%esi
lea    -0xc(%rbp),%rdx
call   1030 <ioctl@plt>
cmp    $0x0,%rax
jge    1146 <sockatmark+0x36>
movl   $0xffffffff,-0x4(%rbp)
jmp    1155 <sockatmark+0x45>
cmpl   $0x0,-0xc(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sockatmark>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%esi
lea    0x4(%rsp),%rdx
call   1030 <ioctl@plt>
xor    %ecx,%ecx
cmpl   $0x0,0x4(%rsp)
setne  %cl
test   %rax,%rax
mov    $0xffffffff,%eax
cmovns %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@SIOCATMARK = global i32 0
define i32 @sockatmark(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* @SIOCATMARK
%7 = call i64 @ioctl(i32 %5, i32 %6, i32* %4)
%8 = icmp slt i64 %7, 0
br i1 %8, label %9, label %10
9: ; preds = %1
store i32 -1, i32* %2
br label %14
10: ; preds = %1
%11 = load i32, i32* %4
%12 = icmp ne i32 %11, 0
%13 = zext i1 %12 to i32
store i32 %13, i32* %2
br label %14
14: ; preds = %10, %9
%15 = load i32, i32* %2
ret i32 %15
}

LLVM IR (-O2):
@SIOCATMARK = global i32 0
define i32 @sockatmark(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = load i32, i32* @SIOCATMARK
%5 = call i64 @ioctl(i32 %0, i32 %4, i32* %2)
%6 = icmp slt i64 %5, 0
%7 = load i32, i32* %2
%8 = icmp ne i32 %7, 0
%9 = zext i1 %8 to i32
%10 = select i1 %6, i32 -1, i32 %9
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ abort();
long foo(long);
int main() {
  long int a = 0x4272AL;
  if (foo(a) == a)
    abort();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0x4272a,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <foo@plt>
cmp    -0x10(%rbp),%rax
jne    1151 <main+0x31>
mov    $0x0,%al
call   1030 <abort@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x4272a,%edi
call   1040 <foo@plt>
cmp    $0x4272a,%rax
je     1137 <main+0x17>
xor    %eax,%eax
pop    %rcx
ret
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i64
store i32 0, i32* %1
store i64 272170, i64* %2
%3 = load i64, i64* %2
%4 = call i64 @foo(i64 %3)
%5 = load i64, i64* %2
%6 = icmp eq i64 %4, %5
br i1 %6, label %7, label %9
7: ; preds = %0
%8 = call i32 (...) @abort()
unreachable
9: ; preds = %0
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i64 @foo(i64 272170)
%2 = icmp eq i64 %1, 272170
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 (...) @abort()
unreachable
5: ; preds = %0
ret i32 0
}
/* Type definitions */
struct stat {
  int /*<<< orphan*/ st_mode;
};

/* Variables and functions */
int /*<<< orphan*/ S_ISLNK(int /*<<< orphan*/);
scalar_t__ lstat(char *, struct stat *);
int _symlink_exists(char *path) {
  struct stat buf;
  if (lstat(path, &buf)) {
    return 0;
  }
  if (!S_ISLNK(buf.st_mode)) {
    return -1;
  }
  return 1;
}


x86 assembly (clang, -O0):
<_symlink_exists>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1040 <lstat@plt>
cmp    $0x0,%rax
je     114f <_symlink_exists+0x2f>
movl   $0x0,-0x4(%rbp)
jmp    1173 <_symlink_exists+0x53>
mov    -0x18(%rbp),%edi
call   1030 <S_ISLNK@plt>
cmp    $0x0,%eax
jne    116c <_symlink_exists+0x4c>
movl   $0xffffffff,-0x4(%rbp)
jmp    1173 <_symlink_exists+0x53>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_symlink_exists>:
push   %rax
mov    %rsp,%rsi
call   1040 <lstat@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
je     1135 <_symlink_exists+0x15>
pop    %rcx
ret
mov    (%rsp),%edi
call   1030 <S_ISLNK@plt>
cmp    $0x1,%eax
sbb    %eax,%eax
or     $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
define i32 @_symlink_exists(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca %struct.stat
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i64 @lstat(i8* %5, %struct.stat* %4)
%7 = icmp ne i64 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %1
store i32 0, i32* %2
br label %16
9: ; preds = %1
%10 = getelementptr inbounds %struct.stat, %struct.stat* %4, i32 0, i32 0
%11 = load i32, i32* %10
%12 = call i32 @S_ISLNK(i32 %11)
%13 = icmp ne i32 %12, 0
br i1 %13, label %15, label %14
14: ; preds = %9
store i32 -1, i32* %2
br label %16
15: ; preds = %9
store i32 1, i32* %2
br label %16
16: ; preds = %15, %14, %8
%17 = load i32, i32* %2
ret i32 %17
}

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @_symlink_exists(i8* nocapture %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i64 @lstat(i8* %0, %struct.stat* %2)
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %12
6: ; preds = %1
%7 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%8 = load i32, i32* %7
%9 = tail call i32 @S_ISLNK(i32 %8)
%10 = icmp eq i32 %9, 0
%11 = select i1 %10, i32 -1, i32 1
br label %12
12: ; preds = %6, %1
%13 = phi i32 [ 0, %1 ], [ %11, %6 ]
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ setx(int *, int *);
void sety(int *x, int *y) { setx(y, x); }


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

x86 assembly (clang, -O2):
<sety>:
mov    %rdi,%rax
mov    %rsi,%rdi
mov    %rax,%rsi
jmp    1030 <setx@plt>

LLVM IR (-O0):
define void @sety(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 = load i32*, i32** %3
%7 = call i32 @setx(i32* %5, i32* %6)
ret void
}

LLVM IR (-O2):
define void @sety(i32* %0, i32* %1) {
%3 = tail call i32 @setx(i32* %1, i32* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ BBM_TS_START(void *);
void mtv_ts_start(void *hDevice) { BBM_TS_START(hDevice); }


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

x86 assembly (clang, -O2):
<mtv_ts_start>:
jmp    1030 <BBM_TS_START@plt>

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

LLVM IR (-O2):
define void @mtv_ts_start(i8* %0) {
%2 = tail call i32 @BBM_TS_START(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ free(int *);
int /*<<< orphan*/ stderr;
void error_sort(int arr[], size_t low, size_t high) {
  fprintf(stderr, "Exception: Maximal recursion depth!");
  free(arr);
  exit(1);
}


x86 assembly (clang, -O0):
<error_sort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    0x2e95(%rip),%rax
mov    (%rax),%edi
lea    0xeac(%rip),%rsi
call   1040 <fprintf@plt>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<error_sort>:
push   %rbx
mov    %rdi,%rbx
mov    0x2ea5(%rip),%rax
mov    (%rax),%edi
lea    0xebc(%rip),%rsi
call   1040 <fprintf@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [36 x i8] c"Exception: Maximal recursion depth!\00"
define void @error_sort(i32* %0, i64 %1, i64 %2) {
%4 = alloca i32*
%5 = alloca i64
%6 = alloca i64
store i32* %0, i32** %4
store i64 %1, i64* %5
store i64 %2, i64* %6
%7 = load i32, i32* @stderr
%8 = call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
%9 = load i32*, i32** %4
%10 = call i32 @free(i32* %9)
%11 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [36 x i8] c"Exception: Maximal recursion depth!\00"
define void @error_sort(i32* nocapture %0, i64 %1, i64 %2) {
%4 = load i32, i32* @stderr
%5 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
%6 = tail call i32 @free(i32* %0)
%7 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ SubTickNotify(int);
void SubTickTaskEnd(void) { SubTickNotify(16 - 1); }


x86 assembly (clang, -O0):
<SubTickTaskEnd>:
push   %rbp
mov    %rsp,%rbp
mov    $0xf,%edi
call   1030 <SubTickNotify@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<SubTickTaskEnd>:
mov    $0xf,%edi
jmp    1030 <SubTickNotify@plt>

LLVM IR (-O0):
define void @SubTickTaskEnd() {
%1 = call i32 @SubTickNotify(i32 15)
ret void
}

LLVM IR (-O2):
define void @SubTickTaskEnd() {
%1 = tail call i32 @SubTickNotify(i32 15)
ret void
}
/* Type definitions */
typedef int fpu_control_t;

/* Variables and functions */
int /*<<< orphan*/ _FPU_GETCW(int);
int /*<<< orphan*/ _FPU_SETCW(int);
int fesetround(int round) {
  fpu_control_t cw;
  if ((round & ~0x1) != 0)
    return 1;
  _FPU_GETCW(cw);
  cw &= ~0x1;
  cw |= round;
  _FPU_SETCW(cw);
  return 0;
}


x86 assembly (clang, -O0):
<fesetround>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
and    $0xfffffffe,%eax
cmp    $0x0,%eax
je     1146 <fesetround+0x26>
movl   $0x1,-0x4(%rbp)
jmp    116f <fesetround+0x4f>
mov    -0xc(%rbp),%edi
call   1030 <_FPU_GETCW@plt>
mov    -0xc(%rbp),%eax
and    $0xfffffffe,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
or     -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%edi
call   1040 <_FPU_SETCW@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fesetround>:
mov    $0x1,%eax
cmp    $0x1,%edi
ja     113c <fesetround+0x1c>
push   %rbx
mov    %edi,%ebx
call   1030 <_FPU_GETCW@plt>
mov    %ebx,%edi
call   1040 <_FPU_SETCW@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @fesetround(i32 %0) {
%2 = icmp ult i32 %0, 2
br i1 %2, label %3, label %6
3: ; preds = %1
%4 = tail call i32 @_FPU_GETCW(i32 undef)
%5 = tail call i32 @_FPU_SETCW(i32 %0)
br label %6
6: ; preds = %1, %3
%7 = phi i32 [ 0, %3 ], [ 1, %1 ]
ret i32 %7
}