xunge/DecIR huggingface dataset:
void GC_noop() {}


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

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

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

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

/* Variables and functions */
int WEXITSTATUS(int);
scalar_t__ WIFEXITED(int);
scalar_t__ WIFSIGNALED(int);
int /*<<< orphan*/ WTERMSIG(int);
int /*<<< orphan*/ both_logs(char *, ...);
int /*<<< orphan*/ check_argc(int);
scalar_t__ determine_proc_usage(char *);
int /*<<< orphan*/ execute_command(char *, char *, char *, char *);
int /*<<< orphan*/ exit(int);
scalar_t__ fork();
int /*<<< orphan*/ open_log_files(char *);
int /*<<< orphan*/ parent_log(char *);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ raise(int /*<<< orphan*/);
char *setup_proc(char *);
int /*<<< orphan*/ umount(char *);
int wait_for_process(scalar_t__);
int main(int argc, char **argv) {
  printf("This is not tested!!!\n");
  exit(1);
  check_argc(argc);
  open_log_files(argv[6]);
  both_logs("chroot_wrapper.exe log file\n");
  int x;
  for (x = 0; x < argc; x++) {
    both_logs("Arg #%d: %s\n", x, argv[x]);
  }
  both_logs("Running command: %s\n", argv[3]);
  char *mountpoint = determine_proc_usage(argv[1]) ? setup_proc(argv[2]) : NULL;
  pid_t pid;
  if ((pid = fork()) == 0) {
    execute_command(argv[2], argv[3], argv[4], argv[5]);
  } else if (pid > 0) {
    int child_exit_status = wait_for_process(pid);
    if (mountpoint) {
      umount(mountpoint);
      parent_log("Parent: Umount\n");
    }
    if (WIFEXITED(child_exit_status)) {
      parent_log("Parent: Child exited\n");
      exit(WEXITSTATUS(child_exit_status));
    } else if (WIFSIGNALED(child_exit_status)) {
      parent_log("Parent: Child signalled\n");
      raise(WTERMSIG(child_exit_status));
    }
  } else {
    both_logs("Unable to create child process.\n");
    exit(-1);
  }
  return -1;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

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

LLVM IR (-O0):
@.str = [23 x i8] c"This is not tested!!!\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i64
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%9 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%10 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@str = [22 x i8] c"This is not tested!!!\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ a_barrier();
int a_ll(int volatile *);
int /*<<< orphan*/ a_post_llsc();
int /*<<< orphan*/ a_sc(int volatile *, int);
int a_fetch_or(volatile int *p, int v) {
  int old;
  a_barrier();
  do
    old = a_ll(p);
  while (!a_sc(p, old | v));
  a_post_llsc();
  return old;
}


x86 assembly (clang, -O0):
<a_fetch_or>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    $0x0,%al
call   1040 <a_barrier@plt>
mov    -0x8(%rbp),%rdi
call   1060 <a_ll@plt>
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%esi
or     -0xc(%rbp),%esi
call   1050 <a_sc@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    1156 <a_fetch_or+0x16>
mov    $0x0,%al
call   1030 <a_post_llsc@plt>
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<a_fetch_or>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%r14d
mov    %rdi,%rbx
xor    %eax,%eax
call   1040 <a_barrier@plt>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
call   1060 <a_ll@plt>
mov    %eax,%ebp
mov    %eax,%esi
or     %r14d,%esi
mov    %rbx,%rdi
call   1050 <a_sc@plt>
test   %eax,%eax
je     1160 <a_fetch_or+0x20>
xor    %eax,%eax
call   1030 <a_post_llsc@plt>
mov    %ebp,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @a_fetch_or(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 (...) @a_barrier()
br label %7
7: ; preds = %10, %2
%8 = load i32*, i32** %3
%9 = call i32 @a_ll(i32* %8)
store i32 %9, i32* %5
br label %10
10: ; preds = %7
%11 = load i32*, i32** %3
%12 = load i32, i32* %5
%13 = load i32, i32* %4
%14 = or i32 %12, %13
%15 = call i32 @a_sc(i32* %11, i32 %14)
%16 = icmp ne i32 %15, 0
%17 = xor i1 %16, true
br i1 %17, label %7, label %18
18: ; preds = %10
%19 = call i32 (...) @a_post_llsc()
%20 = load i32, i32* %5
ret i32 %20
}

LLVM IR (-O2):
define i32 @a_fetch_or(i32* %0, i32 %1) {
%3 = tail call i32 (...) @a_barrier()
br label %4
4: ; preds = %4, %2
%5 = tail call i32 @a_ll(i32* %0)
%6 = or i32 %5, %1
%7 = tail call i32 @a_sc(i32* %0, i32 %6)
%8 = icmp eq i32 %7, 0
br i1 %8, label %4, label %9
9: ; preds = %4
%10 = tail call i32 (...) @a_post_llsc()
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ O_RDWR;
int open(char *, int /*<<< orphan*/);
int ptys_open(char *pts_name) {
  int fds;
  if ((fds = open(pts_name, O_RDWR)) < 0)
    return -5;
  return fds;
}


x86 assembly (clang, -O0):
<ptys_open>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    0x2ec1(%rip),%rax
mov    (%rax),%esi
call   1030 <open@plt>
mov    %eax,-0x14(%rbp)
cmp    $0x0,%eax
jge    1146 <ptys_open+0x36>
movl   $0xfffffffb,-0x4(%rbp)
jmp    114c <ptys_open+0x3c>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ptys_open>:
push   %rax
mov    0x2ed0(%rip),%rax
mov    (%rax),%esi
call   1030 <open@plt>
test   %eax,%eax
mov    $0xfffffffb,%ecx
cmovs  %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@O_RDWR = global i32 0
define i32 @ptys_open(i8* nocapture %0) {
%2 = load i32, i32* @O_RDWR
%3 = tail call i32 @open(i8* %0, i32 %2)
%4 = icmp slt i32 %3, 0
%5 = select i1 %4, i32 -5, i32 %3
ret i32 %5
}
int or (void) { return a() || b() || c(); }


x86 assembly (clang, -O0):
<or>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1050 <a@plt>
mov    %eax,%ecx
mov    $0x1,%al
cmp    $0x0,%ecx
mov    %al,-0x1(%rbp)
jne    1176 <or+0x46>
mov    $0x0,%al
call   1030 <b@plt>
mov    %eax,%ecx
mov    $0x1,%al
cmp    $0x0,%ecx
mov    %al,-0x1(%rbp)
jne    1176 <or+0x46>
mov    $0x0,%al
call   1040 <c@plt>
cmp    $0x0,%eax
setne  %al
mov    %al,-0x1(%rbp)
mov    -0x1(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<or>:
push   %rbx
xor    %eax,%eax
call   1050 <a@plt>
mov    $0x1,%ebx
test   %eax,%eax
jne    115a <or+0x2a>
xor    %eax,%eax
call   1030 <b@plt>
test   %eax,%eax
jne    115a <or+0x2a>
xor    %eax,%eax
call   1040 <c@plt>
xor    %ebx,%ebx
test   %eax,%eax
setne  %bl
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @or() {
%1 = call i32 (...) @a()
%2 = icmp ne i32 %1, 0
br i1 %2, label %9, label %3
3: ; preds = %0
%4 = call i32 (...) @b()
%5 = icmp ne i32 %4, 0
br i1 %5, label %9, label %6
6: ; preds = %3
%7 = call i32 (...) @c()
%8 = icmp ne i32 %7, 0
br label %9
9: ; preds = %6, %3, %0
%10 = phi i1 [ true, %3 ], [ true, %0 ], [ %8, %6 ]
%11 = zext i1 %10 to i32
ret i32 %11
}

LLVM IR (-O2):
define i32 @or() {
%1 = tail call i32 (...) @a()
%2 = icmp eq i32 %1, 0
br i1 %2, label %3, label %10
3: ; preds = %0
%4 = tail call i32 (...) @b()
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %3
%7 = tail call i32 (...) @c()
%8 = icmp ne i32 %7, 0
%9 = zext i1 %8 to i32
br label %10
10: ; preds = %6, %3, %0
%11 = phi i32 [ 1, %3 ], [ 1, %0 ], [ %9, %6 ]
ret i32 %11
}
double to_ns(int dt) { return dt * 7.8125e-3; }


x86 assembly (clang, -O0):
<to_ns>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cvtsi2sdl -0x4(%rbp),%xmm0
movsd  0xeec(%rip),%xmm1
mulsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<to_ns>:
cvtsi2sd %edi,%xmm0
mulsd  0xef4(%rip),%xmm0
ret

LLVM IR (-O0):
define double @to_ns(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sitofp i32 %3 to double
%5 = fmul double %4, 7.812500e-03
ret double %5
}

LLVM IR (-O2):
define double @to_ns(i32 %0) {
%2 = sitofp i32 %0 to double
%3 = fmul double %2, 7.812500e-03
ret double %3
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int EOF;
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fdopen(int, char *);
int fgetc(int /*<<< orphan*/ *);
int /*<<< orphan*/ putchar(int);
void read_from_pipe(int fd) {
  int c;
  FILE *stream;
  stream = fdopen(fd, "r");
  while ((c = fgetc(stream)) != EOF)
    putchar(c);
  fclose(stream);
}


x86 assembly (clang, -O0):
<read_from_pipe>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
lea    0xeab(%rip),%rsi
call   1060 <fdopen@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <fgetc@plt>
mov    %eax,-0x8(%rbp)
mov    0x2e77(%rip),%rcx
cmp    (%rcx),%eax
je     1186 <read_from_pipe+0x46>
mov    -0x8(%rbp),%edi
call   1030 <putchar@plt>
jmp    115e <read_from_pipe+0x1e>
mov    -0x10(%rbp),%rdi
call   1040 <fclose@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_from_pipe>:
push   %r14
push   %rbx
push   %rax
lea    0xeb5(%rip),%rsi
call   1060 <fdopen@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1050 <fgetc@plt>
mov    0x2e86(%rip),%r14
cmp    (%r14),%eax
je     1184 <read_from_pipe+0x44>
nopw   0x0(%rax,%rax,1)
mov    %eax,%edi
call   1030 <putchar@plt>
mov    %rbx,%rdi
call   1050 <fgetc@plt>
cmp    (%r14),%eax
jne    1170 <read_from_pipe+0x30>
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <fclose@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"r\00"
@EOF = global i32 0
define void @read_from_pipe(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32*
store i32 %0, i32* %2
%5 = load i32, i32* %2
%6 = call i32* @fdopen(i32 %5, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32* %6, i32** %4
br label %7
7: ; preds = %12, %1
%8 = load i32*, i32** %4
%9 = call i32 @fgetc(i32* %8)
store i32 %9, i32* %3
%10 = load i32, i32* @EOF
%11 = icmp ne i32 %9, %10
br i1 %11, label %12, label %15
12: ; preds = %7
%13 = load i32, i32* %3
%14 = call i32 @putchar(i32 %13)
br label %7
15: ; preds = %7
%16 = load i32*, i32** %4
%17 = call i32 @fclose(i32* %16)
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c"r\00"
@EOF = global i32 0
define void @read_from_pipe(i32 %0) {
%2 = tail call i32* @fdopen(i32 %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @fgetc(i32* %2)
%4 = load i32, i32* @EOF
%5 = icmp eq i32 %3, %4
br i1 %5, label %12, label %6
6: ; preds = %1, %6
%7 = phi i32 [ %9, %6 ], [ %3, %1 ]
%8 = tail call i32 @putchar(i32 %7)
%9 = tail call i32 @fgetc(i32* %2)
%10 = load i32, i32* @EOF
%11 = icmp eq i32 %9, %10
br i1 %11, label %12, label %6
12: ; preds = %6, %1
%13 = tail call i32 @fclose(i32* %2)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
char EOF;
char fgetc(int /*<<< orphan*/ *);
void get_next_char(FILE *src, char *current, char *lookahead) {
  *current = *lookahead;
  if (*current == EOF) {
    lookahead = NULL;
    return;
  } else
    *lookahead = fgetc(src);
}


x86 assembly (clang, -O0):
<get_next_char>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
mov    0x2eaa(%rip),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
jne    1156 <get_next_char+0x46>
movq   $0x0,-0x18(%rbp)
jmp    1167 <get_next_char+0x57>
mov    -0x8(%rbp),%rdi
call   1030 <fgetc@plt>
mov    %al,%cl
mov    -0x18(%rbp),%rax
mov    %cl,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_next_char>:
push   %rbx
mov    (%rdx),%al
mov    %al,(%rsi)
mov    0x2ecc(%rip),%rcx
cmp    (%rcx),%al
je     112a <get_next_char+0x1a>
mov    %rdx,%rbx
call   1030 <fgetc@plt>
mov    %al,(%rbx)
pop    %rbx
ret

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

LLVM IR (-O2):
@EOF = global i8 0
define void @get_next_char(i32* nocapture %0, i8* nocapture writeonly %1, i8* nocapture %2) {
%4 = load i8, i8* %2
store i8 %4, i8* %1
%5 = load i8, i8* @EOF
%6 = icmp eq i8 %4, %5
br i1 %6, label %9, label %7
7: ; preds = %3
%8 = tail call signext i8 @fgetc(i32* %0)
store i8 %8, i8* %2
br label %9
9: ; preds = %3, %7
ret void
}
/* Variables and functions */
int ipow(int, int);
int PR(int n, int r) { return ipow(n, r); }


x86 assembly (clang, -O0):
<PR>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <ipow@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PR>:
jmp    1030 <ipow@plt>

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

LLVM IR (-O2):
define i32 @PR(i32 %0, i32 %1) {
%3 = tail call i32 @ipow(i32 %0, i32 %1)
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
unsigned char *sha256_file(unsigned char *, int /*<<< orphan*/ *);
unsigned char *hash_file_sha256(unsigned char *out, FILE *fp) {
  return sha256_file(out, fp);
}


x86 assembly (clang, -O0):
<hash_file_sha256>:
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 <sha256_file@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash_file_sha256>:
jmp    1030 <sha256_file@plt>

LLVM IR (-O0):
define i8* @hash_file_sha256(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* @sha256_file(i8* %5, i32* %6)
ret i8* %7
}

LLVM IR (-O2):
define i8* @hash_file_sha256(i8* %0, i32* %1) {
%3 = tail call i8* @sha256_file(i8* %0, i32* %1)
ret i8* %3
}
/* Variables and functions */
int spi_close();
int led_close() {
  int status;
  status = spi_close();
  if (status < 0)
    return -1;
  return 0;
}


x86 assembly (clang, -O0):
<led_close>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <spi_close@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    1138 <led_close+0x28>
movl   $0xffffffff,-0x4(%rbp)
jmp    113f <led_close+0x2f>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<led_close>:
push   %rax
xor    %eax,%eax
call   1030 <spi_close@plt>
sar    $0x1f,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @led_close() {
%1 = tail call i32 (...) @spi_close()
%2 = ashr i32 %1, 31
ret i32 %2
}
int I2C_Write(int NumberOfBytes, int RegAddress, unsigned char *TxBuffer) {
  int res = -1;
  return (res);
}


x86 assembly (clang, -O0):
<I2C_Write>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
movl   $0xffffffff,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @I2C_Write(i32 %0, i32 %1, i8* nocapture readnone %2) {
ret i32 -1
}
void XkbResizeKeyActions() {}


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

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

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

LLVM IR (-O2):
define void @XkbResizeKeyActions() {
ret void
}
void markovcurrylambdahardware_func() {
  char c = 0;
  switch (c) {}
}


x86 assembly (clang, -O0):
<markovcurrylambdahardware_func>:
push   %rbp
mov    %rsp,%rbp
movb   $0x0,-0x1(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @markovcurrylambdahardware_func() {
%1 = alloca i8
store i8 0, i8* %1
%2 = load i8, i8* %1
%3 = sext i8 %2 to i32
switch i32 %3, label %4 [
]
4: ; preds = %0
ret void
}

LLVM IR (-O2):
define void @markovcurrylambdahardware_func() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128;

/* Variables and functions */
int /*<<< orphan*/ _mm_cmpord_ps(int /*<<< orphan*/, int /*<<< orphan*/);
__m128 test_mm_cmpord_ps(__m128 __a, __m128 __b) {
  return _mm_cmpord_ps(__a, __b);
}


x86 assembly (clang, -O0):
<test_mm_cmpord_ps>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <_mm_cmpord_ps@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_mm_cmpord_ps>:
jmp    1030 <_mm_cmpord_ps@plt>

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

LLVM IR (-O2):
define i32 @test_mm_cmpord_ps(i32 %0, i32 %1) {
%3 = tail call i32 @_mm_cmpord_ps(i32 %0, i32 %1)
ret i32 %3
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int peri_read(int volatile *);
int /*<<< orphan*/ peri_write(int volatile *, int);
void peri_set_bits(volatile uint32_t *paddr, uint32_t value, uint32_t mask) {
  uint32_t v = peri_read(paddr);
  v = (v & ~mask) | (value & mask);
  peri_write(paddr, v);
}


x86 assembly (clang, -O0):
<peri_set_bits>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <peri_read@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0x10(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0xc(%rbp),%ecx
and    -0x10(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1040 <peri_write@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<peri_set_bits>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%r14d
mov    %esi,%ebp
mov    %rdi,%rbx
call   1030 <peri_read@plt>
xor    %eax,%ebp
and    %r14d,%ebp
xor    %eax,%ebp
mov    %rbx,%rdi
mov    %ebp,%esi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <peri_write@plt>

LLVM IR (-O0):
define void @peri_set_bits(i32* %0, i32 %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32* %0, i32** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i32*, i32** %4
%9 = call i32 @peri_read(i32* %8)
store i32 %9, i32* %7
%10 = load i32, i32* %7
%11 = load i32, i32* %6
%12 = xor i32 %11, -1
%13 = and i32 %10, %12
%14 = load i32, i32* %5
%15 = load i32, i32* %6
%16 = and i32 %14, %15
%17 = or i32 %13, %16
store i32 %17, i32* %7
%18 = load i32*, i32** %4
%19 = load i32, i32* %7
%20 = call i32 @peri_write(i32* %18, i32 %19)
ret void
}

LLVM IR (-O2):
define void @peri_set_bits(i32* %0, i32 %1, i32 %2) {
%4 = tail call i32 @peri_read(i32* %0)
%5 = xor i32 %2, -1
%6 = and i32 %4, %5
%7 = and i32 %2, %1
%8 = or i32 %6, %7
%9 = tail call i32 @peri_write(i32* %0, i32 %8)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ glad_glResumeTransformFeedback();
void glResumeTransformFeedback() { glad_glResumeTransformFeedback(); }


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

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

LLVM IR (-O0):
define void @glResumeTransformFeedback() {
%1 = call i32 (...) @glad_glResumeTransformFeedback()
ret void
}

LLVM IR (-O2):
define void @glResumeTransformFeedback() {
%1 = tail call i32 (...) @glad_glResumeTransformFeedback()
ret void
}
void logMessage(const char *name, long value, const char *unit) {
  ;
  char buf[100];
  sprintf(buf, "%ld", value);
  logMessage(name, buf, unit);
  ;
  ;
}


x86 assembly (clang, -O0):
<logMessage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
lea    -0x80(%rbp),%rdi
mov    -0x10(%rbp),%rdx
lea    0xeba(%rip),%rsi
mov    $0x0,%al
call   1040 <sprintf@plt>
mov    -0x8(%rbp),%rdi
lea    -0x80(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <logMessage@plt>
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<logMessage>:
push   %r15
push   %r14
push   %rbx
sub    $0x70,%rsp
mov    %rdx,%r14
mov    %rsi,%rdx
mov    %rdi,%rbx
lea    0xec7(%rip),%rsi
mov    %rsp,%r15
mov    %r15,%rdi
xor    %eax,%eax
call   1040 <sprintf@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
mov    %r14,%rdx
call   1030 <logMessage@plt>
add    $0x70,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%ld\00"
define void @logMessage(i8* %0, i64 %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i8*
%7 = alloca [100 x i8]
store i8* %0, i8** %4
store i64 %1, i64* %5
store i8* %2, i8** %6
%8 = getelementptr inbounds [100 x i8], [100 x i8]* %7, i64 0, i64 0
%9 = load i64, i64* %5
%10 = call i32 (i8*, i8*, ...) @sprintf(i8* %8, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i64 %9)
%11 = load i8*, i8** %4
%12 = getelementptr inbounds [100 x i8], [100 x i8]* %7, i64 0, i64 0
%13 = ptrtoint i8* %12 to i64
%14 = load i8*, i8** %6
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%ld\00"
define void @logMessage(i8* nocapture readnone %0, i64 %1, i8* nocapture readnone %2) {
%4 = alloca [100 x i8]
%5 = getelementptr inbounds [100 x i8], [100 x i8]* %4, i64 0, i64 0
%6 = call i32 (i8*, i8*, ...) @sprintf(i8* %5, i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i64 %1)
%7 = ptrtoint [100 x i8]* %4 to i64
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;
typedef int /*<<< orphan*/ buf;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ bswap_16(int /*<<< orphan*/);
size_t fread(int /*<<< orphan*/ *, int, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ fwrite(int /*<<< orphan*/ *, int, int, int /*<<< orphan*/ *);
void read_bswap_write_16(FILE *in, FILE *out) {
  uint16_t buf = 0;
  size_t read;
  read = fread(&buf, 1, sizeof(buf), in);
  if (read == 0)
    return;
  buf = bswap_16(buf);
  fwrite(&buf, 1, sizeof(buf), out);
}


x86 assembly (clang, -O0):
<read_bswap_write_16>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x8(%rbp),%rcx
lea    -0x14(%rbp),%rdi
mov    $0x1,%esi
mov    $0x4,%edx
call   1030 <fread@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    1172 <read_bswap_write_16+0x42>
jmp    1194 <read_bswap_write_16+0x64>
mov    -0x14(%rbp),%edi
call   1040 <bswap_16@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rcx
lea    -0x14(%rbp),%rdi
mov    $0x1,%esi
mov    $0x4,%edx
call   1050 <fwrite@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_bswap_write_16>:
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%rbx
mov    %rdi,%rcx
movl   $0x0,0xc(%rsp)
lea    0xc(%rsp),%rdi
mov    $0x1,%esi
mov    $0x4,%edx
call   1030 <fread@plt>
test   %rax,%rax
je     1180 <read_bswap_write_16+0x50>
mov    0xc(%rsp),%edi
call   1040 <bswap_16@plt>
mov    %eax,0xc(%rsp)
lea    0xc(%rsp),%rdi
mov    $0x1,%esi
mov    $0x4,%edx
mov    %rbx,%rcx
call   1050 <fwrite@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @read_bswap_write_16(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i64
store i32* %0, i32** %3
store i32* %1, i32** %4
store i32 0, i32* %5
%7 = load i32*, i32** %3
%8 = call i64 @fread(i32* %5, i32 1, i32 4, i32* %7)
store i64 %8, i64* %6
%9 = load i64, i64* %6
%10 = icmp eq i64 %9, 0
br i1 %10, label %11, label %12
11: ; preds = %2
br label %17
12: ; preds = %2
%13 = load i32, i32* %5
%14 = call i32 @bswap_16(i32 %13)
store i32 %14, i32* %5
%15 = load i32*, i32** %4
%16 = call i32 @fwrite(i32* %5, i32 1, i32 4, i32* %15)
br label %17
17: ; preds = %12, %11
ret void
}

LLVM IR (-O2):
define void @read_bswap_write_16(i32* nocapture %0, i32* nocapture %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
store i32 0, i32* %3
%5 = call i64 @fread(i32* %3, i32 1, i32 4, i32* %0)
%6 = icmp eq i64 %5, 0
br i1 %6, label %11, label %7
7: ; preds = %2
%8 = load i32, i32* %3
%9 = tail call i32 @bswap_16(i32 %8)
store i32 %9, i32* %3
%10 = call i32 @fwrite(i32* %3, i32 1, i32 4, i32* %1)
br label %11
11: ; preds = %2, %7
ret void
}
unsigned long __libc_detect_null(unsigned long w) {
  unsigned long mask = 0x7f7f7f7f;
  if (sizeof(long) == 8)
    mask = ((mask << 16) << 16) | mask;
  return ~(((w & mask) + mask) | w | mask);
}


x86 assembly (clang, -O0):
<__libc_detect_null>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x7f7f7f7f,-0x10(%rbp)
7f
mov    -0x10(%rbp),%rax
shl    $0x10,%rax
shl    $0x10,%rax
or     -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
and    -0x10(%rbp),%rax
add    -0x10(%rbp),%rax
or     -0x8(%rbp),%rax
or     -0x10(%rbp),%rax
xor    $0xffffffffffffffff,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__libc_detect_null>:
movabs $0x7f7f7f7f7f7f7f7f,%rax
7f 7f 7f
mov    %rdi,%rcx
and    %rax,%rcx
add    %rax,%rcx
or     %rdi,%rcx
not    %rcx
not    %rax
and    %rcx,%rax
ret

LLVM IR (-O0):
define i64 @__libc_detect_null(i64 %0) {
%2 = alloca i64
%3 = alloca i64
store i64 %0, i64* %2
store i64 2139062143, i64* %3
%4 = load i64, i64* %3
%5 = shl i64 %4, 16
%6 = shl i64 %5, 16
%7 = load i64, i64* %3
%8 = or i64 %6, %7
store i64 %8, i64* %3
%9 = load i64, i64* %2
%10 = load i64, i64* %3
%11 = and i64 %9, %10
%12 = load i64, i64* %3
%13 = add i64 %11, %12
%14 = load i64, i64* %2
%15 = or i64 %13, %14
%16 = load i64, i64* %3
%17 = or i64 %15, %16
%18 = xor i64 %17, -1
ret i64 %18
}

LLVM IR (-O2):
define i64 @__libc_detect_null(i64 %0) {
%2 = and i64 %0, 9187201950435737471
%3 = add nuw i64 %2, 9187201950435737471
%4 = or i64 %3, %0
%5 = or i64 %4, 9187201950435737471
%6 = xor i64 %5, -1
ret i64 %6
}
unsigned int ip4AddrArrToBits(int *ipArr) {
  unsigned int ip =
      (ipArr[0] << 24 | ipArr[1] << 16 | ipArr[2] << 8 | ipArr[3]);
  return ip;
}


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

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

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

LLVM IR (-O2):
define i32 @ip4AddrArrToBits(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = shl i32 %2, 24
%4 = getelementptr inbounds i32, i32* %0, i64 1
%5 = load i32, i32* %4
%6 = shl i32 %5, 16
%7 = or i32 %6, %3
%8 = getelementptr inbounds i32, i32* %0, i64 2
%9 = load i32, i32* %8
%10 = shl i32 %9, 8
%11 = or i32 %7, %10
%12 = getelementptr inbounds i32, i32* %0, i64 3
%13 = load i32, i32* %12
%14 = or i32 %11, %13
ret i32 %14
}
/* Type definitions */
typedef int uint32_t;
typedef int uint16_t;

/* Variables and functions */
int /*<<< orphan*/ assert(int);
void to_surrogate_pair(uint32_t unicode, uint16_t *uc, uint16_t *lc) {
  uint32_t n;
  assert(unicode >= 0x10000 && unicode <= 0x10FFFF);
  n = unicode - 0x10000;
  *uc = ((n >> 10) & 0x3FF) | 0xD800;
  *lc = (n & 0x3FF) | 0xDC00;
}


x86 assembly (clang, -O0):
<to_surrogate_pair>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
xor    %eax,%eax
cmpl   $0x10000,-0x4(%rbp)
mov    %al,-0x1d(%rbp)
jl     1142 <to_surrogate_pair+0x32>
cmpl   $0x10ffff,-0x4(%rbp)
setle  %al
mov    %al,-0x1d(%rbp)
mov    -0x1d(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x4(%rbp),%eax
sub    $0x10000,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%ecx
sar    $0xa,%ecx
and    $0x3ff,%ecx
or     $0xd800,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x1c(%rbp),%ecx
and    $0x3ff,%ecx
or     $0xdc00,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<to_surrogate_pair>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %rsi,%r15
mov    %edi,%ebx
lea    -0x10000(%rbx),%eax
xor    %edi,%edi
cmp    $0x100000,%eax
setb   %dil
call   1030 <assert@plt>
lea    0xf0000(%rbx),%eax
shr    $0xa,%eax
and    $0x3ff,%eax
or     $0xd800,%eax
mov    %eax,(%r15)
and    $0x3ff,%ebx
or     $0xdc00,%ebx
mov    %ebx,(%r14)
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @to_surrogate_pair(i32 %0, i32* %1, i32* %2) {
%4 = alloca i32
%5 = alloca i32*
%6 = alloca i32*
%7 = alloca i32
store i32 %0, i32* %4
store i32* %1, i32** %5
store i32* %2, i32** %6
%8 = load i32, i32* %4
%9 = icmp sge i32 %8, 65536
br i1 %9, label %10, label %13
10: ; preds = %3
%11 = load i32, i32* %4
%12 = icmp sle i32 %11, 1114111
br label %13
13: ; preds = %10, %3
%14 = phi i1 [ false, %3 ], [ %12, %10 ]
%15 = zext i1 %14 to i32
%16 = call i32 @assert(i32 %15)
%17 = load i32, i32* %4
%18 = sub nsw i32 %17, 65536
store i32 %18, i32* %7
%19 = load i32, i32* %7
%20 = ashr i32 %19, 10
%21 = and i32 %20, 1023
%22 = or i32 %21, 55296
%23 = load i32*, i32** %5
store i32 %22, i32* %23
%24 = load i32, i32* %7
%25 = and i32 %24, 1023
%26 = or i32 %25, 56320
%27 = load i32*, i32** %6
store i32 %26, i32* %27
ret void
}

LLVM IR (-O2):
define void @to_surrogate_pair(i32 %0, i32* nocapture writeonly %1, i32* nocapture writeonly %2) {
%4 = add i32 %0, -65536
%5 = icmp ult i32 %4, 1048576
%6 = zext i1 %5 to i32
%7 = tail call i32 @assert(i32 %6)
%8 = add i32 %0, 983040
%9 = lshr i32 %8, 10
%10 = and i32 %9, 1023
%11 = or i32 %10, 55296
store i32 %11, i32* %1
%12 = and i32 %0, 1023
%13 = or i32 %12, 56320
store i32 %13, i32* %2
ret void
}
char *_Locale_compose_name(char *__DUMMY_PAR1, const char *__DUMMY_PAR2,
                           const char *__DUMMY_PAR3, const char *__DUMMY_PAR4,
                           const char *__DUMMY_PAR5, const char *__DUMMY_PAR6,
                           const char *__DUMMY_PAR7, const char *__DUMMY_PAR8) {
  return 0;
}


x86 assembly (clang, -O0):
<_Locale_compose_name>:
push   %rbp
mov    %rsp,%rbp
mov    0x18(%rbp),%rax
mov    0x10(%rbp),%rax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i8* @_Locale_compose_name(i8* %0, i8* %1, i8* %2, i8* %3, i8* %4, i8* %5, i8* %6, i8* %7) {
%9 = alloca i8*
%10 = alloca i8*
%11 = alloca i8*
%12 = alloca i8*
%13 = alloca i8*
%14 = alloca i8*
%15 = alloca i8*
%16 = alloca i8*
store i8* %0, i8** %9
store i8* %1, i8** %10
store i8* %2, i8** %11
store i8* %3, i8** %12
store i8* %4, i8** %13
store i8* %5, i8** %14
store i8* %6, i8** %15
store i8* %7, i8** %16
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @_Locale_compose_name(i8* nocapture readnone %0, i8* nocapture readnone %1, i8* nocapture readnone %2, i8* nocapture readnone %3, i8* nocapture readnone %4, i8* nocapture readnone %5, i8* nocapture readnone %6, i8* nocapture readnone %7) {
ret i8* null
}
int kvmppc_set_cap_nested_kvm_hv(int enable) { return -1; }


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

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

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

LLVM IR (-O2):
define i32 @kvmppc_set_cap_nested_kvm_hv(i32 %0) {
ret i32 -1
}
/* Variables and functions */
int S_IROTH;
int S_IRWXG;
int S_IRWXU;
int S_IXOTH;
scalar_t__ mkdir(char const *, int);
int platform_mkdir(const char *path) {
  return (mkdir(path, S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH) == 0);
}


x86 assembly (clang, -O0):
<platform_mkdir>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2ec1(%rip),%rax
mov    (%rax),%esi
mov    0x2ea8(%rip),%rax
or     (%rax),%esi
mov    0x2e8f(%rip),%rax
or     (%rax),%esi
mov    0x2e9e(%rip),%rax
or     (%rax),%esi
call   1030 <mkdir@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<platform_mkdir>:
push   %rax
mov    0x2ed0(%rip),%rax
mov    0x2eb9(%rip),%rcx
mov    (%rcx),%esi
or     (%rax),%esi
mov    0x2e9e(%rip),%rax
or     (%rax),%esi
mov    0x2ead(%rip),%rax
or     (%rax),%esi
call   1030 <mkdir@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@S_IRWXU = global i32 0
@S_IRWXG = global i32 0
@S_IROTH = global i32 0
@S_IXOTH = global i32 0
define i32 @platform_mkdir(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i32, i32* @S_IRWXU
%5 = load i32, i32* @S_IRWXG
%6 = or i32 %4, %5
%7 = load i32, i32* @S_IROTH
%8 = or i32 %6, %7
%9 = load i32, i32* @S_IXOTH
%10 = or i32 %8, %9
%11 = call i64 @mkdir(i8* %3, i32 %10)
%12 = icmp eq i64 %11, 0
%13 = zext i1 %12 to i32
ret i32 %13
}

LLVM IR (-O2):
@S_IRWXU = global i32 0
@S_IRWXG = global i32 0
@S_IROTH = global i32 0
@S_IXOTH = global i32 0
define i32 @platform_mkdir(i8* nocapture %0) {
%2 = load i32, i32* @S_IRWXU
%3 = load i32, i32* @S_IRWXG
%4 = or i32 %3, %2
%5 = load i32, i32* @S_IROTH
%6 = or i32 %4, %5
%7 = load i32, i32* @S_IXOTH
%8 = or i32 %6, %7
%9 = tail call i64 @mkdir(i8* %0, i32 %8)
%10 = icmp eq i64 %9, 0
%11 = zext i1 %10 to i32
ret i32 %11
}
/* Type definitions */
typedef int uint8_t;
typedef int uint16_t;

/* Variables and functions */
void udp_set_cksum(uint8_t *p_udp, uint16_t cksum) {
  p_udp[6] = (cksum & 0xff00) >> 8;
  p_udp[7] = (cksum & 0xff);
}


x86 assembly (clang, -O0):
<udp_set_cksum>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
and    $0xff00,%ecx
sar    $0x8,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x18(%rax)
mov    -0xc(%rbp),%ecx
and    $0xff,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x1c(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<udp_set_cksum>:
mov    %esi,%eax
movzbl %ah,%ecx
mov    %ecx,0x18(%rdi)
movzbl %al,%eax
mov    %eax,0x1c(%rdi)
ret

LLVM IR (-O0):
define void @udp_set_cksum(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = and i32 %5, 65280
%7 = ashr i32 %6, 8
%8 = load i32*, i32** %3
%9 = getelementptr inbounds i32, i32* %8, i64 6
store i32 %7, i32* %9
%10 = load i32, i32* %4
%11 = and i32 %10, 255
%12 = load i32*, i32** %3
%13 = getelementptr inbounds i32, i32* %12, i64 7
store i32 %11, i32* %13
ret void
}

LLVM IR (-O2):
define void @udp_set_cksum(i32* nocapture writeonly %0, i32 %1) {
%3 = lshr i32 %1, 8
%4 = and i32 %3, 255
%5 = getelementptr inbounds i32, i32* %0, i64 6
store i32 %4, i32* %5
%6 = and i32 %1, 255
%7 = getelementptr inbounds i32, i32* %0, i64 7
store i32 %6, i32* %7
ret void
}
char *Strchr(char *s, char c) {
  while (*s)
    if (*s++ == c)
      return s;
  return (char *)0;
}


x86 assembly (clang, -O0):
<Strchr>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x10(%rbp)
mov    %al,-0x11(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     114b <Strchr+0x4b>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movsbl (%rax),%eax
movsbl -0x11(%rbp),%ecx
cmp    %ecx,%eax
jne    1146 <Strchr+0x46>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1153 <Strchr+0x53>
jmp    110e <Strchr+0xe>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Strchr>:
mov    %rdi,%rax
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movzbl (%rax),%ecx
test   %cl,%cl
je     1121 <Strchr+0x21>
add    $0x1,%rax
cmp    %sil,%cl
jne    1110 <Strchr+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i8* @Strchr(i8* %0, i8 signext %1) {
br label %3
3: ; preds = %7, %2
%4 = phi i8* [ %0, %2 ], [ %8, %7 ]
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
br i1 %6, label %10, label %7
7: ; preds = %3
%8 = getelementptr inbounds i8, i8* %4, i64 1
%9 = icmp eq i8 %5, %1
br i1 %9, label %10, label %3
10: ; preds = %3, %7
%11 = phi i8* [ %8, %7 ], [ null, %3 ]
ret i8* %11
}
/* Variables and functions */
int _ada_use_c2phc(int, int *, int *, double *);
int solcon_read_multprec_solutions(void) {
  int *a, *b, fail;
  double *c;
  fail = _ada_use_c2phc(450, a, b, c);
  return fail;
}


x86 assembly (clang, -O0):
<solcon_read_multprec_solutions>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x1c2,%edi
call   1030 <_ada_use_c2phc@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<solcon_read_multprec_solutions>:
mov    $0x1c2,%edi
jmp    1030 <_ada_use_c2phc@plt>

LLVM IR (-O0):
define i32 @solcon_read_multprec_solutions() {
%1 = alloca i32*
%2 = alloca i32*
%3 = alloca i32
%4 = alloca double*
%5 = load i32*, i32** %1
%6 = load i32*, i32** %2
%7 = load double*, double** %4
%8 = call i32 @_ada_use_c2phc(i32 450, i32* %5, i32* %6, double* %7)
store i32 %8, i32* %3
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
define i32 @solcon_read_multprec_solutions() {
%1 = tail call i32 @_ada_use_c2phc(i32 450, i32* undef, i32* undef, double* undef)
ret i32 %1
}
/* Variables and functions */
size_t rand();
size_t TestingRandom(size_t index, size_t total) { return rand(); }


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

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

LLVM IR (-O0):
define i64 @TestingRandom(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = call i64 (...) @rand()
ret i64 %5
}

LLVM IR (-O2):
define i64 @TestingRandom(i64 %0, i64 %1) {
%3 = tail call i64 (...) @rand()
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ scanf(char *, char *);
void InputCmd(char *pStr) { scanf("%s", pStr); }


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

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

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define void @InputCmd(i8* %0) {
%2 = tail call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
void f_empty_while_loop_semicolon() {
  while (1) {
    ;
  }
}


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

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

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

LLVM IR (-O2):
define void @f_empty_while_loop_semicolon() {
br label %1
1: ; preds = %0, %1
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ dgetrf_(int *, int *, double *, int *, int *, int *);
void dgetrf(int m, int n, double *a, int lda, int *ipiv, int *info) {
  dgetrf_(&m, &n, a, &lda, ipiv, info);
}


x86 assembly (clang, -O0):
<dgetrf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8,-0x20(%rbp)
mov    %r9,-0x28(%rbp)
mov    -0x10(%rbp),%rdx
mov    -0x20(%rbp),%r8
mov    -0x28(%rbp),%r9
lea    -0x4(%rbp),%rdi
lea    -0x8(%rbp),%rsi
lea    -0x14(%rbp),%rcx
call   1030 <dgetrf_@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dgetrf>:
sub    $0x18,%rsp
mov    %edi,0x14(%rsp)
mov    %esi,0x10(%rsp)
mov    %ecx,0xc(%rsp)
lea    0x14(%rsp),%rdi
lea    0x10(%rsp),%rsi
lea    0xc(%rsp),%rcx
call   1030 <dgetrf_@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
define void @dgetrf(i32 %0, i32 %1, double* %2, i32 %3, i32* %4, i32* %5) {
%7 = alloca i32
%8 = alloca i32
%9 = alloca double*
%10 = alloca i32
%11 = alloca i32*
%12 = alloca i32*
store i32 %0, i32* %7
store i32 %1, i32* %8
store double* %2, double** %9
store i32 %3, i32* %10
store i32* %4, i32** %11
store i32* %5, i32** %12
%13 = load double*, double** %9
%14 = load i32*, i32** %11
%15 = load i32*, i32** %12
%16 = call i32 @dgetrf_(i32* %7, i32* %8, double* %13, i32* %10, i32* %14, i32* %15)
ret void
}

LLVM IR (-O2):
define void @dgetrf(i32 %0, i32 %1, double* %2, i32 %3, i32* %4, i32* %5) {
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i32 %0, i32* %7
store i32 %1, i32* %8
store i32 %3, i32* %9
%10 = call i32 @dgetrf_(i32* %7, i32* %8, double* %2, i32* %9, i32* %4, i32* %5)
ret void
}
/* Variables and functions */
char *ulltoa(unsigned int, char *, int);
char *utoa(unsigned value, char *str, int base) {
  return ulltoa(value, str, base);
}


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

x86 assembly (clang, -O2):
<utoa>:
jmp    1030 <ulltoa@plt>

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

LLVM IR (-O2):
define i8* @utoa(i32 %0, i8* %1, i32 %2) {
%4 = tail call i8* @ulltoa(i32 %0, i8* %1, i32 %2)
ret i8* %4
}
int test_imm_49int32_reg(int val) { return ((val) & (0x49 << 0)) ? -20 : -40; }


x86 assembly (clang, -O0):
<test_imm_49int32_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
and    $0x49,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_49int32_reg(i32 %0) {
%2 = and i32 %0, 73
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
extern int xcpu_signal(int sig, char *nodes) { return 0; }


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

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

LLVM IR (-O0):
define i32 @xcpu_signal(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
ret i32 0
}

LLVM IR (-O2):
define i32 @xcpu_signal(i32 %0, i8* nocapture readnone %1) {
ret i32 0
}