xunge/DecIR huggingface dataset:
/* Variables and functions */
scalar_t__ isUpper(int);
int toLower(int k) { return (isUpper(k)) ? ('a' + (k - 'A')) : k; }


x86 assembly (clang, -O0):
<toLower>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <isUpper@plt>
cmp    $0x0,%rax
je     113e <toLower+0x2e>
mov    -0x4(%rbp),%eax
sub    $0x41,%eax
add    $0x61,%eax
mov    %eax,-0x8(%rbp)
jmp    1144 <toLower+0x34>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<toLower>:
push   %rbx
mov    %edi,%ebx
call   1030 <isUpper@plt>
lea    0x20(%rbx),%ecx
test   %rax,%rax
cmove  %ebx,%ecx
mov    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @toLower(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i64 @isUpper(i32 %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i32, i32* %2
%8 = sub nsw i32 %7, 65
%9 = add nsw i32 97, %8
br label %12
10: ; preds = %1
%11 = load i32, i32* %2
br label %12
12: ; preds = %10, %6
%13 = phi i32 [ %9, %6 ], [ %11, %10 ]
ret i32 %13
}

LLVM IR (-O2):
define i32 @toLower(i32 %0) {
%2 = tail call i64 @isUpper(i32 %0)
%3 = icmp eq i64 %2, 0
%4 = add nsw i32 %0, 32
%5 = select i1 %3, i32 %0, i32 %4
ret i32 %5
}
void setData(unsigned char *data, unsigned char reg, unsigned short value) {
  data[0] = reg | ((value & 0xf0) >> 4);
  data[1] = (value & 0x0f) << 4;
}


x86 assembly (clang, -O0):
<setData>:
push   %rbp
mov    %rsp,%rbp
mov    %dx,%ax
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %ax,-0xc(%rbp)
movzbl -0x9(%rbp),%eax
movzwl -0xc(%rbp),%ecx
and    $0xf0,%ecx
sar    $0x4,%ecx
or     %ecx,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
movzwl -0xc(%rbp),%eax
and    $0xf,%eax
shl    $0x4,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x1(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<setData>:
mov    %edx,%eax
shr    $0x4,%al
or     %sil,%al
mov    %al,(%rdi)
shl    $0x4,%dl
mov    %dl,0x1(%rdi)
ret

LLVM IR (-O0):
define void @setData(i8* %0, i8 zeroext %1, i16 zeroext %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i16
store i8* %0, i8** %4
store i8 %1, i8* %5
store i16 %2, i16* %6
%7 = load i8, i8* %5
%8 = zext i8 %7 to i32
%9 = load i16, i16* %6
%10 = zext i16 %9 to i32
%11 = and i32 %10, 240
%12 = ashr i32 %11, 4
%13 = or i32 %8, %12
%14 = trunc i32 %13 to i8
%15 = load i8*, i8** %4
%16 = getelementptr inbounds i8, i8* %15, i64 0
store i8 %14, i8* %16
%17 = load i16, i16* %6
%18 = zext i16 %17 to i32
%19 = and i32 %18, 15
%20 = shl i32 %19, 4
%21 = trunc i32 %20 to i8
%22 = load i8*, i8** %4
%23 = getelementptr inbounds i8, i8* %22, i64 1
store i8 %21, i8* %23
ret void
}

LLVM IR (-O2):
define void @setData(i8* nocapture writeonly %0, i8 zeroext %1, i16 zeroext %2) {
%4 = trunc i16 %2 to i8
%5 = lshr i8 %4, 4
%6 = or i8 %5, %1
store i8 %6, i8* %0
%7 = shl i8 %4, 4
%8 = getelementptr inbounds i8, i8* %0, i64 1
store i8 %7, i8* %8
ret void
}
int compare(const void *a, const void *b) {
  float fa = *(const float *)a;
  float fb = *(const float *)b;
  return (fa > fb) - (fa < fb);
}


x86 assembly (clang, -O0):
<compare>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm0
movss  %xmm0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm0
movss  %xmm0,-0x18(%rbp)
movss  -0x14(%rbp),%xmm0
ucomiss -0x18(%rbp),%xmm0
seta   %al
and    $0x1,%al
movzbl %al,%eax
movss  -0x14(%rbp),%xmm1
movss  -0x18(%rbp),%xmm0
ucomiss %xmm1,%xmm0
seta   %cl
and    $0x1,%cl
movzbl %cl,%ecx
sub    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<compare>:
movss  (%rdi),%xmm0
movss  (%rsi),%xmm1
xor    %eax,%eax
ucomiss %xmm1,%xmm0
seta   %al
xor    %ecx,%ecx
ucomiss %xmm0,%xmm1
seta   %cl
sub    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @compare(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca float
%6 = alloca float
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = bitcast i8* %7 to float*
%9 = load float, float* %8
store float %9, float* %5
%10 = load i8*, i8** %4
%11 = bitcast i8* %10 to float*
%12 = load float, float* %11
store float %12, float* %6
%13 = load float, float* %5
%14 = load float, float* %6
%15 = fcmp ogt float %13, %14
%16 = zext i1 %15 to i32
%17 = load float, float* %5
%18 = load float, float* %6
%19 = fcmp olt float %17, %18
%20 = zext i1 %19 to i32
%21 = sub nsw i32 %16, %20
ret i32 %21
}

LLVM IR (-O2):
define i32 @compare(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to float*
%4 = load float, float* %3
%5 = bitcast i8* %1 to float*
%6 = load float, float* %5
%7 = fcmp ogt float %4, %6
%8 = zext i1 %7 to i32
%9 = fcmp olt float %4, %6
%10 = sext i1 %9 to i32
%11 = add nsw i32 %10, %8
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ write_imm(int);
int /*<<< orphan*/ write_instr(int);
int pause_handler(char **save) {
  write_instr(0x00);
  write_imm(0x48);
  write_instr(0x28);
  return 0;
}


x86 assembly (clang, -O0):
<pause_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
xor    %edi,%edi
call   1040 <write_instr@plt>
mov    $0x48,%edi
call   1030 <write_imm@plt>
mov    $0x28,%edi
call   1040 <write_instr@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pause_handler>:
push   %rax
xor    %edi,%edi
call   1040 <write_instr@plt>
mov    $0x48,%edi
call   1030 <write_imm@plt>
mov    $0x28,%edi
call   1040 <write_instr@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @pause_handler(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
%3 = call i32 @write_instr(i32 0)
%4 = call i32 @write_imm(i32 72)
%5 = call i32 @write_instr(i32 40)
ret i32 0
}

LLVM IR (-O2):
define i32 @pause_handler(i8** nocapture readnone %0) {
%2 = tail call i32 @write_instr(i32 0)
%3 = tail call i32 @write_imm(i32 72)
%4 = tail call i32 @write_instr(i32 40)
ret i32 0
}
char *isnull(char *s) {
  if (s == 0)
    s = "";
  return (s);
}


x86 assembly (clang, -O0):
<isnull>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    111e <isnull+0x1e>
lea    0xee6(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isnull>:
test   %rdi,%rdi
lea    0xef6(%rip),%rax
cmovne %rdi,%rax
ret

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define i8* @isnull(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %6
5: ; preds = %1
store i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8** %2
br label %6
6: ; preds = %5, %1
%7 = load i8*, i8** %2
ret i8* %7
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
define i8* @isnull(i8* readnone %0) {
%2 = icmp eq i8* %0, null
%3 = select i1 %2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8* %0
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ a();
int /*<<< orphan*/ b();
int /*<<< orphan*/ c();
int /*<<< orphan*/ d();
int /*<<< orphan*/ e();
int /*<<< orphan*/ f();
int main(int argc, char **argv) {
  a();
  b();
  c();
  d();
  e();
  f();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1080 <a@plt>
mov    $0x0,%al
call   1040 <b@plt>
mov    $0x0,%al
call   1070 <c@plt>
mov    $0x0,%al
call   1030 <d@plt>
mov    $0x0,%al
call   1060 <e@plt>
mov    $0x0,%al
call   1050 <f@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1080 <a@plt>
xor    %eax,%eax
call   1040 <b@plt>
xor    %eax,%eax
call   1070 <c@plt>
xor    %eax,%eax
call   1030 <d@plt>
xor    %eax,%eax
call   1060 <e@plt>
xor    %eax,%eax
call   1050 <f@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**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 (...) @a()
%7 = call i32 (...) @b()
%8 = call i32 (...) @c()
%9 = call i32 (...) @d()
%10 = call i32 (...) @e()
%11 = call i32 (...) @f()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @a()
%4 = tail call i32 (...) @b()
%5 = tail call i32 (...) @c()
%6 = tail call i32 (...) @d()
%7 = tail call i32 (...) @e()
%8 = tail call i32 (...) @f()
ret i32 0
}
short empty3() { return 0; }


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

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

LLVM IR (-O0):
define signext i16 @empty3() {
ret i16 0
}

LLVM IR (-O2):
define signext i16 @empty3() {
ret i16 0
}
/* Variables and functions */
int one(unsigned int);
int /*<<< orphan*/ printf(char *, int);
int scanf(char *, unsigned int *);
int main() {
  unsigned int num;
  if (scanf("%u", &num) == 1)
    printf("%d\n", one(num));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
cmp    $0x1,%eax
jne    116e <main+0x3e>
mov    -0x8(%rbp),%edi
call   1040 <one@plt>
mov    %eax,%esi
lea    0xe9a(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
cmp    $0x1,%eax
jne    115e <main+0x2e>
mov    0x4(%rsp),%edi
call   1040 <one@plt>
lea    0xeac(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%u\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%4 = icmp eq i32 %3, 1
br i1 %4, label %5, label %9
5: ; preds = %0
%6 = load i32, i32* %2
%7 = call i32 @one(i32 %6)
%8 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %7)
br label %9
9: ; preds = %5, %0
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%u\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = icmp eq i32 %3, 1
br i1 %4, label %5, label %9
5: ; preds = %0
%6 = load i32, i32* %1
%7 = call i32 @one(i32 %6)
%8 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %7)
br label %9
9: ; preds = %5, %0
ret i32 0
}
/* Variables and functions */
int recv(int, void *, size_t, int /*<<< orphan*/);
int tcp_recv(void *arg, void *buf, size_t len) {
  int *fd = (int *)arg;
  return recv(*fd, buf, len, 0);
}


x86 assembly (clang, -O0):
<tcp_recv>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
xor    %ecx,%ecx
call   1030 <recv@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tcp_recv>:
mov    (%rdi),%edi
xor    %ecx,%ecx
jmp    1030 <recv@plt>

LLVM IR (-O0):
define i32 @tcp_recv(i8* %0, i8* %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i32*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i32*
store i32* %9, i32** %7
%10 = load i32*, i32** %7
%11 = load i32, i32* %10
%12 = load i8*, i8** %5
%13 = load i64, i64* %6
%14 = call i32 @recv(i32 %11, i8* %12, i64 %13, i32 0)
ret i32 %14
}

LLVM IR (-O2):
define i32 @tcp_recv(i8* nocapture %0, i8* %1, i64 %2) {
%4 = bitcast i8* %0 to i32*
%5 = load i32, i32* %4
%6 = tail call i32 @recv(i32 %5, i8* %1, i64 %2, i32 0)
ret i32 %6
}
int kdb_unregister(char *cmd) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @kdb_unregister(i8* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void LibHelloWorld() { printf("Hello World (from a shared library!)\n"); }


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

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

LLVM IR (-O0):
@.str = [38 x i8] c"Hello World (from a shared library!)\0A\00"
define void @LibHelloWorld() {
%1 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [37 x i8] c"Hello World (from a shared library!)\00"
define void @LibHelloWorld() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ iconv_t;

/* Variables and functions */
size_t libiconv(int /*<<< orphan*/, char **, size_t *, char **, size_t *);
size_t iconv(iconv_t cd, char **inbuf, size_t *inbytesleft, char **outbuf,
             size_t *outbytesleft) {
  return libiconv(cd, inbuf, inbytesleft, outbuf, outbytesleft);
}


x86 assembly (clang, -O0):
<iconv>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r8
call   1030 <libiconv@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<iconv>:
jmp    1030 <libiconv@plt>

LLVM IR (-O0):
define i64 @iconv(i32 %0, i8** %1, i64* %2, i8** %3, i64* %4) {
%6 = alloca i32
%7 = alloca i8**
%8 = alloca i64*
%9 = alloca i8**
%10 = alloca i64*
store i32 %0, i32* %6
store i8** %1, i8*** %7
store i64* %2, i64** %8
store i8** %3, i8*** %9
store i64* %4, i64** %10
%11 = load i32, i32* %6
%12 = load i8**, i8*** %7
%13 = load i64*, i64** %8
%14 = load i8**, i8*** %9
%15 = load i64*, i64** %10
%16 = call i64 @libiconv(i32 %11, i8** %12, i64* %13, i8** %14, i64* %15)
ret i64 %16
}

LLVM IR (-O2):
define i64 @iconv(i32 %0, i8** %1, i64* %2, i8** %3, i64* %4) {
%6 = tail call i64 @libiconv(i32 %0, i8** %1, i64* %2, i8** %3, i64* %4)
ret i64 %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void test() {
  printf("Test");
  printf("Test2");
}


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

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

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

LLVM IR (-O2):
@.str = [5 x i8] c"Test\00"
@.str.1 = [6 x i8] c"Test2\00"
define void @test() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fill_outgoing_packet_header(unsigned char *, int, int);
int fill_protocol_info_req(unsigned char *buf, unsigned char flags) {
  fill_outgoing_packet_header(buf, 0x45, 4);
  buf += 4;
  buf[0x00] = 0x00;
  buf[0x01] = 0x02;
  buf[0x02] = 0x00;
  buf[0x03] = flags;
  return 4 + 4;
}


x86 assembly (clang, -O0):
<fill_protocol_info_req>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x45,%esi
mov    $0x4,%edx
call   1030 <fill_outgoing_packet_header@plt>
mov    -0x8(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x8(%rbp),%rax
movb   $0x2,0x1(%rax)
mov    -0x8(%rbp),%rax
movb   $0x0,0x2(%rax)
mov    -0x9(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x3(%rax)
mov    $0x8,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fill_protocol_info_req>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
mov    $0x45,%esi
mov    $0x4,%edx
call   1030 <fill_outgoing_packet_header@plt>
movw   $0x200,0x4(%rbx)
movb   $0x0,0x6(%rbx)
mov    %bpl,0x7(%rbx)
mov    $0x8,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @fill_protocol_info_req(i8* %0, i8 zeroext %1) {
%3 = alloca i8*
%4 = alloca i8
store i8* %0, i8** %3
store i8 %1, i8* %4
%5 = load i8*, i8** %3
%6 = call i32 @fill_outgoing_packet_header(i8* %5, i32 69, i32 4)
%7 = load i8*, i8** %3
%8 = getelementptr inbounds i8, i8* %7, i64 4
store i8* %8, i8** %3
%9 = load i8*, i8** %3
%10 = getelementptr inbounds i8, i8* %9, i64 0
store i8 0, i8* %10
%11 = load i8*, i8** %3
%12 = getelementptr inbounds i8, i8* %11, i64 1
store i8 2, i8* %12
%13 = load i8*, i8** %3
%14 = getelementptr inbounds i8, i8* %13, i64 2
store i8 0, i8* %14
%15 = load i8, i8* %4
%16 = load i8*, i8** %3
%17 = getelementptr inbounds i8, i8* %16, i64 3
store i8 %15, i8* %17
ret i32 8
}

LLVM IR (-O2):
define i32 @fill_protocol_info_req(i8* %0, i8 zeroext %1) {
%3 = tail call i32 @fill_outgoing_packet_header(i8* %0, i32 69, i32 4)
%4 = getelementptr inbounds i8, i8* %0, i64 4
store i8 0, i8* %4
%5 = getelementptr inbounds i8, i8* %0, i64 5
store i8 2, i8* %5
%6 = getelementptr inbounds i8, i8* %0, i64 6
store i8 0, i8* %6
%7 = getelementptr inbounds i8, i8* %0, i64 7
store i8 %1, i8* %7
ret i32 8
}
/* Variables and functions */
scalar_t__ memcmp(void const *, void const *, size_t);
int memeq(const void *s1, const void *s2, size_t n) {
  return memcmp(s1, s2, n) == 0;
}


x86 assembly (clang, -O0):
<memeq>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <memcmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<memeq>:
push   %rax
call   1030 <memcmp@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @memeq(i8* %0, i8* %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
store i8* %0, i8** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = load i64, i64* %6
%10 = call i64 @memcmp(i8* %7, i8* %8, i64 %9)
%11 = icmp eq i64 %10, 0
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @memeq(i8* %0, i8* %1, i64 %2) {
%4 = tail call i64 @memcmp(i8* %0, i8* %1, i64 %2)
%5 = icmp eq i64 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
void *realloc(void *, size_t);
int /*<<< orphan*/ stderr;
void *xrealloc(void *ptr, size_t size) {
  register void *value = realloc(ptr, size);
  if (value == 0) {
    fprintf(stderr, "tree: virtual memory exhausted.\n");
    exit(1);
  }
  return value;
}


x86 assembly (clang, -O0):
<xrealloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <realloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    117b <xrealloc+0x4b>
mov    0x2e7d(%rip),%rax
mov    (%rax),%edi
lea    0xe94(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrealloc>:
push   %rax
call   1040 <realloc@plt>
test   %rax,%rax
je     113d <xrealloc+0xd>
pop    %rcx
ret
mov    0x2e9c(%rip),%rax
mov    (%rax),%edi
lea    0xeb3(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [33 x i8] c"tree: virtual memory exhausted.\0A\00"
define i8* @xrealloc(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i8*
store i8* %0, i8** %3
store i64 %1, i64* %4
%6 = load i8*, i8** %3
%7 = load i64, i64* %4
%8 = call i8* @realloc(i8* %6, i64 %7)
store i8* %8, i8** %5
%9 = load i8*, i8** %5
%10 = icmp eq i8* %9, null
br i1 %10, label %11, label %15
11: ; preds = %2
%12 = load i32, i32* @stderr
%13 = call i32 @fprintf(i32 %12, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
%14 = call i32 @exit(i32 1)
unreachable
15: ; preds = %2
%16 = load i8*, i8** %5
ret i8* %16
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [33 x i8] c"tree: virtual memory exhausted.\0A\00"
define noalias i8* @xrealloc(i8* nocapture %0, i64 %1) {
%3 = tail call i8* @realloc(i8* %0, i64 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %9
5: ; preds = %2
%6 = load i32, i32* @stderr
%7 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
%8 = tail call i32 @exit(i32 1)
unreachable
9: ; preds = %2
ret i8* %3
}
unsigned xrop3_199_0_0(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  unsigned stk3;
  stk3 = D | T;
  stk2 = S & stk3;
  stk1 = T ^ stk2;
  stk1 = ~stk1;
  return stk1;
}


x86 assembly (clang, -O0):
<xrop3_199_0_0>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xff,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
movzbl -0x2(%rbp),%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
or     -0x10(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0xc(%rbp),%eax
and    -0x1c(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%eax
xor    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_199_0_0>:
mov    %edi,%ecx
shl    $0x8,%ecx
or     %edi,%ecx
mov    %esi,%eax
shl    $0x8,%eax
lea    (%rsi,%rax,1),%edx
or     $0xff,%eax
and    %ecx,%eax
xor    %edx,%eax
not    %eax
ret

LLVM IR (-O0):
define i32 @xrop3_199_0_0(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
store i32 255, i32* %5
%11 = load i8, i8* %3
%12 = zext i8 %11 to i32
%13 = shl i32 %12, 8
%14 = load i8, i8* %3
%15 = zext i8 %14 to i32
%16 = or i32 %13, %15
store i32 %16, i32* %6
%17 = load i8, i8* %4
%18 = zext i8 %17 to i32
%19 = shl i32 %18, 8
%20 = load i8, i8* %4
%21 = zext i8 %20 to i32
%22 = or i32 %19, %21
store i32 %22, i32* %7
%23 = load i32, i32* %5
%24 = load i32, i32* %7
%25 = or i32 %23, %24
store i32 %25, i32* %10
%26 = load i32, i32* %6
%27 = load i32, i32* %10
%28 = and i32 %26, %27
store i32 %28, i32* %9
%29 = load i32, i32* %7
%30 = load i32, i32* %9
%31 = xor i32 %29, %30
store i32 %31, i32* %8
%32 = load i32, i32* %8
%33 = xor i32 %32, -1
store i32 %33, i32* %8
%34 = load i32, i32* %8
ret i32 %34
}

LLVM IR (-O2):
define i32 @xrop3_199_0_0(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = mul nuw nsw i32 %3, 257
%5 = zext i8 %1 to i32
%6 = shl nuw nsw i32 %5, 8
%7 = or i32 %6, %5
%8 = or i32 %6, 255
%9 = and i32 %8, %4
%10 = xor i32 %7, %9
%11 = xor i32 %10, -1
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ worker_1(int /*<<< orphan*/);
int /*<<< orphan*/ worker_2(int /*<<< orphan*/);
int /*<<< orphan*/ worker_3(int /*<<< orphan*/);
int /*<<< orphan*/ worker_4(int /*<<< orphan*/);
int /*<<< orphan*/ worker_5(int /*<<< orphan*/);
int /*<<< orphan*/ worker_6(int /*<<< orphan*/);
int /*<<< orphan*/ worker_7(int /*<<< orphan*/);
int /*<<< orphan*/ worker_8(int /*<<< orphan*/);
int main() {
__CPROVER_ASYNC_1:
  worker_1(0);
__CPROVER_ASYNC_2:
  worker_2(0);
__CPROVER_ASYNC_3:
  worker_3(0);
__CPROVER_ASYNC_4:
  worker_4(0);
__CPROVER_ASYNC_5:
  worker_5(0);
__CPROVER_ASYNC_6:
  worker_6(0);
__CPROVER_ASYNC_7:
  worker_7(0);
__CPROVER_ASYNC_8:
  worker_8(0);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xor    %edi,%edi
call   10a0 <worker_1@plt>
xor    %edi,%edi
call   1060 <worker_2@plt>
xor    %edi,%edi
call   1040 <worker_3@plt>
xor    %edi,%edi
call   1080 <worker_4@plt>
xor    %edi,%edi
call   1030 <worker_5@plt>
xor    %edi,%edi
call   1070 <worker_6@plt>
xor    %edi,%edi
call   1050 <worker_7@plt>
xor    %edi,%edi
call   1090 <worker_8@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
call   10a0 <worker_1@plt>
xor    %edi,%edi
call   1060 <worker_2@plt>
xor    %edi,%edi
call   1040 <worker_3@plt>
xor    %edi,%edi
call   1080 <worker_4@plt>
xor    %edi,%edi
call   1030 <worker_5@plt>
xor    %edi,%edi
call   1070 <worker_6@plt>
xor    %edi,%edi
call   1050 <worker_7@plt>
xor    %edi,%edi
call   1090 <worker_8@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %0
%3 = call i32 @worker_1(i32 0)
br label %4
4: ; preds = %2
%5 = call i32 @worker_2(i32 0)
br label %6
6: ; preds = %4
%7 = call i32 @worker_3(i32 0)
br label %8
8: ; preds = %6
%9 = call i32 @worker_4(i32 0)
br label %10
10: ; preds = %8
%11 = call i32 @worker_5(i32 0)
br label %12
12: ; preds = %10
%13 = call i32 @worker_6(i32 0)
br label %14
14: ; preds = %12
%15 = call i32 @worker_7(i32 0)
br label %16
16: ; preds = %14
%17 = call i32 @worker_8(i32 0)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @worker_1(i32 0)
%2 = tail call i32 @worker_2(i32 0)
%3 = tail call i32 @worker_3(i32 0)
%4 = tail call i32 @worker_4(i32 0)
%5 = tail call i32 @worker_5(i32 0)
%6 = tail call i32 @worker_6(i32 0)
%7 = tail call i32 @worker_7(i32 0)
%8 = tail call i32 @worker_8(i32 0)
ret i32 0
}
/* Type definitions */
struct client_attr {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ send_response_data(struct client_attr *);
int /*<<< orphan*/ send_response_header(struct client_attr *);
void send_response(struct client_attr *attr) {
  send_response_header(attr);
  send_response_data(attr);
}


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

x86 assembly (clang, -O2):
<send_response>:
push   %rbx
mov    %rdi,%rbx
call   1030 <send_response_header@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <send_response_data@plt>

LLVM IR (-O0):
%struct.client_attr = type { i32 }
define void @send_response(%struct.client_attr* %0) {
%2 = alloca %struct.client_attr*
store %struct.client_attr* %0, %struct.client_attr** %2
%3 = load %struct.client_attr*, %struct.client_attr** %2
%4 = call i32 @send_response_header(%struct.client_attr* %3)
%5 = load %struct.client_attr*, %struct.client_attr** %2
%6 = call i32 @send_response_data(%struct.client_attr* %5)
ret void
}

LLVM IR (-O2):
%struct.client_attr = type { i32 }
define void @send_response(%struct.client_attr* %0) {
%2 = tail call i32 @send_response_header(%struct.client_attr* %0)
%3 = tail call i32 @send_response_data(%struct.client_attr* %0)
ret void
}
void audit_session_key_free(struct ssh *ssh, int ctos) {}


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

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

LLVM IR (-O0):
%struct.ssh = type opaque
define void @audit_session_key_free(%struct.ssh* %0, i32 %1) {
%3 = alloca %struct.ssh*
%4 = alloca i32
store %struct.ssh* %0, %struct.ssh** %3
store i32 %1, i32* %4
ret void
}

LLVM IR (-O2):
%struct.ssh = type opaque
define void @audit_session_key_free(%struct.ssh* nocapture %0, i32 %1) {
ret void
}
int ObjectSize2(void *const p __attribute__((pass_object_size(2)))) {
  return __builtin_object_size(p, 2);
}


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

x86 assembly (clang, -O2):
<ObjectSize2>:
mov    %rsi,%rax
ret

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

LLVM IR (-O2):
define i32 @ObjectSize2(i8* nocapture readnone %0, i64 %1) {
%3 = trunc i64 %1 to i32
ret i32 %3
}
/* Variables and functions */
char *notImplemented();
char *serverGetCommands(char *unused1, char *unused2, char *unused3) {
  (void)(unused1);
  (void)(unused2);
  (void)(unused3);
  return notImplemented();
}


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

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

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

LLVM IR (-O2):
define i8* @serverGetCommands(i8* nocapture readnone %0, i8* nocapture readnone %1, i8* nocapture readnone %2) {
%4 = tail call i8* (...) @notImplemented()
ret i8* %4
}
void zpodd_enable_run_wake(struct ata_device *dev) {}


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

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

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

LLVM IR (-O2):
%struct.ata_device = type opaque
define void @zpodd_enable_run_wake(%struct.ata_device* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ hang();
int /*<<< orphan*/ printf(char *, char const *);
void panic(const char *msg) {
  printf("\npanic: %s\n", msg ? msg : "Something went terribly wrong :(");
  hang();
}


x86 assembly (clang, -O0):
<panic>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1144 <panic+0x24>
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
jmp    1154 <panic+0x34>
lea    0xec1(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    1154 <panic+0x34>
mov    -0x10(%rbp),%rsi
lea    0xea1(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <hang@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<panic>:
push   %rax
test   %rdi,%rdi
lea    0xee1(%rip),%rsi
cmovne %rdi,%rsi
lea    0xeca(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <hang@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"\0Apanic: %s\0A\00"
@.str.1 = [33 x i8] c"Something went terribly wrong :(\00"
define void @panic(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp ne i8* %3, null
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = load i8*, i8** %2
br label %8
7: ; preds = %1
br label %8
8: ; preds = %7, %5
%9 = phi i8* [ %6, %5 ], [ getelementptr inbounds ([33 x i8], [33 x i8]* @.str.1, i64 0, i64 0), %7 ]
%10 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %9)
%11 = call i32 (...) @hang()
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"\0Apanic: %s\0A\00"
@.str.1 = [33 x i8] c"Something went terribly wrong :(\00"
define void @panic(i8* %0) {
%2 = icmp eq i8* %0, null
%3 = select i1 %2, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.1, i64 0, i64 0), i8* %0
%4 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = tail call i32 (...) @hang()
ret void
}
/* Type definitions */
typedef int uint_least64_t;

/* Variables and functions */
uint_least64_t vc_get_insecureccaps() {
  return ~(0x00000001ull | 0x00000100ull);
}


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

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

LLVM IR (-O0):
define i32 @vc_get_insecureccaps() {
ret i32 -258
}

LLVM IR (-O2):
define i32 @vc_get_insecureccaps() {
ret i32 -258
}
void HALSTM25PM$HPLSTM25P$beginCmd(void) { HPLSTM25PM$HPLSTM25P$beginCmd(); }


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

x86 assembly (clang, -O2):
<HALSTM25PM$HPLSTM25P$beginCmd>:
xor    %eax,%eax
jmp    1030 <HPLSTM25PM$HPLSTM25P$beginCmd@plt>

LLVM IR (-O0):
define void @"HALSTM25PM$HPLSTM25P$beginCmd"() {
%1 = call i32 (...) @"HPLSTM25PM$HPLSTM25P$beginCmd"()
ret void
}

LLVM IR (-O2):
define void @"HALSTM25PM$HPLSTM25P$beginCmd"() {
%1 = tail call i32 (...) @"HPLSTM25PM$HPLSTM25P$beginCmd"()
ret void
}
/* Variables and functions */
char **sa_concat(char **, int /*<<< orphan*/);
char **sa_merge(char **x, char **y) {
  if (y != NULL) {
    while (*y != NULL) {
      x = sa_concat(x, *y++);
    }
  }
  return x;
}


x86 assembly (clang, -O0):
<sa_merge>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1169 <sa_merge+0x59>
jmp    1130 <sa_merge+0x20>
mov    -0x10(%rbp),%rax
cmpq   $0x0,(%rax)
je     1164 <sa_merge+0x54>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%rax
mov    %eax,%esi
call   1030 <sa_concat@plt>
mov    %rax,-0x8(%rbp)
jmp    1130 <sa_merge+0x20>
jmp    1169 <sa_merge+0x59>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sa_merge>:
push   %rbx
mov    %rdi,%rax
test   %rsi,%rsi
je     1144 <sa_merge+0x34>
mov    %rsi,%rbx
mov    (%rsi),%rsi
test   %rsi,%rsi
je     1144 <sa_merge+0x34>
add    $0x8,%rbx
nopl   0x0(%rax,%rax,1)
mov    %rax,%rdi
call   1030 <sa_concat@plt>
mov    (%rbx),%rsi
add    $0x8,%rbx
test   %rsi,%rsi
jne    1130 <sa_merge+0x20>
pop    %rbx
ret

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

LLVM IR (-O2):
define i8** @sa_merge(i8** %0, i8** %1) {
%3 = icmp eq i8** %1, null
br i1 %3, label %17, label %4
4: ; preds = %2
%5 = load i8*, i8** %1
%6 = icmp eq i8* %5, null
br i1 %6, label %17, label %7
7: ; preds = %4, %7
%8 = phi i8* [ %15, %7 ], [ %5, %4 ]
%9 = phi i8** [ %11, %7 ], [ %1, %4 ]
%10 = phi i8** [ %14, %7 ], [ %0, %4 ]
%11 = getelementptr inbounds i8*, i8** %9, i64 1
%12 = ptrtoint i8* %8 to i64
%13 = trunc i64 %12 to i32
%14 = tail call i8** @sa_concat(i8** %10, i32 %13)
%15 = load i8*, i8** %11
%16 = icmp eq i8* %15, null
br i1 %16, label %17, label %7
17: ; preds = %7, %4, %2
%18 = phi i8** [ %0, %2 ], [ %0, %4 ], [ %14, %7 ]
ret i8** %18
}
void foo_2_1_1_1_2_2_1_1_1() {}


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

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

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

LLVM IR (-O2):
define void @foo_2_1_1_1_2_2_1_1_1() {
ret void
}
int do_138() { return 138; }


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

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

LLVM IR (-O0):
define i32 @do_138() {
ret i32 138
}

LLVM IR (-O2):
define i32 @do_138() {
ret i32 138
}
/* Type definitions */
typedef scalar_t__ __v4hi;
typedef scalar_t__ __m64;

/* Variables and functions */
__m64 __attribute__((__always___, __nodebug__))
_mm_cmpeq_pi16(__m64 __m1, __m64 __m2) {
  return (__m64)((__v4hi)__m1 == (__v4hi)__m2);
}


x86 assembly (clang, -O0):
<_mm_cmpeq_pi16>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
cltq
pop    %rbp
ret

x86 assembly (clang, -O2):
<_mm_cmpeq_pi16>:
xor    %eax,%eax
cmp    %rsi,%rdi
sete   %al
ret

LLVM IR (-O0):
define i64 @_mm_cmpeq_pi16(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = load i64, i64* %4
%7 = icmp eq i64 %5, %6
%8 = zext i1 %7 to i32
%9 = sext i32 %8 to i64
ret i64 %9
}

LLVM IR (-O2):
define i64 @_mm_cmpeq_pi16(i64 %0, i64 %1) {
%3 = icmp eq i64 %0, %1
%4 = zext i1 %3 to i64
ret i64 %4
}
/* Type definitions */
struct target {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ target__has_cpu(struct target *);
int /*<<< orphan*/ target__has_task(struct target *);
bool target__none(struct target *target) {
  return !target__has_task(target) && !target__has_cpu(target);
}


x86 assembly (clang, -O0):
<target__none>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <target__has_task@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x9(%rbp)
jne    1159 <target__none+0x39>
mov    -0x8(%rbp),%rdi
call   1030 <target__has_cpu@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<target__none>:
push   %rbx
mov    %rdi,%rbx
call   1040 <target__has_task@plt>
mov    %eax,%ecx
xor    %eax,%eax
test   %ecx,%ecx
je     1133 <target__none+0x13>
pop    %rbx
ret
mov    %rbx,%rdi
call   1030 <target__has_cpu@plt>
mov    %eax,%ecx
xor    %eax,%eax
test   %ecx,%ecx
sete   %al
pop    %rbx
ret

LLVM IR (-O0):
%struct.target = type { i32 }
define i32 @target__none(%struct.target* %0) {
%2 = alloca %struct.target*
store %struct.target* %0, %struct.target** %2
%3 = load %struct.target*, %struct.target** %2
%4 = call i32 @target__has_task(%struct.target* %3)
%5 = icmp ne i32 %4, 0
br i1 %5, label %11, label %6
6: ; preds = %1
%7 = load %struct.target*, %struct.target** %2
%8 = call i32 @target__has_cpu(%struct.target* %7)
%9 = icmp ne i32 %8, 0
%10 = xor i1 %9, true
br label %11
11: ; preds = %6, %1
%12 = phi i1 [ false, %1 ], [ %10, %6 ]
%13 = zext i1 %12 to i32
ret i32 %13
}

LLVM IR (-O2):
%struct.target = type { i32 }
define i32 @target__none(%struct.target* %0) {
%2 = tail call i32 @target__has_task(%struct.target* %0)
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = tail call i32 @target__has_cpu(%struct.target* %0)
%6 = icmp eq i32 %5, 0
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %4, %1
%9 = phi i32 [ 0, %1 ], [ %7, %4 ]
ret i32 %9
}
/* Type definitions */
struct stat {
  int dummy;
};

/* Variables and functions */
#define ENOENT 129
#define ENOTDIR 128
int errno;
int stat(char *, struct stat *);
int file_exists(char *file) {
  struct stat buf;
  int res = stat(file, &buf);
  if (res)
    return true;
  else
    switch (errno) {
    case ENOENT:
    case ENOTDIR:
      return false;
    default:
      return true;
    }
}


x86 assembly (clang, -O0):
<file_exists>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1030 <stat@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
je     1142 <file_exists+0x32>
movl   $0x1,-0x4(%rbp)
jmp    116f <file_exists+0x5f>
mov    0x2e97(%rip),%rax
mov    (%rax),%eax
add    $0xffffff80,%eax
sub    $0x1,%eax
ja     1168 <file_exists+0x58>
jmp    115c <file_exists+0x4c>
movl   $0x0,-0x4(%rbp)
jmp    116f <file_exists+0x5f>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<file_exists>:
push   %rax
mov    %rsp,%rsi
call   1030 <stat@plt>
mov    0x2ec0(%rip),%rcx
mov    (%rcx),%edx
and    $0xfffffffe,%edx
xor    $0x80,%edx
xor    %ecx,%ecx
or     %eax,%edx
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
@errno = global i32 0
define i32 @file_exists(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca %struct.stat
%5 = alloca i32
store i8* %0, i8** %3
%6 = load i8*, i8** %3
%7 = call i32 @stat(i8* %6, %struct.stat* %4)
store i32 %7, i32* %5
%8 = load i32, i32* %5
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %11
10: ; preds = %1
store i32 1, i32* %2
br label %15
11: ; preds = %1
%12 = load i32, i32* @errno
switch i32 %12, label %14 [
i32 129, label %13
i32 128, label %13
]
13: ; preds = %11, %11
store i32 0, i32* %2
br label %15
14: ; preds = %11
store i32 1, i32* %2
br label %15
15: ; preds = %14, %13, %10
%16 = load i32, i32* %2
ret i32 %16
}

LLVM IR (-O2):
%struct.stat = type { i32 }
@errno = global i32 0
define i32 @file_exists(i8* nocapture %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i32 @stat(i8* %0, %struct.stat* %2)
%5 = icmp ne i32 %4, 0
%6 = load i32, i32* @errno
%7 = and i32 %6, -2
%8 = icmp ne i32 %7, 128
%9 = select i1 %5, i1 true, i1 %8
%10 = zext i1 %9 to i32
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ F_OK;
int access(char *, int /*<<< orphan*/);
int file_exists_p(char *filename) { return (access(filename, F_OK)); }


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

x86 assembly (clang, -O2):
<file_exists_p>:
mov    0x2ec1(%rip),%rax
mov    (%rax),%esi
jmp    1030 <access@plt>

LLVM IR (-O0):
@F_OK = global i32 0
define i32 @file_exists_p(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i32, i32* @F_OK
%5 = call i32 @access(i8* %3, i32 %4)
ret i32 %5
}

LLVM IR (-O2):
@F_OK = global i32 0
define i32 @file_exists_p(i8* nocapture %0) {
%2 = load i32, i32* @F_OK
%3 = tail call i32 @access(i8* %0, i32 %2)
ret i32 %3
}
char *strrchr(const char *ptr, int value) { return 0; }


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

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

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

LLVM IR (-O2):
define noalias i8* @strrchr(i8* nocapture readnone %0, i32 %1) {
ret i8* null
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ get_port(int /*<<< orphan*/, int, int);
uint8_t io_read_interrupt_capture(uint8_t port) {
  return get_port(port, 0x10, 0x11);
}


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

x86 assembly (clang, -O2):
<io_read_interrupt_capture>:
mov    $0x10,%esi
mov    $0x11,%edx
jmp    1030 <get_port@plt>

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

LLVM IR (-O2):
define i32 @io_read_interrupt_capture(i32 %0) {
%2 = tail call i32 @get_port(i32 %0, i32 16, i32 17)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void hello(void) { printf("hello, world\n"); }


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

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

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

LLVM IR (-O2):
@str = [13 x i8] c"hello, world\00"
define void @hello() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
char getchar();
int /*<<< orphan*/ putchar(char);
int /*<<< orphan*/ puts(char *);
void pause_buffer(void) {
  int ch;
  putchar('\n');
  puts("[enter] to continue...");
  ch = getchar();
  if (ch != '\n') {
    while (getchar() != '\n') {
      continue;
    }
    putchar('\n');
  }
}


x86 assembly (clang, -O0):
<pause_buffer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xeb7(%rip),%rdi
call   1040 <puts@plt>
mov    $0x0,%al
call   1050 <getchar@plt>
movsbl %al,%eax
mov    %eax,-0x4(%rbp)
cmpl   $0xa,-0x4(%rbp)
je     118c <pause_buffer+0x5c>
jmp    116a <pause_buffer+0x3a>
mov    $0x0,%al
call   1050 <getchar@plt>
movsbl %al,%eax
cmp    $0xa,%eax
je     1182 <pause_buffer+0x52>
jmp    116a <pause_buffer+0x3a>
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pause_buffer>:
push   %rax
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xebe(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
call   1050 <getchar@plt>
cmp    $0xa,%al
jne    1160 <pause_buffer+0x30>
pop    %rax
ret
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
xor    %eax,%eax
call   1050 <getchar@plt>
cmp    $0xa,%al
jne    1160 <pause_buffer+0x30>
mov    $0xa,%edi
pop    %rax
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [23 x i8] c"[enter] to continue...\00"
define void @pause_buffer() {
%1 = alloca i32
%2 = call i32 @putchar(i8 signext 10)
%3 = call i32 @puts(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%4 = call signext i8 (...) @getchar()
%5 = sext i8 %4 to i32
store i32 %5, i32* %1
%6 = load i32, i32* %1
%7 = icmp ne i32 %6, 10
br i1 %7, label %8, label %16
8: ; preds = %0
br label %9
9: ; preds = %13, %8
%10 = call signext i8 (...) @getchar()
%11 = sext i8 %10 to i32
%12 = icmp ne i32 %11, 10
br i1 %12, label %13, label %14
13: ; preds = %9
br label %9
14: ; preds = %9
%15 = call i32 @putchar(i8 signext 10)
br label %16
16: ; preds = %14, %0
ret void
}

LLVM IR (-O2):
@.str = [23 x i8] c"[enter] to continue...\00"
define void @pause_buffer() {
%1 = tail call i32 @putchar(i8 signext 10)
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%3 = tail call signext i8 (...) @getchar()
%4 = icmp eq i8 %3, 10
br i1 %4, label %10, label %5
5: ; preds = %0, %5
%6 = tail call signext i8 (...) @getchar()
%7 = icmp eq i8 %6, 10
br i1 %7, label %8, label %5
8: ; preds = %5
%9 = tail call i32 @putchar(i8 signext 10)
br label %10
10: ; preds = %8, %0
ret void
}