xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ emit_andimm(int, int, int);
int /*<<< orphan*/ emit_cmp(int, int);
int /*<<< orphan*/ emit_orrhi_imm(int, int, int);
void emit_cmphi(int s1, int s2, int sr, int temp) {
  emit_andimm(sr, ~1, sr);
  emit_cmp(s2, s1);
  emit_orrhi_imm(sr, 1, sr);
}


x86 assembly (clang, -O0):
<emit_cmphi>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0xc(%rbp),%edi
mov    -0xc(%rbp),%edx
mov    $0xfffffffe,%esi
call   1050 <emit_andimm@plt>
mov    -0x8(%rbp),%edi
mov    -0x4(%rbp),%esi
call   1030 <emit_cmp@plt>
mov    -0xc(%rbp),%edi
mov    -0xc(%rbp),%edx
mov    $0x1,%esi
call   1040 <emit_orrhi_imm@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<emit_cmphi>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%ebx
mov    %esi,%ebp
mov    %edi,%r14d
mov    %edx,%edi
mov    $0xfffffffe,%esi
call   1050 <emit_andimm@plt>
mov    %ebp,%edi
mov    %r14d,%esi
call   1030 <emit_cmp@plt>
mov    %ebx,%edi
mov    $0x1,%esi
mov    %ebx,%edx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <emit_orrhi_imm@plt>

LLVM IR (-O0):
define void @emit_cmphi(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32, i32* %7
%10 = load i32, i32* %7
%11 = call i32 @emit_andimm(i32 %9, i32 -2, i32 %10)
%12 = load i32, i32* %6
%13 = load i32, i32* %5
%14 = call i32 @emit_cmp(i32 %12, i32 %13)
%15 = load i32, i32* %7
%16 = load i32, i32* %7
%17 = call i32 @emit_orrhi_imm(i32 %15, i32 1, i32 %16)
ret void
}

LLVM IR (-O2):
define void @emit_cmphi(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = tail call i32 @emit_andimm(i32 %2, i32 -2, i32 %2)
%6 = tail call i32 @emit_cmp(i32 %1, i32 %0)
%7 = tail call i32 @emit_orrhi_imm(i32 %2, i32 1, i32 %2)
ret void
}
const unsigned char *PushCharPixel(const unsigned char *pixels,
                                   unsigned char *pixel) {
  *pixel = (*pixels++);
  return (pixels);
}


x86 assembly (clang, -O0):
<PushCharPixel>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
mov    (%rax),%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<PushCharPixel>:
mov    (%rdi),%cl
lea    0x1(%rdi),%rax
mov    %cl,(%rsi)
ret

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

LLVM IR (-O2):
define i8* @PushCharPixel(i8* %0, i8* nocapture writeonly %1) {
%3 = getelementptr inbounds i8, i8* %0, i64 1
%4 = load i8, i8* %0
store i8 %4, i8* %1
ret i8* %3
}
/* Variables and functions */
scalar_t__ Fork();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
void doit() {
  if (Fork() == 0) {
    Fork();
    printf("hello\n");
    exit(0);
  }
  return;
}


x86 assembly (clang, -O0):
<doit>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <Fork@plt>
cmp    $0x0,%rax
jne    115f <doit+0x2f>
mov    $0x0,%al
call   1030 <Fork@plt>
lea    0xead(%rip),%rdi
call   1040 <printf@plt>
xor    %edi,%edi
call   1050 <exit@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<doit>:
push   %rax
xor    %eax,%eax
call   1030 <Fork@plt>
test   %rax,%rax
je     113f <doit+0xf>
pop    %rax
ret
xor    %eax,%eax
call   1030 <Fork@plt>
lea    0xeb3(%rip),%rdi
call   1040 <puts@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"hello\0A\00"
define void @doit() {
%1 = call i64 (...) @Fork()
%2 = icmp eq i64 %1, 0
br i1 %2, label %3, label %7
3: ; preds = %0
%4 = call i64 (...) @Fork()
%5 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @exit(i32 0)
unreachable
7: ; preds = %0
ret void
}

LLVM IR (-O2):
@str = [6 x i8] c"hello\00"
define void @doit() {
%1 = tail call i64 (...) @Fork()
%2 = icmp eq i64 %1, 0
br i1 %2, label %3, label %7
3: ; preds = %0
%4 = tail call i64 (...) @Fork()
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0))
%6 = tail call i32 @exit(i32 0)
unreachable
7: ; preds = %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ print_icmpv6types();
int /*<<< orphan*/ printf(char *);
void print_help() {
  printf("ip6 options:\n"
         "--ip6-src    [!] address[/mask]: ipv6 source specification\n"
         "--ip6-dst    [!] address[/mask]: ipv6 destination specification\n"
         "--ip6-tclass [!] tclass        : ipv6 traffic class specification\n"
         "--ip6-proto  [!] protocol      : ipv6 protocol specification\n"
         "--ip6-sport  [!] port[:port]   : tcp/udp source port or port range\n"
         "--ip6-dport  [!] port[:port]   : tcp/udp destination port or port "
         "range\n"
         "--ip6-icmp-type [!] type[[:type]/code[:code]] : ipv6-icmp type/code "
         "or type/code range\n");
  print_icmpv6types();
}


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

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

LLVM IR (-O0):
@.str = [490 x i8] c"ip6 options:\0A--ip6-src [!] address[/mask]: ipv6 source specification\0A--ip6-dst [!] address[/mask]: ipv6 destination specification\0A--ip6-tclass [!] tclass : ipv6 traffic class specification\0A--ip6-proto [!] protocol : ipv6 protocol specification\0A--ip6-sport [!] port[:port] : tcp/udp source port or port range\0A--ip6-dport [!] port[:port] : tcp/udp destination port or port range\0A--ip6-icmp-type [!] type[[:type]/code[:code]] : ipv6-icmp type/code or type/code range\0A\00"
define void @print_help() {
%1 = call i32 @printf(i8* getelementptr inbounds ([490 x i8], [490 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (...) @print_icmpv6types()
ret void
}

LLVM IR (-O2):
@str = [489 x i8] c"ip6 options:\0A--ip6-src [!] address[/mask]: ipv6 source specification\0A--ip6-dst [!] address[/mask]: ipv6 destination specification\0A--ip6-tclass [!] tclass : ipv6 traffic class specification\0A--ip6-proto [!] protocol : ipv6 protocol specification\0A--ip6-sport [!] port[:port] : tcp/udp source port or port range\0A--ip6-dport [!] port[:port] : tcp/udp destination port or port range\0A--ip6-icmp-type [!] type[[:type]/code[:code]] : ipv6-icmp type/code or type/code range\00"
define void @print_help() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([489 x i8], [489 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (...) @print_icmpv6types()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, char *);
void _Q_qtod(void) {
  printf("Unimplemented %s called, exiting\n", "_Q_qtod");
  exit(-1);
}


x86 assembly (clang, -O0):
<_Q_qtod>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
lea    0xef0(%rip),%rsi
call   1030 <printf@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<_Q_qtod>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0xef3(%rip),%rsi
call   1030 <printf@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [34 x i8] c"Unimplemented %s called, exiting\0A\00"
@.str.1 = [8 x i8] c"_Q_qtod\00"
define void @_Q_qtod() {
%1 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%2 = call i32 @exit(i32 -1)
unreachable
}

LLVM IR (-O2):
@.str = [34 x i8] c"Unimplemented %s called, exiting\0A\00"
@.str.1 = [8 x i8] c"_Q_qtod\00"
define void @_Q_qtod() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @exit(i32 -1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ foo(int, int *);
int /*<<< orphan*/ foo2(int, int **);
int /*<<< orphan*/ foo3(int, int **);
int main(void) {
  int a[40];
  foo(40, a);
  int n = 30;
  int b[n][n];
  b[29][0] = 0;
  foo2(30, b);
  foo3(30, b);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xd0,%rsp
mov    $0x28,%edi
lea    -0xa0(%rbp),%rsi
call   1040 <foo@plt>
movl   $0x1e,-0xa4(%rbp)
mov    -0xa4(%rbp),%eax
mov    %eax,%ecx
mov    %rcx,%rax
mov    %rsp,%rdx
mov    %rdx,-0xb0(%rbp)
mov    %rcx,%rdx
imul   %rdx,%rdx
lea    0xf(,%rdx,4),%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rsi
sub    %rdx,%rsi
mov    %rsi,-0xc8(%rbp)
mov    %rsi,%rsp
mov    %rcx,-0xb8(%rbp)
mov    %rax,-0xc0(%rbp)
imul   $0x1d,%rax,%rax
movl   $0x0,(%rsi,%rax,4)
mov    $0x1e,%edi
call   1030 <foo2@plt>
mov    -0xc8(%rbp),%rsi
mov    $0x1e,%edi
call   1050 <foo3@plt>
mov    -0xb0(%rbp),%rax
mov    %rax,%rsp
xor    %eax,%eax
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0xeb8,%rsp
mov    %rsp,%rsi
mov    $0x28,%edi
call   1040 <foo@plt>
mov    %rsp,%rbx
movl   $0x0,0xe38(%rsp)
lea    0xa0(%rsp),%r14
mov    $0x1e,%edi
mov    %r14,%rsi
call   1030 <foo2@plt>
mov    $0x1e,%edi
mov    %r14,%rsi
call   1050 <foo3@plt>
mov    %rbx,%rsp
xor    %eax,%eax
add    $0xeb8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca [40 x i32]
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i64
%6 = getelementptr inbounds [40 x i32], [40 x i32]* %1, i64 0, i64 0
%7 = call i32 @foo(i32 40, i32* %6)
store i32 30, i32* %2
%8 = load i32, i32* %2
%9 = zext i32 %8 to i64
%10 = load i32, i32* %2
%11 = zext i32 %10 to i64
%12 = call i8* @llvm.stacksave()
store i8* %12, i8** %3
%13 = mul nuw i64 %9, %11
%14 = alloca i32, i64 %13
store i64 %9, i64* %4
store i64 %11, i64* %5
%15 = mul nsw i64 29, %11
%16 = getelementptr inbounds i32, i32* %14, i64 %15
%17 = getelementptr inbounds i32, i32* %16, i64 0
store i32 0, i32* %17
%18 = bitcast i32* %14 to i32**
%19 = call i32 @foo2(i32 30, i32** %18)
%20 = bitcast i32* %14 to i32**
%21 = call i32 @foo3(i32 30, i32** %20)
%22 = load i8*, i8** %3
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca [40 x i32]
%2 = bitcast [40 x i32]* %1 to i8*
%3 = getelementptr inbounds [40 x i32], [40 x i32]* %1, i64 0, i64 0
%4 = call i32 @foo(i32 40, i32* %3)
%5 = call i8* @llvm.stacksave()
%6 = alloca [900 x i32]
%7 = getelementptr inbounds [900 x i32], [900 x i32]* %6, i64 0, i64 870
store i32 0, i32* %7
%8 = bitcast [900 x i32]* %6 to i32**
%9 = call i32 @foo2(i32 30, i32** %8)
%10 = call i32 @foo3(i32 30, i32** %8)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("first OSS code");
  printf("Third OSS code");
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <printf@plt>
lea    0xeeb(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [15 x i8] c"first OSS code\00"
@.str.1 = [15 x i8] c"Third OSS code\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [15 x i8] c"first OSS code\00"
@.str.1 = [15 x i8] c"Third OSS code\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
int valid_yearday(int d) { return (d >= 1 && d <= 366) ? 1 : 0; }


x86 assembly (clang, -O0):
<valid_yearday>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x1,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jl     1123 <valid_yearday+0x23>
cmpl   $0x16e,-0x4(%rbp)
setle  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%dl
xor    %eax,%eax
mov    $0x1,%ecx
test   $0x1,%dl
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<valid_yearday>:
add    $0xffffffff,%edi
xor    %eax,%eax
cmp    $0x16e,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @valid_yearday(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 1
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 366
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ false, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i64
%11 = select i1 %9, i32 1, i32 0
ret i32 %11
}

LLVM IR (-O2):
define i32 @valid_yearday(i32 %0) {
%2 = add i32 %0, -1
%3 = icmp ult i32 %2, 366
%4 = zext i1 %3 to i32
ret i32 %4
}
int f2(int a) {
  { return (a); }
}


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

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

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

LLVM IR (-O2):
define i32 @f2(i32 returned %0) {
ret i32 %0
}
const char *mg_version(void) { return "3.9"; }


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

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

LLVM IR (-O0):
@.str = [4 x i8] c"3.9\00"
define i8* @mg_version() {
ret i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [4 x i8] c"3.9\00"
define i8* @mg_version() {
ret i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ strlen(char const *);
int /*<<< orphan*/ write(int, char const *, int /*<<< orphan*/);
void __attribute__((unused)) write_stdout(const char *s) {
  write(1, s, strlen(s));
}


x86 assembly (clang, -O0):
<write_stdout>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x10(%rbp),%rsi
mov    %eax,%edx
mov    $0x1,%edi
call   1030 <write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_stdout>:
push   %rbx
mov    %rdi,%rbx
call   1040 <strlen@plt>
mov    $0x1,%edi
mov    %rbx,%rsi
mov    %eax,%edx
pop    %rbx
jmp    1030 <write@plt>

LLVM IR (-O0):
define void @write_stdout(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @strlen(i8* %4)
%6 = call i32 @write(i32 1, i8* %3, i32 %5)
ret void
}

LLVM IR (-O2):
define void @write_stdout(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = tail call i32 @write(i32 1, i8* %0, i32 %2)
ret void
}
/* Variables and functions */
char *check(int /*<<< orphan*/);
int /*<<< orphan*/ malloc(size_t);
char *c_malloc(size_t size) { return check(malloc(size)); }


x86 assembly (clang, -O0):
<c_malloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <malloc@plt>
mov    %eax,%edi
call   1040 <check@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<c_malloc>:
push   %rax
call   1030 <malloc@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <check@plt>

LLVM IR (-O0):
define i8* @c_malloc(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i32 @malloc(i64 %3)
%5 = call i8* @check(i32 %4)
ret i8* %5
}

LLVM IR (-O2):
define i8* @c_malloc(i64 %0) {
%2 = tail call i32 @malloc(i64 %0)
%3 = tail call i8* @check(i32 %2)
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ ft_memdel(void **);
int ft_free(void **ptr, int ret) {
  if (*ptr)
    ft_memdel(ptr);
  return (ret);
}


x86 assembly (clang, -O0):
<ft_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
cmpq   $0x0,(%rax)
je     1136 <ft_free+0x26>
mov    -0x8(%rbp),%rdi
call   1030 <ft_memdel@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_free>:
push   %rbx
mov    %esi,%ebx
cmpq   $0x0,(%rdi)
je     111e <ft_free+0xe>
call   1030 <ft_memdel@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @ft_free(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 i8*, i8** %5
%7 = icmp ne i8* %6, null
br i1 %7, label %8, label %11
8: ; preds = %2
%9 = load i8**, i8*** %3
%10 = call i32 @ft_memdel(i8** %9)
br label %11
11: ; preds = %8, %2
%12 = load i32, i32* %4
ret i32 %12
}

LLVM IR (-O2):
define i32 @ft_free(i8** %0, i32 returned %1) {
%3 = load i8*, i8** %0
%4 = icmp eq i8* %3, null
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 @ft_memdel(i8** %0)
br label %7
7: ; preds = %5, %2
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ function(int, char **);
int main(int argc, char **argv) { function(argc, argv); }


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

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @function(i32 %0, i8** %1)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int uint16_t;

/* Variables and functions */
int /*<<< orphan*/ inb(int);
int /*<<< orphan*/ outb(int, int);
uint8_t ec_idx_read(uint16_t addr) {
  uint16_t lpc_idx = 0x380;
  outb(addr & 0xff, lpc_idx + 2);
  outb(addr >> 8, lpc_idx + 1);
  return inb(lpc_idx + 3);
}


x86 assembly (clang, -O0):
<ec_idx_read>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x380,-0x8(%rbp)
mov    -0x4(%rbp),%edi
and    $0xff,%edi
mov    -0x8(%rbp),%esi
add    $0x2,%esi
call   1030 <outb@plt>
mov    -0x4(%rbp),%edi
sar    $0x8,%edi
mov    -0x8(%rbp),%esi
add    $0x1,%esi
call   1030 <outb@plt>
mov    -0x8(%rbp),%edi
add    $0x3,%edi
call   1040 <inb@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ec_idx_read>:
push   %rbx
mov    %edi,%ebx
movzbl %bl,%edi
mov    $0x382,%esi
call   1030 <outb@plt>
sar    $0x8,%ebx
mov    %ebx,%edi
mov    $0x381,%esi
call   1030 <outb@plt>
mov    $0x383,%edi
pop    %rbx
jmp    1040 <inb@plt>

LLVM IR (-O0):
define i32 @ec_idx_read(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 896, i32* %3
%4 = load i32, i32* %2
%5 = and i32 %4, 255
%6 = load i32, i32* %3
%7 = add nsw i32 %6, 2
%8 = call i32 @outb(i32 %5, i32 %7)
%9 = load i32, i32* %2
%10 = ashr i32 %9, 8
%11 = load i32, i32* %3
%12 = add nsw i32 %11, 1
%13 = call i32 @outb(i32 %10, i32 %12)
%14 = load i32, i32* %3
%15 = add nsw i32 %14, 3
%16 = call i32 @inb(i32 %15)
ret i32 %16
}

LLVM IR (-O2):
define i32 @ec_idx_read(i32 %0) {
%2 = and i32 %0, 255
%3 = tail call i32 @outb(i32 %2, i32 898)
%4 = ashr i32 %0, 8
%5 = tail call i32 @outb(i32 %4, i32 897)
%6 = tail call i32 @inb(i32 899)
ret i32 %6
}
int overloaded1() { return 0; }


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

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

LLVM IR (-O0):
define i32 @overloaded1() {
ret i32 0
}

LLVM IR (-O2):
define i32 @overloaded1() {
ret i32 0
}
/* Type definitions */
struct message {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct message *);
void delete_message(struct message *m) { free(m); }


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

x86 assembly (clang, -O2):
<delete_message>:
jmp    1030 <free@plt>

LLVM IR (-O0):
%struct.message = type { i32 }
define void @delete_message(%struct.message* %0) {
%2 = alloca %struct.message*
store %struct.message* %0, %struct.message** %2
%3 = load %struct.message*, %struct.message** %2
%4 = call i32 @free(%struct.message* %3)
ret void
}

LLVM IR (-O2):
%struct.message = type { i32 }
define void @delete_message(%struct.message* nocapture %0) {
%2 = tail call i32 @free(%struct.message* %0)
ret void
}
/* Variables and functions */
int cbuf(int, int, int);
cbuf35(int f, int n) { return (cbuf(f, n, 35)); }


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

x86 assembly (clang, -O2):
<cbuf35>:
mov    $0x23,%edx
jmp    1030 <cbuf@plt>

LLVM IR (-O0):
define i32 @cbuf35(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 @cbuf(i32 %5, i32 %6, i32 35)
ret i32 %7
}

LLVM IR (-O2):
define i32 @cbuf35(i32 %0, i32 %1) {
%3 = tail call i32 @cbuf(i32 %0, i32 %1, i32 35)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
int main(int ac, char **av) {
  while (ac) {
    ac = ac - 1;
    puts(av[ac]);
  }
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     114f <main+0x3f>
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x8(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <puts@plt>
jmp    1126 <main+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
test   %edi,%edi
je     1142 <main+0x32>
mov    %edi,%r14d
movslq %edi,%rax
neg    %r14d
lea    (%rsi,%rax,8),%r15
add    $0xfffffffffffffff8,%r15
xor    %ebx,%ebx
nopl   0x0(%rax)
mov    (%r15,%rbx,8),%rdi
call   1030 <puts@plt>
add    $0xffffffffffffffff,%rbx
cmp    %ebx,%r14d
jne    1130 <main+0x20>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 0
br i1 %3, label %14, label %4
4: ; preds = %2
%5 = sext i32 %0 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ %5, %4 ], [ %8, %6 ]
%8 = add nsw i64 %7, -1
%9 = getelementptr inbounds i8*, i8** %1, i64 %8
%10 = load i8*, i8** %9
%11 = tail call i32 @puts(i8* dereferenceable(1) %10)
%12 = trunc i64 %8 to i32
%13 = icmp eq i32 %12, 0
br i1 %13, label %14, label %6
14: ; preds = %6, %2
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ begin();
int /*<<< orphan*/ loop();
int main() {
  begin();
  loop();
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @begin()
%3 = call i32 (...) @loop()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @begin()
%2 = tail call i32 (...) @loop()
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ off_t;

/* Variables and functions */
int /*<<< orphan*/ __NR_truncate;
int syscall(int /*<<< orphan*/, int, int /*<<< orphan*/);
__attribute__((always_)) int _syscall_ftruncate(int fd, off_t length) {
  return syscall(__NR_truncate, fd, length);
}


x86 assembly (clang, -O0):
<_syscall_ftruncate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    0x2ebb(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
call   1030 <syscall@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_syscall_ftruncate>:
mov    %esi,%edx
mov    %edi,%esi
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
jmp    1030 <syscall@plt>

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

LLVM IR (-O2):
@__NR_truncate = global i32 0
define i32 @_syscall_ftruncate(i32 %0, i32 %1) {
%3 = load i32, i32* @__NR_truncate
%4 = tail call i32 @syscall(i32 %3, i32 %0, i32 %1)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void show_usage(char *name) {
  fprintf(stderr,
          "\nEthStatus v"
          "0.4a"
          " - "
          "Gabriel Montenegro / Christoph Haas"
          "\n"
          "Usage: %s\n"
          "  [-i interface]                      interface name\n"
          "  [-v [vga|mono]]                     video display mode\n"
          "  [-S speed[k|m|g]]                   line speed in [K|M|G]bps\n"
          "  [-s [10|100|64|128|256|768|1540]]   line speed (backward "
          "compatibility)\n"
          "\n",
          name);
}


x86 assembly (clang, -O0):
<show_usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xed0(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<show_usage>:
mov    %rdi,%rdx
mov    0x2ec6(%rip),%rax
mov    (%rax),%edi
lea    0xedd(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [314 x i8] c"\0AEthStatus v0.4a - Gabriel Montenegro / Christoph Haas\0AUsage: %s\0A [-i interface] interface name\0A [-v [vga|mono]] video display mode\0A [-S speed[k|m|g]] line speed in [K|M|G]bps\0A [-s [10|100|64|128|256|768|1540]] line speed (backward compatibility)\0A\0A\00"
define void @show_usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([314 x i8], [314 x i8]* @.str, i64 0, i64 0), i8* %4)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [314 x i8] c"\0AEthStatus v0.4a - Gabriel Montenegro / Christoph Haas\0AUsage: %s\0A [-i interface] interface name\0A [-v [vga|mono]] video display mode\0A [-S speed[k|m|g]] line speed in [K|M|G]bps\0A [-s [10|100|64|128|256|768|1540]] line speed (backward compatibility)\0A\0A\00"
define void @show_usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([314 x i8], [314 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ endwin();
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ reset_phi();
int /*<<< orphan*/ sleep(int);
int /*<<< orphan*/ stdout;
void handle_exit(void) {
  printf("Exiting from console terminal\n");
  fflush(stdout);
  reset_phi();
  sleep(2);
  endwin();
}


x86 assembly (clang, -O0):
<handle_exit>:
push   %rbp
mov    %rsp,%rbp
lea    0xea5(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e79(%rip),%rax
mov    (%rax),%edi
call   1050 <fflush@plt>
mov    $0x0,%al
call   1040 <reset_phi@plt>
mov    $0x2,%edi
call   1070 <sleep@plt>
mov    $0x0,%al
call   1060 <endwin@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<handle_exit>:
push   %rax
lea    0xea8(%rip),%rdi
call   1030 <puts@plt>
mov    0x2e7c(%rip),%rax
mov    (%rax),%edi
call   1050 <fflush@plt>
xor    %eax,%eax
call   1040 <reset_phi@plt>
mov    $0x2,%edi
call   1070 <sleep@plt>
xor    %eax,%eax
pop    %rcx
jmp    1060 <endwin@plt>

LLVM IR (-O0):
@.str = [31 x i8] c"Exiting from console terminal\0A\00"
@stdout = global i32 0
define void @handle_exit() {
%1 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
%2 = load i32, i32* @stdout
%3 = call i32 @fflush(i32 %2)
%4 = call i32 (...) @reset_phi()
%5 = call i32 @sleep(i32 2)
%6 = call i32 (...) @endwin()
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@str = [30 x i8] c"Exiting from console terminal\00"
define void @handle_exit() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str, i64 0, i64 0))
%2 = load i32, i32* @stdout
%3 = tail call i32 @fflush(i32 %2)
%4 = tail call i32 (...) @reset_phi()
%5 = tail call i32 @sleep(i32 2)
%6 = tail call i32 (...) @endwin()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isspace(int);
void t_isspace_0x54() {
  Assert_real((isspace(84) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isspace.c",
              425, ("isspace should be 0 for T"));
}


x86 assembly (clang, -O0):
<t_isspace_0x54>:
push   %rbp
mov    %rsp,%rbp
mov    $0x54,%edi
call   1030 <isspace@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x1a9,%edx
lea    0xf5b(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isspace_0x54>:
push   %rax
mov    $0x54,%edi
call   1030 <isspace@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x1a9,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isspace.c\00"
@.str.1 = [26 x i8] c"isspace should be 0 for T\00"
define void @t_isspace_0x54() {
%1 = call i64 @isspace(i32 84)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 425, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isspace.c\00"
@.str.1 = [26 x i8] c"isspace should be 0 for T\00"
define void @t_isspace_0x54() {
%1 = tail call i64 @isspace(i32 84)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 425, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
float k2_angle_in_degrees(float radians) {
  return radians * 180.0f / ((float)3.14159265358979323846);
}


x86 assembly (clang, -O0):
<k2_angle_in_degrees>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  0xef3(%rip),%xmm0
mulss  -0x4(%rbp),%xmm0
movss  0xee2(%rip),%xmm1
divss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<k2_angle_in_degrees>:
mulss  0xef8(%rip),%xmm0
divss  0xef4(%rip),%xmm0
ret

LLVM IR (-O0):
define float @k2_angle_in_degrees(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fmul float %3, 1.800000e+02
%5 = fdiv float %4, 0x400921FB60000000
ret float %5
}

LLVM IR (-O2):
define float @k2_angle_in_degrees(float %0) {
%2 = fmul float %0, 1.800000e+02
%3 = fdiv float %2, 0x400921FB60000000
ret float %3
}
/* Variables and functions */
int new_int_from_bin(char *);
int new_int_from_char(char *value) { return new_int_from_bin(value); }


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

x86 assembly (clang, -O2):
<new_int_from_char>:
jmp    1030 <new_int_from_bin@plt>

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

LLVM IR (-O2):
define i32 @new_int_from_char(i8* %0) {
%2 = tail call i32 @new_int_from_bin(i8* %0)
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_mutexattr_t;

/* Variables and functions */
int EINVAL;
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ printf(char *, ...);
int pthread_mutexattr_setpshared(int /*<<< orphan*/ *, int);
int /*<<< orphan*/ stderr;
int main(void) {
  fprintf(stderr, "process-shared attribute is not available for testing\n");
  return 2;
  pthread_mutexattr_t mta;
  int ret;
  ret = pthread_mutexattr_setpshared(&mta, -1);
  if (ret != 0) {
    if (ret == EINVAL) {
      printf("Test PASSED\n");
      return 0;
    }
    printf("Test FAILED: Expected return code 0 or EINVAL, got: %d\n", ret);
    return 1;
  }
  printf("Test PASSED: NOTE*: Returned 0 on error, though standard states "
         "'may' fail.\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2eba(%rip),%rax
mov    (%rax),%edi
lea    0xed1(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x2,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%edi
lea    0xedf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x2,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [55 x i8] c"process-shared attribute is not available for testing\0A\00"
@EINVAL = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
%4 = load i32, i32* @stderr
%5 = call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str, i64 0, i64 0))
ret i32 2
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [55 x i8] c"process-shared attribute is not available for testing\0A\00"
@EINVAL = global i32 0
define i32 @main() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str, i64 0, i64 0))
ret i32 2
}
unsigned int rol(unsigned int x, int n) {
  unsigned long result = (x << n) | (x >> (32 - n));
  return (result);
}


x86 assembly (clang, -O0):
<rol>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
shl    %cl,%eax
mov    -0x4(%rbp),%edx
mov    $0x20,%ecx
sub    -0x8(%rbp),%ecx
shr    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
mov    %eax,%eax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rol>:
mov    %esi,%ecx
mov    %edi,%eax
rol    %cl,%eax
ret

LLVM IR (-O0):
define i32 @rol(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i64
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = load i32, i32* %4
%8 = shl i32 %6, %7
%9 = load i32, i32* %3
%10 = load i32, i32* %4
%11 = sub nsw i32 32, %10
%12 = lshr i32 %9, %11
%13 = or i32 %8, %12
%14 = zext i32 %13 to i64
store i64 %14, i64* %5
%15 = load i64, i64* %5
%16 = trunc i64 %15 to i32
ret i32 %16
}

LLVM IR (-O2):
define i32 @rol(i32 %0, i32 %1) {
%3 = shl i32 %0, %1
%4 = sub nsw i32 32, %1
%5 = lshr i32 %0, %4
%6 = or i32 %5, %3
ret i32 %6
}
int I2C_Read(int NumberOfBytes, int RegAddress, unsigned char *RxBuffer) {
  int res = -1;
  return (res);
}


x86 assembly (clang, -O0):
<I2C_Read>:
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_Read>:
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
define i32 @I2C_Read(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_Read(i32 %0, i32 %1, i8* nocapture readnone %2) {
ret i32 -1
}
double __subdf3(double a __attribute__((unused)),
                double b __attribute__((unused))) {
  return 0.0;
}


x86 assembly (clang, -O0):
<__subdf3>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
xorps  %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<__subdf3>:
xorps  %xmm0,%xmm0
ret

LLVM IR (-O0):
define double @__subdf3(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
ret double 0.000000e+00
}

LLVM IR (-O2):
define double @__subdf3(double %0, double %1) {
ret double 0.000000e+00
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128i;

/* Variables and functions */
int /*<<< orphan*/ _mm_bsrli_si128(int /*<<< orphan*/, int);
__m128i test_mm_bsrli_si128(__m128i A) { return _mm_bsrli_si128(A, 5); }


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

x86 assembly (clang, -O2):
<test_mm_bsrli_si128>:
mov    $0x5,%esi
jmp    1030 <_mm_bsrli_si128@plt>

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

LLVM IR (-O2):
define i32 @test_mm_bsrli_si128(i32 %0) {
%2 = tail call i32 @_mm_bsrli_si128(i32 %0, i32 5)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ vec4f_normalize_new(float *, float const *);
void quatf_normalize_new(float dest[4], const float src[4]) {
  vec4f_normalize_new(dest, src);
}


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

x86 assembly (clang, -O2):
<quatf_normalize_new>:
jmp    1030 <vec4f_normalize_new@plt>

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

LLVM IR (-O2):
define void @quatf_normalize_new(float* %0, float* %1) {
%3 = tail call i32 @vec4f_normalize_new(float* %0, float* %1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uid_t;

/* Variables and functions */
int /*<<< orphan*/ _getuid();
uid_t getuid(void) { return _getuid(); }


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

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

LLVM IR (-O0):
define i32 @getuid() {
%1 = call i32 (...) @_getuid()
ret i32 %1
}

LLVM IR (-O2):
define i32 @getuid() {
%1 = tail call i32 (...) @_getuid()
ret i32 %1
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int /*<<< orphan*/ internal_fiat_p384_to_montgomery(uintptr_t, uintptr_t);
void fiat_p384_to_montgomery(uint64_t out1[6], const uint64_t arg1[6]) {
  internal_fiat_p384_to_montgomery((uintptr_t)out1, (uintptr_t)arg1);
}


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

x86 assembly (clang, -O2):
<fiat_p384_to_montgomery>:
jmp    1030 <internal_fiat_p384_to_montgomery@plt>

LLVM IR (-O0):
define void @fiat_p384_to_montgomery(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 = ptrtoint i32* %5 to i64
%7 = load i32*, i32** %4
%8 = ptrtoint i32* %7 to i64
%9 = call i32 @internal_fiat_p384_to_montgomery(i64 %6, i64 %8)
ret void
}

LLVM IR (-O2):
define void @fiat_p384_to_montgomery(i32* %0, i32* %1) {
%3 = ptrtoint i32* %0 to i64
%4 = ptrtoint i32* %1 to i64
%5 = tail call i32 @internal_fiat_p384_to_montgomery(i64 %3, i64 %4)
ret void
}
sethostfile(name) char *name;
{}


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

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

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

LLVM IR (-O2):
define i32 @sethostfile(i8* nocapture readnone %0) {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ HiveX_motor_setDutyCycle(int, int /*<<< orphan*/);
void stopRobot() {
  HiveX_motor_setDutyCycle(0, 0);
  HiveX_motor_setDutyCycle(1, 0);
}


x86 assembly (clang, -O0):
<stopRobot>:
push   %rbp
mov    %rsp,%rbp
xor    %esi,%esi
mov    %esi,%edi
call   1030 <HiveX_motor_setDutyCycle@plt>
mov    $0x1,%edi
xor    %esi,%esi
call   1030 <HiveX_motor_setDutyCycle@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<stopRobot>:
push   %rax
xor    %edi,%edi
xor    %esi,%esi
call   1030 <HiveX_motor_setDutyCycle@plt>
mov    $0x1,%edi
xor    %esi,%esi
pop    %rax
jmp    1030 <HiveX_motor_setDutyCycle@plt>

LLVM IR (-O0):
define void @stopRobot() {
%1 = call i32 @HiveX_motor_setDutyCycle(i32 0, i32 0)
%2 = call i32 @HiveX_motor_setDutyCycle(i32 1, i32 0)
ret void
}

LLVM IR (-O2):
define void @stopRobot() {
%1 = tail call i32 @HiveX_motor_setDutyCycle(i32 0, i32 0)
%2 = tail call i32 @HiveX_motor_setDutyCycle(i32 1, i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ min_down(long long *, int, int);
void build_min_heap(long long arr[], int n) {
  int i;
  for (i = n / 2; i >= 1; i--)
    min_down(arr, i, n);
}


x86 assembly (clang, -O0):
<build_min_heap>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x10(%rbp)
cmpl   $0x1,-0x10(%rbp)
jl     1154 <build_min_heap+0x44>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%esi
mov    -0xc(%rbp),%edx
call   1030 <min_down@plt>
mov    -0x10(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x10(%rbp)
jmp    112d <build_min_heap+0x1d>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<build_min_heap>:
push   %rbp
push   %r14
push   %rbx
cmp    $0x2,%esi
jl     1146 <build_min_heap+0x36>
mov    %esi,%ebp
mov    %rdi,%r14
mov    %esi,%ebx
shr    %ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %r14,%rdi
mov    %ebx,%esi
mov    %ebp,%edx
call   1030 <min_down@plt>
lea    -0x1(%rbx),%eax
cmp    $0x1,%ebx
mov    %eax,%ebx
ja     1130 <build_min_heap+0x20>
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define void @build_min_heap(i64* %0, i32 %1) {
%3 = icmp sgt i32 %1, 1
br i1 %3, label %4, label %11
4: ; preds = %2
%5 = lshr i32 %1, 1
br label %6
6: ; preds = %4, %6
%7 = phi i32 [ %9, %6 ], [ %5, %4 ]
%8 = tail call i32 @min_down(i64* %0, i32 %7, i32 %1)
%9 = add nsw i32 %7, -1
%10 = icmp ugt i32 %7, 1
br i1 %10, label %6, label %11
11: ; preds = %6, %2
ret void
}
/* Variables and functions */
bool nrf_drv_usbd_errata_166(void) { return 1 && true; }


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

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

LLVM IR (-O0):
define i32 @nrf_drv_usbd_errata_166() {
ret i32 1
}

LLVM IR (-O2):
define i32 @nrf_drv_usbd_errata_166() {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ scanf(char *, int *);
void input_Q(int *Q_array) { scanf("%d", Q_array); }


x86 assembly (clang, -O0):
<input_Q>:
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):
<input_Q>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <scanf@plt>

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define void @input_Q(i32* %0) {
%2 = tail call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ __m64;

/* Variables and functions */
int /*<<< orphan*/ _mm_unpackhi_pi8(int /*<<< orphan*/, int /*<<< orphan*/);
__m64 test_mm_unpackhi_pi8(__m64 a, __m64 b) { return _mm_unpackhi_pi8(a, b); }


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

x86 assembly (clang, -O2):
<test_mm_unpackhi_pi8>:
jmp    1030 <_mm_unpackhi_pi8@plt>

LLVM IR (-O0):
define i32 @test_mm_unpackhi_pi8(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_unpackhi_pi8(i32 %5, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @test_mm_unpackhi_pi8(i32 %0, i32 %1) {
%3 = tail call i32 @_mm_unpackhi_pi8(i32 %0, i32 %1)
ret i32 %3
}