xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ outb(unsigned short, int);
void serial_configure_line(unsigned short com) { outb((com + 3), 0x03); }


x86 assembly (clang, -O0):
<serial_configure_line>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%eax
add    $0x3,%eax
mov    $0x3,%esi
movzwl %ax,%edi
call   1030 <outb@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<serial_configure_line>:
add    $0x3,%edi
movzwl %di,%edi
mov    $0x3,%esi
jmp    1030 <outb@plt>

LLVM IR (-O0):
define void @serial_configure_line(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = zext i16 %3 to i32
%5 = add nsw i32 %4, 3
%6 = trunc i32 %5 to i16
%7 = call i32 @outb(i16 zeroext %6, i32 3)
ret void
}

LLVM IR (-O2):
define void @serial_configure_line(i16 zeroext %0) {
%2 = add i16 %0, 3
%3 = tail call i32 @outb(i16 zeroext %2, i32 3)
ret void
}
int eql(int a, int b) { return a == b; }


x86 assembly (clang, -O0):
<eql>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<eql>:
xor    %eax,%eax
cmp    %esi,%edi
sete   %al
ret

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

LLVM IR (-O2):
define i32 @eql(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
void __attribute__((destructor)) __pt_uninit(void) {}


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

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

LLVM IR (-O0):
@llvm.global_dtors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @__pt_uninit, i8* null }]
define void @__pt_uninit() {
ret void
}

LLVM IR (-O2):
@llvm.global_dtors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @__pt_uninit, i8* null }]
define void @__pt_uninit() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ logInputProblem(char *, unsigned char *, int);
void logDiscardedByte(unsigned char byte) {
  logInputProblem("Discarded Byte", &byte, 1);
}


x86 assembly (clang, -O0):
<logDiscardedByte>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
lea    0xedb(%rip),%rdi
lea    -0x1(%rbp),%rsi
mov    $0x1,%edx
call   1030 <logInputProblem@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<logDiscardedByte>:
push   %rax
mov    %dil,0x7(%rsp)
lea    0xee3(%rip),%rdi
lea    0x7(%rsp),%rsi
mov    $0x1,%edx
call   1030 <logInputProblem@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [15 x i8] c"Discarded Byte\00"
define void @logDiscardedByte(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = call i32 @logInputProblem(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %2, i32 1)
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"Discarded Byte\00"
define void @logDiscardedByte(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = call i32 @logInputProblem(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %2, i32 1)
ret void
}
/* Variables and functions */
size_t newgap(size_t gap) {
  gap = (gap * 10) / 13;
  if (gap == 9 || gap == 10)
    gap = 11;
  if (gap < 1)
    gap = 1;
  return gap;
}


x86 assembly (clang, -O0):
<newgap>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
imul   $0xa,-0x8(%rbp),%rax
mov    $0xd,%ecx
xor    %edx,%edx
div    %rcx
mov    %rax,-0x8(%rbp)
cmpq   $0x9,-0x8(%rbp)
je     1131 <newgap+0x31>
cmpq   $0xa,-0x8(%rbp)
jne    1139 <newgap+0x39>
movq   $0xb,-0x8(%rbp)
cmpq   $0x1,-0x8(%rbp)
jae    114c <newgap+0x4c>
movq   $0x1,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<newgap>:
add    %rdi,%rdi
lea    (%rdi,%rdi,4),%rax
add    $0xffffffffffffff8b,%rax
mov    $0xb,%edx
cmp    $0x1a,%rax
jb     112b <newgap+0x2b>
lea    (%rdi,%rdi,4),%rax
movabs $0x4ec4ec4ec4ec4ec5,%rcx
ec c4 4e
mul    %rcx
shr    $0x2,%rdx
test   %rdx,%rdx
mov    $0x1,%eax
cmovne %rdx,%rax
ret

LLVM IR (-O0):
define i64 @newgap(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = mul i64 %3, 10
%5 = udiv i64 %4, 13
store i64 %5, i64* %2
%6 = load i64, i64* %2
%7 = icmp eq i64 %6, 9
br i1 %7, label %11, label %8
8: ; preds = %1
%9 = load i64, i64* %2
%10 = icmp eq i64 %9, 10
br i1 %10, label %11, label %12
11: ; preds = %8, %1
store i64 11, i64* %2
br label %12
12: ; preds = %11, %8
%13 = load i64, i64* %2
%14 = icmp ult i64 %13, 1
br i1 %14, label %15, label %16
15: ; preds = %12
store i64 1, i64* %2
br label %16
16: ; preds = %15, %12
%17 = load i64, i64* %2
ret i64 %17
}

LLVM IR (-O2):
define i64 @newgap(i64 %0) {
%2 = mul i64 %0, 10
%3 = udiv i64 %2, 13
%4 = add i64 %2, -117
%5 = icmp ult i64 %4, 26
%6 = select i1 %5, i64 11, i64 %3
%7 = icmp eq i64 %6, 0
%8 = select i1 %7, i64 1, i64 %6
ret i64 %8
}
/* Variables and functions */
int /*<<< orphan*/ asm_cursorshape(int, int);
void cursoron(void) { asm_cursorshape(6, 7); }


x86 assembly (clang, -O0):
<cursoron>:
push   %rbp
mov    %rsp,%rbp
mov    $0x6,%edi
mov    $0x7,%esi
call   1030 <asm_cursorshape@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<cursoron>:
mov    $0x6,%edi
mov    $0x7,%esi
jmp    1030 <asm_cursorshape@plt>

LLVM IR (-O0):
define void @cursoron() {
%1 = call i32 @asm_cursorshape(i32 6, i32 7)
ret void
}

LLVM IR (-O2):
define void @cursoron() {
%1 = tail call i32 @asm_cursorshape(i32 6, i32 7)
ret void
}
void f(int x) { (void)(x); }


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

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

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

LLVM IR (-O2):
define void @f(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
void *malloc(size_t);
int /*<<< orphan*/ perror(char *);
void *_mp_default_allocate(size_t size) {
  void *ret;
  ret = malloc(size);
  if (ret == 0) {
    perror("cannot allocate in libmp");
    abort();
  }
  return ret;
}


x86 assembly (clang, -O0):
<_mp_default_allocate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1167 <_mp_default_allocate+0x37>
lea    0xea5(%rip),%rdi
call   1050 <perror@plt>
mov    $0x0,%al
call   1030 <abort@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_mp_default_allocate>:
push   %rax
call   1040 <malloc@plt>
test   %rax,%rax
je     113d <_mp_default_allocate+0xd>
pop    %rcx
ret
lea    0xebc(%rip),%rdi
call   1050 <perror@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@.str = [25 x i8] c"cannot allocate in libmp\00"
define i8* @_mp_default_allocate(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp eq i8* %6, null
br i1 %7, label %8, label %11
8: ; preds = %1
%9 = call i32 @perror(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%10 = call i32 (...) @abort()
unreachable
11: ; preds = %1
%12 = load i8*, i8** %3
ret i8* %12
}

LLVM IR (-O2):
@.str = [25 x i8] c"cannot allocate in libmp\00"
define noalias i8* @_mp_default_allocate(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = tail call i32 @perror(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%6 = tail call i32 (...) @abort()
unreachable
7: ; preds = %1
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void imprime_uso() {
  printf("USAGE:\n"
         "tp0 [OPTION]...[FILE]...\n"
         "Write each FILE to standard output, with line numbers added. With no "
         "FILE, or when FILE ir -,\n"
         "read standard input\n"
         "\n"
         "OPTIONS:\n"
         "-h, --help Print this message and quit\n"
         "-s, --number-separator (mandatory argument)\n"
         "-v, --starting-line-number (mandatory argument)\n"
         "-i, --line-increment (mandatory argument)\n"
         "-l, --join-blank-lines (mandatory argument)\n"
         "-t, --non-empty\n");
}


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

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

LLVM IR (-O0):
@.str = [390 x i8] c"USAGE:\0Atp0 [OPTION]...[FILE]...\0AWrite each FILE to standard output, with line numbers added. With no FILE, or when FILE ir -,\0Aread standard input\0A\0AOPTIONS:\0A-h, --help Print this message and quit\0A-s, --number-separator (mandatory argument)\0A-v, --starting-line-number (mandatory argument)\0A-i, --line-increment (mandatory argument)\0A-l, --join-blank-lines (mandatory argument)\0A-t, --non-empty\0A\00"
define void @imprime_uso() {
%1 = call i32 @printf(i8* getelementptr inbounds ([390 x i8], [390 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [389 x i8] c"USAGE:\0Atp0 [OPTION]...[FILE]...\0AWrite each FILE to standard output, with line numbers added. With no FILE, or when FILE ir -,\0Aread standard input\0A\0AOPTIONS:\0A-h, --help Print this message and quit\0A-s, --number-separator (mandatory argument)\0A-v, --starting-line-number (mandatory argument)\0A-i, --line-increment (mandatory argument)\0A-l, --join-blank-lines (mandatory argument)\0A-t, --non-empty\00"
define void @imprime_uso() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([389 x i8], [389 x i8]* @str, i64 0, i64 0))
ret void
}
void bu_compile_dec(args) struct conscell *args;
{
  int n = bu_compile_arg_list(args);
  if (n != 1)
    goto er;
  EMIT1ATM("DEC");
  EMITEND();
  return;
er:
  cerror("1-: wrong # of args", args);
}


x86 assembly (clang, -O0):
<bu_compile_dec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1040 <bu_compile_arg_list@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x1,-0xc(%rbp)
je     1169 <bu_compile_dec+0x29>
jmp    1183 <bu_compile_dec+0x43>
lea    0xe90(%rip),%rdi
mov    $0x0,%al
call   1050 <EMIT1ATM@plt>
mov    $0x0,%al
call   1030 <EMITEND@plt>
jmp    1195 <bu_compile_dec+0x55>
mov    -0x8(%rbp),%rsi
lea    0xe76(%rip),%rdi
mov    $0x0,%al
call   1060 <cerror@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bu_compile_dec>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1040 <bu_compile_arg_list@plt>
cmp    $0x1,%eax
jne    1166 <bu_compile_dec+0x26>
lea    0xea9(%rip),%rdi
xor    %eax,%eax
call   1050 <EMIT1ATM@plt>
xor    %eax,%eax
pop    %rbx
jmp    1030 <EMITEND@plt>
lea    0xe97(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
pop    %rbx
jmp    1060 <cerror@plt>

LLVM IR (-O0):
%struct.conscell = type opaque
@.str = [4 x i8] c"DEC\00"
@.str.1 = [20 x i8] c"1-: wrong # of args\00"
define void @bu_compile_dec(%struct.conscell* %0) {
%2 = alloca %struct.conscell*
%3 = alloca i32
store %struct.conscell* %0, %struct.conscell** %2
%4 = load %struct.conscell*, %struct.conscell** %2
%5 = call i32 (%struct.conscell*, ...) bitcast (i32 (...)* @bu_compile_arg_list to i32 (%struct.conscell*, ...)*)(%struct.conscell* %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = icmp ne i32 %6, 1
br i1 %7, label %8, label %9
8: ; preds = %1
br label %12
9: ; preds = %1
%10 = call i32 (i8*, ...) bitcast (i32 (...)* @EMIT1ATM to i32 (i8*, ...)*)(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%11 = call i32 (...) @EMITEND()
br label %15
12: ; preds = %8
%13 = load %struct.conscell*, %struct.conscell** %2
%14 = call i32 (i8*, %struct.conscell*, ...) bitcast (i32 (...)* @cerror to i32 (i8*, %struct.conscell*, ...)*)(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), %struct.conscell* %13)
br label %15
15: ; preds = %12, %9
ret void
}

LLVM IR (-O2):
%struct.conscell = type opaque
@.str = [4 x i8] c"DEC\00"
@.str.1 = [20 x i8] c"1-: wrong # of args\00"
define void @bu_compile_dec(%struct.conscell* %0) {
%2 = tail call i32 (%struct.conscell*, ...) bitcast (i32 (...)* @bu_compile_arg_list to i32 (%struct.conscell*, ...)*)(%struct.conscell* %0)
%3 = icmp eq i32 %2, 1
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = tail call i32 (i8*, ...) bitcast (i32 (...)* @EMIT1ATM to i32 (i8*, ...)*)(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%6 = tail call i32 (...) @EMITEND()
br label %9
7: ; preds = %1
%8 = tail call i32 (i8*, %struct.conscell*, ...) bitcast (i32 (...)* @cerror to i32 (i8*, %struct.conscell*, ...)*)(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), %struct.conscell* %0)
br label %9
9: ; preds = %7, %4
ret void
}
unsigned short htons(unsigned short h) {
  unsigned short n;
  unsigned char *p;
  p = (unsigned char *)&n;
  p[0] = h >> 8;
  p[1] = h;
  return n;
}


x86 assembly (clang, -O0):
<htons>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
lea    -0x4(%rbp),%rax
mov    %rax,-0x10(%rbp)
movzwl -0x2(%rbp),%eax
sar    $0x8,%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
mov    -0x2(%rbp),%ax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,0x1(%rax)
movzwl -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<htons>:
mov    %edi,%eax
rol    $0x8,%ax
ret

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

LLVM IR (-O2):
define zeroext i16 @htons(i16 zeroext %0) {
%2 = tail call i16 @llvm.bswap.i16(i16 %0)
ret i16 %2
}
/* Variables and functions */
int /*<<< orphan*/ handle_buffer();
int /*<<< orphan*/ orig_protocol_execute_runtime();
int /*<<< orphan*/ printBlock();
void protocol_execute_runtime(void) {
  orig_protocol_execute_runtime();
  printBlock();
  handle_buffer();
}


x86 assembly (clang, -O0):
<protocol_execute_runtime>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1050 <orig_protocol_execute_runtime@plt>
mov    $0x0,%al
call   1040 <printBlock@plt>
mov    $0x0,%al
call   1030 <handle_buffer@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<protocol_execute_runtime>:
push   %rax
xor    %eax,%eax
call   1050 <orig_protocol_execute_runtime@plt>
xor    %eax,%eax
call   1040 <printBlock@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <handle_buffer@plt>

LLVM IR (-O0):
define void @protocol_execute_runtime() {
%1 = call i32 (...) @orig_protocol_execute_runtime()
%2 = call i32 (...) @printBlock()
%3 = call i32 (...) @handle_buffer()
ret void
}

LLVM IR (-O2):
define void @protocol_execute_runtime() {
%1 = tail call i32 (...) @orig_protocol_execute_runtime()
%2 = tail call i32 (...) @printBlock()
%3 = tail call i32 (...) @handle_buffer()
ret void
}
void genbltzall_idle() {}


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

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

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

LLVM IR (-O2):
define void @genbltzall_idle() {
ret void
}
int test4(int x) { return x / -10 != 0; }


x86 assembly (clang, -O0):
<test4>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xfffffff6,%ecx
cltd
idiv   %ecx
cmp    $0x0,%eax
setne  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test4>:
add    $0xfffffff6,%edi
xor    %eax,%eax
cmp    $0xffffffed,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @test4(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sdiv i32 %3, -10
%5 = icmp ne i32 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @test4(i32 %0) {
%2 = add i32 %0, -10
%3 = icmp ult i32 %2, -19
%4 = zext i1 %3 to i32
ret i32 %4
}
void eq() {
  asm volatile("popq %%rax\n\t"
               "popq %%rbx\n\t"
               "cmpq %%rax, %%rbx\n\t"
               "je _eq\n\t"
               "pushq $0x0\n\t"
               "jmp _eqn\n\t"
               "_eq:pushq $0x1\n\t"
               "_eqn:\n\t" ::
                   :);
}


x86 assembly (clang, -O0):
<eq>:
push   %rbp
mov    %rsp,%rbp
pop    %rax
pop    %rbx
cmp    %rax,%rbx
je     1116 <_eq>
push   $0x0
jmp    1118 <_eqn>

x86 assembly (clang, -O2):
<eq>:
pop    %rax
pop    %rbx
cmp    %rax,%rbx
je     110b <_eq>
push   $0x0
jmp    110d <_eqn>

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

LLVM IR (-O2):
define void @eq() {
tail call void asm sideeffect "popq %rax\0A\09popq %rbx\0A\09cmpq %rax, %rbx\0A\09je _eq\0A\09pushq $$0x0\0A\09jmp _eqn\0A\09_eq:pushq $$0x1\0A\09_eqn:\0A\09", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Type definitions */
typedef int uint32_t;
typedef int int8_t;

/* Variables and functions */
int8_t setBit_fun_int8_t(int8_t x, uint32_t i) { return x | 1 << i; }


x86 assembly (clang, -O0):
<setBit_fun_int8_t>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<setBit_fun_int8_t>:
mov    %edi,%eax
bts    %esi,%eax
ret

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

LLVM IR (-O2):
define i32 @setBit_fun_int8_t(i32 %0, i32 %1) {
%3 = shl nuw i32 1, %1
%4 = or i32 %3, %0
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ g(int);
main() {
  g(0x1234567812345678ll);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x12345678,%edi
call   1030 <g@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @g(i32 305419896)
ret i32 0
}
/* Variables and functions */
scalar_t__ close(int);
int /*<<< orphan*/ name_get(unsigned int);
int /*<<< orphan*/ warn(char *, int /*<<< orphan*/);
void do_closedir(int fd, unsigned name) {
  if (close(fd)) {
    warn("%s: closedir", name_get(name));
  }
}


x86 assembly (clang, -O0):
<do_closedir>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <close@plt>
cmp    $0x0,%rax
je     1166 <do_closedir+0x36>
mov    -0x8(%rbp),%edi
call   1050 <name_get@plt>
mov    %eax,%esi
lea    0xe9f(%rip),%rdi
call   1030 <warn@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_closedir>:
push   %rbx
mov    %esi,%ebx
call   1040 <close@plt>
test   %rax,%rax
je     1153 <do_closedir+0x23>
mov    %ebx,%edi
call   1050 <name_get@plt>
lea    0xeb5(%rip),%rdi
mov    %eax,%esi
pop    %rbx
jmp    1030 <warn@plt>
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [13 x i8] c"%s: closedir\00"
define void @do_closedir(i32 %0, i32 %1) {
%3 = tail call i64 @close(i32 %0)
%4 = icmp eq i64 %3, 0
br i1 %4, label %8, label %5
5: ; preds = %2
%6 = tail call i32 @name_get(i32 %1)
%7 = tail call i32 @warn(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %6)
br label %8
8: ; preds = %5, %2
ret void
}
void test___atomic_xor_fetch_0(char *mem) { __atomic_xor_fetch(mem, -1, 4); }


x86 assembly (clang, -O0):
<test___atomic_xor_fetch_0>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
movb   $0xff,-0x9(%rbp)
mov    -0x9(%rbp),%cl
mov    %cl,-0xc(%rbp)
mov    (%rax),%al
mov    %al,-0xb(%rbp)
mov    -0xb(%rbp),%al
mov    -0x18(%rbp),%rcx
mov    -0xc(%rbp),%sil
mov    %al,%dl
xor    %sil,%dl
lock cmpxchg %dl,(%rcx)
sete   %cl
mov    %al,-0x19(%rbp)
test   $0x1,%cl
mov    %al,-0xb(%rbp)
jne    114a <test___atomic_xor_fetch_0+0x4a>
jmp    111f <test___atomic_xor_fetch_0+0x1f>
mov    -0xc(%rbp),%cl
mov    -0x19(%rbp),%al
xor    %cl,%al
mov    %al,-0xa(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<test___atomic_xor_fetch_0>:
lock xorb $0xff,(%rdi)
ret

LLVM IR (-O0):
define void @test___atomic_xor_fetch_0(i8* %0) {
%2 = alloca i8*
%3 = alloca i8
%4 = alloca i8
store i8* %0, i8** %2
%5 = load i8*, i8** %2
store i8 -1, i8* %3
%6 = load i8, i8* %3
%7 = atomicrmw xor i8* %5, i8 %6 acq_rel
%8 = xor i8 %7, %6
store i8 %8, i8* %4
%9 = load i8, i8* %4
ret void
}

LLVM IR (-O2):
define void @test___atomic_xor_fetch_0(i8* nocapture %0) {
%2 = atomicrmw xor i8* %0, i8 -1 acq_rel
ret void
}
void mpc_oem_pci_bus(struct mpc_config_bus *m,
                     struct mpc_config_translation *translation) {}


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

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

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

LLVM IR (-O2):
%struct.mpc_config_bus = type opaque
%struct.mpc_config_translation = type opaque
define void @mpc_oem_pci_bus(%struct.mpc_config_bus* nocapture %0, %struct.mpc_config_translation* nocapture %1) {
ret void
}
/* Type definitions */
struct test9 {
  int dummy;
};

/* Variables and functions */
struct test9 *test9spare();
void test9(struct test9 *p) { p ? p : test9spare(); }


x86 assembly (clang, -O0):
<test9>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1130 <test9+0x20>
mov    -0x8(%rbp),%rax
jmp    1137 <test9+0x27>
mov    $0x0,%al
call   1030 <test9spare@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test9>:
test   %rdi,%rdi
je     1116 <test9+0x6>
ret
xor    %eax,%eax
jmp    1030 <test9spare@plt>

LLVM IR (-O0):
%struct.test9 = type { i32 }
define void @test9(%struct.test9* %0) {
%2 = alloca %struct.test9*
store %struct.test9* %0, %struct.test9** %2
%3 = load %struct.test9*, %struct.test9** %2
%4 = icmp ne %struct.test9* %3, null
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = load %struct.test9*, %struct.test9** %2
br label %9
7: ; preds = %1
%8 = call %struct.test9* (...) @test9spare()
br label %9
9: ; preds = %7, %5
%10 = phi %struct.test9* [ %6, %5 ], [ %8, %7 ]
ret void
}

LLVM IR (-O2):
%struct.test9 = type { i32 }
define void @test9(%struct.test9* readnone %0) {
%2 = icmp eq %struct.test9* %0, null
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call %struct.test9* (...) @test9spare()
br label %5
5: ; preds = %1, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ UAVObjUpdated(int /*<<< orphan*/);
int /*<<< orphan*/ UBloxInfoHandle();
void UBloxInfoUpdated() { UAVObjUpdated(UBloxInfoHandle()); }


x86 assembly (clang, -O0):
<UBloxInfoUpdated>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <UBloxInfoHandle@plt>
mov    %eax,%edi
call   1030 <UAVObjUpdated@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<UBloxInfoUpdated>:
push   %rax
xor    %eax,%eax
call   1040 <UBloxInfoHandle@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <UAVObjUpdated@plt>

LLVM IR (-O0):
define void @UBloxInfoUpdated() {
%1 = call i32 (...) @UBloxInfoHandle()
%2 = call i32 @UAVObjUpdated(i32 %1)
ret void
}

LLVM IR (-O2):
define void @UBloxInfoUpdated() {
%1 = tail call i32 (...) @UBloxInfoHandle()
%2 = tail call i32 @UAVObjUpdated(i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ perror(char const *);
void failure(const char *fCall) {
  perror(fCall);
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<failure>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <perror@plt>
mov    0x2ea4(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<failure>:
push   %rax
call   1030 <perror@plt>
mov    0x2eb3(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@EXIT_FAILURE = global i32 0
define void @failure(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @perror(i8* %3)
%5 = load i32, i32* @EXIT_FAILURE
%6 = call i32 @exit(i32 %5)
unreachable
}

LLVM IR (-O2):
@EXIT_FAILURE = global i32 0
define void @failure(i8* nocapture %0) {
%2 = tail call i32 @perror(i8* %0)
%3 = load i32, i32* @EXIT_FAILURE
%4 = tail call i32 @exit(i32 %3)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ errx(int, char *);
int timeoutwrite(int, int, char *, unsigned int);
int safewrite(int fd, char *buf, unsigned int len) {
  int w = 0;
  w = timeoutwrite(60, fd, buf, len);
  if (w <= 0)
    errx(-1, "could not write to network");
  return w;
}


x86 assembly (clang, -O0):
<safewrite>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rdx
mov    -0x14(%rbp),%ecx
mov    $0x3c,%edi
call   1040 <timeoutwrite@plt>
mov    %eax,-0x18(%rbp)
cmpl   $0x0,-0x18(%rbp)
jg     116b <safewrite+0x4b>
mov    $0xffffffff,%edi
lea    0xe9a(%rip),%rsi
call   1030 <errx@plt>
mov    -0x18(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<safewrite>:
push   %rbx
mov    %edx,%ecx
mov    %rsi,%rdx
mov    %edi,%esi
mov    $0x3c,%edi
call   1040 <timeoutwrite@plt>
mov    %eax,%ebx
test   %eax,%eax
jg     1149 <safewrite+0x29>
lea    0xec1(%rip),%rsi
mov    $0xffffffff,%edi
call   1030 <errx@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [27 x i8] c"could not write to network\00"
define i32 @safewrite(i32 %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %4
store i8* %1, i8** %5
store i32 %2, i32* %6
store i32 0, i32* %7
%8 = load i32, i32* %4
%9 = load i8*, i8** %5
%10 = load i32, i32* %6
%11 = call i32 @timeoutwrite(i32 60, i32 %8, i8* %9, i32 %10)
store i32 %11, i32* %7
%12 = load i32, i32* %7
%13 = icmp sle i32 %12, 0
br i1 %13, label %14, label %16
14: ; preds = %3
%15 = call i32 @errx(i32 -1, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
br label %16
16: ; preds = %14, %3
%17 = load i32, i32* %7
ret i32 %17
}

LLVM IR (-O2):
@.str = [27 x i8] c"could not write to network\00"
define i32 @safewrite(i32 %0, i8* %1, i32 %2) {
%4 = tail call i32 @timeoutwrite(i32 60, i32 %0, i8* %1, i32 %2)
%5 = icmp slt i32 %4, 1
br i1 %5, label %6, label %8
6: ; preds = %3
%7 = tail call i32 @errx(i32 -1, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %3
ret i32 %4
}
int execute_spu_run() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @execute_spu_run() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ CL_StartDemo(int /*<<< orphan*/);
int Cmd_Argc();
int /*<<< orphan*/ Cmd_Argv(int);
int /*<<< orphan*/ Com_Printf(char *);
void CL_PlayDemo_f(void) {
  if (Cmd_Argc() != 2) {
    Com_Printf("demo <demoname>\n");
    return;
  }
  CL_StartDemo(Cmd_Argv(1));
}


x86 assembly (clang, -O0):
<CL_PlayDemo_f>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <Cmd_Argc@plt>
cmp    $0x2,%eax
je     1165 <CL_PlayDemo_f+0x25>
lea    0xea5(%rip),%rdi
call   1050 <Com_Printf@plt>
jmp    1176 <CL_PlayDemo_f+0x36>
mov    $0x1,%edi
call   1060 <Cmd_Argv@plt>
mov    %eax,%edi
call   1040 <CL_StartDemo@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<CL_PlayDemo_f>:
push   %rax
xor    %eax,%eax
call   1030 <Cmd_Argc@plt>
cmp    $0x2,%eax
jne    115f <CL_PlayDemo_f+0x1f>
mov    $0x1,%edi
call   1060 <Cmd_Argv@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <CL_StartDemo@plt>
lea    0xe9a(%rip),%rdi
pop    %rax
jmp    1050 <Com_Printf@plt>

LLVM IR (-O0):
@.str = [17 x i8] c"demo <demoname>\0A\00"
define void @CL_PlayDemo_f() {
%1 = call i32 (...) @Cmd_Argc()
%2 = icmp ne i32 %1, 2
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = call i32 @Com_Printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
br label %8
5: ; preds = %0
%6 = call i32 @Cmd_Argv(i32 1)
%7 = call i32 @CL_StartDemo(i32 %6)
br label %8
8: ; preds = %5, %3
ret void
}

LLVM IR (-O2):
@.str = [17 x i8] c"demo <demoname>\0A\00"
define void @CL_PlayDemo_f() {
%1 = tail call i32 (...) @Cmd_Argc()
%2 = icmp eq i32 %1, 2
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 @Com_Printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
br label %8
5: ; preds = %0
%6 = tail call i32 @Cmd_Argv(i32 1)
%7 = tail call i32 @CL_StartDemo(i32 %6)
br label %8
8: ; preds = %5, %3
ret void
}
void symbol31_randomtag() {}


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

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

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

LLVM IR (-O2):
define void @symbol31_randomtag() {
ret void
}
/* Variables and functions */
size_t CMSG_SPACE(size_t);
size_t us_cmsg_space(size_t s) { return CMSG_SPACE(s); }


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

x86 assembly (clang, -O2):
<us_cmsg_space>:
jmp    1030 <CMSG_SPACE@plt>

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

LLVM IR (-O2):
define i64 @us_cmsg_space(i64 %0) {
%2 = tail call i64 @CMSG_SPACE(i64 %0)
ret i64 %2
}
/* Variables and functions */
void bzero(void *address, int size) {
  int i;
  char *start = (char *)address;
  for (i = 0; i < size; i++)
    *(start + i) = 0;
}


x86 assembly (clang, -O0):
<bzero>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1140 <bzero+0x40>
mov    -0x18(%rbp),%rax
movslq -0x10(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    111a <bzero+0x1a>
pop    %rbp
ret

x86 assembly (clang, -O2):
<bzero>:
test   %esi,%esi
jle    1122 <bzero+0x12>
push   %rax
mov    %esi,%edx
xor    %esi,%esi
call   1030 <memset@plt>
add    $0x8,%rsp
ret

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

LLVM IR (-O2):
define void @bzero(i8* nocapture writeonly %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %2
ret void
}
/* Variables and functions */
int tcpClose(int);
int client_close(int l_fd) {
  int ret;
  if (l_fd < 0) {
    return -1;
  }
  ret = tcpClose(l_fd);
  l_fd = (-1);
  return 0;
}


x86 assembly (clang, -O0):
<client_close>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    1131 <client_close+0x21>
movl   $0xffffffff,-0x4(%rbp)
jmp    114a <client_close+0x3a>
mov    -0x8(%rbp),%edi
call   1030 <tcpClose@plt>
mov    %eax,-0xc(%rbp)
movl   $0xffffffff,-0x8(%rbp)
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<client_close>:
test   %edi,%edi
js     1121 <client_close+0x11>
push   %rax
call   1030 <tcpClose@plt>
xor    %eax,%eax
add    $0x8,%rsp
ret
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
define i32 @client_close(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
%5 = load i32, i32* %3
%6 = icmp slt i32 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 -1, i32* %2
br label %11
8: ; preds = %1
%9 = load i32, i32* %3
%10 = call i32 @tcpClose(i32 %9)
store i32 %10, i32* %4
store i32 -1, i32* %3
store i32 0, i32* %2
br label %11
11: ; preds = %8, %7
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
define i32 @client_close(i32 %0) {
%2 = icmp slt i32 %0, 0
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @tcpClose(i32 %0)
br label %5
5: ; preds = %1, %3
%6 = phi i32 [ 0, %3 ], [ -1, %1 ]
ret i32 %6
}
unsigned char rj_xtime(unsigned char x) {
  return (x & 0x80) ? ((x << 1) ^ 0x1b) : (x << 1);
}


x86 assembly (clang, -O0):
<rj_xtime>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
and    $0x80,%eax
cmp    $0x0,%eax
je     112e <rj_xtime+0x2e>
movzbl -0x1(%rbp),%eax
shl    $0x1,%eax
xor    $0x1b,%eax
mov    %eax,-0x8(%rbp)
jmp    1138 <rj_xtime+0x38>
movzbl -0x1(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rj_xtime>:
lea    (%rdi,%rdi,1),%eax
movzbl %al,%ecx
xor    $0x1b,%al
test   %dil,%dil
movzbl %al,%eax
cmovns %ecx,%eax
ret

LLVM IR (-O0):
define zeroext i8 @rj_xtime(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = and i32 %4, 128
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %12
7: ; preds = %1
%8 = load i8, i8* %2
%9 = zext i8 %8 to i32
%10 = shl i32 %9, 1
%11 = xor i32 %10, 27
br label %16
12: ; preds = %1
%13 = load i8, i8* %2
%14 = zext i8 %13 to i32
%15 = shl i32 %14, 1
br label %16
16: ; preds = %12, %7
%17 = phi i32 [ %11, %7 ], [ %15, %12 ]
%18 = trunc i32 %17 to i8
ret i8 %18
}

LLVM IR (-O2):
define zeroext i8 @rj_xtime(i8 zeroext %0) {
%2 = icmp sgt i8 %0, -1
%3 = shl i8 %0, 1
%4 = xor i8 %3, 27
%5 = select i1 %2, i8 %3, i8 %4
ret i8 %5
}
/* Type definitions */
struct core_counter {
  int dummy;
};
typedef scalar_t__ int64_t;

/* Variables and functions */
scalar_t__ core_counter_get(struct core_counter *, int);
int64_t core_counter_difference(struct core_counter *self, int counter1,
                                int counter2) {
  return core_counter_get(self, counter1) - core_counter_get(self, counter2);
}


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

x86 assembly (clang, -O2):
<core_counter_difference>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%r14d
mov    %rdi,%rbx
call   1030 <core_counter_get@plt>
mov    %rax,%rbp
mov    %rbx,%rdi
mov    %r14d,%esi
call   1030 <core_counter_get@plt>
sub    %rax,%rbp
mov    %rbp,%rax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
%struct.core_counter = type { i32 }
define i64 @core_counter_difference(%struct.core_counter* %0, i32 %1, i32 %2) {
%4 = alloca %struct.core_counter*
%5 = alloca i32
%6 = alloca i32
store %struct.core_counter* %0, %struct.core_counter** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load %struct.core_counter*, %struct.core_counter** %4
%8 = load i32, i32* %5
%9 = call i64 @core_counter_get(%struct.core_counter* %7, i32 %8)
%10 = load %struct.core_counter*, %struct.core_counter** %4
%11 = load i32, i32* %6
%12 = call i64 @core_counter_get(%struct.core_counter* %10, i32 %11)
%13 = sub nsw i64 %9, %12
ret i64 %13
}

LLVM IR (-O2):
%struct.core_counter = type { i32 }
define i64 @core_counter_difference(%struct.core_counter* %0, i32 %1, i32 %2) {
%4 = tail call i64 @core_counter_get(%struct.core_counter* %0, i32 %1)
%5 = tail call i64 @core_counter_get(%struct.core_counter* %0, i32 %2)
%6 = sub nsw i64 %4, %5
ret i64 %6
}
char *K256Cpy(char *dst, const char *Key) {
  int c0;
  c0 = 1;
  while (c0) {
    *dst = *Key;
    if (*dst & 0x80) {
      c0++;
    } else {
      c0--;
    }
    dst++;
    Key++;
  }
  return dst;
}


x86 assembly (clang, -O0):
<K256Cpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x1,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
je     1172 <K256Cpy+0x72>
mov    -0x10(%rbp),%rax
mov    (%rax),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
and    $0x80,%eax
cmp    $0x0,%eax
je     114c <K256Cpy+0x4c>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1155 <K256Cpy+0x55>
mov    -0x14(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1113 <K256Cpy+0x13>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<K256Cpy>:
mov    %rdi,%rax
mov    $0x1,%ecx
nopl   0x0(%rax,%rax,1)
movzbl (%rsi),%edx
mov    %dl,(%rax)
shr    $0x7,%dl
movzbl %dl,%edx
lea    (%rcx,%rdx,2),%ecx
add    $0x1,%rax
add    $0x1,%rsi
add    $0xffffffff,%ecx
jne    1110 <K256Cpy+0x10>
ret

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

LLVM IR (-O2):
define i8* @K256Cpy(i8* writeonly %0, i8* nocapture %1) {
br label %3
3: ; preds = %2, %3
%4 = phi i32 [ 1, %2 ], [ %10, %3 ]
%5 = phi i8* [ %1, %2 ], [ %12, %3 ]
%6 = phi i8* [ %0, %2 ], [ %11, %3 ]
%7 = load i8, i8* %5
store i8 %7, i8* %6
%8 = icmp sgt i8 %7, -1
%9 = select i1 %8, i32 -1, i32 1
%10 = add nsw i32 %9, %4
%11 = getelementptr inbounds i8, i8* %6, i64 1
%12 = getelementptr inbounds i8, i8* %5, i64 1
%13 = icmp eq i32 %10, 0
br i1 %13, label %14, label %3
14: ; preds = %3
ret i8* %11
}
/* Variables and functions */
int pattern_match_length(char const *, int /*<<< orphan*/, char const *,
                         int /*<<< orphan*/, int);
int /*<<< orphan*/ strlen(char const *);
int pattern_match(const char *string, const char *pattern, int nocase) {
  return pattern_match_length(string, strlen(string), pattern, strlen(pattern),
                              nocase);
}


x86 assembly (clang, -O0):
<pattern_match>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x24(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x30(%rbp),%rdi
mov    -0x24(%rbp),%esi
mov    -0x20(%rbp),%rdx
mov    %eax,%ecx
mov    -0x14(%rbp),%r8d
call   1040 <pattern_match_length@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pattern_match>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %edx,%r14d
mov    %rsi,%rbx
mov    %rdi,%rbp
call   1030 <strlen@plt>
mov    %eax,%r15d
mov    %rbx,%rdi
call   1030 <strlen@plt>
mov    %rbp,%rdi
mov    %r15d,%esi
mov    %rbx,%rdx
mov    %eax,%ecx
mov    %r14d,%r8d
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <pattern_match_length@plt>

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

LLVM IR (-O2):
define i32 @pattern_match(i8* %0, i8* %1, i32 %2) {
%4 = tail call i32 @strlen(i8* %0)
%5 = tail call i32 @strlen(i8* %1)
%6 = tail call i32 @pattern_match_length(i8* %0, i32 %4, i8* %1, i32 %5, i32 %2)
ret i32 %6
}
/* Variables and functions */
char *zhome();
char *homepath() {
  int x;
  extern char hompthbuf[];
  extern char *myhome;
  char *h;
  h = myhome ? myhome : zhome();
  hompthbuf[0] = '\0';
  return (h);
}


x86 assembly (clang, -O0):
<homepath>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    0x2eb9(%rip),%rax
cmpq   $0x0,(%rax)
je     113c <homepath+0x2c>
mov    0x2ea8(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
jmp    1147 <homepath+0x37>
mov    $0x0,%al
call   1030 <zhome@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    0x2e92(%rip),%rax
movb   $0x0,(%rax)
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<homepath>:
push   %rax
mov    0x2ec0(%rip),%rax
mov    (%rax),%rax
test   %rax,%rax
jne    1127 <homepath+0x17>
xor    %eax,%eax
call   1030 <zhome@plt>
mov    0x2eba(%rip),%rcx
movb   $0x0,(%rcx)
pop    %rcx
ret

LLVM IR (-O0):
@myhome = external global i8*
@hompthbuf = external global [0 x i8]
define i8* @homepath() {
%1 = alloca i32
%2 = alloca i8*
%3 = load i8*, i8** @myhome
%4 = icmp ne i8* %3, null
br i1 %4, label %5, label %7
5: ; preds = %0
%6 = load i8*, i8** @myhome
br label %9
7: ; preds = %0
%8 = call i8* (...) @zhome()
br label %9
9: ; preds = %7, %5
%10 = phi i8* [ %6, %5 ], [ %8, %7 ]
store i8* %10, i8** %2
store i8 0, i8* getelementptr inbounds ([0 x i8], [0 x i8]* @hompthbuf, i64 0, i64 0)
%11 = load i8*, i8** %2
ret i8* %11
}

LLVM IR (-O2):
@myhome = external global i8*
@hompthbuf = external global [0 x i8]
define i8* @homepath() {
%1 = load i8*, i8** @myhome
%2 = icmp eq i8* %1, null
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i8* (...) @zhome()
br label %5
5: ; preds = %0, %3
%6 = phi i8* [ %4, %3 ], [ %1, %0 ]
store i8 0, i8* getelementptr inbounds ([0 x i8], [0 x i8]* @hompthbuf, i64 0, i64 0)
ret i8* %6
}
int fix_mul(int a, int b) {
  long long temp = (long long)a * (long long)b >> 12;
  return (int)((temp >> 1) + (temp & 1));
}


x86 assembly (clang, -O0):
<fix_mul>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movslq -0x4(%rbp),%rax
movslq -0x8(%rbp),%rcx
imul   %rcx,%rax
sar    $0xc,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
sar    $0x1,%rax
mov    -0x10(%rbp),%rcx
and    $0x1,%rcx
add    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fix_mul>:
movslq %edi,%rax
movslq %esi,%rcx
imul   %rax,%rcx
mov    %rcx,%rax
shr    $0xd,%rax
shr    $0xc,%ecx
and    $0x1,%ecx
add    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @fix_mul(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i64
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = sext i32 %6 to i64
%8 = load i32, i32* %4
%9 = sext i32 %8 to i64
%10 = mul nsw i64 %7, %9
%11 = ashr i64 %10, 12
store i64 %11, i64* %5
%12 = load i64, i64* %5
%13 = ashr i64 %12, 1
%14 = load i64, i64* %5
%15 = and i64 %14, 1
%16 = add nsw i64 %13, %15
%17 = trunc i64 %16 to i32
ret i32 %17
}

LLVM IR (-O2):
define i32 @fix_mul(i32 %0, i32 %1) {
%3 = sext i32 %0 to i64
%4 = sext i32 %1 to i64
%5 = mul nsw i64 %4, %3
%6 = lshr i64 %5, 12
%7 = lshr i64 %5, 13
%8 = and i64 %6, 1
%9 = add nuw nsw i64 %8, %7
%10 = trunc i64 %9 to i32
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ html_table_heading(char *, char *, char *);
void html_table_output_table_heading2(char *title, char *sub_title,
                                      char *sub_sub_title) {
  html_table_heading(title, sub_title, sub_sub_title);
}


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

x86 assembly (clang, -O2):
<html_table_output_table_heading2>:
jmp    1030 <html_table_heading@plt>

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

LLVM IR (-O2):
define void @html_table_output_table_heading2(i8* %0, i8* %1, i8* %2) {
%4 = tail call i32 @html_table_heading(i8* %0, i8* %1, i8* %2)
ret void
}
int create_wall() {}


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

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

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

LLVM IR (-O2):
define i32 @create_wall() {
ret i32 undef
}
/* Variables and functions */
int openSwbPortDiv(char *, int /*<<< orphan*/);
int openSwbPort(char *port) {
  int fd;
  fd = openSwbPortDiv(port, 0);
  return fd;
}


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

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

LLVM IR (-O0):
define i32 @openSwbPort(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @openSwbPortDiv(i8* %4, i32 0)
store i32 %5, i32* %3
%6 = load i32, i32* %3
ret i32 %6
}

LLVM IR (-O2):
define i32 @openSwbPort(i8* %0) {
%2 = tail call i32 @openSwbPortDiv(i8* %0, i32 0)
ret i32 %2
}