xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ wchar_t;
typedef int /*<<< orphan*/ time_t;

/* Variables and functions */
char *ctime(int /*<<< orphan*/ const *);
int /*<<< orphan*/ mbstowcs(int /*<<< orphan*/ *, char *, int);
wchar_t *wctime(const time_t *timer) {
  static wchar_t result[26];
  char *time;
  time = ctime(timer);
  mbstowcs(result, time, 26);
  return result;
}


x86 assembly (clang, -O0):
<wctime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <ctime@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
lea    0x2efc(%rip),%rdi
mov    $0x1a,%edx
call   1030 <mbstowcs@plt>
lea    0x2eeb(%rip),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wctime>:
push   %rbx
call   1040 <ctime@plt>
lea    0x2f13(%rip),%rbx
mov    %rbx,%rdi
mov    %rax,%rsi
mov    $0x1a,%edx
call   1030 <mbstowcs@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@wctime.result = internal global [26 x i32] zeroinitializer
define i32* @wctime(i32* %0) {
%2 = alloca i32*
%3 = alloca i8*
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = call i8* @ctime(i32* %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = call i32 @mbstowcs(i32* getelementptr inbounds ([26 x i32], [26 x i32]* @wctime.result, i64 0, i64 0), i8* %6, i32 26)
ret i32* getelementptr inbounds ([26 x i32], [26 x i32]* @wctime.result, i64 0, i64 0)
}

LLVM IR (-O2):
@wctime.result = internal global [26 x i32] zeroinitializer
define i32* @wctime(i32* %0) {
%2 = tail call i8* @ctime(i32* %0)
%3 = tail call i32 @mbstowcs(i32* getelementptr inbounds ([26 x i32], [26 x i32]* @wctime.result, i64 0, i64 0), i8* %2, i32 26)
ret i32* getelementptr inbounds ([26 x i32], [26 x i32]* @wctime.result, i64 0, i64 0)
}
void gtk_size_group_remove_widget() {}


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

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

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

LLVM IR (-O2):
define void @gtk_size_group_remove_widget() {
ret void
}
void logger_platform_out(const char *text) {}


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

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

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

LLVM IR (-O2):
define void @logger_platform_out(i8* nocapture %0) {
ret void
}
int test_imm_15uint64_highword_reg(unsigned long long val) {
  return ((val >> 32) & (0x15 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_15uint64_highword_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
shr    $0x20,%rdx
and    $0x15,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_15uint64_highword_reg>:
movabs $0x1500000000,%rax
test   %rax,%rdi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_15uint64_highword_reg(i64 %0) {
%2 = and i64 %0, 90194313216
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
void X509_print_ex(void) {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ F_RDLCK;
int _tdb_unlockall(struct tdb_context *, int /*<<< orphan*/);
int ext2fs_tdb_unlockall_read(struct tdb_context *tdb) {
  return _tdb_unlockall(tdb, F_RDLCK);
}


x86 assembly (clang, -O0):
<ext2fs_tdb_unlockall_read>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2eb1(%rip),%rax
mov    (%rax),%esi
call   1030 <_tdb_unlockall@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ext2fs_tdb_unlockall_read>:
mov    0x2ec1(%rip),%rax
mov    (%rax),%esi
jmp    1030 <_tdb_unlockall@plt>

LLVM IR (-O0):
%struct.tdb_context = type { i32 }
@F_RDLCK = global i32 0
define i32 @ext2fs_tdb_unlockall_read(%struct.tdb_context* %0) {
%2 = alloca %struct.tdb_context*
store %struct.tdb_context* %0, %struct.tdb_context** %2
%3 = load %struct.tdb_context*, %struct.tdb_context** %2
%4 = load i32, i32* @F_RDLCK
%5 = call i32 @_tdb_unlockall(%struct.tdb_context* %3, i32 %4)
ret i32 %5
}

LLVM IR (-O2):
%struct.tdb_context = type { i32 }
@F_RDLCK = global i32 0
define i32 @ext2fs_tdb_unlockall_read(%struct.tdb_context* %0) {
%2 = load i32, i32* @F_RDLCK
%3 = tail call i32 @_tdb_unlockall(%struct.tdb_context* %0, i32 %2)
ret i32 %3
}
/* Variables and functions */
double ceil(double);
long tor_lround(double d) { return (long)(d > 0 ? d + 0.5 : ceil(d - 0.5)); }


x86 assembly (clang, -O0):
<tor_lround>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    1146 <tor_lround+0x36>
movsd  0xec9(%rip),%xmm0
addsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
jmp    1161 <tor_lround+0x51>
movsd  -0x8(%rbp),%xmm0
movsd  0xead(%rip),%xmm1
subsd  %xmm1,%xmm0
call   1030 <ceil@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
cvttsd2si %xmm0,%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tor_lround>:
push   %rax
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    1125 <tor_lround+0x15>
addsd  0xee5(%rip),%xmm0
jmp    1132 <tor_lround+0x22>
addsd  0xed3(%rip),%xmm0
call   1030 <ceil@plt>
cvttsd2si %xmm0,%rax
pop    %rcx
ret

LLVM IR (-O0):
define i64 @tor_lround(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fcmp ogt double %3, 0.000000e+00
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load double, double* %2
%7 = fadd double %6, 5.000000e-01
br label %12
8: ; preds = %1
%9 = load double, double* %2
%10 = fsub double %9, 5.000000e-01
%11 = call double @llvm.ceil.f64(double %10)
br label %12
12: ; preds = %8, %5
%13 = phi double [ %7, %5 ], [ %11, %8 ]
%14 = fptosi double %13 to i64
ret i64 %14
}

LLVM IR (-O2):
define i64 @tor_lround(double %0) {
%2 = fcmp ogt double %0, 0.000000e+00
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = fadd double %0, 5.000000e-01
br label %8
5: ; preds = %1
%6 = fadd double %0, -5.000000e-01
%7 = tail call double @llvm.ceil.f64(double %6)
br label %8
8: ; preds = %5, %3
%9 = phi double [ %4, %3 ], [ %7, %5 ]
%10 = fptosi double %9 to i64
ret i64 %10
}
void set_icmp_header_icmp_flood() {}


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

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

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

LLVM IR (-O2):
define void @set_icmp_header_icmp_flood() {
ret void
}
void av_hwdevice_ctx_create_derived_opts() {}


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

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

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

LLVM IR (-O2):
define void @av_hwdevice_ctx_create_derived_opts() {
ret void
}
long negoffset(long a, long romsz) {
  if (a > 0) {
    if (a & 0x80000000)
      return a - 0x100000000;
    else
      return a - romsz;
  } else {
    return a;
  }
}


x86 assembly (clang, -O0):
<negoffset>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
jle    115a <negoffset+0x5a>
movabs $0x80000000,%rax
and    -0x10(%rbp),%rax
cmp    $0x0,%rax
je     1149 <negoffset+0x49>
mov    -0x10(%rbp),%rax
movabs $0x100000000,%rcx
sub    %rcx,%rax
mov    %rax,-0x8(%rbp)
jmp    1162 <negoffset+0x62>
mov    -0x10(%rbp),%rax
sub    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1162 <negoffset+0x62>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<negoffset>:
mov    %rdi,%rax
test   %rdi,%rdi
jle    1112 <negoffset+0x12>
test   $0x80000000,%eax
jne    1113 <negoffset+0x13>
sub    %rsi,%rax
ret
movabs $0xffffffff00000000,%rcx
ff ff ff
add    %rcx,%rax
ret

LLVM IR (-O0):
define i64 @negoffset(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
store i64 %0, i64* %4
store i64 %1, i64* %5
%6 = load i64, i64* %4
%7 = icmp sgt i64 %6, 0
br i1 %7, label %8, label %19
8: ; preds = %2
%9 = load i64, i64* %4
%10 = and i64 %9, 2147483648
%11 = icmp ne i64 %10, 0
br i1 %11, label %12, label %15
12: ; preds = %8
%13 = load i64, i64* %4
%14 = sub nsw i64 %13, 4294967296
store i64 %14, i64* %3
br label %21
15: ; preds = %8
%16 = load i64, i64* %4
%17 = load i64, i64* %5
%18 = sub nsw i64 %16, %17
store i64 %18, i64* %3
br label %21
19: ; preds = %2
%20 = load i64, i64* %4
store i64 %20, i64* %3
br label %21
21: ; preds = %19, %15, %12
%22 = load i64, i64* %3
ret i64 %22
}

LLVM IR (-O2):
define i64 @negoffset(i64 %0, i64 %1) {
%3 = icmp sgt i64 %0, 0
br i1 %3, label %4, label %11
4: ; preds = %2
%5 = and i64 %0, 2147483648
%6 = icmp eq i64 %5, 0
br i1 %6, label %9, label %7
7: ; preds = %4
%8 = add nsw i64 %0, -4294967296
br label %11
9: ; preds = %4
%10 = sub nsw i64 %0, %1
br label %11
11: ; preds = %2, %9, %7
%12 = phi i64 [ %8, %7 ], [ %10, %9 ], [ %0, %2 ]
ret i64 %12
}
void gtk_menu_tool_button_set_arrow_tooltip() {}


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

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

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

LLVM IR (-O2):
define void @gtk_menu_tool_button_set_arrow_tooltip() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int optellen(int term1, int term2) {
  if ((term1 < 0) | (term2 < 0)) {
    printf("een van de termen is negatief, ik ga aftrekken\n");
  }
  return term1 + term2;
}


x86 assembly (clang, -O0):
<optellen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
setl   %al
and    $0x1,%al
movzbl %al,%eax
cmpl   $0x0,-0x8(%rbp)
setl   %cl
and    $0x1,%cl
movzbl %cl,%ecx
or     %ecx,%eax
cmp    $0x0,%eax
je     114e <optellen+0x3e>
lea    0xeb7(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<optellen>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
mov    %esi,%eax
or     %edi,%eax
jns    1129 <optellen+0x19>
lea    0xedc(%rip),%rdi
call   1030 <puts@plt>
add    %ebp,%ebx
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [48 x i8] c"een van de termen is negatief, ik ga aftrekken\0A\00"
define i32 @optellen(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 = icmp slt i32 %5, 0
%7 = zext i1 %6 to i32
%8 = load i32, i32* %4
%9 = icmp slt i32 %8, 0
%10 = zext i1 %9 to i32
%11 = or i32 %7, %10
%12 = icmp ne i32 %11, 0
br i1 %12, label %13, label %15
13: ; preds = %2
%14 = call i32 @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0))
br label %15
15: ; preds = %13, %2
%16 = load i32, i32* %3
%17 = load i32, i32* %4
%18 = add nsw i32 %16, %17
ret i32 %18
}

LLVM IR (-O2):
@str = [47 x i8] c"een van de termen is negatief, ik ga aftrekken\00"
define i32 @optellen(i32 %0, i32 %1) {
%3 = or i32 %1, %0
%4 = icmp sgt i32 %3, -1
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([47 x i8], [47 x i8]* @str, i64 0, i64 0))
br label %7
7: ; preds = %5, %2
%8 = add nsw i32 %1, %0
ret i32 %8
}
/* Type definitions */
struct rbtree {
  int dummy;
};
struct htable {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int read_records_from_file(char *, struct htable *, struct rbtree *, int);
int refresh_records(struct htable *ds, struct rbtree *rbt) {
  printf("read from records.z\n");
  return read_records_from_file("../records.z", ds, rbt, 1);
}


x86 assembly (clang, -O0):
<refresh_records>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xec9(%rip),%rdi
call   1040 <printf@plt>
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
lea    0xeca(%rip),%rdi
mov    $0x1,%ecx
call   1030 <read_records_from_file@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<refresh_records>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
lea    0xedc(%rip),%rdi
call   1040 <puts@plt>
lea    0xec3(%rip),%rdi
mov    %rbx,%rsi
mov    %r14,%rdx
mov    $0x1,%ecx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <read_records_from_file@plt>

LLVM IR (-O0):
%struct.htable = type { i32 }
%struct.rbtree = type { i32 }
@.str = [21 x i8] c"read from records.z\0A\00"
@.str.1 = [13 x i8] c"../records.z\00"
define i32 @refresh_records(%struct.htable* %0, %struct.rbtree* %1) {
%3 = alloca %struct.htable*
%4 = alloca %struct.rbtree*
store %struct.htable* %0, %struct.htable** %3
store %struct.rbtree* %1, %struct.rbtree** %4
%5 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%6 = load %struct.htable*, %struct.htable** %3
%7 = load %struct.rbtree*, %struct.rbtree** %4
%8 = call i32 @read_records_from_file(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), %struct.htable* %6, %struct.rbtree* %7, i32 1)
ret i32 %8
}

LLVM IR (-O2):
%struct.htable = type { i32 }
%struct.rbtree = type { i32 }
@.str.1 = [13 x i8] c"../records.z\00"
@str = [20 x i8] c"read from records.z\00"
define i32 @refresh_records(%struct.htable* %0, %struct.rbtree* %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @read_records_from_file(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), %struct.htable* %0, %struct.rbtree* %1, i32 1)
ret i32 %4
}
void kinetis_reset_system() {}


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

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

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

LLVM IR (-O2):
define void @kinetis_reset_system() {
ret void
}
/* Variables and functions */
int parition(int *, int, int);
void quicksort(int arr[], int l, int h) {
  if (l < h) {
    int pi = parition(arr, l, h);
    quicksort(arr, l, pi - 1);
    quicksort(arr, pi + 1, h);
  }
}


x86 assembly (clang, -O0):
<quicksort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1174 <quicksort+0x54>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1040 <parition@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x14(%rbp),%edx
sub    $0x1,%edx
call   1030 <quicksort@plt>
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
add    $0x1,%esi
mov    -0x10(%rbp),%edx
call   1030 <quicksort@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<quicksort>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
cmp    %edx,%esi
jge    1166 <quicksort+0x46>
mov    %edx,%r14d
mov    %esi,%ebp
mov    %rdi,%r15
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %r15,%rdi
mov    %ebp,%esi
mov    %r14d,%edx
call   1040 <parition@plt>
mov    %eax,%ebx
lea    -0x1(%rbx),%edx
mov    %r15,%rdi
mov    %ebp,%esi
call   1030 <quicksort@plt>
add    $0x1,%ebx
mov    %ebx,%ebp
cmp    %r14d,%ebx
jl     1140 <quicksort+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @quicksort(i32* %0, i32 %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32* %0, i32** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = icmp slt i32 %8, %9
br i1 %10, label %11, label %24
11: ; preds = %3
%12 = load i32*, i32** %4
%13 = load i32, i32* %5
%14 = load i32, i32* %6
%15 = call i32 @parition(i32* %12, i32 %13, i32 %14)
store i32 %15, i32* %7
%16 = load i32*, i32** %4
%17 = load i32, i32* %5
%18 = load i32, i32* %7
%19 = sub nsw i32 %18, 1
%20 = load i32*, i32** %4
%21 = load i32, i32* %7
%22 = add nsw i32 %21, 1
%23 = load i32, i32* %6
br label %24
24: ; preds = %11, %3
ret void
}

LLVM IR (-O2):
define void @quicksort(i32* %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %1, %2
br i1 %4, label %5, label %11
5: ; preds = %3, %5
%6 = phi i32 [ %9, %5 ], [ %1, %3 ]
%7 = tail call i32 @parition(i32* %0, i32 %6, i32 %2)
%8 = add nsw i32 %7, -1
tail call void @quicksort(i32* %0, i32 %6, i32 %8)
%9 = add nsw i32 %7, 1
%10 = icmp slt i32 %9, %2
br i1 %10, label %5, label %11
11: ; preds = %5, %3
ret void
}
/* Variables and functions */
scalar_t__ GetSystemTimerBase();
int GetTimeStamp() {
  int *timerBase = (int *)GetSystemTimerBase();
  return *(timerBase + 1);
}


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

x86 assembly (clang, -O2):
<GetTimeStamp>:
push   %rax
xor    %eax,%eax
call   1030 <GetSystemTimerBase@plt>
mov    0x4(%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @GetTimeStamp() {
%1 = alloca i32*
%2 = call i64 (...) @GetSystemTimerBase()
%3 = inttoptr i64 %2 to i32*
store i32* %3, i32** %1
%4 = load i32*, i32** %1
%5 = getelementptr inbounds i32, i32* %4, i64 1
%6 = load i32, i32* %5
ret i32 %6
}

LLVM IR (-O2):
define i32 @GetTimeStamp() {
%1 = tail call i64 (...) @GetSystemTimerBase()
%2 = inttoptr i64 %1 to i32*
%3 = getelementptr inbounds i32, i32* %2, i64 1
%4 = load i32, i32* %3
ret i32 %4
}
void pathconN_nm5_incref(void) {}


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

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

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

LLVM IR (-O2):
define void @pathconN_nm5_incref() {
ret void
}
void Default_Handler() {
  for (;;)
    ;
}


x86 assembly (clang, -O0):
<Default_Handler>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <Default_Handler+0x9>
jmp    1109 <Default_Handler+0x9>

x86 assembly (clang, -O2):
<Default_Handler>:
jmp    1100 <Default_Handler>

LLVM IR (-O0):
define void @Default_Handler() {
br label %1
1: ; preds = %1, %0
br label %1
}

LLVM IR (-O2):
define void @Default_Handler() {
br label %1
1: ; preds = %1, %0
br label %1
}
/* Variables and functions */
float powf(float, float);
float dds_scaling_dbovf(float level) {
  return powf(10.0f, (level - (-3.02f)) / 20.0f) * 32767.0f;
}


x86 assembly (clang, -O0):
<dds_scaling_dbovf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm1
movss  0xee2(%rip),%xmm0
subss  %xmm0,%xmm1
movss  0xed2(%rip),%xmm0
divss  %xmm0,%xmm1
movss  0xec2(%rip),%xmm0
call   1030 <powf@plt>
movss  0xeb1(%rip),%xmm1
mulss  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dds_scaling_dbovf>:
push   %rax
movaps %xmm0,%xmm1
addss  0xee4(%rip),%xmm1
divss  0xee0(%rip),%xmm1
movss  0xedc(%rip),%xmm0
call   1030 <powf@plt>
mulss  0xed3(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @dds_scaling_dbovf(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fsub float %3, 0xC00828F5C0000000
%5 = fdiv float %4, 2.000000e+01
%6 = call float @powf(float 1.000000e+01, float %5)
%7 = fmul float %6, 3.276700e+04
ret float %7
}

LLVM IR (-O2):
define float @dds_scaling_dbovf(float %0) {
%2 = fadd float %0, 0x400828F5C0000000
%3 = fdiv float %2, 2.000000e+01
%4 = tail call float @powf(float 1.000000e+01, float %3)
%5 = fmul float %4, 3.276700e+04
ret float %5
}
/* Type definitions */
struct cmd_arg {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ showMACs();
void cmdShowFdbTbl(int cmdType, struct cmd_arg *pCmdArg) { showMACs(); }


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

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

LLVM IR (-O0):
%struct.cmd_arg = type { i32 }
define void @cmdShowFdbTbl(i32 %0, %struct.cmd_arg* %1) {
%3 = alloca i32
%4 = alloca %struct.cmd_arg*
store i32 %0, i32* %3
store %struct.cmd_arg* %1, %struct.cmd_arg** %4
%5 = call i32 (...) @showMACs()
ret void
}

LLVM IR (-O2):
%struct.cmd_arg = type { i32 }
define void @cmdShowFdbTbl(i32 %0, %struct.cmd_arg* nocapture readnone %1) {
%3 = tail call i32 (...) @showMACs()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;
typedef int /*<<< orphan*/ out;

/* Variables and functions */
int /*<<< orphan*/ swap_n(int /*<<< orphan*/ *, int /*<<< orphan*/ *, int);
uint32_t be32toh(uint32_t in) {
  uint32_t out;
  swap_n(&in, &out, sizeof(out));
  return out;
}


x86 assembly (clang, -O0):
<be32toh>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    -0x4(%rbp),%rdi
lea    -0x8(%rbp),%rsi
mov    $0x4,%edx
call   1030 <swap_n@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<be32toh>:
push   %rax
mov    %edi,0x4(%rsp)
lea    0x4(%rsp),%rdi
mov    %rsp,%rsi
mov    $0x4,%edx
call   1030 <swap_n@plt>
mov    (%rsp),%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @be32toh(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = bitcast i32* %3 to i8*
%5 = call i32 @swap_n(i32* %2, i32* %3, i32 4)
%6 = load i32, i32* %3
ret i32 %6
}
void usb_pm_lock(struct usb_device *udev) {}


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

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

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

LLVM IR (-O2):
%struct.usb_device = type opaque
define void @usb_pm_lock(%struct.usb_device* nocapture %0) {
ret void
}
int data_ready_on_stdin() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @data_ready_on_stdin() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ ephDegToRad(double);
double sin(int /*<<< orphan*/);
double ephSin(double theta) { return sin(ephDegToRad(theta)); }


x86 assembly (clang, -O0):
<ephSin>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <ephDegToRad@plt>
mov    %eax,%edi
call   1040 <sin@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ephSin>:
push   %rax
call   1030 <ephDegToRad@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <sin@plt>

LLVM IR (-O0):
define double @ephSin(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call i32 @ephDegToRad(double %3)
%5 = call double @sin(i32 %4)
ret double %5
}

LLVM IR (-O2):
define double @ephSin(double %0) {
%2 = tail call i32 @ephDegToRad(double %0)
%3 = tail call double @sin(i32 %2)
ret double %3
}
/* Variables and functions */
int /*<<< orphan*/ put32(unsigned int);
int /*<<< orphan*/ put8(int);
void mov_preg64pimm32_reg32(int reg1, unsigned int imm32, int reg2) {
  put8(0x89);
  put8(0x80 | reg1 | (reg2 << 3));
  put32(imm32);
}


x86 assembly (clang, -O0):
<mov_preg64pimm32_reg32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    $0x89,%edi
call   1030 <put8@plt>
mov    -0x4(%rbp),%edi
or     $0x80,%edi
mov    -0xc(%rbp),%eax
shl    $0x3,%eax
or     %eax,%edi
call   1030 <put8@plt>
mov    -0x8(%rbp),%edi
call   1040 <put32@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mov_preg64pimm32_reg32>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%ebx
mov    %esi,%r14d
mov    %edi,%ebp
mov    $0x89,%edi
call   1030 <put8@plt>
shl    $0x3,%ebx
or     %ebp,%ebx
or     $0x80,%ebx
mov    %ebx,%edi
call   1030 <put8@plt>
mov    %r14d,%edi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <put32@plt>

LLVM IR (-O0):
define void @mov_preg64pimm32_reg32(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 = call i32 @put8(i32 137)
%8 = load i32, i32* %4
%9 = or i32 128, %8
%10 = load i32, i32* %6
%11 = shl i32 %10, 3
%12 = or i32 %9, %11
%13 = call i32 @put8(i32 %12)
%14 = load i32, i32* %5
%15 = call i32 @put32(i32 %14)
ret void
}

LLVM IR (-O2):
define void @mov_preg64pimm32_reg32(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @put8(i32 137)
%5 = shl i32 %2, 3
%6 = or i32 %5, %0
%7 = or i32 %6, 128
%8 = tail call i32 @put8(i32 %7)
%9 = tail call i32 @put32(i32 %1)
ret void
}
/* Type definitions */
struct strvec {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct strvec *);
int /*<<< orphan*/ strvec_clear(struct strvec *);
void strvec_destroy(struct strvec *psv) {
  strvec_clear(psv);
  free(psv);
}


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

x86 assembly (clang, -O2):
<strvec_destroy>:
push   %rbx
mov    %rdi,%rbx
call   1040 <strvec_clear@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

LLVM IR (-O0):
%struct.strvec = type { i32 }
define void @strvec_destroy(%struct.strvec* %0) {
%2 = alloca %struct.strvec*
store %struct.strvec* %0, %struct.strvec** %2
%3 = load %struct.strvec*, %struct.strvec** %2
%4 = call i32 @strvec_clear(%struct.strvec* %3)
%5 = load %struct.strvec*, %struct.strvec** %2
%6 = call i32 @free(%struct.strvec* %5)
ret void
}

LLVM IR (-O2):
%struct.strvec = type { i32 }
define void @strvec_destroy(%struct.strvec* %0) {
%2 = tail call i32 @strvec_clear(%struct.strvec* %0)
%3 = tail call i32 @free(%struct.strvec* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ f(int *);
main() {
  int i;
  f((void *)0);
  f(&i);
  f(0);
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
call   1030 <f@plt>
lea    0x4(%rsp),%rdi
call   1030 <f@plt>
xor    %edi,%edi
call   1030 <f@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = call i32 @f(i32* null)
%3 = call i32 @f(i32* %1)
%4 = call i32 @f(i32* null)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @f(i32* null)
%4 = call i32 @f(i32* %1)
%5 = call i32 @f(i32* null)
ret i32 0
}
/* Type definitions */
struct cfg_section {
  int dummy;
};
struct cfg_domain {
  int dummy;
};

/* Variables and functions */
struct cfg_domain *cfg_find_domain(char *);
struct cfg_section *cfg_find_section(struct cfg_domain *, char *);
struct cfg_section *cfg_get_sec(char *dname, char *sname) {
  struct cfg_domain *domain;
  domain = cfg_find_domain(dname);
  if (NULL == domain)
    return NULL;
  return cfg_find_section(domain, sname);
}


x86 assembly (clang, -O0):
<cfg_get_sec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <cfg_find_domain@plt>
mov    %rax,-0x20(%rbp)
xor    %eax,%eax
cmp    -0x20(%rbp),%rax
jne    1156 <cfg_get_sec+0x36>
movq   $0x0,-0x8(%rbp)
jmp    1167 <cfg_get_sec+0x47>
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <cfg_find_section@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cfg_get_sec>:
push   %rbx
mov    %rsi,%rbx
call   1040 <cfg_find_domain@plt>
test   %rax,%rax
je     113a <cfg_get_sec+0x1a>
mov    %rax,%rdi
mov    %rbx,%rsi
pop    %rbx
jmp    1030 <cfg_find_section@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.cfg_section = type { i32 }
%struct.cfg_domain = type { i32 }
define %struct.cfg_section* @cfg_get_sec(i8* %0, i8* %1) {
%3 = alloca %struct.cfg_section*
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca %struct.cfg_domain*
store i8* %0, i8** %4
store i8* %1, i8** %5
%7 = load i8*, i8** %4
%8 = call %struct.cfg_domain* @cfg_find_domain(i8* %7)
store %struct.cfg_domain* %8, %struct.cfg_domain** %6
%9 = load %struct.cfg_domain*, %struct.cfg_domain** %6
%10 = icmp eq %struct.cfg_domain* null, %9
br i1 %10, label %11, label %12
11: ; preds = %2
store %struct.cfg_section* null, %struct.cfg_section** %3
br label %16
12: ; preds = %2
%13 = load %struct.cfg_domain*, %struct.cfg_domain** %6
%14 = load i8*, i8** %5
%15 = call %struct.cfg_section* @cfg_find_section(%struct.cfg_domain* %13, i8* %14)
store %struct.cfg_section* %15, %struct.cfg_section** %3
br label %16
16: ; preds = %12, %11
%17 = load %struct.cfg_section*, %struct.cfg_section** %3
ret %struct.cfg_section* %17
}

LLVM IR (-O2):
%struct.cfg_section = type { i32 }
%struct.cfg_domain = type { i32 }
define %struct.cfg_section* @cfg_get_sec(i8* %0, i8* %1) {
%3 = tail call %struct.cfg_domain* @cfg_find_domain(i8* %0)
%4 = icmp eq %struct.cfg_domain* %3, null
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call %struct.cfg_section* @cfg_find_section(%struct.cfg_domain* %3, i8* %1)
br label %7
7: ; preds = %2, %5
%8 = phi %struct.cfg_section* [ %6, %5 ], [ null, %2 ]
ret %struct.cfg_section* %8
}
__attribute__((__no__)) void
do_nothing_small_hole_assigned_dynamic_partial(struct test_small_hole *ptr) {
  if ((unsigned long)ptr > 0x2)
    return;
  else
    return;
}


x86 assembly (clang, -O0):
<do_nothing_small_hole_assigned_dynamic_partial>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmp    $0x2,%rax
jbe    111b <do_nothing_small_hole_assigned_dynamic_partial+0x1b>
jmp    1120 <do_nothing_small_hole_assigned_dynamic_partial+0x20>
jmp    1120 <do_nothing_small_hole_assigned_dynamic_partial+0x20>
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.test_small_hole = type opaque
define void @do_nothing_small_hole_assigned_dynamic_partial(%struct.test_small_hole* %0) {
%2 = alloca %struct.test_small_hole*
store %struct.test_small_hole* %0, %struct.test_small_hole** %2
%3 = load %struct.test_small_hole*, %struct.test_small_hole** %2
%4 = ptrtoint %struct.test_small_hole* %3 to i64
%5 = icmp ugt i64 %4, 2
br i1 %5, label %6, label %7
6: ; preds = %1
br label %8
7: ; preds = %1
br label %8
8: ; preds = %7, %6
ret void
}

LLVM IR (-O2):
%struct.test_small_hole = type opaque
define void @do_nothing_small_hole_assigned_dynamic_partial(%struct.test_small_hole* nocapture %0) {
ret void
}
/* Variables and functions */
int tgdb_types_print_item(void *);
int tgdb_types_print_command(void *command) {
  return tgdb_types_print_item((void *)command);
}


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

x86 assembly (clang, -O2):
<tgdb_types_print_command>:
jmp    1030 <tgdb_types_print_item@plt>

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

LLVM IR (-O2):
define i32 @tgdb_types_print_command(i8* %0) {
%2 = tail call i32 @tgdb_types_print_item(i8* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_SUCCESS;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
void sigterm_handler(const int sig) {
  printf("SIGTERM handled.\n");
  exit(EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<sigterm_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xece(%rip),%rdi
call   1030 <printf@plt>
mov    0x2ea2(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

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

LLVM IR (-O0):
@.str = [18 x i8] c"SIGTERM handled.\0A\00"
@EXIT_SUCCESS = global i32 0
define void @sigterm_handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* @EXIT_SUCCESS
%5 = call i32 @exit(i32 %4)
unreachable
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
@str = [17 x i8] c"SIGTERM handled.\00"
define void @sigterm_handler(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str, i64 0, i64 0))
%3 = load i32, i32* @EXIT_SUCCESS
%4 = tail call i32 @exit(i32 %3)
unreachable
}
unsigned int get_uint8(char *start) { return (unsigned char)*start; }


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

x86 assembly (clang, -O2):
<get_uint8>:
movzbl (%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @get_uint8(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = zext i8 %2 to i32
ret i32 %3
}
unsigned short readw(unsigned int address) {
  return *((volatile unsigned short *)address);
}


x86 assembly (clang, -O0):
<readw>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    (%rax),%ax
movzwl %ax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<readw>:
mov    %edi,%eax
movzwl (%rax),%eax
ret

LLVM IR (-O0):
define zeroext i16 @readw(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = zext i32 %3 to i64
%5 = inttoptr i64 %4 to i16*
%6 = load volatile i16, i16* %5
ret i16 %6
}

LLVM IR (-O2):
define zeroext i16 @readw(i32 %0) {
%2 = zext i32 %0 to i64
%3 = inttoptr i64 %2 to i16*
%4 = load volatile i16, i16* %3
ret i16 %4
}
void polys_(n, parray) int *n;
short parray[][3];
{ polys((long)*n, parray); }


x86 assembly (clang, -O0):
<polys_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq (%rax),%rdi
mov    -0x10(%rbp),%rsi
mov    $0x0,%al
call   1030 <polys@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<polys_>:
movslq (%rdi),%rdi
xor    %eax,%eax
jmp    1030 <polys@plt>

LLVM IR (-O0):
define void @polys_(i32* %0, [3 x i16]* %1) {
%3 = alloca i32*
%4 = alloca [3 x i16]*
store i32* %0, i32** %3
store [3 x i16]* %1, [3 x i16]** %4
%5 = load i32*, i32** %3
%6 = load i32, i32* %5
%7 = sext i32 %6 to i64
%8 = load [3 x i16]*, [3 x i16]** %4
%9 = call i32 (i64, [3 x i16]*, ...) bitcast (i32 (...)* @polys to i32 (i64, [3 x i16]*, ...)*)(i64 %7, [3 x i16]* %8)
ret void
}

LLVM IR (-O2):
define void @polys_(i32* nocapture %0, [3 x i16]* %1) {
%3 = load i32, i32* %0
%4 = sext i32 %3 to i64
%5 = tail call i32 (i64, [3 x i16]*, ...) bitcast (i32 (...)* @polys to i32 (i64, [3 x i16]*, ...)*)(i64 %4, [3 x i16]* %1)
ret void
}
long int labs(long int num) {
  if (num < 0)
    return -num;
  return num;
}


x86 assembly (clang, -O0):
<labs>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jge    1122 <labs+0x22>
xor    %eax,%eax
sub    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    112a <labs+0x2a>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<labs>:
mov    %rdi,%rax
neg    %rax
cmovs  %rdi,%rax
ret

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

LLVM IR (-O2):
define i64 @labs(i64 %0) {
%2 = tail call i64 @llvm.abs.i64(i64 %0, i1 true)
ret i64 %2
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ stderr;
void usage(char *progname) {
  fprintf(stderr,
          ("Usage: %s [ options ] [ <interval> [ <count> ] ] [ <outfile> ]\n"),
          progname);
  fprintf(
      stderr,
      ("Options are:\n"
       "[ -C <comment> ] [ -S { INT | DISK | ALL } ] [ -F ] [ -L ] [ -V ]\n"));
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2e92(%rip),%rax
mov    (%rax),%edi
lea    0xee9(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rbx
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rbx
mov    (%rbx),%edi
lea    0xecc(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xefc(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [64 x i8] c"Usage: %s [ options ] [ <interval> [ <count> ] ] [ <outfile> ]\0A\00"
@.str.1 = [80 x i8] c"Options are:\0A[ -C <comment> ] [ -S { INT | DISK | ALL } ] [ -F ] [ -L ] [ -V ]\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 (i32, i8*, ...) @fprintf(i32 %3, i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = load i32, i32* @stderr
%7 = call i32 (i32, i8*, ...) @fprintf(i32 %6, i8* getelementptr inbounds ([80 x i8], [80 x i8]* @.str.1, i64 0, i64 0))
%8 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [64 x i8] c"Usage: %s [ options ] [ <interval> [ <count> ] ] [ <outfile> ]\0A\00"
@.str.1 = [80 x i8] c"Options are:\0A[ -C <comment> ] [ -S { INT | DISK | ALL } ] [ -F ] [ -L ] [ -V ]\0A\00"
define void @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 (i32, i8*, ...) @fprintf(i32 %2, i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = load i32, i32* @stderr
%5 = tail call i32 (i32, i8*, ...) @fprintf(i32 %4, i8* getelementptr inbounds ([80 x i8], [80 x i8]* @.str.1, i64 0, i64 0))
%6 = tail call i32 @exit(i32 1)
unreachable
}
int test_imm_0Fint16_reg(short val) {
  return ((val) & (0x0F << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_0Fint16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%edx
and    $0xf,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_0Fint16_reg(i16 signext %0) {
%2 = and i16 %0, 15
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ all_leds_on();
int sys_leds_on(void) {
  all_leds_on();
  return 0;
}


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

x86 assembly (clang, -O2):
<sys_leds_on>:
push   %rax
xor    %eax,%eax
call   1030 <all_leds_on@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @sys_leds_on() {
%1 = call i32 (...) @all_leds_on()
ret i32 0
}

LLVM IR (-O2):
define i32 @sys_leds_on() {
%1 = tail call i32 (...) @all_leds_on()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ __assert_fail(char *, char *, unsigned int, char *);
int /*<<< orphan*/ check_global();
void main(void) {
  int x;
  {
    x = 3;
    if (x == 3) {
    } else {
      { __assert_fail("x == 3", "shadowing.c", 12U, "main"); }
    }
    { check_global(); }
    return;
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x3,-0x4(%rbp)
cmpl   $0x3,-0x4(%rbp)
jne    113e <main+0x1e>
jmp    115d <main+0x3d>
lea    0xebb(%rip),%rdi
lea    0xebb(%rip),%rsi
mov    $0xc,%edx
lea    0xebb(%rip),%rcx
call   1030 <__assert_fail@plt>
mov    $0x0,%al
call   1040 <check_global@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [7 x i8] c"x == 3\00"
@.str.1 = [12 x i8] c"shadowing.c\00"
@.str.2 = [5 x i8] c"main\00"
define void @main() {
%1 = alloca i32
store i32 3, i32* %1
%2 = load i32, i32* %1
%3 = icmp eq i32 %2, 3
br i1 %3, label %4, label %5
4: ; preds = %0
br label %7
5: ; preds = %0
%6 = call i32 @__assert_fail(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i32 12, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
br label %7
7: ; preds = %5, %4
%8 = call i32 (...) @check_global()
ret void
}

LLVM IR (-O2):
define void @main() {
%1 = tail call i32 (...) @check_global()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ clang_analyzer_eval(int);
scalar_t__ strncasecmp(char *, char *, int);
void strncasecmp_embedded_null() {
  clang_analyzer_eval(strncasecmp("ab\0zz", "ab\0yy", 4) == 0);
}


x86 assembly (clang, -O0):
<strncasecmp_embedded_null>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
lea    0xed4(%rip),%rsi
mov    $0x4,%edx
call   1030 <strncasecmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <clang_analyzer_eval@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<strncasecmp_embedded_null>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0xed7(%rip),%rsi
mov    $0x4,%edx
call   1030 <strncasecmp@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
pop    %rax
jmp    1040 <clang_analyzer_eval@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"ab\00zz\00"
@.str.1 = [6 x i8] c"ab\00yy\00"
define void @strncasecmp_embedded_null() {
%1 = call i64 @strncasecmp(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32 4)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @clang_analyzer_eval(i32 %3)
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"ab\00zz\00"
@.str.1 = [6 x i8] c"ab\00yy\00"
define void @strncasecmp_embedded_null() {
%1 = tail call i64 @strncasecmp(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32 4)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @clang_analyzer_eval(i32 %3)
ret void
}
long fact(int n) {
  long ans;
  for (ans = 1; n > 1; n--)
    ans *= n;
  return ans;
}


x86 assembly (clang, -O0):
<fact>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movq   $0x1,-0x10(%rbp)
cmpl   $0x1,-0x4(%rbp)
jle    1134 <fact+0x34>
movslq -0x4(%rbp),%rax
imul   -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x4(%rbp)
jmp    110f <fact+0xf>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fact>:
mov    $0x1,%eax
cmp    $0x2,%edi
jl     1131 <fact+0x31>
mov    %edi,%ecx
mov    $0x1,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
imul   %rcx,%rax
lea    -0x1(%rcx),%rdx
cmp    $0x2,%rcx
mov    %rdx,%rcx
ja     1120 <fact+0x20>
ret

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

LLVM IR (-O2):
define i64 @fact(i32 %0) {
%2 = icmp sgt i32 %0, 1
br i1 %2, label %3, label %11
3: ; preds = %1
%4 = zext i32 %0 to i64
br label %5
5: ; preds = %3, %5
%6 = phi i64 [ %4, %3 ], [ %9, %5 ]
%7 = phi i64 [ 1, %3 ], [ %8, %5 ]
%8 = mul nsw i64 %7, %6
%9 = add nsw i64 %6, -1
%10 = icmp ugt i64 %6, 2
br i1 %10, label %5, label %11
11: ; preds = %5, %1
%12 = phi i64 [ 1, %1 ], [ %8, %5 ]
ret i64 %12
}
/* Type definitions */
struct stat {
  int dummy;
};

/* Variables and functions */
int stat(char *, struct stat *);
int check_path(char *path) {
  struct stat sb;
  return stat(path, &sb);
}


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

x86 assembly (clang, -O2):
<check_path>:
push   %rax
mov    %rsp,%rsi
call   1030 <stat@plt>
pop    %rcx
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
define i32 @check_path(i8* %0) {
%2 = alloca i8*
%3 = alloca %struct.stat
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @stat(i8* %4, %struct.stat* %3)
ret i32 %5
}

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @check_path(i8* nocapture %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i32 @stat(i8* %0, %struct.stat* %2)
ret i32 %4
}
void RAND_add(const void *buf, int num, double entropy) {}


x86 assembly (clang, -O0):
<RAND_add>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movsd  %xmm0,-0x18(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @RAND_add(i8* %0, i32 %1, double %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca double
store i8* %0, i8** %4
store i32 %1, i32* %5
store double %2, double* %6
ret void
}

LLVM IR (-O2):
define void @RAND_add(i8* nocapture %0, i32 %1, double %2) {
ret void
}
void __libc_finalize(void) {}


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

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

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

LLVM IR (-O2):
define void @__libc_finalize() {
ret void
}