xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ unit_main();
int main(int argc, char **argv) {
  if (!unit_main())
    return 1;
  printf("OK\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)
mov    $0x0,%al
call   1040 <unit_main@plt>
cmp    $0x0,%eax
jne    1152 <main+0x32>
movl   $0x1,-0x4(%rbp)
jmp    1165 <main+0x45>
lea    0xea7(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %ebx,%ebx
xor    %eax,%eax
call   1040 <unit_main@plt>
test   %eax,%eax
je     113c <main+0x1c>
lea    0xecb(%rip),%rdi
call   1030 <puts@plt>
jmp    1141 <main+0x21>
mov    $0x1,%ebx
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"OK\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 (...) @unit_main()
%7 = icmp ne i32 %6, 0
br i1 %7, label %9, label %8
8: ; preds = %2
store i32 1, i32* %3
br label %11
9: ; preds = %2
%10 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %3
br label %11
11: ; preds = %9, %8
%12 = load i32, i32* %3
ret i32 %12
}

LLVM IR (-O2):
@str = [3 x i8] c"OK\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @unit_main()
%4 = icmp eq i32 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @str, i64 0, i64 0))
br label %7
7: ; preds = %2, %5
%8 = phi i32 [ 0, %5 ], [ 1, %2 ]
ret i32 %8
}
/* Variables and functions */
void *pubrealloc(int /*<<< orphan*/ *, size_t, char *);
void *phkmalloc(size_t size) {
  return (pubrealloc(NULL, size, " in malloc():"));
}


x86 assembly (clang, -O0):
<phkmalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%edi
lea    0xed5(%rip),%rdx
call   1030 <pubrealloc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<phkmalloc>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdx
xor    %edi,%edi
jmp    1030 <pubrealloc@plt>

LLVM IR (-O0):
@.str = [14 x i8] c" in malloc():\00"
define i8* @phkmalloc(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i8* @pubrealloc(i32* null, i64 %3, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret i8* %4
}

LLVM IR (-O2):
@.str = [14 x i8] c" in malloc():\00"
define i8* @phkmalloc(i64 %0) {
%2 = tail call i8* @pubrealloc(i32* null, i64 %0, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret i8* %2
}
/* Variables and functions */
scalar_t__ my_malloc(int);
double *create_nvector(int n) {
  double *vector;
  vector = (double *)my_malloc(sizeof(double) * (n + 1));
  return (vector);
}


x86 assembly (clang, -O0):
<create_nvector>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
cltq
shl    $0x3,%rax
mov    %eax,%edi
call   1030 <my_malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<create_nvector>:
lea    0x8(,%rdi,8),%edi
jmp    1030 <my_malloc@plt>

LLVM IR (-O0):
define double* @create_nvector(i32 %0) {
%2 = alloca i32
%3 = alloca double*
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = add nsw i32 %4, 1
%6 = sext i32 %5 to i64
%7 = mul i64 8, %6
%8 = trunc i64 %7 to i32
%9 = call i64 @my_malloc(i32 %8)
%10 = inttoptr i64 %9 to double*
store double* %10, double** %3
%11 = load double*, double** %3
ret double* %11
}

LLVM IR (-O2):
define double* @create_nvector(i32 %0) {
%2 = shl i32 %0, 3
%3 = add i32 %2, 8
%4 = tail call i64 @my_malloc(i32 %3)
%5 = inttoptr i64 %4 to double*
ret double* %5
}
void *pmvpf(void *context) { return 0; }


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

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

LLVM IR (-O0):
define i8* @pmvpf(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @pmvpf(i8* nocapture readnone %0) {
ret i8* null
}
int is_space(char c) {
  return (c == ' ' || c == '\t' || c == '\v' || c == '\f' || c == '\r' ||
          c == '\n');
}


x86 assembly (clang, -O0):
<is_space>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x20,%ecx
mov    %al,-0x2(%rbp)
je     1171 <is_space+0x71>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x9,%ecx
mov    %al,-0x2(%rbp)
je     1171 <is_space+0x71>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0xb,%ecx
mov    %al,-0x2(%rbp)
je     1171 <is_space+0x71>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0xc,%ecx
mov    %al,-0x2(%rbp)
je     1171 <is_space+0x71>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0xd,%ecx
mov    %al,-0x2(%rbp)
je     1171 <is_space+0x71>
movsbl -0x1(%rbp),%eax
cmp    $0xa,%eax
sete   %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_space>:
cmp    $0x20,%dil
ja     1120 <is_space+0x20>
mov    $0x1,%eax
movzbl %dil,%ecx
movabs $0x100003a00,%rdx
bt     %rcx,%rdx
jae    1120 <is_space+0x20>
ret
xor    %eax,%eax
cmp    $0xa,%dil
sete   %al
ret

LLVM IR (-O0):
define i32 @is_space(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp eq i32 %4, 32
br i1 %5, label %26, label %6
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp eq i32 %8, 9
br i1 %9, label %26, label %10
10: ; preds = %6
%11 = load i8, i8* %2
%12 = sext i8 %11 to i32
%13 = icmp eq i32 %12, 11
br i1 %13, label %26, label %14
14: ; preds = %10
%15 = load i8, i8* %2
%16 = sext i8 %15 to i32
%17 = icmp eq i32 %16, 12
br i1 %17, label %26, label %18
18: ; preds = %14
%19 = load i8, i8* %2
%20 = sext i8 %19 to i32
%21 = icmp eq i32 %20, 13
br i1 %21, label %26, label %22
22: ; preds = %18
%23 = load i8, i8* %2
%24 = sext i8 %23 to i32
%25 = icmp eq i32 %24, 10
br label %26
26: ; preds = %22, %18, %14, %10, %6, %1
%27 = phi i1 [ true, %18 ], [ true, %14 ], [ true, %10 ], [ true, %6 ], [ true, %1 ], [ %25, %22 ]
%28 = zext i1 %27 to i32
ret i32 %28
}

LLVM IR (-O2):
define i32 @is_space(i8 signext %0) {
switch i8 %0, label %2 [
i8 32, label %5
i8 13, label %5
i8 12, label %5
i8 11, label %5
i8 9, label %5
]
2: ; preds = %1
%3 = icmp eq i8 %0, 10
%4 = zext i1 %3 to i32
br label %5
5: ; preds = %1, %1, %1, %1, %1, %2
%6 = phi i32 [ 1, %1 ], [ %4, %2 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ]
ret i32 %6
}
/* Type definitions */
typedef scalar_t__ uint8_t;
typedef int uint32_t;
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int32_t raw_voltage(uint8_t *pkt) {
  uint32_t i;
  i = (uint32_t)pkt[6] | (uint32_t)pkt[7] << 8 | (uint32_t)pkt[8] << 16;
  if (i & 0x00800000)
    i |= 0xff000000;
  return (int32_t)i;
}


x86 assembly (clang, -O0):
<raw_voltage>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x30(%rax),%rax
mov    -0x8(%rbp),%rcx
mov    0x38(%rcx),%rcx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
mov    0x40(%rcx),%rcx
shl    $0x10,%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
and    $0x800000,%eax
cmp    $0x0,%eax
je     1149 <raw_voltage+0x49>
mov    -0xc(%rbp),%eax
or     $0xff000000,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<raw_voltage>:
mov    0x38(%rdi),%eax
mov    0x40(%rdi),%ecx
shl    $0x8,%eax
or     0x30(%rdi),%eax
shl    $0x10,%ecx
or     %eax,%ecx
mov    %ecx,%eax
or     $0xff000000,%eax
test   $0x800000,%ecx
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @raw_voltage(i64* nocapture %0) {
%2 = getelementptr inbounds i64, i64* %0, i64 6
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
%5 = getelementptr inbounds i64, i64* %0, i64 7
%6 = load i64, i64* %5
%7 = trunc i64 %6 to i32
%8 = shl i32 %7, 8
%9 = or i32 %8, %4
%10 = getelementptr inbounds i64, i64* %0, i64 8
%11 = load i64, i64* %10
%12 = trunc i64 %11 to i32
%13 = shl i32 %12, 16
%14 = or i32 %9, %13
%15 = and i32 %14, 8388608
%16 = icmp eq i32 %15, 0
%17 = or i32 %14, -16777216
%18 = select i1 %16, i32 %14, i32 %17
ret i32 %18
}
/* Variables and functions */
int /*<<< orphan*/ mempcpy(char *, char *, int);
void mempcpy3() {
  char src[] = {1, 2, 3, 4};
  char dst[3];
  mempcpy(dst + 1, src + 2, 2);
}


x86 assembly (clang, -O0):
<mempcpy3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0xee2(%rip),%eax
mov    %eax,-0x4(%rbp)
lea    -0x7(%rbp),%rdi
add    $0x1,%rdi
lea    -0x4(%rbp),%rsi
add    $0x2,%rsi
mov    $0x2,%edx
call   1030 <mempcpy@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mempcpy3>:
push   %rax
movl   $0x4030201,(%rsp)
lea    0x6(%rsp),%rdi
lea    0x2(%rsp),%rsi
mov    $0x2,%edx
call   1030 <mempcpy@plt>
pop    %rax
ret

LLVM IR (-O0):
@__const.mempcpy3.src = [4 x i8] c"\01\02\03\04"
define void @mempcpy3() {
%1 = alloca [4 x i8]
%2 = alloca [3 x i8]
%3 = bitcast [4 x i8]* %1 to i8*
%4 = getelementptr inbounds [3 x i8], [3 x i8]* %2, i64 0, i64 0
%5 = getelementptr inbounds i8, i8* %4, i64 1
%6 = getelementptr inbounds [4 x i8], [4 x i8]* %1, i64 0, i64 0
%7 = getelementptr inbounds i8, i8* %6, i64 2
%8 = call i32 @mempcpy(i8* %5, i8* %7, i32 2)
ret void
}

LLVM IR (-O2):
define void @mempcpy3() {
%1 = alloca i32
%2 = alloca [3 x i8]
%3 = bitcast i32* %1 to i8*
store i32 67305985, i32* %1
%4 = getelementptr inbounds [3 x i8], [3 x i8]* %2, i64 0, i64 0
%5 = getelementptr inbounds [3 x i8], [3 x i8]* %2, i64 0, i64 1
%6 = getelementptr inbounds i8, i8* %3, i64 2
%7 = call i32 @mempcpy(i8* %5, i8* %6, i32 2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isprint(int);
void t_isprint_0x0e() {
  Assert_real((isprint(14) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isprint.c",
              75, ("isprint should be 0 for 0x0e"));
}


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

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

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

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isprint.c\00"
@.str.1 = [29 x i8] c"isprint should be 0 for 0x0e\00"
define void @t_isprint_0x0e() {
%1 = tail call i64 @isprint(i32 14)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 75, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
char *malloc(int);
int /*<<< orphan*/ memcpy(char *, char *, int);
char *substring(char *unString, int start, int end) {
  char *subbuff = malloc(end - start);
  memcpy(subbuff, unString + start, end - start);
  subbuff[end - start] = '\0';
  return subbuff;
}


x86 assembly (clang, -O0):
<substring>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x10(%rbp),%edi
sub    -0xc(%rbp),%edi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
movslq -0xc(%rbp),%rax
add    %rax,%rsi
mov    -0x10(%rbp),%edx
sub    -0xc(%rbp),%edx
call   1030 <memcpy@plt>
mov    -0x18(%rbp),%rax
mov    -0x10(%rbp),%ecx
sub    -0xc(%rbp),%ecx
movslq %ecx,%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<substring>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %edx,%ebx
mov    %esi,%r15d
mov    %rdi,%r14
sub    %esi,%ebx
mov    %ebx,%edi
call   1040 <malloc@plt>
mov    %rax,%rbp
movslq %r15d,%rsi
add    %r14,%rsi
mov    %rax,%rdi
mov    %ebx,%edx
call   1030 <memcpy@plt>
movslq %ebx,%rax
movb   $0x0,0x0(%rbp,%rax,1)
mov    %rbp,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i8* @substring(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i8*
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i32, i32* %6
%9 = load i32, i32* %5
%10 = sub nsw i32 %8, %9
%11 = call i8* @malloc(i32 %10)
store i8* %11, i8** %7
%12 = load i8*, i8** %7
%13 = load i8*, i8** %4
%14 = load i32, i32* %5
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i8, i8* %13, i64 %15
%17 = load i32, i32* %6
%18 = load i32, i32* %5
%19 = sub nsw i32 %17, %18
%20 = call i32 @memcpy(i8* %12, i8* %16, i32 %19)
%21 = load i8*, i8** %7
%22 = load i32, i32* %6
%23 = load i32, i32* %5
%24 = sub nsw i32 %22, %23
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds i8, i8* %21, i64 %25
store i8 0, i8* %26
%27 = load i8*, i8** %7
ret i8* %27
}

LLVM IR (-O2):
define i8* @substring(i8* %0, i32 %1, i32 %2) {
%4 = sub nsw i32 %2, %1
%5 = tail call i8* @malloc(i32 %4)
%6 = sext i32 %1 to i64
%7 = getelementptr inbounds i8, i8* %0, i64 %6
%8 = tail call i32 @memcpy(i8* %5, i8* %7, i32 %4)
%9 = sext i32 %4 to i64
%10 = getelementptr inbounds i8, i8* %5, i64 %9
store i8 0, i8* %10
ret i8* %5
}
void stu_hash_free_empty_pt(void *p) {}


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

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

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

LLVM IR (-O2):
define void @stu_hash_free_empty_pt(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, float);
int main(void) {
  int x = 10, y = 20, z;
  float m = 10.24, n = 9.68, o;
  z = y / x;
  o = m / n;
  printf("integer divission: %d\n", z);
  printf("floating point divission: %f\n", o);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xa,-0x8(%rbp)
movl   $0x14,-0xc(%rbp)
movss  0xecf(%rip),%xmm0
movss  %xmm0,-0x14(%rbp)
movss  0xebe(%rip),%xmm0
movss  %xmm0,-0x18(%rbp)
mov    -0xc(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %eax,-0x10(%rbp)
movss  -0x14(%rbp),%xmm0
divss  -0x18(%rbp),%xmm0
movss  %xmm0,-0x1c(%rbp)
cvtsi2ssl -0x10(%rbp),%xmm0
lea    0xe9c(%rip),%rdi
call   1030 <printf@plt>
movss  -0x1c(%rbp),%xmm0
lea    0xea2(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xef0(%rip),%rdi
movss  0xee0(%rip),%xmm0
call   1030 <printf@plt>
lea    0xef3(%rip),%rdi
movss  0xed0(%rip),%xmm0
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [23 x i8] c"integer divission: %d\0A\00"
@.str.1 = [30 x i8] c"floating point divission: %f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca float
%6 = alloca float
%7 = alloca float
store i32 0, i32* %1
store i32 10, i32* %2
store i32 20, i32* %3
store float 0x40247AE140000000, float* %5
store float 0x40235C2900000000, float* %6
%8 = load i32, i32* %3
%9 = load i32, i32* %2
%10 = sdiv i32 %8, %9
store i32 %10, i32* %4
%11 = load float, float* %5
%12 = load float, float* %6
%13 = fdiv float %11, %12
store float %13, float* %7
%14 = load i32, i32* %4
%15 = sitofp i32 %14 to float
%16 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), float %15)
%17 = load float, float* %7
%18 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0), float %17)
ret i32 0
}

LLVM IR (-O2):
@.str = [23 x i8] c"integer divission: %d\0A\00"
@.str.1 = [30 x i8] c"floating point divission: %f\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), float 2.000000e+00)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0), float 0x3FF0ECF560000000)
ret i32 0
}
/* Variables and functions */
size_t map(void **array, size_t len, void (*func)(void *)) {
  size_t i;
  for (i = 0; i < len; i++) {
    func(array[i]);
  }
  return i;
}


x86 assembly (clang, -O0):
<map>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x10(%rbp),%rax
jae    114d <map+0x4d>
mov    -0x18(%rbp),%rax
mov    -0x8(%rbp),%rcx
mov    -0x20(%rbp),%rdx
mov    (%rcx,%rdx,8),%rdi
call   *%rax
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    111c <map+0x1c>
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<map>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rsi,%r12
test   %rsi,%rsi
je     1130 <map+0x30>
mov    %rdx,%r14
mov    %rdi,%r15
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
mov    (%r15,%rbx,8),%rdi
call   *%r14
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1120 <map+0x20>
mov    %r12,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i64 @map(i8** %0, i64 %1, void (i8*)* %2) {
%4 = alloca i8**
%5 = alloca i64
%6 = alloca void (i8*)*
%7 = alloca i64
store i8** %0, i8*** %4
store i64 %1, i64* %5
store void (i8*)* %2, void (i8*)** %6
store i64 0, i64* %7
br label %8
8: ; preds = %18, %3
%9 = load i64, i64* %7
%10 = load i64, i64* %5
%11 = icmp ult i64 %9, %10
br i1 %11, label %12, label %21
12: ; preds = %8
%13 = load void (i8*)*, void (i8*)** %6
%14 = load i8**, i8*** %4
%15 = load i64, i64* %7
%16 = getelementptr inbounds i8*, i8** %14, i64 %15
%17 = load i8*, i8** %16
br label %18
18: ; preds = %12
%19 = load i64, i64* %7
%20 = add i64 %19, 1
store i64 %20, i64* %7
br label %8
21: ; preds = %8
%22 = load i64, i64* %7
ret i64 %22
}

LLVM IR (-O2):
define i64 @map(i8** nocapture %0, i64 %1, void (i8*)* nocapture %2) {
%4 = icmp eq i64 %1, 0
br i1 %4, label %11, label %5
5: ; preds = %3, %5
%6 = phi i64 [ %9, %5 ], [ 0, %3 ]
%7 = getelementptr inbounds i8*, i8** %0, i64 %6
%8 = load i8*, i8** %7
tail call void %2(i8* %8)
%9 = add nuw i64 %6, 1
%10 = icmp eq i64 %9, %1
br i1 %10, label %11, label %5
11: ; preds = %5, %3
ret i64 %1
}
void setPadDriveSys(int group, int value) { return; }


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

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

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

LLVM IR (-O2):
define void @setPadDriveSys(i32 %0, i32 %1) {
ret void
}
/* Variables and functions */
void *realloc(void *, size_t);
void *mem_try_realloc(void *ptr, size_t size) { return realloc(ptr, size); }


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

x86 assembly (clang, -O2):
<mem_try_realloc>:
jmp    1030 <realloc@plt>

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

LLVM IR (-O2):
define noalias i8* @mem_try_realloc(i8* nocapture %0, i64 %1) {
%3 = tail call i8* @realloc(i8* %0, i64 %1)
ret i8* %3
}
int isspace(int c) { return (c == ' ' ? 1 : 0); }


x86 assembly (clang, -O0):
<isspace>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0x20,%edx
cmove  %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isspace>:
xor    %eax,%eax
cmp    $0x20,%edi
sete   %al
ret

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

LLVM IR (-O2):
define i32 @isspace(i32 %0) {
%2 = icmp eq i32 %0, 32
%3 = zext i1 %2 to i32
ret i32 %3
}
FSIGNAL(sig, func) int *sig, *func;
{ return ((long)signal(*sig, (void (*)(int))func)); }


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

x86 assembly (clang, -O2):
<FSIGNAL>:
mov    (%rdi),%edi
xor    %eax,%eax
jmp    1030 <signal@plt>

LLVM IR (-O0):
define i32 @FSIGNAL(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* %5
%7 = load i32*, i32** %4
%8 = bitcast i32* %7 to void (i32)*
%9 = call i32 (i32, void (i32)*, ...) bitcast (i32 (...)* @signal to i32 (i32, void (i32)*, ...)*)(i32 %6, void (i32)* %8)
%10 = sext i32 %9 to i64
%11 = trunc i64 %10 to i32
ret i32 %11
}

LLVM IR (-O2):
define i32 @FSIGNAL(i32* nocapture %0, i32* %1) {
%3 = load i32, i32* %0
%4 = bitcast i32* %1 to void (i32)*
%5 = tail call i32 (i32, void (i32)*, ...) bitcast (i32 (...)* @signal to i32 (i32, void (i32)*, ...)*)(i32 %3, void (i32)* %4)
ret i32 %5
}
void g_hook_find_func() {}


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

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

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

LLVM IR (-O2):
define void @g_hook_find_func() {
ret void
}
int func(void) {
  int n = 3;
  int m = 5;
  n >>= m;
  return 0;
}


x86 assembly (clang, -O0):
<func>:
push   %rbp
mov    %rsp,%rbp
movl   $0x3,-0x4(%rbp)
movl   $0x5,-0x8(%rbp)
mov    -0x8(%rbp),%ecx
mov    -0x4(%rbp),%eax
sar    %cl,%eax
mov    %eax,-0x4(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @func() {
ret i32 0
}
/* Variables and functions */
char *process_substring(char const *, char const *);
int strlen(char const *);
char *get_separating_string(const char *istr) {
  return process_substring(istr, istr + strlen(istr));
}


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

x86 assembly (clang, -O2):
<get_separating_string>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
movslq %eax,%rsi
add    %rbx,%rsi
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <process_substring@plt>

LLVM IR (-O0):
define i8* @get_separating_string(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8*, i8** %2
%5 = load i8*, i8** %2
%6 = call i32 @strlen(i8* %5)
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds i8, i8* %4, i64 %7
%9 = call i8* @process_substring(i8* %3, i8* %8)
ret i8* %9
}

LLVM IR (-O2):
define i8* @get_separating_string(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = sext i32 %2 to i64
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = tail call i8* @process_substring(i8* %0, i8* %4)
ret i8* %5
}
/* Variables and functions */
scalar_t__ getllr(long long, long long);
int getir(int min, int max) {
  return (int)getllr((long long)min, (long long)max);
}


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

x86 assembly (clang, -O2):
<getir>:
movslq %edi,%rdi
movslq %esi,%rsi
jmp    1030 <getllr@plt>

LLVM IR (-O0):
define i32 @getir(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 = sext i32 %5 to i64
%7 = load i32, i32* %4
%8 = sext i32 %7 to i64
%9 = call i64 @getllr(i64 %6, i64 %8)
%10 = trunc i64 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @getir(i32 %0, i32 %1) {
%3 = sext i32 %0 to i64
%4 = sext i32 %1 to i64
%5 = tail call i64 @getllr(i64 %3, i64 %4)
%6 = trunc i64 %5 to i32
ret i32 %6
}
void defaultISR(void) {
#pragma diag_push
#pragma CHECK_ULP("-2.1")
  while (1) {
  }
#pragma diag_pop
}


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

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

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

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


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

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

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

LLVM IR (-O2):
define void @teardown_skx_debug() {
ret void
}
setup_exploit(unsigned long mem) {
  *((unsigned long *)(mem - 0x04)) = 0x81;
  *((unsigned long *)(mem + 0x00)) = mem + 0x20;
  *((unsigned long *)(mem + 0x08)) = mem + 0x28;
  *((unsigned long *)(mem + 0x1c)) = 0x85;
  *((unsigned long *)(mem + 0x24)) = mem;
  *((unsigned long *)(mem + 0x2c)) = mem + 8;
}


x86 assembly (clang, -O0):
<setup_exploit>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
sub    $0x4,%rax
movq   $0x81,(%rax)
mov    -0x10(%rbp),%rcx
add    $0x20,%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x10(%rbp),%rcx
add    $0x28,%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,0x8(%rax)
mov    -0x10(%rbp),%rax
movq   $0x85,0x1c(%rax)
mov    -0x10(%rbp),%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,0x24(%rax)
mov    -0x10(%rbp),%rcx
add    $0x8,%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,0x2c(%rax)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<setup_exploit>:
movq   $0x81,-0x4(%rdi)
lea    0x20(%rdi),%rax
mov    %rax,(%rdi)
lea    0x28(%rdi),%rax
lea    0x8(%rdi),%rcx
mov    %rax,0x8(%rdi)
movq   $0x85,0x1c(%rdi)
mov    %rdi,0x24(%rdi)
mov    %rcx,0x2c(%rdi)
ret

LLVM IR (-O0):
define i32 @setup_exploit(i64 %0) {
%2 = alloca i32
%3 = alloca i64
store i64 %0, i64* %3
%4 = load i64, i64* %3
%5 = sub i64 %4, 4
%6 = inttoptr i64 %5 to i64*
store i64 129, i64* %6
%7 = load i64, i64* %3
%8 = add i64 %7, 32
%9 = load i64, i64* %3
%10 = add i64 %9, 0
%11 = inttoptr i64 %10 to i64*
store i64 %8, i64* %11
%12 = load i64, i64* %3
%13 = add i64 %12, 40
%14 = load i64, i64* %3
%15 = add i64 %14, 8
%16 = inttoptr i64 %15 to i64*
store i64 %13, i64* %16
%17 = load i64, i64* %3
%18 = add i64 %17, 28
%19 = inttoptr i64 %18 to i64*
store i64 133, i64* %19
%20 = load i64, i64* %3
%21 = load i64, i64* %3
%22 = add i64 %21, 36
%23 = inttoptr i64 %22 to i64*
store i64 %20, i64* %23
%24 = load i64, i64* %3
%25 = add i64 %24, 8
%26 = load i64, i64* %3
%27 = add i64 %26, 44
%28 = inttoptr i64 %27 to i64*
store i64 %25, i64* %28
%29 = load i32, i32* %2
ret i32 %29
}

LLVM IR (-O2):
define i32 @setup_exploit(i64 %0) {
%2 = add i64 %0, -4
%3 = inttoptr i64 %2 to i64*
store i64 129, i64* %3
%4 = add i64 %0, 32
%5 = inttoptr i64 %0 to i64*
store i64 %4, i64* %5
%6 = add i64 %0, 40
%7 = add i64 %0, 8
%8 = inttoptr i64 %7 to i64*
store i64 %6, i64* %8
%9 = add i64 %0, 28
%10 = inttoptr i64 %9 to i64*
store i64 133, i64* %10
%11 = add i64 %0, 36
%12 = inttoptr i64 %11 to i64*
store i64 %0, i64* %12
%13 = add i64 %0, 44
%14 = inttoptr i64 %13 to i64*
store i64 %7, i64* %14
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
scalar_t__ system(char *);
int CSystem(char *Command) {
  if (system(Command) != 0)
    exit(0);
}


x86 assembly (clang, -O0):
<CSystem>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <system@plt>
cmp    $0x0,%rax
je     1146 <CSystem+0x26>
xor    %edi,%edi
call   1040 <exit@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CSystem>:
push   %rax
call   1030 <system@plt>
test   %rax,%rax
jne    112d <CSystem+0xd>
pop    %rcx
ret
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define i32 @CSystem(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = call i64 @system(i8* %4)
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = call i32 @exit(i32 0)
unreachable
9: ; preds = %1
%10 = load i32, i32* %2
ret i32 %10
}

LLVM IR (-O2):
define i32 @CSystem(i8* nocapture %0) {
%2 = tail call i64 @system(i8* %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @exit(i32 0)
unreachable
6: ; preds = %1
ret i32 undef
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ ASSERT(int);
uint32_t USBDMAChannelStatus(uint32_t ui32Base, uint32_t ui32Channel) {
  ASSERT(ui32Base == 0x40050000);
  ASSERT(ui32Channel < 8);
  return (
      (*((volatile uint32_t *)(ui32Base + 0x00000204 + (0x10 * ui32Channel)))) &
      0x00000100);
}


x86 assembly (clang, -O0):
<USBDMAChannelStatus>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x40050000,-0x4(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <ASSERT@plt>
cmpl   $0x8,-0x8(%rbp)
setl   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <ASSERT@plt>
mov    -0x4(%rbp),%eax
add    $0x204,%eax
mov    -0x8(%rbp),%ecx
shl    $0x4,%ecx
add    %ecx,%eax
cltq
mov    (%rax),%eax
and    $0x100,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<USBDMAChannelStatus>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
xor    %edi,%edi
cmp    $0x40050000,%ebp
sete   %dil
call   1030 <ASSERT@plt>
xor    %edi,%edi
cmp    $0x8,%ebx
setl   %dil
call   1030 <ASSERT@plt>
movslq %ebp,%rcx
movslq %ebx,%rdx
shl    $0x4,%rdx
mov    $0x100,%eax
and    0x204(%rcx,%rdx,1),%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @USBDMAChannelStatus(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 = icmp eq i32 %5, 1074069504
%7 = zext i1 %6 to i32
%8 = call i32 @ASSERT(i32 %7)
%9 = load i32, i32* %4
%10 = icmp slt i32 %9, 8
%11 = zext i1 %10 to i32
%12 = call i32 @ASSERT(i32 %11)
%13 = load i32, i32* %3
%14 = add nsw i32 %13, 516
%15 = load i32, i32* %4
%16 = mul nsw i32 16, %15
%17 = add nsw i32 %14, %16
%18 = sext i32 %17 to i64
%19 = inttoptr i64 %18 to i32*
%20 = load volatile i32, i32* %19
%21 = and i32 %20, 256
ret i32 %21
}

LLVM IR (-O2):
define i32 @USBDMAChannelStatus(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, 1074069504
%4 = zext i1 %3 to i32
%5 = tail call i32 @ASSERT(i32 %4)
%6 = icmp slt i32 %1, 8
%7 = zext i1 %6 to i32
%8 = tail call i32 @ASSERT(i32 %7)
%9 = add nsw i32 %0, 516
%10 = shl nsw i32 %1, 4
%11 = add nsw i32 %9, %10
%12 = sext i32 %11 to i64
%13 = inttoptr i64 %12 to i32*
%14 = load volatile i32, i32* %13
%15 = and i32 %14, 256
ret i32 %15
}
/* Variables and functions */
int /*<<< orphan*/ clear_Tablero();
int /*<<< orphan*/ pintaPelota();
int /*<<< orphan*/ pintaRaqueta();
void pintar(void) {
  clear_Tablero();
  pintaRaqueta();
  pintaPelota();
}


x86 assembly (clang, -O0):
<pintar>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1050 <clear_Tablero@plt>
mov    $0x0,%al
call   1030 <pintaRaqueta@plt>
mov    $0x0,%al
call   1040 <pintaPelota@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<pintar>:
push   %rax
xor    %eax,%eax
call   1050 <clear_Tablero@plt>
xor    %eax,%eax
call   1030 <pintaRaqueta@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <pintaPelota@plt>

LLVM IR (-O0):
define void @pintar() {
%1 = call i32 (...) @clear_Tablero()
%2 = call i32 (...) @pintaRaqueta()
%3 = call i32 (...) @pintaPelota()
ret void
}

LLVM IR (-O2):
define void @pintar() {
%1 = tail call i32 (...) @clear_Tablero()
%2 = tail call i32 (...) @pintaRaqueta()
%3 = tail call i32 (...) @pintaPelota()
ret void
}
/* Variables and functions */
size_t strlen(char *);
size_t str_len(char *str) {
  if (str == NULL)
    return (0);
  return (strlen(str));
}


x86 assembly (clang, -O0):
<str_len>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1134 <str_len+0x24>
movq   $0x0,-0x8(%rbp)
jmp    1141 <str_len+0x31>
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<str_len>:
test   %rdi,%rdi
je     111a <str_len+0xa>
jmp    1030 <strlen@plt>
xor    %eax,%eax
ret

LLVM IR (-O0):
define i64 @str_len(i8* %0) {
%2 = alloca i64
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = icmp eq i8* %4, null
br i1 %5, label %6, label %7
6: ; preds = %1
store i64 0, i64* %2
br label %10
7: ; preds = %1
%8 = load i8*, i8** %3
%9 = call i64 @strlen(i8* %8)
store i64 %9, i64* %2
br label %10
10: ; preds = %7, %6
%11 = load i64, i64* %2
ret i64 %11
}

LLVM IR (-O2):
define i64 @str_len(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i64 @strlen(i8* %0)
br label %5
5: ; preds = %1, %3
%6 = phi i64 [ %4, %3 ], [ 0, %1 ]
ret i64 %6
}
/* Variables and functions */
int atoi(char *);
int /*<<< orphan*/ printf(char *, char *, int);
int /*<<< orphan*/ scanf(char *, char *);
int main() {
  char s[12] = "";
  int i = 0;
  scanf("%s", s);
  i = atoi(s);
  printf("%s = %i \n", s, i);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x10(%rbp),%rdi
xor    %esi,%esi
mov    $0xc,%edx
call   1040 <memset@plt>
movl   $0x0,-0x14(%rbp)
lea    -0x10(%rbp),%rsi
lea    0xe8f(%rip),%rdi
call   1050 <scanf@plt>
lea    -0x10(%rbp),%rdi
call   1060 <atoi@plt>
mov    %eax,-0x14(%rbp)
lea    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
lea    0xe73(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
movl   $0x0,0x8(%rsp)
movq   $0x0,(%rsp)
lea    0xeb4(%rip),%rdi
mov    %rsp,%rbx
mov    %rbx,%rsi
call   1040 <scanf@plt>
mov    %rbx,%rdi
call   1050 <atoi@plt>
lea    0xe9d(%rip),%rdi
mov    %rbx,%rsi
mov    %eax,%edx
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
@.str.1 = [10 x i8] c"%s = %i \0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [12 x i8]
%3 = alloca i32
store i32 0, i32* %1
%4 = bitcast [12 x i8]* %2 to i8*
store i32 0, i32* %3
%5 = getelementptr inbounds [12 x i8], [12 x i8]* %2, i64 0, i64 0
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %5)
%7 = getelementptr inbounds [12 x i8], [12 x i8]* %2, i64 0, i64 0
%8 = call i32 @atoi(i8* %7)
store i32 %8, i32* %3
%9 = getelementptr inbounds [12 x i8], [12 x i8]* %2, i64 0, i64 0
%10 = load i32, i32* %3
%11 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8* %9, i32 %10)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
@.str.1 = [10 x i8] c"%s = %i \0A\00"
define i32 @main() {
%1 = alloca [12 x i8]
%2 = getelementptr inbounds [12 x i8], [12 x i8]* %1, i64 0, i64 0
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = call i32 @atoi(i8* %2)
%5 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8* %2, i32 %4)
ret i32 0
}
/* Variables and functions */
float FP_Exp(float);
float FP_Log(float);
float FP_Pow(float x, float y) { return FP_Exp(y * FP_Log(x)); }


x86 assembly (clang, -O0):
<FP_Pow>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <FP_Log@plt>
movaps %xmm0,%xmm1
movss  -0xc(%rbp),%xmm0
mulss  %xmm1,%xmm0
call   1040 <FP_Exp@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<FP_Pow>:
push   %rax
movss  %xmm1,0x4(%rsp)
call   1030 <FP_Log@plt>
mulss  0x4(%rsp),%xmm0
pop    %rax
jmp    1040 <FP_Exp@plt>

LLVM IR (-O0):
define float @FP_Pow(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %4
%6 = load float, float* %3
%7 = call float @FP_Log(float %6)
%8 = fmul float %5, %7
%9 = call float @FP_Exp(float %8)
ret float %9
}

LLVM IR (-O2):
define float @FP_Pow(float %0, float %1) {
%3 = tail call float @FP_Log(float %0)
%4 = fmul float %3, %1
%5 = tail call float @FP_Exp(float %4)
ret float %5
}
/* Variables and functions */
void g();
void f() { return g(); }


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

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

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

LLVM IR (-O2):
define void @f() {
tail call void (...) @g()
ret void
}
from_cu() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @from_cu() {
ret i32 0
}
/* Variables and functions */
int getc(int /*<<< orphan*/);
int /*<<< orphan*/ stdin;
int getchar() { return (getc(stdin)); }


x86 assembly (clang, -O0):
<getchar>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ecd(%rip),%rax
mov    (%rax),%edi
call   1030 <getc@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<getchar>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%edi
jmp    1030 <getc@plt>

LLVM IR (-O0):
@stdin = global i32 0
define i32 @getchar() {
%1 = load i32, i32* @stdin
%2 = call i32 @getc(i32 %1)
ret i32 %2
}

LLVM IR (-O2):
@stdin = global i32 0
define i32 @getchar() {
%1 = load i32, i32* @stdin
%2 = tail call i32 @getc(i32 %1)
ret i32 %2
}
/* Type definitions */
typedef scalar_t__ uint32_t;

/* Variables and functions */
void WatchdogEnable(uint32_t ui32Base) {
  ;
  (*((volatile unsigned long *)(ui32Base + 0x00000008))) |= 0x00000001;
}


x86 assembly (clang, -O0):
<WatchdogEnable>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%rcx
or     $0x1,%rcx
mov    %rcx,0x8(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<WatchdogEnable>:
orq    $0x1,0x8(%rdi)
ret

LLVM IR (-O0):
define void @WatchdogEnable(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = add nsw i64 %3, 8
%5 = inttoptr i64 %4 to i64*
%6 = load volatile i64, i64* %5
%7 = or i64 %6, 1
store volatile i64 %7, i64* %5
ret void
}

LLVM IR (-O2):
define void @WatchdogEnable(i64 %0) {
%2 = add nsw i64 %0, 8
%3 = inttoptr i64 %2 to i64*
%4 = load volatile i64, i64* %3
%5 = or i64 %4, 1
store volatile i64 %5, i64* %3
ret void
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  int function;
};
typedef TYPE_1__ XGCValues;

/* Variables and functions */
void set_XGCValues_function(void *_p, int _v) {
  ((XGCValues *)_p)->function = (int)_v;
}


x86 assembly (clang, -O0):
<set_XGCValues_function>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_XGCValues_function>:
mov    %esi,(%rdi)
ret

LLVM IR (-O0):
%struct.TYPE_2__ = type { i32 }
define void @set_XGCValues_function(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to %struct.TYPE_2__*
%8 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %7, i32 0, i32 0
store i32 %5, i32* %8
ret void
}

LLVM IR (-O2):
define void @set_XGCValues_function(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
store i32 %1, i32* %3
ret void
}
/* Type definitions */
typedef scalar_t__ uint8_t;
typedef int uint16_t;

/* Variables and functions */
__attribute__((always_)) void LEPackUint16(uint8_t container[2],
                                           uint16_t data) {
  container[0] = (uint8_t)data;
  container[1] = (uint8_t)(data >> 8);
}


x86 assembly (clang, -O0):
<LEPackUint16>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movslq -0xc(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
mov    -0xc(%rbp),%eax
sar    $0x8,%eax
movslq %eax,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,0x8(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<LEPackUint16>:
movslq %esi,%rax
mov    %rax,(%rdi)
sar    $0x8,%eax
cltq
mov    %rax,0x8(%rdi)
ret

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

LLVM IR (-O2):
define void @LEPackUint16(i64* nocapture writeonly %0, i32 %1) {
%3 = sext i32 %1 to i64
store i64 %3, i64* %0
%4 = ashr i32 %1, 8
%5 = sext i32 %4 to i64
%6 = getelementptr inbounds i64, i64* %0, i64 1
store i64 %5, i64* %6
ret void
}
/* Type definitions */
struct node {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ append(struct node **, int);
int count(struct node *);
int /*<<< orphan*/ printf(char *, int);
main() {
  struct node *p;
  p = NULL;
  printf("\n elements in linked list=%d", count(p));
  append(&p, 1);
  append(&p, 2);
  append(&p, 17);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <count@plt>
mov    %eax,%esi
lea    0xeae(%rip),%rdi
call   1050 <printf@plt>
lea    -0x8(%rbp),%rdi
mov    $0x1,%esi
call   1040 <append@plt>
lea    -0x8(%rbp),%rdi
mov    $0x2,%esi
call   1040 <append@plt>
lea    -0x8(%rbp),%rdi
mov    $0x11,%esi
call   1040 <append@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
movq   $0x0,0x8(%rsp)
xor    %edi,%edi
call   1030 <count@plt>
lea    0xeb4(%rip),%rdi
mov    %eax,%esi
call   1050 <printf@plt>
lea    0x8(%rsp),%rbx
mov    %rbx,%rdi
mov    $0x1,%esi
call   1040 <append@plt>
mov    %rbx,%rdi
mov    $0x2,%esi
call   1040 <append@plt>
mov    %rbx,%rdi
mov    $0x11,%esi
call   1040 <append@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.node = type { i32 }
@.str = [29 x i8] c"\0A elements in linked list=%d\00"
define i32 @main() {
%1 = alloca %struct.node*
store %struct.node* null, %struct.node** %1
%2 = load %struct.node*, %struct.node** %1
%3 = call i32 @count(%struct.node* %2)
%4 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = call i32 @append(%struct.node** %1, i32 1)
%6 = call i32 @append(%struct.node** %1, i32 2)
%7 = call i32 @append(%struct.node** %1, i32 17)
ret i32 0
}

LLVM IR (-O2):
%struct.node = type { i32 }
@.str = [29 x i8] c"\0A elements in linked list=%d\00"
define i32 @main() {
%1 = alloca %struct.node*
%2 = bitcast %struct.node** %1 to i8*
store %struct.node* null, %struct.node** %1
%3 = tail call i32 @count(%struct.node* null)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = call i32 @append(%struct.node** %1, i32 1)
%6 = call i32 @append(%struct.node** %1, i32 2)
%7 = call i32 @append(%struct.node** %1, i32 17)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
int /*<<< orphan*/ system(char *);
int exec_command(char *cmd) {
  system(cmd);
  free(cmd);
  return 0;
}


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

x86 assembly (clang, -O2):
<exec_command>:
push   %rbx
mov    %rdi,%rbx
call   1040 <system@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @exec_command(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @system(i8* %3)
%5 = load i8*, i8** %2
%6 = call i32 @free(i8* %5)
ret i32 0
}

LLVM IR (-O2):
define i32 @exec_command(i8* nocapture %0) {
%2 = tail call i32 @system(i8* %0)
%3 = tail call i32 @free(i8* %0)
ret i32 0
}
void makeFuncStub() {}


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

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

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

LLVM IR (-O2):
define void @makeFuncStub() {
ret void
}