xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void disp(int *a, int len) {
  int i = 0;
  for (i = 0; i < len; i++)
    printf("%d ", *(a + i));
  printf("\n");
}


x86 assembly (clang, -O0):
<disp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1160 <disp+0x50>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xeb5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    112d <disp+0x1d>
lea    0xe9d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<disp>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1157 <disp+0x37>
mov    %rdi,%r15
mov    %esi,%r12d
lea    0xec7(%rip),%r14
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
mov    (%r15,%rbx,4),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1140 <disp+0x20>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d \00"
define void @disp(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = load i32, i32* %8
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
%14 = tail call i32 @putchar(i32 10)
ret void
}
/* Variables and functions */
char *strchr(char const *, char);
int GetNewlineCount(const char *s) {
  int count;
  char *pch = strchr(s, '\n');
  for (count = 0; pch != NULL; count++) {
    pch = strchr(pch + 1, '\n');
  }
  return count;
}


x86 assembly (clang, -O0):
<GetNewlineCount>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0xa,%esi
call   1030 <strchr@plt>
mov    %rax,-0x18(%rbp)
movl   $0x0,-0xc(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1164 <GetNewlineCount+0x54>
mov    -0x18(%rbp),%rdi
add    $0x1,%rdi
mov    $0xa,%esi
call   1030 <strchr@plt>
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1135 <GetNewlineCount+0x25>
mov    -0xc(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GetNewlineCount>:
push   %rbx
mov    $0xa,%esi
call   1030 <strchr@plt>
xor    %ebx,%ebx
test   %rax,%rax
je     1149 <GetNewlineCount+0x39>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
add    $0x1,%rax
mov    %rax,%rdi
mov    $0xa,%esi
call   1030 <strchr@plt>
add    $0x1,%ebx
test   %rax,%rax
jne    1130 <GetNewlineCount+0x20>
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @GetNewlineCount(i8* %0) {
%2 = tail call i8* @strchr(i8* dereferenceable(1) %0, i8 signext 10)
%3 = icmp eq i8* %2, null
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i8* [ %8, %4 ], [ %2, %1 ]
%6 = phi i32 [ %9, %4 ], [ 0, %1 ]
%7 = getelementptr inbounds i8, i8* %5, i64 1
%8 = tail call i8* @strchr(i8* %7, i8 signext 10)
%9 = add nuw nsw i32 %6, 1
%10 = icmp eq i8* %8, null
br i1 %10, label %11, label %4
11: ; preds = %4, %1
%12 = phi i32 [ 0, %1 ], [ %9, %4 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
int isqrt(int);
void t_sqrt_26() {
  Assert_real((isqrt(26) == 5),
              "/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",
              135, ("Integer square root of 26 should be 5"));
}


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

x86 assembly (clang, -O2):
<t_sqrt_26>:
push   %rax
mov    $0x1a,%edi
call   1030 <isqrt@plt>
xor    %edi,%edi
cmp    $0x5,%eax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf60(%rip),%rcx
mov    $0x87,%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 = [38 x i8] c"Integer square root of 26 should be 5\00"
define void @t_sqrt_26() {
%1 = call i32 @isqrt(i32 26)
%2 = icmp eq i32 %1, 5
%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 135, i8* getelementptr inbounds ([38 x i8], [38 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 = [38 x i8] c"Integer square root of 26 should be 5\00"
define void @t_sqrt_26() {
%1 = tail call i32 @isqrt(i32 26)
%2 = icmp eq i32 %1, 5
%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 135, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ add_Byte(void *, int, int);
int /*<<< orphan*/ keccakP200NRounds(void *, int);
void Ketje_stride(void *state, int size, unsigned char padding) {
  add_Byte(state, padding, size);
  add_Byte(state, 0x08, 2);
  keccakP200NRounds(state, 6);
}


x86 assembly (clang, -O0):
<Ketje_stride>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dl,%al
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %al,-0xd(%rbp)
mov    -0x8(%rbp),%rdi
movzbl -0xd(%rbp),%esi
mov    -0xc(%rbp),%edx
call   1040 <add_Byte@plt>
mov    -0x8(%rbp),%rdi
mov    $0x8,%esi
mov    $0x2,%edx
call   1040 <add_Byte@plt>
mov    -0x8(%rbp),%rdi
mov    $0x6,%esi
call   1030 <keccakP200NRounds@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Ketje_stride>:
push   %rbx
mov    %esi,%eax
mov    %rdi,%rbx
mov    %edx,%esi
mov    %eax,%edx
call   1040 <add_Byte@plt>
mov    %rbx,%rdi
mov    $0x8,%esi
mov    $0x2,%edx
call   1040 <add_Byte@plt>
mov    %rbx,%rdi
mov    $0x6,%esi
pop    %rbx
jmp    1030 <keccakP200NRounds@plt>

LLVM IR (-O0):
define void @Ketje_stride(i8* %0, i32 %1, i8 zeroext %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i8
store i8* %0, i8** %4
store i32 %1, i32* %5
store i8 %2, i8* %6
%7 = load i8*, i8** %4
%8 = load i8, i8* %6
%9 = zext i8 %8 to i32
%10 = load i32, i32* %5
%11 = call i32 @add_Byte(i8* %7, i32 %9, i32 %10)
%12 = load i8*, i8** %4
%13 = call i32 @add_Byte(i8* %12, i32 8, i32 2)
%14 = load i8*, i8** %4
%15 = call i32 @keccakP200NRounds(i8* %14, i32 6)
ret void
}

LLVM IR (-O2):
define void @Ketje_stride(i8* %0, i32 %1, i8 zeroext %2) {
%4 = zext i8 %2 to i32
%5 = tail call i32 @add_Byte(i8* %0, i32 %4, i32 %1)
%6 = tail call i32 @add_Byte(i8* %0, i32 8, i32 2)
%7 = tail call i32 @keccakP200NRounds(i8* %0, i32 6)
ret void
}
/* Type definitions */
typedef int gid_t;

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


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

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

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

LLVM IR (-O2):
@stderr = global i32 0
@.str = [33 x i8] c"gid_t and int are the same size\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 0, i32* %1
%3 = call i32 @getgroups(i32 0, i32* %1)
%4 = load i32, i32* @stderr
%5 = call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @exit(i32 1)
unreachable
}
int bit_width(int val) {
  int nr_bits = 0;
  if (val <= 1)
    return 0;
  while (val) {
    val >>= 1;
    nr_bits++;
  }
  return nr_bits;
}


x86 assembly (clang, -O0):
<bit_width>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x1,-0x8(%rbp)
jg     1124 <bit_width+0x24>
movl   $0x0,-0x4(%rbp)
jmp    1150 <bit_width+0x50>
jmp    1129 <bit_width+0x29>
cmpl   $0x0,-0x8(%rbp)
je     114a <bit_width+0x4a>
mov    -0x8(%rbp),%eax
sar    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1129 <bit_width+0x29>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bit_width>:
xor    %eax,%eax
cmp    $0x2,%edi
jl     111c <bit_width+0x1c>
xor    %eax,%eax
mov    %edi,%ecx
nopl   0x0(%rax,%rax,1)
sar    %ecx
add    $0x1,%eax
cmp    $0x1,%edi
mov    %ecx,%edi
ja     1110 <bit_width+0x10>
ret

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

LLVM IR (-O2):
define i32 @bit_width(i32 %0) {
%2 = icmp slt i32 %0, 2
br i1 %2, label %9, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %7, %3 ], [ 0, %1 ]
%5 = phi i32 [ %6, %3 ], [ %0, %1 ]
%6 = ashr i32 %5, 1
%7 = add nuw nsw i32 %4, 1
%8 = icmp ult i32 %5, 2
br i1 %8, label %9, label %3
9: ; preds = %3, %1
%10 = phi i32 [ 0, %1 ], [ %7, %3 ]
ret i32 %10
}
int owHasPowerDelivery(int portnum) {
  portnum = 0;
  return 1;
}


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

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

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

LLVM IR (-O2):
define i32 @owHasPowerDelivery(i32 %0) {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
main() {
  printf("Hello, world!\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
call   1030 <printf@plt>
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 = [15 x i8] c"Hello, world!\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [14 x i8] c"Hello, world!\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ caddr_t;

/* Variables and functions */
int DoDisk(int, int /*<<< orphan*/, int, int);
int errno;
WriteDisk(int blknum, caddr_t addr, int blks) {
  int err = DoDisk(blknum, addr, blks, 1);
  if (err)
    errno = err;
  return err ? -1 : 0;
}


x86 assembly (clang, -O0):
<WriteDisk>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    $0x1,%ecx
call   1030 <DoDisk@plt>
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
je     114d <WriteDisk+0x3d>
mov    -0x10(%rbp),%ecx
mov    0x2e95(%rip),%rax
mov    %ecx,(%rax)
mov    -0x10(%rbp),%edx
xor    %eax,%eax
mov    $0xffffffff,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<WriteDisk>:
push   %rax
mov    $0x1,%ecx
call   1030 <DoDisk@plt>
test   %eax,%eax
je     1128 <WriteDisk+0x18>
mov    0x2eba(%rip),%rcx
mov    %eax,(%rcx)
neg    %eax
sbb    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@errno = global i32 0
define i32 @WriteDisk(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i32, i32* %4
%9 = load i32, i32* %5
%10 = load i32, i32* %6
%11 = call i32 @DoDisk(i32 %8, i32 %9, i32 %10, i32 1)
store i32 %11, i32* %7
%12 = load i32, i32* %7
%13 = icmp ne i32 %12, 0
br i1 %13, label %14, label %16
14: ; preds = %3
%15 = load i32, i32* %7
store i32 %15, i32* @errno
br label %16
16: ; preds = %14, %3
%17 = load i32, i32* %7
%18 = icmp ne i32 %17, 0
%19 = zext i1 %18 to i64
%20 = select i1 %18, i32 -1, i32 0
ret i32 %20
}

LLVM IR (-O2):
@errno = global i32 0
define i32 @WriteDisk(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @DoDisk(i32 %0, i32 %1, i32 %2, i32 1)
%5 = icmp eq i32 %4, 0
br i1 %5, label %7, label %6
6: ; preds = %3
store i32 %4, i32* @errno
br label %7
7: ; preds = %6, %3
%8 = xor i1 %5, true
%9 = sext i1 %8 to i32
ret i32 %9
}
void killschedule() { return; }


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

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

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

LLVM IR (-O2):
define void @killschedule() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exec_once_init();
int /*<<< orphan*/ printf(char *);
int main(int argc, char *argv[]) {
  printf("start initalization.\n");
  exec_once_init();
  printf("initalization is done.\n");
  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)
lea    0xec3(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1030 <exec_once_init@plt>
lea    0xec6(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [22 x i8] c"start initalization.\0A\00"
@.str.1 = [24 x i8] c"initalization is done.\0A\00"
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 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%7 = call i32 (...) @exec_once_init()
%8 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [21 x i8] c"start initalization.\00"
@str.2 = [23 x i8] c"initalization is done.\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 (...) @exec_once_init()
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str.2, i64 0, i64 0))
ret i32 0
}
double d_sin_xx_6(double xx) {
  return 0.7853981633974483 +
         xx * (-0.08074544390600076 +
               xx * (0.002490020287907521 + xx * (-3.596176288784333e-05)));
}


x86 assembly (clang, -O0):
<d_sin_xx_6>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm1
movsd  -0x8(%rbp),%xmm2
movsd  0xef0(%rip),%xmm3
mulsd  %xmm3,%xmm2
movsd  0xeec(%rip),%xmm3
addsd  %xmm3,%xmm2
mulsd  %xmm2,%xmm1
movsd  0xecc(%rip),%xmm2
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  0xeb4(%rip),%xmm1
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<d_sin_xx_6>:
movsd  0xef8(%rip),%xmm1
mulsd  %xmm0,%xmm1
addsd  0xef4(%rip),%xmm1
mulsd  %xmm0,%xmm1
addsd  0xef0(%rip),%xmm1
mulsd  %xmm1,%xmm0
addsd  0xeec(%rip),%xmm0
ret

LLVM IR (-O0):
define double @d_sin_xx_6(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = load double, double* %2
%5 = load double, double* %2
%6 = call double @llvm.fmuladd.f64(double %5, double 0xBF02DAB4C39AA380, double 0x3F6465F3767E7A93)
%7 = call double @llvm.fmuladd.f64(double %4, double %6, double 0xBFB4ABBBC0E09525)
%8 = call double @llvm.fmuladd.f64(double %3, double %7, double 0x3FE921FB54442D18)
ret double %8
}

LLVM IR (-O2):
define double @d_sin_xx_6(double %0) {
%2 = tail call double @llvm.fmuladd.f64(double %0, double 0xBF02DAB4C39AA380, double 0x3F6465F3767E7A93)
%3 = tail call double @llvm.fmuladd.f64(double %0, double %2, double 0xBFB4ABBBC0E09525)
%4 = tail call double @llvm.fmuladd.f64(double %0, double %3, double 0x3FE921FB54442D18)
ret double %4
}
/* Type definitions */
struct UPnPService {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, unsigned short);
void AVRCP_ResponseSink_RenderingControl_GetVolume(
    struct UPnPService *Service, int ErrorCode, void *User,
    unsigned short CurrentVolume) {
  printf("AVRCP_ Invoke Response: "
         "RenderingControl/GetVolume[ErrorCode:%d](%u)\r\n",
         ErrorCode, CurrentVolume);
}


x86 assembly (clang, -O0):
<AVRCP_ResponseSink_RenderingControl_GetVolume>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %cx,%ax
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ax,-0x1a(%rbp)
mov    -0xc(%rbp),%esi
lea    0xecc(%rip),%rdi
movzwl -0x1a(%rbp),%edx
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.UPnPService = type { i32 }
@.str = [71 x i8] c"AVRCP_ Invoke Response: RenderingControl/GetVolume[ErrorCode:%d](%u)\0D\0A\00"
define void @AVRCP_ResponseSink_RenderingControl_GetVolume(%struct.UPnPService* %0, i32 %1, i8* %2, i16 zeroext %3) {
%5 = alloca %struct.UPnPService*
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i16
store %struct.UPnPService* %0, %struct.UPnPService** %5
store i32 %1, i32* %6
store i8* %2, i8** %7
store i16 %3, i16* %8
%9 = load i32, i32* %6
%10 = load i16, i16* %8
%11 = call i32 @printf(i8* getelementptr inbounds ([71 x i8], [71 x i8]* @.str, i64 0, i64 0), i32 %9, i16 zeroext %10)
ret void
}

LLVM IR (-O2):
%struct.UPnPService = type { i32 }
@.str = [71 x i8] c"AVRCP_ Invoke Response: RenderingControl/GetVolume[ErrorCode:%d](%u)\0D\0A\00"
define void @AVRCP_ResponseSink_RenderingControl_GetVolume(%struct.UPnPService* nocapture readnone %0, i32 %1, i8* nocapture readnone %2, i16 zeroext %3) {
%5 = tail call i32 @printf(i8* getelementptr inbounds ([71 x i8], [71 x i8]* @.str, i64 0, i64 0), i32 %1, i16 zeroext %3)
ret void
}
void security_skb_copy(struct sk_buff *newskb, const struct sk_buff *oldskb) {}


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

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

LLVM IR (-O0):
%struct.sk_buff = type opaque
define void @security_skb_copy(%struct.sk_buff* %0, %struct.sk_buff* %1) {
%3 = alloca %struct.sk_buff*
%4 = alloca %struct.sk_buff*
store %struct.sk_buff* %0, %struct.sk_buff** %3
store %struct.sk_buff* %1, %struct.sk_buff** %4
ret void
}

LLVM IR (-O2):
%struct.sk_buff = type opaque
define void @security_skb_copy(%struct.sk_buff* nocapture %0, %struct.sk_buff* nocapture %1) {
ret void
}
/* Type definitions */
struct _Locale_name_hint {
  int dummy;
};
struct _Locale_collate {
  int dummy;
};

/* Variables and functions */
scalar_t__ _Locale_create(char const *, int *);
struct _Locale_collate *_Locale_collate_create(const char *name,
                                               struct _Locale_name_hint *hint,
                                               int *__err_code) {
  return (struct _Locale_collate *)_Locale_create(name, __err_code);
}


x86 assembly (clang, -O0):
<_Locale_collate_create>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <_Locale_create@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_Locale_collate_create>:
mov    %rdx,%rsi
jmp    1030 <_Locale_create@plt>

LLVM IR (-O0):
%struct._Locale_collate = type { i32 }
%struct._Locale_name_hint = type { i32 }
define %struct._Locale_collate* @_Locale_collate_create(i8* %0, %struct._Locale_name_hint* %1, i32* %2) {
%4 = alloca i8*
%5 = alloca %struct._Locale_name_hint*
%6 = alloca i32*
store i8* %0, i8** %4
store %struct._Locale_name_hint* %1, %struct._Locale_name_hint** %5
store i32* %2, i32** %6
%7 = load i8*, i8** %4
%8 = load i32*, i32** %6
%9 = call i64 @_Locale_create(i8* %7, i32* %8)
%10 = inttoptr i64 %9 to %struct._Locale_collate*
ret %struct._Locale_collate* %10
}

LLVM IR (-O2):
%struct._Locale_collate = type { i32 }
%struct._Locale_name_hint = type { i32 }
define %struct._Locale_collate* @_Locale_collate_create(i8* %0, %struct._Locale_name_hint* nocapture readnone %1, i32* %2) {
%4 = tail call i64 @_Locale_create(i8* %0, i32* %2)
%5 = inttoptr i64 %4 to %struct._Locale_collate*
ret %struct._Locale_collate* %5
}
int sock_intr_errno(long timeo) {
  return timeo == ((long)(~0UL >> 1)) ? -512 : -4;
}


x86 assembly (clang, -O0):
<sock_intr_errno>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
movabs $0x7fffffffffffffff,%rsi
ff ff 7f
mov    $0xfffffffc,%eax
mov    $0xfffffe00,%ecx
cmp    %rsi,%rdx
cmove  %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sock_intr_errno>:
movabs $0x7fffffffffffffff,%rax
ff ff 7f
cmp    %rax,%rdi
mov    $0xfffffe00,%ecx
mov    $0xfffffffc,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @sock_intr_errno(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = icmp eq i64 %3, 9223372036854775807
%5 = zext i1 %4 to i64
%6 = select i1 %4, i32 -512, i32 -4
ret i32 %6
}

LLVM IR (-O2):
define i32 @sock_intr_errno(i64 %0) {
%2 = icmp eq i64 %0, 9223372036854775807
%3 = select i1 %2, i32 -512, i32 -4
ret i32 %3
}
/* Variables and functions */
double pow(double, double);
int main(int argc, char *argv[]) {
  volatile double result;
  result = pow(-0.0, 3.0);
  result = pow(26.47, -2.0);
  result = pow(0.0, 0.0);
  result = pow(22.3, 1.0);
  result = pow(33.2, -1.0);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movsd  0xf02(%rip),%xmm0
movsd  0xf02(%rip),%xmm1
call   1030 <pow@plt>
movsd  %xmm0,-0x18(%rbp)
movsd  0xed8(%rip),%xmm0
movsd  0xed8(%rip),%xmm1
call   1030 <pow@plt>
movsd  %xmm0,-0x18(%rbp)
xorps  %xmm1,%xmm1
movaps %xmm1,%xmm0
call   1030 <pow@plt>
movsd  %xmm0,-0x18(%rbp)
movsd  0xe9e(%rip),%xmm0
movsd  0xe9e(%rip),%xmm1
call   1030 <pow@plt>
movsd  %xmm0,-0x18(%rbp)
movsd  0xe74(%rip),%xmm0
movsd  0xe74(%rip),%xmm1
call   1030 <pow@plt>
movsd  %xmm0,-0x18(%rbp)
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
movabs $0x8000000000000000,%rax
mov    %rax,-0x8(%rsp)
movabs $0x3f576236055373ff,%rax
62 57 3f
mov    %rax,-0x8(%rsp)
movabs $0x3ff0000000000000,%rax
mov    %rax,-0x8(%rsp)
movabs $0x40364ccccccccccd,%rax
4c 36 40
mov    %rax,-0x8(%rsp)
movabs $0x3f9ed7e75346f093,%rax
d7 9e 3f
mov    %rax,-0x8(%rsp)
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca double
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = call double @pow(double -0.000000e+00, double 3.000000e+00)
store volatile double %7, double* %6
%8 = call double @pow(double 2.647000e+01, double -2.000000e+00)
store volatile double %8, double* %6
%9 = call double @pow(double 0.000000e+00, double 0.000000e+00)
store volatile double %9, double* %6
%10 = call double @pow(double 2.230000e+01, double 1.000000e+00)
store volatile double %10, double* %6
%11 = call double @pow(double 3.320000e+01, double -1.000000e+00)
store volatile double %11, double* %6
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca double
%4 = bitcast double* %3 to i8*
store volatile double -0.000000e+00, double* %3
store volatile double 0x3F576236055373FF, double* %3
store volatile double 1.000000e+00, double* %3
store volatile double 2.230000e+01, double* %3
store volatile double 0x3F9ED7E75346F093, double* %3
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
int main() {
  puts("This code does nothing so it's very secure.");
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
call   1030 <puts@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 = [44 x i8] c"This code does nothing so it's very secure.\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @puts(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [44 x i8] c"This code does nothing so it's very secure.\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
void rwsem_set_owner(struct rw_semaphore *sem) {}


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

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

LLVM IR (-O0):
%struct.rw_semaphore = type opaque
define void @rwsem_set_owner(%struct.rw_semaphore* %0) {
%2 = alloca %struct.rw_semaphore*
store %struct.rw_semaphore* %0, %struct.rw_semaphore** %2
ret void
}

LLVM IR (-O2):
%struct.rw_semaphore = type opaque
define void @rwsem_set_owner(%struct.rw_semaphore* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  int n = 0;
  if (n = 0)
    printf("rowne\n");
  else
    printf("nierowne\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0x8(%rbp)
xor    %eax,%eax
test   $0x1,%al
jne    113c <main+0x2c>
jmp    114d <main+0x3d>
lea    0xec0(%rip),%rdi
call   1030 <printf@plt>
jmp    1159 <main+0x49>
lea    0xeac(%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 = [7 x i8] c"rowne\0A\00"
@.str.1 = [10 x i8] c"nierowne\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
store i32 0, i32* %2
br i1 false, label %3, label %5
3: ; preds = %0
%4 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
br label %7
5: ; preds = %0
%6 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
br label %7
7: ; preds = %5, %3
ret i32 0
}

LLVM IR (-O2):
@str = [9 x i8] c"nierowne\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str, i64 0, i64 0))
ret i32 0
}
void testfunc_00(const char *ap, char *bp, char val) {
  bp[0] = ap[15];
  bp[2] = ap[5];
  bp[9] = ap[7];
  bp[0] = ap[15];
  bp[4] = val;
  bp[14] = val;
}


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %al,-0x11(%rbp)
mov    -0x8(%rbp),%rax
mov    0xf(%rax),%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
mov    0x5(%rax),%cl
mov    -0x10(%rbp),%rax
mov    %cl,0x2(%rax)
mov    -0x8(%rbp),%rax
mov    0x7(%rax),%cl
mov    -0x10(%rbp),%rax
mov    %cl,0x9(%rax)
mov    -0x8(%rbp),%rax
mov    0xf(%rax),%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
mov    -0x11(%rbp),%cl
mov    -0x10(%rbp),%rax
mov    %cl,0x4(%rax)
mov    -0x11(%rbp),%cl
mov    -0x10(%rbp),%rax
mov    %cl,0xe(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
mov    0xf(%rdi),%al
mov    %al,(%rsi)
mov    0x5(%rdi),%al
mov    %al,0x2(%rsi)
mov    0x7(%rdi),%al
mov    %al,0x9(%rsi)
mov    0xf(%rdi),%al
mov    %al,(%rsi)
mov    %dl,0x4(%rsi)
mov    %dl,0xe(%rsi)
ret

LLVM IR (-O0):
define void @testfunc_00(i8* %0, i8* %1, i8 signext %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8 %2, i8* %6
%7 = load i8*, i8** %4
%8 = getelementptr inbounds i8, i8* %7, i64 15
%9 = load i8, i8* %8
%10 = load i8*, i8** %5
%11 = getelementptr inbounds i8, i8* %10, i64 0
store i8 %9, i8* %11
%12 = load i8*, i8** %4
%13 = getelementptr inbounds i8, i8* %12, i64 5
%14 = load i8, i8* %13
%15 = load i8*, i8** %5
%16 = getelementptr inbounds i8, i8* %15, i64 2
store i8 %14, i8* %16
%17 = load i8*, i8** %4
%18 = getelementptr inbounds i8, i8* %17, i64 7
%19 = load i8, i8* %18
%20 = load i8*, i8** %5
%21 = getelementptr inbounds i8, i8* %20, i64 9
store i8 %19, i8* %21
%22 = load i8*, i8** %4
%23 = getelementptr inbounds i8, i8* %22, i64 15
%24 = load i8, i8* %23
%25 = load i8*, i8** %5
%26 = getelementptr inbounds i8, i8* %25, i64 0
store i8 %24, i8* %26
%27 = load i8, i8* %6
%28 = load i8*, i8** %5
%29 = getelementptr inbounds i8, i8* %28, i64 4
store i8 %27, i8* %29
%30 = load i8, i8* %6
%31 = load i8*, i8** %5
%32 = getelementptr inbounds i8, i8* %31, i64 14
store i8 %30, i8* %32
ret void
}

LLVM IR (-O2):
define void @testfunc_00(i8* nocapture %0, i8* nocapture writeonly %1, i8 signext %2) {
%4 = getelementptr inbounds i8, i8* %0, i64 15
%5 = load i8, i8* %4
store i8 %5, i8* %1
%6 = getelementptr inbounds i8, i8* %0, i64 5
%7 = load i8, i8* %6
%8 = getelementptr inbounds i8, i8* %1, i64 2
store i8 %7, i8* %8
%9 = getelementptr inbounds i8, i8* %0, i64 7
%10 = load i8, i8* %9
%11 = getelementptr inbounds i8, i8* %1, i64 9
store i8 %10, i8* %11
%12 = load i8, i8* %4
store i8 %12, i8* %1
%13 = getelementptr inbounds i8, i8* %1, i64 4
store i8 %2, i8* %13
%14 = getelementptr inbounds i8, i8* %1, i64 14
store i8 %2, i8* %14
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ ASN1_PCTX;

/* Variables and functions */
int /*<<< orphan*/ OPENSSL_free(int /*<<< orphan*/ *);
void ASN1_PCTX_free(ASN1_PCTX *p) { OPENSSL_free(p); }


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

x86 assembly (clang, -O2):
<ASN1_PCTX_free>:
jmp    1030 <OPENSSL_free@plt>

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

LLVM IR (-O2):
define void @ASN1_PCTX_free(i32* %0) {
%2 = tail call i32 @OPENSSL_free(i32* %0)
ret void
}
/* Variables and functions */
int func(int);
int callback(int fd) { return func(fd); }


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

x86 assembly (clang, -O2):
<callback>:
jmp    1030 <func@plt>

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

LLVM IR (-O2):
define i32 @callback(i32 %0) {
%2 = tail call i32 @func(i32 %0)
ret i32 %2
}
cbuf32(f, n) { return (cbuf(f, n, 32)); }


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

x86 assembly (clang, -O2):
<cbuf32>:
mov    $0x20,%edx
xor    %eax,%eax
jmp    1030 <cbuf@plt>

LLVM IR (-O0):
define i32 @cbuf32(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 (i32, i32, i32, ...) bitcast (i32 (...)* @cbuf to i32 (i32, i32, i32, ...)*)(i32 %5, i32 %6, i32 32)
ret i32 %7
}

LLVM IR (-O2):
define i32 @cbuf32(i32 %0, i32 %1) {
%3 = tail call i32 (i32, i32, i32, ...) bitcast (i32 (...)* @cbuf to i32 (i32, i32, i32, ...)*)(i32 %0, i32 %1, i32 32)
ret i32 %3
}
/* Type definitions */
struct timespec {
  size_t tv_sec;
  size_t tv_nsec;
  int /*<<< orphan*/ member_0;
};

/* Variables and functions */
struct timespec milliseconds_to_timespec(size_t milliseconds) {
  struct timespec t = {0};
  t.tv_sec = milliseconds / 1000;
  t.tv_nsec = (milliseconds - (1000 * t.tv_sec)) * 1000000;
  return t;
}


x86 assembly (clang, -O0):
<milliseconds_to_timespec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x18(%rbp)
mov    %rdi,%rax
mov    %rax,-0x10(%rbp)
mov    %rsi,-0x8(%rbp)
xor    %esi,%esi
mov    $0x18,%edx
call   1030 <memset@plt>
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rax
mov    $0x3e8,%ecx
xor    %edx,%edx
div    %rcx
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rdi)
mov    -0x8(%rbp),%rcx
imul   $0x3e8,(%rdi),%rdx
sub    %rdx,%rcx
imul   $0xf4240,%rcx,%rcx
mov    %rcx,0x8(%rdi)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<milliseconds_to_timespec>:
movq   $0x0,0x10(%rdi)
mov    %rsi,%rax
shr    $0x3,%rax
movabs $0x20c49ba5e353f7cf,%rcx
9b c4 20
mul    %rcx
shr    $0x4,%rdx
mov    %rdx,(%rdi)
imul   $0xfffffffffffffc18,%rdx,%rax
add    %rsi,%rax
imul   $0xf4240,%rax,%rax
mov    %rax,0x8(%rdi)
mov    %rdi,%rax
ret

LLVM IR (-O0):
%struct.timespec = type { i64, i64, i32 }
define void @milliseconds_to_timespec(%struct.timespec* noalias sret(%struct.timespec) align 8 %0, i64 %1) {
%3 = alloca i64
store i64 %1, i64* %3
%4 = bitcast %struct.timespec* %0 to i8*
%5 = load i64, i64* %3
%6 = udiv i64 %5, 1000
%7 = getelementptr inbounds %struct.timespec, %struct.timespec* %0, i32 0, i32 0
store i64 %6, i64* %7
%8 = load i64, i64* %3
%9 = getelementptr inbounds %struct.timespec, %struct.timespec* %0, i32 0, i32 0
%10 = load i64, i64* %9
%11 = mul i64 1000, %10
%12 = sub i64 %8, %11
%13 = mul i64 %12, 1000000
%14 = getelementptr inbounds %struct.timespec, %struct.timespec* %0, i32 0, i32 1
store i64 %13, i64* %14
ret void
}

LLVM IR (-O2):
%struct.timespec = type { i64, i64, i32 }
define void @milliseconds_to_timespec(%struct.timespec* noalias nocapture writeonly sret(%struct.timespec) align 8 %0, i64 %1) {
%3 = getelementptr inbounds %struct.timespec, %struct.timespec* %0, i64 0, i32 2
%4 = bitcast i32* %3 to i64*
store i64 0, i64* %4
%5 = udiv i64 %1, 1000
%6 = getelementptr inbounds %struct.timespec, %struct.timespec* %0, i64 0, i32 0
store i64 %5, i64* %6
%7 = mul i64 %5, -1000
%8 = add i64 %7, %1
%9 = mul i64 %8, 1000000
%10 = getelementptr inbounds %struct.timespec, %struct.timespec* %0, i64 0, i32 1
store i64 %9, i64* %10
ret void
}
int secure_storage_emmc_read(char *buf, unsigned int len) { return -1; }


x86 assembly (clang, -O0):
<secure_storage_emmc_read>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    $0xffffffff,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @secure_storage_emmc_read(i8* nocapture readnone %0, i32 %1) {
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ INT_MAX;
int /*<<< orphan*/ INT_MIN;
int getir(int /*<<< orphan*/, int /*<<< orphan*/);
int geti() { return getir(INT_MIN, INT_MAX); }


x86 assembly (clang, -O0):
<geti>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
mov    0x2ec4(%rip),%rax
mov    (%rax),%esi
call   1030 <getir@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<geti>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
mov    0x2ec8(%rip),%rax
mov    (%rax),%esi
jmp    1030 <getir@plt>

LLVM IR (-O0):
@INT_MIN = global i32 0
@INT_MAX = global i32 0
define i32 @geti() {
%1 = load i32, i32* @INT_MIN
%2 = load i32, i32* @INT_MAX
%3 = call i32 @getir(i32 %1, i32 %2)
ret i32 %3
}

LLVM IR (-O2):
@INT_MIN = global i32 0
@INT_MAX = global i32 0
define i32 @geti() {
%1 = load i32, i32* @INT_MIN
%2 = load i32, i32* @INT_MAX
%3 = tail call i32 @getir(i32 %1, i32 %2)
ret i32 %3
}
int PWM_device_init(void) { return 1; }


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

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

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

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

/* Variables and functions */
float _mm_cvtss_f32(int /*<<< orphan*/);
int /*<<< orphan*/ _mm_rsqrt_ss(int /*<<< orphan*/);
int /*<<< orphan*/ _mm_set_ss(float);
float HMM_RSquareRootF(float Float) {
  ;
  float Result;
  __m128 In = _mm_set_ss(Float);
  __m128 Out = _mm_rsqrt_ss(In);
  Result = _mm_cvtss_f32(Out);
  return (Result);
}


x86 assembly (clang, -O0):
<HMM_RSquareRootF>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
call   1040 <_mm_set_ss@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%edi
call   1050 <_mm_rsqrt_ss@plt>
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%edi
call   1030 <_mm_cvtss_f32@plt>
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<HMM_RSquareRootF>:
push   %rax
call   1040 <_mm_set_ss@plt>
mov    %eax,%edi
call   1050 <_mm_rsqrt_ss@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <_mm_cvtss_f32@plt>

LLVM IR (-O0):
define float @HMM_RSquareRootF(float %0) {
%2 = alloca float
%3 = alloca float
%4 = alloca i32
%5 = alloca i32
store float %0, float* %2
%6 = load float, float* %2
%7 = call i32 @_mm_set_ss(float %6)
store i32 %7, i32* %4
%8 = load i32, i32* %4
%9 = call i32 @_mm_rsqrt_ss(i32 %8)
store i32 %9, i32* %5
%10 = load i32, i32* %5
%11 = call float @_mm_cvtss_f32(i32 %10)
store float %11, float* %3
%12 = load float, float* %3
ret float %12
}

LLVM IR (-O2):
define float @HMM_RSquareRootF(float %0) {
%2 = tail call i32 @_mm_set_ss(float %0)
%3 = tail call i32 @_mm_rsqrt_ss(i32 %2)
%4 = tail call float @_mm_cvtss_f32(i32 %3)
ret float %4
}
void boot_it(void) {}


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

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

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

LLVM IR (-O2):
define void @boot_it() {
ret void
}
void Matrix_Free(int intHeight, unsigned char ***pMat) {
  int i;
  for (i = 0; i <= intHeight - 1; i++)
    free((*pMat)[i]);
  free(*pMat);
  printf("simple matrix memory free\n");
}


x86 assembly (clang, -O0):
<Matrix_Free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0x4(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jg     1169 <Matrix_Free+0x49>
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <free@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1136 <Matrix_Free+0x16>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1030 <free@plt>
lea    0xe84(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Matrix_Free>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
test   %edi,%edi
jle    1155 <Matrix_Free+0x35>
mov    %edi,%r15d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    (%r14),%rax
mov    (%rax,%rbx,8),%rdi
call   1030 <free@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1140 <Matrix_Free+0x20>
mov    (%r14),%rdi
call   1030 <free@plt>
lea    0xe9c(%rip),%rdi
pop    %rbx
pop    %r14
pop    %r15
jmp    1040 <puts@plt>

LLVM IR (-O0):
@.str = [27 x i8] c"simple matrix memory free\0A\00"
define void @Matrix_Free(i32 %0, i8*** %1) {
%3 = alloca i32
%4 = alloca i8***
%5 = alloca i32
store i32 %0, i32* %3
store i8*** %1, i8**** %4
store i32 0, i32* %5
br label %6
6: ; preds = %18, %2
%7 = load i32, i32* %5
%8 = load i32, i32* %3
%9 = sub nsw i32 %8, 1
%10 = icmp sle i32 %7, %9
br i1 %10, label %11, label %21
11: ; preds = %6
%12 = load i8***, i8**** %4
%13 = load i8**, i8*** %12
%14 = load i32, i32* %5
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i8*, i8** %13, i64 %15
%17 = load i8*, i8** %16
br label %18
18: ; preds = %11
%19 = load i32, i32* %5
%20 = add nsw i32 %19, 1
store i32 %20, i32* %5
br label %6
21: ; preds = %6
%22 = load i8***, i8**** %4
%23 = load i8**, i8*** %22
%24 = bitcast i8** %23 to i8*
%25 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [26 x i8] c"simple matrix memory free\00"
define void @Matrix_Free(i32 %0, i8*** nocapture %1) {
%3 = icmp sgt i32 %0, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %0 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = load i8**, i8*** %1
%9 = getelementptr inbounds i8*, i8** %8, i64 %7
%10 = load i8*, i8** %9
tail call void @free(i8* %10)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
%14 = bitcast i8*** %1 to i8**
%15 = load i8*, i8** %14
tail call void @free(i8* %15)
%16 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str, i64 0, i64 0))
ret void
}
void injectSharedLibrary_end() {}


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

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

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

LLVM IR (-O2):
define void @injectSharedLibrary_end() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
int isqrt(int);
void t_sqrt_123() {
  Assert_real((isqrt(123) == 11),
              "/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",
              620, ("Integer square root of 123 should be 11"));
}


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

x86 assembly (clang, -O2):
<t_sqrt_123>:
push   %rax
mov    $0x7b,%edi
call   1030 <isqrt@plt>
xor    %edi,%edi
cmp    $0xb,%eax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf60(%rip),%rcx
mov    $0x26c,%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 123 should be 11\00"
define void @t_sqrt_123() {
%1 = call i32 @isqrt(i32 123)
%2 = icmp eq i32 %1, 11
%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 620, 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 123 should be 11\00"
define void @t_sqrt_123() {
%1 = tail call i32 @isqrt(i32 123)
%2 = icmp eq i32 %1, 11
%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 620, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0))
ret void
}