xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ path_strip(char *);
int /*<<< orphan*/ remove_Cache_filename(char *);
int unlink(char *);
int unlink_file(char *filename) {
  if (filename == NULL || !*filename)
    return -1;
  path_strip(filename);
  remove_Cache_filename(filename);
  return unlink(filename);
}


x86 assembly (clang, -O0):
<unlink_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1154 <unlink_file+0x24>
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
jne    1160 <unlink_file+0x30>
movl   $0xffffffff,-0x4(%rbp)
jmp    117e <unlink_file+0x4e>
mov    -0x10(%rbp),%rdi
call   1040 <path_strip@plt>
mov    -0x10(%rbp),%rdi
call   1050 <remove_Cache_filename@plt>
mov    -0x10(%rbp),%rdi
call   1030 <unlink@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<unlink_file>:
push   %rbx
test   %rdi,%rdi
je     1157 <unlink_file+0x27>
mov    %rdi,%rbx
cmpb   $0x0,(%rdi)
je     1157 <unlink_file+0x27>
mov    %rbx,%rdi
call   1040 <path_strip@plt>
mov    %rbx,%rdi
call   1050 <remove_Cache_filename@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <unlink@plt>
mov    $0xffffffff,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @unlink_file(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %10, label %3
3: ; preds = %1
%4 = load i8, i8* %0
%5 = icmp eq i8 %4, 0
br i1 %5, label %10, label %6
6: ; preds = %3
%7 = tail call i32 @path_strip(i8* %0)
%8 = tail call i32 @remove_Cache_filename(i8* %0)
%9 = tail call i32 @unlink(i8* %0)
br label %10
10: ; preds = %1, %3, %6
%11 = phi i32 [ %9, %6 ], [ -1, %3 ], [ -1, %1 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  int my_var = 2;
  printf("Hello world\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x2,-0x8(%rbp)
lea    0xed3(%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 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@str = [12 x i8] c"Hello world\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
ret i32 0
}
unsigned int _check_times(unsigned x, unsigned y) {
  unsigned long long whole_ans =
      ((unsigned long long)x) * ((unsigned long long)y);
  unsigned word_ans = (unsigned)whole_ans;
  if (word_ans < whole_ans || word_ans > (1 << 28))
    (_throw_badalloc_fn("/scratch/repos/new/home/jordi_armengol_estape/"
                        "c-scraper/outputs/2022-01-22/02-19-57/repos/FauxFaux/"
                        "cyclone/refs/heads/master/bin/genfiles/precore_c.h",
                        283));
  return word_ans;
}


x86 assembly (clang, -O0):
<_check_times>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
imul   %rcx,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x10(%rbp),%rax
jb     114d <_check_times+0x3d>
cmpl   $0x10000000,-0x14(%rbp)
jbe    1160 <_check_times+0x50>
lea    0xeac(%rip),%rdi
mov    $0x11b,%esi
mov    $0x0,%al
call   1030 <_throw_badalloc_fn@plt>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_check_times>:
push   %rbx
mov    %edi,%eax
mul    %esi
mov    %eax,%ebx
jo     1121 <_check_times+0x11>
cmp    $0x10000001,%ebx
jb     1134 <_check_times+0x24>
lea    0xed8(%rip),%rdi
mov    $0x11b,%esi
xor    %eax,%eax
call   1030 <_throw_badalloc_fn@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [150 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/FauxFaux/cyclone/refs/heads/master/bin/genfiles/precore_c.h\00"
define i32 @_check_times(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i64
%6 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%7 = load i32, i32* %3
%8 = zext i32 %7 to i64
%9 = load i32, i32* %4
%10 = zext i32 %9 to i64
%11 = mul i64 %8, %10
store i64 %11, i64* %5
%12 = load i64, i64* %5
%13 = trunc i64 %12 to i32
store i32 %13, i32* %6
%14 = load i32, i32* %6
%15 = zext i32 %14 to i64
%16 = load i64, i64* %5
%17 = icmp ult i64 %15, %16
br i1 %17, label %21, label %18
18: ; preds = %2
%19 = load i32, i32* %6
%20 = icmp ugt i32 %19, 268435456
br i1 %20, label %21, label %23
21: ; preds = %18, %2
%22 = call i32 (i8*, i32, ...) bitcast (i32 (...)* @_throw_badalloc_fn to i32 (i8*, i32, ...)*)(i8* getelementptr inbounds ([150 x i8], [150 x i8]* @.str, i64 0, i64 0), i32 283)
br label %23
23: ; preds = %21, %18
%24 = load i32, i32* %6
ret i32 %24
}

LLVM IR (-O2):
@.str = [150 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/FauxFaux/cyclone/refs/heads/master/bin/genfiles/precore_c.h\00"
define i32 @_check_times(i32 %0, i32 %1) {
%3 = tail call { i32, i1 } @llvm.umul.with.overflow.i32(i32 %0, i32 %1)
%4 = extractvalue { i32, i1 } %3, 0
%5 = extractvalue { i32, i1 } %3, 1
%6 = icmp ugt i32 %4, 268435456
%7 = or i1 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = tail call i32 (i8*, i32, ...) bitcast (i32 (...)* @_throw_badalloc_fn to i32 (i8*, i32, ...)*)(i8* getelementptr inbounds ([150 x i8], [150 x i8]* @.str, i64 0, i64 0), i32 283)
br label %10
10: ; preds = %2, %8
ret i32 %4
}
void fc56(int n) {
  {
    typedef int(*b)[n];
    {
      typedef int(*c)[n];
      0;
    }
    goto a;
    {
      typedef int(*d)[n];
      0;
    }
  a:;
    typedef int(*e)[n];
    0;
  };
  {
    typedef int(*f)[n];
    {
      typedef int(*g)[n];
      0;
    };
    {
      typedef int(*h)[n];
      0;
    };
    ;
    typedef int(*i)[n];
    0;
  };
  ;
  typedef int(*j)[n];
  0;
}


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

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

LLVM IR (-O0):
define void @fc56(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = zext i32 %3 to i64
%5 = load i32, i32* %2
%6 = zext i32 %5 to i64
br label %10
7: ; No predecessors!
%8 = load i32, i32* %2
%9 = zext i32 %8 to i64
br label %10
10: ; preds = %7, %1
%11 = load i32, i32* %2
%12 = zext i32 %11 to i64
%13 = load i32, i32* %2
%14 = zext i32 %13 to i64
%15 = load i32, i32* %2
%16 = zext i32 %15 to i64
%17 = load i32, i32* %2
%18 = zext i32 %17 to i64
%19 = load i32, i32* %2
%20 = zext i32 %19 to i64
%21 = load i32, i32* %2
%22 = zext i32 %21 to i64
ret void
}

LLVM IR (-O2):
define void @fc56(i32 %0) {
ret void
}
int isprint(int c) {
  return (int)((((unsigned)c) >= ' ') && (((unsigned)c) <= (unsigned)'~'));
}


x86 assembly (clang, -O0):
<isprint>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x20,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jb     1120 <isprint+0x20>
cmpl   $0x7e,-0x4(%rbp)
setbe  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isprint>:
add    $0xffffffe0,%edi
xor    %eax,%eax
cmp    $0x5f,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @isprint(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp uge i32 %3, 32
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp ule i32 %6, 126
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ false, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @isprint(i32 %0) {
%2 = add i32 %0, -32
%3 = icmp ult i32 %2, 95
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
void Platform_Exit(int code) { exit(code); }


x86 assembly (clang, -O0):
<Platform_Exit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<Platform_Exit>:
push   %rax
call   1030 <exit@plt>

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

LLVM IR (-O2):
define void @Platform_Exit(i32 %0) {
%2 = tail call i32 @exit(i32 %0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void callback() { printf("test callback"); }


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

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

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

LLVM IR (-O2):
@.str = [14 x i8] c"test callback\00"
define void @callback() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret void
}
int test_imm_44int64_midword_mem(long long *val) {
  return ((*val >> 16) & (0x44 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_44int64_midword_mem>:
testb  $0x44,0x2(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_44int64_midword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 4456448
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ g(char *const, char const *, char *);
f(char *arg) {
  char *const kp = arg;
  const char *ks = arg;
  char *s = ks;
  g(kp, ks, s);
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    -0x28(%rbp),%rdx
call   1030 <g@plt>
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
mov    %rdi,%rsi
mov    %rdi,%rdx
jmp    1030 <g@plt>

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

LLVM IR (-O2):
define i32 @f(i8* %0) {
%2 = tail call i32 @g(i8* %0, i8* %0, i8* %0)
ret i32 undef
}
void removeRightWall(int (*maze)[13], int startRow, int startCol) {
  int removeRow, removeCol;
  removeCol = (startCol + 1) * 2;
  removeRow = (startRow)*2 - 1 + 2;
  maze[removeRow][removeCol] = 0;
}


x86 assembly (clang, -O0):
<removeRightWall>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
shl    $0x1,%eax
mov    %eax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
shl    $0x1,%eax
sub    $0x1,%eax
add    $0x2,%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
imul   $0x34,%rcx,%rcx
add    %rcx,%rax
movslq -0x18(%rbp),%rcx
movl   $0x0,(%rax,%rcx,4)
pop    %rbp
ret

x86 assembly (clang, -O2):
<removeRightWall>:
lea    (%rdx,%rdx,1),%eax
add    $0x2,%eax
lea    (%rsi,%rsi,1),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
cltq
imul   $0x34,%rcx,%rcx
add    %rdi,%rcx
movl   $0x0,(%rcx,%rax,4)
ret

LLVM IR (-O0):
define void @removeRightWall([13 x i32]* %0, i32 %1, i32 %2) {
%4 = alloca [13 x i32]*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store [13 x i32]* %0, [13 x i32]** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%9 = load i32, i32* %6
%10 = add nsw i32 %9, 1
%11 = mul nsw i32 %10, 2
store i32 %11, i32* %8
%12 = load i32, i32* %5
%13 = mul nsw i32 %12, 2
%14 = sub nsw i32 %13, 1
%15 = add nsw i32 %14, 2
store i32 %15, i32* %7
%16 = load [13 x i32]*, [13 x i32]** %4
%17 = load i32, i32* %7
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds [13 x i32], [13 x i32]* %16, i64 %18
%20 = load i32, i32* %8
%21 = sext i32 %20 to i64
%22 = getelementptr inbounds [13 x i32], [13 x i32]* %19, i64 0, i64 %21
store i32 0, i32* %22
ret void
}

LLVM IR (-O2):
define void @removeRightWall([13 x i32]* nocapture writeonly %0, i32 %1, i32 %2) {
%4 = shl i32 %2, 1
%5 = add i32 %4, 2
%6 = shl nsw i32 %1, 1
%7 = or i32 %6, 1
%8 = sext i32 %7 to i64
%9 = sext i32 %5 to i64
%10 = getelementptr inbounds [13 x i32], [13 x i32]* %0, i64 %8, i64 %9
store i32 0, i32* %10
ret void
}
void EC_GFp_simple_method(void) {}


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

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

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

LLVM IR (-O2):
define void @EC_GFp_simple_method() {
ret void
}
void set_uint24(unsigned char *buf, int block, int value) {
  buf[block * 3 + 0] = (value & 0xff0000) >> 16;
  buf[block * 3 + 1] = (value & 0x00ff00) >> 8;
  buf[block * 3 + 2] = value & 0x0000ff;
}


x86 assembly (clang, -O0):
<set_uint24>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x10(%rbp),%eax
and    $0xff0000,%eax
sar    $0x10,%eax
mov    %al,%dl
mov    -0x8(%rbp),%rax
imul   $0x3,-0xc(%rbp),%ecx
add    $0x0,%ecx
movslq %ecx,%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x10(%rbp),%eax
and    $0xff00,%eax
sar    $0x8,%eax
mov    %al,%dl
mov    -0x8(%rbp),%rax
imul   $0x3,-0xc(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x10(%rbp),%eax
and    $0xff,%eax
mov    %al,%dl
mov    -0x8(%rbp),%rax
imul   $0x3,-0xc(%rbp),%ecx
add    $0x2,%ecx
movslq %ecx,%rcx
mov    %dl,(%rax,%rcx,1)
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_uint24>:
mov    %edx,%eax
shr    $0x10,%eax
movslq %esi,%rcx
lea    (%rcx,%rcx,2),%rcx
mov    %al,(%rdi,%rcx,1)
mov    %dh,0x1(%rdi,%rcx,1)
mov    %dl,0x2(%rdi,%rcx,1)
ret

LLVM IR (-O0):
define void @set_uint24(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %6
%8 = and i32 %7, 16711680
%9 = ashr i32 %8, 16
%10 = trunc i32 %9 to i8
%11 = load i8*, i8** %4
%12 = load i32, i32* %5
%13 = mul nsw i32 %12, 3
%14 = add nsw i32 %13, 0
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i8, i8* %11, i64 %15
store i8 %10, i8* %16
%17 = load i32, i32* %6
%18 = and i32 %17, 65280
%19 = ashr i32 %18, 8
%20 = trunc i32 %19 to i8
%21 = load i8*, i8** %4
%22 = load i32, i32* %5
%23 = mul nsw i32 %22, 3
%24 = add nsw i32 %23, 1
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds i8, i8* %21, i64 %25
store i8 %20, i8* %26
%27 = load i32, i32* %6
%28 = and i32 %27, 255
%29 = trunc i32 %28 to i8
%30 = load i8*, i8** %4
%31 = load i32, i32* %5
%32 = mul nsw i32 %31, 3
%33 = add nsw i32 %32, 2
%34 = sext i32 %33 to i64
%35 = getelementptr inbounds i8, i8* %30, i64 %34
store i8 %29, i8* %35
ret void
}

LLVM IR (-O2):
define void @set_uint24(i8* nocapture writeonly %0, i32 %1, i32 %2) {
%4 = lshr i32 %2, 16
%5 = trunc i32 %4 to i8
%6 = mul nsw i32 %1, 3
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds i8, i8* %0, i64 %7
store i8 %5, i8* %8
%9 = lshr i32 %2, 8
%10 = trunc i32 %9 to i8
%11 = add nsw i32 %6, 1
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds i8, i8* %0, i64 %12
store i8 %10, i8* %13
%14 = trunc i32 %2 to i8
%15 = add nsw i32 %6, 2
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds i8, i8* %0, i64 %16
store i8 %14, i8* %17
ret void
}
/* Variables and functions */
int /*<<< orphan*/ perror(char *);
int read(int, char *, int);
int uds_read(int connection_fd, char *out, int size) {
  int nbytes;
  nbytes = read(connection_fd, out, size);
  if (nbytes < 0) {
    perror("read failed");
    return -1;
  }
  return nbytes;
}


x86 assembly (clang, -O0):
<uds_read>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <read@plt>
mov    %eax,-0x18(%rbp)
cmpl   $0x0,-0x18(%rbp)
jge    1166 <uds_read+0x46>
lea    0xeab(%rip),%rdi
call   1040 <perror@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    116c <uds_read+0x4c>
mov    -0x18(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uds_read>:
push   %rax
call   1030 <read@plt>
test   %eax,%eax
js     112c <uds_read+0xc>
pop    %rcx
ret
lea    0xecd(%rip),%rdi
call   1040 <perror@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [12 x i8] c"read failed\00"
define i32 @uds_read(i32 %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %5
store i8* %1, i8** %6
store i32 %2, i32* %7
%9 = load i32, i32* %5
%10 = load i8*, i8** %6
%11 = load i32, i32* %7
%12 = call i32 @read(i32 %9, i8* %10, i32 %11)
store i32 %12, i32* %8
%13 = load i32, i32* %8
%14 = icmp slt i32 %13, 0
br i1 %14, label %15, label %17
15: ; preds = %3
%16 = call i32 @perror(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
store i32 -1, i32* %4
br label %19
17: ; preds = %3
%18 = load i32, i32* %8
store i32 %18, i32* %4
br label %19
19: ; preds = %17, %15
%20 = load i32, i32* %4
ret i32 %20
}

LLVM IR (-O2):
@.str = [12 x i8] c"read failed\00"
define i32 @uds_read(i32 %0, i8* nocapture %1, i32 %2) {
%4 = tail call i32 @read(i32 %0, i8* %1, i32 %2)
%5 = icmp slt i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %3
%7 = tail call i32 @perror(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %3, %6
%9 = phi i32 [ -1, %6 ], [ %4, %3 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ _cause(int);
void _cause_cpu() { _cause(7); }


x86 assembly (clang, -O0):
<_cause_cpu>:
push   %rbp
mov    %rsp,%rbp
mov    $0x7,%edi
call   1030 <_cause@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<_cause_cpu>:
mov    $0x7,%edi
jmp    1030 <_cause@plt>

LLVM IR (-O0):
define void @_cause_cpu() {
%1 = call i32 @_cause(i32 7)
ret void
}

LLVM IR (-O2):
define void @_cause_cpu() {
%1 = tail call i32 @_cause(i32 7)
ret void
}
int assaltolecito(int PosT, int PosC) {
  int x = PosT % 150 - PosC % 150;
  int y = PosT / 150 - PosC / 150;
  if (x * x + y * y <= 1)
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<assaltolecito>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x96,%ecx
cltd
idiv   %ecx
mov    %edx,-0x1c(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x96,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
mov    -0x1c(%rbp),%edx
sub    %eax,%edx
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x96,%ecx
cltd
idiv   %ecx
mov    %eax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x96,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x18(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%eax
imul   -0x10(%rbp),%eax
mov    -0x14(%rbp),%ecx
imul   -0x14(%rbp),%ecx
add    %ecx,%eax
cmp    $0x1,%eax
jg     1175 <assaltolecito+0x75>
movl   $0x1,-0x4(%rbp)
jmp    117c <assaltolecito+0x7c>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<assaltolecito>:
movslq %esi,%rcx
imul   $0x1b4e81b5,%rcx,%rax
mov    %rax,%rdx
shr    $0x3f,%rdx
sar    $0x24,%rax
add    %edx,%eax
imul   $0x96,%eax,%edx
sub    %ecx,%edx
movslq %edi,%rax
imul   $0x1b4e81b5,%rax,%rsi
mov    %rsi,%rdi
shr    $0x3f,%rdi
sar    $0x24,%rsi
add    %edi,%esi
imul   $0x96,%esi,%edi
sub    %edi,%eax
add    %edx,%eax
imul   $0xffffffffe4b17e4b,%rcx,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x24,%rcx
add    %edx,%ecx
add    %esi,%ecx
imul   %eax,%eax
imul   %ecx,%ecx
add    %eax,%ecx
xor    %eax,%eax
cmp    $0x2,%ecx
setb   %al
ret

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

LLVM IR (-O2):
define i32 @assaltolecito(i32 %0, i32 %1) {
%3 = srem i32 %0, 150
%4 = srem i32 %1, 150
%5 = sub nsw i32 %3, %4
%6 = sdiv i32 %0, 150
%7 = sdiv i32 %1, -150
%8 = add nsw i32 %7, %6
%9 = mul nsw i32 %5, %5
%10 = mul nsw i32 %8, %8
%11 = add nuw nsw i32 %9, %10
%12 = icmp ult i32 %11, 2
%13 = zext i1 %12 to i32
ret i32 %13
}
void enable_yacc_debug() {}


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

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

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

LLVM IR (-O2):
define void @enable_yacc_debug() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ diag(char *, int, int);
int /*<<< orphan*/ fail(char const *);
int /*<<< orphan*/ pass(char const *);
void is(int got, int expected, const char *description) {
  if (got == expected)
    pass(description);
  else {
    fail(description);
    diag("got %d but expected %d", got, expected);
  }
}


x86 assembly (clang, -O0):
<is>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jne    115c <is+0x2c>
mov    -0x10(%rbp),%rdi
call   1040 <pass@plt>
jmp    1177 <is+0x47>
mov    -0x10(%rbp),%rdi
call   1030 <fail@plt>
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xe8e(%rip),%rdi
call   1050 <diag@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is>:
cmp    %esi,%edi
jne    113c <is+0xc>
mov    %rdx,%rdi
jmp    1040 <pass@plt>
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
mov    %rdx,%rdi
call   1030 <fail@plt>
lea    0xeae(%rip),%rdi
mov    %ebp,%esi
mov    %ebx,%edx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1050 <diag@plt>

LLVM IR (-O0):
@.str = [23 x i8] c"got %d but expected %d\00"
define void @is(i32 %0, i32 %1, i8* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8*
store i32 %0, i32* %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%7 = load i32, i32* %4
%8 = load i32, i32* %5
%9 = icmp eq i32 %7, %8
br i1 %9, label %10, label %13
10: ; preds = %3
%11 = load i8*, i8** %6
%12 = call i32 @pass(i8* %11)
br label %19
13: ; preds = %3
%14 = load i8*, i8** %6
%15 = call i32 @fail(i8* %14)
%16 = load i32, i32* %4
%17 = load i32, i32* %5
%18 = call i32 @diag(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 %16, i32 %17)
br label %19
19: ; preds = %13, %10
ret void
}

LLVM IR (-O2):
@.str = [23 x i8] c"got %d but expected %d\00"
define void @is(i32 %0, i32 %1, i8* %2) {
%4 = icmp eq i32 %0, %1
br i1 %4, label %5, label %7
5: ; preds = %3
%6 = tail call i32 @pass(i8* %2)
br label %10
7: ; preds = %3
%8 = tail call i32 @fail(i8* %2)
%9 = tail call i32 @diag(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1)
br label %10
10: ; preds = %7, %5
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ system(char *);
int rp_app_exit(void) {
  fprintf(stderr, "Stopping HPSDR transceiver server.\n");
  system("/opt/redpitaya/www/apps/sdr_transceiver_hpsdr/stop.sh");
  return 0;
}


x86 assembly (clang, -O0):
<rp_app_exit>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1040 <fprintf@plt>
lea    0xee4(%rip),%rdi
call   1030 <system@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rp_app_exit>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1040 <fprintf@plt>
lea    0xee7(%rip),%rdi
call   1030 <system@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [36 x i8] c"Stopping HPSDR transceiver server.\0A\00"
@.str.1 = [54 x i8] c"/opt/redpitaya/www/apps/sdr_transceiver_hpsdr/stop.sh\00"
define i32 @rp_app_exit() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @system(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [36 x i8] c"Stopping HPSDR transceiver server.\0A\00"
@.str.1 = [54 x i8] c"/opt/redpitaya/www/apps/sdr_transceiver_hpsdr/stop.sh\00"
define i32 @rp_app_exit() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @system(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
typedef int dev_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
dev_t makedev(int maj, int min) {
  printf(">>> makedev, maj - %d, min - %d\n", maj, min);
  return -1;
}


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

x86 assembly (clang, -O2):
<makedev>:
push   %rax
mov    %esi,%edx
mov    %edi,%esi
lea    0xee4(%rip),%rdi
call   1030 <printf@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [33 x i8] c">>> makedev, maj - %d, min - %d\0A\00"
define i32 @makedev(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 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i32 %5, i32 %6)
ret i32 -1
}

LLVM IR (-O2):
@.str = [33 x i8] c">>> makedev, maj - %d, min - %d\0A\00"
define i32 @makedev(i32 %0, i32 %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1)
ret i32 -1
}
/* Type definitions */
typedef scalar_t__ uint64_t;

/* Variables and functions */
scalar_t__ timer_getTickCount();
void timer_wait(uint64_t us) {
  us += timer_getTickCount();
  while (timer_getTickCount() < us) {
  };
}


x86 assembly (clang, -O0):
<timer_wait>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <timer_getTickCount@plt>
add    -0x8(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    $0x0,%al
call   1030 <timer_getTickCount@plt>
cmp    -0x8(%rbp),%rax
jge    1141 <timer_wait+0x31>
jmp    112b <timer_wait+0x1b>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<timer_wait>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
xor    %eax,%eax
call   1030 <timer_getTickCount@plt>
mov    %rax,%rbx
add    %r14,%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
xor    %eax,%eax
call   1030 <timer_getTickCount@plt>
cmp    %rbx,%rax
jl     1130 <timer_wait+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @timer_wait(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = call i64 (...) @timer_getTickCount()
%4 = load i64, i64* %2
%5 = add nsw i64 %4, %3
store i64 %5, i64* %2
br label %6
6: ; preds = %10, %1
%7 = call i64 (...) @timer_getTickCount()
%8 = load i64, i64* %2
%9 = icmp slt i64 %7, %8
br i1 %9, label %10, label %11
10: ; preds = %6
br label %6
11: ; preds = %6
ret void
}

LLVM IR (-O2):
define void @timer_wait(i64 %0) {
%2 = tail call i64 (...) @timer_getTickCount()
%3 = add nsw i64 %2, %0
br label %4
4: ; preds = %4, %1
%5 = tail call i64 (...) @timer_getTickCount()
%6 = icmp slt i64 %5, %3
br i1 %6, label %4, label %7
7: ; preds = %4
ret void
}
int ShrTest9(int Y, int X, unsigned C) { return (Y + (X >> C)) << C; }


x86 assembly (clang, -O0):
<ShrTest9>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%edx
mov    -0xc(%rbp),%ecx
sar    %cl,%edx
mov    %edx,%ecx
add    %ecx,%eax
mov    -0xc(%rbp),%ecx
shl    %cl,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ShrTest9>:
mov    %edx,%ecx
sar    %cl,%esi
lea    (%rsi,%rdi,1),%eax
shl    %cl,%eax
ret

LLVM IR (-O0):
define i32 @ShrTest9(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = ashr i32 %8, %9
%11 = add nsw i32 %7, %10
%12 = load i32, i32* %6
%13 = shl i32 %11, %12
ret i32 %13
}

LLVM IR (-O2):
define i32 @ShrTest9(i32 %0, i32 %1, i32 %2) {
%4 = ashr i32 %1, %2
%5 = add nsw i32 %4, %0
%6 = shl i32 %5, %2
ret i32 %6
}
/* Variables and functions */
int pigpio_command(int, int, int /*<<< orphan*/, int /*<<< orphan*/, int);
int wave_get_micros(int pi) { return pigpio_command(pi, 34, 0, 0, 1); }


x86 assembly (clang, -O0):
<wave_get_micros>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x22,%esi
xor    %ecx,%ecx
mov    $0x1,%r8d
mov    %ecx,%edx
call   1030 <pigpio_command@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wave_get_micros>:
mov    $0x22,%esi
xor    %edx,%edx
xor    %ecx,%ecx
mov    $0x1,%r8d
jmp    1030 <pigpio_command@plt>

LLVM IR (-O0):
define i32 @wave_get_micros(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @pigpio_command(i32 %3, i32 34, i32 0, i32 0, i32 1)
ret i32 %4
}

LLVM IR (-O2):
define i32 @wave_get_micros(i32 %0) {
%2 = tail call i32 @pigpio_command(i32 %0, i32 34, i32 0, i32 0, i32 1)
ret i32 %2
}
void sigalrm(int sig) {}


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

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

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

LLVM IR (-O2):
define void @sigalrm(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ pushNarray(char *, unsigned int);
void pushreal16array(void *x, int n) {
  pushNarray((char *)x, (unsigned int)(n * 16));
}


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

x86 assembly (clang, -O2):
<pushreal16array>:
shl    $0x4,%esi
jmp    1030 <pushNarray@plt>

LLVM IR (-O0):
define void @pushreal16array(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 = mul nsw i32 %6, 16
%8 = call i32 @pushNarray(i8* %5, i32 %7)
ret void
}

LLVM IR (-O2):
define void @pushreal16array(i8* %0, i32 %1) {
%3 = shl nsw i32 %1, 4
%4 = tail call i32 @pushNarray(i8* %0, i32 %3)
ret void
}
/* Variables and functions */
scalar_t__ sqrt(double);
float __sqrtf(float x) { return ((float)sqrt((double)x)); }


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

x86 assembly (clang, -O2):
<__sqrtf>:
push   %rax
cvtss2sd %xmm0,%xmm0
call   1030 <sqrt@plt>
xorps  %xmm0,%xmm0
cvtsi2ss %rax,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @__sqrtf(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fpext float %3 to double
%5 = call i64 @sqrt(double %4)
%6 = sitofp i64 %5 to float
ret float %6
}

LLVM IR (-O2):
define float @__sqrtf(float %0) {
%2 = fpext float %0 to double
%3 = tail call i64 @sqrt(double %2)
%4 = sitofp i64 %3 to float
ret float %4
}
int main(void) {
  int *pNumber = malloc(10 * sizeof(int));
  printf("pNumber is %X\n", pNumber);
  printf("&pNumber is %X\n", &pNumber);
  printf("*pNumber is %X\n", *pNumber);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x28,%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
lea    0xeb9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeaa(%rip),%rdi
lea    -0x10(%rbp),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%rax
mov    (%rax),%esi
lea    0xea2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x28,%edi
call   1040 <malloc@plt>
mov    %rax,(%rsp)
lea    0xecb(%rip),%rdi
mov    %rax,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xeb9(%rip),%rdi
mov    %rsp,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
mov    (%rsp),%rax
mov    (%rax),%esi
lea    0xeb2(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [15 x i8] c"pNumber is %X\0A\00"
@.str.1 = [16 x i8] c"&pNumber is %X\0A\00"
@.str.2 = [16 x i8] c"*pNumber is %X\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
store i32 0, i32* %1
%3 = call i8* @malloc(i64 40)
%4 = bitcast i8* %3 to i32*
store i32* %4, i32** %2
%5 = load i32*, i32** %2
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32* %5)
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i32** %2)
%8 = load i32*, i32** %2
%9 = load i32, i32* %8
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), i32 %9)
ret i32 0
}

LLVM IR (-O2):
@.str = [15 x i8] c"pNumber is %X\0A\00"
@.str.1 = [16 x i8] c"&pNumber is %X\0A\00"
@.str.2 = [16 x i8] c"*pNumber is %X\0A\00"
define i32 @main() {
%1 = alloca i32*
%2 = bitcast i32** %1 to i8*
%3 = tail call dereferenceable_or_null(40) i8* @malloc(i64 40)
%4 = bitcast i32** %1 to i8**
store i8* %3, i8** %4
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %3)
%6 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i32** %1)
%7 = load i32*, i32** %1
%8 = load i32, i32* %7
%9 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), i32 %8)
ret i32 0
}
void ff_hevc_put_hevc_uni_epel_hv16_8_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_uni_epel_hv16_8_sse4() {
ret void
}
char shift_register15(unsigned char xor_tap) {
  static unsigned int sreg = 0x4000;
  int bit0, tap, bit14;
  bit0 = sreg & 1;
  tap = (sreg & xor_tap) ? 1 : 0;
  bit14 = (bit0 ^ tap);
  sreg >>= 1;
  sreg |= (bit14 << 14);
  return bit0 ^ 1;
}


x86 assembly (clang, -O0):
<shift_register15>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    0x2f10(%rip),%eax
and    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    0x2f04(%rip),%edx
movzbl -0x1(%rbp),%eax
and    %eax,%edx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
xor    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    0x2edf(%rip),%eax
shr    $0x1,%eax
mov    %eax,0x2ed6(%rip)
mov    -0x10(%rbp),%eax
shl    $0xe,%eax
or     0x2eca(%rip),%eax
mov    %eax,0x2ec4(%rip)
mov    -0x8(%rbp),%eax
xor    $0x1,%eax
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<shift_register15>:
mov    0x2f1a(%rip),%ecx
mov    %ecx,%eax
and    $0x1,%eax
xor    %edx,%edx
test   %edi,%ecx
setne  %dl
xor    %eax,%edx
shr    %ecx
shl    $0xe,%edx
or     %ecx,%edx
mov    %edx,0x2eff(%rip)
xor    $0x1,%al
ret

LLVM IR (-O0):
@shift_register15.sreg = internal global i32 16384
define signext i8 @shift_register15(i8 zeroext %0) {
%2 = alloca i8
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i8 %0, i8* %2
%6 = load i32, i32* @shift_register15.sreg
%7 = and i32 %6, 1
store i32 %7, i32* %3
%8 = load i32, i32* @shift_register15.sreg
%9 = load i8, i8* %2
%10 = zext i8 %9 to i32
%11 = and i32 %8, %10
%12 = icmp ne i32 %11, 0
%13 = zext i1 %12 to i64
%14 = select i1 %12, i32 1, i32 0
store i32 %14, i32* %4
%15 = load i32, i32* %3
%16 = load i32, i32* %4
%17 = xor i32 %15, %16
store i32 %17, i32* %5
%18 = load i32, i32* @shift_register15.sreg
%19 = lshr i32 %18, 1
store i32 %19, i32* @shift_register15.sreg
%20 = load i32, i32* %5
%21 = shl i32 %20, 14
%22 = load i32, i32* @shift_register15.sreg
%23 = or i32 %22, %21
store i32 %23, i32* @shift_register15.sreg
%24 = load i32, i32* %3
%25 = xor i32 %24, 1
%26 = trunc i32 %25 to i8
ret i8 %26
}

LLVM IR (-O2):
@shift_register15.sreg = internal unnamed_addr global i32 16384
define signext i8 @shift_register15(i8 zeroext %0) {
%2 = load i32, i32* @shift_register15.sreg
%3 = and i32 %2, 1
%4 = zext i8 %0 to i32
%5 = and i32 %2, %4
%6 = icmp ne i32 %5, 0
%7 = zext i1 %6 to i32
%8 = xor i32 %3, %7
%9 = lshr i32 %2, 1
%10 = shl nuw nsw i32 %8, 14
%11 = or i32 %10, %9
store i32 %11, i32* @shift_register15.sreg
%12 = trunc i32 %3 to i8
%13 = xor i8 %12, 1
ret i8 %13
}
/* Variables and functions */
int /*<<< orphan*/ sleep(int);
void take_so_long_that_ctrl_c_is_needed() { sleep(10); }


x86 assembly (clang, -O0):
<take_so_long_that_ctrl_c_is_needed>:
push   %rbp
mov    %rsp,%rbp
mov    $0xa,%edi
call   1030 <sleep@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<take_so_long_that_ctrl_c_is_needed>:
mov    $0xa,%edi
jmp    1030 <sleep@plt>

LLVM IR (-O0):
define void @take_so_long_that_ctrl_c_is_needed() {
%1 = call i32 @sleep(i32 10)
ret void
}

LLVM IR (-O2):
define void @take_so_long_that_ctrl_c_is_needed() {
%1 = tail call i32 @sleep(i32 10)
ret void
}
int el_create_bound(int UNUSED_len __attribute__((__unused__))) { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @el_create_bound(i32 %0) {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ errx(int, char *);
void *malloc(size_t);
void *xmalloc(size_t sz) {
  void *ret = malloc(sz);
  if (!ret)
    errx(1, "Malloc failed");
  return ret;
}


x86 assembly (clang, -O0):
<xmalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1155 <xmalloc+0x35>
mov    $0x1,%edi
lea    0xeb0(%rip),%rsi
call   1030 <errx@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmalloc>:
push   %rbx
call   1040 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    113f <xmalloc+0x1f>
lea    0xecb(%rip),%rsi
mov    $0x1,%edi
call   1030 <errx@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"Malloc failed\00"
define i8* @xmalloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %10, label %8
8: ; preds = %1
%9 = call i32 @errx(i32 1, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %8, %1
%11 = load i8*, i8** %3
ret i8* %11
}

LLVM IR (-O2):
@.str = [14 x i8] c"Malloc failed\00"
define noalias i8* @xmalloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @errx(i32 1, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %1
ret i8* %2
}
/* Variables and functions */
char EOF;
scalar_t__ isspace(char);
int is_whitespace(char c) { return c != EOF && isspace(c); }


x86 assembly (clang, -O0):
<is_whitespace>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
mov    0x2ebf(%rip),%rax
movsbl (%rax),%edx
xor    %eax,%eax
cmp    %edx,%ecx
mov    %al,-0x2(%rbp)
je     114c <is_whitespace+0x3c>
movsbl -0x1(%rbp),%edi
call   1030 <isspace@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_whitespace>:
push   %rax
mov    0x2ed0(%rip),%rcx
xor    %eax,%eax
cmp    %dil,(%rcx)
je     1133 <is_whitespace+0x23>
movsbl %dil,%edi
call   1030 <isspace@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
pop    %rcx
ret

LLVM IR (-O0):
@EOF = global i8 0
define i32 @is_whitespace(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = load i8, i8* @EOF
%6 = sext i8 %5 to i32
%7 = icmp ne i32 %4, %6
br i1 %7, label %8, label %12
8: ; preds = %1
%9 = load i8, i8* %2
%10 = call i64 @isspace(i8 signext %9)
%11 = icmp ne i64 %10, 0
br label %12
12: ; preds = %8, %1
%13 = phi i1 [ false, %1 ], [ %11, %8 ]
%14 = zext i1 %13 to i32
ret i32 %14
}

LLVM IR (-O2):
@EOF = global i8 0
define i32 @is_whitespace(i8 signext %0) {
%2 = load i8, i8* @EOF
%3 = icmp eq i8 %2, %0
br i1 %3, label %8, label %4
4: ; preds = %1
%5 = tail call i64 @isspace(i8 signext %0)
%6 = icmp ne i64 %5, 0
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %4, %1
%9 = phi i32 [ 0, %1 ], [ %7, %4 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
int isqrt(int);
void t_sqrt_225() {
  Assert_real((isqrt(225) == 15),
              "/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/stdlib/isqrt.c",
              1130, ("Integer square root of 225 should be 15"));
}


x86 assembly (clang, -O0):
<t_sqrt_225>:
push   %rbp
mov    %rsp,%rbp
mov    $0xe1,%edi
call   1030 <isqrt@plt>
cmp    $0xf,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xec0(%rip),%rsi
mov    $0x46a,%edx
lea    0xf56(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_sqrt_225>:
push   %rax
mov    $0xe1,%edi
call   1030 <isqrt@plt>
xor    %edi,%edi
cmp    $0xf,%eax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf60(%rip),%rcx
mov    $0x46a,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [162 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/stdlib/isqrt.c\00"
@.str.1 = [40 x i8] c"Integer square root of 225 should be 15\00"
define void @t_sqrt_225() {
%1 = call i32 @isqrt(i32 225)
%2 = icmp eq i32 %1, 15
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str, i64 0, i64 0), i32 1130, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [162 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/stdlib/isqrt.c\00"
@.str.1 = [40 x i8] c"Integer square root of 225 should be 15\00"
define void @t_sqrt_225() {
%1 = tail call i32 @isqrt(i32 225)
%2 = icmp eq i32 %1, 15
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str, i64 0, i64 0), i32 1130, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
char *strstr(char const *, char *);
char *_getErrorShortFileName(const char *fileName) {
  char *file = strstr(fileName, "src");
  if (file != NULL)
    file = (file + 4);
  else
    file = (char *)fileName;
  return file;
}


x86 assembly (clang, -O0):
<_getErrorShortFileName>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xed9(%rip),%rsi
call   1030 <strstr@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     114c <_getErrorShortFileName+0x3c>
mov    -0x10(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x10(%rbp)
jmp    1154 <_getErrorShortFileName+0x44>
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_getErrorShortFileName>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rsi
call   1030 <strstr@plt>
lea    0x4(%rax),%rcx
test   %rax,%rax
cmove  %rbx,%rcx
mov    %rcx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"src\00"
define i8* @_getErrorShortFileName(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i8* @strstr(i8* %4, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %8, label %11
8: ; preds = %1
%9 = load i8*, i8** %3
%10 = getelementptr inbounds i8, i8* %9, i64 4
store i8* %10, i8** %3
br label %13
11: ; preds = %1
%12 = load i8*, i8** %2
store i8* %12, i8** %3
br label %13
13: ; preds = %11, %8
%14 = load i8*, i8** %3
ret i8* %14
}

LLVM IR (-O2):
@.str = [4 x i8] c"src\00"
define i8* @_getErrorShortFileName(i8* %0) {
%2 = tail call i8* @strstr(i8* dereferenceable(1) %0, i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i8* %2, null
%4 = getelementptr inbounds i8, i8* %2, i64 4
%5 = select i1 %3, i8* %0, i8* %4
ret i8* %5
}