xunge/DecIR huggingface dataset:
/* Variables and functions */
int log2_64(size_t);
scalar_t__ size_in_tiny(size_t);
size_t size_to_block_size(size_t size) {
  if (size_in_tiny(size))
    return (size + (16 - 1)) & ~(16 - 1);
  return 1UL << (log2_64(size - 1) + 1);
}


x86 assembly (clang, -O0):
<size_to_block_size>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <size_in_tiny@plt>
cmp    $0x0,%rax
je     1154 <size_to_block_size+0x34>
mov    -0x10(%rbp),%rax
add    $0xf,%rax
and    $0xfffffffffffffff0,%rax
mov    %rax,-0x8(%rbp)
jmp    1174 <size_to_block_size+0x54>
mov    -0x10(%rbp),%rdi
sub    $0x1,%rdi
call   1040 <log2_64@plt>
add    $0x1,%eax
mov    %eax,%eax
mov    %eax,%ecx
mov    $0x1,%eax
shl    %cl,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<size_to_block_size>:
push   %rbx
mov    %rdi,%rbx
call   1030 <size_in_tiny@plt>
test   %rax,%rax
je     1138 <size_to_block_size+0x18>
add    $0xf,%rbx
and    $0xfffffffffffffff0,%rbx
jmp    114f <size_to_block_size+0x2f>
add    $0xffffffffffffffff,%rbx
mov    %rbx,%rdi
call   1040 <log2_64@plt>
lea    0x1(%rax),%ecx
mov    $0x1,%ebx
shl    %cl,%rbx
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i64 @size_to_block_size(i64 %0) {
%2 = alloca i64
%3 = alloca i64
store i64 %0, i64* %3
%4 = load i64, i64* %3
%5 = call i64 @size_in_tiny(i64 %4)
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %11
7: ; preds = %1
%8 = load i64, i64* %3
%9 = add i64 %8, 15
%10 = and i64 %9, -16
store i64 %10, i64* %2
br label %18
11: ; preds = %1
%12 = load i64, i64* %3
%13 = sub i64 %12, 1
%14 = call i32 @log2_64(i64 %13)
%15 = add nsw i32 %14, 1
%16 = zext i32 %15 to i64
%17 = shl i64 1, %16
store i64 %17, i64* %2
br label %18
18: ; preds = %11, %7
%19 = load i64, i64* %2
ret i64 %19
}

LLVM IR (-O2):
define i64 @size_to_block_size(i64 %0) {
%2 = tail call i64 @size_in_tiny(i64 %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %7, label %4
4: ; preds = %1
%5 = add i64 %0, 15
%6 = and i64 %5, -16
br label %13
7: ; preds = %1
%8 = add i64 %0, -1
%9 = tail call i32 @log2_64(i64 %8)
%10 = add nsw i32 %9, 1
%11 = zext i32 %10 to i64
%12 = shl nuw i64 1, %11
br label %13
13: ; preds = %7, %4
%14 = phi i64 [ %6, %4 ], [ %12, %7 ]
ret i64 %14
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *, int);
int title_to_number(char const *);
int main(void) {
  const char *s = "ABA";
  printf("%s --> %d\n", s, title_to_number(s));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <title_to_number@plt>
mov    -0x18(%rbp),%rsi
mov    %eax,%edx
lea    0xeac(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xed8(%rip),%rbx
mov    %rbx,%rdi
call   1040 <title_to_number@plt>
lea    0xecd(%rip),%rdi
mov    %rbx,%rsi
mov    %eax,%edx
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"ABA\00"
@.str.1 = [11 x i8] c"%s --> %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
store i32 0, i32* %1
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8** %2
%3 = load i8*, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @title_to_number(i8* %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i8* %3, i32 %5)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"ABA\00"
@.str.1 = [11 x i8] c"%s --> %d\0A\00"
define i32 @main() {
%1 = tail call i32 @title_to_number(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int proc(char *, int);
int /*<<< orphan*/ scanf(char *, char *);
int main() {
  char s[100];
  scanf("%s", s);
  if (proc(s, 1) == 1)
    printf("Yes\n");
  else
    printf("No\n");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x70(%rbp),%rsi
lea    0xeb6(%rip),%rdi
call   1050 <scanf@plt>
lea    -0x70(%rbp),%rdi
mov    $0x1,%esi
call   1040 <proc@plt>
cmp    $0x1,%eax
jne    1177 <main+0x47>
lea    0xe96(%rip),%rdi
call   1030 <printf@plt>
jmp    1183 <main+0x53>
lea    0xe8a(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x70,%rsp
lea    0xec4(%rip),%rdi
mov    %rsp,%rbx
mov    %rbx,%rsi
call   1050 <scanf@plt>
mov    %rbx,%rdi
mov    $0x1,%esi
call   1040 <proc@plt>
cmp    $0x1,%eax
lea    0xea8(%rip),%rax
lea    0xe9e(%rip),%rdi
cmove  %rax,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
@.str.1 = [5 x i8] c"Yes\0A\00"
@.str.2 = [4 x i8] c"No\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [100 x i8]
store i32 0, i32* %1
%3 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%6 = call i32 @proc(i8* %5, i32 1)
%7 = icmp eq i32 %6, 1
br i1 %7, label %8, label %10
8: ; preds = %0
%9 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
br label %12
10: ; preds = %0
%11 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
br label %12
12: ; preds = %10, %8
%13 = load i32, i32* %1
ret i32 %13
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
@str = [3 x i8] c"No\00"
@str.3 = [4 x i8] c"Yes\00"
define i32 @main() {
%1 = alloca [100 x i8]
%2 = getelementptr inbounds [100 x i8], [100 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 @proc(i8* %2, i32 1)
%5 = icmp eq i32 %4, 1
%6 = select i1 %5, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @str.3, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @str, i64 0, i64 0)
%7 = call i32 @puts(i8* dereferenceable(1) %6)
ret i32 0
}
char *jRead_atoi(char *p, unsigned int *result) {
  unsigned int x = 0;
  while (*p >= '0' && *p <= '9') {
    x = (x * 10) + (*p - '0');
    ++p;
  }
  *result = x;
  return p;
}


x86 assembly (clang, -O0):
<jRead_atoi>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x30,%ecx
mov    %al,-0x15(%rbp)
jl     1138 <jRead_atoi+0x38>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x39,%eax
setle  %al
mov    %al,-0x15(%rbp)
mov    -0x15(%rbp),%al
test   $0x1,%al
jne    1148 <jRead_atoi+0x48>
jmp    116c <jRead_atoi+0x6c>
imul   $0xa,-0x14(%rbp),%eax
mov    -0x8(%rbp),%rcx
movsbl (%rcx),%ecx
sub    $0x30,%ecx
add    %ecx,%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1113 <jRead_atoi+0x13>
mov    -0x14(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<jRead_atoi>:
mov    %rdi,%rax
mov    (%rdi),%dl
lea    -0x30(%rdx),%edi
xor    %ecx,%ecx
cmp    $0x9,%dil
ja     113d <jRead_atoi+0x3d>
xor    %ecx,%ecx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movzbl %dl,%edx
lea    (%rcx,%rcx,4),%ecx
lea    (%rdx,%rcx,2),%ecx
add    $0xffffffd0,%ecx
movzbl 0x1(%rax),%edx
add    $0x1,%rax
lea    -0x30(%rdx),%edi
cmp    $0xa,%dil
jb     1120 <jRead_atoi+0x20>
mov    %ecx,(%rsi)
ret

LLVM IR (-O0):
define i8* @jRead_atoi(i8* %0, i32* %1) {
%3 = alloca i8*
%4 = alloca i32*
%5 = alloca i32
store i8* %0, i8** %3
store i32* %1, i32** %4
store i32 0, i32* %5
br label %6
6: ; preds = %18, %2
%7 = load i8*, i8** %3
%8 = load i8, i8* %7
%9 = sext i8 %8 to i32
%10 = icmp sge i32 %9, 48
br i1 %10, label %11, label %16
11: ; preds = %6
%12 = load i8*, i8** %3
%13 = load i8, i8* %12
%14 = sext i8 %13 to i32
%15 = icmp sle i32 %14, 57
br label %16
16: ; preds = %11, %6
%17 = phi i1 [ false, %6 ], [ %15, %11 ]
br i1 %17, label %18, label %28
18: ; preds = %16
%19 = load i32, i32* %5
%20 = mul i32 %19, 10
%21 = load i8*, i8** %3
%22 = load i8, i8* %21
%23 = sext i8 %22 to i32
%24 = sub nsw i32 %23, 48
%25 = add i32 %20, %24
store i32 %25, i32* %5
%26 = load i8*, i8** %3
%27 = getelementptr inbounds i8, i8* %26, i32 1
store i8* %27, i8** %3
br label %6
28: ; preds = %16
%29 = load i32, i32* %5
%30 = load i32*, i32** %4
store i32 %29, i32* %30
%31 = load i8*, i8** %3
ret i8* %31
}

LLVM IR (-O2):
define i8* @jRead_atoi(i8* %0, i32* nocapture writeonly %1) {
%3 = load i8, i8* %0
%4 = add i8 %3, -48
%5 = icmp ult i8 %4, 10
br i1 %5, label %6, label %18
6: ; preds = %2, %6
%7 = phi i8 [ %15, %6 ], [ %3, %2 ]
%8 = phi i32 [ %13, %6 ], [ 0, %2 ]
%9 = phi i8* [ %14, %6 ], [ %0, %2 ]
%10 = zext i8 %7 to i32
%11 = mul i32 %8, 10
%12 = add i32 %11, -48
%13 = add i32 %12, %10
%14 = getelementptr inbounds i8, i8* %9, i64 1
%15 = load i8, i8* %14
%16 = add i8 %15, -48
%17 = icmp ult i8 %16, 10
br i1 %17, label %6, label %18
18: ; preds = %6, %2
%19 = phi i8* [ %0, %2 ], [ %14, %6 ]
%20 = phi i32 [ 0, %2 ], [ %13, %6 ]
store i32 %20, i32* %1
ret i8* %19
}
/* Type definitions */
struct jx {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ advance_object_iter(struct jx *, void **);
char const *jx_get_key(void **);
const char *jx_iterate_keys(struct jx *j, void **i) {
  advance_object_iter(j, i);
  return jx_get_key(i);
}


x86 assembly (clang, -O0):
<jx_iterate_keys>:
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   1040 <advance_object_iter@plt>
mov    -0x10(%rbp),%rdi
call   1030 <jx_get_key@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<jx_iterate_keys>:
push   %rbx
mov    %rsi,%rbx
call   1040 <advance_object_iter@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <jx_get_key@plt>

LLVM IR (-O0):
%struct.jx = type { i32 }
define i8* @jx_iterate_keys(%struct.jx* %0, i8** %1) {
%3 = alloca %struct.jx*
%4 = alloca i8**
store %struct.jx* %0, %struct.jx** %3
store i8** %1, i8*** %4
%5 = load %struct.jx*, %struct.jx** %3
%6 = load i8**, i8*** %4
%7 = call i32 @advance_object_iter(%struct.jx* %5, i8** %6)
%8 = load i8**, i8*** %4
%9 = call i8* @jx_get_key(i8** %8)
ret i8* %9
}

LLVM IR (-O2):
%struct.jx = type { i32 }
define i8* @jx_iterate_keys(%struct.jx* %0, i8** %1) {
%3 = tail call i32 @advance_object_iter(%struct.jx* %0, i8** %1)
%4 = tail call i8* @jx_get_key(i8** %1)
ret i8* %4
}
/* Variables and functions */
int putchar(char);
int puts(const char *str) {
  int c;
  while ((c = *str++) != '\0')
    putchar(c);
  return (putchar('\n'));
}


x86 assembly (clang, -O0):
<puts>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%eax
mov    %eax,-0xc(%rbp)
cmp    $0x0,%eax
je     114a <puts+0x3a>
mov    -0xc(%rbp),%eax
movsbl %al,%edi
call   1030 <putchar@plt>
jmp    111c <puts+0xc>
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<puts>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1133 <puts+0x23>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movsbl %al,%edi
call   1030 <putchar@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <puts+0x10>
mov    $0xa,%edi
pop    %rbx
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
define i32 @puts(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %9, %4 ], [ %2, %1 ]
%6 = phi i8* [ %7, %4 ], [ %0, %1 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = tail call i32 @putchar(i8 signext %5)
%9 = load i8, i8* %7
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
%12 = tail call i32 @putchar(i8 signext 10)
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int extw(unsigned int b) {
  assert(b < 0x100);
  if (b & 0x80) {
    long v = -256;
    return (v | b);
  }
  return b;
}


x86 assembly (clang, -O0):
<extw>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x100,-0x8(%rbp)
setb   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x8(%rbp),%eax
and    $0x80,%eax
cmp    $0x0,%eax
je     115a <extw+0x4a>
movq   $0xffffffffffffff00,-0x10(%rbp)
ff
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%ecx
or     %rcx,%rax
mov    %eax,-0x4(%rbp)
jmp    1160 <extw+0x50>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<extw>:
push   %rbx
mov    %edi,%ebx
xor    %edi,%edi
cmp    $0x100,%ebx
setb   %dil
call   1030 <assert@plt>
mov    %ebx,%eax
or     $0xffffff00,%eax
test   $0x80,%bl
cmove  %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @extw(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i64
store i32 %0, i32* %3
%5 = load i32, i32* %3
%6 = icmp ult i32 %5, 256
%7 = zext i1 %6 to i32
%8 = call i32 @assert(i32 %7)
%9 = load i32, i32* %3
%10 = and i32 %9, 128
%11 = icmp ne i32 %10, 0
br i1 %11, label %12, label %18
12: ; preds = %1
store i64 -256, i64* %4
%13 = load i64, i64* %4
%14 = load i32, i32* %3
%15 = zext i32 %14 to i64
%16 = or i64 %13, %15
%17 = trunc i64 %16 to i32
store i32 %17, i32* %2
br label %20
18: ; preds = %1
%19 = load i32, i32* %3
store i32 %19, i32* %2
br label %20
20: ; preds = %18, %12
%21 = load i32, i32* %2
ret i32 %21
}

LLVM IR (-O2):
define i32 @extw(i32 %0) {
%2 = icmp ult i32 %0, 256
%3 = zext i1 %2 to i32
%4 = tail call i32 @assert(i32 %3)
%5 = and i32 %0, 128
%6 = icmp eq i32 %5, 0
%7 = or i32 %0, -256
%8 = select i1 %6, i32 %0, i32 %7
ret i32 %8
}
void debug_dump_memory_bytes(const void *mem, int len) {
  *((volatile unsigned int *)((
      ((((((((0xf0000000)) + (4 * 1024 * 1024)) + (4 * 1024 * 1024)) +
          (4 * 1024 * 1024)) +
         (4 * 1024 * 1024)) +
        (4 * 1024 * 1024)) +
       (4 * 1024 * 1024)) +
      12))) = (unsigned int)mem;
  *((volatile unsigned int *)((
      ((((((((0xf0000000)) + (4 * 1024 * 1024)) + (4 * 1024 * 1024)) +
          (4 * 1024 * 1024)) +
         (4 * 1024 * 1024)) +
        (4 * 1024 * 1024)) +
       (4 * 1024 * 1024)) +
      16))) = len;
  *((volatile unsigned int *)((
      ((((((((0xf0000000)) + (4 * 1024 * 1024)) + (4 * 1024 * 1024)) +
          (4 * 1024 * 1024)) +
         (4 * 1024 * 1024)) +
        (4 * 1024 * 1024)) +
       (4 * 1024 * 1024)) +
      20))) = 1;
}


x86 assembly (clang, -O0):
<debug_dump_memory_bytes>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %eax,%ecx
mov    $0xf180000c,%eax
mov    %ecx,(%rax)
mov    -0xc(%rbp),%ecx
mov    $0xf1800010,%eax
mov    %ecx,(%rax)
mov    $0xf1800014,%eax
movl   $0x1,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<debug_dump_memory_bytes>:
mov    $0xf180000c,%eax
mov    %edi,(%rax)
mov    %esi,0x4(%rax)
movl   $0x1,0x8(%rax)
ret

LLVM IR (-O0):
define void @debug_dump_memory_bytes(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = ptrtoint i8* %5 to i32
store volatile i32 %6, i32* inttoptr (i64 4051697676 to i32*)
%7 = load i32, i32* %4
store volatile i32 %7, i32* inttoptr (i64 4051697680 to i32*)
store volatile i32 1, i32* inttoptr (i64 4051697684 to i32*)
ret void
}

LLVM IR (-O2):
define void @debug_dump_memory_bytes(i8* %0, i32 %1) {
%3 = ptrtoint i8* %0 to i64
%4 = trunc i64 %3 to i32
store volatile i32 %4, i32* inttoptr (i64 4051697676 to i32*)
store volatile i32 %1, i32* inttoptr (i64 4051697680 to i32*)
store volatile i32 1, i32* inttoptr (i64 4051697684 to i32*)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ a();
int /*<<< orphan*/ g();
void d() {
  a();
  g();
}


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

x86 assembly (clang, -O2):
<d>:
push   %rax
xor    %eax,%eax
call   1040 <a@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <g@plt>

LLVM IR (-O0):
define void @d() {
%1 = call i32 (...) @a()
%2 = call i32 (...) @g()
ret void
}

LLVM IR (-O2):
define void @d() {
%1 = tail call i32 (...) @a()
%2 = tail call i32 (...) @g()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ENOTSUP;
int /*<<< orphan*/ errno;
int remove(const char *pathname) {
  errno = ENOTSUP;
  return 1;
}


x86 assembly (clang, -O0):
<remove>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    0x2ed9(%rip),%rax
mov    (%rax),%ecx
mov    0x2ec0(%rip),%rax
mov    %ecx,(%rax)
mov    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<remove>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%eax
mov    0x2ec8(%rip),%rcx
mov    %eax,(%rcx)
mov    $0x1,%eax
ret

LLVM IR (-O0):
@ENOTSUP = global i32 0
@errno = global i32 0
define i32 @remove(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @ENOTSUP
store i32 %3, i32* @errno
ret i32 1
}

LLVM IR (-O2):
@ENOTSUP = global i32 0
@errno = global i32 0
define i32 @remove(i8* nocapture readnone %0) {
%2 = load i32, i32* @ENOTSUP
store i32 %2, i32* @errno
ret i32 1
}
/* Type definitions */
struct field {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ __print_bin(struct field const *, char *, int);
void print_bin_rev(const struct field *field) { __print_bin(field, "", true); }


x86 assembly (clang, -O0):
<print_bin_rev>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xed9(%rip),%rsi
mov    $0x1,%edx
call   1030 <__print_bin@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_bin_rev>:
lea    0xee9(%rip),%rsi
mov    $0x1,%edx
jmp    1030 <__print_bin@plt>

LLVM IR (-O0):
%struct.field = type { i32 }
@.str = [1 x i8] zeroinitializer
define void @print_bin_rev(%struct.field* %0) {
%2 = alloca %struct.field*
store %struct.field* %0, %struct.field** %2
%3 = load %struct.field*, %struct.field** %2
%4 = call i32 @__print_bin(%struct.field* %3, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i32 1)
ret void
}

LLVM IR (-O2):
%struct.field = type { i32 }
@.str = [1 x i8] zeroinitializer
define void @print_bin_rev(%struct.field* %0) {
%2 = tail call i32 @__print_bin(%struct.field* %0, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ redecl4();
void useRedecl4() { redecl4(); }


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

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

LLVM IR (-O0):
define void @useRedecl4() {
%1 = call i32 (...) @redecl4()
ret void
}

LLVM IR (-O2):
define void @useRedecl4() {
%1 = tail call i32 (...) @redecl4()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ log_info(char *);
void json_print_level(int level) {
  while (level-- > 0)
    log_info("  ");
}


x86 assembly (clang, -O0):
<json_print_level>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x4(%rbp)
cmp    $0x0,%eax
jle    1140 <json_print_level+0x30>
lea    0xeca(%rip),%rdi
call   1030 <log_info@plt>
jmp    111b <json_print_level+0xb>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<json_print_level>:
push   %r14
push   %rbx
push   %rax
test   %edi,%edi
jle    1140 <json_print_level+0x30>
mov    %edi,%ebx
add    $0x1,%ebx
lea    0xedc(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %r14,%rdi
call   1030 <log_info@plt>
add    $0xffffffff,%ebx
cmp    $0x1,%ebx
ja     1130 <json_print_level+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [3 x i8] c" \00"
define void @json_print_level(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
br label %3
3: ; preds = %7, %1
%4 = load i32, i32* %2
%5 = add nsw i32 %4, -1
store i32 %5, i32* %2
%6 = icmp sgt i32 %4, 0
br i1 %6, label %7, label %9
7: ; preds = %3
%8 = call i32 @log_info(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
br label %3
9: ; preds = %3
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c" \00"
define void @json_print_level(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %8
3: ; preds = %1, %3
%4 = phi i32 [ %5, %3 ], [ %0, %1 ]
%5 = add nsw i32 %4, -1
%6 = tail call i32 @log_info(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%7 = icmp ugt i32 %4, 1
br i1 %7, label %3, label %8
8: ; preds = %3, %1
ret void
}
/* Variables and functions */
int *reallocarray(int *, size_t, int);
size_t add_to_int_array(int **array, size_t len, int what) {
  int *p;
  p = reallocarray(*array, len + 1, sizeof(*p));
  if (p != NULL) {
    *array = p;
    (*array)[len++] = what;
  }
  return len;
}


x86 assembly (clang, -O0):
<add_to_int_array>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
mov    -0x10(%rbp),%rsi
add    $0x1,%rsi
mov    $0x4,%edx
call   1030 <reallocarray@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     1172 <add_to_int_array+0x62>
mov    -0x20(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x14(%rbp),%edx
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    -0x10(%rbp),%rcx
mov    %rcx,%rsi
add    $0x1,%rsi
mov    %rsi,-0x10(%rbp)
mov    %edx,(%rax,%rcx,4)
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<add_to_int_array>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %edx,%r15d
mov    %rsi,%r14
mov    %rdi,%rbp
mov    (%rdi),%rdi
lea    0x1(%rsi),%rbx
mov    %rbx,%rsi
mov    $0x4,%edx
call   1030 <reallocarray@plt>
test   %rax,%rax
je     1143 <add_to_int_array+0x33>
mov    %rax,0x0(%rbp)
mov    %r15d,(%rax,%r14,4)
jmp    1146 <add_to_int_array+0x36>
mov    %r14,%rbx
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define i64 @add_to_int_array(i32** nocapture %0, i64 %1, i32 %2) {
%4 = load i32*, i32** %0
%5 = add i64 %1, 1
%6 = tail call i32* @reallocarray(i32* %4, i64 %5, i32 4)
%7 = icmp eq i32* %6, null
br i1 %7, label %10, label %8
8: ; preds = %3
store i32* %6, i32** %0
%9 = getelementptr inbounds i32, i32* %6, i64 %1
store i32 %2, i32* %9
br label %10
10: ; preds = %8, %3
%11 = phi i64 [ %5, %8 ], [ %1, %3 ]
ret i64 %11
}
/* Variables and functions */
int /*<<< orphan*/ kill_pppd_by_cmd(int);
scalar_t__ kill_pppd_by_pid(int);
void stop_second_session(void) {
  if (kill_pppd_by_pid(1) == 0)
    kill_pppd_by_cmd(1);
}


x86 assembly (clang, -O0):
<stop_second_session>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1030 <kill_pppd_by_pid@plt>
cmp    $0x0,%rax
jne    1142 <stop_second_session+0x22>
mov    $0x1,%edi
call   1040 <kill_pppd_by_cmd@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<stop_second_session>:
push   %rax
mov    $0x1,%edi
call   1030 <kill_pppd_by_pid@plt>
test   %rax,%rax
je     1132 <stop_second_session+0x12>
pop    %rax
ret
mov    $0x1,%edi
pop    %rax
jmp    1040 <kill_pppd_by_cmd@plt>

LLVM IR (-O0):
define void @stop_second_session() {
%1 = call i64 @kill_pppd_by_pid(i32 1)
%2 = icmp eq i64 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = call i32 @kill_pppd_by_cmd(i32 1)
br label %5
5: ; preds = %3, %0
ret void
}

LLVM IR (-O2):
define void @stop_second_session() {
%1 = tail call i64 @kill_pppd_by_pid(i32 1)
%2 = icmp eq i64 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 @kill_pppd_by_cmd(i32 1)
br label %5
5: ; preds = %3, %0
ret void
}
void recode_LF_to_NUL(char *string) {
  while (*string != '\0') {
    if (*string == '\n')
      *string = '\0';
    string++;
  }
}


x86 assembly (clang, -O0):
<recode_LF_to_NUL>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1140 <recode_LF_to_NUL+0x40>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0xa,%eax
jne    112f <recode_LF_to_NUL+0x2f>
mov    -0x8(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1108 <recode_LF_to_NUL+0x8>
pop    %rbp
ret

x86 assembly (clang, -O2):
<recode_LF_to_NUL>:
jmp    1117 <recode_LF_to_NUL+0x17>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movb   $0x0,(%rdi)
add    $0x1,%rdi
movzbl (%rdi),%eax
cmp    $0xa,%al
je     1110 <recode_LF_to_NUL+0x10>
test   %al,%al
jne    1113 <recode_LF_to_NUL+0x13>
ret

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

LLVM IR (-O2):
define void @recode_LF_to_NUL(i8* nocapture %0) {
br label %2
2: ; preds = %6, %1
%3 = phi i8* [ %0, %1 ], [ %7, %6 ]
%4 = load i8, i8* %3
switch i8 %4, label %6 [
i8 0, label %8
i8 10, label %5
]
5: ; preds = %2
store i8 0, i8* %3
br label %6
6: ; preds = %2, %5
%7 = getelementptr inbounds i8, i8* %3, i64 1
br label %2
8: ; preds = %2
ret void
}
/* Variables and functions */
int mod3fn1(int);
int /*<<< orphan*/ puts(char *);
int mod3fn2(int x) {
  puts("in mod3fn2");
  return mod3fn1(x / 2) * 2;
}


x86 assembly (clang, -O0):
<mod3fn2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xece(%rip),%rdi
call   1030 <puts@plt>
mov    -0x4(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%edi
call   1040 <mod3fn1@plt>
shl    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mod3fn2>:
push   %rbx
mov    %edi,%ebx
lea    0xed6(%rip),%rdi
call   1030 <puts@plt>
mov    %ebx,%edi
shr    $0x1f,%edi
add    %ebx,%edi
sar    %edi
call   1040 <mod3fn1@plt>
add    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [11 x i8] c"in mod3fn2\00"
define i32 @mod3fn2(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @puts(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* %2
%5 = sdiv i32 %4, 2
%6 = call i32 @mod3fn1(i32 %5)
%7 = mul nsw i32 %6, 2
ret i32 %7
}

LLVM IR (-O2):
@.str = [11 x i8] c"in mod3fn2\00"
define i32 @mod3fn2(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%3 = sdiv i32 %0, 2
%4 = tail call i32 @mod3fn1(i32 %3)
%5 = shl nsw i32 %4, 1
ret i32 %5
}
/* Variables and functions */
unsigned long *calloc(unsigned long, int);
unsigned long **malloc(unsigned long);
unsigned long *restrict *make_buffer(unsigned long n, unsigned long m) {
  unsigned long i;
  unsigned long *restrict *restrict rc = malloc(n * sizeof(unsigned long *));
  for (i = 0; i < n; i++)
    rc[i] = calloc(m, sizeof(unsigned long));
  return rc;
}


x86 assembly (clang, -O0):
<make_buffer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
shl    $0x3,%rdi
call   1040 <malloc@plt>
mov    %rax,-0x20(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x8(%rbp),%rax
jae    1185 <make_buffer+0x65>
mov    -0x10(%rbp),%rdi
mov    $0x8,%esi
call   1030 <calloc@plt>
mov    %rax,%rdx
mov    -0x20(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    %rdx,(%rax,%rcx,8)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1149 <make_buffer+0x29>
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<make_buffer>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%r15
lea    0x0(,%rdi,8),%rdi
call   1040 <malloc@plt>
mov    %rax,%r12
test   %r15,%r15
je     116a <make_buffer+0x4a>
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nop
mov    %r14,%rdi
mov    $0x8,%esi
call   1030 <calloc@plt>
mov    %rax,(%r12,%rbx,8)
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1150 <make_buffer+0x30>
mov    %r12,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define noalias i64** @make_buffer(i64 %0, i64 %1) {
%3 = shl i64 %0, 3
%4 = tail call i64** @malloc(i64 %3)
%5 = icmp eq i64 %0, 0
br i1 %5, label %12, label %6
6: ; preds = %2, %6
%7 = phi i64 [ %10, %6 ], [ 0, %2 ]
%8 = tail call i64* @calloc(i64 %1, i32 8)
%9 = getelementptr inbounds i64*, i64** %4, i64 %7
store i64* %8, i64** %9
%10 = add nuw i64 %7, 1
%11 = icmp eq i64 %10, %0
br i1 %11, label %12, label %6
12: ; preds = %6, %2
ret i64** %4
}
/* Type definitions */
typedef int /*<<< orphan*/ volatile uint16_t;

/* Variables and functions */
uint16_t st103_get_istr(void) {
  return *((volatile uint16_t *)((0x40005C00UL) + 0x44));
}


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

x86 assembly (clang, -O2):
<st103_get_istr>:
mov    0x40005c44,%eax
ret

LLVM IR (-O0):
define i32 @st103_get_istr() {
%1 = load volatile i32, i32* inttoptr (i64 1073765444 to i32*)
ret i32 %1
}

LLVM IR (-O2):
define i32 @st103_get_istr() {
%1 = load volatile i32, i32* inttoptr (i64 1073765444 to i32*)
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, float *);
int main() {
  float f;
  printf("Enter a Number: ");
  scanf("%f", &f);
  printf("2 Rightmost Intergral Part is: %d \n", (int)f % 100);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xecd(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
cvttss2si -0x8(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
mov    %edx,%esi
lea    0xeb1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xedb(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
cvttss2si 0x4(%rsp),%eax
movslq %eax,%rsi
imul   $0x51eb851f,%rsi,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x25,%rax
add    %ecx,%eax
imul   $0x64,%eax,%eax
sub    %eax,%esi
lea    0xeab(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [17 x i8] c"Enter a Number: \00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [36 x i8] c"2 Rightmost Intergral Part is: %d \0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
store i32 0, i32* %1
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %2)
%5 = load float, float* %2
%6 = fptosi float %5 to i32
%7 = srem i32 %6, 100
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.2, i64 0, i64 0), i32 %7)
ret i32 0
}

LLVM IR (-O2):
@.str = [17 x i8] c"Enter a Number: \00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [36 x i8] c"2 Rightmost Intergral Part is: %d \0A\00"
define i32 @main() {
%1 = alloca float
%2 = bitcast float* %1 to i8*
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %1)
%5 = load float, float* %1
%6 = fptosi float %5 to i32
%7 = srem i32 %6, 100
%8 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @.str.2, i64 0, i64 0), i32 %7)
ret i32 0
}
/* Variables and functions */
int strcmp(char *const, char *const);
int cmpstrp(const void *p1, const void *p2) {
  return strcmp(*(char *const *)p1, *(char *const *)p2);
}


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

x86 assembly (clang, -O2):
<cmpstrp>:
mov    (%rdi),%rdi
mov    (%rsi),%rsi
jmp    1030 <strcmp@plt>

LLVM IR (-O0):
define i32 @cmpstrp(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = bitcast i8* %5 to i8**
%7 = load i8*, i8** %6
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i8**
%10 = load i8*, i8** %9
%11 = call i32 @strcmp(i8* %7, i8* %10)
ret i32 %11
}

LLVM IR (-O2):
define i32 @cmpstrp(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i8**
%4 = load i8*, i8** %3
%5 = bitcast i8* %1 to i8**
%6 = load i8*, i8** %5
%7 = tail call i32 @strcmp(i8* dereferenceable(1) %4, i8* dereferenceable(1) %6)
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
void show_help(const char *cmd) {
  printf("Use: %s <path> <runs> [write]\n", cmd);
}


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

x86 assembly (clang, -O2):
<show_help>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [31 x i8] c"Use: %s <path> <runs> [write]\0A\00"
define void @show_help(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [31 x i8] c"Use: %s <path> <runs> [write]\0A\00"
define void @show_help(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ strcat(int /*<<< orphan*/, char *);
void strcat_null_dst(char *x) { strcat(0, x); }


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

x86 assembly (clang, -O2):
<strcat_null_dst>:
mov    %rdi,%rsi
xor    %edi,%edi
jmp    1030 <strcat@plt>

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

LLVM IR (-O2):
define void @strcat_null_dst(i8* %0) {
%2 = tail call i32 @strcat(i32 0, i8* %0)
ret void
}
void pullphone(char *dn, char *str) {
  int i = 0;
  while (dn[i] != ',')
    str[i] = dn[i], i++;
  str[i] = 0x0;
}


x86 assembly (clang, -O0):
<pullphone>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x2c,%eax
je     114c <pullphone+0x4c>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,1),%dl
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1113 <pullphone+0x13>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
pop    %rbp
ret

x86 assembly (clang, -O2):
<pullphone>:
mov    (%rdi),%al
cmp    $0x2c,%al
jne    110d <pullphone+0xd>
xor    %eax,%eax
movb   $0x0,(%rsi,%rax,1)
ret
xor    %ecx,%ecx
nop
mov    %al,(%rsi,%rcx,1)
movzbl 0x1(%rdi,%rcx,1),%eax
add    $0x1,%rcx
cmp    $0x2c,%al
jne    1110 <pullphone+0x10>
mov    %ecx,%eax
movb   $0x0,(%rsi,%rax,1)
ret

LLVM IR (-O0):
define void @pullphone(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
store i8* %0, i8** %3
store i8* %1, i8** %4
store i32 0, i32* %5
br label %6
6: ; preds = %14, %2
%7 = load i8*, i8** %3
%8 = load i32, i32* %5
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds i8, i8* %7, i64 %9
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
%13 = icmp ne i32 %12, 44
br i1 %13, label %14, label %26
14: ; preds = %6
%15 = load i8*, i8** %3
%16 = load i32, i32* %5
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds i8, i8* %15, i64 %17
%19 = load i8, i8* %18
%20 = load i8*, i8** %4
%21 = load i32, i32* %5
%22 = sext i32 %21 to i64
%23 = getelementptr inbounds i8, i8* %20, i64 %22
store i8 %19, i8* %23
%24 = load i32, i32* %5
%25 = add nsw i32 %24, 1
store i32 %25, i32* %5
br label %6
26: ; preds = %6
%27 = load i8*, i8** %4
%28 = load i32, i32* %5
%29 = sext i32 %28 to i64
%30 = getelementptr inbounds i8, i8* %27, i64 %29
store i8 0, i8* %30
ret void
}

LLVM IR (-O2):
define void @pullphone(i8* nocapture %0, i8* nocapture writeonly %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 44
br i1 %4, label %15, label %5
5: ; preds = %2, %5
%6 = phi i64 [ %9, %5 ], [ 0, %2 ]
%7 = phi i8 [ %11, %5 ], [ %3, %2 ]
%8 = getelementptr inbounds i8, i8* %1, i64 %6
store i8 %7, i8* %8
%9 = add nuw nsw i64 %6, 1
%10 = getelementptr inbounds i8, i8* %0, i64 %9
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 44
br i1 %12, label %13, label %5
13: ; preds = %5
%14 = and i64 %9, 4294967295
br label %15
15: ; preds = %13, %2
%16 = phi i64 [ 0, %2 ], [ %14, %13 ]
%17 = getelementptr inbounds i8, i8* %1, i64 %16
store i8 0, i8* %17
ret void
}
int st_intcmp(const void *a, const void *b, void *data) {
  return (*(const int *)a == *(const int *)b) ? 0 : -1;
}


x86 assembly (clang, -O0):
<st_intcmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edx
mov    -0x10(%rbp),%rax
mov    (%rax),%esi
mov    $0xffffffff,%eax
xor    %ecx,%ecx
cmp    %esi,%edx
cmove  %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<st_intcmp>:
mov    (%rdi),%ecx
xor    %eax,%eax
cmp    (%rsi),%ecx
setne  %al
neg    %eax
ret

LLVM IR (-O0):
define i32 @st_intcmp(i8* %0, i8* %1, i8* %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 = bitcast i8* %7 to i32*
%9 = load i32, i32* %8
%10 = load i8*, i8** %5
%11 = bitcast i8* %10 to i32*
%12 = load i32, i32* %11
%13 = icmp eq i32 %9, %12
%14 = zext i1 %13 to i64
%15 = select i1 %13, i32 0, i32 -1
ret i32 %15
}

LLVM IR (-O2):
define i32 @st_intcmp(i8* nocapture %0, i8* nocapture %1, i8* nocapture readnone %2) {
%4 = bitcast i8* %0 to i32*
%5 = load i32, i32* %4
%6 = bitcast i8* %1 to i32*
%7 = load i32, i32* %6
%8 = icmp ne i32 %5, %7
%9 = sext i1 %8 to i32
ret i32 %9
}
int exact_square(int n) {
  int i;
  for (i = 0; i <= n; i++) {
    if (i * i == n)
      return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<exact_square>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jg     1149 <exact_square+0x49>
mov    -0xc(%rbp),%eax
imul   -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jne    1136 <exact_square+0x36>
movl   $0x1,-0x4(%rbp)
jmp    1150 <exact_square+0x50>
jmp    113b <exact_square+0x3b>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110e <exact_square+0xe>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<exact_square>:
test   %edi,%edi
js     1120 <exact_square+0x20>
lea    0x1(%rdi),%eax
xor    %ecx,%ecx
nopl   0x0(%rax)
mov    %ecx,%edx
imul   %ecx,%edx
cmp    %edi,%edx
je     1123 <exact_square+0x23>
add    $0x1,%ecx
cmp    %ecx,%eax
jne    1110 <exact_square+0x10>
xor    %eax,%eax
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @exact_square(i32 %0) {
%2 = icmp slt i32 %0, 0
br i1 %2, label %10, label %6
3: ; preds = %6
%4 = add nuw i32 %7, 1
%5 = icmp eq i32 %7, %0
br i1 %5, label %10, label %6
6: ; preds = %1, %3
%7 = phi i32 [ %4, %3 ], [ 0, %1 ]
%8 = mul nsw i32 %7, %7
%9 = icmp eq i32 %8, %0
br i1 %9, label %10, label %3
10: ; preds = %6, %3, %1
%11 = phi i32 [ 0, %1 ], [ 0, %3 ], [ 1, %6 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void hello_c_() { printf("%s\n", "Hello_C: Hello Earth!"); }


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

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

LLVM IR (-O0):
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [22 x i8] c"Hello_C: Hello Earth!\00"
define void @hello_c_() {
%1 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [22 x i8] c"Hello_C: Hello Earth!\00"
define void @hello_c_() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ putch(unsigned char);
int strlen(char const *);
void puts(unsigned char *text) {
  int len_of_str = strlen((const char *)text);
  int temp;
  for (temp = 1; temp <= len_of_str; temp++) {
    putch(text[temp]);
  }
}


x86 assembly (clang, -O0):
<puts>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0xc(%rbp)
movl   $0x1,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jg     116a <puts+0x4a>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movzbl (%rax,%rcx,1),%edi
call   1040 <putch@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    113f <puts+0x1f>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<puts>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
call   1030 <strlen@plt>
test   %eax,%eax
jle    1153 <puts+0x33>
mov    %eax,%r15d
add    $0x1,%r15d
mov    $0x1,%ebx
nopl   (%rax)
movzbl (%r14,%rbx,1),%edi
call   1040 <putch@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1140 <puts+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @puts(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = icmp slt i32 %2, 1
br i1 %3, label %14, label %4
4: ; preds = %1
%5 = add nuw i32 %2, 1
%6 = zext i32 %5 to i64
br label %7
7: ; preds = %4, %7
%8 = phi i64 [ 1, %4 ], [ %12, %7 ]
%9 = getelementptr inbounds i8, i8* %0, i64 %8
%10 = load i8, i8* %9
%11 = tail call i32 @putch(i8 zeroext %10)
%12 = add nuw nsw i64 %8, 1
%13 = icmp eq i64 %12, %6
br i1 %13, label %14, label %7
14: ; preds = %7, %1
ret void
}
/* Type definitions */
typedef int uint32_t;
typedef int uint16_t;

/* Variables and functions */
uint16_t FixChecksum(uint16_t sum, uint16_t old, uint16_t new) {
  uint32_t l;
  l = sum + old - new;
  l = (l >> 16) + (l & 65535);
  l = l & 65535;
  return l;
}


x86 assembly (clang, -O0):
<FixChecksum>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
sub    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
sar    $0x10,%eax
mov    -0x10(%rbp),%ecx
and    $0xffff,%ecx
add    %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
and    $0xffff,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<FixChecksum>:
add    %esi,%edi
sub    %edx,%edi
mov    %edi,%eax
shr    $0x10,%eax
add    %edi,%eax
movzwl %ax,%eax
ret

LLVM IR (-O0):
define i32 @FixChecksum(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 = add nsw i32 %8, %9
%11 = load i32, i32* %6
%12 = sub nsw i32 %10, %11
store i32 %12, i32* %7
%13 = load i32, i32* %7
%14 = ashr i32 %13, 16
%15 = load i32, i32* %7
%16 = and i32 %15, 65535
%17 = add nsw i32 %14, %16
store i32 %17, i32* %7
%18 = load i32, i32* %7
%19 = and i32 %18, 65535
store i32 %19, i32* %7
%20 = load i32, i32* %7
ret i32 %20
}

LLVM IR (-O2):
define i32 @FixChecksum(i32 %0, i32 %1, i32 %2) {
%4 = add nsw i32 %1, %0
%5 = sub i32 %4, %2
%6 = lshr i32 %5, 16
%7 = add i32 %6, %5
%8 = and i32 %7, 65535
ret i32 %8
}