xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ console_tx_string(char const *);
void print_warn(const char *str) { console_tx_string(str); }


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

x86 assembly (clang, -O2):
<print_warn>:
jmp    1030 <console_tx_string@plt>

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

LLVM IR (-O2):
define void @print_warn(i8* %0) {
%2 = tail call i32 @console_tx_string(i8* %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ va_list;

/* Variables and functions */
int /*<<< orphan*/ __vsyslog(int, char const *, int /*<<< orphan*/);
void __vsyslog_chk(int priority, int flag, const char *message, va_list ap) {
  __vsyslog(priority, message, ap);
}


x86 assembly (clang, -O0):
<__vsyslog_chk>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <__vsyslog@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__vsyslog_chk>:
mov    %rdx,%rsi
mov    %ecx,%edx
jmp    1030 <__vsyslog@plt>

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

LLVM IR (-O2):
define void @__vsyslog_chk(i32 %0, i32 %1, i8* %2, i32 %3) {
%5 = tail call i32 @__vsyslog(i32 %0, i8* %2, i32 %3)
ret void
}
/* Type definitions */
struct oipf_list_head {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ __oipf_list_splice(struct oipf_list_head *,
                                      struct oipf_list_head *);
int /*<<< orphan*/ oipf_list_empty(struct oipf_list_head *);
void oipf_list_splice(struct oipf_list_head *list,
                      struct oipf_list_head *head) {
  if (!oipf_list_empty(list))
    __oipf_list_splice(list, head);
}


x86 assembly (clang, -O0):
<oipf_list_splice>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <oipf_list_empty@plt>
cmp    $0x0,%eax
jne    114f <oipf_list_splice+0x2f>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <__oipf_list_splice@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<oipf_list_splice>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <oipf_list_empty@plt>
test   %eax,%eax
je     113b <oipf_list_splice+0x1b>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret
mov    %rbx,%rdi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <__oipf_list_splice@plt>

LLVM IR (-O0):
%struct.oipf_list_head = type { i32 }
define void @oipf_list_splice(%struct.oipf_list_head* %0, %struct.oipf_list_head* %1) {
%3 = alloca %struct.oipf_list_head*
%4 = alloca %struct.oipf_list_head*
store %struct.oipf_list_head* %0, %struct.oipf_list_head** %3
store %struct.oipf_list_head* %1, %struct.oipf_list_head** %4
%5 = load %struct.oipf_list_head*, %struct.oipf_list_head** %3
%6 = call i32 @oipf_list_empty(%struct.oipf_list_head* %5)
%7 = icmp ne i32 %6, 0
br i1 %7, label %12, label %8
8: ; preds = %2
%9 = load %struct.oipf_list_head*, %struct.oipf_list_head** %3
%10 = load %struct.oipf_list_head*, %struct.oipf_list_head** %4
%11 = call i32 @__oipf_list_splice(%struct.oipf_list_head* %9, %struct.oipf_list_head* %10)
br label %12
12: ; preds = %8, %2
ret void
}

LLVM IR (-O2):
%struct.oipf_list_head = type { i32 }
define void @oipf_list_splice(%struct.oipf_list_head* %0, %struct.oipf_list_head* %1) {
%3 = tail call i32 @oipf_list_empty(%struct.oipf_list_head* %0)
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @__oipf_list_splice(%struct.oipf_list_head* %0, %struct.oipf_list_head* %1)
br label %7
7: ; preds = %5, %2
ret void
}
/* Variables and functions */
int getpid();
int /*<<< orphan*/ printf(char *, int);
void atexit_child2(void) { printf("child2: %d: finished\n", getpid()); }


x86 assembly (clang, -O0):
<atexit_child2>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <getpid@plt>
mov    %eax,%esi
lea    0xecc(%rip),%rdi
call   1040 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<atexit_child2>:
push   %rax
xor    %eax,%eax
call   1030 <getpid@plt>
lea    0xed1(%rip),%rdi
mov    %eax,%esi
pop    %rax
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [22 x i8] c"child2: %d: finished\0A\00"
define void @atexit_child2() {
%1 = call i32 (...) @getpid()
%2 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 %1)
ret void
}

LLVM IR (-O2):
@.str = [22 x i8] c"child2: %d: finished\0A\00"
define void @atexit_child2() {
%1 = tail call i32 (...) @getpid()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 %1)
ret void
}
/* Type definitions */
struct jdksavdecc_printer {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ jdksavdecc_printer_printc(struct jdksavdecc_printer *, char);
void jdksavdecc_printer_print_eol(struct jdksavdecc_printer *self) {
  jdksavdecc_printer_printc(self, '\n');
}


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

x86 assembly (clang, -O2):
<jdksavdecc_printer_print_eol>:
mov    $0xa,%esi
jmp    1030 <jdksavdecc_printer_printc@plt>

LLVM IR (-O0):
%struct.jdksavdecc_printer = type { i32 }
define void @jdksavdecc_printer_print_eol(%struct.jdksavdecc_printer* %0) {
%2 = alloca %struct.jdksavdecc_printer*
store %struct.jdksavdecc_printer* %0, %struct.jdksavdecc_printer** %2
%3 = load %struct.jdksavdecc_printer*, %struct.jdksavdecc_printer** %2
%4 = call i32 @jdksavdecc_printer_printc(%struct.jdksavdecc_printer* %3, i8 signext 10)
ret void
}

LLVM IR (-O2):
%struct.jdksavdecc_printer = type { i32 }
define void @jdksavdecc_printer_print_eol(%struct.jdksavdecc_printer* %0) {
%2 = tail call i32 @jdksavdecc_printer_printc(%struct.jdksavdecc_printer* %0, i8 signext 10)
ret void
}
double fnAreaTrapezoid(double dHeight1, double dHeight2, double dBase) {
  double dArea;
  dArea = dBase * ((dHeight1 + dHeight2) / 2);
  return dArea;
}


x86 assembly (clang, -O0):
<fnAreaTrapezoid>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm1
addsd  -0x10(%rbp),%xmm1
movsd  0xed6(%rip),%xmm2
divsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<fnAreaTrapezoid>:
addsd  %xmm1,%xmm0
mulsd  0xef4(%rip),%xmm0
mulsd  %xmm2,%xmm0
ret

LLVM IR (-O0):
define double @fnAreaTrapezoid(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%8 = load double, double* %6
%9 = load double, double* %4
%10 = load double, double* %5
%11 = fadd double %9, %10
%12 = fdiv double %11, 2.000000e+00
%13 = fmul double %8, %12
store double %13, double* %7
%14 = load double, double* %7
ret double %14
}

LLVM IR (-O2):
define double @fnAreaTrapezoid(double %0, double %1, double %2) {
%4 = fadd double %0, %1
%5 = fmul double %4, 5.000000e-01
%6 = fmul double %5, %2
ret double %6
}
int test_imm_95int8_reg(signed char val) {
  return ((val) & (0x95 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_95int8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edx
and    $0x95,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_95int8_reg>:
test   $0x95,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_95int8_reg(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = and i32 %4, 149
%6 = icmp ne i32 %5, 0
%7 = zext i1 %6 to i64
%8 = select i1 %6, i32 -20, i32 -40
ret i32 %8
}

LLVM IR (-O2):
define i32 @test_imm_95int8_reg(i8 signext %0) {
%2 = and i8 %0, -107
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int powerOf2(int);
int logOf2(int a) {
  int foo = 0;
  while ((powerOf2(foo)) != a)
    foo++;
  return foo;
}


x86 assembly (clang, -O0):
<logOf2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <powerOf2@plt>
cmp    -0x4(%rbp),%eax
je     1141 <logOf2+0x31>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1122 <logOf2+0x12>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<logOf2>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebp
mov    $0xffffffff,%ebx
nopw   0x0(%rax,%rax,1)
add    $0x1,%ebx
mov    %ebx,%edi
call   1030 <powerOf2@plt>
cmp    %ebp,%eax
jne    1120 <logOf2+0x10>
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @logOf2(i32 %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i32 [ 0, %1 ], [ %6, %2 ]
%4 = tail call i32 @powerOf2(i32 %3)
%5 = icmp eq i32 %4, %0
%6 = add nuw nsw i32 %3, 1
br i1 %5, label %7, label %2
7: ; preds = %2
ret i32 %3
}
long (*func(var))[42] int var;
{ return 0; }


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

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

LLVM IR (-O0):
define [42 x i64]* @func(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
ret [42 x i64]* null
}

LLVM IR (-O2):
define noalias [42 x i64]* @func(i32 %0) {
ret [42 x i64]* null
}
/* Variables and functions */
int /*<<< orphan*/ cctools_debug(long long, char *);
int uptime_get() {
  int uptime;
  static int did_warning = 0;
  if (!did_warning) {
    cctools_debug((1LL << 2),
                  "uptime not implemented (yet) on this operating system");
    did_warning = 1;
  }
  uptime = 0;
  return uptime;
}


x86 assembly (clang, -O0):
<uptime_get>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
cmpl   $0x0,0x2f0d(%rip)
jne    1140 <uptime_get+0x30>
mov    $0x4,%edi
lea    0xecf(%rip),%rsi
call   1030 <cctools_debug@plt>
movl   $0x1,0x2eec(%rip)
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uptime_get>:
push   %rax
cmpb   $0x0,0x2f14(%rip)
jne    1132 <uptime_get+0x22>
lea    0xedf(%rip),%rsi
mov    $0x4,%edi
call   1030 <cctools_debug@plt>
movb   $0x1,0x2efa(%rip)
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@uptime_get.did_warning = internal global i32 0
@.str = [54 x i8] c"uptime not implemented (yet) on this operating system\00"
define i32 @uptime_get() {
%1 = alloca i32
%2 = load i32, i32* @uptime_get.did_warning
%3 = icmp ne i32 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %0
%5 = call i32 @cctools_debug(i64 4, i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str, i64 0, i64 0))
store i32 1, i32* @uptime_get.did_warning
br label %6
6: ; preds = %4, %0
store i32 0, i32* %1
%7 = load i32, i32* %1
ret i32 %7
}

LLVM IR (-O2):
@uptime_get.did_warning = internal unnamed_addr global i1 false
@.str = [54 x i8] c"uptime not implemented (yet) on this operating system\00"
define i32 @uptime_get() {
%1 = load i1, i1* @uptime_get.did_warning
br i1 %1, label %4, label %2
2: ; preds = %0
%3 = tail call i32 @cctools_debug(i64 4, i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str, i64 0, i64 0))
store i1 true, i1* @uptime_get.did_warning
br label %4
4: ; preds = %2, %0
ret i32 0
}
/* Type definitions */
struct wordrec {
  int dummy;
};

/* Variables and functions */
void cleartable() {
  struct wordrec *wp = NULL, *p = NULL;
  int i = 0;
}


x86 assembly (clang, -O0):
<cleartable>:
push   %rbp
mov    %rsp,%rbp
movq   $0x0,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.wordrec = type { i32 }
define void @cleartable() {
%1 = alloca %struct.wordrec*
%2 = alloca %struct.wordrec*
%3 = alloca i32
store %struct.wordrec* null, %struct.wordrec** %1
store %struct.wordrec* null, %struct.wordrec** %2
store i32 0, i32* %3
ret void
}

LLVM IR (-O2):
%struct.wordrec = type { i32 }
define void @cleartable() {
ret void
}
int checkbyte(unsigned char index, int *array) { return array[index]; }


x86 assembly (clang, -O0):
<checkbyte>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movzbl -0x1(%rbp),%ecx
mov    (%rax,%rcx,4),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<checkbyte>:
mov    %edi,%eax
mov    (%rsi,%rax,4),%eax
ret

LLVM IR (-O0):
define i32 @checkbyte(i8 zeroext %0, i32* %1) {
%3 = alloca i8
%4 = alloca i32*
store i8 %0, i8* %3
store i32* %1, i32** %4
%5 = load i32*, i32** %4
%6 = load i8, i8* %3
%7 = zext i8 %6 to i64
%8 = getelementptr inbounds i32, i32* %5, i64 %7
%9 = load i32, i32* %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @checkbyte(i8 zeroext %0, i32* nocapture %1) {
%3 = zext i8 %0 to i64
%4 = getelementptr inbounds i32, i32* %1, i64 %3
%5 = load i32, i32* %4
ret i32 %5
}
char *XGetDefault() {}


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

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

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

LLVM IR (-O2):
define noalias i8* @XGetDefault() {
ret i8* undef
}
/* Type definitions */
struct bitstream_elmt_t {
  int dummy;
};

/* Variables and functions */
unsigned int _read_bits(struct bitstream_elmt_t *, int, int);
unsigned int bitstream_u(struct bitstream_elmt_t *bs, int bits) {
  unsigned int value;
  value = _read_bits(bs, bits, 1);
  return value;
}


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

x86 assembly (clang, -O2):
<bitstream_u>:
mov    $0x1,%edx
jmp    1030 <_read_bits@plt>

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

LLVM IR (-O2):
%struct.bitstream_elmt_t = type { i32 }
define i32 @bitstream_u(%struct.bitstream_elmt_t* %0, i32 %1) {
%3 = tail call i32 @_read_bits(%struct.bitstream_elmt_t* %0, i32 %1, i32 1)
ret i32 %3
}
int lettura_matrice_doppia(int **matrice, unsigned int numero_riga,
                           unsigned int numero_colonna) {
  return (matrice[numero_riga][numero_colonna]);
}


x86 assembly (clang, -O0):
<lettura_matrice_doppia>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
mov    (%rax,%rcx,8),%rax
mov    -0x10(%rbp),%ecx
mov    (%rax,%rcx,4),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<lettura_matrice_doppia>:
mov    %esi,%eax
mov    (%rdi,%rax,8),%rax
mov    %edx,%ecx
mov    (%rax,%rcx,4),%eax
ret

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

LLVM IR (-O2):
define i32 @lettura_matrice_doppia(i32** nocapture %0, i32 %1, i32 %2) {
%4 = zext i32 %1 to i64
%5 = getelementptr inbounds i32*, i32** %0, i64 %4
%6 = load i32*, i32** %5
%7 = zext i32 %2 to i64
%8 = getelementptr inbounds i32, i32* %6, i64 %7
%9 = load i32, i32* %8
ret i32 %9
}
/* Variables and functions */
scalar_t__ send_command_to_variable_server(int, char *);
int run(int socket) {
  if (send_command_to_variable_server(socket, "trick.exec_run()") < 0) {
    return -1;
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<run>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
lea    0xedb(%rip),%rsi
call   1030 <send_command_to_variable_server@plt>
cmp    $0x0,%rax
jge    1140 <run+0x30>
movl   $0xffffffff,-0x4(%rbp)
jmp    1147 <run+0x37>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<run>:
push   %rax
lea    0xee8(%rip),%rsi
call   1030 <send_command_to_variable_server@plt>
sar    $0x3f,%rax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [17 x i8] c"trick.exec_run()\00"
define i32 @run(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = call i64 @send_command_to_variable_server(i32 %4, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%6 = icmp slt i64 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 -1, i32* %2
br label %9
8: ; preds = %1
store i32 0, i32* %2
br label %9
9: ; preds = %8, %7
%10 = load i32, i32* %2
ret i32 %10
}

LLVM IR (-O2):
@.str = [17 x i8] c"trick.exec_run()\00"
define i32 @run(i32 %0) {
%2 = tail call i64 @send_command_to_variable_server(i32 %0, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%3 = ashr i64 %2, 63
%4 = trunc i64 %3 to i32
ret i32 %4
}
/* Type definitions */
typedef scalar_t__ wint_t;

/* Variables and functions */
int ispunct(scalar_t__);
int iswpunct(wint_t wc) { return ((wc < (wint_t)0x100 ? ispunct(wc) : 0)); }


x86 assembly (clang, -O0):
<iswpunct>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x100,-0x8(%rbp)
jge    113b <iswpunct+0x2b>
mov    -0x8(%rbp),%rdi
call   1030 <ispunct@plt>
mov    %eax,-0xc(%rbp)
jmp    1145 <iswpunct+0x35>
xor    %eax,%eax
mov    %eax,-0xc(%rbp)
jmp    1145 <iswpunct+0x35>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<iswpunct>:
cmp    $0xff,%rdi
jg     111e <iswpunct+0xe>
jmp    1030 <ispunct@plt>
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @iswpunct(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = icmp slt i64 %3, 256
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i64, i64* %2
%7 = call i32 @ispunct(i64 %6)
br label %9
8: ; preds = %1
br label %9
9: ; preds = %8, %5
%10 = phi i32 [ %7, %5 ], [ 0, %8 ]
ret i32 %10
}

LLVM IR (-O2):
define i32 @iswpunct(i64 %0) {
%2 = icmp slt i64 %0, 256
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 @ispunct(i64 %0)
br label %5
5: ; preds = %1, %3
%6 = phi i32 [ %4, %3 ], [ 0, %1 ]
ret i32 %6
}
quad_subdivision() {}


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

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

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

LLVM IR (-O2):
define i32 @quad_subdivision() {
ret i32 undef
}
int add_uevent_var(struct kobj_uevent_env *env, const char *fmt, ...) {
  return 0;
}


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

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

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

LLVM IR (-O2):
%struct.kobj_uevent_env = type opaque
define i32 @add_uevent_var(%struct.kobj_uevent_env* nocapture readnone %0, i8* nocapture readnone %1, ...) {
ret i32 0
}
void foo5f() {}


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

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

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

LLVM IR (-O2):
define void @foo5f() {
ret void
}
/* Type definitions */
struct cxl_afu_h {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ _cxl_afu_free(struct cxl_afu_h *, int);
void cxl_afu_free(struct cxl_afu_h *afu) { _cxl_afu_free(afu, 1); }


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

x86 assembly (clang, -O2):
<cxl_afu_free>:
mov    $0x1,%esi
jmp    1030 <_cxl_afu_free@plt>

LLVM IR (-O0):
%struct.cxl_afu_h = type { i32 }
define void @cxl_afu_free(%struct.cxl_afu_h* %0) {
%2 = alloca %struct.cxl_afu_h*
store %struct.cxl_afu_h* %0, %struct.cxl_afu_h** %2
%3 = load %struct.cxl_afu_h*, %struct.cxl_afu_h** %2
%4 = call i32 @_cxl_afu_free(%struct.cxl_afu_h* %3, i32 1)
ret void
}

LLVM IR (-O2):
%struct.cxl_afu_h = type { i32 }
define void @cxl_afu_free(%struct.cxl_afu_h* %0) {
%2 = tail call i32 @_cxl_afu_free(%struct.cxl_afu_h* %0, i32 1)
ret void
}
int NumSpace(in)
char in[];
{
  int i;
  int re = 0;
  for (i = 0; in[i] != '\0' && in[i] != '\n'; ++i)
    if (in[i] == ' ')
      ++re;
  return re;
}


x86 assembly (clang, -O0):
<NumSpace>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x11(%rbp)
je     1145 <NumSpace+0x45>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0xa,%eax
setne  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    1155 <NumSpace+0x55>
jmp    1186 <NumSpace+0x86>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x20,%eax
jne    1173 <NumSpace+0x73>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1178 <NumSpace+0x78>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1116 <NumSpace+0x16>
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<NumSpace>:
xor    %eax,%eax
jmp    1117 <NumSpace+0x17>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
add    $0x1,%eax
add    $0x1,%rdi
movzbl (%rdi),%ecx
cmp    $0x20,%cl
je     1110 <NumSpace+0x10>
test   %cl,%cl
je     1128 <NumSpace+0x28>
cmp    $0xa,%cl
jne    1113 <NumSpace+0x13>
ret

LLVM IR (-O0):
define i32 @NumSpace(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %4
store i32 0, i32* %3
br label %5
5: ; preds = %35, %1
%6 = load i8*, i8** %2
%7 = load i32, i32* %3
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i8, i8* %6, i64 %8
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
%12 = icmp ne i32 %11, 0
br i1 %12, label %13, label %21
13: ; preds = %5
%14 = load i8*, i8** %2
%15 = load i32, i32* %3
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds i8, i8* %14, i64 %16
%18 = load i8, i8* %17
%19 = sext i8 %18 to i32
%20 = icmp ne i32 %19, 10
br label %21
21: ; preds = %13, %5
%22 = phi i1 [ false, %5 ], [ %20, %13 ]
br i1 %22, label %23, label %38
23: ; preds = %21
%24 = load i8*, i8** %2
%25 = load i32, i32* %3
%26 = sext i32 %25 to i64
%27 = getelementptr inbounds i8, i8* %24, i64 %26
%28 = load i8, i8* %27
%29 = sext i8 %28 to i32
%30 = icmp eq i32 %29, 32
br i1 %30, label %31, label %34
31: ; preds = %23
%32 = load i32, i32* %4
%33 = add nsw i32 %32, 1
store i32 %33, i32* %4
br label %34
34: ; preds = %31, %23
br label %35
35: ; preds = %34
%36 = load i32, i32* %3
%37 = add nsw i32 %36, 1
store i32 %37, i32* %3
br label %5
38: ; preds = %21
%39 = load i32, i32* %4
ret i32 %39
}

LLVM IR (-O2):
define i32 @NumSpace(i8* nocapture %0) {
br label %2
2: ; preds = %9, %1
%3 = phi i64 [ %11, %9 ], [ 0, %1 ]
%4 = phi i32 [ %10, %9 ], [ 0, %1 ]
%5 = getelementptr inbounds i8, i8* %0, i64 %3
%6 = load i8, i8* %5
switch i8 %6, label %9 [
i8 0, label %12
i8 10, label %12
i8 32, label %7
]
7: ; preds = %2
%8 = add nsw i32 %4, 1
br label %9
9: ; preds = %2, %7
%10 = phi i32 [ %8, %7 ], [ %4, %2 ]
%11 = add nuw i64 %3, 1
br label %2
12: ; preds = %2, %2
ret i32 %4
}
void e64toasc(x, string, ndigs) unsigned short x[];
char *string;
int ndigs;
{
  unsigned short w[(6 + 3)];
  e64toe(x, w);
  etoasc(w, string, ndigs);
}


x86 assembly (clang, -O0):
<e64toasc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x30(%rbp),%rsi
mov    $0x0,%al
call   1040 <e64toe@plt>
lea    -0x30(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    $0x0,%al
call   1030 <etoasc@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<e64toasc>:
push   %rbp
push   %r14
push   %rbx
sub    $0x20,%rsp
mov    %edx,%ebp
mov    %rsi,%rbx
mov    %rsp,%r14
mov    %r14,%rsi
xor    %eax,%eax
call   1040 <e64toe@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %ebp,%edx
xor    %eax,%eax
call   1030 <etoasc@plt>
add    $0x20,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define void @e64toasc(i16* %0, i8* %1, i32 %2) {
%4 = alloca i16*
%5 = alloca i8*
%6 = alloca i32
%7 = alloca [9 x i16]
store i16* %0, i16** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%8 = load i16*, i16** %4
%9 = getelementptr inbounds [9 x i16], [9 x i16]* %7, i64 0, i64 0
%10 = call i32 (i16*, i16*, ...) bitcast (i32 (...)* @e64toe to i32 (i16*, i16*, ...)*)(i16* %8, i16* %9)
%11 = getelementptr inbounds [9 x i16], [9 x i16]* %7, i64 0, i64 0
%12 = load i8*, i8** %5
%13 = load i32, i32* %6
%14 = call i32 (i16*, i8*, i32, ...) bitcast (i32 (...)* @etoasc to i32 (i16*, i8*, i32, ...)*)(i16* %11, i8* %12, i32 %13)
ret void
}

LLVM IR (-O2):
define void @e64toasc(i16* %0, i8* %1, i32 %2) {
%4 = alloca [9 x i16]
%5 = bitcast [9 x i16]* %4 to i8*
%6 = getelementptr inbounds [9 x i16], [9 x i16]* %4, i64 0, i64 0
%7 = call i32 (i16*, i16*, ...) bitcast (i32 (...)* @e64toe to i32 (i16*, i16*, ...)*)(i16* %0, i16* %6)
%8 = call i32 (i16*, i8*, i32, ...) bitcast (i32 (...)* @etoasc to i32 (i16*, i8*, i32, ...)*)(i16* %6, i8* %1, i32 %2)
ret void
}
/* Variables and functions */
scalar_t__ phys_to_virt(int);
int /*<<< orphan*/ printk(char *);
void restore_NMI_vector(unsigned short *high, unsigned short *low) {
  printk("Restoring NMI vector\n");
  *((volatile unsigned short *)phys_to_virt(0xa)) = *high;
  *((volatile unsigned short *)phys_to_virt(0x8)) = *low;
}


x86 assembly (clang, -O0):
<restore_NMI_vector>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xec9(%rip),%rdi
call   1030 <printk@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%ax
mov    %ax,-0x14(%rbp)
mov    $0xa,%edi
call   1040 <phys_to_virt@plt>
mov    -0x14(%rbp),%cx
mov    %cx,(%rax)
mov    -0x10(%rbp),%rax
mov    (%rax),%ax
mov    %ax,-0x12(%rbp)
mov    $0x8,%edi
call   1040 <phys_to_virt@plt>
mov    -0x12(%rbp),%cx
mov    %cx,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<restore_NMI_vector>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
lea    0xecf(%rip),%rdi
call   1030 <printk@plt>
movzwl (%rbx),%ebx
mov    $0xa,%edi
call   1040 <phys_to_virt@plt>
mov    %bx,(%rax)
movzwl (%r14),%ebx
mov    $0x8,%edi
call   1040 <phys_to_virt@plt>
mov    %bx,(%rax)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [22 x i8] c"Restoring NMI vector\0A\00"
define void @restore_NMI_vector(i16* %0, i16* %1) {
%3 = alloca i16*
%4 = alloca i16*
store i16* %0, i16** %3
store i16* %1, i16** %4
%5 = call i32 @printk(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%6 = load i16*, i16** %3
%7 = load i16, i16* %6
%8 = call i64 @phys_to_virt(i32 10)
%9 = inttoptr i64 %8 to i16*
store volatile i16 %7, i16* %9
%10 = load i16*, i16** %4
%11 = load i16, i16* %10
%12 = call i64 @phys_to_virt(i32 8)
%13 = inttoptr i64 %12 to i16*
store volatile i16 %11, i16* %13
ret void
}

LLVM IR (-O2):
@.str = [22 x i8] c"Restoring NMI vector\0A\00"
define void @restore_NMI_vector(i16* nocapture %0, i16* nocapture %1) {
%3 = tail call i32 @printk(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%4 = load i16, i16* %0
%5 = tail call i64 @phys_to_virt(i32 10)
%6 = inttoptr i64 %5 to i16*
store volatile i16 %4, i16* %6
%7 = load i16, i16* %1
%8 = tail call i64 @phys_to_virt(i32 8)
%9 = inttoptr i64 %8 to i16*
store volatile i16 %7, i16* %9
ret void
}
void _infix_operator_div_double_double(double lhs, double rhs,
                                       double *__rval_1) {
  *__rval_1 = lhs / rhs;
}


x86 assembly (clang, -O0):
<_infix_operator_div_double_double>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
mov    %rdi,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
divsd  -0x10(%rbp),%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<_infix_operator_div_double_double>:
divsd  %xmm1,%xmm0
movsd  %xmm0,(%rdi)
ret

LLVM IR (-O0):
define void @_infix_operator_div_double_double(double %0, double %1, double* %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double*
store double %0, double* %4
store double %1, double* %5
store double* %2, double** %6
%7 = load double, double* %4
%8 = load double, double* %5
%9 = fdiv double %7, %8
%10 = load double*, double** %6
store double %9, double* %10
ret void
}

LLVM IR (-O2):
define void @_infix_operator_div_double_double(double %0, double %1, double* nocapture writeonly %2) {
%4 = fdiv double %0, %1
store double %4, double* %2
ret void
}
/* Variables and functions */
int global_fd_log();
int write(int, char *, int);
int print_red(int fd_out, char *str, unsigned long size) {
  write(fd_out, "\033[31m", 5);
  write(fd_out, str, size);
  write(global_fd_log(), str, size);
  return (write(fd_out, "\033[0m", 5));
}


x86 assembly (clang, -O0):
<print_red>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
lea    0xec3(%rip),%rsi
mov    $0x5,%edx
call   1030 <write@plt>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rax
mov    %eax,%edx
call   1030 <write@plt>
mov    $0x0,%al
call   1040 <global_fd_log@plt>
mov    %eax,%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rax
mov    %eax,%edx
call   1030 <write@plt>
mov    -0x4(%rbp),%edi
lea    0xe8b(%rip),%rsi
mov    $0x5,%edx
call   1030 <write@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_red>:
push   %rbp
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %rsi,%rbx
mov    %edi,%ebp
lea    0xecd(%rip),%rsi
mov    $0x5,%edx
call   1030 <write@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %r14d,%edx
call   1030 <write@plt>
xor    %eax,%eax
call   1040 <global_fd_log@plt>
mov    %eax,%edi
mov    %rbx,%rsi
mov    %r14d,%edx
call   1030 <write@plt>
lea    0xea1(%rip),%rsi
mov    %ebp,%edi
mov    $0x5,%edx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <write@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"\1B[31m\00"
@.str.1 = [5 x i8] c"\1B[0m\00"
define i32 @print_red(i32 %0, i8* %1, i64 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i64
store i32 %0, i32* %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%7 = load i32, i32* %4
%8 = call i32 @write(i32 %7, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 5)
%9 = load i32, i32* %4
%10 = load i8*, i8** %5
%11 = load i64, i64* %6
%12 = trunc i64 %11 to i32
%13 = call i32 @write(i32 %9, i8* %10, i32 %12)
%14 = call i32 (...) @global_fd_log()
%15 = load i8*, i8** %5
%16 = load i64, i64* %6
%17 = trunc i64 %16 to i32
%18 = call i32 @write(i32 %14, i8* %15, i32 %17)
%19 = load i32, i32* %4
%20 = call i32 @write(i32 %19, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 5)
ret i32 %20
}

LLVM IR (-O2):
@.str = [6 x i8] c"\1B[31m\00"
@.str.1 = [5 x i8] c"\1B[0m\00"
define i32 @print_red(i32 %0, i8* nocapture %1, i64 %2) {
%4 = tail call i32 @write(i32 %0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 5)
%5 = trunc i64 %2 to i32
%6 = tail call i32 @write(i32 %0, i8* %1, i32 %5)
%7 = tail call i32 (...) @global_fd_log()
%8 = tail call i32 @write(i32 %7, i8* %1, i32 %5)
%9 = tail call i32 @write(i32 %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 5)
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ outw(unsigned short, int);
int /*<<< orphan*/ slow_down_io();
__attribute__((always_)) void outw_p(unsigned short value, int port) {
  outw(value, port);
  slow_down_io();
}


x86 assembly (clang, -O0):
<outw_p>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x2(%rbp),%ax
mov    -0x8(%rbp),%esi
movzwl %ax,%edi
call   1030 <outw@plt>
mov    $0x0,%al
call   1040 <slow_down_io@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<outw_p>:
push   %rax
call   1030 <outw@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <slow_down_io@plt>

LLVM IR (-O0):
define void @outw_p(i16 zeroext %0, i32 %1) {
%3 = alloca i16
%4 = alloca i32
store i16 %0, i16* %3
store i32 %1, i32* %4
%5 = load i16, i16* %3
%6 = load i32, i32* %4
%7 = call i32 @outw(i16 zeroext %5, i32 %6)
%8 = call i32 (...) @slow_down_io()
ret void
}

LLVM IR (-O2):
define void @outw_p(i16 zeroext %0, i32 %1) {
%3 = tail call i32 @outw(i16 zeroext %0, i32 %1)
%4 = tail call i32 (...) @slow_down_io()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
int main(void) {
  printf("hello world\n");
  exit(42);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
call   1030 <printf@plt>
mov    $0x2a,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
mov    $0x2a,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [13 x i8] c"hello world\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 42)
unreachable
}

LLVM IR (-O2):
@str = [12 x i8] c"hello world\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 42)
unreachable
}
void fail(const char *s) {
  LOG_io("%s", s);
  log_sn(0, -1, 0), exit(5);
}


x86 assembly (clang, -O0):
<fail>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xeb9(%rip),%rdi
mov    $0x0,%al
call   1040 <LOG_io@plt>
xor    %edx,%edx
mov    $0xffffffff,%esi
mov    %edx,%edi
mov    $0x0,%al
call   1030 <log_sn@plt>
mov    $0x5,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<fail>:
push   %rax
mov    %rdi,%rsi
lea    0xec5(%rip),%rdi
xor    %eax,%eax
call   1040 <LOG_io@plt>
xor    %edi,%edi
mov    $0xffffffff,%esi
xor    %edx,%edx
xor    %eax,%eax
call   1030 <log_sn@plt>
mov    $0x5,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
define void @fail(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @LOG_io to i32 (i8*, i8*, ...)*)(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = call i32 (i32, i32, i32, ...) bitcast (i32 (...)* @log_sn to i32 (i32, i32, i32, ...)*)(i32 0, i32 -1, i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define void @fail(i8* %0) {
%2 = tail call i32 (i8*, i8*, ...) bitcast (i32 (...)* @LOG_io to i32 (i8*, i8*, ...)*)(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 (i32, i32, i32, ...) bitcast (i32 (...)* @log_sn to i32 (i32, i32, i32, ...)*)(i32 0, i32 -1, i32 0)
tail call void @exit(i32 5)
unreachable
}
void kexception_handler(void) {}


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

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

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

LLVM IR (-O2):
define void @kexception_handler() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ current_view();
int /*<<< orphan*/ insertlb(int /*<<< orphan*/);
void newline_action() { insertlb(current_view()); }


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

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

LLVM IR (-O0):
define void @newline_action() {
%1 = call i32 (...) @current_view()
%2 = call i32 @insertlb(i32 %1)
ret void
}

LLVM IR (-O2):
define void @newline_action() {
%1 = tail call i32 (...) @current_view()
%2 = tail call i32 @insertlb(i32 %1)
ret void
}
/* Variables and functions */
int cbuf(int, int, int);
cbuf1(int f, int n) { return (cbuf(f, n, 1)); }


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

x86 assembly (clang, -O2):
<cbuf1>:
mov    $0x1,%edx
jmp    1030 <cbuf@plt>

LLVM IR (-O0):
define i32 @cbuf1(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 = call i32 @cbuf(i32 %5, i32 %6, i32 1)
ret i32 %7
}

LLVM IR (-O2):
define i32 @cbuf1(i32 %0, i32 %1) {
%3 = tail call i32 @cbuf(i32 %0, i32 %1, i32 1)
ret i32 %3
}
int test3(unsigned short a) {
  if (a & 1)
    return 1;
  else if (a)
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<test3>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x6(%rbp)
movzwl -0x6(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     1127 <test3+0x27>
movl   $0x1,-0x4(%rbp)
jmp    1145 <test3+0x45>
cmpw   $0x0,-0x6(%rbp)
je     113e <test3+0x3e>
movl   $0x1,-0x4(%rbp)
jmp    1145 <test3+0x45>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test3>:
xor    %eax,%eax
test   %edi,%edi
setne  %al
ret

LLVM IR (-O0):
define i32 @test3(i16 zeroext %0) {
%2 = alloca i32
%3 = alloca i16
store i16 %0, i16* %3
%4 = load i16, i16* %3
%5 = zext i16 %4 to i32
%6 = and i32 %5, 1
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %1
store i32 1, i32* %2
br label %14
9: ; preds = %1
%10 = load i16, i16* %3
%11 = icmp ne i16 %10, 0
br i1 %11, label %12, label %13
12: ; preds = %9
store i32 1, i32* %2
br label %14
13: ; preds = %9
store i32 0, i32* %2
br label %14
14: ; preds = %13, %12, %8
%15 = load i32, i32* %2
ret i32 %15
}

LLVM IR (-O2):
define i32 @test3(i16 zeroext %0) {
%2 = icmp ne i16 %0, 0
%3 = zext i1 %2 to i32
ret i32 %3
}
void foo_1_2_2_2_1_1_1_2_2() {}


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

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

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

LLVM IR (-O2):
define void @foo_1_2_2_2_1_1_1_2_2() {
ret void
}
int main() {
  short test = 1;
  switch (test) {
  case 10L:
    return 1;
  case (char)3:
    return 2;
  case (long)1:
    return 3;
  default:
    return 4;
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movw   $0x1,-0x6(%rbp)
movswl -0x6(%rbp),%eax
mov    %eax,-0xc(%rbp)
sub    $0x1,%eax
je     1160 <main+0x60>
jmp    1126 <main+0x26>
mov    -0xc(%rbp),%eax
sub    $0x3,%eax
je     1154 <main+0x54>
jmp    1137 <main+0x37>
mov    -0xc(%rbp),%eax
sub    $0xa,%eax
jne    116c <main+0x6c>
jmp    1148 <main+0x48>
movl   $0x1,-0x4(%rbp)
jmp    1173 <main+0x73>
movl   $0x2,-0x4(%rbp)
jmp    1173 <main+0x73>
movl   $0x3,-0x4(%rbp)
jmp    1173 <main+0x73>
movl   $0x4,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i16
store i32 0, i32* %1
store i16 1, i16* %2
%3 = load i16, i16* %2
%4 = sext i16 %3 to i32
switch i32 %4, label %8 [
i32 10, label %5
i32 3, label %6
i32 1, label %7
]
5: ; preds = %0
store i32 1, i32* %1
br label %9
6: ; preds = %0
store i32 2, i32* %1
br label %9
7: ; preds = %0
store i32 3, i32* %1
br label %9
8: ; preds = %0
store i32 4, i32* %1
br label %9
9: ; preds = %8, %7, %6, %5
%10 = load i32, i32* %1
ret i32 %10
}

LLVM IR (-O2):
define i32 @main() {
ret i32 3
}
char lastchar(s)
char *s;
{
  while (*s++)
    ;
  return (s[-2]);
}


x86 assembly (clang, -O0):
<lastchar>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
cmpb   $0x0,(%rax)
je     1125 <lastchar+0x25>
jmp    1108 <lastchar+0x8>
mov    -0x8(%rbp),%rax
movsbl -0x2(%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<lastchar>:
cmpb   $0x0,(%rdi)
lea    0x1(%rdi),%rdi
jne    1100 <lastchar>
mov    -0x2(%rdi),%al
ret

LLVM IR (-O0):
define signext i8 @lastchar(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %8, %1
%4 = load i8*, i8** %2
%5 = getelementptr inbounds i8, i8* %4, i32 1
store i8* %5, i8** %2
%6 = load i8, i8* %4
%7 = icmp ne i8 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %3
br label %3
9: ; preds = %3
%10 = load i8*, i8** %2
%11 = getelementptr inbounds i8, i8* %10, i64 -2
%12 = load i8, i8* %11
ret i8 %12
}

LLVM IR (-O2):
define signext i8 @lastchar(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %4, %2 ]
%4 = getelementptr inbounds i8, i8* %3, i64 1
%5 = load i8, i8* %3
%6 = icmp eq i8 %5, 0
br i1 %6, label %7, label %2
7: ; preds = %2
%8 = getelementptr inbounds i8, i8* %3, i64 -1
%9 = load i8, i8* %8
ret i8 %9
}
/* Variables and functions */
int /*<<< orphan*/ memtr_init();
int /*<<< orphan*/ memtr_print(char *, size_t, void *);
void *orig_realloc(void *, size_t);
void *realloc(void *ptr, size_t size) {
  void *p;
  memtr_init();
  memtr_print("r<", size, ptr);
  p = orig_realloc(ptr, size);
  memtr_print("r>", size, p);
  return p;
}


x86 assembly (clang, -O0):
<realloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1040 <memtr_init@plt>
mov    -0x10(%rbp),%rsi
mov    -0x8(%rbp),%rdx
lea    0xeaa(%rip),%rdi
call   1030 <memtr_print@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1050 <orig_realloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
lea    0xe88(%rip),%rdi
call   1030 <memtr_print@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<realloc>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r15
mov    %rdi,%r14
xor    %eax,%eax
call   1040 <memtr_init@plt>
lea    0xeb7(%rip),%rdi
mov    %r15,%rsi
mov    %r14,%rdx
call   1030 <memtr_print@plt>
mov    %r14,%rdi
mov    %r15,%rsi
call   1050 <orig_realloc@plt>
mov    %rax,%rbx
lea    0xe9a(%rip),%rdi
mov    %r15,%rsi
mov    %rax,%rdx
call   1030 <memtr_print@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [3 x i8] c"r<\00"
@.str.1 = [3 x i8] c"r>\00"
define i8* @realloc(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i8*
store i8* %0, i8** %3
store i64 %1, i64* %4
%6 = call i32 (...) @memtr_init()
%7 = load i64, i64* %4
%8 = load i8*, i8** %3
%9 = call i32 @memtr_print(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i64 %7, i8* %8)
%10 = load i8*, i8** %3
%11 = load i64, i64* %4
%12 = call i8* @orig_realloc(i8* %10, i64 %11)
store i8* %12, i8** %5
%13 = load i64, i64* %4
%14 = load i8*, i8** %5
%15 = call i32 @memtr_print(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i64 %13, i8* %14)
%16 = load i8*, i8** %5
ret i8* %16
}

LLVM IR (-O2):
@.str = [3 x i8] c"r<\00"
@.str.1 = [3 x i8] c"r>\00"
define i8* @realloc(i8* %0, i64 %1) {
%3 = tail call i32 (...) @memtr_init()
%4 = tail call i32 @memtr_print(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i64 %1, i8* %0)
%5 = tail call i8* @orig_realloc(i8* %0, i64 %1)
%6 = tail call i32 @memtr_print(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i64 %1, i8* %5)
ret i8* %5
}
/* Type definitions */
struct strbuf {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ traverse0(struct strbuf *, int);
void traverse(struct strbuf *pathbuf) { traverse0(pathbuf, 1); }


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

x86 assembly (clang, -O2):
<traverse>:
mov    $0x1,%esi
jmp    1030 <traverse0@plt>

LLVM IR (-O0):
%struct.strbuf = type { i32 }
define void @traverse(%struct.strbuf* %0) {
%2 = alloca %struct.strbuf*
store %struct.strbuf* %0, %struct.strbuf** %2
%3 = load %struct.strbuf*, %struct.strbuf** %2
%4 = call i32 @traverse0(%struct.strbuf* %3, i32 1)
ret void
}

LLVM IR (-O2):
%struct.strbuf = type { i32 }
define void @traverse(%struct.strbuf* %0) {
%2 = tail call i32 @traverse0(%struct.strbuf* %0, i32 1)
ret void
}