xunge/DecIR huggingface dataset:
/* Variables and functions */
int core3_swap(char *, int);
int U_EMRSETMITERLIMIT_swap(char *record, int torev) {
  return (core3_swap(record, torev));
}


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

x86 assembly (clang, -O2):
<U_EMRSETMITERLIMIT_swap>:
jmp    1030 <core3_swap@plt>

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

LLVM IR (-O2):
define i32 @U_EMRSETMITERLIMIT_swap(i8* %0, i32 %1) {
%3 = tail call i32 @core3_swap(i8* %0, i32 %1)
ret i32 %3
}
void vpostOSDDisable(void) {
  *((volatile unsigned int *)((0xB0008000 + 0x00))) =
      (*((volatile unsigned int *)((0xB0008000 + 0x00)))) & ~(1 << 2);
}


x86 assembly (clang, -O0):
<vpostOSDDisable>:
push   %rbp
mov    %rsp,%rbp
mov    $0xb0008000,%eax
mov    (%rax),%ecx
and    $0xfffffffb,%ecx
mov    $0xb0008000,%eax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<vpostOSDDisable>:
mov    $0xb0008000,%eax
andl   $0xfffffffb,(%rax)
ret

LLVM IR (-O0):
define void @vpostOSDDisable() {
%1 = load volatile i32, i32* inttoptr (i64 2952822784 to i32*)
%2 = and i32 %1, -5
store volatile i32 %2, i32* inttoptr (i64 2952822784 to i32*)
ret void
}

LLVM IR (-O2):
define void @vpostOSDDisable() {
%1 = load volatile i32, i32* inttoptr (i64 2952822784 to i32*)
%2 = and i32 %1, -5
store volatile i32 %2, i32* inttoptr (i64 2952822784 to i32*)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ recursion_sort(char *, int /*<<< orphan*/, int);
void all_sort(char *c, int n) { recursion_sort(c, 0, n - 1); }


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

x86 assembly (clang, -O2):
<all_sort>:
lea    -0x1(%rsi),%edx
xor    %esi,%esi
jmp    1030 <recursion_sort@plt>

LLVM IR (-O0):
define void @all_sort(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = load i32, i32* %4
%7 = sub nsw i32 %6, 1
%8 = call i32 @recursion_sort(i8* %5, i32 0, i32 %7)
ret void
}

LLVM IR (-O2):
define void @all_sort(i8* %0, i32 %1) {
%3 = add nsw i32 %1, -1
%4 = tail call i32 @recursion_sort(i8* %0, i32 0, i32 %3)
ret void
}
__attribute__((always_)) void set_bp(void) { asm volatile("int3"); }


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

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

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

LLVM IR (-O2):
define void @set_bp() {
tail call void asm sideeffect "int3", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
void func42() {
  char var_42[32];
  var_42[31] = 0x42;
}


x86 assembly (clang, -O0):
<func42>:
push   %rbp
mov    %rsp,%rbp
movb   $0x42,-0x1(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @func42() {
%1 = alloca [32 x i8]
%2 = getelementptr inbounds [32 x i8], [32 x i8]* %1, i64 0, i64 31
store i8 66, i8* %2
ret void
}

LLVM IR (-O2):
define void @func42() {
ret void
}
/* Variables and functions */
scalar_t__ __builtin_scalb(double, double);
int /*<<< orphan*/ link_failure_builtin_scalb();
void test_builtin_scalb(double d1, double d2) {
  if (__builtin_scalb(d1, d2) != __builtin_scalb(d1, d2))
    link_failure_builtin_scalb();
}


x86 assembly (clang, -O0):
<test_builtin_scalb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
call   1040 <__builtin_scalb@plt>
mov    %rax,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
call   1040 <__builtin_scalb@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
cmp    %rcx,%rax
je     116b <test_builtin_scalb+0x4b>
mov    $0x0,%al
call   1030 <link_failure_builtin_scalb@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_builtin_scalb>:
push   %rbx
sub    $0x10,%rsp
movsd  %xmm1,0x8(%rsp)
movsd  %xmm0,(%rsp)
call   1040 <__builtin_scalb@plt>
mov    %rax,%rbx
movsd  (%rsp),%xmm0
movsd  0x8(%rsp),%xmm1
call   1040 <__builtin_scalb@plt>
cmp    %rax,%rbx
jne    1153 <test_builtin_scalb+0x33>
add    $0x10,%rsp
pop    %rbx
ret
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
jmp    1030 <link_failure_builtin_scalb@plt>

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

LLVM IR (-O2):
define void @test_builtin_scalb(double %0, double %1) {
%3 = tail call i64 @__builtin_scalb(double %0, double %1)
%4 = tail call i64 @__builtin_scalb(double %0, double %1)
%5 = icmp eq i64 %3, %4
br i1 %5, label %8, label %6
6: ; preds = %2
%7 = tail call i32 (...) @link_failure_builtin_scalb()
br label %8
8: ; preds = %6, %2
ret void
}
void udelay(unsigned int n) {}


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

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

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

LLVM IR (-O2):
define void @udelay(i32 %0) {
ret void
}
/* Variables and functions */
void *calloc(size_t, size_t);
void *_mosquitto_calloc(size_t nmemb, size_t size) {
  void *mem = calloc(nmemb, size);
  return mem;
}


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

x86 assembly (clang, -O2):
<_mosquitto_calloc>:
jmp    1030 <calloc@plt>

LLVM IR (-O0):
define i8* @_mosquitto_calloc(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i8*
store i64 %0, i64* %3
store i64 %1, i64* %4
%6 = load i64, i64* %3
%7 = load i64, i64* %4
%8 = call i8* @calloc(i64 %6, i64 %7)
store i8* %8, i8** %5
%9 = load i8*, i8** %5
ret i8* %9
}

LLVM IR (-O2):
define noalias i8* @_mosquitto_calloc(i64 %0, i64 %1) {
%3 = tail call i8* @calloc(i64 %0, i64 %1)
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ unlink(char *);
void cleanup(void) {
  (void)unlink("utimensat.tmp");
  (void)unlink("utimensat.tmp2");
}


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

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

LLVM IR (-O0):
@.str = [14 x i8] c"utimensat.tmp\00"
@.str.1 = [15 x i8] c"utimensat.tmp2\00"
define void @cleanup() {
%1 = call i32 @unlink(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @unlink(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [14 x i8] c"utimensat.tmp\00"
@.str.1 = [15 x i8] c"utimensat.tmp2\00"
define void @cleanup() {
%1 = tail call i32 @unlink(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @unlink(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void gtk_window_is_active() {}


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

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

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

LLVM IR (-O2):
define void @gtk_window_is_active() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ X509_CRL_INFO;
typedef int /*<<< orphan*/ ASN1_VALUE;

/* Variables and functions */
int /*<<< orphan*/ ASN1_item_free(int /*<<< orphan*/ *, int /*<<< orphan*/ *);
int /*<<< orphan*/ X509_CRL_INFO_it;
void X509_CRL_INFO_free(X509_CRL_INFO *a) {
  ASN1_item_free((ASN1_VALUE *)a, &X509_CRL_INFO_it);
}


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

x86 assembly (clang, -O2):
<X509_CRL_INFO_free>:
mov    0x2ed1(%rip),%rsi
jmp    1030 <ASN1_item_free@plt>

LLVM IR (-O0):
@X509_CRL_INFO_it = global i32 0
define void @X509_CRL_INFO_free(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @ASN1_item_free(i32* %3, i32* @X509_CRL_INFO_it)
ret void
}

LLVM IR (-O2):
@X509_CRL_INFO_it = global i32 0
define void @X509_CRL_INFO_free(i32* %0) {
%2 = tail call i32 @ASN1_item_free(i32* %0, i32* @X509_CRL_INFO_it)
ret void
}
int MaxSlot(void) { return (128); }


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

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

LLVM IR (-O0):
define i32 @MaxSlot() {
ret i32 128
}

LLVM IR (-O2):
define i32 @MaxSlot() {
ret i32 128
}
void J400ToARGBRow_NEON() {}


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

x86 assembly (clang, -O2):
ret

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

LLVM IR (-O2):
define void @J400ToARGBRow_NEON() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int sub1(int, int);
int main() {
  typedef struct {
    int c[22];
  } c;
  if (sub1(20, 3) != sizeof(c) * 3)
    abort();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x14,%edi
mov    $0x3,%esi
call   1040 <sub1@plt>
cltq
cmp    $0x108,%rax
je     1153 <main+0x33>
mov    $0x0,%al
call   1030 <abort@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x14,%edi
mov    $0x3,%esi
call   1040 <sub1@plt>
cmp    $0x108,%eax
jne    113b <main+0x1b>
xor    %eax,%eax
pop    %rcx
ret
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @sub1(i32 20, i32 3)
%3 = sext i32 %2 to i64
%4 = icmp ne i64 %3, 264
br i1 %4, label %5, label %7
5: ; preds = %0
%6 = call i32 (...) @abort()
unreachable
7: ; preds = %0
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @sub1(i32 20, i32 3)
%2 = icmp eq i32 %1, 264
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 (...) @abort()
unreachable
5: ; preds = %0
ret i32 0
}
void foo010() {}


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

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

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

LLVM IR (-O2):
define void @foo010() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ recv(int, void *, int, int /*<<< orphan*/);
int recieve_all(int sockfd) {
  void *buff;
  int len;
  recv(sockfd, buff, len, 0);
  int message = *((int *)buff);
  printf("I got - %d", message);
}


x86 assembly (clang, -O0):
<recieve_all>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
xor    %ecx,%ecx
call   1030 <recv@plt>
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%esi
lea    0xeb1(%rip),%rdi
call   1040 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<recieve_all>:
push   %rax
xor    %ecx,%ecx
call   1030 <recv@plt>
lea    0xed1(%rip),%rdi
pop    %rax
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"I got - %d\00"
define i32 @recieve_all(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %3
%7 = load i32, i32* %3
%8 = load i8*, i8** %4
%9 = load i32, i32* %5
%10 = call i32 @recv(i32 %7, i8* %8, i32 %9, i32 0)
%11 = load i8*, i8** %4
%12 = bitcast i8* %11 to i32*
%13 = load i32, i32* %12
store i32 %13, i32* %6
%14 = load i32, i32* %6
%15 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %14)
%16 = load i32, i32* %2
ret i32 %16
}

LLVM IR (-O2):
@.str = [11 x i8] c"I got - %d\00"
define i32 @recieve_all(i32 %0) {
%2 = tail call i32 @recv(i32 %0, i8* undef, i32 undef, i32 0)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 undef)
ret i32 undef
}
/* Type definitions */
typedef scalar_t__ wint_t;

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


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

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

LLVM IR (-O0):
define i32 @iswdigit(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 @isdigit(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 @iswdigit(i64 %0) {
%2 = icmp slt i64 %0, 256
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 @isdigit(i64 %0)
br label %5
5: ; preds = %1, %3
%6 = phi i32 [ %4, %3 ], [ 0, %1 ]
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
int xmp_flush(void *userdata) {
  (void)(userdata);
  fprintf(stderr, "Received a flush request.\n");
  return 0;
}


x86 assembly (clang, -O0):
<xmp_flush>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
lea    0xed4(%rip),%rsi
call   1030 <fprintf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmp_flush>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%edi
lea    0xedf(%rip),%rsi
call   1030 <fprintf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [27 x i8] c"Received a flush request.\0A\00"
define i32 @xmp_flush(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i32, i32* @stderr
%5 = call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [27 x i8] c"Received a flush request.\0A\00"
define i32 @xmp_flush(i8* nocapture readnone %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ p(char *);
int /*<<< orphan*/ p_good();
int /*<<< orphan*/ p_newline();
void morning() {
  p_good();
  p("morning");
  p_newline();
}


x86 assembly (clang, -O0):
<morning>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1050 <p_good@plt>
lea    0xebe(%rip),%rdi
call   1040 <p@plt>
mov    $0x0,%al
call   1030 <p_newline@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<morning>:
push   %rax
xor    %eax,%eax
call   1050 <p_good@plt>
lea    0xec1(%rip),%rdi
call   1040 <p@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <p_newline@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"morning\00"
define void @morning() {
%1 = call i32 (...) @p_good()
%2 = call i32 @p(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (...) @p_newline()
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"morning\00"
define void @morning() {
%1 = tail call i32 (...) @p_good()
%2 = tail call i32 @p(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (...) @p_newline()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ uart_putc(int /*<<< orphan*/);
int _write(int file, char *ptr, int len) {
  int todo;
  for (todo = 0; todo < len; todo++) {
    uart_putc(*ptr++);
  }
  return len;
}


x86 assembly (clang, -O0):
<_write>:
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    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    115a <_write+0x4a>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movsbl (%rax),%edi
call   1030 <uart_putc@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1129 <_write+0x19>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_write>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %edx,%r14d
test   %edx,%edx
jle    1142 <_write+0x32>
mov    %rsi,%r15
mov    %r14d,%ebp
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
movsbl (%r15,%rbx,1),%edi
call   1030 <uart_putc@plt>
add    $0x1,%rbx
cmp    %ebx,%ebp
jne    1130 <_write+0x20>
mov    %r14d,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @_write(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
br label %8
8: ; preds = %18, %3
%9 = load i32, i32* %7
%10 = load i32, i32* %6
%11 = icmp slt i32 %9, %10
br i1 %11, label %12, label %21
12: ; preds = %8
%13 = load i8*, i8** %5
%14 = getelementptr inbounds i8, i8* %13, i32 1
store i8* %14, i8** %5
%15 = load i8, i8* %13
%16 = sext i8 %15 to i32
%17 = call i32 @uart_putc(i32 %16)
br label %18
18: ; preds = %12
%19 = load i32, i32* %7
%20 = add nsw i32 %19, 1
store i32 %20, i32* %7
br label %8
21: ; preds = %8
%22 = load i32, i32* %6
ret i32 %22
}

LLVM IR (-O2):
define i32 @_write(i32 %0, i8* nocapture %1, i32 returned %2) {
%4 = icmp sgt i32 %2, 0
br i1 %4, label %5, label %14
5: ; preds = %3, %5
%6 = phi i32 [ %12, %5 ], [ 0, %3 ]
%7 = phi i8* [ %8, %5 ], [ %1, %3 ]
%8 = getelementptr inbounds i8, i8* %7, i64 1
%9 = load i8, i8* %7
%10 = sext i8 %9 to i32
%11 = tail call i32 @uart_putc(i32 %10)
%12 = add nuw nsw i32 %6, 1
%13 = icmp eq i32 %12, %2
br i1 %13, label %14, label %5
14: ; preds = %5, %3
ret i32 %2
}
int compareBF(const void *p1, const void *p2) {
  if (*((double *)p1) < *((double *)p2))
    return -1;
  if (*((double *)p1) == *((double *)p2))
    return 0;
  if (*((double *)p1) > *((double *)p2))
    return 1;
}


x86 assembly (clang, -O0):
<compareBF>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm1
mov    -0x18(%rbp),%rax
movsd  (%rax),%xmm0
ucomisd %xmm1,%xmm0
jbe    1132 <compareBF+0x32>
movl   $0xffffffff,-0x4(%rbp)
jmp    1177 <compareBF+0x77>
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x18(%rbp),%rax
ucomisd (%rax),%xmm0
jne    115a <compareBF+0x5a>
jp     115a <compareBF+0x5a>
movl   $0x0,-0x4(%rbp)
jmp    1177 <compareBF+0x77>
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x18(%rbp),%rax
ucomisd (%rax),%xmm0
jbe    1177 <compareBF+0x77>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<compareBF>:
movsd  (%rdi),%xmm0
movsd  (%rsi),%xmm1
mov    $0xffffffff,%eax
ucomisd %xmm0,%xmm1
ja     111d <compareBF+0x1d>
xor    %eax,%eax
ucomisd %xmm1,%xmm0
jne    111e <compareBF+0x1e>
jp     111e <compareBF+0x1e>
ret
mov    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @compareBF(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
%6 = load i8*, i8** %4
%7 = bitcast i8* %6 to double*
%8 = load double, double* %7
%9 = load i8*, i8** %5
%10 = bitcast i8* %9 to double*
%11 = load double, double* %10
%12 = fcmp olt double %8, %11
br i1 %12, label %13, label %14
13: ; preds = %2
store i32 -1, i32* %3
br label %32
14: ; preds = %2
%15 = load i8*, i8** %4
%16 = bitcast i8* %15 to double*
%17 = load double, double* %16
%18 = load i8*, i8** %5
%19 = bitcast i8* %18 to double*
%20 = load double, double* %19
%21 = fcmp oeq double %17, %20
br i1 %21, label %22, label %23
22: ; preds = %14
store i32 0, i32* %3
br label %32
23: ; preds = %14
%24 = load i8*, i8** %4
%25 = bitcast i8* %24 to double*
%26 = load double, double* %25
%27 = load i8*, i8** %5
%28 = bitcast i8* %27 to double*
%29 = load double, double* %28
%30 = fcmp ogt double %26, %29
br i1 %30, label %31, label %32
31: ; preds = %23
store i32 1, i32* %3
br label %32
32: ; preds = %13, %22, %31, %23
%33 = load i32, i32* %3
ret i32 %33
}

LLVM IR (-O2):
define i32 @compareBF(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to double*
%4 = load double, double* %3
%5 = bitcast i8* %1 to double*
%6 = load double, double* %5
%7 = fcmp olt double %4, %6
br i1 %7, label %11, label %8
8: ; preds = %2
%9 = fcmp oeq double %4, %6
br i1 %9, label %11, label %10
10: ; preds = %8
br label %11
11: ; preds = %10, %8, %2
%12 = phi i32 [ -1, %2 ], [ 0, %8 ], [ 1, %10 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ put_byte(unsigned char);
int put_word(int b, int e) {
  unsigned char v;
  if (!e) {
    v = b & 0xff;
    put_byte(v);
    v = b >> 8;
    put_byte(v);
  } else {
    v = b >> 8;
    put_byte(v);
    v = b & 0xff;
    put_byte(v);
  }
  return 0;
}


x86 assembly (clang, -O0):
<put_word>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1153 <put_word+0x43>
mov    -0x4(%rbp),%eax
and    $0xff,%eax
mov    %al,-0x9(%rbp)
movzbl -0x9(%rbp),%edi
call   1030 <put_byte@plt>
mov    -0x4(%rbp),%eax
sar    $0x8,%eax
mov    %al,-0x9(%rbp)
movzbl -0x9(%rbp),%edi
call   1030 <put_byte@plt>
jmp    1179 <put_word+0x69>
mov    -0x4(%rbp),%eax
sar    $0x8,%eax
mov    %al,-0x9(%rbp)
movzbl -0x9(%rbp),%edi
call   1030 <put_byte@plt>
mov    -0x4(%rbp),%eax
and    $0xff,%eax
mov    %al,-0x9(%rbp)
movzbl -0x9(%rbp),%edi
call   1030 <put_byte@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<put_word>:
push   %rbx
mov    %edi,%ebx
test   %esi,%esi
je     1121 <put_word+0x11>
movzbl %bh,%edi
call   1030 <put_byte@plt>
jmp    112c <put_word+0x1c>
movzbl %bl,%edi
call   1030 <put_byte@plt>
shr    $0x8,%ebx
movzbl %bl,%edi
call   1030 <put_byte@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @put_word(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %4, label %8
4: ; preds = %2
%5 = trunc i32 %0 to i8
%6 = tail call i32 @put_byte(i8 zeroext %5)
%7 = lshr i32 %0, 8
br label %12
8: ; preds = %2
%9 = lshr i32 %0, 8
%10 = trunc i32 %9 to i8
%11 = tail call i32 @put_byte(i8 zeroext %10)
br label %12
12: ; preds = %8, %4
%13 = phi i32 [ %0, %8 ], [ %7, %4 ]
%14 = trunc i32 %13 to i8
%15 = tail call i32 @put_byte(i8 zeroext %14)
ret i32 0
}
/* Variables and functions */
int rand();
int rand31() { return ((rand() << 16) ^ rand()) & 0x7fff; }


x86 assembly (clang, -O0):
<rand31>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <rand@plt>
shl    $0x10,%eax
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
mov    %eax,%ecx
mov    -0x4(%rbp),%eax
xor    %ecx,%eax
and    $0x7fff,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rand31>:
push   %rax
xor    %eax,%eax
call   1030 <rand@plt>
xor    %eax,%eax
call   1030 <rand@plt>
and    $0x7fff,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @rand31() {
%1 = call i32 (...) @rand()
%2 = shl i32 %1, 16
%3 = call i32 (...) @rand()
%4 = xor i32 %2, %3
%5 = and i32 %4, 32767
ret i32 %5
}

LLVM IR (-O2):
define i32 @rand31() {
%1 = tail call i32 (...) @rand()
%2 = tail call i32 (...) @rand()
%3 = and i32 %2, 32767
ret i32 %3
}
/* Variables and functions */
unsigned char *medusaReceiveDataInternal(int, int *, int /*<<< orphan*/, int,
                                         int);
unsigned char *medusaReceiveRawDelay(int socket, int *nBufferSize,
                                     int nReceiveDelay1, int nReceiveDelay2) {
  return medusaReceiveDataInternal(socket, nBufferSize, 0, nReceiveDelay1,
                                   nReceiveDelay2);
}


x86 assembly (clang, -O0):
<medusaReceiveRawDelay>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%ecx
mov    -0x18(%rbp),%r8d
xor    %edx,%edx
call   1030 <medusaReceiveDataInternal@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<medusaReceiveRawDelay>:
mov    %ecx,%r8d
mov    %edx,%ecx
xor    %edx,%edx
jmp    1030 <medusaReceiveDataInternal@plt>

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

LLVM IR (-O2):
define i8* @medusaReceiveRawDelay(i32 %0, i32* %1, i32 %2, i32 %3) {
%5 = tail call i8* @medusaReceiveDataInternal(i32 %0, i32* %1, i32 0, i32 %2, i32 %3)
ret i8* %5
}
/* Type definitions */
typedef scalar_t__ ssize_t;

/* Variables and functions */
scalar_t__ write(int, void const *, size_t);
ssize_t writen(int fd, const void *buf, size_t len) {
  ssize_t n;
  while (len > 0) {
    n = write(fd, buf, len);
    if (n <= 0) {
      return n;
    }
    len -= n;
  }
  return n;
}


x86 assembly (clang, -O0):
<writen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0xc(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jbe    116e <writen+0x5e>
mov    -0xc(%rbp),%edi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
call   1030 <write@plt>
mov    %rax,-0x28(%rbp)
cmpq   $0x0,-0x28(%rbp)
jg     115a <writen+0x4a>
mov    -0x28(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1176 <writen+0x66>
mov    -0x28(%rbp),%rcx
mov    -0x20(%rbp),%rax
sub    %rcx,%rax
mov    %rax,-0x20(%rbp)
jmp    1123 <writen+0x13>
mov    -0x28(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<writen>:
push   %rbp
push   %r14
push   %rbx
test   %rdx,%rdx
je     1149 <writen+0x39>
mov    %rdx,%rbx
mov    %rsi,%r14
mov    %edi,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %ebp,%edi
mov    %r14,%rsi
mov    %rbx,%rdx
call   1030 <write@plt>
test   %rax,%rax
jle    1149 <writen+0x39>
sub    %rax,%rbx
jne    1130 <writen+0x20>
jmp    1149 <writen+0x39>
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i64 @writen(i32 %0, i8* %1, i64 %2) {
%4 = alloca i64
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i64
%8 = alloca i64
store i32 %0, i32* %5
store i8* %1, i8** %6
store i64 %2, i64* %7
br label %9
9: ; preds = %21, %3
%10 = load i64, i64* %7
%11 = icmp ugt i64 %10, 0
br i1 %11, label %12, label %25
12: ; preds = %9
%13 = load i32, i32* %5
%14 = load i8*, i8** %6
%15 = load i64, i64* %7
%16 = call i64 @write(i32 %13, i8* %14, i64 %15)
store i64 %16, i64* %8
%17 = load i64, i64* %8
%18 = icmp sle i64 %17, 0
br i1 %18, label %19, label %21
19: ; preds = %12
%20 = load i64, i64* %8
store i64 %20, i64* %4
br label %27
21: ; preds = %12
%22 = load i64, i64* %8
%23 = load i64, i64* %7
%24 = sub i64 %23, %22
store i64 %24, i64* %7
br label %9
25: ; preds = %9
%26 = load i64, i64* %8
store i64 %26, i64* %4
br label %27
27: ; preds = %25, %19
%28 = load i64, i64* %4
ret i64 %28
}

LLVM IR (-O2):
define i64 @writen(i32 %0, i8* nocapture %1, i64 %2) {
%4 = icmp eq i64 %2, 0
br i1 %4, label %12, label %5
5: ; preds = %3, %5
%6 = phi i64 [ %9, %5 ], [ %2, %3 ]
%7 = tail call i64 @write(i32 %0, i8* %1, i64 %6)
%8 = icmp slt i64 %7, 1
%9 = sub i64 %6, %7
%10 = icmp eq i64 %9, 0
%11 = or i1 %8, %10
br i1 %11, label %12, label %5
12: ; preds = %5, %3
%13 = phi i64 [ undef, %3 ], [ %7, %5 ]
ret i64 %13
}
/* Type definitions */
struct ship {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ Write(int, struct ship *, long, long, int /*<<< orphan*/,
                         int /*<<< orphan*/);
void send_unfoul(struct ship *ship, long a, long b) {
  Write(16, ship, a, b, 0, 0);
}


x86 assembly (clang, -O0):
<send_unfoul>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    $0x10,%edi
xor    %r9d,%r9d
mov    %r9d,%r8d
call   1030 <Write@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<send_unfoul>:
mov    %rdx,%rcx
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    $0x10,%edi
xor    %r8d,%r8d
xor    %r9d,%r9d
jmp    1030 <Write@plt>

LLVM IR (-O0):
%struct.ship = type { i32 }
define void @send_unfoul(%struct.ship* %0, i64 %1, i64 %2) {
%4 = alloca %struct.ship*
%5 = alloca i64
%6 = alloca i64
store %struct.ship* %0, %struct.ship** %4
store i64 %1, i64* %5
store i64 %2, i64* %6
%7 = load %struct.ship*, %struct.ship** %4
%8 = load i64, i64* %5
%9 = load i64, i64* %6
%10 = call i32 @Write(i32 16, %struct.ship* %7, i64 %8, i64 %9, i32 0, i32 0)
ret void
}

LLVM IR (-O2):
%struct.ship = type { i32 }
define void @send_unfoul(%struct.ship* %0, i64 %1, i64 %2) {
%4 = tail call i32 @Write(i32 16, %struct.ship* %0, i64 %1, i64 %2, i32 0, i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ die(char *, char *);
void usage(char *progname) {
  die("Usage: %s [-eflmov] file1 [file2 ...]\n"
      "  -e: expand block lists ('1 2 3' versus '1-3')\n"
      "  -f: print full names (default: basename only)\n"
      "  -l: list pages\n"
      "  -m: do not print colons\n"
      "  -o: one char per page\n"
      "  -v: verbose page listing\n",
      progname);
}


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

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

LLVM IR (-O0):
@.str = [229 x i8] c"Usage: %s [-eflmov] file1 [file2 ...]\0A -e: expand block lists ('1 2 3' versus '1-3')\0A -f: print full names (default: basename only)\0A -l: list pages\0A -m: do not print colons\0A -o: one char per page\0A -v: verbose page listing\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @die(i8* getelementptr inbounds ([229 x i8], [229 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [229 x i8] c"Usage: %s [-eflmov] file1 [file2 ...]\0A -e: expand block lists ('1 2 3' versus '1-3')\0A -f: print full names (default: basename only)\0A -l: list pages\0A -m: do not print colons\0A -o: one char per page\0A -v: verbose page listing\0A\00"
define void @usage(i8* %0) {
%2 = tail call i32 @die(i8* getelementptr inbounds ([229 x i8], [229 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ngen(char *, char *, int);
void cginclw(int a) { ngen("%s\t%d(%%ebp)", "incl", a); }


x86 assembly (clang, -O0):
<cginclw>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
lea    0xedb(%rip),%rdi
lea    0xee1(%rip),%rsi
call   1030 <ngen@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cginclw>:
mov    %edi,%edx
lea    0xee7(%rip),%rdi
lea    0xeed(%rip),%rsi
jmp    1030 <ngen@plt>

LLVM IR (-O0):
@.str = [13 x i8] c"%s\09%d(%%ebp)\00"
@.str.1 = [5 x i8] c"incl\00"
define void @cginclw(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @ngen(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %3)
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c"%s\09%d(%%ebp)\00"
@.str.1 = [5 x i8] c"incl\00"
define void @cginclw(i32 %0) {
%2 = tail call i32 @ngen(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %0)
ret void
}
void omap_control_usb_device_mode(struct device *dev) {}


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

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

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

LLVM IR (-O2):
%struct.device = type opaque
define void @omap_control_usb_device_mode(%struct.device* nocapture %0) {
ret void
}
unsigned symhash(char *sym) {
  unsigned int hash = 0;
  unsigned c;
  while (c = *sym++) {
    hash = hash * 9 ^ c;
  }
  return hash;
}


x86 assembly (clang, -O0):
<symhash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%eax
mov    %eax,-0x10(%rbp)
cmp    $0x0,%eax
je     113c <symhash+0x3c>
imul   $0x9,-0xc(%rbp),%eax
xor    -0x10(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    110f <symhash+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<symhash>:
mov    (%rdi),%cl
test   %cl,%cl
je     1124 <symhash+0x24>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
movsbl %cl,%ecx
lea    (%rax,%rax,8),%eax
xor    %ecx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <symhash+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @symhash(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %14, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i8* [ %9, %4 ], [ %0, %1 ]
%7 = phi i32 [ %11, %4 ], [ 0, %1 ]
%8 = sext i8 %5 to i32
%9 = getelementptr inbounds i8, i8* %6, i64 1
%10 = mul i32 %7, 9
%11 = xor i32 %10, %8
%12 = load i8, i8* %9
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4, %1
%15 = phi i32 [ 0, %1 ], [ %11, %4 ]
ret i32 %15
}
/* Variables and functions */
int PAPI_stop_counters(long long *, int);
void papif_stop_counters_(long long *values, int *array_len, int *check) {
  *check = PAPI_stop_counters(values, *array_len);
}


x86 assembly (clang, -O0):
<papif_stop_counters_>:
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),%rax
mov    (%rax),%esi
call   1030 <PAPI_stop_counters@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<papif_stop_counters_>:
push   %rbx
mov    %rdx,%rbx
mov    (%rsi),%esi
call   1030 <PAPI_stop_counters@plt>
mov    %eax,(%rbx)
pop    %rbx
ret

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

LLVM IR (-O2):
define void @papif_stop_counters_(i64* %0, i32* nocapture %1, i32* nocapture writeonly %2) {
%4 = load i32, i32* %1
%5 = tail call i32 @PAPI_stop_counters(i64* %0, i32 %4)
store i32 %5, i32* %2
ret void
}
int main(int a) {
  int i = 0;
  int j = 6;
  while (a < 5) {
    i = i + j + a;
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x6,-0x10(%rbp)
cmpl   $0x5,-0x8(%rbp)
jge    1137 <main+0x37>
mov    -0xc(%rbp),%eax
add    -0x10(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    111c <main+0x1c>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
cmp    $0x4,%edi
jg     1112 <main+0x12>
cs nopw 0x0(%rax,%rax,1)
nop
jmp    1110 <main+0x10>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @main(i32 %0) {
%2 = icmp slt i32 %0, 5
br i1 %2, label %3, label %4
3: ; preds = %1, %3
br label %3
4: ; preds = %1
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ fastscan(int *);
int /*<<< orphan*/ printf(char *, unsigned long);
unsigned long solve_subtle(int);
int main() {
  int t;
  fastscan(&t);
  while (t--) {
    int n = 0;
    fastscan(&n);
    unsigned long res = solve_subtle(n);
    printf("%lu\n", res);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x8(%rbp),%rdi
call   1050 <fastscan@plt>
mov    -0x8(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x8(%rbp)
cmp    $0x0,%eax
je     118d <main+0x5d>
movl   $0x0,-0xc(%rbp)
lea    -0xc(%rbp),%rdi
call   1050 <fastscan@plt>
mov    -0xc(%rbp),%edi
call   1030 <solve_subtle@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rsi
lea    0xe7d(%rip),%rdi
call   1040 <printf@plt>
jmp    1148 <main+0x18>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
lea    0x4(%rsp),%rdi
call   1050 <fastscan@plt>
subl   $0x1,0x4(%rsp)
jb     1179 <main+0x49>
mov    %rsp,%r14
lea    0xeb1(%rip),%rbx
nop
movl   $0x0,(%rsp)
mov    %r14,%rdi
call   1050 <fastscan@plt>
mov    (%rsp),%edi
call   1030 <solve_subtle@plt>
mov    %rbx,%rdi
mov    %rax,%rsi
call   1040 <printf@plt>
subl   $0x1,0x4(%rsp)
jae    1150 <main+0x20>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [5 x i8] c"%lu\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i64
store i32 0, i32* %1
%5 = call i32 @fastscan(i32* %2)
br label %6
6: ; preds = %10, %0
%7 = load i32, i32* %2
%8 = add nsw i32 %7, -1
store i32 %8, i32* %2
%9 = icmp ne i32 %7, 0
br i1 %9, label %10, label %16
10: ; preds = %6
store i32 0, i32* %3
%11 = call i32 @fastscan(i32* %3)
%12 = load i32, i32* %3
%13 = call i64 @solve_subtle(i32 %12)
store i64 %13, i64* %4
%14 = load i64, i64* %4
%15 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64 %14)
br label %6
16: ; preds = %6
ret i32 0
}

LLVM IR (-O2):
@.str = [5 x i8] c"%lu\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = call i32 @fastscan(i32* %1)
%5 = load i32, i32* %1
%6 = add nsw i32 %5, -1
store i32 %6, i32* %1
%7 = icmp eq i32 %5, 0
br i1 %7, label %18, label %8
8: ; preds = %0
%9 = bitcast i32* %2 to i8*
br label %10
10: ; preds = %8, %10
store i32 0, i32* %2
%11 = call i32 @fastscan(i32* %2)
%12 = load i32, i32* %2
%13 = call i64 @solve_subtle(i32 %12)
%14 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64 %13)
%15 = load i32, i32* %1
%16 = add nsw i32 %15, -1
store i32 %16, i32* %1
%17 = icmp eq i32 %15, 0
br i1 %17, label %18, label %10
18: ; preds = %10, %0
ret i32 0
}
/* Variables and functions */
scalar_t__ read(int /*<<< orphan*/, char *, int);
int /*<<< orphan*/ write(int, char *, int);
int main(int argc, char **argv) {
  char buf;
  while (read(0, &buf, 1)) {
    write(1, &buf, 1);
  }
  return 1;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %edi,%edi
lea    -0x11(%rbp),%rsi
mov    $0x1,%edx
call   1040 <read@plt>
cmp    $0x0,%rax
je     1165 <main+0x45>
mov    $0x1,%edx
lea    -0x11(%rbp),%rsi
mov    %edx,%edi
call   1030 <write@plt>
jmp    1136 <main+0x16>
mov    $0x1,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xf(%rsp),%rsi
xor    %edi,%edi
mov    $0x1,%edx
call   1040 <read@plt>
test   %rax,%rax
je     1166 <main+0x46>
lea    0xf(%rsp),%rbx
mov    $0x1,%edi
mov    %rbx,%rsi
mov    $0x1,%edx
call   1030 <write@plt>
xor    %edi,%edi
mov    %rbx,%rsi
mov    $0x1,%edx
call   1040 <read@plt>
test   %rax,%rax
jne    1140 <main+0x20>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i8
%4 = call i64 @read(i32 0, i8* %3, i32 1)
%5 = icmp eq i64 %4, 0
br i1 %5, label %10, label %6
6: ; preds = %2, %6
%7 = call i32 @write(i32 1, i8* %3, i32 1)
%8 = call i64 @read(i32 0, i8* %3, i32 1)
%9 = icmp eq i64 %8, 0
br i1 %9, label %10, label %6
10: ; preds = %6, %2
ret i32 1
}
/* Type definitions */
typedef int uint64_t;
struct statvfs {
  scalar_t__ f_bfree;
  scalar_t__ f_frsize;
};

/* Variables and functions */
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ statvfs(char const *, struct statvfs *);
uint64_t get_freespace(const char *path) {
  struct statvfs fs;
  assert(!statvfs(path, &fs));
  return (uint64_t)fs.f_frsize * (uint64_t)fs.f_bfree;
}


x86 assembly (clang, -O0):
<get_freespace>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1040 <statvfs@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%rcx
imul   %ecx,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_freespace>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rsi
call   1040 <statvfs@plt>
xor    %edi,%edi
test   %eax,%eax
sete   %dil
call   1030 <assert@plt>
mov    0x8(%rsp),%eax
imul   0x10(%rsp),%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.statvfs = type { i64, i64 }
define i32 @get_freespace(i8* %0) {
%2 = alloca i8*
%3 = alloca %struct.statvfs
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @statvfs(i8* %4, %struct.statvfs* %3)
%6 = icmp ne i32 %5, 0
%7 = xor i1 %6, true
%8 = zext i1 %7 to i32
%9 = call i32 @assert(i32 %8)
%10 = getelementptr inbounds %struct.statvfs, %struct.statvfs* %3, i32 0, i32 1
%11 = load i64, i64* %10
%12 = trunc i64 %11 to i32
%13 = getelementptr inbounds %struct.statvfs, %struct.statvfs* %3, i32 0, i32 0
%14 = load i64, i64* %13
%15 = trunc i64 %14 to i32
%16 = mul nsw i32 %12, %15
ret i32 %16
}

LLVM IR (-O2):
%struct.statvfs = type { i64, i64 }
define i32 @get_freespace(i8* nocapture %0) {
%2 = alloca %struct.statvfs
%3 = bitcast %struct.statvfs* %2 to i8*
%4 = call i32 @statvfs(i8* %0, %struct.statvfs* %2)
%5 = icmp eq i32 %4, 0
%6 = zext i1 %5 to i32
%7 = tail call i32 @assert(i32 %6)
%8 = getelementptr inbounds %struct.statvfs, %struct.statvfs* %2, i64 0, i32 1
%9 = load i64, i64* %8
%10 = trunc i64 %9 to i32
%11 = getelementptr inbounds %struct.statvfs, %struct.statvfs* %2, i64 0, i32 0
%12 = load i64, i64* %11
%13 = trunc i64 %12 to i32
%14 = mul nsw i32 %13, %10
ret i32 %14
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
struct tm {
  int dummy;
};

/* Variables and functions */
struct tm *localtime(int /*<<< orphan*/ *);
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ strftime(char *, int, char *, struct tm *);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
int timestamp() {
  time_t timer;
  char buffer[26];
  struct tm *tm_info;
  time(&timer);
  tm_info = localtime(&timer);
  strftime(buffer, 16, "%Y%m%d%H%M%S", tm_info);
  puts(buffer);
  return 0;
}


x86 assembly (clang, -O0):
<timestamp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
lea    -0x4(%rbp),%rdi
call   1050 <time@plt>
lea    -0x4(%rbp),%rdi
call   1030 <localtime@plt>
mov    %rax,-0x28(%rbp)
lea    -0x20(%rbp),%rdi
mov    -0x28(%rbp),%rcx
mov    $0x10,%esi
lea    0xe8e(%rip),%rdx
call   1060 <strftime@plt>
lea    -0x20(%rbp),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<timestamp>:
push   %rbx
sub    $0x30,%rsp
lea    0xc(%rsp),%rbx
mov    %rbx,%rdi
call   1050 <time@plt>
mov    %rbx,%rdi
call   1030 <localtime@plt>
lea    0xe9f(%rip),%rdx
lea    0x10(%rsp),%rbx
mov    %rbx,%rdi
mov    $0x10,%esi
mov    %rax,%rcx
call   1060 <strftime@plt>
mov    %rbx,%rdi
call   1040 <puts@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.tm = type { i32 }
@.str = [13 x i8] c"%Y%m%d%H%M%S\00"
define i32 @timestamp() {
%1 = alloca i32
%2 = alloca [26 x i8]
%3 = alloca %struct.tm*
%4 = call i32 @time(i32* %1)
%5 = call %struct.tm* @localtime(i32* %1)
store %struct.tm* %5, %struct.tm** %3
%6 = getelementptr inbounds [26 x i8], [26 x i8]* %2, i64 0, i64 0
%7 = load %struct.tm*, %struct.tm** %3
%8 = call i32 @strftime(i8* %6, i32 16, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), %struct.tm* %7)
%9 = getelementptr inbounds [26 x i8], [26 x i8]* %2, i64 0, i64 0
%10 = call i32 @puts(i8* %9)
ret i32 0
}

LLVM IR (-O2):
%struct.tm = type { i32 }
@.str = [13 x i8] c"%Y%m%d%H%M%S\00"
define i32 @timestamp() {
%1 = alloca i32
%2 = alloca [26 x i8]
%3 = bitcast i32* %1 to i8*
%4 = getelementptr inbounds [26 x i8], [26 x i8]* %2, i64 0, i64 0
%5 = call i32 @time(i32* %1)
%6 = call %struct.tm* @localtime(i32* %1)
%7 = call i32 @strftime(i8* %4, i32 16, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), %struct.tm* %6)
%8 = call i32 @puts(i8* %4)
ret i32 0
}