xunge/DecIR huggingface dataset:
blklen(av) register char **av;
{
  register int i = 0;
  while (*av++)
    i++;
  return (i);
}


x86 assembly (clang, -O0):
<blklen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x8(%rbp)
cmpq   $0x0,(%rax)
je     1136 <blklen+0x36>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <blklen+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<blklen>:
cmpq   $0x0,(%rdi)
je     111d <blklen+0x1d>
xor    %eax,%eax
nopl   0x0(%rax,%rax,1)
cmpq   $0x0,0x8(%rdi,%rax,8)
lea    0x1(%rax),%rax
jne    1110 <blklen+0x10>
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @blklen(i8** %0) {
%2 = alloca i8**
%3 = alloca i32
store i8** %0, i8*** %2
store i32 0, i32* %3
br label %4
4: ; preds = %9, %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 = icmp ne i8* %7, null
br i1 %8, label %9, label %12
9: ; preds = %4
%10 = load i32, i32* %3
%11 = add nsw i32 %10, 1
store i32 %11, i32* %3
br label %4
12: ; preds = %4
%13 = load i32, i32* %3
ret i32 %13
}

LLVM IR (-O2):
define i32 @blklen(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = icmp eq i8* %2, null
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i32 [ %8, %4 ], [ 0, %1 ]
%6 = phi i8** [ %7, %4 ], [ %0, %1 ]
%7 = getelementptr inbounds i8*, i8** %6, i64 1
%8 = add nuw nsw i32 %5, 1
%9 = load i8*, i8** %7
%10 = icmp eq i8* %9, null
br i1 %10, label %11, label %4
11: ; preds = %4, %1
%12 = phi i32 [ 0, %1 ], [ %8, %4 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ test_numeric_bin_to_dec();
int /*<<< orphan*/ test_numeric_bin_to_oct();
int /*<<< orphan*/ test_numeric_dec_to_bin();
void test_numberic() {
  test_numeric_bin_to_dec();
  test_numeric_bin_to_oct();
  test_numeric_dec_to_bin();
}


x86 assembly (clang, -O0):
<test_numberic>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <test_numeric_bin_to_dec@plt>
mov    $0x0,%al
call   1050 <test_numeric_bin_to_oct@plt>
mov    $0x0,%al
call   1040 <test_numeric_dec_to_bin@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_numberic>:
push   %rax
xor    %eax,%eax
call   1030 <test_numeric_bin_to_dec@plt>
xor    %eax,%eax
call   1050 <test_numeric_bin_to_oct@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <test_numeric_dec_to_bin@plt>

LLVM IR (-O0):
define void @test_numberic() {
%1 = call i32 (...) @test_numeric_bin_to_dec()
%2 = call i32 (...) @test_numeric_bin_to_oct()
%3 = call i32 (...) @test_numeric_dec_to_bin()
ret void
}

LLVM IR (-O2):
define void @test_numberic() {
%1 = tail call i32 (...) @test_numeric_bin_to_dec()
%2 = tail call i32 (...) @test_numeric_bin_to_oct()
%3 = tail call i32 (...) @test_numeric_dec_to_bin()
ret void
}
int hash_fn(const char *key, int table_size) {
  unsigned int hashed = 0;
  while (*key) {
    hashed = (hashed << 7) ^ *key++;
  }
  return hashed % table_size;
}


x86 assembly (clang, -O0):
<hash_fn>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1141 <hash_fn+0x41>
mov    -0x10(%rbp),%eax
shl    $0x7,%eax
mov    -0x8(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
movsbl (%rcx),%ecx
xor    %ecx,%eax
mov    %eax,-0x10(%rbp)
jmp    1112 <hash_fn+0x12>
mov    -0x10(%rbp),%eax
xor    %edx,%edx
divl   -0xc(%rbp)
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash_fn>:
mov    (%rdi),%cl
test   %cl,%cl
je     1125 <hash_fn+0x25>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
shl    $0x7,%eax
movsbl %cl,%ecx
xor    %ecx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <hash_fn+0x10>
jmp    1127 <hash_fn+0x27>
xor    %eax,%eax
xor    %edx,%edx
div    %esi
mov    %edx,%eax
ret

LLVM IR (-O0):
define i32 @hash_fn(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 = %10, %2
%7 = load i8*, i8** %3
%8 = load i8, i8* %7
%9 = icmp ne i8 %8, 0
br i1 %9, label %10, label %18
10: ; preds = %6
%11 = load i32, i32* %5
%12 = shl i32 %11, 7
%13 = load i8*, i8** %3
%14 = getelementptr inbounds i8, i8* %13, i32 1
store i8* %14, i8** %3
%15 = load i8, i8* %13
%16 = sext i8 %15 to i32
%17 = xor i32 %12, %16
store i32 %17, i32* %5
br label %6
18: ; preds = %6
%19 = load i32, i32* %5
%20 = load i32, i32* %4
%21 = urem i32 %19, %20
ret i32 %21
}

LLVM IR (-O2):
define i32 @hash_fn(i8* nocapture %0, i32 %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %15, label %5
5: ; preds = %2, %5
%6 = phi i8 [ %13, %5 ], [ %3, %2 ]
%7 = phi i32 [ %12, %5 ], [ 0, %2 ]
%8 = phi i8* [ %10, %5 ], [ %0, %2 ]
%9 = shl i32 %7, 7
%10 = getelementptr inbounds i8, i8* %8, i64 1
%11 = sext i8 %6 to i32
%12 = xor i32 %9, %11
%13 = load i8, i8* %10
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %5
15: ; preds = %5, %2
%16 = phi i32 [ 0, %2 ], [ %12, %5 ]
%17 = urem i32 %16, %1
ret i32 %17
}
void foo699() {}


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

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

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

LLVM IR (-O2):
define void @foo699() {
ret void
}
void foo029(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo029(i32 %0) {
ret void
}
/* Variables and functions */
scalar_t__ isspace(char);
char *skipspace(char *str) {
  while (isspace(*str))
    ++str;
  return str;
}


x86 assembly (clang, -O0):
<skipspace>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <isspace@plt>
cmp    $0x0,%rax
je     1143 <skipspace+0x33>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    111c <skipspace+0xc>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<skipspace>:
push   %rbx
mov    %rdi,%rbx
add    $0xffffffffffffffff,%rbx
nopl   0x0(%rax,%rax,1)
movsbl 0x1(%rbx),%edi
add    $0x1,%rbx
call   1030 <isspace@plt>
test   %rax,%rax
jne    1120 <skipspace+0x10>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @skipspace(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %7, %2 ]
%4 = load i8, i8* %3
%5 = tail call i64 @isspace(i8 signext %4)
%6 = icmp eq i64 %5, 0
%7 = getelementptr inbounds i8, i8* %3, i64 1
br i1 %6, label %8, label %2
8: ; preds = %2
ret i8* %3
}
/* Variables and functions */
char *U_WMRCORENONE_set(char *);
char *U_WMRCB_set(void) { return U_WMRCORENONE_set("U_WMRCB"); }


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

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

LLVM IR (-O0):
@.str = [8 x i8] c"U_WMRCB\00"
define i8* @U_WMRCB_set() {
%1 = call i8* @U_WMRCORENONE_set(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}

LLVM IR (-O2):
@.str = [8 x i8] c"U_WMRCB\00"
define i8* @U_WMRCB_set() {
%1 = tail call i8* @U_WMRCORENONE_set(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}
void g_error() {
  int args;
  args = 3;
}


x86 assembly (clang, -O0):
<g_error>:
push   %rbp
mov    %rsp,%rbp
movl   $0x3,-0x4(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @g_error() {
ret void
}
int array_sum(int arr[3]) {
  int sum = 0;
  for (int i = 0; i < 3; i++) {
    sum += arr[i];
  }
  return sum;
}


x86 assembly (clang, -O0):
<array_sum>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
cmpl   $0x3,-0x10(%rbp)
jge    113f <array_sum+0x3f>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1116 <array_sum+0x16>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<array_sum>:
mov    0x4(%rdi),%eax
add    (%rdi),%eax
add    0x8(%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @array_sum(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = getelementptr inbounds i32, i32* %0, i64 1
%4 = load i32, i32* %3
%5 = add nsw i32 %4, %2
%6 = getelementptr inbounds i32, i32* %0, i64 2
%7 = load i32, i32* %6
%8 = add nsw i32 %7, %5
ret i32 %8
}
void ft_striter(char *s, void (*f)(char *)) {
  while (*s != '\0')
    f(s++);
}


x86 assembly (clang, -O0):
<ft_striter>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     113a <ft_striter+0x3a>
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rdi
mov    %rdi,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
call   *%rax
jmp    1110 <ft_striter+0x10>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_striter>:
push   %r15
push   %r14
push   %rbx
cmpb   $0x0,(%rdi)
je     1123 <ft_striter+0x23>
mov    %rsi,%r14
mov    %rdi,%rbx
lea    0x1(%rbx),%r15
mov    %rbx,%rdi
call   *%r14
cmpb   $0x0,0x1(%rbx)
mov    %r15,%rbx
jne    1110 <ft_striter+0x10>
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @ft_striter(i8* %0, void (i8*)* nocapture %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %10, label %5
5: ; preds = %2, %5
%6 = phi i8* [ %7, %5 ], [ %0, %2 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
tail call void %1(i8* %6)
%8 = load i8, i8* %7
%9 = icmp eq i8 %8, 0
br i1 %9, label %10, label %5
10: ; preds = %5, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ perror(char *);
int socket(int, int, int);
int std_socket(int domain, int type, int protocol) {
  int sockfd;
  if ((sockfd = socket(domain, type, protocol)) == -1) {
    perror("socket");
    exit(1);
  }
  return sockfd;
}


x86 assembly (clang, -O0):
<std_socket>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
call   1050 <socket@plt>
mov    %eax,-0x10(%rbp)
cmp    $0xffffffff,%eax
jne    1171 <std_socket+0x41>
lea    0xe9e(%rip),%rdi
call   1030 <perror@plt>
mov    $0x1,%edi
call   1040 <exit@plt>
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<std_socket>:
push   %rax
call   1050 <socket@plt>
cmp    $0xffffffff,%eax
je     113d <std_socket+0xd>
pop    %rcx
ret
lea    0xebc(%rip),%rdi
call   1030 <perror@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

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

LLVM IR (-O2):
@.str = [7 x i8] c"socket\00"
define i32 @std_socket(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @socket(i32 %0, i32 %1, i32 %2)
%5 = icmp eq i32 %4, -1
br i1 %5, label %6, label %9
6: ; preds = %3
%7 = tail call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%8 = tail call i32 @exit(i32 1)
unreachable
9: ; preds = %3
ret i32 %4
}
int bar(int y) { return ~y ^ 4; }


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

x86 assembly (clang, -O2):
<bar>:
mov    %edi,%eax
xor    $0xfffffffb,%eax
ret

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

LLVM IR (-O2):
define i32 @bar(i32 %0) {
%2 = xor i32 %0, -5
ret i32 %2
}
void xxerr(x) char *x;
{ write(2, x, strlen(x)); }


x86 assembly (clang, -O0):
<xxerr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x10(%rbp),%rsi
mov    %rax,%rdx
mov    $0x2,%edi
mov    $0x0,%al
call   1030 <write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xxerr>:
push   %rbx
mov    %rdi,%rbx
call   1040 <strlen@plt>
mov    $0x2,%edi
mov    %rbx,%rsi
mov    %rax,%rdx
xor    %eax,%eax
pop    %rbx
jmp    1030 <write@plt>

LLVM IR (-O0):
define void @xxerr(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @strlen(i8* %4)
%6 = call i32 (i32, i8*, i64, ...) bitcast (i32 (...)* @write to i32 (i32, i8*, i64, ...)*)(i32 2, i8* %3, i64 %5)
ret void
}

LLVM IR (-O2):
define void @xxerr(i8* %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = tail call i32 (i32, i8*, i64, ...) bitcast (i32 (...)* @write to i32 (i32, i8*, i64, ...)*)(i32 2, i8* %0, i64 %2)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ ntohl(int /*<<< orphan*/);
uint32_t minipack_unpack_bin32(void *ptr, size_t *sz) {
  *sz = 5;
  return ntohl(*((uint32_t *)(ptr + 1)));
}


x86 assembly (clang, -O0):
<minipack_unpack_bin32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movq   $0x5,(%rax)
mov    -0x8(%rbp),%rax
mov    0x1(%rax),%edi
call   1030 <ntohl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<minipack_unpack_bin32>:
movq   $0x5,(%rsi)
mov    0x1(%rdi),%edi
jmp    1030 <ntohl@plt>

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

LLVM IR (-O2):
define i32 @minipack_unpack_bin32(i8* nocapture %0, i64* nocapture writeonly %1) {
store i64 5, i64* %1
%3 = getelementptr i8, i8* %0, i64 1
%4 = bitcast i8* %3 to i32*
%5 = load i32, i32* %4
%6 = tail call i32 @ntohl(i32 %5)
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ init(int *, int);
int /*<<< orphan*/ ins_sort(int *, int);
int /*<<< orphan*/ print(int *, int);
int main(void) {
  int x[1024];
  init(x, 1024);
  ins_sort(x, 1024);
  print(x, 1024);
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1010,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x1010(%rbp),%rdi
mov    $0x400,%esi
call   1040 <init@plt>
lea    -0x1010(%rbp),%rdi
mov    $0x400,%esi
call   1050 <ins_sort@plt>
lea    -0x1010(%rbp),%rdi
mov    $0x400,%esi
call   1030 <print@plt>
xor    %eax,%eax
add    $0x1010,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x1000,%rsp
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x400,%esi
call   1040 <init@plt>
mov    %rbx,%rdi
mov    $0x400,%esi
call   1050 <ins_sort@plt>
mov    %rbx,%rdi
mov    $0x400,%esi
call   1030 <print@plt>
xor    %eax,%eax
add    $0x1000,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca [1024 x i32]
store i32 0, i32* %1
%3 = getelementptr inbounds [1024 x i32], [1024 x i32]* %2, i64 0, i64 0
%4 = call i32 @init(i32* %3, i32 1024)
%5 = getelementptr inbounds [1024 x i32], [1024 x i32]* %2, i64 0, i64 0
%6 = call i32 @ins_sort(i32* %5, i32 1024)
%7 = getelementptr inbounds [1024 x i32], [1024 x i32]* %2, i64 0, i64 0
%8 = call i32 @print(i32* %7, i32 1024)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca [1024 x i32]
%2 = bitcast [1024 x i32]* %1 to i8*
%3 = getelementptr inbounds [1024 x i32], [1024 x i32]* %1, i64 0, i64 0
%4 = call i32 @init(i32* %3, i32 1024)
%5 = call i32 @ins_sort(i32* %3, i32 1024)
%6 = call i32 @print(i32* %3, i32 1024)
ret i32 0
}
/* Type definitions */
typedef int int32_t;

/* Variables and functions */
int32_t ror(int32_t x, int i) { return (x >> i) | (x << (32 - i)); }


x86 assembly (clang, -O0):
<ror>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
sar    %cl,%eax
mov    -0x4(%rbp),%edx
mov    $0x20,%ecx
sub    -0x8(%rbp),%ecx
shl    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ror>:
mov    %esi,%ecx
mov    %edi,%eax
sar    %cl,%eax
neg    %cl
shl    %cl,%edi
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @ror(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = ashr i32 %5, %6
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = sub nsw i32 32, %9
%11 = shl i32 %8, %10
%12 = or i32 %7, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @ror(i32 %0, i32 %1) {
%3 = ashr i32 %0, %1
%4 = sub nsw i32 32, %1
%5 = shl i32 %0, %4
%6 = or i32 %5, %3
ret i32 %6
}
/* Variables and functions */
int fleft(int);
int getch();
int findleft(void) {
  int c = getch();
  if (c < 0 || c > 255)
    return 1;
  return fleft(c);
}


x86 assembly (clang, -O0):
<findleft>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <getch@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jl     1149 <findleft+0x29>
cmpl   $0xff,-0x8(%rbp)
jle    1155 <findleft+0x35>
movl   $0x1,-0x4(%rbp)
jmp    1160 <findleft+0x40>
mov    -0x8(%rbp),%edi
call   1040 <fleft@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<findleft>:
push   %rax
xor    %eax,%eax
call   1030 <getch@plt>
cmp    $0xff,%eax
jbe    1136 <findleft+0x16>
mov    $0x1,%eax
pop    %rcx
ret
mov    %eax,%edi
pop    %rax
jmp    1040 <fleft@plt>

LLVM IR (-O0):
define i32 @findleft() {
%1 = alloca i32
%2 = alloca i32
%3 = call i32 (...) @getch()
store i32 %3, i32* %2
%4 = load i32, i32* %2
%5 = icmp slt i32 %4, 0
br i1 %5, label %9, label %6
6: ; preds = %0
%7 = load i32, i32* %2
%8 = icmp sgt i32 %7, 255
br i1 %8, label %9, label %10
9: ; preds = %6, %0
store i32 1, i32* %1
br label %13
10: ; preds = %6
%11 = load i32, i32* %2
%12 = call i32 @fleft(i32 %11)
store i32 %12, i32* %1
br label %13
13: ; preds = %10, %9
%14 = load i32, i32* %1
ret i32 %14
}

LLVM IR (-O2):
define i32 @findleft() {
%1 = tail call i32 (...) @getch()
%2 = icmp ugt i32 %1, 255
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 @fleft(i32 %1)
br label %5
5: ; preds = %0, %3
%6 = phi i32 [ %4, %3 ], [ 1, %0 ]
ret i32 %6
}
/* Variables and functions */
int anetTcpGenericConnect(char *, char *, int, int /*<<< orphan*/);
int anetTcpConnect(char *err, char *addr, int port) {
  return anetTcpGenericConnect(err, addr, port, 0);
}


x86 assembly (clang, -O0):
<anetTcpConnect>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
xor    %ecx,%ecx
call   1030 <anetTcpGenericConnect@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<anetTcpConnect>:
xor    %ecx,%ecx
jmp    1030 <anetTcpGenericConnect@plt>

LLVM IR (-O0):
define i32 @anetTcpConnect(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = load i32, i32* %6
%10 = call i32 @anetTcpGenericConnect(i8* %7, i8* %8, i32 %9, i32 0)
ret i32 %10
}

LLVM IR (-O2):
define i32 @anetTcpConnect(i8* %0, i8* %1, i32 %2) {
%4 = tail call i32 @anetTcpGenericConnect(i8* %0, i8* %1, i32 %2, i32 0)
ret i32 %4
}
void ptrace_sandbox_permit_sigaction(struct pt_sandbox *p_sandbox) {
  (void)p_sandbox;
}


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

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

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

LLVM IR (-O2):
%struct.pt_sandbox = type opaque
define void @ptrace_sandbox_permit_sigaction(%struct.pt_sandbox* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fio_printf(int, char *);
int smoke(void) {
  fio_printf(1, "Nice! You find the correct path.\n\r");
  return 0;
}


x86 assembly (clang, -O0):
<smoke>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
lea    0xee0(%rip),%rsi
call   1030 <fio_printf@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<smoke>:
push   %rax
lea    0xee8(%rip),%rsi
mov    $0x1,%edi
call   1030 <fio_printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [35 x i8] c"Nice! You find the correct path.\0A\0D\00"
define i32 @smoke() {
%1 = call i32 @fio_printf(i32 1, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [35 x i8] c"Nice! You find the correct path.\0A\0D\00"
define i32 @smoke() {
%1 = tail call i32 @fio_printf(i32 1, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
void __attribute__((__no__)) function_definition(void) {}


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

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

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

LLVM IR (-O2):
define void @function_definition() {
ret void
}
double builtin_fnms(double b, double c, double d) {
  return -__builtin_fma(b, c, -d);
}


x86 assembly (clang, -O0):
<builtin_fnms>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm2
movq   %xmm2,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm2
call   1030 <fma@plt>
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<builtin_fnms>:
push   %rax
xorps  0xee8(%rip),%xmm2
call   1030 <fma@plt>
xorps  0xedc(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @builtin_fnms(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%7 = load double, double* %4
%8 = load double, double* %5
%9 = load double, double* %6
%10 = fneg double %9
%11 = call double @llvm.fma.f64(double %7, double %8, double %10)
%12 = fneg double %11
ret double %12
}

LLVM IR (-O2):
define double @builtin_fnms(double %0, double %1, double %2) {
%4 = fneg double %2
%5 = tail call double @llvm.fma.f64(double %0, double %1, double %4)
%6 = fneg double %5
ret double %6
}
unsigned short int unsignedshortint_ignoring_signedint(unsigned short int x,
                                                       signed int y) {
  return x;
}


x86 assembly (clang, -O0):
<unsignedshortint_ignoring_signedint>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    %esi,-0x8(%rbp)
movzwl -0x2(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define zeroext i16 @unsignedshortint_ignoring_signedint(i16 returned zeroext %0, i32 %1) {
ret i16 %0
}
/* Type definitions */
struct oscap_string_iterator {
  int dummy;
};
struct oscap_iterator {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ oscap_iterator_reset(struct oscap_iterator *);
void oscap_string_iterator_reset(struct oscap_string_iterator *it) {
  oscap_iterator_reset(((struct oscap_iterator *)(it)));
}


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

x86 assembly (clang, -O2):
<oscap_string_iterator_reset>:
jmp    1030 <oscap_iterator_reset@plt>

LLVM IR (-O0):
%struct.oscap_string_iterator = type { i32 }
%struct.oscap_iterator = type { i32 }
define void @oscap_string_iterator_reset(%struct.oscap_string_iterator* %0) {
%2 = alloca %struct.oscap_string_iterator*
store %struct.oscap_string_iterator* %0, %struct.oscap_string_iterator** %2
%3 = load %struct.oscap_string_iterator*, %struct.oscap_string_iterator** %2
%4 = bitcast %struct.oscap_string_iterator* %3 to %struct.oscap_iterator*
%5 = call i32 @oscap_iterator_reset(%struct.oscap_iterator* %4)
ret void
}

LLVM IR (-O2):
%struct.oscap_string_iterator = type { i32 }
%struct.oscap_iterator = type { i32 }
define void @oscap_string_iterator_reset(%struct.oscap_string_iterator* %0) {
%2 = bitcast %struct.oscap_string_iterator* %0 to %struct.oscap_iterator*
%3 = tail call i32 @oscap_iterator_reset(%struct.oscap_iterator* %2)
ret void
}
void foo(void) {
  int i;
  for (i = 0; i < 1000; i++)
    asm volatile("" ::: "memory");
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
cmpl   $0x3e8,-0x4(%rbp)
jge    1126 <foo+0x26>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    110b <foo+0xb>
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
mov    $0x3e8,%eax
cs nopw 0x0(%rax,%rax,1)
nop
add    $0xffffffff,%eax
jne    1110 <foo+0x10>
ret

LLVM IR (-O0):
define void @foo() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %6, %0
%3 = load i32, i32* %1
%4 = icmp slt i32 %3, 1000
br i1 %4, label %5, label %9
5: ; preds = %2
br label %6
6: ; preds = %5
%7 = load i32, i32* %1
%8 = add nsw i32 %7, 1
store i32 %8, i32* %1
br label %2
9: ; preds = %2
ret void
}

LLVM IR (-O2):
define void @foo() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 0, %0 ], [ %3, %1 ]
tail call void asm sideeffect "", "~{memory},~{dirflag},~{fpsr},~{flags}"()
%3 = add nuw nsw i32 %2, 1
%4 = icmp eq i32 %3, 1000
br i1 %4, label %5, label %1
5: ; preds = %1
ret void
}
void func8(int *aptr) {
  if (!aptr) {
    if (1 == 0) {
      int k = 10;
      int l = 20;
    }
    return;
  }
  *aptr = 900;
}


x86 assembly (clang, -O0):
<func8>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1118 <func8+0x18>
jmp    1122 <func8+0x22>
mov    -0x8(%rbp),%rax
movl   $0x384,(%rax)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @func8(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = icmp ne i32* %3, null
br i1 %4, label %6, label %5
5: ; preds = %1
br label %8
6: ; preds = %1
%7 = load i32*, i32** %2
store i32 900, i32* %7
br label %8
8: ; preds = %6, %5
ret void
}

LLVM IR (-O2):
define void @func8(i32* writeonly %0) {
%2 = icmp eq i32* %0, null
br i1 %2, label %4, label %3
3: ; preds = %1
store i32 900, i32* %0
br label %4
4: ; preds = %1, %3
ret void
}
int stic_positive_predicate(void) { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @stic_positive_predicate() {
ret i32 1
}
int snd_info_get_line(struct snd_info_buffer *buffer, char *line, int len) {
  return 1;
}


x86 assembly (clang, -O0):
<snd_info_get_line>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    $0x1,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.snd_info_buffer = type opaque
define i32 @snd_info_get_line(%struct.snd_info_buffer* %0, i8* %1, i32 %2) {
%4 = alloca %struct.snd_info_buffer*
%5 = alloca i8*
%6 = alloca i32
store %struct.snd_info_buffer* %0, %struct.snd_info_buffer** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
ret i32 1
}

LLVM IR (-O2):
%struct.snd_info_buffer = type opaque
define i32 @snd_info_get_line(%struct.snd_info_buffer* nocapture readnone %0, i8* nocapture readnone %1, i32 %2) {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isascii(int);
void t_isascii_0xc9() {
  Assert_real((isascii(201) == 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_isascii.c",
              1010, ("isascii should be 0 for 0xc9"));
}


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

x86 assembly (clang, -O2):
<t_isascii_0xc9>:
push   %rax
mov    $0xc9,%edi
call   1030 <isascii@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x3f2,%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_isascii.c\00"
@.str.1 = [29 x i8] c"isascii should be 0 for 0xc9\00"
define void @t_isascii_0xc9() {
%1 = call i64 @isascii(i32 201)
%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 1010, 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_isascii.c\00"
@.str.1 = [29 x i8] c"isascii should be 0 for 0xc9\00"
define void @t_isascii_0xc9() {
%1 = tail call i64 @isascii(i32 201)
%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 1010, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
char *malloc(long);
int /*<<< orphan*/ strcpy(char *, char *);
long strlen(char *);
char *_cstr_clone(char *in_string) {
  if (!in_string)
    in_string = NULL;
  long len = strlen(in_string);
  char *result = malloc(len + 1);
  if (!result)
    return NULL;
  strcpy(result, in_string);
  return result;
}


x86 assembly (clang, -O0):
<_cstr_clone>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    114f <_cstr_clone+0x1f>
movq   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
add    $0x1,%rdi
call   1050 <malloc@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    1185 <_cstr_clone+0x55>
movq   $0x0,-0x8(%rbp)
jmp    119a <_cstr_clone+0x6a>
mov    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_cstr_clone>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <strlen@plt>
lea    0x1(%rax),%rdi
call   1050 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
je     1158 <_cstr_clone+0x28>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @_cstr_clone(i8* %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add nsw i64 %2, 1
%4 = tail call i8* @malloc(i64 %3)
%5 = icmp eq i8* %4, null
br i1 %5, label %8, label %6
6: ; preds = %1
%7 = tail call i32 @strcpy(i8* %4, i8* %0)
br label %8
8: ; preds = %1, %6
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void hello() { printf("\nHello Deepak\n"); }


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

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

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

LLVM IR (-O2):
@str = [14 x i8] c"\0AHello Deepak\00"
define void @hello() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int EINVAL;
__attribute__((visibility("default"))) int
sd_network_link_get_domains(int ifindex, char ***ret) {
  return -EINVAL;
}


x86 assembly (clang, -O0):
<sd_network_link_get_domains>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %eax,%eax
mov    0x2ecc(%rip),%rcx
sub    (%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sd_network_link_get_domains>:
mov    0x2ed9(%rip),%rcx
xor    %eax,%eax
sub    (%rcx),%eax
ret

LLVM IR (-O0):
@EINVAL = global i32 0
define i32 @sd_network_link_get_domains(i32 %0, i8*** %1) {
%3 = alloca i32
%4 = alloca i8***
store i32 %0, i32* %3
store i8*** %1, i8**** %4
%5 = load i32, i32* @EINVAL
%6 = sub nsw i32 0, %5
ret i32 %6
}

LLVM IR (-O2):
@EINVAL = global i32 0
define i32 @sd_network_link_get_domains(i32 %0, i8*** nocapture readnone %1) {
%3 = load i32, i32* @EINVAL
%4 = sub nsw i32 0, %3
ret i32 %4
}
long f(char g) { return f(g); }


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edi
call   1030 <f@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i64 @f(i8 signext %0) {
br label %2
2: ; preds = %2, %1
br label %2
}
/* Variables and functions */
int /*<<< orphan*/ F_OK;
scalar_t__ access(char const *, int /*<<< orphan*/);
int File_Exist(const char *FileName) {
  if (access(FileName, F_OK) == 0)
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<File_Exist>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    0x2eb1(%rip),%rax
mov    (%rax),%esi
call   1030 <access@plt>
cmp    $0x0,%rax
jne    1144 <File_Exist+0x34>
movl   $0x1,-0x4(%rbp)
jmp    114b <File_Exist+0x3b>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<File_Exist>:
push   %rax
mov    0x2ec0(%rip),%rax
mov    (%rax),%esi
call   1030 <access@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@F_OK = global i32 0
define i32 @File_Exist(i8* nocapture %0) {
%2 = load i32, i32* @F_OK
%3 = tail call i64 @access(i8* %0, i32 %2)
%4 = icmp eq i64 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ doit(int, int);
int main() {
  int i, j;
  for (i = 0; i < 7000; i++)
    for (j = 0; j < 7000; j++)
      doit(i, j);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x1b58,-0x8(%rbp)
jge    1173 <main+0x63>
movl   $0x0,-0xc(%rbp)
cmpl   $0x1b58,-0xc(%rbp)
jge    1160 <main+0x50>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1030 <doit@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    113a <main+0x2a>
jmp    1165 <main+0x55>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <main+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nop
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %ebx,%edi
mov    %ebp,%esi
call   1030 <doit@plt>
add    $0x1,%ebp
cmp    $0x1b58,%ebp
jne    1130 <main+0x20>
add    $0x1,%ebx
cmp    $0x1b58,%ebx
jne    1120 <main+0x10>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @main() {
br label %1
1: ; preds = %0, %8
%2 = phi i32 [ 0, %0 ], [ %9, %8 ]
br label %3
3: ; preds = %1, %3
%4 = phi i32 [ 0, %1 ], [ %6, %3 ]
%5 = tail call i32 @doit(i32 %2, i32 %4)
%6 = add nuw nsw i32 %4, 1
%7 = icmp eq i32 %6, 7000
br i1 %7, label %8, label %3
8: ; preds = %3
%9 = add nuw nsw i32 %2, 1
%10 = icmp eq i32 %9, 7000
br i1 %10, label %11, label %1
11: ; preds = %8
ret i32 0
}
void AbsoluteGoToXY_HVP(X, Y) int X, Y;
{
  char Str[20];
  sprintf(Str, "\033[%d;%df", Y, X);
  WRITETEST(Str);
}


x86 assembly (clang, -O0):
<AbsoluteGoToXY_HVP>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
lea    -0x20(%rbp),%rdi
mov    -0x8(%rbp),%edx
mov    -0x4(%rbp),%ecx
lea    0xec1(%rip),%rsi
mov    $0x0,%al
call   1040 <sprintf@plt>
lea    -0x20(%rbp),%rdi
mov    $0x0,%al
call   1030 <WRITETEST@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<AbsoluteGoToXY_HVP>:
push   %rbx
sub    $0x20,%rsp
mov    %esi,%edx
mov    %edi,%ecx
lea    0xed0(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <sprintf@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <WRITETEST@plt>
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [9 x i8] c"\1B[%d;%df\00"
define void @AbsoluteGoToXY_HVP(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca [20 x i8]
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = getelementptr inbounds [20 x i8], [20 x i8]* %5, i64 0, i64 0
%7 = load i32, i32* %4
%8 = load i32, i32* %3
%9 = call i32 (i8*, i8*, ...) @sprintf(i8* %6, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %7, i32 %8)
%10 = getelementptr inbounds [20 x i8], [20 x i8]* %5, i64 0, i64 0
%11 = call i32 (i8*, ...) bitcast (i32 (...)* @WRITETEST to i32 (i8*, ...)*)(i8* %10)
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"\1B[%d;%df\00"
define void @AbsoluteGoToXY_HVP(i32 %0, i32 %1) {
%3 = alloca [20 x i8]
%4 = getelementptr inbounds [20 x i8], [20 x i8]* %3, i64 0, i64 0
%5 = call i32 (i8*, i8*, ...) @sprintf(i8* %4, i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %1, i32 %0)
%6 = call i32 (i8*, ...) bitcast (i32 (...)* @WRITETEST to i32 (i8*, ...)*)(i8* %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int tiling(int);
int main(int argc, char const *argv[]) {
  printf("%d\n", tiling(5));
  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    $0x5,%edi
call   1030 <tiling@plt>
mov    %eax,%esi
lea    0xeb7(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x5,%edi
call   1030 <tiling@plt>
lea    0xece(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%d\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 @tiling(i32 5)
%7 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @tiling(i32 5)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int fflush(int /*<<< orphan*/ *);
int _sys_fflush(FILE *file) { return (fflush(file)); }


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

x86 assembly (clang, -O2):
<_sys_fflush>:
jmp    1030 <fflush@plt>

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

LLVM IR (-O2):
define i32 @_sys_fflush(i32* nocapture %0) {
%2 = tail call i32 @fflush(i32* %0)
ret i32 %2
}
long power(long number, int power) {
  long tmp = number;
  for (int i = 1; i < power; i++) {
    tmp *= number;
  }
  return tmp;
}


x86 assembly (clang, -O0):
<power>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
movl   $0x1,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1141 <power+0x41>
mov    -0x8(%rbp),%rax
imul   -0x18(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    111a <power+0x1a>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<power>:
cmp    $0x2,%esi
jl     115a <power+0x5a>
lea    -0x1(%rsi),%edx
add    $0xfffffffe,%esi
mov    %edx,%ecx
and    $0x7,%ecx
mov    %rdi,%rax
cmp    $0x7,%esi
jb     1145 <power+0x45>
and    $0xfffffff8,%edx
mov    %rdi,%rax
xchg   %ax,%ax
imul   %rdi,%rax
imul   %rdi,%rax
imul   %rdi,%rax
imul   %rdi,%rax
imul   %rdi,%rax
imul   %rdi,%rax
imul   %rdi,%rax
imul   %rdi,%rax
add    $0xfffffff8,%edx
jne    1120 <power+0x20>
test   %ecx,%ecx
je     1159 <power+0x59>
nopl   0x0(%rax)
imul   %rdi,%rax
add    $0xffffffff,%ecx
jne    1150 <power+0x50>
ret
mov    %rdi,%rax
ret

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

LLVM IR (-O2):
define i64 @power(i64 %0, i32 %1) {
%3 = icmp sgt i32 %1, 1
br i1 %3, label %4, label %21
4: ; preds = %2
%5 = add i32 %1, -1
%6 = add i32 %1, -2
%7 = and i32 %5, 7
%8 = icmp ult i32 %6, 7
br i1 %8, label %11, label %9
9: ; preds = %4
%10 = and i32 %5, -8
br label %23
11: ; preds = %23, %4
%12 = phi i64 [ undef, %4 ], [ %33, %23 ]
%13 = phi i64 [ %0, %4 ], [ %33, %23 ]
%14 = icmp eq i32 %7, 0
br i1 %14, label %21, label %15
15: ; preds = %11, %15
%16 = phi i64 [ %18, %15 ], [ %13, %11 ]
%17 = phi i32 [ %19, %15 ], [ 0, %11 ]
%18 = mul nsw i64 %16, %0
%19 = add i32 %17, 1
%20 = icmp eq i32 %19, %7
br i1 %20, label %21, label %15
21: ; preds = %11, %15, %2
%22 = phi i64 [ %0, %2 ], [ %12, %11 ], [ %18, %15 ]
ret i64 %22
23: ; preds = %23, %9
%24 = phi i64 [ %0, %9 ], [ %33, %23 ]
%25 = phi i32 [ 0, %9 ], [ %34, %23 ]
%26 = mul nsw i64 %24, %0
%27 = mul nsw i64 %26, %0
%28 = mul nsw i64 %27, %0
%29 = mul nsw i64 %28, %0
%30 = mul nsw i64 %29, %0
%31 = mul nsw i64 %30, %0
%32 = mul nsw i64 %31, %0
%33 = mul nsw i64 %32, %0
%34 = add i32 %25, 8
%35 = icmp eq i32 %34, %10
br i1 %35, label %11, label %23
}