xunge/DecIR huggingface dataset:
/* Variables and functions */
char *__strpadl(char *, char, size_t, size_t);
size_t strlen(char *);
char *strpadl(char *str, char pad, size_t len) {
  size_t cur_len;
  char *dest;
  cur_len = strlen(str);
  if (cur_len >= len)
    return str;
  dest = __strpadl(str, pad, len, cur_len);
  *dest = '\0';
  return str;
}


x86 assembly (clang, -O0):
<strpadl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %sil,%al
mov    %rdi,-0x10(%rbp)
mov    %al,-0x11(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
cmp    -0x20(%rbp),%rax
jb     115e <strpadl+0x3e>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1188 <strpadl+0x68>
mov    -0x10(%rbp),%rdi
mov    -0x11(%rbp),%al
mov    -0x20(%rbp),%rdx
mov    -0x28(%rbp),%rcx
movsbl %al,%esi
call   1040 <__strpadl@plt>
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strpadl>:
push   %rbp
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %esi,%ebp
mov    %rdi,%rbx
call   1030 <strlen@plt>
cmp    %r14,%rax
jae    114b <strpadl+0x2b>
movsbl %bpl,%esi
mov    %rbx,%rdi
mov    %r14,%rdx
mov    %rax,%rcx
call   1040 <__strpadl@plt>
movb   $0x0,(%rax)
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define i8* @strpadl(i8* returned %0, i8 signext %1, i64 %2) {
%4 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%5 = icmp ult i64 %4, %2
br i1 %5, label %6, label %8
6: ; preds = %3
%7 = tail call i8* @__strpadl(i8* %0, i8 signext %1, i64 %2, i64 %4)
store i8 0, i8* %7
br label %8
8: ; preds = %3, %6
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ rol16addr(int /*<<< orphan*/);
int /*<<< orphan*/ zeropage();
void rolZp16(void) { rol16addr(zeropage()); }


x86 assembly (clang, -O0):
<rolZp16>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <zeropage@plt>
mov    %eax,%edi
call   1030 <rol16addr@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<rolZp16>:
push   %rax
xor    %eax,%eax
call   1040 <zeropage@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <rol16addr@plt>

LLVM IR (-O0):
define void @rolZp16() {
%1 = call i32 (...) @zeropage()
%2 = call i32 @rol16addr(i32 %1)
ret void
}

LLVM IR (-O2):
define void @rolZp16() {
%1 = tail call i32 (...) @zeropage()
%2 = tail call i32 @rol16addr(i32 %1)
ret void
}
int t_int_double(int_arg1, double_arg2)
int int_arg1;
double double_arg2;
{
  return ((int_arg1 - double_arg2) < (0.001) &&
          (int_arg1 - double_arg2) > -(0.001));
}


x86 assembly (clang, -O0):
<t_int_double>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movsd  %xmm0,-0x10(%rbp)
cvtsi2sdl -0x4(%rbp),%xmm1
subsd  -0x10(%rbp),%xmm1
xor    %eax,%eax
movsd  0xee0(%rip),%xmm0
ucomisd %xmm1,%xmm0
mov    %al,-0x11(%rbp)
jbe    1149 <t_int_double+0x49>
cvtsi2sdl -0x4(%rbp),%xmm0
subsd  -0x10(%rbp),%xmm0
movsd  0xec9(%rip),%xmm1
ucomisd %xmm1,%xmm0
seta   %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_int_double>:
cvtsi2sd %edi,%xmm1
subsd  %xmm0,%xmm1
movsd  0xef0(%rip),%xmm0
ucomisd %xmm1,%xmm0
seta   %al
ucomisd 0xee9(%rip),%xmm1
seta   %cl
and    %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @t_int_double(i32 %0, double %1) {
%3 = alloca i32
%4 = alloca double
store i32 %0, i32* %3
store double %1, double* %4
%5 = load i32, i32* %3
%6 = sitofp i32 %5 to double
%7 = load double, double* %4
%8 = fsub double %6, %7
%9 = fcmp olt double %8, 1.000000e-03
br i1 %9, label %10, label %16
10: ; preds = %2
%11 = load i32, i32* %3
%12 = sitofp i32 %11 to double
%13 = load double, double* %4
%14 = fsub double %12, %13
%15 = fcmp ogt double %14, -1.000000e-03
br label %16
16: ; preds = %10, %2
%17 = phi i1 [ false, %2 ], [ %15, %10 ]
%18 = zext i1 %17 to i32
ret i32 %18
}

LLVM IR (-O2):
define i32 @t_int_double(i32 %0, double %1) {
%3 = sitofp i32 %0 to double
%4 = fsub double %3, %1
%5 = fcmp olt double %4, 1.000000e-03
%6 = fcmp ogt double %4, -1.000000e-03
%7 = and i1 %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ japi_getimagesource(int, int, int, int, int, int *, int *,
                                       int *);
void j_getimagesource(int arg0, int arg1, int arg2, int arg3, int arg4,
                      int *arg5, int *arg6, int *arg7) {
  japi_getimagesource(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7);
}


x86 assembly (clang, -O0):
<j_getimagesource>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    0x18(%rbp),%rax
mov    0x10(%rbp),%rax
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8d,-0x14(%rbp)
mov    %r9,-0x20(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
mov    -0x14(%rbp),%r8d
mov    -0x20(%rbp),%r9
mov    0x10(%rbp),%r10
mov    0x18(%rbp),%rax
mov    %r10,(%rsp)
mov    %rax,0x8(%rsp)
call   1030 <japi_getimagesource@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<j_getimagesource>:
jmp    1030 <japi_getimagesource@plt>

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

LLVM IR (-O2):
define void @j_getimagesource(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32* %5, i32* %6, i32* %7) {
%9 = tail call i32 @japi_getimagesource(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32* %5, i32* %6, i32* %7)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ int80(int, char *, char *, char *, int /*<<< orphan*/,
                         int /*<<< orphan*/, int /*<<< orphan*/);
char getMinutes() {
  char h;
  char mi;
  char s;
  int80(6, &h, &mi, &s, 0, 0, 0);
  return mi;
}


x86 assembly (clang, -O0):
<getMinutes>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x6,%edi
lea    -0x1(%rbp),%rsi
lea    -0x2(%rbp),%rdx
lea    -0x3(%rbp),%rcx
xor    %r9d,%r9d
mov    %r9d,%r8d
movl   $0x0,(%rsp)
call   1030 <int80@plt>
movsbl -0x2(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getMinutes>:
sub    $0x18,%rsp
movl   $0x0,(%rsp)
lea    0x17(%rsp),%rsi
lea    0x15(%rsp),%rdx
lea    0x16(%rsp),%rcx
mov    $0x6,%edi
xor    %r8d,%r8d
xor    %r9d,%r9d
call   1030 <int80@plt>
mov    0x15(%rsp),%al
add    $0x18,%rsp
ret

LLVM IR (-O0):
define signext i8 @getMinutes() {
%1 = alloca i8
%2 = alloca i8
%3 = alloca i8
%4 = call i32 @int80(i32 6, i8* %1, i8* %2, i8* %3, i32 0, i32 0, i32 0)
%5 = load i8, i8* %2
ret i8 %5
}

LLVM IR (-O2):
define signext i8 @getMinutes() {
%1 = alloca i8
%2 = alloca i8
%3 = alloca i8
%4 = call i32 @int80(i32 6, i8* %1, i8* %2, i8* %3, i32 0, i32 0, i32 0)
%5 = load i8, i8* %2
ret i8 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_mutex_t;

/* Variables and functions */
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ perror(char *);
int pthread_mutex_unlock(int /*<<< orphan*/ *);
void checked_unlock(pthread_mutex_t *lock) {
  assert(NULL != lock);
  if (-1 == pthread_mutex_unlock(lock)) {
    perror("pthread_mutex_unlock");
    assert(0);
  }
}


x86 assembly (clang, -O0):
<checked_unlock>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
xor    %eax,%eax
cmp    -0x8(%rbp),%rax
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x8(%rbp),%rdi
call   1040 <pthread_mutex_unlock@plt>
mov    %eax,%ecx
mov    $0xffffffff,%eax
cmp    %ecx,%eax
jne    117a <checked_unlock+0x4a>
lea    0xe92(%rip),%rdi
call   1050 <perror@plt>
xor    %edi,%edi
call   1030 <assert@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<checked_unlock>:
push   %rbx
mov    %rdi,%rbx
xor    %edi,%edi
test   %rbx,%rbx
setne  %dil
call   1030 <assert@plt>
mov    %rbx,%rdi
call   1040 <pthread_mutex_unlock@plt>
cmp    $0xffffffff,%eax
je     1151 <checked_unlock+0x21>
pop    %rbx
ret
lea    0xea8(%rip),%rdi
call   1050 <perror@plt>
xor    %edi,%edi
pop    %rbx
jmp    1030 <assert@plt>

LLVM IR (-O0):
@.str = [21 x i8] c"pthread_mutex_unlock\00"
define void @checked_unlock(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = icmp ne i32* null, %3
%5 = zext i1 %4 to i32
%6 = call i32 @assert(i32 %5)
%7 = load i32*, i32** %2
%8 = call i32 @pthread_mutex_unlock(i32* %7)
%9 = icmp eq i32 -1, %8
br i1 %9, label %10, label %13
10: ; preds = %1
%11 = call i32 @perror(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%12 = call i32 @assert(i32 0)
br label %13
13: ; preds = %10, %1
ret void
}

LLVM IR (-O2):
@.str = [21 x i8] c"pthread_mutex_unlock\00"
define void @checked_unlock(i32* %0) {
%2 = icmp ne i32* %0, null
%3 = zext i1 %2 to i32
%4 = tail call i32 @assert(i32 %3)
%5 = tail call i32 @pthread_mutex_unlock(i32* %0)
%6 = icmp eq i32 %5, -1
br i1 %6, label %7, label %10
7: ; preds = %1
%8 = tail call i32 @perror(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%9 = tail call i32 @assert(i32 0)
br label %10
10: ; preds = %7, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ dynaloc(char **);
scalar_t__ malloc(int);
int /*<<< orphan*/ printf(char *, char **);
int main(int argc, char **argv) {
  char **ptrs = (char **)malloc(32 * 1024 * 1024 * sizeof(char *));
  dynaloc(ptrs);
  printf("ptrs = %p\n", ptrs);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x10000000,%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1050 <dynaloc@plt>
lea    0xeb3(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [11 x i8] c"ptrs = %p\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = call i64 @malloc(i32 268435456)
%8 = inttoptr i64 %7 to i8**
store i8** %8, i8*** %6
%9 = load i8**, i8*** %6
%10 = call i32 @dynaloc(i8** %9)
%11 = load i8**, i8*** %6
%12 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8** %11)
ret i32 0
}

LLVM IR (-O2):
@.str = [11 x i8] c"ptrs = %p\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i64 @malloc(i32 268435456)
%4 = inttoptr i64 %3 to i8**
%5 = tail call i32 @dynaloc(i8** %4)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8** %4)
ret i32 0
}
int erts_no_of_cpus(void) {
  int ncpus;
  ncpus = -1;
  return ncpus;
}


x86 assembly (clang, -O0):
<erts_no_of_cpus>:
push   %rbp
mov    %rsp,%rbp
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @erts_no_of_cpus() {
ret i32 -1
}
__attribute__((signal)) void foo(void) {}


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

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

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

LLVM IR (-O2):
define void @foo() {
ret void
}
/* Type definitions */
struct spwd {
  int /*<<< orphan*/ *sp_pwdp;
};

/* Variables and functions */
scalar_t__ strlen(int /*<<< orphan*/ *);
int spwd_need_buflen(struct spwd *pwd) {
  int len = 0;
  if (pwd->sp_pwdp != NULL)
    len += strlen(pwd->sp_pwdp) + 1;
  return len;
}


x86 assembly (clang, -O0):
<spwd_need_buflen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
cmpq   $0x0,(%rax)
je     114e <spwd_need_buflen+0x3e>
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
call   1030 <strlen@plt>
mov    %rax,%rcx
add    $0x1,%rcx
movslq -0xc(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<spwd_need_buflen>:
push   %rax
mov    (%rdi),%rdi
test   %rdi,%rdi
je     1123 <spwd_need_buflen+0x13>
call   1030 <strlen@plt>
add    $0x1,%eax
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.spwd = type { i32* }
define i32 @spwd_need_buflen(%struct.spwd* %0) {
%2 = alloca %struct.spwd*
%3 = alloca i32
store %struct.spwd* %0, %struct.spwd** %2
store i32 0, i32* %3
%4 = load %struct.spwd*, %struct.spwd** %2
%5 = getelementptr inbounds %struct.spwd, %struct.spwd* %4, i32 0, i32 0
%6 = load i32*, i32** %5
%7 = icmp ne i32* %6, null
br i1 %7, label %8, label %18
8: ; preds = %1
%9 = load %struct.spwd*, %struct.spwd** %2
%10 = getelementptr inbounds %struct.spwd, %struct.spwd* %9, i32 0, i32 0
%11 = load i32*, i32** %10
%12 = call i64 @strlen(i32* %11)
%13 = add nsw i64 %12, 1
%14 = load i32, i32* %3
%15 = sext i32 %14 to i64
%16 = add nsw i64 %15, %13
%17 = trunc i64 %16 to i32
store i32 %17, i32* %3
br label %18
18: ; preds = %8, %1
%19 = load i32, i32* %3
ret i32 %19
}

LLVM IR (-O2):
%struct.spwd = type { i32* }
define i32 @spwd_need_buflen(%struct.spwd* nocapture %0) {
%2 = getelementptr inbounds %struct.spwd, %struct.spwd* %0, i64 0, i32 0
%3 = load i32*, i32** %2
%4 = icmp eq i32* %3, null
br i1 %4, label %9, label %5
5: ; preds = %1
%6 = tail call i64 @strlen(i32* %3)
%7 = trunc i64 %6 to i32
%8 = add i32 %7, 1
br label %9
9: ; preds = %5, %1
%10 = phi i32 [ %8, %5 ], [ 0, %1 ]
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
void r() {
  char pCh[1] = {0};
  int *pInt = (int *)pCh;
  *pInt = 0xFFFFFFFF;
  assert(pCh[0] == 0);
}


x86 assembly (clang, -O0):
<r>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x1(%rbp),%rdi
xor    %esi,%esi
mov    $0x1,%edx
call   1030 <memset@plt>
lea    -0x1(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movl   $0xffffffff,(%rax)
movsbl -0x1(%rbp),%eax
cmp    $0x0,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<r>:
mov    $0x1,%edi
jmp    1030 <assert@plt>

LLVM IR (-O0):
define void @r() {
%1 = alloca [1 x i8]
%2 = alloca i32*
%3 = bitcast [1 x i8]* %1 to i8*
%4 = getelementptr inbounds [1 x i8], [1 x i8]* %1, i64 0, i64 0
%5 = bitcast i8* %4 to i32*
store i32* %5, i32** %2
%6 = load i32*, i32** %2
store i32 -1, i32* %6
%7 = getelementptr inbounds [1 x i8], [1 x i8]* %1, i64 0, i64 0
%8 = load i8, i8* %7
%9 = sext i8 %8 to i32
%10 = icmp eq i32 %9, 0
%11 = zext i1 %10 to i32
%12 = call i32 @assert(i32 %11)
ret void
}

LLVM IR (-O2):
define void @r() {
%1 = tail call i32 @assert(i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ initial_values_length_metric();
int /*<<< orphan*/ printf(char *);
void length_to_metric() {
  printf("\nTo metric system. (Length)\n");
  initial_values_length_metric();
}


x86 assembly (clang, -O0):
<length_to_metric>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <initial_values_length_metric@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<length_to_metric>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <initial_values_length_metric@plt>

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

LLVM IR (-O2):
@str = [28 x i8] c"\0ATo metric system. (Length)\00"
define void @length_to_metric() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (...) @initial_values_length_metric()
ret void
}
void *thread_function(void *arg) {
  asm("    .global "
      "set_point"
      "\n"
      "set_point"
      ":\n"
      "    call "
      "func"
      "\n");
}


x86 assembly (clang, -O0):
<thread_function>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)

x86 assembly (clang, -O2):
<thread_function>:
call   1030 <func@plt>
ret

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

LLVM IR (-O2):
define i8* @thread_function(i8* nocapture readnone %0) {
tail call void asm sideeffect " .global set_point\0Aset_point:\0A call func\0A", "~{dirflag},~{fpsr},~{flags}"()
ret i8* undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int test(int i) {
  if (i < -2)
    i = -2;
  if (i > 3)
    i = 3;
  printf("MinMax result %d\n", i);
}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0xfffffffe,-0x8(%rbp)
jge    112c <test+0x1c>
movl   $0xfffffffe,-0x8(%rbp)
cmpl   $0x3,-0x8(%rbp)
jle    113d <test+0x2d>
movl   $0x3,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xeb9(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test>:
cmp    $0xffffffff,%edi
mov    $0xfffffffe,%eax
cmovge %edi,%eax
cmp    $0x3,%eax
mov    $0x3,%esi
cmovl  %eax,%esi
lea    0xed3(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [18 x i8] c"MinMax result %d\0A\00"
define i32 @test(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp slt i32 %4, -2
br i1 %5, label %6, label %7
6: ; preds = %1
store i32 -2, i32* %3
br label %7
7: ; preds = %6, %1
%8 = load i32, i32* %3
%9 = icmp sgt i32 %8, 3
br i1 %9, label %10, label %11
10: ; preds = %7
store i32 3, i32* %3
br label %11
11: ; preds = %10, %7
%12 = load i32, i32* %3
%13 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %12)
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
@.str = [18 x i8] c"MinMax result %d\0A\00"
define i32 @test(i32 %0) {
%2 = icmp sgt i32 %0, -2
%3 = select i1 %2, i32 %0, i32 -2
%4 = icmp slt i32 %3, 3
%5 = select i1 %4, i32 %3, i32 3
%6 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %5)
ret i32 undef
}
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ SwapByteOrder_16(int /*<<< orphan*/);
void bswap_16(const int n, void *u) {
  uint16_t *T = u;
  int i;
  for (i = 0; i < n; i++) {
    *(T + i) = SwapByteOrder_16(*(T + i));
  }
  return;
}


x86 assembly (clang, -O0):
<bswap_16>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1165 <bswap_16+0x55>
mov    -0x18(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,4),%edi
call   1030 <SwapByteOrder_16@plt>
mov    %eax,%edx
mov    -0x18(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    112e <bswap_16+0x1e>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bswap_16>:
push   %r15
push   %r14
push   %rbx
test   %edi,%edi
jle    1146 <bswap_16+0x36>
mov    %rsi,%r15
mov    %edi,%r14d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    (%r15,%rbx,4),%edi
call   1030 <SwapByteOrder_16@plt>
mov    %eax,(%r15,%rbx,4)
add    $0x1,%rbx
cmp    %rbx,%r14
jne    1130 <bswap_16+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @bswap_16(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i32*
%6 = alloca i32
store i32 %0, i32* %3
store i8* %1, i8** %4
%7 = load i8*, i8** %4
%8 = bitcast i8* %7 to i32*
store i32* %8, i32** %5
store i32 0, i32* %6
br label %9
9: ; preds = %24, %2
%10 = load i32, i32* %6
%11 = load i32, i32* %3
%12 = icmp slt i32 %10, %11
br i1 %12, label %13, label %27
13: ; preds = %9
%14 = load i32*, i32** %5
%15 = load i32, i32* %6
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds i32, i32* %14, i64 %16
%18 = load i32, i32* %17
%19 = call i32 @SwapByteOrder_16(i32 %18)
%20 = load i32*, i32** %5
%21 = load i32, i32* %6
%22 = sext i32 %21 to i64
%23 = getelementptr inbounds i32, i32* %20, i64 %22
store i32 %19, i32* %23
br label %24
24: ; preds = %13
%25 = load i32, i32* %6
%26 = add nsw i32 %25, 1
store i32 %26, i32* %6
br label %9
27: ; preds = %9
ret void
}

LLVM IR (-O2):
define void @bswap_16(i32 %0, i8* nocapture %1) {
%3 = bitcast i8* %1 to i32*
%4 = icmp sgt i32 %0, 0
br i1 %4, label %5, label %14
5: ; preds = %2
%6 = zext i32 %0 to i64
br label %7
7: ; preds = %5, %7
%8 = phi i64 [ 0, %5 ], [ %12, %7 ]
%9 = getelementptr inbounds i32, i32* %3, i64 %8
%10 = load i32, i32* %9
%11 = tail call i32 @SwapByteOrder_16(i32 %10)
store i32 %11, i32* %9
%12 = add nuw nsw i64 %8, 1
%13 = icmp eq i64 %12, %6
br i1 %13, label %14, label %7
14: ; preds = %7, %2
ret void
}
/* Variables and functions */
int fprintf() {}


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

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

LLVM IR (-O0):
define i32 @fprintf() {
%1 = alloca i32
%2 = load i32, i32* %1
ret i32 %2
}

LLVM IR (-O2):
define i32 @fprintf() {
ret i32 undef
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
size_t write_FD(int, int /*<<< orphan*/ const *, int);
size_t uint8WriteToFD(int fd, const uint8_t *data) {
  return write_FD(fd, data, sizeof(uint8_t));
}


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

x86 assembly (clang, -O2):
<uint8WriteToFD>:
mov    $0x4,%edx
jmp    1030 <write_FD@plt>

LLVM IR (-O0):
define i64 @uint8WriteToFD(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 = load i32*, i32** %4
%7 = call i64 @write_FD(i32 %5, i32* %6, i32 4)
ret i64 %7
}

LLVM IR (-O2):
define i64 @uint8WriteToFD(i32 %0, i32* %1) {
%3 = tail call i64 @write_FD(i32 %0, i32* %1, i32 4)
ret i64 %3
}
/* Variables and functions */
int main(int argc, char **argv) {
  size_t size = 16;
  char p[16];
  p[15] = 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x10,-0x18(%rbp)
movb   $0x0,-0x21(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca i64
%6 = alloca [16 x i8]
store i32 %0, i32* %3
store i8** %1, i8*** %4
store i64 16, i64* %5
%7 = getelementptr inbounds [16 x i8], [16 x i8]* %6, i64 0, i64 15
store i8 0, i8* %7
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ ntohs(int /*<<< orphan*/);
int stun_attr_add_str(unsigned char *, size_t *, int, unsigned char *, int);
int stun_attr_add_response_port_str(unsigned char *buf, size_t *len,
                                    uint16_t port) {
  unsigned char avalue[4] = {0, 0, 0, 0};
  uint16_t *port_ptr = (uint16_t *)avalue;
  *port_ptr = ntohs(port);
  return stun_attr_add_str(buf, len, (0x0027), avalue, 4);
}


x86 assembly (clang, -O0):
<stun_attr_add_response_port_str>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
lea    -0x18(%rbp),%rdi
xor    %esi,%esi
mov    $0x4,%edx
call   1030 <memset@plt>
lea    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x14(%rbp),%edi
call   1050 <ntohs@plt>
mov    %eax,%ecx
mov    -0x20(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
lea    -0x18(%rbp),%rcx
mov    $0x27,%edx
mov    $0x4,%r8d
call   1040 <stun_attr_add_str@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stun_attr_add_response_port_str>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
mov    %edx,%edi
call   1040 <ntohs@plt>
mov    %eax,0x4(%rsp)
lea    0x4(%rsp),%rcx
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0x27,%edx
mov    $0x4,%r8d
call   1030 <stun_attr_add_str@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @stun_attr_add_response_port_str(i8* %0, i64* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i64*
%6 = alloca i32
%7 = alloca [4 x i8]
%8 = alloca i32*
store i8* %0, i8** %4
store i64* %1, i64** %5
store i32 %2, i32* %6
%9 = bitcast [4 x i8]* %7 to i8*
%10 = getelementptr inbounds [4 x i8], [4 x i8]* %7, i64 0, i64 0
%11 = bitcast i8* %10 to i32*
store i32* %11, i32** %8
%12 = load i32, i32* %6
%13 = call i32 @ntohs(i32 %12)
%14 = load i32*, i32** %8
store i32 %13, i32* %14
%15 = load i8*, i8** %4
%16 = load i64*, i64** %5
%17 = getelementptr inbounds [4 x i8], [4 x i8]* %7, i64 0, i64 0
%18 = call i32 @stun_attr_add_str(i8* %15, i64* %16, i32 39, i8* %17, i32 4)
ret i32 %18
}

LLVM IR (-O2):
define i32 @stun_attr_add_response_port_str(i8* %0, i64* %1, i32 %2) {
%4 = alloca i32
%5 = bitcast i32* %4 to i8*
%6 = tail call i32 @ntohs(i32 %2)
store i32 %6, i32* %4
%7 = call i32 @stun_attr_add_str(i8* %0, i64* %1, i32 39, i8* %5, i32 4)
ret i32 %7
}
/* Variables and functions */
int EINVAL;
__attribute__((visibility("default"))) int sd_bus_is_open(void *bus) {
  return -EINVAL;
}


x86 assembly (clang, -O0):
<sd_bus_is_open>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
xor    %eax,%eax
mov    0x2ecf(%rip),%rcx
sub    (%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sd_bus_is_open>:
mov    0x2ed9(%rip),%rcx
xor    %eax,%eax
sub    (%rcx),%eax
ret

LLVM IR (-O0):
@EINVAL = global i32 0
define i32 @sd_bus_is_open(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @EINVAL
%4 = sub nsw i32 0, %3
ret i32 %4
}

LLVM IR (-O2):
@EINVAL = global i32 0
define i32 @sd_bus_is_open(i8* nocapture readnone %0) {
%2 = load i32, i32* @EINVAL
%3 = sub nsw i32 0, %2
ret i32 %3
}
/* Variables and functions */
int safe_atollu_full(char const *, int /*<<< orphan*/, unsigned long long *);
int safe_atollu(const char *s, long long unsigned *ret_llu) {
  return safe_atollu_full(s, 0, ret_llu);
}


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

x86 assembly (clang, -O2):
<safe_atollu>:
mov    %rsi,%rdx
xor    %esi,%esi
jmp    1030 <safe_atollu_full@plt>

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

LLVM IR (-O2):
define i32 @safe_atollu(i8* %0, i64* %1) {
%3 = tail call i32 @safe_atollu_full(i8* %0, i32 0, i64* %1)
ret i32 %3
}
/* Type definitions */
typedef int type;
typedef int depth;

/* Variables and functions */
int cvCvToIplDepth(int type) {
  int depth = ((type) & ((1 << 3) - 1));
  return ((((sizeof(size_t) << 28) | 0x8442211) >>
           ((depth) & ((1 << 3) - 1)) * 4) &
          15) *
             8 |
         (depth == 1 || depth == 3 || depth == 4 ? 0x80000000 : 0);
}


x86 assembly (clang, -O0):
<cvCvToIplDepth>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x7,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
and    $0x7,%eax
shl    $0x2,%eax
mov    %eax,%eax
mov    %eax,%ecx
mov    $0x88442211,%eax
shr    %cl,%rax
and    $0xf,%rax
shl    $0x3,%rax
mov    %rax,-0x18(%rbp)
mov    $0x1,%al
cmpl   $0x1,-0x8(%rbp)
mov    %al,-0x9(%rbp)
je     1159 <cvCvToIplDepth+0x59>
mov    $0x1,%al
cmpl   $0x3,-0x8(%rbp)
mov    %al,-0x9(%rbp)
je     1159 <cvCvToIplDepth+0x59>
cmpl   $0x4,-0x8(%rbp)
sete   %al
mov    %al,-0x9(%rbp)
mov    -0x18(%rbp),%rax
mov    -0x9(%rbp),%sil
xor    %ecx,%ecx
mov    $0x80000000,%edx
test   $0x1,%sil
cmovne %edx,%ecx
mov    %ecx,%ecx
or     %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cvCvToIplDepth>:
mov    %edi,%ecx
and    $0x7,%ecx
and    $0x5,%edi
cmp    $0x1,%edi
sete   %al
cmp    $0x4,%ecx
sete   %dl
or     %al,%dl
shl    $0x2,%ecx
mov    $0x88442211,%eax
shr    %cl,%eax
movzbl %dl,%ecx
shl    $0x1f,%ecx
and    $0xf,%eax
lea    (%rcx,%rax,8),%eax
ret

LLVM IR (-O0):
define i32 @cvCvToIplDepth(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = and i32 %4, 7
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = and i32 %6, 7
%8 = mul nsw i32 %7, 4
%9 = zext i32 %8 to i64
%10 = lshr i64 2286166545, %9
%11 = and i64 %10, 15
%12 = mul i64 %11, 8
%13 = load i32, i32* %3
%14 = icmp eq i32 %13, 1
br i1 %14, label %21, label %15
15: ; preds = %1
%16 = load i32, i32* %3
%17 = icmp eq i32 %16, 3
br i1 %17, label %21, label %18
18: ; preds = %15
%19 = load i32, i32* %3
%20 = icmp eq i32 %19, 4
br label %21
21: ; preds = %18, %15, %1
%22 = phi i1 [ true, %15 ], [ true, %1 ], [ %20, %18 ]
%23 = zext i1 %22 to i64
%24 = select i1 %22, i32 -2147483648, i32 0
%25 = zext i32 %24 to i64
%26 = or i64 %12, %25
%27 = trunc i64 %26 to i32
ret i32 %27
}

LLVM IR (-O2):
define i32 @cvCvToIplDepth(i32 %0) {
%2 = and i32 %0, 7
%3 = and i32 %0, 5
%4 = icmp eq i32 %3, 1
%5 = icmp eq i32 %2, 4
%6 = or i1 %4, %5
%7 = select i1 %6, i32 -2147483648, i32 0
%8 = shl nuw nsw i32 %2, 2
%9 = lshr i32 -2008800751, %8
%10 = shl i32 %9, 3
%11 = and i32 %10, 120
%12 = or i32 %11, %7
ret i32 %12
}
void roadmap_square_activate_one(void *context) {}


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

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

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

LLVM IR (-O2):
define void @roadmap_square_activate_one(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void hexPrint(char bytes[], int length) {
  int i;
  for (i = 0; i < length; i++)
    printf("%02x ", bytes[i]);
  printf("\n");
}


x86 assembly (clang, -O0):
<hexPrint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    115a <hexPrint+0x4a>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%esi
lea    0xebb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <hexPrint+0x16>
lea    0xea5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hexPrint>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1158 <hexPrint+0x38>
mov    %rdi,%r15
mov    %esi,%r12d
lea    0xec7(%rip),%r14
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
movsbl (%r15,%rbx,1),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1140 <hexPrint+0x20>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
@.str = [6 x i8] c"%02x \00"
define void @hexPrint(i8* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %14
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %12, %6 ]
%8 = getelementptr inbounds i8, i8* %0, i64 %7
%9 = load i8, i8* %8
%10 = sext i8 %9 to i32
%11 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %10)
%12 = add nuw nsw i64 %7, 1
%13 = icmp eq i64 %12, %5
br i1 %13, label %14, label %6
14: ; preds = %6, %2
%15 = tail call i32 @putchar(i32 10)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ cli_outfunf(char *, char *);
void default_unknown_command(int argc, char **argv, void *data) {
  cli_outfunf("unknown command '%s' type '?' to see allowed commands.\n",
              argv[0]);
}


x86 assembly (clang, -O0):
<default_unknown_command>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
lea    0xecf(%rip),%rdi
call   1030 <cli_outfunf@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [56 x i8] c"unknown command '%s' type '?' to see allowed commands.\0A\00"
define void @default_unknown_command(i32 %0, i8** %1, i8* %2) {
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i8* %2, i8** %6
%7 = load i8**, i8*** %5
%8 = getelementptr inbounds i8*, i8** %7, i64 0
%9 = load i8*, i8** %8
%10 = call i32 @cli_outfunf(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str, i64 0, i64 0), i8* %9)
ret void
}

LLVM IR (-O2):
@.str = [56 x i8] c"unknown command '%s' type '?' to see allowed commands.\0A\00"
define void @default_unknown_command(i32 %0, i8** nocapture %1, i8* nocapture readnone %2) {
%4 = load i8*, i8** %1
%5 = tail call i32 @cli_outfunf(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str, i64 0, i64 0), i8* %4)
ret void
}
void led_clear() { *(unsigned int *)0xf0000028 = 0; }


x86 assembly (clang, -O0):
<led_clear>:
push   %rbp
mov    %rsp,%rbp
mov    $0xf0000028,%eax
movl   $0x0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<led_clear>:
mov    $0xf0000028,%eax
movl   $0x0,(%rax)
ret

LLVM IR (-O0):
define void @led_clear() {
store i32 0, i32* inttoptr (i64 4026531880 to i32*)
ret void
}

LLVM IR (-O2):
define void @led_clear() {
store i32 0, i32* inttoptr (i64 4026531880 to i32*)
ret void
}
void acpi_container_init(void) {}


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

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

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

LLVM IR (-O2):
define void @acpi_container_init() {
ret void
}
/* Type definitions */
typedef int uint8_t;
typedef int const uint16_t;

/* Variables and functions */
uint16_t get16be(const uint8_t *bytes) { return (bytes[1]) | (bytes[0] << 8); }


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

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

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

LLVM IR (-O2):
define i32 @get16be(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 1
%3 = load i32, i32* %2
%4 = load i32, i32* %0
%5 = shl i32 %4, 8
%6 = or i32 %5, %3
ret i32 %6
}
int counter() {
  static int counter = 18;
  counter = counter + 1;
  return counter;
}


x86 assembly (clang, -O0):
<counter>:
push   %rbp
mov    %rsp,%rbp
mov    0x2f16(%rip),%eax
add    $0x1,%eax
mov    %eax,0x2f0d(%rip)
mov    0x2f07(%rip),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<counter>:
mov    0x2f1a(%rip),%eax
add    $0x1,%eax
mov    %eax,0x2f11(%rip)
ret

LLVM IR (-O0):
@counter.counter = internal global i32 18
define i32 @counter() {
%1 = load i32, i32* @counter.counter
%2 = add nsw i32 %1, 1
store i32 %2, i32* @counter.counter
%3 = load i32, i32* @counter.counter
ret i32 %3
}

LLVM IR (-O2):
@counter.counter = internal unnamed_addr global i32 18
define i32 @counter() {
%1 = load i32, i32* @counter.counter
%2 = add nsw i32 %1, 1
store i32 %2, i32* @counter.counter
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ ENOMEM;
size_t SIZE_MAX;
int /*<<< orphan*/ errno;
void *malloc(size_t);
void *imalloc(size_t nrec, size_t reclen) {
  if (nrec > SIZE_MAX / reclen) {
    errno = ENOMEM;
    return (NULL);
  } else {
    return (malloc(nrec * reclen));
  }
}


x86 assembly (clang, -O0):
<imalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    0x2e99(%rip),%rax
mov    (%rax),%rax
xor    %ecx,%ecx
mov    %ecx,%edx
divq   -0x18(%rbp)
mov    %rax,%rcx
mov    -0x20(%rbp),%rax
cmp    %rcx,%rax
jbe    1169 <imalloc+0x59>
mov    0x2e8f(%rip),%rax
mov    (%rax),%ecx
mov    0x2e7e(%rip),%rax
mov    %ecx,(%rax)
movq   $0x0,-0x8(%rbp)
jmp    117b <imalloc+0x6b>
mov    -0x10(%rbp),%rdi
imul   -0x18(%rbp),%rdi
call   1030 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<imalloc>:
mov    0x2eb1(%rip),%rax
mov    (%rax),%rax
mov    %rax,%rcx
or     %rsi,%rcx
shr    $0x20,%rcx
je     1145 <imalloc+0x35>
xor    %edx,%edx
div    %rsi
cmp    %rdi,%rax
jae    114e <imalloc+0x3e>
mov    0x2ea9(%rip),%rax
mov    (%rax),%eax
mov    0x2e98(%rip),%rcx
mov    %eax,(%rcx)
xor    %eax,%eax
ret
xor    %edx,%edx
div    %esi
cmp    %rdi,%rax
jb     1130 <imalloc+0x20>
imul   %rdi,%rsi
mov    %rsi,%rdi
jmp    1030 <malloc@plt>

LLVM IR (-O0):
@SIZE_MAX = global i64 0
@ENOMEM = global i32 0
@errno = global i32 0
define i8* @imalloc(i64 %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i64
store i64 %0, i64* %4
store i64 %1, i64* %5
%6 = load i64, i64* %4
%7 = load i64, i64* @SIZE_MAX
%8 = load i64, i64* %5
%9 = udiv i64 %7, %8
%10 = icmp ugt i64 %6, %9
br i1 %10, label %11, label %13
11: ; preds = %2
%12 = load i32, i32* @ENOMEM
store i32 %12, i32* @errno
store i8* null, i8** %3
br label %18
13: ; preds = %2
%14 = load i64, i64* %4
%15 = load i64, i64* %5
%16 = mul i64 %14, %15
%17 = call i8* @malloc(i64 %16)
store i8* %17, i8** %3
br label %18
18: ; preds = %13, %11
%19 = load i8*, i8** %3
ret i8* %19
}

LLVM IR (-O2):
@SIZE_MAX = global i64 0
@ENOMEM = global i32 0
@errno = global i32 0
define noalias i8* @imalloc(i64 %0, i64 %1) {
%3 = load i64, i64* @SIZE_MAX
%4 = udiv i64 %3, %1
%5 = icmp ult i64 %4, %0
br i1 %5, label %6, label %8
6: ; preds = %2
%7 = load i32, i32* @ENOMEM
store i32 %7, i32* @errno
br label %11
8: ; preds = %2
%9 = mul i64 %1, %0
%10 = tail call i8* @malloc(i64 %9)
br label %11
11: ; preds = %8, %6
%12 = phi i8* [ null, %6 ], [ %10, %8 ]
ret i8* %12
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int ssearch(int, int /*<<< orphan*/);
int main() {
  printf("%d\n", ssearch(762021092, 0));
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x2d6b84e4,%edi
xor    %esi,%esi
call   1040 <ssearch@plt>
lea    0xecc(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @ssearch(i32 762021092, i32 0)
%3 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %2)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 @ssearch(i32 762021092, i32 0)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Variables and functions */
double asin_66(double);
double poly_asin(double x) { return asin_66(x); }


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

x86 assembly (clang, -O2):
<poly_asin>:
jmp    1030 <asin_66@plt>

LLVM IR (-O0):
define double @poly_asin(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call double @asin_66(double %3)
ret double %4
}

LLVM IR (-O2):
define double @poly_asin(double %0) {
%2 = tail call double @asin_66(double %0)
ret double %2
}
float QuadraticEaseIn(float p) { return p * p; }


x86 assembly (clang, -O0):
<QuadraticEaseIn>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
mulss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<QuadraticEaseIn>:
mulss  %xmm0,%xmm0
ret

LLVM IR (-O0):
define float @QuadraticEaseIn(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = load float, float* %2
%5 = fmul float %3, %4
ret float %5
}

LLVM IR (-O2):
define float @QuadraticEaseIn(float %0) {
%2 = fmul float %0, %0
ret float %2
}
/* Type definitions */
typedef scalar_t__ uint8_t;
typedef int uint32_t;

/* Variables and functions */
__attribute__((always_)) void LEUnpackUint32(uint32_t *data,
                                             const uint8_t container[4]) {
  *data = (uint32_t)container[0] | ((uint32_t)container[1] << 8) |
          ((uint32_t)container[2] << 16) | ((uint32_t)container[3] << 24);
}


x86 assembly (clang, -O0):
<LEUnpackUint32>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
shl    $0x8,%eax
or     %eax,%ecx
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rax
shl    $0x10,%eax
or     %eax,%ecx
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rax
shl    $0x18,%eax
or     %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<LEUnpackUint32>:
mov    0x8(%rsi),%eax
mov    0x10(%rsi),%ecx
shl    $0x8,%eax
or     (%rsi),%eax
shl    $0x10,%ecx
mov    0x18(%rsi),%edx
shl    $0x18,%edx
or     %ecx,%edx
or     %eax,%edx
mov    %edx,(%rdi)
ret

LLVM IR (-O0):
define void @LEUnpackUint32(i32* %0, i64* %1) {
%3 = alloca i32*
%4 = alloca i64*
store i32* %0, i32** %3
store i64* %1, i64** %4
%5 = load i64*, i64** %4
%6 = getelementptr inbounds i64, i64* %5, i64 0
%7 = load i64, i64* %6
%8 = trunc i64 %7 to i32
%9 = load i64*, i64** %4
%10 = getelementptr inbounds i64, i64* %9, i64 1
%11 = load i64, i64* %10
%12 = trunc i64 %11 to i32
%13 = shl i32 %12, 8
%14 = or i32 %8, %13
%15 = load i64*, i64** %4
%16 = getelementptr inbounds i64, i64* %15, i64 2
%17 = load i64, i64* %16
%18 = trunc i64 %17 to i32
%19 = shl i32 %18, 16
%20 = or i32 %14, %19
%21 = load i64*, i64** %4
%22 = getelementptr inbounds i64, i64* %21, i64 3
%23 = load i64, i64* %22
%24 = trunc i64 %23 to i32
%25 = shl i32 %24, 24
%26 = or i32 %20, %25
%27 = load i32*, i32** %3
store i32 %26, i32* %27
ret void
}

LLVM IR (-O2):
define void @LEUnpackUint32(i32* nocapture writeonly %0, i64* nocapture %1) {
%3 = load i64, i64* %1
%4 = trunc i64 %3 to i32
%5 = getelementptr inbounds i64, i64* %1, i64 1
%6 = load i64, i64* %5
%7 = trunc i64 %6 to i32
%8 = shl i32 %7, 8
%9 = or i32 %8, %4
%10 = getelementptr inbounds i64, i64* %1, i64 2
%11 = load i64, i64* %10
%12 = trunc i64 %11 to i32
%13 = shl i32 %12, 16
%14 = or i32 %9, %13
%15 = getelementptr inbounds i64, i64* %1, i64 3
%16 = load i64, i64* %15
%17 = trunc i64 %16 to i32
%18 = shl i32 %17, 24
%19 = or i32 %14, %18
store i32 %19, i32* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
scalar_t__ malloc(int);
int /*<<< orphan*/ stderr;
double *c_alloc1d(int n) {
  double *dp = (double *)malloc(n * sizeof(double));
  if (dp == NULL) {
    fprintf(stderr, "out of memory\n");
    exit(1);
  }
  return dp;
}


x86 assembly (clang, -O0):
<c_alloc1d>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movslq -0x4(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1178 <c_alloc1d+0x48>
mov    0x2e80(%rip),%rax
mov    (%rax),%edi
lea    0xe97(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<c_alloc1d>:
push   %rax
shl    $0x3,%edi
call   1040 <malloc@plt>
test   %rax,%rax
je     1140 <c_alloc1d+0x10>
pop    %rcx
ret
mov    0x2e99(%rip),%rax
mov    (%rax),%edi
lea    0xeb0(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [15 x i8] c"out of memory\0A\00"
define double* @c_alloc1d(i32 %0) {
%2 = alloca i32
%3 = alloca double*
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = sext i32 %4 to i64
%6 = mul i64 %5, 8
%7 = trunc i64 %6 to i32
%8 = call i64 @malloc(i32 %7)
%9 = inttoptr i64 %8 to double*
store double* %9, double** %3
%10 = load double*, double** %3
%11 = icmp eq double* %10, null
br i1 %11, label %12, label %16
12: ; preds = %1
%13 = load i32, i32* @stderr
%14 = call i32 @fprintf(i32 %13, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%15 = call i32 @exit(i32 1)
unreachable
16: ; preds = %1
%17 = load double*, double** %3
ret double* %17
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [15 x i8] c"out of memory\0A\00"
define double* @c_alloc1d(i32 %0) {
%2 = shl i32 %0, 3
%3 = tail call i64 @malloc(i32 %2)
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %9
5: ; preds = %1
%6 = load i32, i32* @stderr
%7 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%8 = tail call i32 @exit(i32 1)
unreachable
9: ; preds = %1
%10 = inttoptr i64 %3 to double*
ret double* %10
}