xunge/DecIR huggingface dataset:
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ count;
};
typedef TYPE_1__ XMappingEvent;

/* Variables and functions */
int get_XMappingEvent_count(void *_p) {
  return (int)((XMappingEvent *)_p)->count;
}


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

x86 assembly (clang, -O2):
<get_XMappingEvent_count>:
mov    (%rdi),%eax
ret

LLVM IR (-O0):
%struct.TYPE_2__ = type { i64 }
define i32 @get_XMappingEvent_count(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.TYPE_2__*
%5 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %4, i32 0, i32 0
%6 = load i64, i64* %5
%7 = trunc i64 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @get_XMappingEvent_count(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
ret i32 %4
}
void test_no_crash_on_pointer_to_label() {
  char *a = &&label;
  a[0] = 0;
label:;
}


x86 assembly (clang, -O0):
<test_no_crash_on_pointer_to_label>:
push   %rbp
mov    %rsp,%rbp
lea    0xb(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movb   $0x0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_no_crash_on_pointer_to_label>:
movb   $0x0,0x0(%rip)
ret

LLVM IR (-O0):
define void @test_no_crash_on_pointer_to_label() {
%1 = alloca i8*
store i8* blockaddress(@test_no_crash_on_pointer_to_label, %4), i8** %1
%2 = load i8*, i8** %1
%3 = getelementptr inbounds i8, i8* %2, i64 0
store i8 0, i8* %3
br label %4
4: ; preds = %0, %5
ret void
5: ; No predecessors!
indirectbr i8* undef, [label %4]
}

LLVM IR (-O2):
define void @test_no_crash_on_pointer_to_label() {
store i8 0, i8* blockaddress(@test_no_crash_on_pointer_to_label, %1)
br label %1
1: ; preds = %0
ret void
}
int fun897() { return 897; }


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

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

LLVM IR (-O0):
define i32 @fun897() {
ret i32 897
}

LLVM IR (-O2):
define i32 @fun897() {
ret i32 897
}
int in_range(int x, int lo, int hi) { return (lo <= x) && (x <= hi); }


x86 assembly (clang, -O0):
<in_range>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x8(%rbp),%ecx
xor    %eax,%eax
cmp    -0x4(%rbp),%ecx
mov    %al,-0xd(%rbp)
jg     112a <in_range+0x2a>
mov    -0x4(%rbp),%eax
cmp    -0xc(%rbp),%eax
setle  %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<in_range>:
cmp    %edi,%esi
setle  %al
cmp    %edx,%edi
setle  %cl
and    %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @in_range(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %5
%8 = load i32, i32* %4
%9 = icmp sle i32 %7, %8
br i1 %9, label %10, label %14
10: ; preds = %3
%11 = load i32, i32* %4
%12 = load i32, i32* %6
%13 = icmp sle i32 %11, %12
br label %14
14: ; preds = %10, %3
%15 = phi i1 [ false, %3 ], [ %13, %10 ]
%16 = zext i1 %15 to i32
ret i32 %16
}

LLVM IR (-O2):
define i32 @in_range(i32 %0, i32 %1, i32 %2) {
%4 = icmp sle i32 %1, %0
%5 = icmp sle i32 %0, %2
%6 = and i1 %4, %5
%7 = zext i1 %6 to i32
ret i32 %7
}
int lt_dbl(const void *a, const void *b) {
  return (*(const double *)a < *(const double *)b);
}


x86 assembly (clang, -O0):
<lt_dbl>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm1
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
ucomisd %xmm1,%xmm0
seta   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<lt_dbl>:
movsd  (%rsi),%xmm0
xor    %eax,%eax
ucomisd (%rdi),%xmm0
seta   %al
ret

LLVM IR (-O0):
define i32 @lt_dbl(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 = bitcast i8* %5 to double*
%7 = load double, double* %6
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to double*
%10 = load double, double* %9
%11 = fcmp olt double %7, %10
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @lt_dbl(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
%8 = zext i1 %7 to i32
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ arg_short3(short, short, short);
void arg_short2(short a, short b) { arg_short3(a, b, b + 1); }


x86 assembly (clang, -O0):
<arg_short2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %si,%ax
mov    %di,%cx
mov    %cx,-0x2(%rbp)
mov    %ax,-0x4(%rbp)
mov    -0x2(%rbp),%dx
mov    -0x4(%rbp),%cx
movswl -0x4(%rbp),%eax
add    $0x1,%eax
movswl %dx,%edi
movswl %cx,%esi
movswl %ax,%edx
call   1030 <arg_short3@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<arg_short2>:
lea    0x1(%rsi),%eax
movswl %ax,%edx
jmp    1030 <arg_short3@plt>

LLVM IR (-O0):
define void @arg_short2(i16 signext %0, i16 signext %1) {
%3 = alloca i16
%4 = alloca i16
store i16 %0, i16* %3
store i16 %1, i16* %4
%5 = load i16, i16* %3
%6 = load i16, i16* %4
%7 = load i16, i16* %4
%8 = sext i16 %7 to i32
%9 = add nsw i32 %8, 1
%10 = trunc i32 %9 to i16
%11 = call i32 @arg_short3(i16 signext %5, i16 signext %6, i16 signext %10)
ret void
}

LLVM IR (-O2):
define void @arg_short2(i16 signext %0, i16 signext %1) {
%3 = add i16 %1, 1
%4 = tail call i32 @arg_short3(i16 signext %0, i16 signext %1, i16 signext %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ check_write(int, unsigned char, char *);
void outb_p(unsigned char value, unsigned short int port) {
  check_write((int)port, value, "outb_p");
}


x86 assembly (clang, -O0):
<outb_p>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %si,%ax
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %ax,-0x4(%rbp)
movzwl -0x4(%rbp),%edi
lea    0xed0(%rip),%rdx
movzbl -0x1(%rbp),%esi
call   1030 <check_write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<outb_p>:
mov    %edi,%eax
lea    0xee7(%rip),%rdx
mov    %esi,%edi
mov    %eax,%esi
jmp    1030 <check_write@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"outb_p\00"
define void @outb_p(i8 zeroext %0, i16 zeroext %1) {
%3 = alloca i8
%4 = alloca i16
store i8 %0, i8* %3
store i16 %1, i16* %4
%5 = load i16, i16* %4
%6 = zext i16 %5 to i32
%7 = load i8, i8* %3
%8 = call i32 @check_write(i32 %6, i8 zeroext %7, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"outb_p\00"
define void @outb_p(i8 zeroext %0, i16 zeroext %1) {
%3 = zext i16 %1 to i32
%4 = tail call i32 @check_write(i32 %3, i8 zeroext %0, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret void
}
int jac_chain_nm7_free(void *mem) {
  (void)mem;
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @jac_chain_nm7_free(i8* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ fnoret2();
int call_noret2(void) { fnoret2(); }


x86 assembly (clang, -O0):
<call_noret2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <fnoret2@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @call_noret2() {
%1 = alloca i32
%2 = call i32 (...) @fnoret2()
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
define i32 @call_noret2() {
%1 = tail call i32 (...) @fnoret2()
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char *argv[]) {
  printf("File based capabilities are not supported\n");
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [43 x i8] c"File based capabilities are not supported\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [42 x i8] c"File based capabilities are not supported\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @str, i64 0, i64 0))
ret i32 0
}
void gtk_tree_view_column_pack_start() {}


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

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

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

LLVM IR (-O2):
define void @gtk_tree_view_column_pack_start() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ solve_lx(int, double *, double *, double *);
int /*<<< orphan*/ solve_uy(int, double *, double *, double *);
void solve(int n, double *l, double *u, double *var, double *r) {
  double r1[n];
  solve_lx(n, l, r1, r);
  solve_uy(n, u, var, r1);
}


x86 assembly (clang, -O0):
<solve>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x4(%rbp),%eax
mov    %rsp,%rcx
mov    %rcx,-0x30(%rbp)
lea    0xf(,%rax,8),%rcx
and    $0xfffffffffffffff0,%rcx
mov    %rsp,%rdx
sub    %rcx,%rdx
mov    %rdx,-0x40(%rbp)
mov    %rdx,%rsp
mov    %rax,-0x38(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x28(%rbp),%rcx
call   1030 <solve_lx@plt>
mov    -0x40(%rbp),%rcx
mov    -0x4(%rbp),%edi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
call   1040 <solve_uy@plt>
mov    -0x30(%rbp),%rax
mov    %rax,%rsp
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<solve>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %rcx,%r14
mov    %rdx,%r15
mov    %edi,%r12d
mov    %edi,%eax
mov    %rsp,%rbx
lea    0xf(,%rax,8),%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%rbx
mov    %rbx,%rsp
mov    %rbx,%rdx
mov    %r8,%rcx
call   1030 <solve_lx@plt>
mov    %r12d,%edi
mov    %r15,%rsi
mov    %r14,%rdx
mov    %rbx,%rcx
call   1040 <solve_uy@plt>
lea    -0x20(%rbp),%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @solve(i32 %0, double* %1, double* %2, double* %3, double* %4) {
%6 = alloca i32
%7 = alloca double*
%8 = alloca double*
%9 = alloca double*
%10 = alloca double*
%11 = alloca i8*
%12 = alloca i64
store i32 %0, i32* %6
store double* %1, double** %7
store double* %2, double** %8
store double* %3, double** %9
store double* %4, double** %10
%13 = load i32, i32* %6
%14 = zext i32 %13 to i64
%15 = call i8* @llvm.stacksave()
store i8* %15, i8** %11
%16 = alloca double, i64 %14
store i64 %14, i64* %12
%17 = load i32, i32* %6
%18 = load double*, double** %7
%19 = load double*, double** %10
%20 = call i32 @solve_lx(i32 %17, double* %18, double* %16, double* %19)
%21 = load i32, i32* %6
%22 = load double*, double** %8
%23 = load double*, double** %9
%24 = call i32 @solve_uy(i32 %21, double* %22, double* %23, double* %16)
%25 = load i8*, i8** %11
ret void
}

LLVM IR (-O2):
define void @solve(i32 %0, double* %1, double* %2, double* %3, double* %4) {
%6 = zext i32 %0 to i64
%7 = alloca double, i64 %6
%8 = call i32 @solve_lx(i32 %0, double* %1, double* %7, double* %4)
%9 = call i32 @solve_uy(i32 %0, double* %2, double* %3, double* %7)
ret void
}
/* Type definitions */
struct pathnode {
  int dummy;
};

/* Variables and functions */
struct pathnode *freenode(struct pathnode *);
void freepath(struct pathnode *p) {
  while ((p = freenode(p)) != NULL)
    ;
}


x86 assembly (clang, -O0):
<freepath>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <freenode@plt>
mov    %rax,-0x8(%rbp)
cmp    $0x0,%rax
je     1138 <freepath+0x28>
jmp    111c <freepath+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<freepath>:
push   %rax
mov    %rdi,%rax
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %rax,%rdi
call   1030 <freenode@plt>
test   %rax,%rax
jne    1120 <freepath+0x10>
pop    %rax
ret

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

LLVM IR (-O2):
%struct.pathnode = type { i32 }
define void @freepath(%struct.pathnode* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi %struct.pathnode* [ %0, %1 ], [ %4, %2 ]
%4 = tail call %struct.pathnode* @freenode(%struct.pathnode* %3)
%5 = icmp eq %struct.pathnode* %4, null
br i1 %5, label %6, label %2
6: ; preds = %2
ret void
}
const char *scsi_model(int device) {
  unsigned char buf[36];
  if (scsi_inquiry(device, buf) != 0)
    return strdup(("unknown"));
  else {
    return strdup(buf + 8);
  }
}


x86 assembly (clang, -O0):
<scsi_model>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0xc(%rbp)
mov    -0xc(%rbp),%edi
lea    -0x30(%rbp),%rsi
mov    $0x0,%al
call   1030 <scsi_inquiry@plt>
cmp    $0x0,%eax
je     1157 <scsi_model+0x37>
lea    0xeb7(%rip),%rdi
call   1040 <strdup@plt>
mov    %rax,-0x8(%rbp)
jmp    1168 <scsi_model+0x48>
lea    -0x30(%rbp),%rdi
add    $0x8,%rdi
call   1040 <strdup@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<scsi_model>:
sub    $0x28,%rsp
mov    %rsp,%rsi
xor    %eax,%eax
call   1030 <scsi_inquiry@plt>
test   %eax,%eax
je     113b <scsi_model+0x1b>
lea    0xec7(%rip),%rdi
jmp    1140 <scsi_model+0x20>
lea    0x8(%rsp),%rdi
call   1040 <strdup@plt>
add    $0x28,%rsp
ret

LLVM IR (-O0):
@.str = [8 x i8] c"unknown\00"
define i8* @scsi_model(i32 %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca [36 x i8]
store i32 %0, i32* %3
%5 = load i32, i32* %3
%6 = getelementptr inbounds [36 x i8], [36 x i8]* %4, i64 0, i64 0
%7 = call i32 (i32, i8*, ...) bitcast (i32 (...)* @scsi_inquiry to i32 (i32, i8*, ...)*)(i32 %5, i8* %6)
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %1
%10 = call i8* @strdup(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
store i8* %10, i8** %2
br label %15
11: ; preds = %1
%12 = getelementptr inbounds [36 x i8], [36 x i8]* %4, i64 0, i64 0
%13 = getelementptr inbounds i8, i8* %12, i64 8
%14 = call i8* @strdup(i8* %13)
store i8* %14, i8** %2
br label %15
15: ; preds = %11, %9
%16 = load i8*, i8** %2
ret i8* %16
}

LLVM IR (-O2):
@.str = [8 x i8] c"unknown\00"
define i8* @scsi_model(i32 %0) {
%2 = alloca [36 x i8]
%3 = getelementptr inbounds [36 x i8], [36 x i8]* %2, i64 0, i64 0
%4 = call i32 (i32, i8*, ...) bitcast (i32 (...)* @scsi_inquiry to i32 (i32, i8*, ...)*)(i32 %0, i8* %3)
%5 = icmp eq i32 %4, 0
br i1 %5, label %8, label %6
6: ; preds = %1
%7 = call dereferenceable_or_null(8) i8* @strdup(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
br label %11
8: ; preds = %1
%9 = getelementptr inbounds [36 x i8], [36 x i8]* %2, i64 0, i64 8
%10 = call i8* @strdup(i8* %9)
br label %11
11: ; preds = %8, %6
%12 = phi i8* [ %7, %6 ], [ %10, %8 ]
ret i8* %12
}
int before(unsigned long seq1, unsigned long seq2) {
  return (long)(seq1 - seq2) < 0;
}


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

x86 assembly (clang, -O2):
<before>:
mov    %rdi,%rax
sub    %rsi,%rax
shr    $0x3f,%rax
ret

LLVM IR (-O0):
define i32 @before(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 = sub i64 %5, %6
%8 = icmp slt i64 %7, 0
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @before(i64 %0, i64 %1) {
%3 = sub i64 %0, %1
%4 = lshr i64 %3, 63
%5 = trunc i64 %4 to i32
ret i32 %5
}
char **blkcat(up, vp)
char **up, **vp;
{
  (void)blkcpy(blkend(up), vp);
  return (up);
}


x86 assembly (clang, -O0):
<blkcat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1030 <blkend@plt>
mov    %eax,%edi
mov    -0x10(%rbp),%rsi
mov    $0x0,%al
call   1040 <blkcpy@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<blkcat>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <blkend@plt>
mov    %eax,%edi
mov    %r14,%rsi
xor    %eax,%eax
call   1040 <blkcpy@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8** @blkcat(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 = call i32 (i8**, ...) bitcast (i32 (...)* @blkend to i32 (i8**, ...)*)(i8** %5)
%7 = load i8**, i8*** %4
%8 = call i32 (i32, i8**, ...) bitcast (i32 (...)* @blkcpy to i32 (i32, i8**, ...)*)(i32 %6, i8** %7)
%9 = load i8**, i8*** %3
ret i8** %9
}

LLVM IR (-O2):
define i8** @blkcat(i8** returned %0, i8** %1) {
%3 = tail call i32 (i8**, ...) bitcast (i32 (...)* @blkend to i32 (i8**, ...)*)(i8** %0)
%4 = tail call i32 (i32, i8**, ...) bitcast (i32 (...)* @blkcpy to i32 (i32, i8**, ...)*)(i32 %3, i8** %1)
ret i8** %0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char *args[]) {
  printf("Hello, world!\n");
  printf("Hello, world!\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xed3(%rip),%rdi
call   1030 <printf@plt>
lea    0xec7(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xee8(%rip),%rbx
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [15 x i8] c"Hello, world!\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str.1 = [14 x i8] c"Hello, world!\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str.1, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str.1, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
bool nrf53_errata_13(void) { return false; }


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

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

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

LLVM IR (-O2):
define i32 @nrf53_errata_13() {
ret i32 0
}
void gpio_spdif_inactive(void) {}


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

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

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

LLVM IR (-O2):
define void @gpio_spdif_inactive() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
void help() {
  puts("Copyright (C) 2016 Michael Vietluzhskih     \nSLang (String "
       "Programming Language) \n     slang filepath [-h] \n\t     -h, --help "
       "-- show help message \n\t     filepath   -- path to the script file");
}


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

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

LLVM IR (-O0):
@.str = [191 x i8] c"Copyright (C) 2016 Michael Vietluzhskih \0ASLang (String Programming Language) \0A slang filepath [-h] \0A\09 -h, --help -- show help message \0A\09 filepath -- path to the script file\00"
define void @help() {
%1 = call i32 @puts(i8* getelementptr inbounds ([191 x i8], [191 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [191 x i8] c"Copyright (C) 2016 Michael Vietluzhskih \0ASLang (String Programming Language) \0A slang filepath [-h] \0A\09 -h, --help -- show help message \0A\09 filepath -- path to the script file\00"
define void @help() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([191 x i8], [191 x i8]* @.str, i64 0, i64 0))
ret void
}
int strstartwithignorecase(char *amin, char *b) {
  int i = 0;
  while (amin[i] != 0) {
    if (amin[i] != (b[i] | 32))
      return 0;
    i++;
  }
  return 1;
}


x86 assembly (clang, -O0):
<strstartwithignorecase>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1165 <strstartwithignorecase+0x65>
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
mov    -0x18(%rbp),%rcx
movslq -0x1c(%rbp),%rdx
movsbl (%rcx,%rdx,1),%ecx
or     $0x20,%ecx
cmp    %ecx,%eax
je     1157 <strstartwithignorecase+0x57>
movl   $0x0,-0x4(%rbp)
jmp    116c <strstartwithignorecase+0x6c>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1113 <strstartwithignorecase+0x13>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strstartwithignorecase>:
mov    (%rdi),%r8b
mov    $0x1,%eax
test   %r8b,%r8b
je     112b <strstartwithignorecase+0x2b>
xor    %edx,%edx
nop
movzbl (%rsi,%rdx,1),%ecx
or     $0x20,%cl
cmp    %cl,%r8b
jne    112c <strstartwithignorecase+0x2c>
movzbl 0x1(%rdi,%rdx,1),%r8d
add    $0x1,%rdx
test   %r8b,%r8b
jne    1110 <strstartwithignorecase+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @strstartwithignorecase(i8* nocapture %0, i8* nocapture %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %17, label %9
5: ; preds = %9
%6 = getelementptr inbounds i8, i8* %0, i64 %16
%7 = load i8, i8* %6
%8 = icmp eq i8 %7, 0
br i1 %8, label %17, label %9
9: ; preds = %2, %5
%10 = phi i64 [ %16, %5 ], [ 0, %2 ]
%11 = phi i8 [ %7, %5 ], [ %3, %2 ]
%12 = getelementptr inbounds i8, i8* %1, i64 %10
%13 = load i8, i8* %12
%14 = or i8 %13, 32
%15 = icmp eq i8 %11, %14
%16 = add nuw i64 %10, 1
br i1 %15, label %5, label %17
17: ; preds = %9, %5, %2
%18 = phi i32 [ 1, %2 ], [ 1, %5 ], [ 0, %9 ]
ret i32 %18
}
void subvv(float *result, const float *s1, const float *s2) {
  result[0] = s1[0] - s2[0];
  result[1] = s1[1] - s2[1];
  result[2] = s1[2] - s2[2];
}


x86 assembly (clang, -O0):
<subvv>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm0
mov    -0x18(%rbp),%rax
subss  (%rax),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,(%rax)
mov    -0x10(%rbp),%rax
movss  0x4(%rax),%xmm0
mov    -0x18(%rbp),%rax
subss  0x4(%rax),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0x4(%rax)
mov    -0x10(%rbp),%rax
movss  0x8(%rax),%xmm0
mov    -0x18(%rbp),%rax
subss  0x8(%rax),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0x8(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<subvv>:
movss  (%rsi),%xmm0
subss  (%rdx),%xmm0
movss  %xmm0,(%rdi)
movss  0x4(%rsi),%xmm0
subss  0x4(%rdx),%xmm0
movss  %xmm0,0x4(%rdi)
movss  0x8(%rsi),%xmm0
subss  0x8(%rdx),%xmm0
movss  %xmm0,0x8(%rdi)
ret

LLVM IR (-O0):
define void @subvv(float* %0, float* %1, float* %2) {
%4 = alloca float*
%5 = alloca float*
%6 = alloca float*
store float* %0, float** %4
store float* %1, float** %5
store float* %2, float** %6
%7 = load float*, float** %5
%8 = getelementptr inbounds float, float* %7, i64 0
%9 = load float, float* %8
%10 = load float*, float** %6
%11 = getelementptr inbounds float, float* %10, i64 0
%12 = load float, float* %11
%13 = fsub float %9, %12
%14 = load float*, float** %4
%15 = getelementptr inbounds float, float* %14, i64 0
store float %13, float* %15
%16 = load float*, float** %5
%17 = getelementptr inbounds float, float* %16, i64 1
%18 = load float, float* %17
%19 = load float*, float** %6
%20 = getelementptr inbounds float, float* %19, i64 1
%21 = load float, float* %20
%22 = fsub float %18, %21
%23 = load float*, float** %4
%24 = getelementptr inbounds float, float* %23, i64 1
store float %22, float* %24
%25 = load float*, float** %5
%26 = getelementptr inbounds float, float* %25, i64 2
%27 = load float, float* %26
%28 = load float*, float** %6
%29 = getelementptr inbounds float, float* %28, i64 2
%30 = load float, float* %29
%31 = fsub float %27, %30
%32 = load float*, float** %4
%33 = getelementptr inbounds float, float* %32, i64 2
store float %31, float* %33
ret void
}

LLVM IR (-O2):
define void @subvv(float* nocapture writeonly %0, float* nocapture %1, float* nocapture %2) {
%4 = load float, float* %1
%5 = load float, float* %2
%6 = fsub float %4, %5
store float %6, float* %0
%7 = getelementptr inbounds float, float* %1, i64 1
%8 = load float, float* %7
%9 = getelementptr inbounds float, float* %2, i64 1
%10 = load float, float* %9
%11 = fsub float %8, %10
%12 = getelementptr inbounds float, float* %0, i64 1
store float %11, float* %12
%13 = getelementptr inbounds float, float* %1, i64 2
%14 = load float, float* %13
%15 = getelementptr inbounds float, float* %2, i64 2
%16 = load float, float* %15
%17 = fsub float %14, %16
%18 = getelementptr inbounds float, float* %0, i64 2
store float %17, float* %18
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void print_perl_unsupported_msg(void) {
  fprintf(stderr, "Perl scripting not supported."
                  "  Install libperl and rebuild perf to enable it.\n"
                  "For example:\n  # apt-get install libperl-dev (ubuntu)"
                  "\n  # yum install 'perl(ExtUtils::Embed)' (Fedora)"
                  "\n  etc.\n");
}


x86 assembly (clang, -O0):
<print_perl_unsupported_msg>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_perl_unsupported_msg>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [189 x i8] c"Perl scripting not supported. Install libperl and rebuild perf to enable it.\0AFor example:\0A # apt-get install libperl-dev (ubuntu)\0A # yum install 'perl(ExtUtils::Embed)' (Fedora)\0A etc.\0A\00"
define void @print_perl_unsupported_msg() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([189 x i8], [189 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [189 x i8] c"Perl scripting not supported. Install libperl and rebuild perf to enable it.\0AFor example:\0A # apt-get install libperl-dev (ubuntu)\0A # yum install 'perl(ExtUtils::Embed)' (Fedora)\0A etc.\0A\00"
define void @print_perl_unsupported_msg() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([189 x i8], [189 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
float roundf(float);
float *vec3_round(float *result, float *a) {
  result[0] = roundf(a[0]);
  result[1] = roundf(a[1]);
  result[2] = roundf(a[2]);
  return result;
}


x86 assembly (clang, -O0):
<vec3_round>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm0
call   1030 <roundf@plt>
mov    -0x8(%rbp),%rax
movss  %xmm0,(%rax)
mov    -0x10(%rbp),%rax
movss  0x4(%rax),%xmm0
call   1030 <roundf@plt>
mov    -0x8(%rbp),%rax
movss  %xmm0,0x4(%rax)
mov    -0x10(%rbp),%rax
movss  0x8(%rax),%xmm0
call   1030 <roundf@plt>
mov    -0x8(%rbp),%rax
movss  %xmm0,0x8(%rax)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vec3_round>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
movss  (%rsi),%xmm0
call   1030 <roundf@plt>
movss  %xmm0,(%rbx)
movss  0x4(%r14),%xmm0
call   1030 <roundf@plt>
movss  %xmm0,0x4(%rbx)
movss  0x8(%r14),%xmm0
call   1030 <roundf@plt>
movss  %xmm0,0x8(%rbx)
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define float* @vec3_round(float* %0, float* %1) {
%3 = alloca float*
%4 = alloca float*
store float* %0, float** %3
store float* %1, float** %4
%5 = load float*, float** %4
%6 = getelementptr inbounds float, float* %5, i64 0
%7 = load float, float* %6
%8 = call float @llvm.round.f32(float %7)
%9 = load float*, float** %3
%10 = getelementptr inbounds float, float* %9, i64 0
store float %8, float* %10
%11 = load float*, float** %4
%12 = getelementptr inbounds float, float* %11, i64 1
%13 = load float, float* %12
%14 = call float @llvm.round.f32(float %13)
%15 = load float*, float** %3
%16 = getelementptr inbounds float, float* %15, i64 1
store float %14, float* %16
%17 = load float*, float** %4
%18 = getelementptr inbounds float, float* %17, i64 2
%19 = load float, float* %18
%20 = call float @llvm.round.f32(float %19)
%21 = load float*, float** %3
%22 = getelementptr inbounds float, float* %21, i64 2
store float %20, float* %22
%23 = load float*, float** %3
ret float* %23
}

LLVM IR (-O2):
define float* @vec3_round(float* returned writeonly %0, float* nocapture %1) {
%3 = load float, float* %1
%4 = tail call float @llvm.round.f32(float %3)
store float %4, float* %0
%5 = getelementptr inbounds float, float* %1, i64 1
%6 = load float, float* %5
%7 = tail call float @llvm.round.f32(float %6)
%8 = getelementptr inbounds float, float* %0, i64 1
store float %7, float* %8
%9 = getelementptr inbounds float, float* %1, i64 2
%10 = load float, float* %9
%11 = tail call float @llvm.round.f32(float %10)
%12 = getelementptr inbounds float, float* %0, i64 2
store float %11, float* %12
ret float* %0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int main(int argc, char *argv[]) {
  if (argc > 1) {
    printf("Hello World (I mean %s)\n", argv[1]);
  } else {
    printf("Hello World (no name)\n");
  }
}


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)
cmpl   $0x1,-0x8(%rbp)
jle    114b <main+0x3b>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
lea    0xec1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1159 <main+0x49>
lea    0xec7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
cmp    $0x2,%edi
jl     113a <main+0x1a>
mov    0x8(%rsi),%rsi
lea    0xecf(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
jmp    1146 <main+0x26>
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [25 x i8] c"Hello World (I mean %s)\0A\00"
@.str.1 = [23 x i8] c"Hello World (no name)\0A\00"
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 = icmp sgt i32 %6, 1
br i1 %7, label %8, label %13
8: ; preds = %2
%9 = load i8**, i8*** %5
%10 = getelementptr inbounds i8*, i8** %9, i64 1
%11 = load i8*, i8** %10
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* %11)
br label %15
13: ; preds = %2
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0))
br label %15
15: ; preds = %13, %8
%16 = load i32, i32* %3
ret i32 %16
}

LLVM IR (-O2):
@.str = [25 x i8] c"Hello World (I mean %s)\0A\00"
@str = [22 x i8] c"Hello World (no name)\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 1
br i1 %3, label %4, label %8
4: ; preds = %2
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* %6)
br label %10
8: ; preds = %2
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str, i64 0, i64 0))
br label %10
10: ; preds = %8, %4
ret i32 0
}
void i2d_DIST_POINT_NAME(void) {}


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

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

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

LLVM IR (-O2):
define void @i2d_DIST_POINT_NAME() {
ret void
}
/* Variables and functions */
scalar_t__ isspace(char const);
int str_isspace(const char *s) {
  while (isspace(*s))
    s++;
  return *s == '\0';
}


x86 assembly (clang, -O0):
<str_isspace>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <isspace@plt>
cmp    $0x0,%rax
je     1143 <str_isspace+0x33>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    111c <str_isspace+0xc>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<str_isspace>:
push   %rbx
mov    %rdi,%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movsbl (%rbx),%edi
call   1030 <isspace@plt>
add    $0x1,%rbx
test   %rax,%rax
jne    1120 <str_isspace+0x10>
xor    %eax,%eax
cmpb   $0x0,-0x1(%rbx)
sete   %al
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @str_isspace(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %7, %2 ]
%4 = load i8, i8* %3
%5 = tail call i64 @isspace(i8 signext %4)
%6 = icmp eq i64 %5, 0
%7 = getelementptr inbounds i8, i8* %3, i64 1
br i1 %6, label %8, label %2
8: ; preds = %2
%9 = load i8, i8* %3
%10 = icmp eq i8 %9, 0
%11 = zext i1 %10 to i32
ret i32 %11
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
int VarInt_sizeOf(uint64_t val) {
  return (!!(val >> 32)) * 4 + (!!(val >> 16)) * 2 + (!!((val + 3) >> 8)) + 1;
}


x86 assembly (clang, -O0):
<VarInt_sizeOf>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x20,%ecx
sar    %cl,%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
shl    $0x2,%eax
mov    -0x4(%rbp),%ecx
sar    $0x10,%ecx
cmp    $0x0,%ecx
setne  %cl
xor    $0xff,%cl
xor    $0xff,%cl
and    $0x1,%cl
movzbl %cl,%ecx
shl    $0x1,%ecx
add    %ecx,%eax
mov    -0x4(%rbp),%ecx
add    $0x3,%ecx
sar    $0x8,%ecx
cmp    $0x0,%ecx
setne  %cl
xor    $0xff,%cl
xor    $0xff,%cl
and    $0x1,%cl
movzbl %cl,%ecx
add    %ecx,%eax
add    $0x1,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @VarInt_sizeOf(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = ashr i32 %3, 32
%5 = icmp ne i32 %4, 0
%6 = xor i1 %5, true
%7 = xor i1 %6, true
%8 = zext i1 %7 to i32
%9 = mul nsw i32 %8, 4
%10 = load i32, i32* %2
%11 = ashr i32 %10, 16
%12 = icmp ne i32 %11, 0
%13 = xor i1 %12, true
%14 = xor i1 %13, true
%15 = zext i1 %14 to i32
%16 = mul nsw i32 %15, 2
%17 = add nsw i32 %9, %16
%18 = load i32, i32* %2
%19 = add nsw i32 %18, 3
%20 = ashr i32 %19, 8
%21 = icmp ne i32 %20, 0
%22 = xor i1 %21, true
%23 = xor i1 %22, true
%24 = zext i1 %23 to i32
%25 = add nsw i32 %17, %24
%26 = add nsw i32 %25, 1
ret i32 %26
}

LLVM IR (-O2):
define i32 @VarInt_sizeOf(i32 %0) {
ret i32 poison
}
/* Variables and functions */
char *make_return_packet(int /*<<< orphan*/);
char *gdb_get_query(char *query) { return (make_return_packet(0)); }


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

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

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

LLVM IR (-O2):
define i8* @gdb_get_query(i8* nocapture readnone %0) {
%2 = tail call i8* @make_return_packet(i32 0)
ret i8* %2
}
/* Variables and functions */
double cos(double);
double sin(double);
double foo(double a, double b) { return sin(a) + cos(b) + 4.9; }


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <sin@plt>
movsd  %xmm0,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1040 <cos@plt>
movaps %xmm0,%xmm1
movsd  -0x18(%rbp),%xmm0
addsd  %xmm1,%xmm0
movsd  0xea1(%rip),%xmm1
addsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
sub    $0x18,%rsp
movsd  %xmm1,0x10(%rsp)
call   1030 <sin@plt>
movsd  %xmm0,0x8(%rsp)
movsd  0x10(%rsp),%xmm0
call   1040 <cos@plt>
addsd  0x8(%rsp),%xmm0
addsd  0xeb2(%rip),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @foo(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 = call double @sin(double %5)
%7 = load double, double* %4
%8 = call double @cos(double %7)
%9 = fadd double %6, %8
%10 = fadd double %9, 4.900000e+00
ret double %10
}

LLVM IR (-O2):
define double @foo(double %0, double %1) {
%3 = tail call double @sin(double %0)
%4 = tail call double @cos(double %1)
%5 = fadd double %3, %4
%6 = fadd double %5, 4.900000e+00
ret double %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int n;
  scanf("%d", &n);
  for (; n >= 0; --n) {
    printf("Eu adoro programar\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
cmpl   $0x0,-0x8(%rbp)
jl     1163 <main+0x43>
lea    0xeb3(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
jmp    113f <main+0x1f>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xed4(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1040 <scanf@plt>
cmpl   $0x0,0xc(%rsp)
js     1167 <main+0x47>
lea    0xebf(%rip),%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    0xc(%rsp),%eax
lea    -0x1(%rax),%ecx
mov    %ecx,0xc(%rsp)
test   %eax,%eax
jg     1150 <main+0x30>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@str = [19 x i8] c"Eu adoro programar\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = icmp sgt i32 %4, -1
br i1 %5, label %6, label %11
6: ; preds = %0, %6
%7 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str, i64 0, i64 0))
%8 = load i32, i32* %1
%9 = add nsw i32 %8, -1
store i32 %9, i32* %1
%10 = icmp sgt i32 %8, 0
br i1 %10, label %6, label %11
11: ; preds = %6, %0
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;

/* Variables and functions */
int /*<<< orphan*/ localtime(int /*<<< orphan*/ *);
char *malloc(int);
int /*<<< orphan*/ strftime(char *, int, char *, int /*<<< orphan*/);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
char *gettime(void) {
  time_t rawtime;
  char *buffer = malloc(sizeof(char) * 80);
  time(&rawtime);
  strftime(buffer, 80, "%A %d %B %Y-%m-%d %X", localtime(&rawtime));
  return buffer;
}


x86 assembly (clang, -O0):
<gettime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    $0x50,%edi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
lea    -0x4(%rbp),%rdi
call   1040 <time@plt>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
lea    -0x4(%rbp),%rdi
call   1030 <localtime@plt>
mov    -0x18(%rbp),%rdi
mov    %eax,%ecx
mov    $0x50,%esi
lea    0xe7e(%rip),%rdx
call   1060 <strftime@plt>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gettime>:
push   %r14
push   %rbx
push   %rax
mov    $0x50,%edi
call   1050 <malloc@plt>
mov    %rax,%rbx
lea    0x4(%rsp),%r14
mov    %r14,%rdi
call   1040 <time@plt>
mov    %r14,%rdi
call   1030 <localtime@plt>
lea    0xe93(%rip),%rdx
mov    %rbx,%rdi
mov    $0x50,%esi
mov    %eax,%ecx
call   1060 <strftime@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [21 x i8] c"%A %d %B %Y-%m-%d %X\00"
define i8* @gettime() {
%1 = alloca i32
%2 = alloca i8*
%3 = call i8* @malloc(i32 80)
store i8* %3, i8** %2
%4 = call i32 @time(i32* %1)
%5 = load i8*, i8** %2
%6 = call i32 @localtime(i32* %1)
%7 = call i32 @strftime(i8* %5, i32 80, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 %6)
%8 = load i8*, i8** %2
ret i8* %8
}

LLVM IR (-O2):
@.str = [21 x i8] c"%A %d %B %Y-%m-%d %X\00"
define i8* @gettime() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call dereferenceable_or_null(80) i8* @malloc(i32 80)
%4 = call i32 @time(i32* %1)
%5 = call i32 @localtime(i32* %1)
%6 = call i32 @strftime(i8* %3, i32 80, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 %5)
ret i8* %3
}
/* Type definitions */
typedef int int64_t;
typedef int int32_t;

/* Variables and functions */
int64_t aeron_int64_to_ptr_hash_map_compound_key(int32_t high, int32_t low) {
  return ((int64_t)high << 32) | (low);
}


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

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

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

LLVM IR (-O2):
define i32 @aeron_int64_to_ptr_hash_map_compound_key(i32 %0, i32 %1) {
ret i32 poison
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void _mxml_destructor(void *g) { free(g); }


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

x86 assembly (clang, -O2):
<_mxml_destructor>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @_mxml_destructor(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
char *emalloc(int);
int /*<<< orphan*/ strncpy(char *, char *, int);
char *newstr(char *s, int n) {
  char *rv = emalloc(n + 1);
  rv[n] = '\0';
  strncpy(rv, s, n);
  return rv;
}


x86 assembly (clang, -O0):
<newstr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%edi
add    $0x1,%edi
call   1040 <emalloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movslq -0xc(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
call   1030 <strncpy@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<newstr>:
push   %r15
push   %r14
push   %rbx
mov    %esi,%r15d
mov    %rdi,%r14
lea    0x1(%r15),%edi
call   1040 <emalloc@plt>
mov    %rax,%rbx
movslq %r15d,%rdx
movb   $0x0,(%rax,%rdx,1)
mov    %rax,%rdi
mov    %r14,%rsi
call   1030 <strncpy@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @newstr(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i8*
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
%7 = add nsw i32 %6, 1
%8 = call i8* @emalloc(i32 %7)
store i8* %8, i8** %5
%9 = load i8*, i8** %5
%10 = load i32, i32* %4
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds i8, i8* %9, i64 %11
store i8 0, i8* %12
%13 = load i8*, i8** %5
%14 = load i8*, i8** %3
%15 = load i32, i32* %4
%16 = call i32 @strncpy(i8* %13, i8* %14, i32 %15)
%17 = load i8*, i8** %5
ret i8* %17
}

LLVM IR (-O2):
define i8* @newstr(i8* %0, i32 %1) {
%3 = add nsw i32 %1, 1
%4 = tail call i8* @emalloc(i32 %3)
%5 = sext i32 %1 to i64
%6 = getelementptr inbounds i8, i8* %4, i64 %5
store i8 0, i8* %6
%7 = tail call i32 @strncpy(i8* %4, i8* %0, i32 %1)
ret i8* %4
}