xunge/DecIR huggingface dataset:
/* Variables and functions */
scalar_t__ chdir(char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ stderr;
int main(int argc, char **argv) {
  if (chdir("/tmp/") < 0) {
    fprintf(stderr, "chdir error");
  }
  printf("chdir to /tmp succeed\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xeb3(%rip),%rdi
call   1030 <chdir@plt>
cmp    $0x0,%rax
jge    1171 <main+0x41>
mov    0x2e7d(%rip),%rax
mov    (%rax),%edi
lea    0xe9a(%rip),%rsi
call   1050 <fprintf@plt>
lea    0xe9a(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
call   1040 <chdir@plt>
test   %rax,%rax
jns    1157 <main+0x27>
mov    0x2e97(%rip),%rax
mov    (%rax),%edi
lea    0xeb4(%rip),%rsi
call   1050 <fprintf@plt>
lea    0xeb4(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"/tmp/\00"
@stderr = global i32 0
@.str.1 = [12 x i8] c"chdir error\00"
@.str.2 = [23 x i8] c"chdir to /tmp succeed\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i64 @chdir(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%7 = icmp slt i64 %6, 0
br i1 %7, label %8, label %11
8: ; preds = %2
%9 = load i32, i32* @stderr
%10 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
br label %11
11: ; preds = %8, %2
%12 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"/tmp/\00"
@stderr = global i32 0
@.str.1 = [12 x i8] c"chdir error\00"
@str = [22 x i8] c"chdir to /tmp succeed\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i64 @chdir(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%4 = icmp slt i64 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %2
%6 = load i32, i32* @stderr
%7 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
br label %8
8: ; preds = %5, %2
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int cdiEncodeTime(int, int, int);
int sec_to_time(int secofday) {
  int time;
  int hour, minute, second;
  hour = secofday / 3600;
  minute = secofday / 60 - hour * 60;
  second = secofday - hour * 3600 - minute * 60;
  time = cdiEncodeTime(hour, minute, second);
  return (time);
}


x86 assembly (clang, -O0):
<sec_to_time>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xe10,%ecx
cltd
idiv   %ecx
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x3c,%ecx
cltd
idiv   %ecx
imul   $0x3c,-0xc(%rbp),%ecx
sub    %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
imul   $0xe10,-0xc(%rbp),%ecx
sub    %ecx,%eax
imul   $0x3c,-0x10(%rbp),%ecx
sub    %ecx,%eax
mov    %eax,-0x14(%rbp)
mov    -0xc(%rbp),%edi
mov    -0x10(%rbp),%esi
mov    -0x14(%rbp),%edx
call   1030 <cdiEncodeTime@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sec_to_time>:
movslq %edi,%rax
imul   $0xffffffff91a2b3c5,%rax,%rdi
shr    $0x20,%rdi
add    %eax,%edi
mov    %edi,%ecx
shr    $0x1f,%ecx
sar    $0xb,%edi
add    %ecx,%edi
imul   $0xffffffff88888889,%rax,%rcx
shr    $0x20,%rcx
add    %eax,%ecx
mov    %ecx,%edx
shr    $0x1f,%edx
sar    $0x5,%ecx
add    %edx,%ecx
imul   $0xffffffc4,%edi,%esi
add    %ecx,%esi
imul   $0xfffff1f0,%edi,%ecx
add    %eax,%ecx
imul   $0xffffffc4,%esi,%edx
add    %ecx,%edx
jmp    1030 <cdiEncodeTime@plt>

LLVM IR (-O0):
define i32 @sec_to_time(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %2
%7 = load i32, i32* %2
%8 = sdiv i32 %7, 3600
store i32 %8, i32* %4
%9 = load i32, i32* %2
%10 = sdiv i32 %9, 60
%11 = load i32, i32* %4
%12 = mul nsw i32 %11, 60
%13 = sub nsw i32 %10, %12
store i32 %13, i32* %5
%14 = load i32, i32* %2
%15 = load i32, i32* %4
%16 = mul nsw i32 %15, 3600
%17 = sub nsw i32 %14, %16
%18 = load i32, i32* %5
%19 = mul nsw i32 %18, 60
%20 = sub nsw i32 %17, %19
store i32 %20, i32* %6
%21 = load i32, i32* %4
%22 = load i32, i32* %5
%23 = load i32, i32* %6
%24 = call i32 @cdiEncodeTime(i32 %21, i32 %22, i32 %23)
store i32 %24, i32* %3
%25 = load i32, i32* %3
ret i32 %25
}

LLVM IR (-O2):
define i32 @sec_to_time(i32 %0) {
%2 = sdiv i32 %0, 3600
%3 = sdiv i32 %0, 60
%4 = mul nsw i32 %2, -60
%5 = add nsw i32 %4, %3
%6 = mul nsw i32 %2, -3600
%7 = add i32 %6, %0
%8 = mul i32 %5, -60
%9 = add i32 %7, %8
%10 = tail call i32 @cdiEncodeTime(i32 %2, i32 %5, i32 %9)
ret i32 %10
}
int bcmp(v1, v2, length) const void *v1, *v2;
unsigned long length;
{
  register const char *b1 = v1;
  register const char *b2 = v2;
  if (length)
    do
      if (*b1++ != *b2++)
        break;
    while (--length);
  return (length);
}


x86 assembly (clang, -O0):
<bcmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1181 <bcmp+0x81>
jmp    1130 <bcmp+0x30>
mov    -0x20(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x20(%rbp)
movsbl (%rax),%eax
mov    -0x28(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x28(%rbp)
movsbl (%rcx),%ecx
cmp    %ecx,%eax
je     1161 <bcmp+0x61>
jmp    117c <bcmp+0x7c>
jmp    1166 <bcmp+0x66>
mov    -0x18(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
jne    1130 <bcmp+0x30>
jmp    1181 <bcmp+0x81>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bcmp>:
test   %rdx,%rdx
je     1123 <bcmp+0x23>
mov    %rdx,%rax
xor    %ecx,%ecx
nopw   0x0(%rax,%rax,1)
movzbl (%rdi,%rcx,1),%edx
cmp    (%rsi,%rcx,1),%dl
jne    1125 <bcmp+0x25>
add    $0x1,%rcx
add    $0xffffffffffffffff,%rax
jne    1110 <bcmp+0x10>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @bcmp(i8* nocapture %0, i8* nocapture %1, i64 %2) {
%4 = icmp eq i64 %2, 0
br i1 %4, label %17, label %5
5: ; preds = %3, %12
%6 = phi i64 [ %15, %12 ], [ %2, %3 ]
%7 = phi i8* [ %14, %12 ], [ %0, %3 ]
%8 = phi i8* [ %13, %12 ], [ %1, %3 ]
%9 = load i8, i8* %7
%10 = load i8, i8* %8
%11 = icmp eq i8 %9, %10
br i1 %11, label %12, label %17
12: ; preds = %5
%13 = getelementptr inbounds i8, i8* %8, i64 1
%14 = getelementptr inbounds i8, i8* %7, i64 1
%15 = add i64 %6, -1
%16 = icmp eq i64 %15, 0
br i1 %16, label %17, label %5
17: ; preds = %12, %5, %3
%18 = phi i64 [ 0, %3 ], [ 0, %12 ], [ %6, %5 ]
%19 = trunc i64 %18 to i32
ret i32 %19
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void Die(char *msg) {
  fprintf(stderr, "SEVERE ERROR: %s\n", msg);
  exit(EXIT_FAILURE);
}


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

x86 assembly (clang, -O2):
<Die>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e98(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [18 x i8] c"SEVERE ERROR: %s\0A\00"
@EXIT_FAILURE = global i32 0
define void @Die(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = load i32, i32* @EXIT_FAILURE
%7 = call i32 @exit(i32 %6)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [18 x i8] c"SEVERE ERROR: %s\0A\00"
@EXIT_FAILURE = global i32 0
define void @Die(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = load i32, i32* @EXIT_FAILURE
%5 = tail call i32 @exit(i32 %4)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ IFNAMSIZ;
int /*<<< orphan*/ bzero(char *, int /*<<< orphan*/);
char *malloc(int /*<<< orphan*/);
char *alloc_tun_name() {
  char *nam = malloc(IFNAMSIZ);
  bzero(nam, IFNAMSIZ);
  return nam;
}


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

x86 assembly (clang, -O2):
<alloc_tun_name>:
push   %rbp
push   %rbx
push   %rax
mov    0x2eb6(%rip),%rax
mov    (%rax),%ebp
mov    %ebp,%edi
call   1030 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %ebp,%esi
call   1040 <bzero@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@IFNAMSIZ = global i32 0
define i8* @alloc_tun_name() {
%1 = alloca i8*
%2 = load i32, i32* @IFNAMSIZ
%3 = call i8* @malloc(i32 %2)
store i8* %3, i8** %1
%4 = load i8*, i8** %1
%5 = load i32, i32* @IFNAMSIZ
%6 = call i32 @bzero(i8* %4, i32 %5)
%7 = load i8*, i8** %1
ret i8* %7
}

LLVM IR (-O2):
@IFNAMSIZ = global i32 0
define noalias i8* @alloc_tun_name() {
%1 = load i32, i32* @IFNAMSIZ
%2 = tail call i8* @malloc(i32 %1)
%3 = tail call i32 @bzero(i8* %2, i32 %1)
ret i8* %2
}
/* Variables and functions */
float __nv_log10f(float);
float log10f(float __a) { return __nv_log10f(__a); }


x86 assembly (clang, -O0):
<log10f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <__nv_log10f@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<log10f>:
jmp    1030 <__nv_log10f@plt>

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

LLVM IR (-O2):
define float @log10f(float %0) {
%2 = tail call float @__nv_log10f(float %0)
ret float %2
}
/* Variables and functions */
int /*<<< orphan*/ O_RDONLY;
int /*<<< orphan*/ close(int);
int open(char *, int /*<<< orphan*/);
int /*<<< orphan*/ read(int, void *, size_t);
void randomize(void *mem, size_t size) {
  int rnd = open("/dev/urandom", O_RDONLY);
  read(rnd, mem, size);
  close(rnd);
}


x86 assembly (clang, -O0):
<randomize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2ea1(%rip),%rax
mov    (%rax),%esi
lea    0xeb0(%rip),%rdi
call   1050 <open@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
call   1040 <read@plt>
mov    -0x14(%rbp),%edi
call   1030 <close@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<randomize>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%rbx
mov    0x2ea7(%rip),%rax
mov    (%rax),%esi
lea    0xeb6(%rip),%rdi
call   1050 <open@plt>
mov    %eax,%ebp
mov    %eax,%edi
mov    %rbx,%rsi
mov    %r14,%rdx
call   1040 <read@plt>
mov    %ebp,%edi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <close@plt>

LLVM IR (-O0):
@.str = [13 x i8] c"/dev/urandom\00"
@O_RDONLY = global i32 0
define void @randomize(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i32
store i8* %0, i8** %3
store i64 %1, i64* %4
%6 = load i32, i32* @O_RDONLY
%7 = call i32 @open(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %6)
store i32 %7, i32* %5
%8 = load i32, i32* %5
%9 = load i8*, i8** %3
%10 = load i64, i64* %4
%11 = call i32 @read(i32 %8, i8* %9, i64 %10)
%12 = load i32, i32* %5
%13 = call i32 @close(i32 %12)
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c"/dev/urandom\00"
@O_RDONLY = global i32 0
define void @randomize(i8* nocapture %0, i64 %1) {
%3 = load i32, i32* @O_RDONLY
%4 = tail call i32 @open(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = tail call i32 @read(i32 %4, i8* %0, i64 %1)
%6 = tail call i32 @close(i32 %4)
ret void
}
/* Variables and functions */
scalar_t__ strcmp(char const *, char const *);
int check(const char *s1, const char *s2) { return strcmp(s1, s2) ? 0 : 1; }


x86 assembly (clang, -O0):
<check>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcmp@plt>
mov    %rax,%rdx
mov    $0x1,%eax
xor    %ecx,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check>:
push   %rax
call   1030 <strcmp@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @check(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 i64 @strcmp(i8* %5, i8* %6)
%8 = icmp ne i64 %7, 0
%9 = zext i1 %8 to i64
%10 = select i1 %8, i32 0, i32 1
ret i32 %10
}

LLVM IR (-O2):
define i32 @check(i8* %0, i8* %1) {
%3 = tail call i64 @strcmp(i8* %0, i8* %1)
%4 = icmp eq i64 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
int simple_function(void) { return 42; }


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

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

LLVM IR (-O0):
define i32 @simple_function() {
ret i32 42
}

LLVM IR (-O2):
define i32 @simple_function() {
ret i32 42
}
/* Variables and functions */
int /*<<< orphan*/ f1(int);
int /*<<< orphan*/ f2(int, int);
int /*<<< orphan*/ f3(int, int);
int /*<<< orphan*/ f4(int);
int /*<<< orphan*/ f5(int, int);
int /*<<< orphan*/ f6(int, int);
int main() {
  f1(0x123456789abcde0fUL);
  f2(0x123456789abcde0fUL, 18);
  f3(0x123456789abcde0fUL, 17);
  f4(0x12345678);
  f5(0x12345678, 18);
  f6(0x12345678, 17);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x9abcde0f,%edi
call   1060 <f1@plt>
mov    $0x9abcde0f,%edi
mov    $0x12,%esi
call   1030 <f2@plt>
mov    $0x9abcde0f,%edi
mov    $0x11,%esi
call   1050 <f3@plt>
mov    $0x12345678,%edi
call   1080 <f4@plt>
mov    $0x12345678,%edi
mov    $0x12,%esi
call   1070 <f5@plt>
mov    $0x12345678,%edi
mov    $0x11,%esi
call   1040 <f6@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x9abcde0f,%edi
call   1060 <f1@plt>
mov    $0x9abcde0f,%edi
mov    $0x12,%esi
call   1030 <f2@plt>
mov    $0x9abcde0f,%edi
mov    $0x11,%esi
call   1050 <f3@plt>
mov    $0x12345678,%edi
call   1080 <f4@plt>
mov    $0x12345678,%edi
mov    $0x12,%esi
call   1070 <f5@plt>
mov    $0x12345678,%edi
mov    $0x11,%esi
call   1040 <f6@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @f1(i32 -1698898417)
%3 = call i32 @f2(i32 -1698898417, i32 18)
%4 = call i32 @f3(i32 -1698898417, i32 17)
%5 = call i32 @f4(i32 305419896)
%6 = call i32 @f5(i32 305419896, i32 18)
%7 = call i32 @f6(i32 305419896, i32 17)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @f1(i32 -1698898417)
%2 = tail call i32 @f2(i32 -1698898417, i32 18)
%3 = tail call i32 @f3(i32 -1698898417, i32 17)
%4 = tail call i32 @f4(i32 305419896)
%5 = tail call i32 @f5(i32 305419896, i32 18)
%6 = tail call i32 @f6(i32 305419896, i32 17)
ret i32 0
}
void destroy_matrix(double **M) {
  free(M[0]);
  free(M);
}


x86 assembly (clang, -O0):
<destroy_matrix>:
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),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @destroy_matrix(double** %0) {
%2 = alloca double**
store double** %0, double*** %2
%3 = load double**, double*** %2
%4 = getelementptr inbounds double*, double** %3, i64 0
%5 = load double*, double** %4
%6 = bitcast double* %5 to i8*
%7 = load double**, double*** %2
%8 = bitcast double** %7 to i8*
ret void
}

LLVM IR (-O2):
define void @destroy_matrix(double** nocapture %0) {
%2 = bitcast double** %0 to i8**
%3 = load i8*, i8** %2
tail call void @free(i8* %3)
%4 = bitcast double** %0 to i8*
tail call void @free(i8* %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ foo(void *);
int main(void) {
  foo((void *)0);
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @foo(i8* null)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @foo(i8* null)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ COM_StripExtension(char *, char *, int);
int /*<<< orphan*/ Q_strcat(char *, int, char const *);
void COM_SetExtension(char *path, int maxSize, const char *extension) {
  COM_StripExtension(path, path, maxSize);
  Q_strcat(path, maxSize, extension);
}


x86 assembly (clang, -O0):
<COM_SetExtension>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
call   1030 <COM_StripExtension@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
call   1040 <Q_strcat@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<COM_SetExtension>:
push   %rbp
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %esi,%ebp
mov    %rdi,%rbx
mov    %rdi,%rsi
mov    %ebp,%edx
call   1030 <COM_StripExtension@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
mov    %r14,%rdx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <Q_strcat@plt>

LLVM IR (-O0):
define void @COM_SetExtension(i8* %0, i32 %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i8*
store i8* %0, i8** %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %4
%9 = load i32, i32* %5
%10 = call i32 @COM_StripExtension(i8* %7, i8* %8, i32 %9)
%11 = load i8*, i8** %4
%12 = load i32, i32* %5
%13 = load i8*, i8** %6
%14 = call i32 @Q_strcat(i8* %11, i32 %12, i8* %13)
ret void
}

LLVM IR (-O2):
define void @COM_SetExtension(i8* %0, i32 %1, i8* %2) {
%4 = tail call i32 @COM_StripExtension(i8* %0, i8* %0, i32 %1)
%5 = tail call i32 @Q_strcat(i8* %0, i32 %1, i8* %2)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
struct ndarray {
  int dummy;
};
typedef int int8_t;
typedef int /*<<< orphan*/ int64_t;

/* Variables and functions */
int /*<<< orphan*/ *stdlib_ndarray_get_ptr(struct ndarray const *,
                                           int /*<<< orphan*/ const *);
int stdlib_ndarray_get_ptr_int8(int /*<<< orphan*/ *, int *);
int8_t stdlib_ndarray_get_int8(const struct ndarray *arr, const int64_t *sub,
                               int8_t *out) {
  uint8_t *idx = stdlib_ndarray_get_ptr(arr, sub);
  if (idx == NULL) {
    return -1;
  }
  return stdlib_ndarray_get_ptr_int8(idx, out);
}


x86 assembly (clang, -O0):
<stdlib_ndarray_get_int8>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <stdlib_ndarray_get_ptr@plt>
mov    %rax,-0x28(%rbp)
cmpq   $0x0,-0x28(%rbp)
jne    115c <stdlib_ndarray_get_int8+0x3c>
movl   $0xffffffff,-0x4(%rbp)
jmp    116c <stdlib_ndarray_get_int8+0x4c>
mov    -0x28(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1040 <stdlib_ndarray_get_ptr_int8@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stdlib_ndarray_get_int8>:
push   %rbx
mov    %rdx,%rbx
call   1030 <stdlib_ndarray_get_ptr@plt>
test   %rax,%rax
je     113a <stdlib_ndarray_get_int8+0x1a>
mov    %rax,%rdi
mov    %rbx,%rsi
pop    %rbx
jmp    1040 <stdlib_ndarray_get_ptr_int8@plt>
mov    $0xffffffff,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.ndarray = type { i32 }
define i32 @stdlib_ndarray_get_int8(%struct.ndarray* %0, i32* %1, i32* %2) {
%4 = alloca i32
%5 = alloca %struct.ndarray*
%6 = alloca i32*
%7 = alloca i32*
%8 = alloca i32*
store %struct.ndarray* %0, %struct.ndarray** %5
store i32* %1, i32** %6
store i32* %2, i32** %7
%9 = load %struct.ndarray*, %struct.ndarray** %5
%10 = load i32*, i32** %6
%11 = call i32* @stdlib_ndarray_get_ptr(%struct.ndarray* %9, i32* %10)
store i32* %11, i32** %8
%12 = load i32*, i32** %8
%13 = icmp eq i32* %12, null
br i1 %13, label %14, label %15
14: ; preds = %3
store i32 -1, i32* %4
br label %19
15: ; preds = %3
%16 = load i32*, i32** %8
%17 = load i32*, i32** %7
%18 = call i32 @stdlib_ndarray_get_ptr_int8(i32* %16, i32* %17)
store i32 %18, i32* %4
br label %19
19: ; preds = %15, %14
%20 = load i32, i32* %4
ret i32 %20
}

LLVM IR (-O2):
%struct.ndarray = type { i32 }
define i32 @stdlib_ndarray_get_int8(%struct.ndarray* %0, i32* %1, i32* %2) {
%4 = tail call i32* @stdlib_ndarray_get_ptr(%struct.ndarray* %0, i32* %1)
%5 = icmp eq i32* %4, null
br i1 %5, label %8, label %6
6: ; preds = %3
%7 = tail call i32 @stdlib_ndarray_get_ptr_int8(i32* %4, i32* %2)
br label %8
8: ; preds = %3, %6
%9 = phi i32 [ %7, %6 ], [ -1, %3 ]
ret i32 %9
}
const char *jx9_lib_signature(void) { return "Jx9/1.7.2"; }


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

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

LLVM IR (-O0):
@.str = [10 x i8] c"Jx9/1.7.2\00"
define i8* @jx9_lib_signature() {
ret i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [10 x i8] c"Jx9/1.7.2\00"
define i8* @jx9_lib_signature() {
ret i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0)
}
/* Type definitions */
typedef int /*<<< orphan*/ va_list;

/* Variables and functions */
int /*<<< orphan*/ vprintf(char *, int /*<<< orphan*/);
void uninitvar_vprintf(char *Format, va_list Arg) {
  char *format;
  va_list arg;
  (void)vprintf(format, arg);
  (void)vprintf(format, Arg);
  (void)vprintf(Format, Arg);
  (void)vprintf(Format, arg);
}


x86 assembly (clang, -O0):
<uninitvar_vprintf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x1c(%rbp),%esi
call   1030 <vprintf@plt>
mov    -0x18(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <vprintf@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <vprintf@plt>
mov    -0x8(%rbp),%rdi
mov    -0x1c(%rbp),%esi
call   1030 <vprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uninitvar_vprintf>:
push   %r14
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %rdi,%r14
call   1030 <vprintf@plt>
mov    %ebx,%esi
call   1030 <vprintf@plt>
mov    %r14,%rdi
mov    %ebx,%esi
call   1030 <vprintf@plt>
mov    %r14,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <vprintf@plt>

LLVM IR (-O0):
define void @uninitvar_vprintf(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%7 = load i8*, i8** %5
%8 = load i32, i32* %6
%9 = call i32 @vprintf(i8* %7, i32 %8)
%10 = load i8*, i8** %5
%11 = load i32, i32* %4
%12 = call i32 @vprintf(i8* %10, i32 %11)
%13 = load i8*, i8** %3
%14 = load i32, i32* %4
%15 = call i32 @vprintf(i8* %13, i32 %14)
%16 = load i8*, i8** %3
%17 = load i32, i32* %6
%18 = call i32 @vprintf(i8* %16, i32 %17)
ret void
}

LLVM IR (-O2):
define void @uninitvar_vprintf(i8* nocapture %0, i32 %1) {
%3 = tail call i32 @vprintf(i8* undef, i32 undef)
%4 = tail call i32 @vprintf(i8* undef, i32 %1)
%5 = tail call i32 @vprintf(i8* %0, i32 %1)
%6 = tail call i32 @vprintf(i8* %0, i32 undef)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ edata;
int /*<<< orphan*/ end;
int /*<<< orphan*/ etext;
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char *argv[]) {
  extern edata, etext, end;
  printf("end of text segment: %d.\n", (int)&etext);
  printf("end of data segment: %d.\n", (int)&edata);
  printf("end of the uninitialize data segment: %d.\n", (int)&end);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
mov    0x2eca(%rip),%esi
call   1030 <printf@plt>
lea    0xef0(%rip),%rdi
mov    0x2e98(%rip),%esi
call   1030 <printf@plt>
lea    0xef8(%rip),%rdi
mov    0x2e96(%rip),%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [26 x i8] c"end of text segment: %d.\0A\00"
@etext = global i32 0
@.str.1 = [26 x i8] c"end of data segment: %d.\0A\00"
@edata = global i32 0
@.str.2 = [43 x i8] c"end of the uninitialize data segment: %d.\0A\00"
@end = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 ptrtoint (i32* @etext to i32))
%7 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0), i32 ptrtoint (i32* @edata to i32))
%8 = call i32 @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.2, i64 0, i64 0), i32 ptrtoint (i32* @end to i32))
ret i32 0
}

LLVM IR (-O2):
@.str = [26 x i8] c"end of text segment: %d.\0A\00"
@etext = global i32 0
@.str.1 = [26 x i8] c"end of data segment: %d.\0A\00"
@edata = global i32 0
@.str.2 = [43 x i8] c"end of the uninitialize data segment: %d.\0A\00"
@end = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 ptrtoint (i32* @etext to i32))
%4 = tail call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0), i32 ptrtoint (i32* @edata to i32))
%5 = tail call i32 @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.2, i64 0, i64 0), i32 ptrtoint (i32* @end to i32))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ FBerror(int, char *, size_t);
void *malloc(size_t);
void *FBalloc(size_t size) {
  void *s;
  if ((s = malloc(size)) == NULL) {
    FBerror(0x0001 | 0x0002, "FBalloc: couldn't get %ld bytes", size);
  }
  return (void *)s;
}


x86 assembly (clang, -O0):
<FBalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
jne    1158 <FBalloc+0x38>
mov    -0x8(%rbp),%rdx
mov    $0x3,%edi
lea    0xead(%rip),%rsi
call   1030 <FBerror@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<FBalloc>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1148 <FBalloc+0x28>
lea    0xec5(%rip),%rsi
mov    $0x3,%edi
mov    %r14,%rdx
call   1030 <FBerror@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [32 x i8] c"FBalloc: couldn't get %ld bytes\00"
define i8* @FBalloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = icmp eq i8* %5, null
br i1 %6, label %7, label %10
7: ; preds = %1
%8 = load i64, i64* %2
%9 = call i32 @FBerror(i32 3, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i64 %8)
br label %10
10: ; preds = %7, %1
%11 = load i8*, i8** %3
ret i8* %11
}

LLVM IR (-O2):
@.str = [32 x i8] c"FBalloc: couldn't get %ld bytes\00"
define noalias i8* @FBalloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @FBerror(i32 3, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i64 %0)
br label %6
6: ; preds = %4, %1
ret i8* %2
}
/* Variables and functions */
int U_WMRCORENONE_get(char *);
int U_WMR82_get(void) { return U_WMRCORENONE_get("U_WMR82"); }


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

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

LLVM IR (-O0):
@.str = [8 x i8] c"U_WMR82\00"
define i32 @U_WMR82_get() {
%1 = call i32 @U_WMRCORENONE_get(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}

LLVM IR (-O2):
@.str = [8 x i8] c"U_WMR82\00"
define i32 @U_WMR82_get() {
%1 = tail call i32 @U_WMRCORENONE_get(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}
void Hal_hook_rd_sgnbfield_bita(void) {}


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

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

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

LLVM IR (-O2):
define void @Hal_hook_rd_sgnbfield_bita() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
struct stat {
  int /*<<< orphan*/ st_mtime;
};

/* Variables and functions */
int /*<<< orphan*/ stat(char *, struct stat *);
time_t Getmodtime(char *url, int index) {
  struct stat info;
  stat(url, &info);
  return info.st_mtime;
}


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

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

LLVM IR (-O0):
%struct.stat = type { i32 }
define i32 @Getmodtime(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca %struct.stat
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i8*, i8** %3
%7 = call i32 @stat(i8* %6, %struct.stat* %5)
%8 = getelementptr inbounds %struct.stat, %struct.stat* %5, i32 0, i32 0
%9 = load i32, i32* %8
ret i32 %9
}

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @Getmodtime(i8* nocapture %0, i32 %1) {
%3 = alloca %struct.stat
%4 = bitcast %struct.stat* %3 to i8*
%5 = call i32 @stat(i8* %0, %struct.stat* %3)
%6 = getelementptr inbounds %struct.stat, %struct.stat* %3, i64 0, i32 0
%7 = load i32, i32* %6
ret i32 %7
}
/* Variables and functions */
int PAPI_write(int, long long *);
void papif_write__(int *EventSet, long long *values, int *check) {
  *check = PAPI_write(*EventSet, values);
}


x86 assembly (clang, -O0):
<papif_write__>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rsi
call   1030 <PAPI_write@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<papif_write__>:
push   %rbx
mov    %rdx,%rbx
mov    (%rdi),%edi
call   1030 <PAPI_write@plt>
mov    %eax,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @papif_write__(i32* %0, i64* %1, i32* %2) {
%4 = alloca i32*
%5 = alloca i64*
%6 = alloca i32*
store i32* %0, i32** %4
store i64* %1, i64** %5
store i32* %2, i32** %6
%7 = load i32*, i32** %4
%8 = load i32, i32* %7
%9 = load i64*, i64** %5
%10 = call i32 @PAPI_write(i32 %8, i64* %9)
%11 = load i32*, i32** %6
store i32 %10, i32* %11
ret void
}

LLVM IR (-O2):
define void @papif_write__(i32* nocapture %0, i64* %1, i32* nocapture writeonly %2) {
%4 = load i32, i32* %0
%5 = tail call i32 @PAPI_write(i32 %4, i64* %1)
store i32 %5, i32* %2
ret void
}
int countingNumberofOneswithBitwiseAND(unsigned int n) {
  int count = 0;
  while (n) {
    if (n & 1) {
      count++;
    }
    n = n >> 1;
  }
  return count;
}


x86 assembly (clang, -O0):
<countingNumberofOneswithBitwiseAND>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     113e <countingNumberofOneswithBitwiseAND+0x3e>
mov    -0x4(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     1130 <countingNumberofOneswithBitwiseAND+0x30>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    110e <countingNumberofOneswithBitwiseAND+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<countingNumberofOneswithBitwiseAND>:
xor    %eax,%eax
test   %edi,%edi
je     1120 <countingNumberofOneswithBitwiseAND+0x20>
mov    %edi,%ecx
nopl   0x0(%rax,%rax,1)
mov    %edi,%edx
and    $0x1,%edx
add    %edx,%eax
shr    %ecx
cmp    $0x1,%edi
mov    %ecx,%edi
ja     1110 <countingNumberofOneswithBitwiseAND+0x10>
ret

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

LLVM IR (-O2):
define i32 @countingNumberofOneswithBitwiseAND(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %10, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %7, %3 ], [ 0, %1 ]
%5 = phi i32 [ %8, %3 ], [ %0, %1 ]
%6 = and i32 %5, 1
%7 = add nuw nsw i32 %4, %6
%8 = lshr i32 %5, 1
%9 = icmp ult i32 %5, 2
br i1 %9, label %10, label %3
10: ; preds = %3, %1
%11 = phi i32 [ 0, %1 ], [ %7, %3 ]
ret i32 %11
}
/* Variables and functions */
long roundUpDiv(long, long);
long chunkOffset(long cC, long iC, long cN) {
  long r;
  if (cN > cC || cN < 1)
    r = -1;
  else
    r = (cN - 1) * roundUpDiv(iC, cC);
  return r;
}


x86 assembly (clang, -O0):
<chunkOffset>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x8(%rbp),%rax
jg     113d <chunkOffset+0x2d>
cmpq   $0x1,-0x18(%rbp)
jge    114a <chunkOffset+0x3a>
movq   $0xffffffffffffffff,-0x20(%rbp)
ff
jmp    1172 <chunkOffset+0x62>
mov    -0x18(%rbp),%rax
sub    $0x1,%rax
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <roundUpDiv@plt>
mov    %rax,%rcx
mov    -0x28(%rbp),%rax
imul   %rcx,%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<chunkOffset>:
push   %rbx
mov    $0xffffffffffffffff,%rax
cmp    %rdi,%rdx
jg     113b <chunkOffset+0x2b>
mov    %rdx,%rbx
test   %rdx,%rdx
jle    113b <chunkOffset+0x2b>
mov    %rdi,%rcx
add    $0xffffffffffffffff,%rbx
mov    %rsi,%rdi
mov    %rcx,%rsi
call   1030 <roundUpDiv@plt>
imul   %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i64 @chunkOffset(i64 %0, i64 %1, i64 %2) {
%4 = icmp sgt i64 %2, %0
%5 = icmp slt i64 %2, 1
%6 = or i1 %4, %5
br i1 %6, label %11, label %7
7: ; preds = %3
%8 = add nsw i64 %2, -1
%9 = tail call i64 @roundUpDiv(i64 %1, i64 %0)
%10 = mul nsw i64 %9, %8
br label %11
11: ; preds = %3, %7
%12 = phi i64 [ %10, %7 ], [ -1, %3 ]
ret i64 %12
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
uint8_t Settings_GetLimitPinMask(uint8_t axis_idx) {
  if (axis_idx == 0) {
    return (1 << 0);
  }
  if (axis_idx == 1) {
    return (1 << 1);
  }
  if (axis_idx == 2) {
    return (1 << 2);
  }
  if (axis_idx == 3) {
    return (1 << 3);
  }
  return (1 << 4);
}


x86 assembly (clang, -O0):
<Settings_GetLimitPinMask>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    111d <Settings_GetLimitPinMask+0x1d>
movl   $0x1,-0x4(%rbp)
jmp    1166 <Settings_GetLimitPinMask+0x66>
cmpl   $0x1,-0x8(%rbp)
jne    1133 <Settings_GetLimitPinMask+0x33>
movl   $0x2,-0x4(%rbp)
jmp    1166 <Settings_GetLimitPinMask+0x66>
cmpl   $0x2,-0x8(%rbp)
jne    1149 <Settings_GetLimitPinMask+0x49>
movl   $0x4,-0x4(%rbp)
jmp    1166 <Settings_GetLimitPinMask+0x66>
cmpl   $0x3,-0x8(%rbp)
jne    115f <Settings_GetLimitPinMask+0x5f>
movl   $0x8,-0x4(%rbp)
jmp    1166 <Settings_GetLimitPinMask+0x66>
movl   $0x10,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Settings_GetLimitPinMask>:
mov    $0x10,%eax
cmp    $0x3,%edi
ja     1117 <Settings_GetLimitPinMask+0x17>
movslq %edi,%rax
lea    0xeec(%rip),%rcx
mov    (%rcx,%rax,4),%eax
ret

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

LLVM IR (-O2):
@switch.table.Settings_GetLimitPinMask = [4 x i32] [i32 1, i32 2, i32 4, i32 8]
define i32 @Settings_GetLimitPinMask(i32 %0) {
%2 = icmp ult i32 %0, 4
br i1 %2, label %3, label %7
3: ; preds = %1
%4 = sext i32 %0 to i64
%5 = getelementptr inbounds [4 x i32], [4 x i32]* @switch.table.Settings_GetLimitPinMask, i64 0, i64 %4
%6 = load i32, i32* %5
br label %7
7: ; preds = %1, %3
%8 = phi i32 [ %6, %3 ], [ 16, %1 ]
ret i32 %8
}
void null_scale(unsigned char *dest, unsigned int dest_pitch,
                unsigned int dest_width) {
  (void)dest;
  (void)dest_pitch;
  (void)dest_width;
  return;
}


x86 assembly (clang, -O0):
<null_scale>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @null_scale(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i8*, i8** %4
%8 = load i32, i32* %5
%9 = load i32, i32* %6
ret void
}

LLVM IR (-O2):
define void @null_scale(i8* nocapture %0, i32 %1, i32 %2) {
ret void
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  int type;
};
struct TYPE_4__ {
  TYPE_1__ xkey;
};
typedef TYPE_2__ XEvent;

/* Variables and functions */
void set_XEvent_xkey_type(void *_p, int _v) {
  ((XEvent *)_p)->xkey.type = (int)_v;
}


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

x86 assembly (clang, -O2):
<set_XEvent_xkey_type>:
mov    %esi,(%rdi)
ret

LLVM IR (-O0):
%struct.TYPE_4__ = type { %struct.TYPE_3__ }
%struct.TYPE_3__ = type { i32 }
define void @set_XEvent_xkey_type(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to %struct.TYPE_4__*
%8 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %7, i32 0, i32 0
%9 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %8, i32 0, i32 0
store i32 %5, i32* %9
ret void
}

LLVM IR (-O2):
define void @set_XEvent_xkey_type(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
store i32 %1, i32* %3
ret void
}
void crypto_hmac(void) { nsc_assert(0, __func__); }


x86 assembly (clang, -O0):
<crypto_hmac>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
lea    0xee3(%rip),%rsi
mov    $0x0,%al
call   1030 <nsc_assert@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<crypto_hmac>:
lea    0xee9(%rip),%rsi
xor    %edi,%edi
xor    %eax,%eax
jmp    1030 <nsc_assert@plt>

LLVM IR (-O0):
@__func__.crypto_hmac = [12 x i8] c"crypto_hmac\00"
define void @crypto_hmac() {
%1 = call i32 (i32, i8*, ...) bitcast (i32 (...)* @nsc_assert to i32 (i32, i8*, ...)*)(i32 0, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @__func__.crypto_hmac, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@__func__.crypto_hmac = [12 x i8] c"crypto_hmac\00"
define void @crypto_hmac() {
%1 = tail call i32 (i32, i8*, ...) bitcast (i32 (...)* @nsc_assert to i32 (i32, i8*, ...)*)(i32 0, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @__func__.crypto_hmac, i64 0, i64 0))
ret void
}
extern void tracemat(int level, const double *A, int n, int m, int p, int q) {}


x86 assembly (clang, -O0):
<tracemat>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    %r8d,-0x1c(%rbp)
mov    %r9d,-0x20(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @tracemat(i32 %0, double* nocapture %1, i32 %2, i32 %3, i32 %4, i32 %5) {
ret void
}
int trailingZeroes(int n) {
  int result;
  long x, powerFive = 5;
  for (result = 0, x = n / powerFive; x > 0;) {
    result += x;
    powerFive *= 5;
    x = n / powerFive;
  }
  return result;
}


x86 assembly (clang, -O0):
<trailingZeroes>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movq   $0x5,-0x18(%rbp)
movl   $0x0,-0x8(%rbp)
movslq -0x4(%rbp),%rax
cqto
idivq  -0x18(%rbp)
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jle    1159 <trailingZeroes+0x59>
mov    -0x10(%rbp),%rcx
movslq -0x8(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0x8(%rbp)
imul   $0x5,-0x18(%rbp),%rax
mov    %rax,-0x18(%rbp)
movslq -0x4(%rbp),%rax
cqto
idivq  -0x18(%rbp)
mov    %rax,-0x10(%rbp)
jmp    1124 <trailingZeroes+0x24>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<trailingZeroes>:
xor    %esi,%esi
cmp    $0x5,%edi
jl     115b <trailingZeroes+0x5b>
mov    %edi,%r8d
movslq %edi,%r9
mov    %edi,%eax
mov    $0xcccccccd,%edi
imul   %rax,%rdi
shr    $0x22,%rdi
xor    %esi,%esi
mov    $0x5,%ecx
jmp    1142 <trailingZeroes+0x42>
cs nopw 0x0(%rax,%rax,1)
nop
mov    %r9,%rax
cqto
idiv   %rcx
add    %edi,%esi
mov    %rax,%rdi
test   %rax,%rax
jle    115b <trailingZeroes+0x5b>
lea    (%rcx,%rcx,4),%rcx
mov    %r9,%rax
or     %rcx,%rax
shr    $0x20,%rax
jne    1130 <trailingZeroes+0x30>
mov    %r8d,%eax
xor    %edx,%edx
div    %ecx
jmp    1138 <trailingZeroes+0x38>
mov    %esi,%eax
ret

LLVM IR (-O0):
define i32 @trailingZeroes(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i64
%5 = alloca i64
store i32 %0, i32* %2
store i64 5, i64* %5
store i32 0, i32* %3
%6 = load i32, i32* %2
%7 = sext i32 %6 to i64
%8 = load i64, i64* %5
%9 = sdiv i64 %7, %8
store i64 %9, i64* %4
br label %10
10: ; preds = %13, %1
%11 = load i64, i64* %4
%12 = icmp sgt i64 %11, 0
br i1 %12, label %13, label %25
13: ; preds = %10
%14 = load i64, i64* %4
%15 = load i32, i32* %3
%16 = sext i32 %15 to i64
%17 = add nsw i64 %16, %14
%18 = trunc i64 %17 to i32
store i32 %18, i32* %3
%19 = load i64, i64* %5
%20 = mul nsw i64 %19, 5
store i64 %20, i64* %5
%21 = load i32, i32* %2
%22 = sext i32 %21 to i64
%23 = load i64, i64* %5
%24 = sdiv i64 %22, %23
store i64 %24, i64* %4
br label %10
25: ; preds = %10
%26 = load i32, i32* %3
ret i32 %26
}

LLVM IR (-O2):
define i32 @trailingZeroes(i32 %0) {
%2 = sext i32 %0 to i64
%3 = icmp sgt i32 %0, 4
br i1 %3, label %4, label %16
4: ; preds = %1
%5 = udiv i32 %0, 5
%6 = zext i32 %5 to i64
br label %7
7: ; preds = %4, %7
%8 = phi i64 [ %13, %7 ], [ 5, %4 ]
%9 = phi i64 [ %14, %7 ], [ %6, %4 ]
%10 = phi i32 [ %12, %7 ], [ 0, %4 ]
%11 = trunc i64 %9 to i32
%12 = add i32 %10, %11
%13 = mul nuw nsw i64 %8, 5
%14 = sdiv i64 %2, %13
%15 = icmp sgt i64 %14, 0
br i1 %15, label %7, label %16
16: ; preds = %7, %1
%17 = phi i32 [ 0, %1 ], [ %12, %7 ]
ret i32 %17
}
/* Variables and functions */
int /*<<< orphan*/ kprint(char *);
int /*<<< orphan*/ kputc(char);
void kputs(char *s) {
  kprint(s);
  kputc('\r');
  kputc('\n');
}


x86 assembly (clang, -O0):
<kputs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <kprint@plt>
mov    $0xd,%edi
call   1040 <kputc@plt>
mov    $0xa,%edi
call   1040 <kputc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<kputs>:
push   %rax
call   1030 <kprint@plt>
mov    $0xd,%edi
call   1040 <kputc@plt>
mov    $0xa,%edi
pop    %rax
jmp    1040 <kputc@plt>

LLVM IR (-O0):
define void @kputs(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @kprint(i8* %3)
%5 = call i32 @kputc(i8 signext 13)
%6 = call i32 @kputc(i8 signext 10)
ret void
}

LLVM IR (-O2):
define void @kputs(i8* %0) {
%2 = tail call i32 @kprint(i8* %0)
%3 = tail call i32 @kputc(i8 signext 13)
%4 = tail call i32 @kputc(i8 signext 10)
ret void
}