xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int uint8_t;
typedef int const uint16_t;

/* Variables and functions */
uint16_t be16dec(const void *pp) {
  uint8_t const *p = (uint8_t const *)pp;
  return ((p[0] << 8) | p[1]);
}


x86 assembly (clang, -O0):
<be16dec>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
shl    $0x8,%eax
mov    -0x10(%rbp),%rcx
or     0x4(%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<be16dec>:
mov    (%rdi),%eax
shl    $0x8,%eax
or     0x4(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @be16dec(i8* %0) {
%2 = alloca i8*
%3 = alloca i32*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = bitcast i8* %4 to i32*
store i32* %5, i32** %3
%6 = load i32*, i32** %3
%7 = getelementptr inbounds i32, i32* %6, i64 0
%8 = load i32, i32* %7
%9 = shl i32 %8, 8
%10 = load i32*, i32** %3
%11 = getelementptr inbounds i32, i32* %10, i64 1
%12 = load i32, i32* %11
%13 = or i32 %9, %12
ret i32 %13
}

LLVM IR (-O2):
define i32 @be16dec(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
%4 = shl i32 %3, 8
%5 = getelementptr inbounds i8, i8* %0, i64 4
%6 = bitcast i8* %5 to i32*
%7 = load i32, i32* %6
%8 = or i32 %4, %7
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int f(int);
int main() {
  int a = f(10);
  assert(a == 3628800);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0xa,%edi
call   1030 <f@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x375f00,-0x8(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0xa,%edi
call   1030 <f@plt>
xor    %edi,%edi
cmp    $0x375f00,%eax
sete   %dil
call   1040 <assert@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @f(i32 10)
store i32 %3, i32* %2
%4 = load i32, i32* %2
%5 = icmp eq i32 %4, 3628800
%6 = zext i1 %5 to i32
%7 = call i32 @assert(i32 %6)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @f(i32 10)
%2 = icmp eq i32 %1, 3628800
%3 = zext i1 %2 to i32
%4 = tail call i32 @assert(i32 %3)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ UPnPResponse_AVTransport_Seek(void *);
int /*<<< orphan*/ printf(char *, unsigned int, char *, char *);
void UPnPAVTransport_Seek(void *upnptoken, unsigned int InstanceID, char *Unit,
                          char *Target) {
  printf("Invoke: UPnPAVTransport_Seek(%u,%s,%s);\r\n", InstanceID, Unit,
         Target);
  UPnPResponse_AVTransport_Seek(upnptoken);
}


x86 assembly (clang, -O0):
<UPnPAVTransport_Seek>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
lea    0xeb7(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rdi
call   1040 <UPnPResponse_AVTransport_Seek@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<UPnPAVTransport_Seek>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <UPnPResponse_AVTransport_Seek@plt>

LLVM IR (-O0):
@.str = [42 x i8] c"Invoke: UPnPAVTransport_Seek(%u,%s,%s);\0D\0A\00"
define void @UPnPAVTransport_Seek(i8* %0, i32 %1, i8* %2, i8* %3) {
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i8*
store i8* %0, i8** %5
store i32 %1, i32* %6
store i8* %2, i8** %7
store i8* %3, i8** %8
%9 = load i32, i32* %6
%10 = load i8*, i8** %7
%11 = load i8*, i8** %8
%12 = call i32 @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0), i32 %9, i8* %10, i8* %11)
%13 = load i8*, i8** %5
%14 = call i32 @UPnPResponse_AVTransport_Seek(i8* %13)
ret void
}

LLVM IR (-O2):
@.str = [42 x i8] c"Invoke: UPnPAVTransport_Seek(%u,%s,%s);\0D\0A\00"
define void @UPnPAVTransport_Seek(i8* %0, i32 %1, i8* %2, i8* %3) {
%5 = tail call i32 @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0), i32 %1, i8* %2, i8* %3)
%6 = tail call i32 @UPnPResponse_AVTransport_Seek(i8* %0)
ret void
}
/* Variables and functions */
int LMGetHiliteMode();
int /*<<< orphan*/ LMSetHiliteMode(int);
void DoHiliteMode(void) { LMSetHiliteMode(LMGetHiliteMode() & 0x7F); }


x86 assembly (clang, -O0):
<DoHiliteMode>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <LMGetHiliteMode@plt>
mov    %eax,%edi
and    $0x7f,%edi
call   1040 <LMSetHiliteMode@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<DoHiliteMode>:
push   %rax
xor    %eax,%eax
call   1030 <LMGetHiliteMode@plt>
and    $0x7f,%eax
mov    %eax,%edi
pop    %rax
jmp    1040 <LMSetHiliteMode@plt>

LLVM IR (-O0):
define void @DoHiliteMode() {
%1 = call i32 (...) @LMGetHiliteMode()
%2 = and i32 %1, 127
%3 = call i32 @LMSetHiliteMode(i32 %2)
ret void
}

LLVM IR (-O2):
define void @DoHiliteMode() {
%1 = tail call i32 (...) @LMGetHiliteMode()
%2 = and i32 %1, 127
%3 = tail call i32 @LMSetHiliteMode(i32 %2)
ret void
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
uint8_t triwave8(uint8_t in) {
  if (in & 0x80) {
    in = 255 - in;
  }
  uint8_t out = in << 1;
  return out;
}


x86 assembly (clang, -O0):
<triwave8>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x80,%eax
cmp    $0x0,%eax
je     1123 <triwave8+0x23>
mov    $0xff,%eax
sub    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<triwave8>:
mov    $0xff,%eax
sub    %edi,%eax
test   $0x80,%dil
cmove  %edi,%eax
add    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @triwave8(i32 %0) {
%2 = and i32 %0, 128
%3 = icmp eq i32 %2, 0
%4 = sub nsw i32 255, %0
%5 = select i1 %3, i32 %0, i32 %4
%6 = shl i32 %5, 1
ret i32 %6
}
int is_blank(char c) { return (c == ' ' || c == '\t'); }


x86 assembly (clang, -O0):
<is_blank>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x20,%ecx
mov    %al,-0x2(%rbp)
je     1129 <is_blank+0x29>
movsbl -0x1(%rbp),%eax
cmp    $0x9,%eax
sete   %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_blank>:
cmp    $0x20,%dil
sete   %al
cmp    $0x9,%dil
sete   %cl
or     %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @is_blank(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp eq i32 %4, 32
br i1 %5, label %10, label %6
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp eq i32 %8, 9
br label %10
10: ; preds = %6, %1
%11 = phi i1 [ true, %1 ], [ %9, %6 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @is_blank(i8 signext %0) {
%2 = icmp eq i8 %0, 32
%3 = icmp eq i8 %0, 9
%4 = or i1 %2, %3
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ swap(int *, int *);
int /*<<< orphan*/ write(int);
void main() {
  int a = 5;
  int b = 10;
  swap(&a, &b);
  write(a);
  write(b);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x5,-0x4(%rbp)
movl   $0xa,-0x8(%rbp)
lea    -0x4(%rbp),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <swap@plt>
mov    -0x4(%rbp),%edi
call   1030 <write@plt>
mov    -0x8(%rbp),%edi
call   1030 <write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0x5,0x4(%rsp)
movl   $0xa,(%rsp)
lea    0x4(%rsp),%rdi
mov    %rsp,%rsi
call   1040 <swap@plt>
mov    0x4(%rsp),%edi
call   1030 <write@plt>
mov    (%rsp),%edi
call   1030 <write@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @main() {
%1 = alloca i32
%2 = alloca i32
store i32 5, i32* %1
store i32 10, i32* %2
%3 = call i32 @swap(i32* %1, i32* %2)
%4 = load i32, i32* %1
%5 = call i32 @write(i32 %4)
%6 = load i32, i32* %2
%7 = call i32 @write(i32 %6)
ret void
}

LLVM IR (-O2):
define void @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
store i32 5, i32* %1
%4 = bitcast i32* %2 to i8*
store i32 10, i32* %2
%5 = call i32 @swap(i32* %1, i32* %2)
%6 = load i32, i32* %1
%7 = call i32 @write(i32 %6)
%8 = load i32, i32* %2
%9 = call i32 @write(i32 %8)
ret void
}
/* Variables and functions */
int createSemAux(int);
int getSemId() { return createSemAux(-1); }


x86 assembly (clang, -O0):
<getSemId>:
push   %rbp
mov    %rsp,%rbp
mov    $0xffffffff,%edi
call   1030 <createSemAux@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<getSemId>:
mov    $0xffffffff,%edi
jmp    1030 <createSemAux@plt>

LLVM IR (-O0):
define i32 @getSemId() {
%1 = call i32 @createSemAux(i32 -1)
ret i32 %1
}

LLVM IR (-O2):
define i32 @getSemId() {
%1 = tail call i32 @createSemAux(i32 -1)
ret i32 %1
}
/* Variables and functions */
long double f3_add(long double, long double, int /*<<< orphan*/);
long double __addtf3(long double a, long double b) { return f3_add(a, b, 0); }


x86 assembly (clang, -O0):
<__addtf3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
fldt   0x20(%rbp)
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fstpt  -0x20(%rbp)
fldt   -0x10(%rbp)
fldt   -0x20(%rbp)
mov    %rsp,%rax
fstpt  0x10(%rax)
fstpt  (%rax)
xor    %edi,%edi
call   1030 <f3_add@plt>
fld    %st(0)
fstp   %st(0)
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__addtf3>:
xor    %edi,%edi
jmp    1030 <f3_add@plt>

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

LLVM IR (-O2):
define x86_fp80 @__addtf3(x86_fp80 %0, x86_fp80 %1) {
%3 = tail call x86_fp80 @f3_add(x86_fp80 %0, x86_fp80 %1, i32 0)
ret x86_fp80 %3
}
void rop3_130_1_0(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  stk2 = T ^ S;
  stk2 = ~stk2;
  stk1 = *D & stk2;
  *D = (stk1 & (~S)) | (*D & S);
}


x86 assembly (clang, -O0):
<rop3_130_1_0>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
movzbl -0xa(%rbp),%eax
movzbl -0x9(%rbp),%ecx
xor    %ecx,%eax
mov    %al,-0xc(%rbp)
movzbl -0xc(%rbp),%eax
xor    $0xffffffff,%eax
mov    %al,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
movzbl -0xc(%rbp),%ecx
and    %ecx,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
movzbl -0x9(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
movzbl -0x9(%rbp),%edx
and    %edx,%ecx
or     %ecx,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rop3_130_1_0>:
not    %dl
or     %sil,%dl
and    %dl,(%rdi)
ret

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

LLVM IR (-O2):
define void @rop3_130_1_0(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = load i8, i8* %0
%5 = xor i8 %2, -1
%6 = or i8 %5, %1
%7 = and i8 %4, %6
store i8 %7, i8* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ host_send(unsigned char *, int);
int mcu_snprintf(char *, int, char *, unsigned long);
int user_util_send_time(unsigned long time) {
  char buf[64];
  int len;
  len = mcu_snprintf(buf, 64, "time = %d\n", time);
  host_send((unsigned char *)buf, len);
  return 0;
}


x86 assembly (clang, -O0):
<user_util_send_time>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x50(%rbp),%rdi
mov    -0x8(%rbp),%rcx
mov    $0x40,%esi
lea    0xec0(%rip),%rdx
call   1040 <mcu_snprintf@plt>
mov    %eax,-0x54(%rbp)
lea    -0x50(%rbp),%rdi
mov    -0x54(%rbp),%esi
call   1030 <host_send@plt>
xor    %eax,%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<user_util_send_time>:
push   %rbx
sub    $0x40,%rsp
mov    %rdi,%rcx
lea    0xed1(%rip),%rdx
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x40,%esi
call   1040 <mcu_snprintf@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <host_send@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [11 x i8] c"time = %d\0A\00"
define i32 @user_util_send_time(i64 %0) {
%2 = alloca i64
%3 = alloca [64 x i8]
%4 = alloca i32
store i64 %0, i64* %2
%5 = getelementptr inbounds [64 x i8], [64 x i8]* %3, i64 0, i64 0
%6 = load i64, i64* %2
%7 = call i32 @mcu_snprintf(i8* %5, i32 64, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i64 %6)
store i32 %7, i32* %4
%8 = getelementptr inbounds [64 x i8], [64 x i8]* %3, i64 0, i64 0
%9 = load i32, i32* %4
%10 = call i32 @host_send(i8* %8, i32 %9)
ret i32 0
}

LLVM IR (-O2):
@.str = [11 x i8] c"time = %d\0A\00"
define i32 @user_util_send_time(i64 %0) {
%2 = alloca [64 x i8]
%3 = getelementptr inbounds [64 x i8], [64 x i8]* %2, i64 0, i64 0
%4 = call i32 @mcu_snprintf(i8* %3, i32 64, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i64 %0)
%5 = call i32 @host_send(i8* %3, i32 %4)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ delay(int);
int /*<<< orphan*/ mbus_remote_register_write(int, int, int);
void pmu_adc_reset_setting() {
  mbus_remote_register_write(0x3, 0x3C,
                             ((1 << 0) | (1 << 1) | (1 << 2) | (1 << 3) |
                              (1 << 4) | (1 << 5) | (1 << 6) | (1 << 7) |
                              (1 << 8) | (1 << 9) | (1 << 10) | (0 << 11) |
                              (0 << 12) | (0 << 13) | (1 << 14) | (1 << 15) |
                              (1 << 16) | (1 << 17) | (1 << 18) | (1 << 19)));
  delay(100);
}


x86 assembly (clang, -O0):
<pmu_adc_reset_setting>:
push   %rbp
mov    %rsp,%rbp
mov    $0x3,%edi
mov    $0x3c,%esi
mov    $0xfc7ff,%edx
call   1040 <mbus_remote_register_write@plt>
mov    $0x64,%edi
call   1030 <delay@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<pmu_adc_reset_setting>:
push   %rax
mov    $0x3,%edi
mov    $0x3c,%esi
mov    $0xfc7ff,%edx
call   1040 <mbus_remote_register_write@plt>
mov    $0x64,%edi
pop    %rax
jmp    1030 <delay@plt>

LLVM IR (-O0):
define void @pmu_adc_reset_setting() {
%1 = call i32 @mbus_remote_register_write(i32 3, i32 60, i32 1034239)
%2 = call i32 @delay(i32 100)
ret void
}

LLVM IR (-O2):
define void @pmu_adc_reset_setting() {
%1 = tail call i32 @mbus_remote_register_write(i32 3, i32 60, i32 1034239)
%2 = tail call i32 @delay(i32 100)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int revnum(unsigned int);
int /*<<< orphan*/ scanf(char *, unsigned int *);
int main() {
  unsigned n;
  printf("Enter a number:\n");
  scanf(" %u%*c", &n);
  printf("Reversed: %u\n", revnum(n));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xebd(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x8(%rbp),%edi
call   1040 <revnum@plt>
mov    %eax,%esi
lea    0xeaa(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xecd(%rip),%rdi
call   1030 <puts@plt>
lea    0xeac(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1060 <scanf@plt>
mov    0x4(%rsp),%edi
call   1050 <revnum@plt>
lea    0xe99(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [17 x i8] c"Enter a number:\0A\00"
@.str.1 = [7 x i8] c" %u%*c\00"
@.str.2 = [14 x i8] c"Reversed: %u\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%5 = load i32, i32* %2
%6 = call i32 @revnum(i32 %5)
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), i32 %6)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [7 x i8] c" %u%*c\00"
@.str.2 = [14 x i8] c"Reversed: %u\0A\00"
@str = [16 x i8] c"Enter a number:\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = call i32 @revnum(i32 %5)
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), i32 %6)
ret i32 0
}
/* Type definitions */
struct kdtree {
  int dummy;
};

/* Variables and functions */
int kd_insert(struct kdtree *, float *, void *);
int kd_insert3(struct kdtree *tree, float x, float y, float z, void *data) {
  float buf[3];
  buf[0] = x;
  buf[1] = y;
  buf[2] = z;
  return kd_insert(tree, buf, data);
}


x86 assembly (clang, -O0):
<kd_insert3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
movss  %xmm1,-0x10(%rbp)
movss  %xmm2,-0x14(%rbp)
mov    %rsi,-0x20(%rbp)
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x2c(%rbp)
movss  -0x10(%rbp),%xmm0
movss  %xmm0,-0x28(%rbp)
movss  -0x14(%rbp),%xmm0
movss  %xmm0,-0x24(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x2c(%rbp),%rsi
mov    -0x20(%rbp),%rdx
call   1030 <kd_insert@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<kd_insert3>:
sub    $0x18,%rsp
mov    %rsi,%rdx
movss  %xmm0,0xc(%rsp)
movss  %xmm1,0x10(%rsp)
movss  %xmm2,0x14(%rsp)
lea    0xc(%rsp),%rsi
call   1030 <kd_insert@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.kdtree = type { i32 }
define i32 @kd_insert3(%struct.kdtree* %0, float %1, float %2, float %3, i8* %4) {
%6 = alloca %struct.kdtree*
%7 = alloca float
%8 = alloca float
%9 = alloca float
%10 = alloca i8*
%11 = alloca [3 x float]
store %struct.kdtree* %0, %struct.kdtree** %6
store float %1, float* %7
store float %2, float* %8
store float %3, float* %9
store i8* %4, i8** %10
%12 = load float, float* %7
%13 = getelementptr inbounds [3 x float], [3 x float]* %11, i64 0, i64 0
store float %12, float* %13
%14 = load float, float* %8
%15 = getelementptr inbounds [3 x float], [3 x float]* %11, i64 0, i64 1
store float %14, float* %15
%16 = load float, float* %9
%17 = getelementptr inbounds [3 x float], [3 x float]* %11, i64 0, i64 2
store float %16, float* %17
%18 = load %struct.kdtree*, %struct.kdtree** %6
%19 = getelementptr inbounds [3 x float], [3 x float]* %11, i64 0, i64 0
%20 = load i8*, i8** %10
%21 = call i32 @kd_insert(%struct.kdtree* %18, float* %19, i8* %20)
ret i32 %21
}

LLVM IR (-O2):
%struct.kdtree = type { i32 }
define i32 @kd_insert3(%struct.kdtree* %0, float %1, float %2, float %3, i8* %4) {
%6 = alloca [3 x float]
%7 = bitcast [3 x float]* %6 to i8*
%8 = getelementptr inbounds [3 x float], [3 x float]* %6, i64 0, i64 0
store float %1, float* %8
%9 = getelementptr inbounds [3 x float], [3 x float]* %6, i64 0, i64 1
store float %2, float* %9
%10 = getelementptr inbounds [3 x float], [3 x float]* %6, i64 0, i64 2
store float %3, float* %10
%11 = call i32 @kd_insert(%struct.kdtree* %0, float* %8, i8* %4)
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ free(char *);
scalar_t__ malloc(int);
int main() {
  char *s = (char *)malloc(4);
  s[-1] = 'A';
  free(s);
  exit(0);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x4,%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movb   $0x41,-0x1(%rax)
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x4,%edi
call   1040 <malloc@plt>
movb   $0x41,-0x1(%rax)
mov    %rax,%rdi
call   1030 <free@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
store i32 0, i32* %1
%3 = call i64 @malloc(i32 4)
%4 = inttoptr i64 %3 to i8*
store i8* %4, i8** %2
%5 = load i8*, i8** %2
%6 = getelementptr inbounds i8, i8* %5, i64 -1
store i8 65, i8* %6
%7 = load i8*, i8** %2
%8 = call i32 @free(i8* %7)
%9 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i64 @malloc(i32 4)
%2 = inttoptr i64 %1 to i8*
%3 = getelementptr inbounds i8, i8* %2, i64 -1
store i8 65, i8* %3
%4 = tail call i32 @free(i8* %2)
%5 = tail call i32 @exit(i32 0)
unreachable
}
int big_endian(void) {
  long val = 1;
  return !(*((char *)(&val)));
}


x86 assembly (clang, -O0):
<big_endian>:
push   %rbp
mov    %rsp,%rbp
movq   $0x1,-0x8(%rbp)
cmpb   $0x0,-0x8(%rbp)
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @big_endian() {
%1 = alloca i64
store i64 1, i64* %1
%2 = bitcast i64* %1 to i8*
%3 = load i8, i8* %2
%4 = icmp ne i8 %3, 0
%5 = xor i1 %4, true
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @big_endian() {
ret i32 0
}
int test_divide_power2(int x, int k) {
  int p2k = 1 << k;
  return x / p2k;
}


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

x86 assembly (clang, -O2):
<test_divide_power2>:
mov    %esi,%ecx
mov    $0x1,%esi
shl    %cl,%esi
mov    %edi,%eax
cltd
idiv   %esi
ret

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

LLVM IR (-O2):
define i32 @test_divide_power2(i32 %0, i32 %1) {
%3 = shl nuw i32 1, %1
%4 = sdiv i32 %0, %3
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ strncpy(char *, char const *, size_t);
void uninitvar_strncpy(char *dest, const char *src, size_t num) {
  char *d;
  char *s;
  size_t n;
  (void)strncpy(d, src, num);
  (void)strncpy(dest, s, num);
  (void)strncpy(dest, src, n);
  (void)strncpy(dest, src, num);
}


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

x86 assembly (clang, -O2):
<uninitvar_strncpy>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%rbx
call   1030 <strncpy@plt>
mov    %rbx,%rdi
mov    %r14,%rdx
call   1030 <strncpy@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
call   1030 <strncpy@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
mov    %r14,%rdx
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <strncpy@plt>

LLVM IR (-O0):
define void @uninitvar_strncpy(i8* %0, i8* %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i64
store i8* %0, i8** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%10 = load i8*, i8** %7
%11 = load i8*, i8** %5
%12 = load i64, i64* %6
%13 = call i32 @strncpy(i8* %10, i8* %11, i64 %12)
%14 = load i8*, i8** %4
%15 = load i8*, i8** %8
%16 = load i64, i64* %6
%17 = call i32 @strncpy(i8* %14, i8* %15, i64 %16)
%18 = load i8*, i8** %4
%19 = load i8*, i8** %5
%20 = load i64, i64* %9
%21 = call i32 @strncpy(i8* %18, i8* %19, i64 %20)
%22 = load i8*, i8** %4
%23 = load i8*, i8** %5
%24 = load i64, i64* %6
%25 = call i32 @strncpy(i8* %22, i8* %23, i64 %24)
ret void
}

LLVM IR (-O2):
define void @uninitvar_strncpy(i8* %0, i8* %1, i64 %2) {
%4 = tail call i32 @strncpy(i8* undef, i8* %1, i64 %2)
%5 = tail call i32 @strncpy(i8* %0, i8* undef, i64 %2)
%6 = tail call i32 @strncpy(i8* %0, i8* %1, i64 undef)
%7 = tail call i32 @strncpy(i8* %0, i8* %1, i64 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void __newline() { printf("\n"); }


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

x86 assembly (clang, -O2):
<__newline>:
mov    $0xa,%edi
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
define void @__newline() {
%1 = tail call i32 @putchar(i32 10)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _SC_NPROCESSORS_ONLN;
int sysconf(int /*<<< orphan*/);
int get_num_cores() { return sysconf(_SC_NPROCESSORS_ONLN); }


x86 assembly (clang, -O0):
<get_num_cores>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ecd(%rip),%rax
mov    (%rax),%edi
call   1030 <sysconf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_num_cores>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%edi
jmp    1030 <sysconf@plt>

LLVM IR (-O0):
@_SC_NPROCESSORS_ONLN = global i32 0
define i32 @get_num_cores() {
%1 = load i32, i32* @_SC_NPROCESSORS_ONLN
%2 = call i32 @sysconf(i32 %1)
ret i32 %2
}

LLVM IR (-O2):
@_SC_NPROCESSORS_ONLN = global i32 0
define i32 @get_num_cores() {
%1 = load i32, i32* @_SC_NPROCESSORS_ONLN
%2 = tail call i32 @sysconf(i32 %1)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ init_slibu();
int /*<<< orphan*/ init_storage();
int /*<<< orphan*/ init_subrs();
int /*<<< orphan*/ init_trace();
int /*<<< orphan*/ process_cla(int, char **, int /*<<< orphan*/);
void siod_init(int argc, char **argv) {
  process_cla(argc, argv, 0);
  init_storage();
  init_subrs();
  init_trace();
  init_slibu();
}


x86 assembly (clang, -O0):
<siod_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
xor    %edx,%edx
call   1040 <process_cla@plt>
mov    $0x0,%al
call   1030 <init_storage@plt>
mov    $0x0,%al
call   1050 <init_subrs@plt>
mov    $0x0,%al
call   1070 <init_trace@plt>
mov    $0x0,%al
call   1060 <init_slibu@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<siod_init>:
push   %rax
xor    %edx,%edx
call   1040 <process_cla@plt>
xor    %eax,%eax
call   1030 <init_storage@plt>
xor    %eax,%eax
call   1050 <init_subrs@plt>
xor    %eax,%eax
call   1070 <init_trace@plt>
xor    %eax,%eax
pop    %rcx
jmp    1060 <init_slibu@plt>

LLVM IR (-O0):
define void @siod_init(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = load i32, i32* %3
%6 = load i8**, i8*** %4
%7 = call i32 @process_cla(i32 %5, i8** %6, i32 0)
%8 = call i32 (...) @init_storage()
%9 = call i32 (...) @init_subrs()
%10 = call i32 (...) @init_trace()
%11 = call i32 (...) @init_slibu()
ret void
}

LLVM IR (-O2):
define void @siod_init(i32 %0, i8** %1) {
%3 = tail call i32 @process_cla(i32 %0, i8** %1, i32 0)
%4 = tail call i32 (...) @init_storage()
%5 = tail call i32 (...) @init_subrs()
%6 = tail call i32 (...) @init_trace()
%7 = tail call i32 (...) @init_slibu()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ uart_print_hex(unsigned int);
int /*<<< orphan*/ uart_printf(char *);
int /*<<< orphan*/ uart_puts(char *);
void show_content(unsigned int r0, unsigned int r1) {
  uart_puts("\nswi caller:");
  uart_printf("r0 = ");
  uart_print_hex(r0);
  uart_printf(", r1 = ");
  uart_print_hex(r1);
  uart_puts("");
  return;
}


x86 assembly (clang, -O0):
<show_content>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
lea    0xebb(%rip),%rdi
call   1050 <uart_puts@plt>
lea    0xebc(%rip),%rdi
call   1030 <uart_printf@plt>
mov    -0x4(%rbp),%edi
call   1040 <uart_print_hex@plt>
lea    0xeae(%rip),%rdi
call   1030 <uart_printf@plt>
mov    -0x8(%rbp),%edi
call   1040 <uart_print_hex@plt>
lea    0xe99(%rip),%rdi
call   1050 <uart_puts@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<show_content>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
lea    0xec2(%rip),%rdi
call   1050 <uart_puts@plt>
lea    0xec3(%rip),%rdi
call   1030 <uart_printf@plt>
mov    %ebp,%edi
call   1040 <uart_print_hex@plt>
lea    0xeb6(%rip),%rdi
call   1030 <uart_printf@plt>
mov    %ebx,%edi
call   1040 <uart_print_hex@plt>
lea    0xea2(%rip),%rdi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1050 <uart_puts@plt>

LLVM IR (-O0):
@.str = [13 x i8] c"\0Aswi caller:\00"
@.str.1 = [6 x i8] c"r0 = \00"
@.str.2 = [8 x i8] c", r1 = \00"
@.str.3 = [1 x i8] zeroinitializer
define void @show_content(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = call i32 @uart_puts(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @uart_printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%7 = load i32, i32* %3
%8 = call i32 @uart_print_hex(i32 %7)
%9 = call i32 @uart_printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0))
%10 = load i32, i32* %4
%11 = call i32 @uart_print_hex(i32 %10)
%12 = call i32 @uart_puts(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c"\0Aswi caller:\00"
@.str.1 = [6 x i8] c"r0 = \00"
@.str.2 = [8 x i8] c", r1 = \00"
@.str.3 = [1 x i8] zeroinitializer
define void @show_content(i32 %0, i32 %1) {
%3 = tail call i32 @uart_puts(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @uart_printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%5 = tail call i32 @uart_print_hex(i32 %0)
%6 = tail call i32 @uart_printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0))
%7 = tail call i32 @uart_print_hex(i32 %1)
%8 = tail call i32 @uart_puts(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.3, i64 0, i64 0))
ret void
}
/* Type definitions */
struct timeval {
  long long tv_sec;
  long long tv_usec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, long long);
int main(int argc, char **argv) {
  struct timeval time_struct;
  gettimeofday(&time_struct, 0);
  printf("%lld",
         (time_struct.tv_sec * 1000ll) + (time_struct.tv_usec / 1000ll));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x20(%rbp),%rdi
xor    %esi,%esi
call   1040 <gettimeofday@plt>
imul   $0x3e8,-0x20(%rbp),%rsi
mov    -0x18(%rbp),%rax
mov    $0x3e8,%ecx
cqto
idiv   %rcx
add    %rax,%rsi
lea    0xe9f(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1040 <gettimeofday@plt>
imul   $0x3e8,0x8(%rsp),%rcx
movabs $0x20c49ba5e353f7cf,%rax
9b c4 20
imulq  0x10(%rsp)
mov    %rdx,%rsi
shr    $0x3f,%rsi
sar    $0x7,%rdx
add    %rdx,%rsi
add    %rcx,%rsi
lea    0xea0(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timeval = type { i64, i64 }
@.str = [5 x i8] c"%lld\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca %struct.timeval
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = call i32 @gettimeofday(%struct.timeval* %6, i32 0)
%8 = getelementptr inbounds %struct.timeval, %struct.timeval* %6, i32 0, i32 0
%9 = load i64, i64* %8
%10 = mul nsw i64 %9, 1000
%11 = getelementptr inbounds %struct.timeval, %struct.timeval* %6, i32 0, i32 1
%12 = load i64, i64* %11
%13 = sdiv i64 %12, 1000
%14 = add nsw i64 %10, %13
%15 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64 %14)
ret i32 0
}

LLVM IR (-O2):
%struct.timeval = type { i64, i64 }
@.str = [5 x i8] c"%lld\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca %struct.timeval
%4 = bitcast %struct.timeval* %3 to i8*
%5 = call i32 @gettimeofday(%struct.timeval* %3, i32 0)
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %3, i64 0, i32 0
%7 = load i64, i64* %6
%8 = mul nsw i64 %7, 1000
%9 = getelementptr inbounds %struct.timeval, %struct.timeval* %3, i64 0, i32 1
%10 = load i64, i64* %9
%11 = sdiv i64 %10, 1000
%12 = add nsw i64 %11, %8
%13 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64 %12)
ret i32 0
}
void atomic_add(volatile unsigned long long *value, long long i) {
  *value += i;
}


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

x86 assembly (clang, -O2):
<atomic_add>:
add    %rsi,(%rdi)
ret

LLVM IR (-O0):
define void @atomic_add(i64* %0, i64 %1) {
%3 = alloca i64*
%4 = alloca i64
store i64* %0, i64** %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = load i64*, i64** %3
%7 = load volatile i64, i64* %6
%8 = add i64 %7, %5
store volatile i64 %8, i64* %6
ret void
}

LLVM IR (-O2):
define void @atomic_add(i64* %0, i64 %1) {
%3 = load volatile i64, i64* %0
%4 = add i64 %3, %1
store volatile i64 %4, i64* %0
ret void
}
/* Variables and functions */
char const *coex_version_get();
const char *esp_coex_version_get(void) { return coex_version_get(); }


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

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

LLVM IR (-O0):
define i8* @esp_coex_version_get() {
%1 = call i8* (...) @coex_version_get()
ret i8* %1
}

LLVM IR (-O2):
define i8* @esp_coex_version_get() {
%1 = tail call i8* (...) @coex_version_get()
ret i8* %1
}
/* Variables and functions */
int hello_run(int, char const **);
int main(int argc, char const *argv[]) { return hello_run(argc, argv); }


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

x86 assembly (clang, -O2):
<main>:
jmp    1030 <hello_run@plt>

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @hello_run(i32 %0, i8** %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ default_isr();
__attribute__((weak)) void SRC_OUT_Handler() { default_isr(); }


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

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

LLVM IR (-O0):
define weak void @SRC_OUT_Handler() {
%1 = call i32 (...) @default_isr()
ret void
}

LLVM IR (-O2):
define weak void @SRC_OUT_Handler() {
%1 = tail call i32 (...) @default_isr()
ret void
}
int main(void) {
  int a = 2;
  int b = 4;
  return (a * b);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x2,-0x8(%rbp)
movl   $0x4,-0xc(%rbp)
mov    -0x8(%rbp),%eax
imul   -0xc(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 8
}
/* Type definitions */
struct lobject {
  int dummy;
};
struct lemon {
  int dummy;
};

/* Variables and functions */
struct lobject *lobject_error_runtime(struct lemon *, char *);
struct lobject *machine_throw(struct lemon *, struct lobject *);
struct lobject *machine_stack_underflow(struct lemon *lemon) {
  struct lobject *error;
  error = lobject_error_runtime(lemon, "stack underflow");
  return machine_throw(lemon, error);
}


x86 assembly (clang, -O0):
<machine_stack_underflow>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xec9(%rip),%rsi
call   1040 <lobject_error_runtime@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <machine_throw@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<machine_stack_underflow>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rsi
call   1040 <lobject_error_runtime@plt>
mov    %rbx,%rdi
mov    %rax,%rsi
pop    %rbx
jmp    1030 <machine_throw@plt>

LLVM IR (-O0):
%struct.lobject = type { i32 }
%struct.lemon = type { i32 }
@.str = [16 x i8] c"stack underflow\00"
define %struct.lobject* @machine_stack_underflow(%struct.lemon* %0) {
%2 = alloca %struct.lemon*
%3 = alloca %struct.lobject*
store %struct.lemon* %0, %struct.lemon** %2
%4 = load %struct.lemon*, %struct.lemon** %2
%5 = call %struct.lobject* @lobject_error_runtime(%struct.lemon* %4, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
store %struct.lobject* %5, %struct.lobject** %3
%6 = load %struct.lemon*, %struct.lemon** %2
%7 = load %struct.lobject*, %struct.lobject** %3
%8 = call %struct.lobject* @machine_throw(%struct.lemon* %6, %struct.lobject* %7)
ret %struct.lobject* %8
}

LLVM IR (-O2):
%struct.lobject = type { i32 }
%struct.lemon = type { i32 }
@.str = [16 x i8] c"stack underflow\00"
define %struct.lobject* @machine_stack_underflow(%struct.lemon* %0) {
%2 = tail call %struct.lobject* @lobject_error_runtime(%struct.lemon* %0, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%3 = tail call %struct.lobject* @machine_throw(%struct.lemon* %0, %struct.lobject* %2)
ret %struct.lobject* %3
}
int perm2int(int val) {
  int i = 1;
  int v = 0;
  while (val) {
    v = v + (val & 7) * i;
    val >>= 3;
    i *= 10;
  }
  return v;
}


x86 assembly (clang, -O0):
<perm2int>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1146 <perm2int+0x46>
mov    -0xc(%rbp),%eax
mov    -0x4(%rbp),%ecx
and    $0x7,%ecx
imul   -0x8(%rbp),%ecx
add    %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x3,%eax
mov    %eax,-0x4(%rbp)
imul   $0xa,-0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    1115 <perm2int+0x15>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<perm2int>:
test   %edi,%edi
je     112a <perm2int+0x2a>
mov    $0x1,%ecx
xor    %eax,%eax
mov    %edi,%edx
nopl   (%rax)
mov    %edi,%esi
and    $0x7,%esi
imul   %ecx,%esi
add    %esi,%eax
sar    $0x3,%edx
add    %ecx,%ecx
lea    (%rcx,%rcx,4),%ecx
cmp    $0x7,%edi
mov    %edx,%edi
ja     1110 <perm2int+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @perm2int(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %13, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %9, %3 ], [ 0, %1 ]
%5 = phi i32 [ %11, %3 ], [ 1, %1 ]
%6 = phi i32 [ %10, %3 ], [ %0, %1 ]
%7 = and i32 %6, 7
%8 = mul nsw i32 %7, %5
%9 = add nuw nsw i32 %4, %8
%10 = ashr i32 %6, 3
%11 = mul nsw i32 %5, 10
%12 = icmp ult i32 %6, 8
br i1 %12, label %13, label %3
13: ; preds = %3, %1
%14 = phi i32 [ 0, %1 ], [ %9, %3 ]
ret i32 %14
}
/* Variables and functions */
unsigned char *hmac_md5(unsigned char *, unsigned char const *, size_t,
                        unsigned char const *, size_t);
unsigned char *mac_hmac_md5(unsigned char *out, const unsigned char *key,
                            size_t key_len, const unsigned char *msg,
                            size_t msg_len) {
  return hmac_md5(out, key, key_len, msg, msg_len);
}


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

x86 assembly (clang, -O2):
<mac_hmac_md5>:
jmp    1030 <hmac_md5@plt>

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

LLVM IR (-O2):
define i8* @mac_hmac_md5(i8* %0, i8* %1, i64 %2, i8* %3, i64 %4) {
%6 = tail call i8* @hmac_md5(i8* %0, i8* %1, i64 %2, i8* %3, i64 %4)
ret i8* %6
}
/* Variables and functions */
int /*<<< orphan*/ LZ4HC_Init(void *, void const *);
void LZ4_contextHC_init(void *ctx, const void *base) { LZ4HC_Init(ctx, base); }


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

x86 assembly (clang, -O2):
<LZ4_contextHC_init>:
jmp    1030 <LZ4HC_Init@plt>

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

LLVM IR (-O2):
define void @LZ4_contextHC_init(i8* %0, i8* %1) {
%3 = tail call i32 @LZ4HC_Init(i8* %0, i8* %1)
ret void
}
/* Type definitions */
typedef scalar_t__ __m256;

/* Variables and functions */
__m256 _avx_add(__m256 a, __m256 b) { return a + b; }


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

x86 assembly (clang, -O2):
<_avx_add>:
lea    (%rdi,%rsi,1),%rax
ret

LLVM IR (-O0):
define i64 @_avx_add(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = load i64, i64* %4
%7 = add nsw i64 %5, %6
ret i64 %7
}

LLVM IR (-O2):
define i64 @_avx_add(i64 %0, i64 %1) {
%3 = add nsw i64 %1, %0
ret i64 %3
}
int dlclose(void *handle) {
  printf("%s:%s:%i: "
         "handle=%p\n",
         "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
         "2022-01-22/02-19-57/repos/8l/kitten/refs/heads/master/user/runtime/"
         "pct/dl.c",
         __FUNCTION__, 30, handle);
  return -1;
}


x86 assembly (clang, -O0):
<dlclose>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%r8
lea    0xed9(%rip),%rdi
lea    0xee7(%rip),%rsi
lea    0xf6c(%rip),%rdx
mov    $0x1e,%ecx
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0xffffffff,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dlclose>:
push   %rax
mov    %rdi,%r8
lea    0xee5(%rip),%rdi
lea    0xef3(%rip),%rsi
lea    0xf78(%rip),%rdx
mov    $0x1e,%ecx
xor    %eax,%eax
call   1030 <printf@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [21 x i8] c"%s:%s:%i: handle=%p\0A\00"
@.str.1 = [140 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/8l/kitten/refs/heads/master/user/runtime/pct/dl.c\00"
@__FUNCTION__.dlclose = [8 x i8] c"dlclose\00"
define i32 @dlclose(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([140 x i8], [140 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @__FUNCTION__.dlclose, i64 0, i64 0), i32 30, i8* %3)
ret i32 -1
}

LLVM IR (-O2):
@.str = [21 x i8] c"%s:%s:%i: handle=%p\0A\00"
@.str.1 = [140 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/8l/kitten/refs/heads/master/user/runtime/pct/dl.c\00"
@__FUNCTION__.dlclose = [8 x i8] c"dlclose\00"
define i32 @dlclose(i8* %0) {
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([140 x i8], [140 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @__FUNCTION__.dlclose, i64 0, i64 0), i32 30, i8* %0)
ret i32 -1
}
void BN_GF2m_mod_sqr_arr(void) {}


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

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

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

LLVM IR (-O2):
define void @BN_GF2m_mod_sqr_arr() {
ret void
}
void call_tcb_cb(void (*cb)()) { cb(); }


x86 assembly (clang, -O0):
<call_tcb_cb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   *-0x8(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<call_tcb_cb>:
xor    %eax,%eax
jmp    *%rdi

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

LLVM IR (-O2):
define void @call_tcb_cb(void (...)* nocapture %0) {
tail call void (...) %0()
ret void
}