xunge/DecIR huggingface dataset:
int icrypto_init(void) { return 0; }


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

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

LLVM IR (-O0):
define i32 @icrypto_init() {
ret i32 0
}

LLVM IR (-O2):
define i32 @icrypto_init() {
ret i32 0
}
/* Variables and functions */
long double __infer_nondet_long_double();
long double tanl(long double x) { return __infer_nondet_long_double(); }


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

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

LLVM IR (-O0):
define x86_fp80 @tanl(x86_fp80 %0) {
%2 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %2
%3 = call x86_fp80 (...) @__infer_nondet_long_double()
ret x86_fp80 %3
}

LLVM IR (-O2):
define x86_fp80 @tanl(x86_fp80 %0) {
%2 = tail call x86_fp80 (...) @__infer_nondet_long_double()
ret x86_fp80 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int print_help(char *exe) {
  printf("Usage:\n"
         "\t%s [<options>] <file> [<file> ...]\n"
         "\n"
         "If <file> is \"-\", it reads from stdin.\n"
         "\n"
         "Options:\n"
         "\t-h: show this help and exit\n"
         "\t-H: human-readable size output\n"
         "\t-v: print the version and exit\n"
         "\n",
         exe);
  return 0;
}


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

x86 assembly (clang, -O2):
<print_help>:
push   %rax
mov    %rdi,%rsi
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [188 x i8] c"Usage:\0A\09%s [<options>] <file> [<file> ...]\0A\0AIf <file> is \22-\22, it reads from stdin.\0A\0AOptions:\0A\09-h: show this help and exit\0A\09-H: human-readable size output\0A\09-v: print the version and exit\0A\0A\00"
define i32 @print_help(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([188 x i8], [188 x i8]* @.str, i64 0, i64 0), i8* %3)
ret i32 0
}

LLVM IR (-O2):
@.str = [188 x i8] c"Usage:\0A\09%s [<options>] <file> [<file> ...]\0A\0AIf <file> is \22-\22, it reads from stdin.\0A\0AOptions:\0A\09-h: show this help and exit\0A\09-H: human-readable size output\0A\09-v: print the version and exit\0A\0A\00"
define i32 @print_help(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([188 x i8], [188 x i8]* @.str, i64 0, i64 0), i8* %0)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ system(char *);
void pause_clear(int pause_true, int clear_true) {
  if (pause_true) {
    system("pause");
  }
  if (clear_true) {
    system("cls");
  }
}


x86 assembly (clang, -O0):
<pause_clear>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1134 <pause_clear+0x24>
lea    0xed1(%rip),%rdi
call   1030 <system@plt>
cmpl   $0x0,-0x8(%rbp)
je     114a <pause_clear+0x3a>
lea    0xec1(%rip),%rdi
call   1030 <system@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pause_clear>:
push   %rbx
mov    %esi,%ebx
test   %edi,%edi
je     1123 <pause_clear+0x13>
lea    0xee2(%rip),%rdi
call   1030 <system@plt>
test   %ebx,%ebx
je     1134 <pause_clear+0x24>
lea    0xed8(%rip),%rdi
pop    %rbx
jmp    1030 <system@plt>
pop    %rbx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"pause\00"
@.str.1 = [4 x i8] c"cls\00"
define void @pause_clear(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 ne i32 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %2
%8 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
br label %9
9: ; preds = %7, %2
%10 = load i32, i32* %4
%11 = icmp ne i32 %10, 0
br i1 %11, label %12, label %14
12: ; preds = %9
%13 = call i32 @system(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
br label %14
14: ; preds = %12, %9
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"pause\00"
@.str.1 = [4 x i8] c"cls\00"
define void @pause_clear(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, 0
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %2
%7 = icmp eq i32 %1, 0
br i1 %7, label %10, label %8
8: ; preds = %6
%9 = tail call i32 @system(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
br label %10
10: ; preds = %8, %6
ret void
}
void SteamAPI_ISteamFriends_ActivateGameOverlayToStore(void *self) {
  xlogf("%s(self = %p)\n", __func__, self);
}


x86 assembly (clang, -O0):
<SteamAPI_ISteamFriends_ActivateGameOverlayToStore>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
lea    0xed9(%rip),%rdi
lea    0xee1(%rip),%rsi
mov    $0x0,%al
call   1030 <xlogf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SteamAPI_ISteamFriends_ActivateGameOverlayToStore>:
mov    %rdi,%rdx
lea    0xee6(%rip),%rdi
lea    0xeee(%rip),%rsi
xor    %eax,%eax
jmp    1030 <xlogf@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"%s(self = %p)\0A\00"
@__func__.SteamAPI_ISteamFriends_ActivateGameOverlayToStore = [50 x i8] c"SteamAPI_ISteamFriends_ActivateGameOverlayToStore\00"
define void @SteamAPI_ISteamFriends_ActivateGameOverlayToStore(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 (i8*, i8*, i8*, ...) bitcast (i32 (...)* @xlogf to i32 (i8*, i8*, i8*, ...)*)(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([50 x i8], [50 x i8]* @__func__.SteamAPI_ISteamFriends_ActivateGameOverlayToStore, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"%s(self = %p)\0A\00"
@__func__.SteamAPI_ISteamFriends_ActivateGameOverlayToStore = [50 x i8] c"SteamAPI_ISteamFriends_ActivateGameOverlayToStore\00"
define void @SteamAPI_ISteamFriends_ActivateGameOverlayToStore(i8* %0) {
%2 = tail call i32 (i8*, i8*, i8*, ...) bitcast (i32 (...)* @xlogf to i32 (i8*, i8*, i8*, ...)*)(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([50 x i8], [50 x i8]* @__func__.SteamAPI_ISteamFriends_ActivateGameOverlayToStore, i64 0, i64 0), i8* %0)
ret void
}
/* Type definitions */
struct timeval {
  unsigned long long tv_usec;
  scalar_t__ tv_sec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
unsigned long long myclock() {
  struct timeval tm;
  gettimeofday(&tm, NULL);
  return (((unsigned long long)tm.tv_sec) * 1000000) + tm.tv_usec;
}


x86 assembly (clang, -O0):
<myclock>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
imul   $0xf4240,-0x8(%rbp),%rax
add    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<myclock>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
imul   $0xf4240,0x10(%rsp),%rax
add    0x8(%rsp),%rax
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timeval = type { i64, i64 }
define i64 @myclock() {
%1 = alloca %struct.timeval
%2 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%3 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%4 = load i64, i64* %3
%5 = mul i64 %4, 1000000
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%7 = load i64, i64* %6
%8 = add i64 %5, %7
ret i64 %8
}

LLVM IR (-O2):
%struct.timeval = type { i64, i64 }
define i64 @myclock() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%5 = load i64, i64* %4
%6 = mul i64 %5, 1000000
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%8 = load i64, i64* %7
%9 = add i64 %6, %8
ret i64 %9
}
/* Variables and functions */
short udivmodhi4(short, short, int /*<<< orphan*/);
short __udivhi3(short a, short b) { return udivmodhi4(a, b, 0); }


x86 assembly (clang, -O0):
<__udivhi3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %si,%ax
mov    %di,%cx
mov    %cx,-0x2(%rbp)
mov    %ax,-0x4(%rbp)
mov    -0x2(%rbp),%ax
xor    %edx,%edx
movswl %ax,%edi
movswl -0x4(%rbp),%esi
call   1030 <udivmodhi4@plt>
cwtl
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define signext i16 @__udivhi3(i16 signext %0, i16 signext %1) {
%3 = alloca i16
%4 = alloca i16
store i16 %0, i16* %3
store i16 %1, i16* %4
%5 = load i16, i16* %3
%6 = load i16, i16* %4
%7 = call signext i16 @udivmodhi4(i16 signext %5, i16 signext %6, i32 0)
ret i16 %7
}

LLVM IR (-O2):
define signext i16 @__udivhi3(i16 signext %0, i16 signext %1) {
%3 = tail call signext i16 @udivmodhi4(i16 signext %0, i16 signext %1, i32 0)
ret i16 %3
}
const char *CmpName(void *arg) {
  (void)arg;
  return "foo";
}


x86 assembly (clang, -O0):
<CmpName>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
lea    0xef1(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<CmpName>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [4 x i8] c"foo\00"
define i8* @CmpName(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
ret i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [4 x i8] c"foo\00"
define i8* @CmpName(i8* nocapture readnone %0) {
ret i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_version() {
  printf("Built with Lanli "
         "0.0.1"
         ".\n");
}


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

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

LLVM IR (-O0):
@.str = [25 x i8] c"Built with Lanli 0.0.1.\0A\00"
define void @print_version() {
%1 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [24 x i8] c"Built with Lanli 0.0.1.\00"
define void @print_version() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str, i64 0, i64 0))
ret void
}
/* Type definitions */
struct msg_buff {
  int dummy;
};
typedef int /*<<< orphan*/ __u64;

/* Variables and functions */
int nla_put(struct msg_buff *, int, int, int /*<<< orphan*/ *);
int nla_put_u64(struct msg_buff *msg, int attrtype, __u64 value) {
  return nla_put(msg, attrtype, sizeof(__u64), &value);
}


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

x86 assembly (clang, -O2):
<nla_put_u64>:
push   %rax
mov    %edx,0x4(%rsp)
lea    0x4(%rsp),%rcx
mov    $0x4,%edx
call   1030 <nla_put@plt>
pop    %rcx
ret

LLVM IR (-O0):
%struct.msg_buff = type { i32 }
define i32 @nla_put_u64(%struct.msg_buff* %0, i32 %1, i32 %2) {
%4 = alloca %struct.msg_buff*
%5 = alloca i32
%6 = alloca i32
store %struct.msg_buff* %0, %struct.msg_buff** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load %struct.msg_buff*, %struct.msg_buff** %4
%8 = load i32, i32* %5
%9 = call i32 @nla_put(%struct.msg_buff* %7, i32 %8, i32 4, i32* %6)
ret i32 %9
}

LLVM IR (-O2):
%struct.msg_buff = type { i32 }
define i32 @nla_put_u64(%struct.msg_buff* %0, i32 %1, i32 %2) {
%4 = alloca i32
store i32 %2, i32* %4
%5 = call i32 @nla_put(%struct.msg_buff* %0, i32 %1, i32 4, i32* %4)
ret i32 %5
}
any(c, s) register char c;
char *s;
{
  register char d;
  while (d = *s++) {
    if (d == c)
      return ((-1));
  }
  return (0);
}


x86 assembly (clang, -O0):
<any>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%al
mov    %al,-0x11(%rbp)
cmp    $0x0,%al
je     114b <any+0x4b>
movsbl -0x11(%rbp),%eax
movsbl -0x5(%rbp),%ecx
cmp    %ecx,%eax
jne    1146 <any+0x46>
movl   $0xffffffff,-0x4(%rbp)
jmp    1152 <any+0x52>
jmp    110e <any+0xe>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<any>:
movsbl %dil,%eax
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movsbl (%rsi),%ecx
test   %ecx,%ecx
je     1125 <any+0x25>
add    $0x1,%rsi
cmp    %ecx,%eax
jne    1110 <any+0x10>
mov    $0xffffffff,%eax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @any(i32 %0, i8* nocapture %1) {
%3 = shl i32 %0, 24
%4 = ashr exact i32 %3, 24
br label %5
5: ; preds = %9, %2
%6 = phi i8* [ %1, %2 ], [ %10, %9 ]
%7 = load i8, i8* %6
%8 = icmp eq i8 %7, 0
br i1 %8, label %13, label %9
9: ; preds = %5
%10 = getelementptr inbounds i8, i8* %6, i64 1
%11 = sext i8 %7 to i32
%12 = icmp eq i32 %4, %11
br i1 %12, label %13, label %5
13: ; preds = %5, %9
%14 = phi i32 [ -1, %9 ], [ 0, %5 ]
ret i32 %14
}
int iscntrl(int c) { return ((unsigned)c < 0x20) | (c == 0x7f); }


x86 assembly (clang, -O0):
<iscntrl>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x20,-0x4(%rbp)
setb   %al
and    $0x1,%al
movzbl %al,%eax
cmpl   $0x7f,-0x4(%rbp)
sete   %cl
and    $0x1,%cl
movzbl %cl,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<iscntrl>:
cmp    $0x20,%edi
setb   %al
cmp    $0x7f,%edi
sete   %cl
or     %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @iscntrl(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ult i32 %3, 32
%5 = zext i1 %4 to i32
%6 = load i32, i32* %2
%7 = icmp eq i32 %6, 127
%8 = zext i1 %7 to i32
%9 = or i32 %5, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @iscntrl(i32 %0) {
%2 = icmp ult i32 %0, 32
%3 = icmp eq i32 %0, 127
%4 = or i1 %2, %3
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
void echo_str(const char *str) { printf("echo_str: %s\n", str); }


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

x86 assembly (clang, -O2):
<echo_str>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [14 x i8] c"echo_str: %s\0A\00"
define void @echo_str(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sclp_set_write_mask();
void sclp_setup(void) { sclp_set_write_mask(); }


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

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

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

LLVM IR (-O2):
define void @sclp_setup() {
%1 = tail call i32 (...) @sclp_set_write_mask()
ret void
}
/* Type definitions */
struct socket {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ user_flush_rx_tx(struct socket *);
int /*<<< orphan*/ user_on_closure(struct socket *);
__attribute__((always_)) void user_on_socket_fatal(struct socket *sock) {
  user_flush_rx_tx(sock);
  user_on_closure(sock);
}


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

x86 assembly (clang, -O2):
<user_on_socket_fatal>:
push   %rbx
mov    %rdi,%rbx
call   1030 <user_flush_rx_tx@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <user_on_closure@plt>

LLVM IR (-O0):
%struct.socket = type { i32 }
define void @user_on_socket_fatal(%struct.socket* %0) {
%2 = alloca %struct.socket*
store %struct.socket* %0, %struct.socket** %2
%3 = load %struct.socket*, %struct.socket** %2
%4 = call i32 @user_flush_rx_tx(%struct.socket* %3)
%5 = load %struct.socket*, %struct.socket** %2
%6 = call i32 @user_on_closure(%struct.socket* %5)
ret void
}

LLVM IR (-O2):
%struct.socket = type { i32 }
define void @user_on_socket_fatal(%struct.socket* %0) {
%2 = tail call i32 @user_flush_rx_tx(%struct.socket* %0)
%3 = tail call i32 @user_on_closure(%struct.socket* %0)
ret void
}
unsigned int bitset_size(unsigned int set) {
  set = set - ((set >> 1) & ~(unsigned int)0 / 3);
  set = (set & ~(unsigned int)0 / 15 * 3) +
        ((set >> 2) & ~(unsigned int)0 / 15 * 3);
  set = (set + (set >> 4)) & ~(unsigned int)0 / 255 * 15;
  return (set * (~(unsigned int)0 / 255)) >> (sizeof(unsigned int) - 1) * 8;
}


x86 assembly (clang, -O0):
<bitset_size>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
shr    $0x1,%ecx
and    $0x55555555,%ecx
sub    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x33333333,%eax
mov    -0x4(%rbp),%ecx
shr    $0x2,%ecx
and    $0x33333333,%ecx
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
shr    $0x4,%ecx
add    %ecx,%eax
and    $0xf0f0f0f,%eax
mov    %eax,-0x4(%rbp)
imul   $0x1010101,-0x4(%rbp),%eax
shr    $0x18,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bitset_size>:
mov    %edi,%eax
shr    %eax
and    $0x55555555,%eax
sub    %eax,%edi
mov    %edi,%eax
and    $0x33333333,%eax
shr    $0x2,%edi
and    $0x33333333,%edi
add    %eax,%edi
mov    %edi,%eax
shr    $0x4,%eax
add    %edi,%eax
and    $0xf0f0f0f,%eax
imul   $0x1010101,%eax,%eax
shr    $0x18,%eax
ret

LLVM IR (-O0):
define i32 @bitset_size(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* %2
%5 = lshr i32 %4, 1
%6 = and i32 %5, 1431655765
%7 = sub i32 %3, %6
store i32 %7, i32* %2
%8 = load i32, i32* %2
%9 = and i32 %8, 858993459
%10 = load i32, i32* %2
%11 = lshr i32 %10, 2
%12 = and i32 %11, 858993459
%13 = add i32 %9, %12
store i32 %13, i32* %2
%14 = load i32, i32* %2
%15 = load i32, i32* %2
%16 = lshr i32 %15, 4
%17 = add i32 %14, %16
%18 = and i32 %17, 252645135
store i32 %18, i32* %2
%19 = load i32, i32* %2
%20 = mul i32 %19, 16843009
%21 = lshr i32 %20, 24
ret i32 %21
}

LLVM IR (-O2):
define i32 @bitset_size(i32 %0) {
%2 = lshr i32 %0, 1
%3 = and i32 %2, 1431655765
%4 = sub i32 %0, %3
%5 = and i32 %4, 858993459
%6 = lshr i32 %4, 2
%7 = and i32 %6, 858993459
%8 = add nuw nsw i32 %7, %5
%9 = lshr i32 %8, 4
%10 = add nuw nsw i32 %9, %8
%11 = and i32 %10, 252645135
%12 = mul i32 %11, 16843009
%13 = lshr i32 %12, 24
ret i32 %13
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int ROR(int, int);
uint32_t sigma1(uint32_t x) { return ROR(x ^ ROR(x, 5) ^ ROR(x, 19), 6); }


x86 assembly (clang, -O0):
<sigma1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x5,%esi
call   1030 <ROR@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
xor    %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x13,%esi
call   1030 <ROR@plt>
mov    -0x8(%rbp),%edi
xor    %eax,%edi
mov    $0x6,%esi
call   1030 <ROR@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sigma1>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
mov    $0x5,%esi
call   1030 <ROR@plt>
mov    %eax,%ebp
xor    %ebx,%ebp
mov    %ebx,%edi
mov    $0x13,%esi
call   1030 <ROR@plt>
xor    %eax,%ebp
mov    %ebp,%edi
mov    $0x6,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <ROR@plt>

LLVM IR (-O0):
define i32 @sigma1(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @ROR(i32 %4, i32 5)
%6 = xor i32 %3, %5
%7 = load i32, i32* %2
%8 = call i32 @ROR(i32 %7, i32 19)
%9 = xor i32 %6, %8
%10 = call i32 @ROR(i32 %9, i32 6)
ret i32 %10
}

LLVM IR (-O2):
define i32 @sigma1(i32 %0) {
%2 = tail call i32 @ROR(i32 %0, i32 5)
%3 = xor i32 %2, %0
%4 = tail call i32 @ROR(i32 %0, i32 19)
%5 = xor i32 %3, %4
%6 = tail call i32 @ROR(i32 %5, i32 6)
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ jukebox_init(int);
int /*<<< orphan*/ jukebox_launch();
int main(int argc, char *argv[]) {
  int port = 8085;
  (void)argc;
  (void)argv;
  jukebox_init(port);
  jukebox_launch();
  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)
movl   $0x1f95,-0x14(%rbp)
mov    -0x14(%rbp),%edi
call   1030 <jukebox_init@plt>
mov    $0x0,%al
call   1040 <jukebox_launch@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1f95,%edi
call   1030 <jukebox_init@plt>
xor    %eax,%eax
call   1040 <jukebox_launch@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
store i32 8085, i32* %6
%7 = load i32, i32* %4
%8 = load i8**, i8*** %5
%9 = load i32, i32* %6
%10 = call i32 @jukebox_init(i32 %9)
%11 = call i32 (...) @jukebox_launch()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @jukebox_init(i32 8085)
%4 = tail call i32 (...) @jukebox_launch()
ret i32 0
}
/* Variables and functions */
size_t get_char_width(char const *);
size_t get_utf8_overhead(const char str[]) {
  size_t overhead = 0;
  while (*str != '\0') {
    size_t char_width = get_char_width(str);
    str += char_width;
    overhead += char_width - 1;
  }
  return overhead;
}


x86 assembly (clang, -O0):
<get_utf8_overhead>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1162 <get_utf8_overhead+0x52>
mov    -0x8(%rbp),%rdi
call   1030 <get_char_width@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    -0x8(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x18(%rbp),%rax
sub    $0x1,%rax
add    -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
jmp    1124 <get_utf8_overhead+0x14>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_utf8_overhead>:
push   %r14
push   %rbx
push   %rax
cmpb   $0x0,(%rdi)
je     1139 <get_utf8_overhead+0x29>
mov    %rdi,%rbx
xor    %r14d,%r14d
nop
mov    %rbx,%rdi
call   1030 <get_char_width@plt>
cmpb   $0x0,(%rbx,%rax,1)
lea    (%rbx,%rax,1),%rbx
lea    -0x1(%r14,%rax,1),%r14
jne    1120 <get_utf8_overhead+0x10>
jmp    113c <get_utf8_overhead+0x2c>
xor    %r14d,%r14d
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i64 @get_utf8_overhead(i8* %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %13, label %4
4: ; preds = %1, %4
%5 = phi i8* [ %8, %4 ], [ %0, %1 ]
%6 = phi i64 [ %10, %4 ], [ 0, %1 ]
%7 = tail call i64 @get_char_width(i8* %5)
%8 = getelementptr inbounds i8, i8* %5, i64 %7
%9 = add i64 %6, -1
%10 = add i64 %9, %7
%11 = load i8, i8* %8
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %4
13: ; preds = %4, %1
%14 = phi i64 [ 0, %1 ], [ %10, %4 ]
ret i64 %14
}
/* Variables and functions */
char const *weak_s3();
const char *__attribute__((section(".test.c"))) sibcall_weak_s3(void) {
  return weak_s3();
}


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

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

LLVM IR (-O0):
define i8* @sibcall_weak_s3() section ".test.c" {
%1 = call i8* (...) @weak_s3()
ret i8* %1
}

LLVM IR (-O2):
define i8* @sibcall_weak_s3() section ".test.c" {
%1 = tail call i8* (...) @weak_s3()
ret i8* %1
}
/* Variables and functions */
int /*<<< orphan*/ emit(char *);
int /*<<< orphan*/ emitt(char *);
void arm_epilog() {
  emitt("mov r0, #0");
  emitt("bx lr");
  emit("addr_of_mem: .word mem");
}


x86 assembly (clang, -O0):
<arm_epilog>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <emitt@plt>
lea    0xed4(%rip),%rdi
call   1030 <emitt@plt>
lea    0xece(%rip),%rdi
call   1040 <emit@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<arm_epilog>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <emitt@plt>
lea    0xed7(%rip),%rdi
call   1030 <emitt@plt>
lea    0xed1(%rip),%rdi
pop    %rax
jmp    1040 <emit@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"mov r0,\00"
@.str.1 = [6 x i8] c"bx lr\00"
@.str.2 = [23 x i8] c"addr_of_mem: .word mem\00"
define void @arm_epilog() {
%1 = call i32 @emitt(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @emitt(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @emit(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"mov r0,\00"
@.str.1 = [6 x i8] c"bx lr\00"
@.str.2 = [23 x i8] c"addr_of_mem: .word mem\00"
define void @arm_epilog() {
%1 = tail call i32 @emitt(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @emitt(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @emit(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0))
ret void
}
void led_on() { *((volatile unsigned long *)0x7f008824) = 0x0e; }


x86 assembly (clang, -O0):
<led_on>:
push   %rbp
mov    %rsp,%rbp
mov    $0x7f008824,%eax
movq   $0xe,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<led_on>:
movq   $0xe,0x7f008824
ret

LLVM IR (-O0):
define void @led_on() {
store volatile i64 14, i64* inttoptr (i64 2130741284 to i64*)
ret void
}

LLVM IR (-O2):
define void @led_on() {
store volatile i64 14, i64* inttoptr (i64 2130741284 to i64*)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ndsctl_action(char *, char *, char *);
void ndsctl_block(void) {
  ndsctl_action("block", "MAC %s blocked.\n", "Failed to block MAC %s.\n");
}


x86 assembly (clang, -O0):
<ndsctl_block>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
lea    0xee4(%rip),%rsi
lea    0xeee(%rip),%rdx
call   1030 <ndsctl_action@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<ndsctl_block>:
lea    0xee9(%rip),%rdi
lea    0xee8(%rip),%rsi
lea    0xef2(%rip),%rdx
jmp    1030 <ndsctl_action@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"block\00"
@.str.1 = [17 x i8] c"MAC %s blocked.\0A\00"
@.str.2 = [25 x i8] c"Failed to block MAC %s.\0A\00"
define void @ndsctl_block() {
%1 = call i32 @ndsctl_action(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"block\00"
@.str.1 = [17 x i8] c"MAC %s blocked.\0A\00"
@.str.2 = [25 x i8] c"Failed to block MAC %s.\0A\00"
define void @ndsctl_block() {
%1 = tail call i32 @ndsctl_action(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ NVIC_SystemReset();
uint32_t sd_nvic_SystemReset(void) {
  NVIC_SystemReset();
  return ((0x2000) + 3);
}


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

x86 assembly (clang, -O2):
<sd_nvic_SystemReset>:
push   %rax
xor    %eax,%eax
call   1030 <NVIC_SystemReset@plt>
mov    $0x2003,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @sd_nvic_SystemReset() {
%1 = call i32 (...) @NVIC_SystemReset()
ret i32 8195
}

LLVM IR (-O2):
define i32 @sd_nvic_SystemReset() {
%1 = tail call i32 (...) @NVIC_SystemReset()
ret i32 8195
}
/* Variables and functions */
int /*<<< orphan*/ chigraph_main(int /*<<< orphan*/, int *);
int main() {
  int retCode;
  chigraph_main(0, &retCode);
  return retCode;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xor    %edi,%edi
lea    -0x8(%rbp),%rsi
call   1030 <chigraph_main@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0x4(%rsp),%rsi
xor    %edi,%edi
call   1030 <chigraph_main@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @chigraph_main(i32 0, i32* %1)
%4 = load i32, i32* %1
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void eraseline(void) { printf("\033[2K"); }


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

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

LLVM IR (-O0):
@.str = [5 x i8] c"\1B[2K\00"
define void @eraseline() {
%1 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"\1B[2K\00"
define void @eraseline() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void usage(void) {
  printf("\nstl_norm - normalize .stl files\ni\n");
  printf("usage: stl_norm inputfile(s)\n");
}


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

x86 assembly (clang, -O2):
<usage>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xeff(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [36 x i8] c"\0Astl_norm - normalize .stl files\0Ai\0A\00"
@.str.1 = [30 x i8] c"usage: stl_norm inputfile(s)\0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [35 x i8] c"\0Astl_norm - normalize .stl files\0Ai\00"
@str.2 = [29 x i8] c"usage: stl_norm inputfile(s)\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @str.2, i64 0, i64 0))
ret void
}
void __attribute__((visibility("protected"))) lib3_protected(void) {}


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

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

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

LLVM IR (-O2):
define protected void @lib3_protected() {
ret void
}
/* Variables and functions */
void *xcalloc(int, size_t);
__attribute__((unused)) void *xzalloc(size_t size) { return xcalloc(1, size); }


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

x86 assembly (clang, -O2):
<xzalloc>:
mov    %rdi,%rsi
mov    $0x1,%edi
jmp    1030 <xcalloc@plt>

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

LLVM IR (-O2):
define i8* @xzalloc(i64 %0) {
%2 = tail call i8* @xcalloc(i32 1, i64 %0)
ret i8* %2
}
/* Variables and functions */
long double __infer_nondet_long_double();
long double cbrtl(long double x) { return __infer_nondet_long_double(); }


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

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

LLVM IR (-O0):
define x86_fp80 @cbrtl(x86_fp80 %0) {
%2 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %2
%3 = call x86_fp80 (...) @__infer_nondet_long_double()
ret x86_fp80 %3
}

LLVM IR (-O2):
define x86_fp80 @cbrtl(x86_fp80 %0) {
%2 = tail call x86_fp80 (...) @__infer_nondet_long_double()
ret x86_fp80 %2
}
/* Variables and functions */
int /*<<< orphan*/ core11_print(char *, char const *);
void U_EMRPAINTRGN_print(const char *contents) {
  core11_print("U_EMRPAINTRGN", contents);
}


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

x86 assembly (clang, -O2):
<U_EMRPAINTRGN_print>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <core11_print@plt>

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

LLVM IR (-O2):
@.str = [14 x i8] c"U_EMRPAINTRGN\00"
define void @U_EMRPAINTRGN_print(i8* %0) {
%2 = tail call i32 @core11_print(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
void set_word(unsigned char *data, unsigned short value) {
  data[1] = (value >> 8) & 0xff;
  data[0] = (value >> 0) & 0xff;
}


x86 assembly (clang, -O0):
<set_word>:
push   %rbp
mov    %rsp,%rbp
mov    %si,%ax
mov    %rdi,-0x8(%rbp)
mov    %ax,-0xa(%rbp)
movzwl -0xa(%rbp),%eax
sar    $0x8,%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x1(%rax)
movzwl -0xa(%rbp),%eax
sar    $0x0,%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_word>:
mov    %si,(%rdi)
ret

LLVM IR (-O0):
define void @set_word(i8* %0, i16 zeroext %1) {
%3 = alloca i8*
%4 = alloca i16
store i8* %0, i8** %3
store i16 %1, i16* %4
%5 = load i16, i16* %4
%6 = zext i16 %5 to i32
%7 = ashr i32 %6, 8
%8 = and i32 %7, 255
%9 = trunc i32 %8 to i8
%10 = load i8*, i8** %3
%11 = getelementptr inbounds i8, i8* %10, i64 1
store i8 %9, i8* %11
%12 = load i16, i16* %4
%13 = zext i16 %12 to i32
%14 = ashr i32 %13, 0
%15 = and i32 %14, 255
%16 = trunc i32 %15 to i8
%17 = load i8*, i8** %3
%18 = getelementptr inbounds i8, i8* %17, i64 0
store i8 %16, i8* %18
ret void
}

LLVM IR (-O2):
define void @set_word(i8* nocapture writeonly %0, i16 zeroext %1) {
%3 = lshr i16 %1, 8
%4 = trunc i16 %3 to i8
%5 = getelementptr inbounds i8, i8* %0, i64 1
store i8 %4, i8* %5
%6 = trunc i16 %1 to i8
store i8 %6, i8* %0
ret void
}
int check_all() { return 0x0000; }


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

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

LLVM IR (-O0):
define i32 @check_all() {
ret i32 0
}

LLVM IR (-O2):
define i32 @check_all() {
ret i32 0
}
/* Variables and functions */
int dcloadsyscall(int, char const *);
int chdir(const char *path) {
  if (*(unsigned int *)0x8c004004 == 0xdeadbeef)
    return dcloadsyscall(7, path);
  else
    return -1;
}


x86 assembly (clang, -O0):
<chdir>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    $0x8c004004,%eax
cmpl   $0xdeadbeef,(%rax)
jne    1143 <chdir+0x33>
mov    -0x10(%rbp),%rsi
mov    $0x7,%edi
call   1030 <dcloadsyscall@plt>
mov    %eax,-0x4(%rbp)
jmp    114a <chdir+0x3a>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<chdir>:
mov    $0x8c004004,%eax
cmpl   $0xdeadbeef,(%rax)
jne    112a <chdir+0x1a>
mov    %rdi,%rsi
mov    $0x7,%edi
jmp    1030 <dcloadsyscall@plt>
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
define i32 @chdir(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i32, i32* inttoptr (i64 2348826628 to i32*)
%5 = icmp eq i32 %4, -559038737
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load i8*, i8** %3
%8 = call i32 @dcloadsyscall(i32 7, i8* %7)
store i32 %8, i32* %2
br label %10
9: ; preds = %1
store i32 -1, i32* %2
br label %10
10: ; preds = %9, %6
%11 = load i32, i32* %2
ret i32 %11
}

LLVM IR (-O2):
define i32 @chdir(i8* %0) {
%2 = load i32, i32* inttoptr (i64 2348826628 to i32*)
%3 = icmp eq i32 %2, -559038737
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @dcloadsyscall(i32 7, i8* %0)
br label %6
6: ; preds = %1, %4
%7 = phi i32 [ %5, %4 ], [ -1, %1 ]
ret i32 %7
}
int pdp10_section_zero_p(struct pdp10_cpu *cpu) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.pdp10_cpu = type opaque
define i32 @pdp10_section_zero_p(%struct.pdp10_cpu* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ kill(int, int);
int /*<<< orphan*/ printf(char *, int);
int read_pid(char *);
void off_tr069(void) {
  int cwmppid = 0;
  int status;
  cwmppid = read_pid((char *)"/var/run/cwmp.pid");
  printf("\ncwmppid=%d\n", cwmppid);
  if (cwmppid > 0)
    kill(cwmppid, 15);
}


x86 assembly (clang, -O0):
<off_tr069>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
call   1040 <read_pid@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
cmpl   $0x0,-0x4(%rbp)
jle    1174 <off_tr069+0x44>
mov    -0x4(%rbp),%edi
mov    $0xf,%esi
call   1050 <kill@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<off_tr069>:
push   %rbx
lea    0xec8(%rip),%rdi
call   1040 <read_pid@plt>
mov    %eax,%ebx
lea    0xecc(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
test   %ebx,%ebx
jle    115e <off_tr069+0x2e>
mov    %ebx,%edi
mov    $0xf,%esi
pop    %rbx
jmp    1050 <kill@plt>
pop    %rbx
ret

LLVM IR (-O0):
@.str = [18 x i8] c"/var/run/cwmp.pid\00"
@.str.1 = [13 x i8] c"\0Acwmppid=%d\0A\00"
define void @off_tr069() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @read_pid(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
store i32 %3, i32* %1
%4 = load i32, i32* %1
%5 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i32 %4)
%6 = load i32, i32* %1
%7 = icmp sgt i32 %6, 0
br i1 %7, label %8, label %11
8: ; preds = %0
%9 = load i32, i32* %1
%10 = call i32 @kill(i32 %9, i32 15)
br label %11
11: ; preds = %8, %0
ret void
}

LLVM IR (-O2):
@.str = [18 x i8] c"/var/run/cwmp.pid\00"
@.str.1 = [13 x i8] c"\0Acwmppid=%d\0A\00"
define void @off_tr069() {
%1 = tail call i32 @read_pid(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i32 %1)
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = tail call i32 @kill(i32 %1, i32 15)
br label %6
6: ; preds = %4, %0
ret void
}
/* Type definitions */
struct mibinfo {
  int dummy;
};

/* Variables and functions */
int format(char *, char *, size_t, void const *, size_t);
int hex16_format(struct mibinfo *m, const void *data, size_t data_size,
                 char *buf, size_t len) {
  return format("%2x ", buf, len, data, data_size);
}


x86 assembly (clang, -O0):
<hex16_format>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x20(%rbp),%rsi
mov    -0x28(%rbp),%rdx
mov    -0x10(%rbp),%rcx
mov    -0x18(%rbp),%r8
lea    0xebd(%rip),%rdi
call   1030 <format@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hex16_format>:
mov    %rdx,%r9
mov    %rsi,%rax
lea    0xee3(%rip),%rdi
mov    %rcx,%rsi
mov    %r8,%rdx
mov    %rax,%rcx
mov    %r9,%r8
jmp    1030 <format@plt>

LLVM IR (-O0):
%struct.mibinfo = type { i32 }
@.str = [5 x i8] c"%2x \00"
define i32 @hex16_format(%struct.mibinfo* %0, i8* %1, i64 %2, i8* %3, i64 %4) {
%6 = alloca %struct.mibinfo*
%7 = alloca i8*
%8 = alloca i64
%9 = alloca i8*
%10 = alloca i64
store %struct.mibinfo* %0, %struct.mibinfo** %6
store i8* %1, i8** %7
store i64 %2, i64* %8
store i8* %3, i8** %9
store i64 %4, i64* %10
%11 = load i8*, i8** %9
%12 = load i64, i64* %10
%13 = load i8*, i8** %7
%14 = load i64, i64* %8
%15 = call i32 @format(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %11, i64 %12, i8* %13, i64 %14)
ret i32 %15
}

LLVM IR (-O2):
%struct.mibinfo = type { i32 }
@.str = [5 x i8] c"%2x \00"
define i32 @hex16_format(%struct.mibinfo* nocapture readnone %0, i8* %1, i64 %2, i8* %3, i64 %4) {
%6 = tail call i32 @format(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %3, i64 %4, i8* %1, i64 %2)
ret i32 %6
}
int execute_exit() { return 0; }


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

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

LLVM IR (-O0):
define i32 @execute_exit() {
ret i32 0
}

LLVM IR (-O2):
define i32 @execute_exit() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ test_suite();
int main() { test_suite(); }


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 (...) @test_suite()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @test_suite()
ret i32 0
}
/* Variables and functions */
int tar(int);
void bug(int q, long bcount) {
  int j = 0;
  int outgo = 0;
  while (j != -1) {
    outgo++;
    if (outgo > q - 1)
      outgo = q - 1;
    j = tar(outgo * bcount);
  }
}


x86 assembly (clang, -O0):
<bug>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
cmpl   $0xffffffff,-0x14(%rbp)
je     1172 <bug+0x62>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
mov    -0x4(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jle    115a <bug+0x4a>
mov    -0x4(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x18(%rbp)
movslq -0x18(%rbp),%rax
imul   -0x10(%rbp),%rax
mov    %eax,%edi
call   1030 <tar@plt>
mov    %eax,-0x14(%rbp)
jmp    112d <bug+0x1d>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bug>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %edi,%ebp
add    $0xffffffff,%ebp
xor    %ecx,%ecx
xchg   %ax,%ax
lea    0x1(%rcx),%ebx
cmp    %ebp,%ecx
cmovge %ebp,%ebx
mov    %ebx,%edi
imul   %r14d,%edi
call   1030 <tar@plt>
mov    %ebx,%ecx
cmp    $0xffffffff,%eax
jne    1120 <bug+0x10>
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define void @bug(i32 %0, i64 %1) {
%3 = add nsw i32 %0, -1
%4 = trunc i64 %1 to i32
br label %5
5: ; preds = %2, %5
%6 = phi i32 [ 0, %2 ], [ %9, %5 ]
%7 = add nsw i32 %6, 1
%8 = icmp slt i32 %6, %3
%9 = select i1 %8, i32 %7, i32 %3
%10 = mul i32 %9, %4
%11 = tail call i32 @tar(i32 %10)
%12 = icmp eq i32 %11, -1
br i1 %12, label %13, label %5
13: ; preds = %5
ret void
}
void unp0_out(v) { write_out(v); }


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

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

LLVM IR (-O0):
define void @unp0_out(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 (i32, ...) bitcast (i32 (...)* @write_out to i32 (i32, ...)*)(i32 %3)
ret void
}

LLVM IR (-O2):
define void @unp0_out(i32 %0) {
%2 = tail call i32 (i32, ...) bitcast (i32 (...)* @write_out to i32 (i32, ...)*)(i32 %0)
ret void
}