xunge/DecIR huggingface dataset:
/* Variables and functions */
int pivot(int *, int, int);
void quick_sort_rec(int *a, int izq, int der) {
  int piv;
  if (der > izq) {
    piv = pivot(a, izq, der);
    quick_sort_rec(a, izq, piv - 1);
    quick_sort_rec(a, piv + 1, der);
  }
  return;
}


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

x86 assembly (clang, -O2):
<quick_sort_rec>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
cmp    %esi,%edx
jle    1166 <quick_sort_rec+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 <pivot@plt>
mov    %eax,%ebx
lea    -0x1(%rbx),%edx
mov    %r15,%rdi
mov    %ebp,%esi
call   1030 <quick_sort_rec@plt>
add    $0x1,%ebx
mov    %ebx,%ebp
cmp    %r14d,%ebx
jl     1140 <quick_sort_rec+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @quick_sort_rec(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* %6
%9 = load i32, i32* %5
%10 = icmp sgt 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 @pivot(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 @quick_sort_rec(i32* %0, i32 %1, i32 %2) {
%4 = icmp sgt i32 %2, %1
br i1 %4, label %5, label %11
5: ; preds = %3, %5
%6 = phi i32 [ %9, %5 ], [ %1, %3 ]
%7 = tail call i32 @pivot(i32* %0, i32 %6, i32 %2)
%8 = add nsw i32 %7, -1
tail call void @quick_sort_rec(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 */
int /*<<< orphan*/ grn_expr_parserFinalize(void *);
void stub1(void *);
void grn_expr_parserFree(void *p, void (*freeProc)(void *)) {
  if (p == 0)
    return;
  grn_expr_parserFinalize(p);
  (*freeProc)(p);
}


x86 assembly (clang, -O0):
<grn_expr_parserFree>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1130 <grn_expr_parserFree+0x20>
jmp    1143 <grn_expr_parserFree+0x33>
mov    -0x8(%rbp),%rdi
call   1030 <grn_expr_parserFinalize@plt>
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rdi
call   *%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<grn_expr_parserFree>:
test   %rdi,%rdi
je     1133 <grn_expr_parserFree+0x23>
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    %rsi,%r14
call   1030 <grn_expr_parserFinalize@plt>
mov    %rbx,%rdi
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    *%rax
ret

LLVM IR (-O0):
define void @grn_expr_parserFree(i8* %0, void (i8*)* %1) {
%3 = alloca i8*
%4 = alloca void (i8*)*
store i8* %0, i8** %3
store void (i8*)* %1, void (i8*)** %4
%5 = load i8*, i8** %3
%6 = icmp eq i8* %5, null
br i1 %6, label %7, label %8
7: ; preds = %2
br label %13
8: ; preds = %2
%9 = load i8*, i8** %3
%10 = call i32 @grn_expr_parserFinalize(i8* %9)
%11 = load void (i8*)*, void (i8*)** %4
%12 = load i8*, i8** %3
br label %13
13: ; preds = %8, %7
ret void
}

LLVM IR (-O2):
define void @grn_expr_parserFree(i8* %0, void (i8*)* nocapture %1) {
%3 = icmp eq i8* %0, null
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i32 @grn_expr_parserFinalize(i8* %0)
tail call void %1(i8* %0)
br label %6
6: ; preds = %2, %4
ret void
}
/* Variables and functions */
void *compat_realloc(void *, size_t);
int /*<<< orphan*/ memory_add_entry(void *, size_t, char const *, int);
int /*<<< orphan*/ memory_remove_entry(void *, char const *, int);
void *memory_realloc(void *ptr, size_t size, const char *srcname, int line) {
  void *p;
  p = compat_realloc(ptr, size);
  memory_remove_entry(ptr, srcname, line);
  memory_add_entry(p, size, srcname, line);
  return p;
}


x86 assembly (clang, -O0):
<memory_realloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <compat_realloc@plt>
mov    %rax,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x1c(%rbp),%edx
call   1050 <memory_remove_entry@plt>
mov    -0x28(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
call   1040 <memory_add_entry@plt>
mov    -0x28(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<memory_realloc>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %ecx,%r14d
mov    %rdx,%r15
mov    %rsi,%r12
mov    %rdi,%rbx
call   1030 <compat_realloc@plt>
mov    %rax,%rbp
mov    %rbx,%rdi
mov    %r15,%rsi
mov    %r14d,%edx
call   1050 <memory_remove_entry@plt>
mov    %rbp,%rdi
mov    %r12,%rsi
mov    %r15,%rdx
mov    %r14d,%ecx
call   1040 <memory_add_entry@plt>
mov    %rbp,%rax
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i8* @memory_realloc(i8* %0, i64 %1, i8* %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i8*
%8 = alloca i32
%9 = alloca i8*
store i8* %0, i8** %5
store i64 %1, i64* %6
store i8* %2, i8** %7
store i32 %3, i32* %8
%10 = load i8*, i8** %5
%11 = load i64, i64* %6
%12 = call i8* @compat_realloc(i8* %10, i64 %11)
store i8* %12, i8** %9
%13 = load i8*, i8** %5
%14 = load i8*, i8** %7
%15 = load i32, i32* %8
%16 = call i32 @memory_remove_entry(i8* %13, i8* %14, i32 %15)
%17 = load i8*, i8** %9
%18 = load i64, i64* %6
%19 = load i8*, i8** %7
%20 = load i32, i32* %8
%21 = call i32 @memory_add_entry(i8* %17, i64 %18, i8* %19, i32 %20)
%22 = load i8*, i8** %9
ret i8* %22
}

LLVM IR (-O2):
define i8* @memory_realloc(i8* %0, i64 %1, i8* %2, i32 %3) {
%5 = tail call i8* @compat_realloc(i8* %0, i64 %1)
%6 = tail call i32 @memory_remove_entry(i8* %0, i8* %2, i32 %3)
%7 = tail call i32 @memory_add_entry(i8* %5, i64 %1, i8* %2, i32 %3)
ret i8* %5
}
/* Variables and functions */
double M_PI;
double deg_rad(double ang) { return ang * (M_PI / 180.0); }


x86 assembly (clang, -O0):
<deg_rad>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
mov    0x2ed3(%rip),%rax
movsd  (%rax),%xmm1
movsd  0xedf(%rip),%xmm2
divsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<deg_rad>:
mov    0x2ee1(%rip),%rax
movsd  (%rax),%xmm1
divsd  0xeed(%rip),%xmm1
mulsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
@M_PI = global double 0.000000e+00
define double @deg_rad(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = load double, double* @M_PI
%5 = fdiv double %4, 1.800000e+02
%6 = fmul double %3, %5
ret double %6
}

LLVM IR (-O2):
@M_PI = global double 0.000000e+00
define double @deg_rad(double %0) {
%2 = load double, double* @M_PI
%3 = fdiv double %2, 1.800000e+02
%4 = fmul double %3, %0
ret double %4
}
/* Variables and functions */
scalar_t__ malloc(int);
int *create_coord(void) {
  int *res;
  if (!(res = (int *)malloc(sizeof(int) * 4)))
    return (0);
  res[0] = 3;
  res[1] = 0;
  res[2] = 3;
  res[3] = 0;
  return (res);
}


x86 assembly (clang, -O0):
<create_coord>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x10,%edi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
jne    113d <create_coord+0x2d>
movq   $0x0,-0x8(%rbp)
jmp    1170 <create_coord+0x60>
mov    -0x10(%rbp),%rax
movl   $0x3,(%rax)
mov    -0x10(%rbp),%rax
movl   $0x0,0x4(%rax)
mov    -0x10(%rbp),%rax
movl   $0x3,0x8(%rax)
mov    -0x10(%rbp),%rax
movl   $0x0,0xc(%rax)
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<create_coord>:
push   %rax
mov    $0x10,%edi
call   1030 <malloc@plt>
test   %rax,%rax
je     112c <create_coord+0x1c>
movaps 0xed9(%rip),%xmm0
movups %xmm0,(%rax)
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32* @create_coord() {
%1 = tail call i64 @malloc(i32 16)
%2 = icmp eq i64 %1, 0
br i1 %2, label %6, label %3
3: ; preds = %0
%4 = inttoptr i64 %1 to i32*
%5 = inttoptr i64 %1 to <4 x i32>*
store <4 x i32> <i32 3, i32 0, i32 3, i32 0>, <4 x i32>* %5
br label %6
6: ; preds = %0, %3
%7 = phi i32* [ %4, %3 ], [ null, %0 ]
ret i32* %7
}
int security_inode_follow_link(struct dentry *dentry, struct nameidata *nd) {
  return 0;
}


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

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

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

LLVM IR (-O2):
%struct.dentry = type opaque
%struct.nameidata = type opaque
define i32 @security_inode_follow_link(%struct.dentry* nocapture readnone %0, %struct.nameidata* nocapture readnone %1) {
ret i32 0
}
void wait(int time) {
  int ct = 0;
  int i = 0;
  while (ct < time) {
    i = 0;
    while (i++ < 1000)
      ;
    { ct++; }
  }
}


x86 assembly (clang, -O0):
<wait>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1151 <wait+0x51>
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0xc(%rbp)
cmp    $0x3e8,%eax
jge    1143 <wait+0x43>
jmp    1128 <wait+0x28>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1115 <wait+0x15>
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @wait(i32 %0) {
ret void
}
int IsBigEndian() {
  union {
    unsigned int i;
    char c[4];
  } bint = {0x01020304};
  return bint.c[0] == 1;
}


x86 assembly (clang, -O0):
<IsBigEndian>:
push   %rbp
mov    %rsp,%rbp
mov    0xef6(%rip),%eax
mov    %eax,-0x8(%rbp)
movsbl -0x8(%rbp),%eax
cmp    $0x1,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%union.anon = type { i32 }
@__const.IsBigEndian.bint = %union.anon { i32 16909060 }
define i32 @IsBigEndian() {
%1 = alloca %union.anon
%2 = bitcast %union.anon* %1 to i8*
%3 = bitcast %union.anon* %1 to [4 x i8]*
%4 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 0
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = icmp eq i32 %6, 1
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @IsBigEndian() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void safe_free(void *ptr) {
  free(*((void **)ptr));
  *((void **)ptr) = NULL;
}


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

x86 assembly (clang, -O2):
<safe_free>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%rdi
call   1030 <free@plt>
movq   $0x0,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @safe_free(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to i8**
%5 = load i8*, i8** %4
%6 = call i32 @free(i8* %5)
%7 = load i8*, i8** %2
%8 = bitcast i8* %7 to i8**
store i8* null, i8** %8
ret void
}

LLVM IR (-O2):
define void @safe_free(i8* nocapture %0) {
%2 = bitcast i8* %0 to i8**
%3 = load i8*, i8** %2
%4 = tail call i32 @free(i8* %3)
store i8* null, i8** %2
ret void
}
void dummy_init_fn(void) {}


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

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

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

LLVM IR (-O2):
define void @dummy_init_fn() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ allocator_always_fail();
int /*<<< orphan*/ allocator_free(int /*<<< orphan*/, int /*<<< orphan*/);
void _ensure_allocator_free_copes_with_null_address(void) {
  allocator_free(0, allocator_always_fail());
}


x86 assembly (clang, -O0):
<_ensure_allocator_free_copes_with_null_address>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <allocator_always_fail@plt>
mov    %eax,%esi
xor    %edi,%edi
call   1030 <allocator_free@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<_ensure_allocator_free_copes_with_null_address>:
push   %rax
xor    %eax,%eax
call   1040 <allocator_always_fail@plt>
xor    %edi,%edi
mov    %eax,%esi
pop    %rax
jmp    1030 <allocator_free@plt>

LLVM IR (-O0):
define void @_ensure_allocator_free_copes_with_null_address() {
%1 = call i32 (...) @allocator_always_fail()
%2 = call i32 @allocator_free(i32 0, i32 %1)
ret void
}

LLVM IR (-O2):
define void @_ensure_allocator_free_copes_with_null_address() {
%1 = tail call i32 (...) @allocator_always_fail()
%2 = tail call i32 @allocator_free(i32 0, i32 %1)
ret void
}
char *os_compatible_path(char *str) { return (str); }


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

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

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

LLVM IR (-O2):
define i8* @os_compatible_path(i8* readnone returned %0) {
ret i8* %0
}
unsigned char *backward_tcompressed_word(end, begin, delim, len, outtail, flags)
unsigned char *begin, *end, *delim;
int len, outtail, flags;
{ return end; }


x86 assembly (clang, -O0):
<backward_tcompressed_word>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8d,-0x20(%rbp)
mov    %r9d,-0x24(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i8* @backward_tcompressed_word(i8* readnone returned %0, i8* nocapture readnone %1, i8* nocapture readnone %2, i32 %3, i32 %4, i32 %5) {
ret i8* %0
}
/* Type definitions */
typedef scalar_t__ uint64_t;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, scalar_t__);
void hex_out(FILE *fp, uint64_t data[], uint64_t size) {
  uint64_t i;
  for (i = 0; i < size; i++)
    fprintf(fp, "%016lx", data[size - i - 1]);
  return;
}


x86 assembly (clang, -O0):
<hex_out>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x18(%rbp),%rax
jge    116f <hex_out+0x5f>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%rcx
sub    -0x20(%rbp),%rcx
sub    $0x1,%rcx
mov    (%rax,%rcx,8),%rdx
lea    0xea7(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    112c <hex_out+0x1c>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hex_out>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %rdx,%rdx
jle    1146 <hex_out+0x36>
mov    %rdx,%rbx
mov    %rsi,%r14
mov    %rdi,%r15
lea    0xed3(%rip),%r12
nopl   (%rax)
mov    -0x8(%r14,%rbx,8),%rdx
mov    %r15,%rdi
mov    %r12,%rsi
call   1030 <fprintf@plt>
add    $0xffffffffffffffff,%rbx
jne    1130 <hex_out+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [7 x i8] c"%016lx\00"
define void @hex_out(i32* %0, i64* %1, i64 %2) {
%4 = alloca i32*
%5 = alloca i64*
%6 = alloca i64
%7 = alloca i64
store i32* %0, i32** %4
store i64* %1, i64** %5
store i64 %2, i64* %6
store i64 0, i64* %7
br label %8
8: ; preds = %22, %3
%9 = load i64, i64* %7
%10 = load i64, i64* %6
%11 = icmp slt i64 %9, %10
br i1 %11, label %12, label %25
12: ; preds = %8
%13 = load i32*, i32** %4
%14 = load i64*, i64** %5
%15 = load i64, i64* %6
%16 = load i64, i64* %7
%17 = sub nsw i64 %15, %16
%18 = sub nsw i64 %17, 1
%19 = getelementptr inbounds i64, i64* %14, i64 %18
%20 = load i64, i64* %19
%21 = call i32 @fprintf(i32* %13, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i64 %20)
br label %22
22: ; preds = %12
%23 = load i64, i64* %7
%24 = add nsw i64 %23, 1
store i64 %24, i64* %7
br label %8
25: ; preds = %8
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"%016lx\00"
define void @hex_out(i32* nocapture %0, i64* nocapture %1, i64 %2) {
%4 = icmp sgt i64 %2, 0
br i1 %4, label %5, label %14
5: ; preds = %3, %5
%6 = phi i64 [ %12, %5 ], [ 0, %3 ]
%7 = xor i64 %6, -1
%8 = add i64 %7, %2
%9 = getelementptr inbounds i64, i64* %1, i64 %8
%10 = load i64, i64* %9
%11 = tail call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i64 %10)
%12 = add nuw nsw i64 %6, 1
%13 = icmp eq i64 %12, %2
br i1 %13, label %14, label %5
14: ; preds = %5, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ tone(int);
void win_sound() {
  tone(3);
  tone(4);
  tone(5);
  tone(4);
  tone(5);
}


x86 assembly (clang, -O0):
<win_sound>:
push   %rbp
mov    %rsp,%rbp
mov    $0x3,%edi
call   1030 <tone@plt>
mov    $0x4,%edi
call   1030 <tone@plt>
mov    $0x5,%edi
call   1030 <tone@plt>
mov    $0x4,%edi
call   1030 <tone@plt>
mov    $0x5,%edi
call   1030 <tone@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<win_sound>:
push   %rax
mov    $0x3,%edi
call   1030 <tone@plt>
mov    $0x4,%edi
call   1030 <tone@plt>
mov    $0x5,%edi
call   1030 <tone@plt>
mov    $0x4,%edi
call   1030 <tone@plt>
mov    $0x5,%edi
pop    %rax
jmp    1030 <tone@plt>

LLVM IR (-O0):
define void @win_sound() {
%1 = call i32 @tone(i32 3)
%2 = call i32 @tone(i32 4)
%3 = call i32 @tone(i32 5)
%4 = call i32 @tone(i32 4)
%5 = call i32 @tone(i32 5)
ret void
}

LLVM IR (-O2):
define void @win_sound() {
%1 = tail call i32 @tone(i32 3)
%2 = tail call i32 @tone(i32 4)
%3 = tail call i32 @tone(i32 5)
%4 = tail call i32 @tone(i32 4)
%5 = tail call i32 @tone(i32 5)
ret void
}
/* Variables and functions */
float log(double);
float pressure_to_height(float pressure) {
  return (float)-7.2 * log((double)pressure / 1012.5);
}


x86 assembly (clang, -O0):
<pressure_to_height>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xeda(%rip),%xmm1
divsd  %xmm1,%xmm0
call   1030 <log@plt>
movaps %xmm0,%xmm1
movss  0xebe(%rip),%xmm0
mulss  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pressure_to_height>:
push   %rax
cvtss2sd %xmm0,%xmm0
divsd  0xee3(%rip),%xmm0
call   1030 <log@plt>
mulss  0xede(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @pressure_to_height(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fpext float %3 to double
%5 = fdiv double %4, 1.012500e+03
%6 = call float @log(double %5)
%7 = fmul float 0xC01CCCCCC0000000, %6
ret float %7
}

LLVM IR (-O2):
define float @pressure_to_height(float %0) {
%2 = fpext float %0 to double
%3 = fdiv double %2, 1.012500e+03
%4 = tail call float @log(double %3)
%5 = fmul float %4, 0xC01CCCCCC0000000
ret float %5
}
/* Type definitions */
struct charset {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ _(char *);
int /*<<< orphan*/ error(int /*<<< orphan*/, char const *);
struct charset *lookup_charset(char const *);
struct charset *lookup_charset_or_error(const char *name) {
  struct charset *cs = lookup_charset(name);
  if (!cs)
    error(_("GDB doesn't know of any character set named `%s'."), name);
  return cs;
}


x86 assembly (clang, -O0):
<lookup_charset_or_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <lookup_charset@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    116b <lookup_charset_or_error+0x3b>
lea    0xea5(%rip),%rdi
call   1030 <_@plt>
mov    %eax,%edi
mov    -0x8(%rbp),%rsi
call   1050 <error@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lookup_charset_or_error>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <lookup_charset@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    115a <lookup_charset_or_error+0x2a>
lea    0xeb5(%rip),%rdi
call   1030 <_@plt>
mov    %eax,%edi
mov    %r14,%rsi
call   1050 <error@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.charset = type { i32 }
@.str = [50 x i8] c"GDB doesn't know of any character set named `%s'.\00"
define %struct.charset* @lookup_charset_or_error(i8* %0) {
%2 = alloca i8*
%3 = alloca %struct.charset*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call %struct.charset* @lookup_charset(i8* %4)
store %struct.charset* %5, %struct.charset** %3
%6 = load %struct.charset*, %struct.charset** %3
%7 = icmp ne %struct.charset* %6, null
br i1 %7, label %12, label %8
8: ; preds = %1
%9 = call i32 @_(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str, i64 0, i64 0))
%10 = load i8*, i8** %2
%11 = call i32 @error(i32 %9, i8* %10)
br label %12
12: ; preds = %8, %1
%13 = load %struct.charset*, %struct.charset** %3
ret %struct.charset* %13
}

LLVM IR (-O2):
%struct.charset = type { i32 }
@.str = [50 x i8] c"GDB doesn't know of any character set named `%s'.\00"
define %struct.charset* @lookup_charset_or_error(i8* %0) {
%2 = tail call %struct.charset* @lookup_charset(i8* %0)
%3 = icmp eq %struct.charset* %2, null
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = tail call i32 @_(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str, i64 0, i64 0))
%6 = tail call i32 @error(i32 %5, i8* %0)
br label %7
7: ; preds = %4, %1
ret %struct.charset* %2
}
/* Variables and functions */
int /*<<< orphan*/ op_to_dn(char *, int, int /*<<< orphan*/);
void i_add_dn(void) { op_to_dn("add", 1, 0); }


x86 assembly (clang, -O0):
<i_add_dn>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x1,%esi
xor    %edx,%edx
call   1030 <op_to_dn@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<i_add_dn>:
lea    0xee9(%rip),%rdi
mov    $0x1,%esi
xor    %edx,%edx
jmp    1030 <op_to_dn@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"add\00"
define void @i_add_dn() {
%1 = tail call i32 @op_to_dn(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 1, i32 0)
ret void
}
unsigned int servoPwmPca9685DutyMsToValue(unsigned int dutyms) {
  return (4096 * dutyms / (20 * 1000));
}


x86 assembly (clang, -O0):
<servoPwmPca9685DutyMsToValue>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0xc,%eax
mov    $0x4e20,%ecx
xor    %edx,%edx
div    %ecx
pop    %rbp
ret

x86 assembly (clang, -O2):
<servoPwmPca9685DutyMsToValue>:
shl    $0xc,%edi
mov    $0xd1b71759,%eax
imul   %rdi,%rax
shr    $0x2e,%rax
ret

LLVM IR (-O0):
define i32 @servoPwmPca9685DutyMsToValue(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = mul i32 4096, %3
%5 = udiv i32 %4, 20000
ret i32 %5
}

LLVM IR (-O2):
define i32 @servoPwmPca9685DutyMsToValue(i32 %0) {
%2 = shl i32 %0, 12
%3 = udiv i32 %2, 20000
ret i32 %3
}
/* Variables and functions */
scalar_t__ randmt();
float randu32(void) { return ((float)randmt() + 0.5) * (1.0 / 4294967296.0); }


x86 assembly (clang, -O0):
<randu32>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <randmt@plt>
cvtsi2ss %rax,%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xedc(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  0xec8(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<randu32>:
push   %rax
xor    %eax,%eax
call   1030 <randmt@plt>
cvtsi2ss %rax,%xmm0
cvtss2sd %xmm0,%xmm0
addsd  0xed7(%rip),%xmm0
mulsd  0xed7(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @randu32() {
%1 = call i64 (...) @randmt()
%2 = sitofp i64 %1 to float
%3 = fpext float %2 to double
%4 = fadd double %3, 5.000000e-01
%5 = fmul double %4, 0x3DF0000000000000
%6 = fptrunc double %5 to float
ret float %6
}

LLVM IR (-O2):
define float @randu32() {
%1 = tail call i64 (...) @randmt()
%2 = sitofp i64 %1 to float
%3 = fpext float %2 to double
%4 = fadd double %3, 5.000000e-01
%5 = fmul double %4, 0x3DF0000000000000
%6 = fptrunc double %5 to float
ret float %6
}
/* Variables and functions */
int /*<<< orphan*/ __console_tx_char(unsigned char);
void print_notice_char(unsigned char byte) { __console_tx_char(byte); }


x86 assembly (clang, -O0):
<print_notice_char>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%edi
call   1030 <__console_tx_char@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_notice_char>:
jmp    1030 <__console_tx_char@plt>

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

LLVM IR (-O2):
define void @print_notice_char(i8 zeroext %0) {
%2 = tail call i32 @__console_tx_char(i8 zeroext %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void get_architecture(void) { printf("LOONGARCH64"); }


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

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

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

LLVM IR (-O2):
@.str = [12 x i8] c"LOONGARCH64\00"
define void @get_architecture() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ resetClosureContext(int);
int /*<<< orphan*/ switchActiveContext(int);
int primitiveContext_Retry(int receiver, int *arguments) {
  resetClosureContext(receiver);
  switchActiveContext(receiver);
  return receiver;
}


x86 assembly (clang, -O0):
<primitiveContext_Retry>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <resetClosureContext@plt>
mov    -0x4(%rbp),%edi
call   1030 <switchActiveContext@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<primitiveContext_Retry>:
push   %rbx
mov    %edi,%ebx
call   1040 <resetClosureContext@plt>
mov    %ebx,%edi
call   1030 <switchActiveContext@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @primitiveContext_Retry(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 = call i32 @resetClosureContext(i32 %5)
%7 = load i32, i32* %3
%8 = call i32 @switchActiveContext(i32 %7)
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
define i32 @primitiveContext_Retry(i32 returned %0, i32* nocapture readnone %1) {
%3 = tail call i32 @resetClosureContext(i32 %0)
%4 = tail call i32 @switchActiveContext(i32 %0)
ret i32 %0
}
/* Type definitions */
typedef scalar_t__ uint32_t;

/* Variables and functions */
scalar_t__ const UINT16_MAX;
uint32_t __stdfix_sat_uhk(const uint32_t x) {
  if (x > UINT16_MAX)
    return (UINT16_MAX);
  return (x);
}


x86 assembly (clang, -O0):
<__stdfix_sat_uhk>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x2ecd(%rip),%rcx
cmp    (%rcx),%rax
jle    112f <__stdfix_sat_uhk+0x2f>
mov    0x2ebd(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x8(%rbp)
jmp    1137 <__stdfix_sat_uhk+0x37>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__stdfix_sat_uhk>:
mov    %rdi,%rax
sar    $0x3f,%rax
and    %rdi,%rax
ret

LLVM IR (-O0):
@UINT16_MAX = constant i64 0
define i64 @__stdfix_sat_uhk(i64 %0) {
%2 = alloca i64
%3 = alloca i64
store i64 %0, i64* %3
%4 = load i64, i64* %3
%5 = load i64, i64* @UINT16_MAX
%6 = icmp sgt i64 %4, %5
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = load i64, i64* @UINT16_MAX
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, %7
%12 = load i64, i64* %2
ret i64 %12
}

LLVM IR (-O2):
@UINT16_MAX = constant i64 0
define i64 @__stdfix_sat_uhk(i64 %0) {
%2 = icmp slt i64 %0, 0
%3 = select i1 %2, i64 %0, i64 0
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, double);
int main(void) {
  printf("%-8.1f\n", 800.23);
  printf("%10.6f\n", 30.253);
  printf("%-8.3f\n", 83.162212);
  printf("%6.0f\n", 3422.0000009979);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xefa(%rip),%rdi
movsd  0xeea(%rip),%xmm0
call   1030 <printf@plt>
lea    0xeee(%rip),%rdi
movsd  0xece(%rip),%xmm0
call   1030 <printf@plt>
lea    0xee2(%rip),%rdi
movsd  0xeb2(%rip),%xmm0
call   1030 <printf@plt>
lea    0xed6(%rip),%rdi
movsd  0xe96(%rip),%xmm0
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xf08(%rip),%rdi
movsd  0xee0(%rip),%xmm0
call   1030 <printf@plt>
lea    0xefc(%rip),%rdi
movsd  0xed4(%rip),%xmm0
call   1030 <printf@plt>
lea    0xef0(%rip),%rdi
movsd  0xec8(%rip),%xmm0
call   1030 <printf@plt>
lea    0xee4(%rip),%rdi
movsd  0xebc(%rip),%xmm0
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [8 x i8] c"%-8.1f\0A\00"
@.str.1 = [8 x i8] c"%10.6f\0A\00"
@.str.2 = [8 x i8] c"%-8.3f\0A\00"
@.str.3 = [7 x i8] c"%6.0f\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), double 8.002300e+02)
%3 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), double 3.025300e+01)
%4 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), double 0x4054CA61AE70C133)
%5 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), double 0x40AABC0000217BE5)
ret i32 0
}

LLVM IR (-O2):
@.str = [8 x i8] c"%-8.1f\0A\00"
@.str.1 = [8 x i8] c"%10.6f\0A\00"
@.str.2 = [8 x i8] c"%-8.3f\0A\00"
@.str.3 = [7 x i8] c"%6.0f\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), double 8.002300e+02)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), double 3.025300e+01)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), double 0x4054CA61AE70C133)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), double 0x40AABC0000217BE5)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ dod_exit(char *, char const *);
scalar_t__ errno;
double strtod(char const *, char **);
double dod_strtod(char const *s) {
  char *p;
  errno = 0;
  double f = strtod(s, &p);
  if ((errno != 0) || p[0])
    dod_exit("dod:invalid double:<%s>", s);
  return f;
}


x86 assembly (clang, -O0):
<dod_strtod>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
movq   $0x0,(%rax)
mov    -0x8(%rbp),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <strtod@plt>
movsd  %xmm0,-0x18(%rbp)
mov    0x2e8d(%rip),%rax
cmpq   $0x0,(%rax)
jne    116d <dod_strtod+0x4d>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     117d <dod_strtod+0x5d>
mov    -0x8(%rbp),%rsi
lea    0xe88(%rip),%rdi
call   1030 <dod_exit@plt>
movsd  -0x18(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dod_strtod>:
push   %r14
push   %rbx
sub    $0x18,%rsp
mov    %rdi,%rbx
mov    0x2eaf(%rip),%r14
movq   $0x0,(%r14)
lea    0x10(%rsp),%rsi
call   1040 <strtod@plt>
cmpq   $0x0,(%r14)
jne    1152 <dod_strtod+0x32>
mov    0x10(%rsp),%rax
cmpb   $0x0,(%rax)
je     116d <dod_strtod+0x4d>
lea    0xea7(%rip),%rdi
mov    %rbx,%rsi
movsd  %xmm0,0x8(%rsp)
call   1030 <dod_exit@plt>
movsd  0x8(%rsp),%xmm0
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@errno = global i64 0
@.str = [24 x i8] c"dod:invalid double:<%s>\00"
define double @dod_strtod(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca double
store i8* %0, i8** %2
store i64 0, i64* @errno
%5 = load i8*, i8** %2
%6 = call double @strtod(i8* %5, i8** %3)
store double %6, double* %4
%7 = load i64, i64* @errno
%8 = icmp ne i64 %7, 0
br i1 %8, label %15, label %9
9: ; preds = %1
%10 = load i8*, i8** %3
%11 = getelementptr inbounds i8, i8* %10, i64 0
%12 = load i8, i8* %11
%13 = sext i8 %12 to i32
%14 = icmp ne i32 %13, 0
br i1 %14, label %15, label %18
15: ; preds = %9, %1
%16 = load i8*, i8** %2
%17 = call i32 @dod_exit(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* %16)
br label %18
18: ; preds = %15, %9
%19 = load double, double* %4
ret double %19
}

LLVM IR (-O2):
@errno = global i64 0
@.str = [24 x i8] c"dod:invalid double:<%s>\00"
define double @dod_strtod(i8* %0) {
%2 = alloca i8*
%3 = bitcast i8** %2 to i8*
store i64 0, i64* @errno
%4 = call double @strtod(i8* %0, i8** %2)
%5 = load i64, i64* @errno
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %11
7: ; preds = %1
%8 = load i8*, i8** %2
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 0
br i1 %10, label %13, label %11
11: ; preds = %7, %1
%12 = tail call i32 @dod_exit(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* %0)
br label %13
13: ; preds = %11, %7
ret double %4
}
/* Type definitions */
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int32_t funge_extn_load(int32_t fingerprint) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @funge_extn_load(i32 %0) {
ret i32 0
}
void test_arguments(void) { printf("\nStarting test %s():%d\n", __func__, 24); }


x86 assembly (clang, -O0):
<test_arguments>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
lea    0xef6(%rip),%rsi
mov    $0x18,%edx
mov    $0x0,%al
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_arguments>:
lea    0xee9(%rip),%rdi
lea    0xefa(%rip),%rsi
mov    $0x18,%edx
xor    %eax,%eax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [24 x i8] c"\0AStarting test %s():%d\0A\00"
@__func__.test_arguments = [15 x i8] c"test_arguments\00"
define void @test_arguments() {
%1 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @__func__.test_arguments, i64 0, i64 0), i32 24)
ret void
}

LLVM IR (-O2):
@.str = [24 x i8] c"\0AStarting test %s():%d\0A\00"
@__func__.test_arguments = [15 x i8] c"test_arguments\00"
define void @test_arguments() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @__func__.test_arguments, i64 0, i64 0), i32 24)
ret void
}
__attribute__((section("raw_tracepoint/sched_process_exec"), used)) int
sched_process_exec(struct bpf_args *ctx) {
  return 0;
}


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

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

LLVM IR (-O0):
%struct.bpf_args = type opaque
@llvm.compiler.used = appending global [1 x i8*] [i8* bitcast (i32 (%struct.bpf_args*)* @sched_process_exec to i8*)], section "llvm.metadata"
define i32 @sched_process_exec(%struct.bpf_args* %0) section "raw_tracepoint/sched_process_exec" {
%2 = alloca %struct.bpf_args*
store %struct.bpf_args* %0, %struct.bpf_args** %2
ret i32 0
}

LLVM IR (-O2):
%struct.bpf_args = type opaque
@llvm.compiler.used = appending global [1 x i8*] [i8* bitcast (i32 (%struct.bpf_args*)* @sched_process_exec to i8*)], section "llvm.metadata"
define i32 @sched_process_exec(%struct.bpf_args* nocapture readnone %0) section "raw_tracepoint/sched_process_exec" {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
void quitHandler(int sig) {
  printf("Extiting");
  exit(0);
}


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

x86 assembly (clang, -O2):
<quitHandler>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"Extiting\00"
define void @quitHandler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [9 x i8] c"Extiting\00"
define void @quitHandler(i32 %0) {
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int floor(float);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, float *);
int main(void) {
  float num;
  int y;
  printf("Input your number\n");
  scanf("%f", &num);
  y = floor(num + .5);
  printf("%d   %f", y, num);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xec2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xecc(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe92(%rip),%xmm1
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
call   1050 <floor@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%esi
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe8a(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec4(%rip),%rdi
call   1030 <puts@plt>
lea    0xeb5(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
movss  0x4(%rsp),%xmm0
addss  0xe94(%rip),%xmm0
call   1060 <floor@plt>
movss  0x4(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe82(%rip),%rdi
mov    %eax,%esi
mov    $0x1,%al
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [19 x i8] c"Input your number\0A\00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [8 x i8] c"%d %f\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %2)
%6 = load float, float* %2
%7 = fpext float %6 to double
%8 = fadd double %7, 5.000000e-01
%9 = fptrunc double %8 to float
%10 = call i32 @floor(float %9)
store i32 %10, i32* %3
%11 = load i32, i32* %3
%12 = load float, float* %2
%13 = fpext float %12 to double
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i32 %11, double %13)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [8 x i8] c"%d %f\00"
@str = [18 x i8] c"Input your number\00"
define i32 @main() {
%1 = alloca float
%2 = bitcast float* %1 to i8*
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %1)
%5 = load float, float* %1
%6 = fadd float %5, 5.000000e-01
%7 = call i32 @floor(float %6)
%8 = load float, float* %1
%9 = fpext float %8 to double
%10 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i32 %7, double %9)
ret i32 0
}
const char *stress_get_compiler(void) {
  static const char cc[] = "gcc "
                           "9"
                           "."
                           "4"
                           "";
  return cc;
}


x86 assembly (clang, -O0):
<stress_get_compiler>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<stress_get_compiler>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@stress_get_compiler.cc = internal constant [8 x i8] c"gcc 9.4\00"
define i8* @stress_get_compiler() {
ret i8* getelementptr inbounds ([8 x i8], [8 x i8]* @stress_get_compiler.cc, i64 0, i64 0)
}

LLVM IR (-O2):
@stress_get_compiler.cc = internal constant [8 x i8] c"gcc 9.4\00"
define i8* @stress_get_compiler() {
ret i8* getelementptr inbounds ([8 x i8], [8 x i8]* @stress_get_compiler.cc, i64 0, i64 0)
}
/* Type definitions */
typedef scalar_t__ uint64_t;

/* Variables and functions */
int numberOfLeadingZeros32(int);
int numberOfLeadingZeros64(scalar_t__);
int getEliasDeltaSize(uint64_t value) {
  if (value <= 0) {
    return -1;
  }
  int q = 64 - numberOfLeadingZeros64(value);
  int qq = 31 - numberOfLeadingZeros32(q);
  int len = qq + qq + q;
  return len;
}


x86 assembly (clang, -O0):
<getEliasDeltaSize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jg     1143 <getEliasDeltaSize+0x23>
movl   $0xffffffff,-0x4(%rbp)
jmp    117e <getEliasDeltaSize+0x5e>
mov    -0x10(%rbp),%rdi
call   1040 <numberOfLeadingZeros64@plt>
mov    %eax,%ecx
mov    $0x40,%eax
sub    %ecx,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
call   1030 <numberOfLeadingZeros32@plt>
mov    %eax,%ecx
mov    $0x1f,%eax
sub    %ecx,%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
add    -0x18(%rbp),%eax
add    -0x14(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getEliasDeltaSize>:
test   %rdi,%rdi
jle    1145 <getEliasDeltaSize+0x25>
push   %rbx
call   1040 <numberOfLeadingZeros64@plt>
mov    %eax,%ebx
mov    $0x40,%edi
sub    %eax,%edi
call   1030 <numberOfLeadingZeros32@plt>
lea    (%rbx,%rax,2),%ecx
mov    $0x7e,%eax
sub    %ecx,%eax
pop    %rbx
ret
mov    $0xffffffff,%eax
ret

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

LLVM IR (-O2):
define i32 @getEliasDeltaSize(i64 %0) {
%2 = icmp slt i64 %0, 1
br i1 %2, label %10, label %3
3: ; preds = %1
%4 = tail call i32 @numberOfLeadingZeros64(i64 %0)
%5 = sub nsw i32 64, %4
%6 = tail call i32 @numberOfLeadingZeros32(i32 %5)
%7 = mul i32 %6, -2
%8 = sub i32 126, %4
%9 = add i32 %8, %7
br label %10
10: ; preds = %1, %3
%11 = phi i32 [ %9, %3 ], [ -1, %1 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ sscanf(char const *const, char *, char *const);
void read_skip_c(const char *const line, char *const var) {
  sscanf(line, "%*s %s", var);
}


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

x86 assembly (clang, -O2):
<read_skip_c>:
mov    %rsi,%rdx
lea    0xee6(%rip),%rsi
jmp    1030 <sscanf@plt>

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

LLVM IR (-O2):
@.str = [7 x i8] c"%*s %s\00"
define void @read_skip_c(i8* nocapture %0, i8* %1) {
%3 = tail call i32 @sscanf(i8* %0, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %1)
ret void
}
void f6(void) {
#pragma omp critical(foo)
#pragma omp critical(bar)
  ;
#pragma omp critical
#pragma omp critical(baz)
  ;
}


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

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

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

LLVM IR (-O2):
define void @f6() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void FREE(void *_Memory) { free(_Memory); }


x86 assembly (clang, -O0):
<FREE>:
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):
<FREE>:
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @FREE(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 @FREE(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}