xunge/DecIR huggingface dataset:
/* Type definitions */
struct stat {
  int st_mode;
};

/* Variables and functions */
int S_IFDIR;
scalar_t__ stat(char const *, struct stat *);
int is_directory(const char *filename) {
  struct stat s;
  if (stat(filename, &s) != 0) {
    return 0;
  } else if (!(s.st_mode & S_IFDIR)) {
    return 0;
  }
  return 1;
}


x86 assembly (clang, -O0):
<is_directory>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1030 <stat@plt>
cmp    $0x0,%rax
je     113f <is_directory+0x2f>
movl   $0x0,-0x4(%rbp)
jmp    116c <is_directory+0x5c>
mov    -0x18(%rbp),%eax
mov    0x2e8f(%rip),%rcx
and    (%rcx),%eax
cmp    $0x0,%eax
jne    1160 <is_directory+0x50>
movl   $0x0,-0x4(%rbp)
jmp    116c <is_directory+0x5c>
jmp    1165 <is_directory+0x55>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_directory>:
push   %rax
mov    %rsp,%rsi
call   1030 <stat@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
je     1125 <is_directory+0x15>
pop    %rcx
ret
mov    0x2eac(%rip),%rax
mov    (%rax),%ecx
xor    %eax,%eax
test   %ecx,(%rsp)
setne  %al
pop    %rcx
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
@S_IFDIR = global i32 0
define i32 @is_directory(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca %struct.stat
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i64 @stat(i8* %5, %struct.stat* %4)
%7 = icmp ne i64 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %1
store i32 0, i32* %2
br label %18
9: ; preds = %1
%10 = getelementptr inbounds %struct.stat, %struct.stat* %4, i32 0, i32 0
%11 = load i32, i32* %10
%12 = load i32, i32* @S_IFDIR
%13 = and i32 %11, %12
%14 = icmp ne i32 %13, 0
br i1 %14, label %16, label %15
15: ; preds = %9
store i32 0, i32* %2
br label %18
16: ; preds = %9
br label %17
17: ; preds = %16
store i32 1, i32* %2
br label %18
18: ; preds = %17, %15, %8
%19 = load i32, i32* %2
ret i32 %19
}

LLVM IR (-O2):
%struct.stat = type { i32 }
@S_IFDIR = global i32 0
define i32 @is_directory(i8* %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i64 @stat(i8* %0, %struct.stat* %2)
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %13
6: ; preds = %1
%7 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%8 = load i32, i32* %7
%9 = load i32, i32* @S_IFDIR
%10 = and i32 %9, %8
%11 = icmp ne i32 %10, 0
%12 = zext i1 %11 to i32
br label %13
13: ; preds = %6, %1
%14 = phi i32 [ 0, %1 ], [ %12, %6 ]
ret i32 %14
}
/* Variables and functions */
int /*<<< orphan*/ on_exit(void (*)(), int /*<<< orphan*/);
int atexit(void (*f)(void)) {
  on_exit(f, 0);
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @atexit(void ()* %0) {
%2 = alloca void ()*
store void ()* %0, void ()** %2
%3 = load void ()*, void ()** %2
%4 = bitcast void ()* %3 to void (...)*
%5 = call i32 @on_exit(void (...)* %4, i32 0)
ret i32 0
}

LLVM IR (-O2):
define i32 @atexit(void ()* %0) {
%2 = bitcast void ()* %0 to void (...)*
%3 = tail call i32 @on_exit(void (...)* %2, i32 0)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ _flockfile_stub(int /*<<< orphan*/ *);
void flockfile(FILE *fp) { _flockfile_stub(fp); }


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

x86 assembly (clang, -O2):
<flockfile>:
jmp    1030 <_flockfile_stub@plt>

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

LLVM IR (-O2):
define void @flockfile(i32* %0) {
%2 = tail call i32 @_flockfile_stub(i32* %0)
ret void
}
int foo(void) {
  char *p;
  {
    char a = 0;
    p = &a;
  }
  if (*p)
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
movb   $0x0,-0x11(%rbp)
lea    -0x11(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1129 <foo+0x29>
movl   $0x1,-0x4(%rbp)
jmp    1130 <foo+0x30>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @foo() {
%1 = alloca i32
%2 = alloca i8*
%3 = alloca i8
store i8 0, i8* %3
store i8* %3, i8** %2
%4 = load i8*, i8** %2
%5 = load i8, i8* %4
%6 = icmp ne i8 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %0
store i32 1, i32* %1
br label %9
8: ; preds = %0
store i32 0, i32* %1
br label %9
9: ; preds = %8, %7
%10 = load i32, i32* %1
ret i32 %10
}

LLVM IR (-O2):
define i32 @foo() {
ret i32 0
}
void aux_print_elements(d, aux) void *const d;
void *const aux;
{
  int *ip = (int *)d;
  printf("%d\n", *ip);
}


x86 assembly (clang, -O0):
<aux_print_elements>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%esi
lea    0xecb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<aux_print_elements>:
mov    (%rdi),%esi
lea    0xee7(%rip),%rdi
xor    %eax,%eax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
define void @aux_print_elements(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32*
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to i32*
store i32* %7, i32** %5
%8 = load i32*, i32** %5
%9 = load i32, i32* %8
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %9)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define void @aux_print_elements(i8* nocapture %0, i8* nocapture readnone %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %4)
ret void
}
void occampi_ctclienttrace_chook_free(void *chook) { return; }


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

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

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

LLVM IR (-O2):
define void @occampi_ctclienttrace_chook_free(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ openseq(int /*<<< orphan*/);
void op_openseqp() { openseq(0); }


x86 assembly (clang, -O0):
<op_openseqp>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <openseq@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @op_openseqp() {
%1 = call i32 @openseq(i32 0)
ret void
}

LLVM IR (-O2):
define void @op_openseqp() {
%1 = tail call i32 @openseq(i32 0)
ret void
}
int fn2(int a, int b) {
  int tem1 = b | a;
  int tem2 = a ^ b;
  return tem1 ^ tem2;
}


x86 assembly (clang, -O0):
<fn2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
or     -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
xor    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
xor    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fn2>:
mov    %edi,%eax
and    %esi,%eax
ret

LLVM IR (-O0):
define i32 @fn2(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%7 = load i32, i32* %4
%8 = load i32, i32* %3
%9 = or i32 %7, %8
store i32 %9, i32* %5
%10 = load i32, i32* %3
%11 = load i32, i32* %4
%12 = xor i32 %10, %11
store i32 %12, i32* %6
%13 = load i32, i32* %5
%14 = load i32, i32* %6
%15 = xor i32 %13, %14
ret i32 %15
}

LLVM IR (-O2):
define i32 @fn2(i32 %0, i32 %1) {
%3 = and i32 %1, %0
ret i32 %3
}
/* Variables and functions */
char *malloc(int);
int rand();
char *realloc(char *, int);
int /*<<< orphan*/ strcpy(char *, char *);
char *fn72() {
  char *result;
  result = malloc(20 + rand() % 20);
  result = realloc(result, 30 + rand() % 20);
  strcpy((char *)result, "fn72");
  return result;
}


x86 assembly (clang, -O0):
<fn72>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1060 <rand@plt>
mov    $0x14,%ecx
cltd
idiv   %ecx
mov    %edx,%edi
add    $0x14,%edi
call   1040 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    $0x0,%al
call   1060 <rand@plt>
mov    -0x10(%rbp),%rdi
mov    $0x14,%ecx
cltd
idiv   %ecx
mov    %edx,%esi
add    $0x1e,%esi
call   1050 <realloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xe67(%rip),%rsi
call   1030 <strcpy@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fn72>:
push   %rbx
xor    %eax,%eax
call   1060 <rand@plt>
cltq
imul   $0x66666667,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x23,%rcx
add    %edx,%ecx
shl    $0x2,%ecx
lea    (%rcx,%rcx,4),%ecx
neg    %ecx
lea    (%rax,%rcx,1),%edi
add    $0x14,%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
xor    %eax,%eax
call   1060 <rand@plt>
cltq
imul   $0x66666667,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x23,%rcx
add    %edx,%ecx
shl    $0x2,%ecx
lea    (%rcx,%rcx,4),%ecx
neg    %ecx
lea    (%rax,%rcx,1),%esi
add    $0x1e,%esi
mov    %rbx,%rdi
call   1050 <realloc@plt>
mov    %rax,%rbx
lea    0xe4f(%rip),%rsi
mov    %rax,%rdi
call   1030 <strcpy@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"fn72\00"
define i8* @fn72() {
%1 = alloca i8*
%2 = call i32 (...) @rand()
%3 = srem i32 %2, 20
%4 = add nsw i32 20, %3
%5 = call i8* @malloc(i32 %4)
store i8* %5, i8** %1
%6 = load i8*, i8** %1
%7 = call i32 (...) @rand()
%8 = srem i32 %7, 20
%9 = add nsw i32 30, %8
%10 = call i8* @realloc(i8* %6, i32 %9)
store i8* %10, i8** %1
%11 = load i8*, i8** %1
%12 = call i32 @strcpy(i8* %11, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%13 = load i8*, i8** %1
ret i8* %13
}

LLVM IR (-O2):
@.str = [5 x i8] c"fn72\00"
define i8* @fn72() {
%1 = tail call i32 (...) @rand()
%2 = srem i32 %1, 20
%3 = add nsw i32 %2, 20
%4 = tail call i8* @malloc(i32 %3)
%5 = tail call i32 (...) @rand()
%6 = srem i32 %5, 20
%7 = add nsw i32 %6, 30
%8 = tail call i8* @realloc(i8* %4, i32 %7)
%9 = tail call i32 @strcpy(i8* %8, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret i8* %8
}
/* Variables and functions */
char *malloc(size_t);
int /*<<< orphan*/ memcpy(char *, char const *, size_t);
size_t strnlen(char const *, size_t);
char *strndup(const char *str, size_t maxlen) {
  char *copy;
  size_t len;
  len = strnlen(str, maxlen);
  copy = malloc(len + 1);
  if (copy != NULL) {
    (void)memcpy(copy, str, len);
    copy[len] = '\0';
  }
  return copy;
}


x86 assembly (clang, -O0):
<strndup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strnlen@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
add    $0x1,%rdi
call   1050 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     118a <strndup+0x5a>
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x20(%rbp),%rdx
call   1040 <memcpy@plt>
mov    -0x18(%rbp),%rax
mov    -0x20(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strndup>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
call   1030 <strnlen@plt>
mov    %rax,%r15
lea    0x1(%rax),%rdi
call   1050 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
je     1164 <strndup+0x34>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
call   1040 <memcpy@plt>
movb   $0x0,(%rbx,%r15,1)
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @strndup(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i8*
%6 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%7 = load i8*, i8** %3
%8 = load i64, i64* %4
%9 = call i64 @strnlen(i8* %7, i64 %8)
store i64 %9, i64* %6
%10 = load i64, i64* %6
%11 = add i64 %10, 1
%12 = call i8* @malloc(i64 %11)
store i8* %12, i8** %5
%13 = load i8*, i8** %5
%14 = icmp ne i8* %13, null
br i1 %14, label %15, label %23
15: ; preds = %2
%16 = load i8*, i8** %5
%17 = load i8*, i8** %3
%18 = load i64, i64* %6
%19 = call i32 @memcpy(i8* %16, i8* %17, i64 %18)
%20 = load i8*, i8** %5
%21 = load i64, i64* %6
%22 = getelementptr inbounds i8, i8* %20, i64 %21
store i8 0, i8* %22
br label %23
23: ; preds = %15, %2
%24 = load i8*, i8** %5
ret i8* %24
}

LLVM IR (-O2):
define i8* @strndup(i8* %0, i64 %1) {
%3 = tail call i64 @strnlen(i8* %0, i64 %1)
%4 = add i64 %3, 1
%5 = tail call i8* @malloc(i64 %4)
%6 = icmp eq i8* %5, null
br i1 %6, label %10, label %7
7: ; preds = %2
%8 = tail call i32 @memcpy(i8* %5, i8* %0, i64 %3)
%9 = getelementptr inbounds i8, i8* %5, i64 %3
store i8 0, i8* %9
br label %10
10: ; preds = %7, %2
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ fmessage(char *, float);
float timetrace_end();
void print_time(void) {
  float delta = timetrace_end();
  fmessage("Child process initialized in %.02f ms\n", delta);
}


x86 assembly (clang, -O0):
<print_time>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <timetrace_end@plt>
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
lea    0xec0(%rip),%rdi
call   1040 <fmessage@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_time>:
push   %rax
xor    %eax,%eax
call   1030 <timetrace_end@plt>
lea    0xed1(%rip),%rdi
pop    %rax
jmp    1040 <fmessage@plt>

LLVM IR (-O0):
@.str = [39 x i8] c"Child process initialized in %.02f ms\0A\00"
define void @print_time() {
%1 = alloca float
%2 = call float (...) @timetrace_end()
store float %2, float* %1
%3 = load float, float* %1
%4 = call i32 @fmessage(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), float %3)
ret void
}

LLVM IR (-O2):
@.str = [39 x i8] c"Child process initialized in %.02f ms\0A\00"
define void @print_time() {
%1 = tail call float (...) @timetrace_end()
%2 = tail call i32 @fmessage(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), float %1)
ret void
}
long __syscall2(long num, long arg1, long arg2) {
  unsigned long result;
  asm volatile("syscall"
               : "=a"(result)
               : "a"(num), "D"(arg1), "S"(arg2)
               : "memory", "rcx", "r11");
  return result;
}


x86 assembly (clang, -O0):
<__syscall2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
syscall
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__syscall2>:
mov    %rdi,%rax
mov    %rsi,%rdi
mov    %rdx,%rsi
syscall
ret

LLVM IR (-O0):
define i64 @__syscall2(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* %4
%9 = load i64, i64* %5
%10 = load i64, i64* %6
%11 = call i64 asm sideeffect "syscall", "={ax},{ax},{di},{si},~{memory},~{rcx},~{r11},~{dirflag},~{fpsr},~{flags}"(i64 %8, i64 %9, i64 %10)
store i64 %11, i64* %7
%12 = load i64, i64* %7
ret i64 %12
}

LLVM IR (-O2):
define i64 @__syscall2(i64 %0, i64 %1, i64 %2) {
%4 = tail call i64 asm sideeffect "syscall", "={ax},{ax},{di},{si},~{memory},~{rcx},~{r11},~{dirflag},~{fpsr},~{flags}"(i64 %0, i64 %1, i64 %2)
ret i64 %4
}
/* Variables and functions */
int /*<<< orphan*/ cng_destroy_window();
int /*<<< orphan*/ cng_main_loop();
void quitte(void) {
  cng_main_loop();
  cng_destroy_window();
}


x86 assembly (clang, -O0):
<quitte>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <cng_main_loop@plt>
mov    $0x0,%al
call   1030 <cng_destroy_window@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<quitte>:
push   %rax
xor    %eax,%eax
call   1040 <cng_main_loop@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <cng_destroy_window@plt>

LLVM IR (-O0):
define void @quitte() {
%1 = call i32 (...) @cng_main_loop()
%2 = call i32 (...) @cng_destroy_window()
ret void
}

LLVM IR (-O2):
define void @quitte() {
%1 = tail call i32 (...) @cng_main_loop()
%2 = tail call i32 (...) @cng_destroy_window()
ret void
}
/* Variables and functions */
void *strdup(char const *);
void *nxtinit(const char *source) { return strdup(source); }


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

x86 assembly (clang, -O2):
<nxtinit>:
jmp    1030 <strdup@plt>

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

LLVM IR (-O2):
define noalias i8* @nxtinit(i8* nocapture %0) {
%2 = tail call i8* @strdup(i8* %0)
ret i8* %2
}
void kol_screen_get_size(unsigned *w, unsigned *h) {
  unsigned size;
  asm volatile("int $0x40" : "=a"(size) : "a"(14));
  *w = size / 65536;
  *h = size % 65536;
}


x86 assembly (clang, -O0):
<kol_screen_get_size>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0xe,%eax
int    $0x40
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%ecx
shr    $0x10,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x14(%rbp),%ecx
and    $0xffff,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<kol_screen_get_size>:
mov    $0xe,%eax
int    $0x40
movzwl %ax,%ecx
shr    $0x10,%eax
mov    %eax,(%rdi)
mov    %ecx,(%rsi)
ret

LLVM IR (-O0):
define void @kol_screen_get_size(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
%5 = alloca i32
store i32* %0, i32** %3
store i32* %1, i32** %4
%6 = call i32 asm sideeffect "int $$0x40", "={ax},{ax},~{dirflag},~{fpsr},~{flags}"(i32 14)
store i32 %6, i32* %5
%7 = load i32, i32* %5
%8 = udiv i32 %7, 65536
%9 = load i32*, i32** %3
store i32 %8, i32* %9
%10 = load i32, i32* %5
%11 = urem i32 %10, 65536
%12 = load i32*, i32** %4
store i32 %11, i32* %12
ret void
}

LLVM IR (-O2):
define void @kol_screen_get_size(i32* nocapture writeonly %0, i32* nocapture writeonly %1) {
%3 = tail call i32 asm sideeffect "int $$0x40", "={ax},{ax},~{dirflag},~{fpsr},~{flags}"(i32 14)
%4 = lshr i32 %3, 16
store i32 %4, i32* %0
%5 = and i32 %3, 65535
store i32 %5, i32* %1
ret void
}
float dot3d(const float *a, const float *b) {
  return a[0] * b[0] + a[1] * b[1] + a[2] * b[2];
}


x86 assembly (clang, -O0):
<dot3d>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm1
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm2
mov    -0x8(%rbp),%rax
movss  0x4(%rax),%xmm0
mov    -0x10(%rbp),%rax
mulss  0x4(%rax),%xmm0
mulss  %xmm2,%xmm1
addss  %xmm0,%xmm1
mov    -0x8(%rbp),%rax
movss  0x8(%rax),%xmm0
mov    -0x10(%rbp),%rax
movss  0x8(%rax),%xmm2
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<dot3d>:
movss  0x4(%rdi),%xmm0
mulss  0x4(%rsi),%xmm0
movss  (%rdi),%xmm1
mulss  (%rsi),%xmm1
addss  %xmm0,%xmm1
movss  0x8(%rdi),%xmm0
mulss  0x8(%rsi),%xmm0
addss  %xmm1,%xmm0
ret

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

LLVM IR (-O2):
define float @dot3d(float* nocapture %0, float* nocapture %1) {
%3 = load float, float* %0
%4 = load float, float* %1
%5 = getelementptr inbounds float, float* %0, i64 1
%6 = load float, float* %5
%7 = getelementptr inbounds float, float* %1, i64 1
%8 = load float, float* %7
%9 = fmul float %6, %8
%10 = tail call float @llvm.fmuladd.f32(float %3, float %4, float %9)
%11 = getelementptr inbounds float, float* %0, i64 2
%12 = load float, float* %11
%13 = getelementptr inbounds float, float* %1, i64 2
%14 = load float, float* %13
%15 = tail call float @llvm.fmuladd.f32(float %12, float %14, float %10)
ret float %15
}
/* Type definitions */
typedef int /*<<< orphan*/ buf;

/* Variables and functions */
int /*<<< orphan*/ AT_FDCWD;
int readlinkat(int /*<<< orphan*/, char *, char *, int);
int main(void) {
  char buf[4096];
  return readlinkat(AT_FDCWD, "test", buf, sizeof(buf));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1010,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2eaf(%rip),%rax
mov    (%rax),%edi
lea    -0x1010(%rbp),%rdx
lea    0xec7(%rip),%rsi
mov    $0x1000,%ecx
call   1030 <readlinkat@plt>
add    $0x1010,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x1008,%rsp
mov    0x2eba(%rip),%rax
mov    (%rax),%edi
lea    0xed9(%rip),%rsi
mov    %rsp,%rdx
mov    $0x1000,%ecx
call   1030 <readlinkat@plt>
add    $0x1008,%rsp
ret

LLVM IR (-O0):
@AT_FDCWD = global i32 0
@.str = [5 x i8] c"test\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [4096 x i8]
store i32 0, i32* %1
%3 = load i32, i32* @AT_FDCWD
%4 = getelementptr inbounds [4096 x i8], [4096 x i8]* %2, i64 0, i64 0
%5 = call i32 @readlinkat(i32 %3, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %4, i32 4096)
ret i32 %5
}

LLVM IR (-O2):
@AT_FDCWD = global i32 0
@.str = [5 x i8] c"test\00"
define i32 @main() {
%1 = alloca [4096 x i8]
%2 = getelementptr inbounds [4096 x i8], [4096 x i8]* %1, i64 0, i64 0
%3 = load i32, i32* @AT_FDCWD
%4 = call i32 @readlinkat(i32 %3, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %2, i32 4096)
ret i32 %4
}
int abs_0(int i) { return (i < 0) ? -i : i; }


x86 assembly (clang, -O0):
<abs_0>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    111e <abs_0+0x1e>
xor    %eax,%eax
sub    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    1124 <abs_0+0x24>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<abs_0>:
mov    %edi,%eax
neg    %eax
cmovs  %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @abs_0(i32 %0) {
%2 = tail call i32 @llvm.abs.i32(i32 %0, i1 true)
ret i32 %2
}
long baz(void) {
  char s = 'a';
  return s / 3L;
}


x86 assembly (clang, -O0):
<baz>:
push   %rbp
mov    %rsp,%rbp
movb   $0x61,-0x1(%rbp)
movsbq -0x1(%rbp),%rax
mov    $0x3,%ecx
cqto
idiv   %rcx
pop    %rbp
ret

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

LLVM IR (-O0):
define i64 @baz() {
%1 = alloca i8
store i8 97, i8* %1
%2 = load i8, i8* %1
%3 = sext i8 %2 to i64
%4 = sdiv i64 %3, 3
ret i64 %4
}

LLVM IR (-O2):
define i64 @baz() {
ret i64 32
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
char *strdup(char *);
int read_str(char *line, void *arg) {
  char **dest = arg;
  if (*dest)
    free(*dest);
  *dest = strdup(line);
  return 1;
}


x86 assembly (clang, -O0):
<read_str>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmpq   $0x0,(%rax)
je     1152 <read_str+0x32>
mov    -0x18(%rbp),%rax
mov    (%rax),%rdi
call   1030 <free@plt>
mov    -0x8(%rbp),%rdi
call   1040 <strdup@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,(%rax)
mov    $0x1,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_str>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    (%rsi),%rdi
test   %rdi,%rdi
je     1137 <read_str+0x17>
call   1030 <free@plt>
mov    %r14,%rdi
call   1040 <strdup@plt>
mov    %rax,(%rbx)
mov    $0x1,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i32 @read_str(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %1 to i8**
%4 = load i8*, i8** %3
%5 = icmp eq i8* %4, null
br i1 %5, label %8, label %6
6: ; preds = %2
%7 = tail call i32 @free(i8* %4)
br label %8
8: ; preds = %6, %2
%9 = tail call i8* @strdup(i8* %0)
store i8* %9, i8** %3
ret i32 1
}
void fs_x11(void) {}


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

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

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

LLVM IR (-O2):
define void @fs_x11() {
ret void
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ do_test(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ get_rand();
int /*<<< orphan*/ srand(int /*<<< orphan*/);
int /*<<< orphan*/ srand48(int /*<<< orphan*/);
int main(void) {
  srand(0);
  srand48(0);
  do_test(get_rand(), get_rand());
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xor    %edi,%edi
call   1040 <srand@plt>
xor    %edi,%edi
call   1060 <srand48@plt>
mov    $0x0,%al
call   1030 <get_rand@plt>
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1030 <get_rand@plt>
mov    -0x8(%rbp),%edi
mov    %eax,%esi
call   1050 <do_test@plt>
mov    0x2e61(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %edi,%edi
call   1040 <srand@plt>
xor    %edi,%edi
call   1060 <srand48@plt>
xor    %eax,%eax
call   1030 <get_rand@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1030 <get_rand@plt>
mov    %ebx,%edi
mov    %eax,%esi
call   1050 <do_test@plt>
mov    0x2e71(%rip),%rax
mov    (%rax),%eax
pop    %rbx
ret

LLVM IR (-O0):
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @srand(i32 0)
%3 = call i32 @srand48(i32 0)
%4 = call i32 (...) @get_rand()
%5 = call i32 (...) @get_rand()
%6 = call i32 @do_test(i32 %4, i32 %5)
%7 = load i32, i32* @EXIT_SUCCESS
ret i32 %7
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = tail call i32 @srand(i32 0)
%2 = tail call i32 @srand48(i32 0)
%3 = tail call i32 (...) @get_rand()
%4 = tail call i32 (...) @get_rand()
%5 = tail call i32 @do_test(i32 %3, i32 %4)
%6 = load i32, i32* @EXIT_SUCCESS
ret i32 %6
}
/* Type definitions */
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int32_t oml_value_clamp_long(long value) { return (int32_t)value; }


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

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

LLVM IR (-O0):
define i32 @oml_value_clamp_long(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
ret i32 %4
}

LLVM IR (-O2):
define i32 @oml_value_clamp_long(i64 %0) {
%2 = trunc i64 %0 to i32
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ free(int *);
int *malloc(int);
int /*<<< orphan*/ printf(char *, int);
int main() {
  int *matriz = malloc(2000 * 2000 * sizeof(int));
  matriz[0 * 2000 + 0] = 0;
  printf("%d", matriz[0 * 2000 + 0]);
  free(matriz);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0xf42400,%edi
call   1050 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movl   $0x0,(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%esi
lea    0xea3(%rip),%rdi
call   1040 <printf@plt>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0xf42400,%edi
call   1050 <malloc@plt>
mov    %rax,%rbx
movl   $0x0,(%rax)
lea    0xeb5(%rip),%rdi
xor    %esi,%esi
call   1040 <printf@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32*
%2 = call i32* @malloc(i32 16000000)
store i32* %2, i32** %1
%3 = load i32*, i32** %1
%4 = getelementptr inbounds i32, i32* %3, i64 0
store i32 0, i32* %4
%5 = load i32*, i32** %1
%6 = getelementptr inbounds i32, i32* %5, i64 0
%7 = load i32, i32* %6
%8 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = load i32*, i32** %1
%10 = call i32 @free(i32* %9)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = tail call i32* @malloc(i32 16000000)
store i32 0, i32* %1
%2 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 0)
%3 = tail call i32 @free(i32* %1)
ret i32 0
}
/* Type definitions */
typedef int uint16_t;
typedef int /*<<< orphan*/ int16_t;

/* Variables and functions */
int /*<<< orphan*/ USBSTK5515_I2C_write(int, int *, int);
int16_t OSD9616_send(uint16_t comdat, uint16_t data) {
  uint16_t cmd[2];
  cmd[0] = comdat & 0x00FF;
  cmd[1] = data;
  return USBSTK5515_I2C_write(0x3C, cmd, 2);
}


x86 assembly (clang, -O0):
<OSD9616_send>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
and    $0xff,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
lea    -0x10(%rbp),%rsi
mov    $0x3c,%edi
mov    $0x2,%edx
call   1030 <USBSTK5515_I2C_write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<OSD9616_send>:
push   %rax
movzbl %dil,%eax
mov    %eax,(%rsp)
mov    %esi,0x4(%rsp)
mov    %rsp,%rsi
mov    $0x3c,%edi
mov    $0x2,%edx
call   1030 <USBSTK5515_I2C_write@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @OSD9616_send(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca [2 x i32]
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = and i32 %6, 255
%8 = getelementptr inbounds [2 x i32], [2 x i32]* %5, i64 0, i64 0
store i32 %7, i32* %8
%9 = load i32, i32* %4
%10 = getelementptr inbounds [2 x i32], [2 x i32]* %5, i64 0, i64 1
store i32 %9, i32* %10
%11 = getelementptr inbounds [2 x i32], [2 x i32]* %5, i64 0, i64 0
%12 = call i32 @USBSTK5515_I2C_write(i32 60, i32* %11, i32 2)
ret i32 %12
}

LLVM IR (-O2):
define i32 @OSD9616_send(i32 %0, i32 %1) {
%3 = alloca [2 x i32]
%4 = bitcast [2 x i32]* %3 to i8*
%5 = and i32 %0, 255
%6 = getelementptr inbounds [2 x i32], [2 x i32]* %3, i64 0, i64 0
store i32 %5, i32* %6
%7 = getelementptr inbounds [2 x i32], [2 x i32]* %3, i64 0, i64 1
store i32 %1, i32* %7
%8 = call i32 @USBSTK5515_I2C_write(i32 60, i32* %6, i32 2)
ret i32 %8
}
/* Variables and functions */
size_t strlen(char *);
char *strcat(char *restrict dest, const char *restrict src) {
  size_t destlen = strlen(dest);
  char *d = dest + destlen;
  while ((*d++ = *src++))
    ;
  return dest;
}


x86 assembly (clang, -O0):
<strcat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
add    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%al
mov    -0x20(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x20(%rbp)
mov    %al,(%rcx)
cmp    $0x0,%al
je     1168 <strcat+0x58>
jmp    1139 <strcat+0x29>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcat>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
call   1030 <strlen@plt>
add    %r14,%rax
xor    %ecx,%ecx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movzbl (%rbx,%rcx,1),%edx
mov    %dl,(%rax,%rcx,1)
add    $0x1,%rcx
test   %dl,%dl
jne    1130 <strcat+0x20>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @strcat(i8* noalias returned %0, i8* noalias nocapture %1) {
%3 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%4 = getelementptr inbounds i8, i8* %0, i64 %3
br label %5
5: ; preds = %5, %2
%6 = phi i8* [ %1, %2 ], [ %8, %5 ]
%7 = phi i8* [ %4, %2 ], [ %10, %5 ]
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = load i8, i8* %6
%10 = getelementptr inbounds i8, i8* %7, i64 1
store i8 %9, i8* %7
%11 = icmp eq i8 %9, 0
br i1 %11, label %12, label %5
12: ; preds = %5
ret i8* %0
}
void *test_anti_range_102(unsigned short n) {
  extern void *alloc_anti_range_102(unsigned short)
      __attribute__((alloc_size(1)));
  if (0 <= n && n <= 2)
    n = 0 - 1;
  return alloc_anti_range_102(n);
}


x86 assembly (clang, -O0):
<test_anti_range_102>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%ecx
xor    %eax,%eax
cmp    %ecx,%eax
jg     1140 <test_anti_range_102+0x30>
movzwl -0x2(%rbp),%eax
cmp    $0x2,%eax
jg     1140 <test_anti_range_102+0x30>
movw   $0xffff,-0x2(%rbp)
movzwl -0x2(%rbp),%edi
call   1030 <alloc_anti_range_102@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_anti_range_102>:
cmp    $0x3,%di
mov    $0xffff,%eax
cmovb  %eax,%edi
jmp    1030 <alloc_anti_range_102@plt>

LLVM IR (-O0):
define i8* @test_anti_range_102(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = zext i16 %3 to i32
%5 = icmp sle i32 0, %4
br i1 %5, label %6, label %11
6: ; preds = %1
%7 = load i16, i16* %2
%8 = zext i16 %7 to i32
%9 = icmp sle i32 %8, 2
br i1 %9, label %10, label %11
10: ; preds = %6
store i16 -1, i16* %2
br label %11
11: ; preds = %10, %6, %1
%12 = load i16, i16* %2
%13 = call i8* @alloc_anti_range_102(i16 zeroext %12)
ret i8* %13
}

LLVM IR (-O2):
define i8* @test_anti_range_102(i16 zeroext %0) {
%2 = icmp ult i16 %0, 3
%3 = select i1 %2, i16 -1, i16 %0
%4 = tail call i8* @alloc_anti_range_102(i16 zeroext %3)
ret i8* %4
}
void g_object_class_find_property() {}


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

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

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

LLVM IR (-O2):
define void @g_object_class_find_property() {
ret void
}
/* Type definitions */
typedef scalar_t__ volatile uint32_t;

/* Variables and functions */
void OneWireIntEnable(uint32_t ui32Base, uint32_t ui32IntFlags) {
  ;

  ;
  (*((volatile uint32_t *)(ui32Base + 0x00000100))) |= ui32IntFlags;
}


x86 assembly (clang, -O0):
<OneWireIntEnable>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdx
mov    -0x8(%rbp),%rax
mov    0x100(%rax),%rcx
or     %rdx,%rcx
mov    %rcx,0x100(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<OneWireIntEnable>:
mov    %rdi,-0x8(%rsp)
mov    %rsi,-0x10(%rsp)
mov    -0x10(%rsp),%rax
mov    -0x8(%rsp),%rcx
or     %rax,0x100(%rcx)
ret

LLVM IR (-O0):
define void @OneWireIntEnable(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store volatile i64 %0, i64* %3
store volatile i64 %1, i64* %4
%5 = load volatile i64, i64* %4
%6 = load volatile i64, i64* %3
%7 = add nsw i64 %6, 256
%8 = inttoptr i64 %7 to i64*
%9 = load volatile i64, i64* %8
%10 = or i64 %9, %5
store volatile i64 %10, i64* %8
ret void
}

LLVM IR (-O2):
define void @OneWireIntEnable(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store volatile i64 %0, i64* %3
store volatile i64 %1, i64* %4
%5 = load volatile i64, i64* %4
%6 = load volatile i64, i64* %3
%7 = add nsw i64 %6, 256
%8 = inttoptr i64 %7 to i64*
%9 = load volatile i64, i64* %8
%10 = or i64 %9, %5
store volatile i64 %10, i64* %8
ret void
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
uint64_t compute_barrett_reduction_constant(void) {
  uint64_t quotient = 0;
  uint64_t dividend = 0x1;
  for (int i = 0; i < 64 - 32 + 1; i++) {
    if ((dividend >> i) & 1) {
      quotient |= (uint64_t)1 << i;
      dividend ^= (((uint64_t)0xEDB88320 << 1) | 1) << i;
    }
  }
  return quotient;
}


x86 assembly (clang, -O0):
<compute_barrett_reduction_constant>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x21,-0xc(%rbp)
jge    116a <compute_barrett_reduction_constant+0x6a>
mov    -0x8(%rbp),%eax
mov    -0xc(%rbp),%ecx
sar    %cl,%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     1157 <compute_barrett_reduction_constant+0x57>
mov    -0xc(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0xc(%rbp),%ecx
mov    $0xdb710641,%eax
shl    %cl,%eax
xor    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    115c <compute_barrett_reduction_constant+0x5c>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1119 <compute_barrett_reduction_constant+0x19>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @compute_barrett_reduction_constant() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 1, i32* %2
store i32 0, i32* %3
br label %4
4: ; preds = %23, %0
%5 = load i32, i32* %3
%6 = icmp slt i32 %5, 33
br i1 %6, label %7, label %26
7: ; preds = %4
%8 = load i32, i32* %2
%9 = load i32, i32* %3
%10 = ashr i32 %8, %9
%11 = and i32 %10, 1
%12 = icmp ne i32 %11, 0
br i1 %12, label %13, label %22
13: ; preds = %7
%14 = load i32, i32* %3
%15 = shl i32 1, %14
%16 = load i32, i32* %1
%17 = or i32 %16, %15
store i32 %17, i32* %1
%18 = load i32, i32* %3
%19 = shl i32 -613349823, %18
%20 = load i32, i32* %2
%21 = xor i32 %20, %19
store i32 %21, i32* %2
br label %22
22: ; preds = %13, %7
br label %23
23: ; preds = %22
%24 = load i32, i32* %3
%25 = add nsw i32 %24, 1
store i32 %25, i32* %3
br label %4
26: ; preds = %4
%27 = load i32, i32* %1
ret i32 %27
}

LLVM IR (-O2):
define i32 @compute_barrett_reduction_constant() {
ret i32 poison
}
/* Variables and functions */
int omp_get_max_threads();
int main(int argc, char *argv[]) {
  int nt = omp_get_max_threads();
  return nt;
}


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    $0x0,%al
call   1030 <omp_get_max_threads@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @omp_get_max_threads()
ret i32 %3
}
/* Variables and functions */
char *strchr(char const *, int);
char *index(const char *str, int c) { return strchr(str, c); }


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

x86 assembly (clang, -O2):
<index>:
jmp    1030 <strchr@plt>

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

LLVM IR (-O2):
define i8* @index(i8* %0, i32 %1) {
%3 = tail call i8* @strchr(i8* dereferenceable(1) %0, i32 %1)
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  fprintf(stderr,
          "usage: filecap [-a | -d | /dir | /dir/file [cap1 cap2 ...] ]\n");
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [62 x i8] c"usage: filecap [-a | -d | /dir | /dir/file [cap1 cap2 ...] ]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [62 x i8] c"usage: filecap [-a | -d | /dir | /dir/file [cap1 cap2 ...] ]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Type definitions */
typedef int gid_t;

/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int getgroups(int, int *);
scalar_t__ malloc(int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ stderr;
main() {
  int i;
  int *igroups;
  char *cgroups;
  int grp = 0;
  int ngroups = getgroups(0, &grp);
  if (sizeof(gid_t) == sizeof(int)) {
    fprintf(stderr, "gid_t and int are the same size\n");
    exit(1);
  }
  if (ngroups <= 0)
    ngroups = 32;
  igroups = (int *)malloc(sizeof(int) * ngroups);
  for (i = 0; i < ngroups; i++)
    igroups[i] = 0x42424242;
  ngroups = getgroups(ngroups, (gid_t *)igroups);
  if (igroups[0] == 0x42424242)
    ngroups = 0;
  if (ngroups == 0) {
    printf("WARNING: can't determine getgroups return type\n");
    exit(1);
  }
  cgroups = (char *)igroups;
  if (ngroups == 1 && cgroups[2] == 0x42 && cgroups[3] == 0x42) {
    fprintf(stderr, "getgroups returns gid_t\n");
    exit(1);
  }
  for (i = 0; i < ngroups; i++) {
    if (igroups[i] == 0x42424242) {
      fprintf(stderr, "getgroups returns gid_t\n");
      exit(1);
    }
  }
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x1c(%rbp)
xor    %edi,%edi
lea    -0x1c(%rbp),%rsi
call   1040 <getgroups@plt>
mov    %eax,-0x20(%rbp)
mov    0x2e85(%rip),%rax
mov    (%rax),%edi
lea    0xe9c(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0x0,0x4(%rsp)
lea    0x4(%rsp),%rsi
xor    %edi,%edi
call   1040 <getgroups@plt>
mov    0x2e94(%rip),%rax
mov    (%rax),%edi
lea    0xeab(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [33 x i8] c"gid_t and int are the same size\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32*
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %5
%7 = call i32 @getgroups(i32 0, i32* %5)
store i32 %7, i32* %6
%8 = load i32, i32* @stderr
%9 = call i32 @fprintf(i32 %8, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
%10 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [33 x i8] c"gid_t and int are the same size\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 0, i32* %1
%3 = call i32 @getgroups(i32 0, i32* %1)
%4 = load i32, i32* @stderr
%5 = call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
void *calloc(int, int);
char **initCellsStorage() {
  char **pointer = calloc(255, sizeof(char *));
  for (int i = 0; i < 255; i++)
    pointer[i] = calloc(255, sizeof(char));
  return pointer;
}


x86 assembly (clang, -O0):
<initCellsStorage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0xff,%edi
mov    $0x8,%esi
call   1030 <calloc@plt>
mov    %rax,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0xff,-0xc(%rbp)
jge    116b <initCellsStorage+0x5b>
mov    $0xff,%edi
mov    $0x1,%esi
call   1030 <calloc@plt>
mov    %rax,%rdx
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %rdx,(%rax,%rcx,8)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1132 <initCellsStorage+0x22>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<initCellsStorage>:
push   %r14
push   %rbx
push   %rax
mov    $0xff,%edi
mov    $0x8,%esi
call   1030 <calloc@plt>
mov    %rax,%r14
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
mov    $0xff,%edi
mov    $0x1,%esi
call   1030 <calloc@plt>
mov    %rax,(%r14,%rbx,8)
add    $0x1,%rbx
cmp    $0xff,%rbx
jne    1130 <initCellsStorage+0x20>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8** @initCellsStorage() {
%1 = alloca i8**
%2 = alloca i32
%3 = call i8* @calloc(i32 255, i32 8)
%4 = bitcast i8* %3 to i8**
store i8** %4, i8*** %1
store i32 0, i32* %2
br label %5
5: ; preds = %14, %0
%6 = load i32, i32* %2
%7 = icmp slt i32 %6, 255
br i1 %7, label %8, label %17
8: ; preds = %5
%9 = call i8* @calloc(i32 255, i32 1)
%10 = load i8**, i8*** %1
%11 = load i32, i32* %2
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds i8*, i8** %10, i64 %12
store i8* %9, i8** %13
br label %14
14: ; preds = %8
%15 = load i32, i32* %2
%16 = add nsw i32 %15, 1
store i32 %16, i32* %2
br label %5
17: ; preds = %5
%18 = load i8**, i8*** %1
ret i8** %18
}

LLVM IR (-O2):
define noalias i8** @initCellsStorage() {
%1 = tail call dereferenceable_or_null(2040) i8* @calloc(i32 255, i32 8)
%2 = bitcast i8* %1 to i8**
br label %4
3: ; preds = %4
ret i8** %2
4: ; preds = %0, %4
%5 = phi i64 [ 0, %0 ], [ %8, %4 ]
%6 = tail call dereferenceable_or_null(255) i8* @calloc(i32 255, i32 1)
%7 = getelementptr inbounds i8*, i8** %2, i64 %5
store i8* %6, i8** %7
%8 = add nuw nsw i64 %5, 1
%9 = icmp eq i64 %8, 255
br i1 %9, label %3, label %4
}