xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ test_sd_event_code_migration();
int /*<<< orphan*/ test_strpcpy();
int /*<<< orphan*/ test_strpcpyf();
int /*<<< orphan*/ test_strpcpyl();
int /*<<< orphan*/ test_strscpy();
int /*<<< orphan*/ test_strscpyl();
int main(int argc, char *argv[]) {
  test_strpcpy();
  test_strpcpyf();
  test_strpcpyl();
  test_strscpy();
  test_strscpyl();
  test_sd_event_code_migration();
  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)
mov    $0x0,%al
call   1080 <test_strpcpy@plt>
mov    $0x0,%al
call   1050 <test_strpcpyf@plt>
mov    $0x0,%al
call   1040 <test_strpcpyl@plt>
mov    $0x0,%al
call   1070 <test_strscpy@plt>
mov    $0x0,%al
call   1030 <test_strscpyl@plt>
mov    $0x0,%al
call   1060 <test_sd_event_code_migration@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1080 <test_strpcpy@plt>
xor    %eax,%eax
call   1050 <test_strpcpyf@plt>
xor    %eax,%eax
call   1040 <test_strpcpyl@plt>
xor    %eax,%eax
call   1070 <test_strscpy@plt>
xor    %eax,%eax
call   1030 <test_strscpyl@plt>
xor    %eax,%eax
call   1060 <test_sd_event_code_migration@plt>
xor    %eax,%eax
pop    %rcx
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
%6 = call i32 (...) @test_strpcpy()
%7 = call i32 (...) @test_strpcpyf()
%8 = call i32 (...) @test_strpcpyl()
%9 = call i32 (...) @test_strscpy()
%10 = call i32 (...) @test_strscpyl()
%11 = call i32 (...) @test_sd_event_code_migration()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @test_strpcpy()
%4 = tail call i32 (...) @test_strpcpyf()
%5 = tail call i32 (...) @test_strpcpyl()
%6 = tail call i32 (...) @test_strscpy()
%7 = tail call i32 (...) @test_strscpyl()
%8 = tail call i32 (...) @test_sd_event_code_migration()
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ *libc_fopen(char const *, char const *);
scalar_t__ strchr(char const *, char);
int /*<<< orphan*/ watch_log(char *, char const *);
FILE *fopen(const char *path, const char *mode) {
  if (strchr(mode, 'w') || strchr(mode, 'a')) {
    watch_log("open %s w\n", path);
  }
  return libc_fopen(path, mode);
}


x86 assembly (clang, -O0):
<fopen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x77,%esi
call   1030 <strchr@plt>
cmp    $0x0,%rax
jne    1170 <fopen+0x40>
mov    -0x10(%rbp),%rdi
mov    $0x61,%esi
call   1030 <strchr@plt>
cmp    $0x0,%rax
je     1180 <fopen+0x50>
mov    -0x8(%rbp),%rsi
lea    0xe85(%rip),%rdi
call   1050 <watch_log@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <libc_fopen@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fopen>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
mov    $0x77,%esi
call   1030 <strchr@plt>
test   %rax,%rax
jne    115e <fopen+0x2e>
mov    %rbx,%rdi
mov    $0x61,%esi
call   1030 <strchr@plt>
test   %rax,%rax
je     116d <fopen+0x3d>
lea    0xe9b(%rip),%rdi
mov    %r14,%rsi
call   1050 <watch_log@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <libc_fopen@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"open %s w\0A\00"
define i32* @fopen(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = call i64 @strchr(i8* %5, i8 signext 119)
%7 = icmp ne i64 %6, 0
br i1 %7, label %12, label %8
8: ; preds = %2
%9 = load i8*, i8** %4
%10 = call i64 @strchr(i8* %9, i8 signext 97)
%11 = icmp ne i64 %10, 0
br i1 %11, label %12, label %15
12: ; preds = %8, %2
%13 = load i8*, i8** %3
%14 = call i32 @watch_log(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %13)
br label %15
15: ; preds = %12, %8
%16 = load i8*, i8** %3
%17 = load i8*, i8** %4
%18 = call i32* @libc_fopen(i8* %16, i8* %17)
ret i32* %18
}

LLVM IR (-O2):
@.str = [11 x i8] c"open %s w\0A\00"
define i32* @fopen(i8* %0, i8* %1) {
%3 = tail call i64 @strchr(i8* %1, i8 signext 119)
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %2
%6 = tail call i64 @strchr(i8* %1, i8 signext 97)
%7 = icmp eq i64 %6, 0
br i1 %7, label %10, label %8
8: ; preds = %5, %2
%9 = tail call i32 @watch_log(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %0)
br label %10
10: ; preds = %8, %5
%11 = tail call i32* @libc_fopen(i8* %0, i8* %1)
ret i32* %11
}
/* Variables and functions */
int /*<<< orphan*/ readSector(char *, int);
int getFtype(int file) {
  char buf[512];
  int i;
  readSector(buf, file);
  return ((buf[2] & 0x80) >> 6) | ((buf[3] & 0x80) >> 7);
}


x86 assembly (clang, -O0):
<getFtype>:
push   %rbp
mov    %rsp,%rbp
sub    $0x220,%rsp
mov    %edi,-0x4(%rbp)
lea    -0x210(%rbp),%rdi
mov    -0x4(%rbp),%esi
call   1030 <readSector@plt>
movsbl -0x20e(%rbp),%eax
and    $0x80,%eax
sar    $0x6,%eax
movsbl -0x20d(%rbp),%ecx
and    $0x80,%ecx
sar    $0x7,%ecx
or     %ecx,%eax
add    $0x220,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getFtype>:
sub    $0x208,%rsp
mov    %edi,%esi
mov    %rsp,%rdi
call   1030 <readSector@plt>
movzbl 0x2(%rsp),%ecx
shr    $0x6,%ecx
and    $0x2,%ecx
movzbl 0x3(%rsp),%eax
shr    $0x7,%eax
or     %ecx,%eax
add    $0x208,%rsp
ret

LLVM IR (-O0):
define i32 @getFtype(i32 %0) {
%2 = alloca i32
%3 = alloca [512 x i8]
%4 = alloca i32
store i32 %0, i32* %2
%5 = getelementptr inbounds [512 x i8], [512 x i8]* %3, i64 0, i64 0
%6 = load i32, i32* %2
%7 = call i32 @readSector(i8* %5, i32 %6)
%8 = getelementptr inbounds [512 x i8], [512 x i8]* %3, i64 0, i64 2
%9 = load i8, i8* %8
%10 = sext i8 %9 to i32
%11 = and i32 %10, 128
%12 = ashr i32 %11, 6
%13 = getelementptr inbounds [512 x i8], [512 x i8]* %3, i64 0, i64 3
%14 = load i8, i8* %13
%15 = sext i8 %14 to i32
%16 = and i32 %15, 128
%17 = ashr i32 %16, 7
%18 = or i32 %12, %17
ret i32 %18
}

LLVM IR (-O2):
define i32 @getFtype(i32 %0) {
%2 = alloca [512 x i8]
%3 = getelementptr inbounds [512 x i8], [512 x i8]* %2, i64 0, i64 0
%4 = call i32 @readSector(i8* %3, i32 %0)
%5 = getelementptr inbounds [512 x i8], [512 x i8]* %2, i64 0, i64 2
%6 = load i8, i8* %5
%7 = lshr i8 %6, 6
%8 = and i8 %7, 2
%9 = getelementptr inbounds [512 x i8], [512 x i8]* %2, i64 0, i64 3
%10 = load i8, i8* %9
%11 = lshr i8 %10, 7
%12 = or i8 %8, %11
%13 = zext i8 %12 to i32
ret i32 %13
}
/* Variables and functions */
int optind;
void bcftools_set_optind(int val) { optind = val; }


x86 assembly (clang, -O0):
<bcftools_set_optind>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
mov    0x2ed7(%rip),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<bcftools_set_optind>:
mov    0x2ee1(%rip),%rax
mov    %edi,(%rax)
ret

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

LLVM IR (-O2):
@optind = global i32 0
define void @bcftools_set_optind(i32 %0) {
store i32 %0, i32* @optind
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
void tl_pos(int x, int y) { printf("\033[%d;%dH", y, x); }


x86 assembly (clang, -O0):
<tl_pos>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%esi
mov    -0x4(%rbp),%edx
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tl_pos>:
mov    %edi,%edx
lea    0xee7(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"\1B[%d;%dH\00"
define void @tl_pos(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 = load i32, i32* %3
%7 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %5, i32 %6)
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"\1B[%d;%dH\00"
define void @tl_pos(i32 %0, i32 %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %1, i32 %0)
ret void
}
void _gfortran_caf_sync_all(int *stat, char *errmsg __attribute__((unused)),
                            int errmsg_len __attribute__((unused))) {
  __asm__ __volatile__("" ::: "memory");
  if (stat)
    *stat = 0;
}


x86 assembly (clang, -O0):
<_gfortran_caf_sync_all>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1124 <_gfortran_caf_sync_all+0x24>
mov    -0x8(%rbp),%rax
movl   $0x0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<_gfortran_caf_sync_all>:
test   %rdi,%rdi
je     110b <_gfortran_caf_sync_all+0xb>
movl   $0x0,(%rdi)
ret

LLVM IR (-O0):
define void @_gfortran_caf_sync_all(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 = icmp ne i32* %7, null
br i1 %8, label %9, label %11
9: ; preds = %3
%10 = load i32*, i32** %4
store i32 0, i32* %10
br label %11
11: ; preds = %9, %3
ret void
}

LLVM IR (-O2):
define void @_gfortran_caf_sync_all(i32* writeonly %0, i8* nocapture readnone %1, i32 %2) {
tail call void asm sideeffect "", "~{memory},~{dirflag},~{fpsr},~{flags}"()
%4 = icmp eq i32* %0, null
br i1 %4, label %6, label %5
5: ; preds = %3
store i32 0, i32* %0
br label %6
6: ; preds = %5, %3
ret void
}
/* Variables and functions */
char *jsonp_strndup(char const *, size_t);
char *jsonp_strdup(const char *s) { return jsonp_strndup(s, (size_t)-1); }


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

x86 assembly (clang, -O2):
<jsonp_strdup>:
mov    $0xffffffffffffffff,%rsi
jmp    1030 <jsonp_strndup@plt>

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

LLVM IR (-O2):
define i8* @jsonp_strdup(i8* %0) {
%2 = tail call i8* @jsonp_strndup(i8* %0, i64 -1)
ret i8* %2
}
unsigned char reverseBits_fun_uchar(unsigned char x) {
  unsigned char r = x;
  int i = 7;
  while (x >>= 1) {
    r = (r << 1) | (x & 1);
    --i;
  }
  return r << i;
}


x86 assembly (clang, -O0):
<reverseBits_fun_uchar>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    -0x1(%rbp),%al
mov    %al,-0x2(%rbp)
movl   $0x7,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
sar    $0x1,%eax
mov    %al,-0x1(%rbp)
cmp    $0x0,%al
je     114a <reverseBits_fun_uchar+0x4a>
movzbl -0x2(%rbp),%eax
shl    $0x1,%eax
movzbl -0x1(%rbp),%ecx
and    $0x1,%ecx
or     %ecx,%eax
mov    %al,-0x2(%rbp)
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
jmp    1117 <reverseBits_fun_uchar+0x17>
movzbl -0x2(%rbp),%eax
mov    -0x8(%rbp),%ecx
shl    %cl,%eax
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<reverseBits_fun_uchar>:
mov    $0x7,%ecx
cmp    $0x2,%dil
jae    110f <reverseBits_fun_uchar+0xf>
mov    %edi,%eax
jmp    1137 <reverseBits_fun_uchar+0x37>
mov    $0x7,%ecx
mov    %edi,%eax
mov    %edi,%esi
nopl   0x0(%rax,%rax,1)
shr    %sil
add    %al,%al
mov    %esi,%edx
and    $0x1,%dl
or     %dl,%al
add    $0xffffffff,%ecx
cmp    $0x3,%dil
mov    %esi,%edi
ja     1120 <reverseBits_fun_uchar+0x20>
movzbl %al,%eax
shl    %cl,%eax
ret

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

LLVM IR (-O2):
define zeroext i8 @reverseBits_fun_uchar(i8 zeroext %0) {
%2 = icmp ult i8 %0, 2
br i1 %2, label %13, label %3
3: ; preds = %1, %3
%4 = phi i8 [ %7, %3 ], [ %0, %1 ]
%5 = phi i32 [ %11, %3 ], [ 7, %1 ]
%6 = phi i8 [ %10, %3 ], [ %0, %1 ]
%7 = lshr i8 %4, 1
%8 = shl i8 %6, 1
%9 = and i8 %7, 1
%10 = or i8 %8, %9
%11 = add nsw i32 %5, -1
%12 = icmp ult i8 %4, 4
br i1 %12, label %13, label %3
13: ; preds = %3, %1
%14 = phi i8 [ %0, %1 ], [ %10, %3 ]
%15 = phi i32 [ 7, %1 ], [ %11, %3 ]
%16 = zext i8 %14 to i32
%17 = shl i32 %16, %15
%18 = trunc i32 %17 to i8
ret i8 %18
}
void putch(c) int c;
{ putchar(c); }


x86 assembly (clang, -O0):
<putch>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x0,%al
call   1030 <putchar@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @putch(i32 %0) {
%2 = tail call i32 (i32, ...) bitcast (i32 (...)* @putchar to i32 (i32, ...)*)(i32 %0)
ret void
}
void uart_write_ch(const char ch) { (void)ch; }


x86 assembly (clang, -O0):
<uart_write_ch>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @uart_write_ch(i8 signext %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isprint(int);
void t_isprint_0x97() {
  Assert_real((isprint(151) == 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_isprint.c",
              760, ("isprint should be 0 for 0x97"));
}


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

x86 assembly (clang, -O2):
<t_isprint_0x97>:
push   %rax
mov    $0x97,%edi
call   1030 <isprint@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x2f8,%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_isprint.c\00"
@.str.1 = [29 x i8] c"isprint should be 0 for 0x97\00"
define void @t_isprint_0x97() {
%1 = call i64 @isprint(i32 151)
%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 760, i8* getelementptr inbounds ([29 x i8], [29 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_isprint.c\00"
@.str.1 = [29 x i8] c"isprint should be 0 for 0x97\00"
define void @t_isprint_0x97() {
%1 = tail call i64 @isprint(i32 151)
%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 760, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ GLenum;

/* Variables and functions */
void print_program_limits(GLenum target) {}


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

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

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

LLVM IR (-O2):
define void @print_program_limits(i32 %0) {
ret void
}
void DestroyWorkThread() {}


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

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

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

LLVM IR (-O2):
define void @DestroyWorkThread() {
ret void
}
/* Variables and functions */
int core5_swap(char *, int);
int U_EMRENDPATH_swap(char *record, int torev) {
  return (core5_swap(record, torev));
}


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

x86 assembly (clang, -O2):
<U_EMRENDPATH_swap>:
jmp    1030 <core5_swap@plt>

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

LLVM IR (-O2):
define i32 @U_EMRENDPATH_swap(i8* %0, i32 %1) {
%3 = tail call i32 @core5_swap(i8* %0, i32 %1)
ret i32 %3
}
double reduc(x)
double x;
{
  double t;
  t = ldexp(x, 4);
  t = floor(t);
  t = ldexp(t, -4);
  return (t);
}


x86 assembly (clang, -O0):
<reduc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
mov    $0x4,%edi
call   1030 <ldexp@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1040 <floor@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
mov    $0xfffffffc,%edi
call   1030 <ldexp@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<reduc>:
push   %rax
mov    $0x4,%edi
call   1030 <ldexp@plt>
call   1040 <floor@plt>
mov    $0xfffffffc,%edi
pop    %rax
jmp    1030 <ldexp@plt>

LLVM IR (-O0):
define double @reduc(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %2
%4 = load double, double* %2
%5 = call double @ldexp(double %4, i32 4)
store double %5, double* %3
%6 = load double, double* %3
%7 = call double @llvm.floor.f64(double %6)
store double %7, double* %3
%8 = load double, double* %3
%9 = call double @ldexp(double %8, i32 -4)
store double %9, double* %3
%10 = load double, double* %3
ret double %10
}

LLVM IR (-O2):
define double @reduc(double %0) {
%2 = tail call double @ldexp(double %0, i32 4)
%3 = tail call double @llvm.floor.f64(double %2)
%4 = tail call double @ldexp(double %3, i32 -4)
ret double %4
}
/* Type definitions */
typedef int /*<<< orphan*/ sem_t;

/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ *__errno_location();
int sem_close(sem_t *sem) {
  (void)sem;
  (*__errno_location()) = ENOSYS;
  return -1;
}


x86 assembly (clang, -O0):
<sem_close>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ec5(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    $0x0,%al
call   1030 <__errno_location@plt>
mov    -0xc(%rbp),%ecx
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sem_close>:
push   %rbx
mov    0x2ed0(%rip),%rax
mov    (%rax),%ebx
xor    %eax,%eax
call   1030 <__errno_location@plt>
mov    %ebx,(%rax)
mov    $0xffffffff,%eax
pop    %rbx
ret

LLVM IR (-O0):
@ENOSYS = global i32 0
define i32 @sem_close(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* @ENOSYS
%5 = call i32* (...) @__errno_location()
store i32 %4, i32* %5
ret i32 -1
}

LLVM IR (-O2):
@ENOSYS = global i32 0
define i32 @sem_close(i32* nocapture readnone %0) {
%2 = load i32, i32* @ENOSYS
%3 = tail call i32* (...) @__errno_location()
store i32 %2, i32* %3
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(void) { printf("Hello my big big big Galaxy!\n"); }


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

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

LLVM IR (-O0):
@.str = [30 x i8] c"Hello my big big big Galaxy!\0A\00"
define i32 @main() {
%1 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [29 x i8] c"Hello my big big big Galaxy!\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @str, i64 0, i64 0))
ret i32 0
}
void inflateBackEnd(void) {}


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

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

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

LLVM IR (-O2):
define void @inflateBackEnd() {
ret void
}
/* Variables and functions */
int bitrev(unsigned char);
int bitsum0(unsigned char);
int bitsum1(unsigned char);
int /*<<< orphan*/ printf(char *, int);
void dmbit(void) {
  unsigned char c = 0x75;
  printf("%d  ... bitsum0\n", bitsum0(c));
  printf("%d  ... bitsum1\n", bitsum1(c));
  printf("%02X  ... bitrev\n", bitrev(c));
}


x86 assembly (clang, -O0):
<dmbit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movb   $0x75,-0x1(%rbp)
movzbl -0x1(%rbp),%edi
call   1040 <bitsum0@plt>
mov    %eax,%esi
lea    0xea2(%rip),%rdi
call   1030 <printf@plt>
movzbl -0x1(%rbp),%edi
call   1050 <bitsum1@plt>
mov    %eax,%esi
lea    0xe9c(%rip),%rdi
call   1030 <printf@plt>
movzbl -0x1(%rbp),%edi
call   1060 <bitrev@plt>
mov    %eax,%esi
lea    0xe96(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dmbit>:
push   %rax
mov    $0x75,%edi
call   1040 <bitsum0@plt>
lea    0xeae(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    $0x75,%edi
call   1050 <bitsum1@plt>
lea    0xea7(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    $0x75,%edi
call   1060 <bitrev@plt>
lea    0xea0(%rip),%rdi
mov    %eax,%esi
pop    %rax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [17 x i8] c"%d ... bitsum0\0A\00"
@.str.1 = [17 x i8] c"%d ... bitsum1\0A\00"
@.str.2 = [18 x i8] c"%02X ... bitrev\0A\00"
define void @dmbit() {
%1 = alloca i8
store i8 117, i8* %1
%2 = load i8, i8* %1
%3 = call i32 @bitsum0(i8 zeroext %2)
%4 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = load i8, i8* %1
%6 = call i32 @bitsum1(i8 zeroext %5)
%7 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i32 %6)
%8 = load i8, i8* %1
%9 = call i32 @bitrev(i8 zeroext %8)
%10 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0), i32 %9)
ret void
}

LLVM IR (-O2):
@.str = [17 x i8] c"%d ... bitsum0\0A\00"
@.str.1 = [17 x i8] c"%d ... bitsum1\0A\00"
@.str.2 = [18 x i8] c"%02X ... bitrev\0A\00"
define void @dmbit() {
%1 = tail call i32 @bitsum0(i8 zeroext 117)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 @bitsum1(i8 zeroext 117)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i32 %3)
%5 = tail call i32 @bitrev(i8 zeroext 117)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0), i32 %5)
ret void
}
/* Type definitions */
struct in_addr {
  int /*<<< orphan*/ s_addr;
};

/* Variables and functions */
int /*<<< orphan*/ _add_constraint(struct in_addr, int, int /*<<< orphan*/);
int /*<<< orphan*/ inet_addr(char *);
void blocklist_prefix(char *ip, int prefix_len) {
  struct in_addr addr;
  addr.s_addr = inet_addr(ip);
  _add_constraint(addr, prefix_len, 0);
}


x86 assembly (clang, -O0):
<blocklist_prefix>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <inet_addr@plt>
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edi
xor    %edx,%edx
call   1040 <_add_constraint@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<blocklist_prefix>:
push   %rbx
mov    %esi,%ebx
call   1030 <inet_addr@plt>
mov    %eax,%edi
mov    %ebx,%esi
xor    %edx,%edx
pop    %rbx
jmp    1040 <_add_constraint@plt>

LLVM IR (-O0):
%struct.in_addr = type { i32 }
define void @blocklist_prefix(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca %struct.in_addr
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i8*, i8** %3
%7 = call i32 @inet_addr(i8* %6)
%8 = getelementptr inbounds %struct.in_addr, %struct.in_addr* %5, i32 0, i32 0
store i32 %7, i32* %8
%9 = load i32, i32* %4
%10 = getelementptr inbounds %struct.in_addr, %struct.in_addr* %5, i32 0, i32 0
%11 = load i32, i32* %10
%12 = call i32 @_add_constraint(i32 %11, i32 %9, i32 0)
ret void
}

LLVM IR (-O2):
define void @blocklist_prefix(i8* %0, i32 %1) {
%3 = tail call i32 @inet_addr(i8* %0)
%4 = tail call i32 @_add_constraint(i32 %3, i32 %1, i32 0)
ret void
}
int fun(float x, float y) { return x + y; }


x86 assembly (clang, -O0):
<fun>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
addss  -0x8(%rbp),%xmm0
cvttss2si %xmm0,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fun>:
addss  %xmm1,%xmm0
cvttss2si %xmm0,%eax
ret

LLVM IR (-O0):
define i32 @fun(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 = fadd float %5, %6
%8 = fptosi float %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @fun(float %0, float %1) {
%3 = fadd float %0, %1
%4 = fptosi float %3 to i32
ret i32 %4
}
/* Variables and functions */
void *CoreVideo_GL_GetProcAddress(char const *);
void *IntGetProcAddress(const char *name) {
  return CoreVideo_GL_GetProcAddress(name);
}


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

x86 assembly (clang, -O2):
<IntGetProcAddress>:
jmp    1030 <CoreVideo_GL_GetProcAddress@plt>

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

LLVM IR (-O2):
define i8* @IntGetProcAddress(i8* %0) {
%2 = tail call i8* @CoreVideo_GL_GetProcAddress(i8* %0)
ret i8* %2
}
/* Variables and functions */
scalar_t__ realloc(char *, int /*<<< orphan*/);
int /*<<< orphan*/ strlen(char *);
void bad_realloc(char *old_name, char *name) {
  char *new_name = (char *)realloc(old_name, strlen(name + 1));
}


x86 assembly (clang, -O0):
<bad_realloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
add    $0x1,%rdi
call   1030 <strlen@plt>
mov    -0x20(%rbp),%rdi
mov    %eax,%esi
call   1040 <realloc@plt>
mov    %rax,-0x18(%rbp)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bad_realloc>:
push   %rbx
mov    %rdi,%rbx
lea    0x1(%rsi),%rdi
call   1030 <strlen@plt>
mov    %rbx,%rdi
mov    %eax,%esi
pop    %rbx
jmp    1040 <realloc@plt>

LLVM IR (-O0):
define void @bad_realloc(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
%7 = load i8*, i8** %4
%8 = getelementptr inbounds i8, i8* %7, i64 1
%9 = call i32 @strlen(i8* %8)
%10 = call i64 @realloc(i8* %6, i32 %9)
%11 = inttoptr i64 %10 to i8*
store i8* %11, i8** %5
ret void
}

LLVM IR (-O2):
define void @bad_realloc(i8* %0, i8* %1) {
%3 = getelementptr inbounds i8, i8* %1, i64 1
%4 = tail call i32 @strlen(i8* %3)
%5 = tail call i64 @realloc(i8* %0, i32 %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void test2() { printf("Wrong\n"); }


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

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

LLVM IR (-O0):
@.str = [7 x i8] c"Wrong\0A\00"
define void @test2() {
%1 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [6 x i8] c"Wrong\00"
define void @test2() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int int64_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, float);
float stdlib_strided_svariancewd(int, float, float *, int);
int main() {
  float x[] = {1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0};
  int64_t N = 4;
  int64_t stride = 2;
  float v = stdlib_strided_svariancewd(N, 1.0f, x, stride);
  printf("sample variance: %f\n", v);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    0xee1(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xede(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xedb(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0xed8(%rip),%rax
mov    %rax,-0x8(%rbp)
movl   $0x4,-0x24(%rbp)
movl   $0x2,-0x28(%rbp)
mov    -0x24(%rbp),%edi
lea    -0x20(%rbp),%rsi
mov    -0x28(%rbp),%edx
movss  0xe8c(%rip),%xmm0
call   1040 <stdlib_strided_svariancewd@plt>
movss  %xmm0,-0x2c(%rbp)
movss  -0x2c(%rbp),%xmm0
lea    0xea6(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
movaps 0xef5(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xed9(%rip),%xmm0
movaps %xmm0,(%rsp)
movss  0xebd(%rip),%xmm0
mov    %rsp,%rsi
mov    $0x4,%edi
mov    $0x2,%edx
call   1040 <stdlib_strided_svariancewd@plt>
lea    0xed4(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
@__const.main.x = [8 x float] [float 1.000000e+00, float 2.000000e+00, float 3.000000e+00, float 4.000000e+00, float 5.000000e+00, float 6.000000e+00, float 7.000000e+00, float 8.000000e+00]
@.str = [21 x i8] c"sample variance: %f\0A\00"
define i32 @main() {
%1 = alloca [8 x float]
%2 = alloca i32
%3 = alloca i32
%4 = alloca float
%5 = bitcast [8 x float]* %1 to i8*
store i32 4, i32* %2
store i32 2, i32* %3
%6 = load i32, i32* %2
%7 = getelementptr inbounds [8 x float], [8 x float]* %1, i64 0, i64 0
%8 = load i32, i32* %3
%9 = call float @stdlib_strided_svariancewd(i32 %6, float 1.000000e+00, float* %7, i32 %8)
store float %9, float* %4
%10 = load float, float* %4
%11 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), float %10)
ret i32 0
}

LLVM IR (-O2):
@__const.main.x = [8 x float] [float 1.000000e+00, float 2.000000e+00, float 3.000000e+00, float 4.000000e+00, float 5.000000e+00, float 6.000000e+00, float 7.000000e+00, float 8.000000e+00]
@.str = [21 x i8] c"sample variance: %f\0A\00"
define i32 @main() {
%1 = alloca [8 x float]
%2 = bitcast [8 x float]* %1 to i8*
%3 = getelementptr inbounds [8 x float], [8 x float]* %1, i64 0, i64 0
%4 = call float @stdlib_strided_svariancewd(i32 4, float 1.000000e+00, float* %3, i32 2)
%5 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), float %4)
ret i32 0
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
extern uint32_t util_ToFromLE32(uint32_t val) {
  return ((val & 0xff) << 24) | ((val & 0xff00) << 8) |
         ((val & 0xff0000) >> 8) | ((val & 0xff000000) >> 24);
}


x86 assembly (clang, -O0):
<util_ToFromLE32>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xff,%eax
shl    $0x18,%eax
mov    -0x4(%rbp),%ecx
and    $0xff00,%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x4(%rbp),%ecx
and    $0xff0000,%ecx
sar    $0x8,%ecx
or     %ecx,%eax
mov    -0x4(%rbp),%ecx
and    $0xff000000,%ecx
shr    $0x18,%ecx
or     %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @util_ToFromLE32(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 255
%5 = shl i32 %4, 24
%6 = load i32, i32* %2
%7 = and i32 %6, 65280
%8 = shl i32 %7, 8
%9 = or i32 %5, %8
%10 = load i32, i32* %2
%11 = and i32 %10, 16711680
%12 = ashr i32 %11, 8
%13 = or i32 %9, %12
%14 = load i32, i32* %2
%15 = and i32 %14, -16777216
%16 = lshr i32 %15, 24
%17 = or i32 %13, %16
ret i32 %17
}

LLVM IR (-O2):
define i32 @util_ToFromLE32(i32 %0) {
%2 = tail call i32 @llvm.bswap.i32(i32 %0)
ret i32 %2
}
int test_imm_D5int64_highword_reg(long long val) {
  return ((val >> 32) & (0xD5 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_D5int64_highword_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
sar    $0x20,%rdx
and    $0xd5,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_D5int64_highword_reg>:
movabs $0xd500000000,%rax
test   %rax,%rdi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_D5int64_highword_reg(i64 %0) {
%2 = and i64 %0, 914828034048
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void *threadFunc(void *pArg) {
  int myNum = *((int *)pArg);
  printf("Thread number %d\n", myNum);
  return 0;
}


x86 assembly (clang, -O0):
<threadFunc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%esi
lea    0xed1(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [18 x i8] c"Thread number %d\0A\00"
define noalias i8* @threadFunc(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
%4 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i8* null
}
int LZ4_sizeofState() {
  return (((1 << (14 - 3)) + 4) * sizeof(unsigned long long));
}


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

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

LLVM IR (-O0):
define i32 @LZ4_sizeofState() {
ret i32 16416
}

LLVM IR (-O2):
define i32 @LZ4_sizeofState() {
ret i32 16416
}
int isalnum(int c) {
  return (((c >= 'a') && (c <= 'z')) || ((c >= 'A') && (c <= 'Z')) ||
          ((c >= '0') && (c <= '9')));
}


x86 assembly (clang, -O0):
<isalnum>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x61,-0x4(%rbp)
jl     1120 <isalnum+0x20>
mov    $0x1,%al
cmpl   $0x7a,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jle    1158 <isalnum+0x58>
cmpl   $0x41,-0x4(%rbp)
jl     1139 <isalnum+0x39>
mov    $0x1,%al
cmpl   $0x5a,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jle    1158 <isalnum+0x58>
xor    %eax,%eax
cmpl   $0x30,-0x4(%rbp)
mov    %al,-0x6(%rbp)
jl     1152 <isalnum+0x52>
cmpl   $0x39,-0x4(%rbp)
setle  %al
mov    %al,-0x6(%rbp)
mov    -0x6(%rbp),%al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isalnum>:
mov    %edi,%eax
and    $0xffffffdf,%eax
add    $0xffffffbf,%eax
cmp    $0x1a,%eax
setb   %al
add    $0xffffffd0,%edi
cmp    $0xa,%edi
setb   %cl
or     %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @isalnum(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 97
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 122
br i1 %7, label %22, label %8
8: ; preds = %5, %1
%9 = load i32, i32* %2
%10 = icmp sge i32 %9, 65
br i1 %10, label %11, label %14
11: ; preds = %8
%12 = load i32, i32* %2
%13 = icmp sle i32 %12, 90
br i1 %13, label %22, label %14
14: ; preds = %11, %8
%15 = load i32, i32* %2
%16 = icmp sge i32 %15, 48
br i1 %16, label %17, label %20
17: ; preds = %14
%18 = load i32, i32* %2
%19 = icmp sle i32 %18, 57
br label %20
20: ; preds = %17, %14
%21 = phi i1 [ false, %14 ], [ %19, %17 ]
br label %22
22: ; preds = %20, %11, %5
%23 = phi i1 [ true, %11 ], [ true, %5 ], [ %21, %20 ]
%24 = zext i1 %23 to i32
ret i32 %24
}

LLVM IR (-O2):
define i32 @isalnum(i32 %0) {
%2 = and i32 %0, -33
%3 = add i32 %2, -65
%4 = icmp ult i32 %3, 26
%5 = add i32 %0, -48
%6 = icmp ult i32 %5, 10
%7 = or i1 %6, %4
%8 = zext i1 %7 to i32
ret i32 %8
}
/* Variables and functions */
char *getenv(char *);
char *environ___NativeString_get_environ___impl(char *self) {
  return getenv(self);
}


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

x86 assembly (clang, -O2):
<environ___NativeString_get_environ___impl>:
jmp    1030 <getenv@plt>

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

LLVM IR (-O2):
define i8* @environ___NativeString_get_environ___impl(i8* nocapture %0) {
%2 = tail call i8* @getenv(i8* %0)
ret i8* %2
}
/* Variables and functions */
scalar_t__ malloc(size_t);
char *memcpy(char *, char const *, size_t);
int strlen(char const *);
char *strdup(const char *s) {
  size_t l = strlen(s) + 1;
  char *tmp = (char *)malloc(l);
  if (!tmp)
    return 0;
  return memcpy(tmp, s, l);
}


x86 assembly (clang, -O0):
<strdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
add    $0x1,%eax
cltq
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1050 <malloc@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    1173 <strdup+0x43>
movq   $0x0,-0x8(%rbp)
jmp    1188 <strdup+0x58>
mov    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1040 <memcpy@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strdup>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
call   1030 <strlen@plt>
add    $0x1,%eax
movslq %eax,%r15
mov    %r15,%rdi
call   1050 <malloc@plt>
test   %rax,%rax
je     1163 <strdup+0x33>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
call   1040 <memcpy@plt>
jmp    1165 <strdup+0x35>
xor    %ebx,%ebx
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i8* @strdup(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = add nsw i32 %2, 1
%4 = sext i32 %3 to i64
%5 = tail call i64 @malloc(i64 %4)
%6 = icmp eq i64 %5, 0
br i1 %6, label %9, label %7
7: ; preds = %1
%8 = inttoptr i64 %5 to i8*
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 %8, i8* align 1 %0, i64 %4, i1 false)
br label %9
9: ; preds = %1, %7
%10 = phi i8* [ %8, %7 ], [ null, %1 ]
ret i8* %10
}
int sys$disconnect(struct _fab *fab, void *err, void *suc) {
  return ({
    unsigned long resultvar;
    register long int _a3 asm("rdx") = (long)(suc);
    register long int _a2 asm("rsi") = (long)(err);
    register long int _a1 asm("rdi") = (long)(fab);
    asm volatile("movq %1, %%rax\n\t"
                 "int $0x82\n\t"
                 : "=a"(resultvar)
                 : "i"(5), "r"(_a1), "r"(_a2), "r"(_a3)
                 : "memory", "cc", "r11", "cx");
    (long)resultvar;
  });
}


x86 assembly (clang, -O0):
<sys$disconnect>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x38(%rbp),%rdi
mov    -0x30(%rbp),%rsi
mov    -0x28(%rbp),%rdx
mov    $0x5,%rax
int    $0x82
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x40(%rbp)
mov    -0x40(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sys$disconnect>:
mov    $0x5,%rax
int    $0x82
ret

LLVM IR (-O0):
%struct._fab = type opaque
define i32 @"sys$disconnect"(%struct._fab* %0, i8* %1, i8* %2) {
%4 = alloca %struct._fab*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i64
%8 = alloca i64
%9 = alloca i64
%10 = alloca i64
%11 = alloca i64
store %struct._fab* %0, %struct._fab** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%12 = load i8*, i8** %6
%13 = ptrtoint i8* %12 to i64
store i64 %13, i64* %8
%14 = load i8*, i8** %5
%15 = ptrtoint i8* %14 to i64
store i64 %15, i64* %9
%16 = load %struct._fab*, %struct._fab** %4
%17 = ptrtoint %struct._fab* %16 to i64
store i64 %17, i64* %10
%18 = load i64, i64* %10
%19 = load i64, i64* %9
%20 = load i64, i64* %8
%21 = call i64 asm sideeffect "movq $1, %rax\0A\09int $$0x82\0A\09", "={ax},i,{rdi},{rsi},{rdx},~{memory},~{cc},~{r11},~{cx},~{dirflag},~{fpsr},~{flags}"(i32 5, i64 %18, i64 %19, i64 %20)
store i64 %21, i64* %7
%22 = load i64, i64* %7
store i64 %22, i64* %11
%23 = load i64, i64* %11
%24 = trunc i64 %23 to i32
ret i32 %24
}

LLVM IR (-O2):
%struct._fab = type opaque
define i32 @"sys$disconnect"(%struct._fab* %0, i8* %1, i8* %2) {
%4 = ptrtoint i8* %2 to i64
%5 = ptrtoint i8* %1 to i64
%6 = ptrtoint %struct._fab* %0 to i64
%7 = tail call i64 asm sideeffect "movq $1, %rax\0A\09int $$0x82\0A\09", "={ax},i,{rdi},{rsi},{rdx},~{memory},~{cc},~{r11},~{cx},~{dirflag},~{fpsr},~{flags}"(i32 5, i64 %6, i64 %5, i64 %4)
%8 = trunc i64 %7 to i32
ret i32 %8
}
/* Type definitions */
struct timespec {
  double tv_nsec;
  scalar_t__ tv_sec;
};

/* Variables and functions */
int /*<<< orphan*/ CLOCK_REALTIME;
int /*<<< orphan*/ clock_gettime(int /*<<< orphan*/, struct timespec *);
double seconds_since_epoch() {
  struct timespec t;
  clock_gettime(CLOCK_REALTIME, &t);
  return (double)t.tv_sec + t.tv_nsec / 1000000000.0;
}


x86 assembly (clang, -O0):
<seconds_since_epoch>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ec1(%rip),%rax
mov    (%rax),%edi
lea    -0x10(%rbp),%rsi
call   1030 <clock_gettime@plt>
cvtsi2sdq -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  0xec3(%rip),%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<seconds_since_epoch>:
sub    $0x18,%rsp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0x8(%rsp),%rsi
call   1030 <clock_gettime@plt>
cvtsi2sdq 0x10(%rsp),%xmm1
movsd  0x8(%rsp),%xmm0
divsd  0xec4(%rip),%xmm0
addsd  %xmm1,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timespec = type { double, i64 }
@CLOCK_REALTIME = global i32 0
define double @seconds_since_epoch() {
%1 = alloca %struct.timespec
%2 = load i32, i32* @CLOCK_REALTIME
%3 = call i32 @clock_gettime(i32 %2, %struct.timespec* %1)
%4 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i32 0, i32 1
%5 = load i64, i64* %4
%6 = sitofp i64 %5 to double
%7 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i32 0, i32 0
%8 = load double, double* %7
%9 = fdiv double %8, 1.000000e+09
%10 = fadd double %6, %9
ret double %10
}

LLVM IR (-O2):
%struct.timespec = type { double, i64 }
@CLOCK_REALTIME = global i32 0
define double @seconds_since_epoch() {
%1 = alloca %struct.timespec
%2 = bitcast %struct.timespec* %1 to i8*
%3 = load i32, i32* @CLOCK_REALTIME
%4 = call i32 @clock_gettime(i32 %3, %struct.timespec* %1)
%5 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 1
%6 = load i64, i64* %5
%7 = sitofp i64 %6 to double
%8 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 0
%9 = load double, double* %8
%10 = fdiv double %9, 1.000000e+09
%11 = fadd double %10, %7
ret double %11
}
/* Variables and functions */
int /*<<< orphan*/ _IO(int, int);
int ioctl(int, int /*<<< orphan*/);
int cbmarch_reset(int f) { return ioctl(f, _IO(0xcb, 6)); }


x86 assembly (clang, -O0):
<cbmarch_reset>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    $0xcb,%edi
mov    $0x6,%esi
call   1030 <_IO@plt>
mov    -0x8(%rbp),%edi
mov    %eax,%esi
call   1040 <ioctl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cbmarch_reset>:
push   %rbx
mov    %edi,%ebx
mov    $0xcb,%edi
mov    $0x6,%esi
call   1030 <_IO@plt>
mov    %ebx,%edi
mov    %eax,%esi
pop    %rbx
jmp    1040 <ioctl@plt>

LLVM IR (-O0):
define i32 @cbmarch_reset(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @_IO(i32 203, i32 6)
%5 = call i32 @ioctl(i32 %3, i32 %4)
ret i32 %5
}

LLVM IR (-O2):
define i32 @cbmarch_reset(i32 %0) {
%2 = tail call i32 @_IO(i32 203, i32 6)
%3 = tail call i32 @ioctl(i32 %0, i32 %2)
ret i32 %3
}