xunge/DecIR huggingface dataset:
/* Type definitions */
typedef char uint32_t;

/* Variables and functions */
size_t uint32PackSize(char *);
size_t uint32Unpack(const char *buffer, size_t size, uint32_t *data) {
  size_t req = uint32PackSize(data);
  if (size >= req) {
    *data =
        (buffer[0] << 24) | (buffer[1] << 16) | (buffer[2] << 8) | (buffer[3]);
  }
  return req;
}


x86 assembly (clang, -O0):
<uint32Unpack>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <uint32PackSize@plt>
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x20(%rbp),%rax
jb     1175 <uint32Unpack+0x65>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
shl    $0x18,%eax
mov    -0x8(%rbp),%rcx
movsbl 0x1(%rcx),%ecx
shl    $0x10,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
movsbl 0x2(%rcx),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
movsbl 0x3(%rcx),%ecx
or     %ecx,%eax
mov    %al,%cl
mov    -0x18(%rbp),%rax
mov    %cl,(%rax)
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uint32Unpack>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%rbx
mov    %rsi,%r15
mov    %rdi,%r14
mov    %rdx,%rdi
call   1030 <uint32PackSize@plt>
cmp    %r15,%rax
ja     1131 <uint32Unpack+0x21>
mov    0x3(%r14),%cl
mov    %cl,(%rbx)
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i64 @uint32Unpack(i8* %0, i64 %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i8*
%7 = alloca i64
store i8* %0, i8** %4
store i64 %1, i64* %5
store i8* %2, i8** %6
%8 = load i8*, i8** %6
%9 = call i64 @uint32PackSize(i8* %8)
store i64 %9, i64* %7
%10 = load i64, i64* %5
%11 = load i64, i64* %7
%12 = icmp uge i64 %10, %11
br i1 %12, label %13, label %38
13: ; preds = %3
%14 = load i8*, i8** %4
%15 = getelementptr inbounds i8, i8* %14, i64 0
%16 = load i8, i8* %15
%17 = sext i8 %16 to i32
%18 = shl i32 %17, 24
%19 = load i8*, i8** %4
%20 = getelementptr inbounds i8, i8* %19, i64 1
%21 = load i8, i8* %20
%22 = sext i8 %21 to i32
%23 = shl i32 %22, 16
%24 = or i32 %18, %23
%25 = load i8*, i8** %4
%26 = getelementptr inbounds i8, i8* %25, i64 2
%27 = load i8, i8* %26
%28 = sext i8 %27 to i32
%29 = shl i32 %28, 8
%30 = or i32 %24, %29
%31 = load i8*, i8** %4
%32 = getelementptr inbounds i8, i8* %31, i64 3
%33 = load i8, i8* %32
%34 = sext i8 %33 to i32
%35 = or i32 %30, %34
%36 = trunc i32 %35 to i8
%37 = load i8*, i8** %6
store i8 %36, i8* %37
br label %38
38: ; preds = %13, %3
%39 = load i64, i64* %7
ret i64 %39
}

LLVM IR (-O2):
define i64 @uint32Unpack(i8* nocapture %0, i64 %1, i8* %2) {
%4 = tail call i64 @uint32PackSize(i8* %2)
%5 = icmp ugt i64 %4, %1
br i1 %5, label %9, label %6
6: ; preds = %3
%7 = getelementptr inbounds i8, i8* %0, i64 3
%8 = load i8, i8* %7
store i8 %8, i8* %2
br label %9
9: ; preds = %6, %3
ret i64 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ int64_t;

/* Variables and functions */
int __lzcnt64(int /*<<< orphan*/);
int log2ui(int64_t x) { return __lzcnt64((x < 0) ? -x : x); }


x86 assembly (clang, -O0):
<log2ui>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    1132 <log2ui+0x22>
xor    %eax,%eax
sub    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    1138 <log2ui+0x28>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <__lzcnt64@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<log2ui>:
mov    %edi,%eax
neg    %eax
cmovns %eax,%edi
jmp    1030 <__lzcnt64@plt>

LLVM IR (-O0):
define i32 @log2ui(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp slt i32 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = sub nsw i32 0, %6
br label %10
8: ; preds = %1
%9 = load i32, i32* %2
br label %10
10: ; preds = %8, %5
%11 = phi i32 [ %7, %5 ], [ %9, %8 ]
%12 = call i32 @__lzcnt64(i32 %11)
ret i32 %12
}

LLVM IR (-O2):
define i32 @log2ui(i32 %0) {
%2 = tail call i32 @llvm.abs.i32(i32 %0, i1 true)
%3 = tail call i32 @__lzcnt64(i32 %2)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  int i = 0, j = 0, k = 0;
  if (i == 0) {
    if (k == 5) {
      printf("1\n");
      goto label;
    }
    goto end;
  } else {
    printf("2\n");
  }
  printf("3\n");
label:
  printf("4\n");
end:
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    115e <main+0x4e>
cmpl   $0x5,-0x10(%rbp)
jne    1159 <main+0x49>
lea    0xeb1(%rip),%rdi
call   1030 <printf@plt>
jmp    1176 <main+0x66>
jmp    1182 <main+0x72>
lea    0xe9e(%rip),%rdi
call   1030 <printf@plt>
lea    0xe95(%rip),%rdi
call   1030 <printf@plt>
lea    0xe8c(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
void TOKEN_ADD_ASSIGN(int x, int y) { x <<= y; }


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

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

LLVM IR (-O0):
define void @TOKEN_ADD_ASSIGN(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i32, i32* %3
%7 = shl i32 %6, %5
store i32 %7, i32* %3
ret void
}

LLVM IR (-O2):
define void @TOKEN_ADD_ASSIGN(i32 %0, i32 %1) {
ret void
}
void multiplicar(int a, int b, int *r) { *r = a * b; }


x86 assembly (clang, -O0):
<multiplicar>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x4(%rbp),%ecx
imul   -0x8(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<multiplicar>:
imul   %esi,%edi
mov    %edi,(%rdx)
ret

LLVM IR (-O0):
define void @multiplicar(i32 %0, i32 %1, i32* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32*
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32* %2, i32** %6
%7 = load i32, i32* %4
%8 = load i32, i32* %5
%9 = mul nsw i32 %7, %8
%10 = load i32*, i32** %6
store i32 %9, i32* %10
ret void
}

LLVM IR (-O2):
define void @multiplicar(i32 %0, i32 %1, i32* nocapture writeonly %2) {
%4 = mul nsw i32 %1, %0
store i32 %4, i32* %2
ret void
}
/* Variables and functions */
int utf8_decode(char const *, char const *, unsigned int *);
const char *utf8_next(const char *s, const char *e) {
  unsigned ch;
  return s + utf8_decode(s, e, &ch);
}


x86 assembly (clang, -O0):
<utf8_next>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
lea    -0x14(%rbp),%rdx
call   1030 <utf8_decode@plt>
mov    %eax,%ecx
mov    -0x20(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<utf8_next>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
lea    0xc(%rsp),%rdx
call   1030 <utf8_decode@plt>
cltq
add    %rbx,%rax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @utf8_next(i8* %0, i8* %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = call i32 @utf8_decode(i8* %0, i8* %1, i32* %3)
%6 = sext i32 %5 to i64
%7 = getelementptr inbounds i8, i8* %0, i64 %6
ret i8* %7
}
int makerand(int a, int b, int c, int x) { return (a * x + b) % c; }


x86 assembly (clang, -O0):
<makerand>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x4(%rbp),%eax
imul   -0x10(%rbp),%eax
add    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<makerand>:
mov    %edx,%r8d
imul   %ecx,%edi
lea    (%rdi,%rsi,1),%eax
cltd
idiv   %r8d
mov    %edx,%eax
ret

LLVM IR (-O0):
define i32 @makerand(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32, i32* %5
%10 = load i32, i32* %8
%11 = mul nsw i32 %9, %10
%12 = load i32, i32* %6
%13 = add nsw i32 %11, %12
%14 = load i32, i32* %7
%15 = srem i32 %13, %14
ret i32 %15
}

LLVM IR (-O2):
define i32 @makerand(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = mul nsw i32 %3, %0
%6 = add nsw i32 %5, %1
%7 = srem i32 %6, %2
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *, int);
int print_const(const char *msg, int val) {
  printf("%s: %d\n", msg, val);
  return 0;
}


x86 assembly (clang, -O0):
<print_const>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
lea    0xed3(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_const>:
push   %rax
mov    %esi,%edx
mov    %rdi,%rsi
lea    0xee3(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [8 x i8] c"%s: %d\0A\00"
define i32 @print_const(i8* %0, i32 %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ edit_locker1(int);
int /*<<< orphan*/ print_locker();
int main(void) {
  while (1) {
    edit_locker1(1);
    print_locker();
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x1,%edi
call   1040 <edit_locker1@plt>
mov    $0x0,%al
call   1030 <print_locker@plt>
jmp    112f <main+0xf>

x86 assembly (clang, -O2):
<main>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    $0x1,%edi
call   1040 <edit_locker1@plt>
xor    %eax,%eax
call   1030 <print_locker@plt>
jmp    1130 <main+0x10>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %0, %2
%3 = call i32 @edit_locker1(i32 1)
%4 = call i32 (...) @print_locker()
br label %2
}

LLVM IR (-O2):
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = tail call i32 @edit_locker1(i32 1)
%3 = tail call i32 (...) @print_locker()
br label %1
}
int test_imm_EAint32_mem(int *val) {
  return ((*val) & (0xEA << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_EAint32_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edx
and    $0xea,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_EAint32_mem(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = and i32 %2, 234
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Type definitions */
struct str {
  int dummy;
};

/* Variables and functions */
int str_appendn(struct str *, char *, int);
int str_null_terminate(struct str *str) { return str_appendn(str, "\0", 1); }


x86 assembly (clang, -O0):
<str_null_terminate>:
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 <str_appendn@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
%struct.str = type { i32 }
@.str = [2 x i8] zeroinitializer
define i32 @str_null_terminate(%struct.str* %0) {
%2 = tail call i32 @str_appendn(%struct.str* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 1)
ret i32 %2
}
/* Variables and functions */
int get_version_1();
int get_version_2();
int main(void) {
  int v1 = get_version_1();
  int v2 = get_version_2();
  if (v1 != 104)
    return 1;
  if (v2 != 104 || v2 != 203)
    return 2;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <get_version_1@plt>
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1040 <get_version_2@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x68,-0x8(%rbp)
je     1159 <main+0x39>
movl   $0x1,-0x4(%rbp)
jmp    1183 <main+0x63>
cmpl   $0x68,-0xc(%rbp)
jne    1170 <main+0x50>
cmpl   $0xcb,-0xc(%rbp)
je     117c <main+0x5c>
movl   $0x2,-0x4(%rbp)
jmp    1183 <main+0x63>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1030 <get_version_1@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1040 <get_version_2@plt>
xor    %eax,%eax
cmp    $0x68,%ebx
sete   %al
add    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32 (...) @get_version_1()
store i32 %4, i32* %2
%5 = call i32 (...) @get_version_2()
store i32 %5, i32* %3
%6 = load i32, i32* %2
%7 = icmp ne i32 %6, 104
br i1 %7, label %8, label %9
8: ; preds = %0
store i32 1, i32* %1
br label %17
9: ; preds = %0
%10 = load i32, i32* %3
%11 = icmp ne i32 %10, 104
br i1 %11, label %15, label %12
12: ; preds = %9
%13 = load i32, i32* %3
%14 = icmp ne i32 %13, 203
br i1 %14, label %15, label %16
15: ; preds = %12, %9
store i32 2, i32* %1
br label %17
16: ; preds = %12
store i32 0, i32* %1
br label %17
17: ; preds = %16, %15, %8
%18 = load i32, i32* %1
ret i32 %18
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @get_version_1()
%2 = tail call i32 (...) @get_version_2()
%3 = icmp eq i32 %1, 104
%4 = select i1 %3, i32 2, i32 1
ret i32 %4
}
void buffer_repeat(unsigned char *buffer, unsigned char c, int count) {
  for (int i = 0; i < count; ++i) {
    buffer[i] = c;
  }
}


x86 assembly (clang, -O0):
<buffer_repeat>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    %edx,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1140 <buffer_repeat+0x40>
mov    -0x9(%rbp),%dl
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1118 <buffer_repeat+0x18>
pop    %rbp
ret

x86 assembly (clang, -O2):
<buffer_repeat>:
test   %edx,%edx
jle    1124 <buffer_repeat+0x14>
push   %rax
mov    %edx,%edx
movzbl %sil,%esi
call   1030 <memset@plt>
add    $0x8,%rsp
ret

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

LLVM IR (-O2):
define void @buffer_repeat(i8* nocapture writeonly %0, i8 zeroext %1, i32 %2) {
%4 = icmp sgt i32 %2, 0
br i1 %4, label %5, label %7
5: ; preds = %3
%6 = zext i32 %2 to i64
br label %7
7: ; preds = %5, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ FOURCC(char, unsigned char, char, char);
int /*<<< orphan*/ NodeUnRegisterClass(int /*<<< orphan*/);
void DumpOutput_Done() {
  NodeUnRegisterClass(FOURCC('D', 'U', 'M', 'A'));
  NodeUnRegisterClass(FOURCC('D', 'U', 'M', 'V'));
}


x86 assembly (clang, -O0):
<DumpOutput_Done>:
push   %rbp
mov    %rsp,%rbp
mov    $0x44,%edi
mov    $0x55,%esi
mov    $0x4d,%edx
mov    $0x41,%ecx
call   1030 <FOURCC@plt>
mov    %eax,%edi
call   1040 <NodeUnRegisterClass@plt>
mov    $0x44,%edi
mov    $0x55,%esi
mov    $0x4d,%edx
mov    $0x56,%ecx
call   1030 <FOURCC@plt>
mov    %eax,%edi
call   1040 <NodeUnRegisterClass@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<DumpOutput_Done>:
push   %rax
mov    $0x44,%edi
mov    $0x55,%esi
mov    $0x4d,%edx
mov    $0x41,%ecx
call   1030 <FOURCC@plt>
mov    %eax,%edi
call   1040 <NodeUnRegisterClass@plt>
mov    $0x44,%edi
mov    $0x55,%esi
mov    $0x4d,%edx
mov    $0x56,%ecx
call   1030 <FOURCC@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <NodeUnRegisterClass@plt>

LLVM IR (-O0):
define void @DumpOutput_Done() {
%1 = call i32 @FOURCC(i8 signext 68, i8 zeroext 85, i8 signext 77, i8 signext 65)
%2 = call i32 @NodeUnRegisterClass(i32 %1)
%3 = call i32 @FOURCC(i8 signext 68, i8 zeroext 85, i8 signext 77, i8 signext 86)
%4 = call i32 @NodeUnRegisterClass(i32 %3)
ret void
}

LLVM IR (-O2):
define void @DumpOutput_Done() {
%1 = tail call i32 @FOURCC(i8 signext 68, i8 zeroext 85, i8 signext 77, i8 signext 65)
%2 = tail call i32 @NodeUnRegisterClass(i32 %1)
%3 = tail call i32 @FOURCC(i8 signext 68, i8 zeroext 85, i8 signext 77, i8 signext 86)
%4 = tail call i32 @NodeUnRegisterClass(i32 %3)
ret void
}
int str_ncmp(char *src1, char *src2, int n) {
  int i;
  for (i = 0; i != n; i++) {
    if (*src1++ != *src2++) {
      return 1;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<str_ncmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
movl   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0x1c(%rbp),%eax
je     116d <str_ncmp+0x6d>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movsbl (%rax),%eax
mov    -0x18(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x18(%rbp)
movsbl (%rcx),%ecx
cmp    %ecx,%eax
je     115a <str_ncmp+0x5a>
movl   $0x1,-0x4(%rbp)
jmp    1174 <str_ncmp+0x74>
jmp    115f <str_ncmp+0x5f>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    1116 <str_ncmp+0x16>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<str_ncmp>:
test   %edx,%edx
je     1121 <str_ncmp+0x21>
mov    %edx,%eax
xor    %ecx,%ecx
nopl   0x0(%rax,%rax,1)
movzbl (%rdi,%rcx,1),%edx
cmp    (%rsi,%rcx,1),%dl
jne    1124 <str_ncmp+0x24>
add    $0x1,%rcx
cmp    %ecx,%eax
jne    1110 <str_ncmp+0x10>
xor    %eax,%eax
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @str_ncmp(i8* nocapture %0, i8* nocapture %1, i32 %2) {
%4 = icmp eq i32 %2, 0
br i1 %4, label %17, label %5
5: ; preds = %3, %12
%6 = phi i32 [ %15, %12 ], [ 0, %3 ]
%7 = phi i8* [ %13, %12 ], [ %1, %3 ]
%8 = phi i8* [ %14, %12 ], [ %0, %3 ]
%9 = load i8, i8* %8
%10 = load i8, i8* %7
%11 = icmp eq i8 %9, %10
br i1 %11, label %12, label %17
12: ; preds = %5
%13 = getelementptr inbounds i8, i8* %7, i64 1
%14 = getelementptr inbounds i8, i8* %8, i64 1
%15 = add nuw nsw i32 %6, 1
%16 = icmp eq i32 %15, %2
br i1 %16, label %17, label %5
17: ; preds = %5, %12, %3
%18 = phi i32 [ 0, %3 ], [ 0, %12 ], [ 1, %5 ]
ret i32 %18
}
void fn1(__complex__ long double p1) { __imag__ p1 = 6.0L; }


x86 assembly (clang, -O0):
<fn1>:
push   %rbp
mov    %rsp,%rbp
lea    0x10(%rbp),%rax
flds   0xef2(%rip)
fstpt  0x10(%rax)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @fn1({ x86_fp80, x86_fp80 }* byval({ x86_fp80, x86_fp80 }) align 16 %0) {
%2 = getelementptr inbounds { x86_fp80, x86_fp80 }, { x86_fp80, x86_fp80 }* %0, i32 0, i32 1
store x86_fp80 0xK4001C000000000000000, x86_fp80* %2
ret void
}

LLVM IR (-O2):
define void @fn1({ x86_fp80, x86_fp80 }* nocapture writeonly byval({ x86_fp80, x86_fp80 }) align 16 %0) {
ret void
}
void ff_hevc_put_hevc_bi_w_qpel_v12_10_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_bi_w_qpel_v12_10_sse4() {
ret void
}
void f_empty_goto_loop() {
f_empty_goto_loop_label:
  goto f_empty_goto_loop_label;
}


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

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

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

LLVM IR (-O2):
define void @f_empty_goto_loop() {
br label %1
1: ; preds = %1, %0
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int main(void) {
  int i;
  int vc[5] = {1, 2, 3, 4, 5};
  for (i = 0; i < 5; i++) {
    printf("vc[%d] = %d\n", i, vc[i]);
    return (0);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeda(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xed7(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xed5(%rip),%eax
mov    %eax,-0x10(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x5,-0x8(%rbp)
jge    116d <main+0x5d>
mov    -0x8(%rbp),%esi
movslq -0x8(%rbp),%rax
mov    -0x20(%rbp,%rax,4),%edx
lea    0xeb3(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [13 x i8] c"vc[%d] = %d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 0, i32 1)
ret i32 0
}
char *strlwr2(char *pszStr) {
  char *p;
  p = pszStr;
  while (*p) {
    if (*p >= 'A' && *p <= 'Z')
      *p += 0x20;
    p++;
  }
  return (pszStr);
}


x86 assembly (clang, -O0):
<strlwr2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     115a <strlwr2+0x5a>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x41,%eax
jl     1149 <strlwr2+0x49>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x5a,%eax
jg     1149 <strlwr2+0x49>
mov    -0x10(%rbp),%rax
movsbl (%rax),%ecx
add    $0x20,%ecx
mov    %cl,(%rax)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <strlwr2+0x10>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlwr2>:
mov    %rdi,%rax
mov    (%rdi),%cl
test   %cl,%cl
je     112c <strlwr2+0x2c>
lea    0x1(%rax),%rdx
jmp    111b <strlwr2+0x1b>
nop
movzbl (%rdx),%ecx
add    $0x1,%rdx
test   %cl,%cl
je     112c <strlwr2+0x2c>
lea    -0x41(%rcx),%esi
cmp    $0x19,%sil
ja     1110 <strlwr2+0x10>
add    $0x20,%cl
mov    %cl,-0x1(%rdx)
jmp    1110 <strlwr2+0x10>
ret

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

LLVM IR (-O2):
define i8* @strlwr2(i8* returned %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %15, label %4
4: ; preds = %1, %11
%5 = phi i8 [ %13, %11 ], [ %2, %1 ]
%6 = phi i8* [ %12, %11 ], [ %0, %1 ]
%7 = add i8 %5, -65
%8 = icmp ult i8 %7, 26
br i1 %8, label %9, label %11
9: ; preds = %4
%10 = add nuw nsw i8 %5, 32
store i8 %10, i8* %6
br label %11
11: ; preds = %9, %4
%12 = getelementptr inbounds i8, i8* %6, i64 1
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %4
15: ; preds = %11, %1
ret i8* %0
}
void omap_secure_ram_reserve_memblock(void) {}


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

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

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

LLVM IR (-O2):
define void @omap_secure_ram_reserve_memblock() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ errAbort(char *);
void usage() {
  errAbort("gff3Tester - tester for GFF3 objects\n"
           "usage:\n"
           "   gff3Tester gff3In gff3Out\n"
           "\n");
}


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

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

LLVM IR (-O0):
@.str = [75 x i8] c"gff3Tester - tester for GFF3 objects\0Ausage:\0A gff3Tester gff3In gff3Out\0A\0A\00"
define void @usage() {
%1 = call i32 @errAbort(i8* getelementptr inbounds ([75 x i8], [75 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [75 x i8] c"gff3Tester - tester for GFF3 objects\0Ausage:\0A gff3Tester gff3In gff3Out\0A\0A\00"
define void @usage() {
%1 = tail call i32 @errAbort(i8* getelementptr inbounds ([75 x i8], [75 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void printCharArray(char *array, size_t num) {
  for (size_t i = 0; i < num; i++)
    printf("%c ", array[i]);
  printf("\n");
}


x86 assembly (clang, -O0):
<printCharArray>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x10(%rbp),%rax
jae    1161 <printCharArray+0x51>
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
movsbl (%rax,%rcx,1),%esi
lea    0xeb7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1128 <printCharArray+0x18>
lea    0xe9c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printCharArray>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %rsi,%rsi
je     1158 <printCharArray+0x38>
mov    %rsi,%r12
mov    %rdi,%r14
lea    0xec6(%rip),%r15
xor    %ebx,%ebx
nopl   0x0(%rax)
movsbl (%r14,%rbx,1),%esi
mov    %r15,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1140 <printCharArray+0x20>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%c \00"
define void @printCharArray(i8* nocapture %0, i64 %1) {
%3 = icmp eq i64 %1, 0
br i1 %3, label %4, label %6
4: ; preds = %6, %2
%5 = tail call i32 @putchar(i32 10)
ret void
6: ; preds = %2, %6
%7 = phi i64 [ %12, %6 ], [ 0, %2 ]
%8 = getelementptr inbounds i8, i8* %0, i64 %7
%9 = load i8, i8* %8
%10 = sext i8 %9 to i32
%11 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %10)
%12 = add nuw i64 %7, 1
%13 = icmp eq i64 %12, %1
br i1 %13, label %4, label %6
}
/* Variables and functions */
int /*<<< orphan*/ int80(int, int /*<<< orphan*/, int /*<<< orphan*/,
                         int /*<<< orphan*/, int /*<<< orphan*/,
                         int /*<<< orphan*/);
void yield() { int80(31, 0, 0, 0, 0, 0); }


x86 assembly (clang, -O0):
<yield>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1f,%edi
xor    %r9d,%r9d
mov    %r9d,%esi
mov    %r9d,%edx
mov    %r9d,%ecx
mov    %r9d,%r8d
call   1030 <int80@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<yield>:
mov    $0x1f,%edi
xor    %esi,%esi
xor    %edx,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
xor    %r9d,%r9d
jmp    1030 <int80@plt>

LLVM IR (-O0):
define void @yield() {
%1 = call i32 @int80(i32 31, i32 0, i32 0, i32 0, i32 0, i32 0)
ret void
}

LLVM IR (-O2):
define void @yield() {
%1 = tail call i32 @int80(i32 31, i32 0, i32 0, i32 0, i32 0, i32 0)
ret void
}
/* Variables and functions */
int exec(int, char *);
char *getcmd(char *);
int isvalidcmd(char *);
int request(char *cmdline) {
  int cmdno, chk;
  char *cmd;
  cmd = getcmd(cmdline);
  cmdno = isvalidcmd(cmd);
  if (cmdno) {
    chk = exec(cmdno, cmdline);
    if (chk)
      return 1;
    else
      return -1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<request>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <getcmd@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
call   1040 <isvalidcmd@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
je     1190 <request+0x60>
mov    -0x14(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1050 <exec@plt>
mov    %eax,-0x18(%rbp)
cmpl   $0x0,-0x18(%rbp)
je     1184 <request+0x54>
movl   $0x1,-0x4(%rbp)
jmp    1197 <request+0x67>
movl   $0xffffffff,-0x4(%rbp)
jmp    1197 <request+0x67>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<request>:
push   %rbx
mov    %rdi,%rbx
call   1030 <getcmd@plt>
mov    %rax,%rdi
call   1040 <isvalidcmd@plt>
test   %eax,%eax
je     1159 <request+0x29>
mov    %eax,%edi
mov    %rbx,%rsi
call   1050 <exec@plt>
cmp    $0x1,%eax
sbb    %eax,%eax
or     $0x1,%eax
pop    %rbx
ret
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @request(i8* %0) {
%2 = tail call i8* @getcmd(i8* %0)
%3 = tail call i32 @isvalidcmd(i8* %2)
%4 = icmp eq i32 %3, 0
br i1 %4, label %9, label %5
5: ; preds = %1
%6 = tail call i32 @exec(i32 %3, i8* %0)
%7 = icmp eq i32 %6, 0
%8 = select i1 %7, i32 -1, i32 1
br label %9
9: ; preds = %1, %5
%10 = phi i32 [ %8, %5 ], [ 0, %1 ]
ret i32 %10
}
void foo219() {}


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

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

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

LLVM IR (-O2):
define void @foo219() {
ret void
}
int main(int argc, char **argv) {
  char *sieve;
  int *primes;
  prime_sieve(200000, &sieve, &primes);
  printf("%d\n", primes[10001 - 1]);
  free(sieve);
  free(primes);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x30d40,%edi
lea    -0x18(%rbp),%rsi
lea    -0x20(%rbp),%rdx
mov    $0x0,%al
call   1050 <prime_sieve@plt>
mov    -0x20(%rbp),%rax
mov    0x9c40(%rax),%esi
lea    0xe95(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
mov    -0x20(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
lea    0x10(%rsp),%rsi
lea    0x8(%rsp),%rdx
mov    $0x30d40,%edi
xor    %eax,%eax
call   1050 <prime_sieve@plt>
mov    0x8(%rsp),%rax
mov    0x9c40(%rax),%esi
lea    0xea4(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x10(%rsp),%rdi
call   1030 <free@plt>
mov    0x8(%rsp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x18,%rsp
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**
%6 = alloca i8*
%7 = alloca i32*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = call i32 (i32, i8**, i32**, ...) bitcast (i32 (...)* @prime_sieve to i32 (i32, i8**, i32**, ...)*)(i32 200000, i8** %6, i32** %7)
%9 = load i32*, i32** %7
%10 = getelementptr inbounds i32, i32* %9, i64 10000
%11 = load i32, i32* %10
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %11)
%13 = load i8*, i8** %6
%14 = load i32*, i32** %7
%15 = bitcast i32* %14 to i8*
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i8*
%4 = alloca i32*
%5 = bitcast i8** %3 to i8*
%6 = bitcast i32** %4 to i8*
%7 = call i32 (i32, i8**, i32**, ...) bitcast (i32 (...)* @prime_sieve to i32 (i32, i8**, i32**, ...)*)(i32 200000, i8** %3, i32** %4)
%8 = load i32*, i32** %4
%9 = getelementptr inbounds i32, i32* %8, i64 10000
%10 = load i32, i32* %9
%11 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %10)
%12 = load i8*, i8** %3
%13 = bitcast i32** %4 to i8**
%14 = load i8*, i8** %13
ret i32 0
}
char *get_version_string(void) { return "libinklevel 0.8.0"; }


x86 assembly (clang, -O0):
<get_version_string>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_version_string>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [18 x i8] c"libinklevel 0.8.0\00"
define i8* @get_version_string() {
ret i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [18 x i8] c"libinklevel 0.8.0\00"
define i8* @get_version_string() {
ret i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0)
}
/* Type definitions */
typedef int /*<<< orphan*/ __m64;
typedef int /*<<< orphan*/ __m128i;

/* Variables and functions */
int /*<<< orphan*/ _mm_castsi128_ps(int /*<<< orphan*/ const);
int /*<<< orphan*/ _mm_storeh_pi(int /*<<< orphan*/ *, int /*<<< orphan*/);
void _mm_storeh_epi64(__m128i *const d, const __m128i s) {
  _mm_storeh_pi((__m64 *)d, _mm_castsi128_ps(s));
}


x86 assembly (clang, -O0):
<_mm_storeh_epi64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%edi
call   1040 <_mm_castsi128_ps@plt>
mov    -0x18(%rbp),%rdi
mov    %eax,%esi
call   1030 <_mm_storeh_pi@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_mm_storeh_epi64>:
push   %rbx
mov    %rdi,%rbx
mov    %esi,%edi
call   1040 <_mm_castsi128_ps@plt>
mov    %rbx,%rdi
mov    %eax,%esi
pop    %rbx
jmp    1030 <_mm_storeh_pi@plt>

LLVM IR (-O0):
define void @_mm_storeh_epi64(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32*, i32** %3
%6 = load i32, i32* %4
%7 = call i32 @_mm_castsi128_ps(i32 %6)
%8 = call i32 @_mm_storeh_pi(i32* %5, i32 %7)
ret void
}

LLVM IR (-O2):
define void @_mm_storeh_epi64(i32* %0, i32 %1) {
%3 = tail call i32 @_mm_castsi128_ps(i32 %1)
%4 = tail call i32 @_mm_storeh_pi(i32* %0, i32 %3)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;

/* Variables and functions */
int /*<<< orphan*/ srand(unsigned int);
scalar_t__ time(int /*<<< orphan*/ *);
void initRand(void) {
  time_t t;
  srand((unsigned)time(&t));
}


x86 assembly (clang, -O0):
<initRand>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x4(%rbp),%rdi
call   1040 <time@plt>
mov    %eax,%edi
call   1030 <srand@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<initRand>:
push   %rax
lea    0x4(%rsp),%rdi
call   1040 <time@plt>
mov    %eax,%edi
call   1030 <srand@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @initRand() {
%1 = alloca i32
%2 = call i64 @time(i32* %1)
%3 = trunc i64 %2 to i32
%4 = call i32 @srand(i32 %3)
ret void
}

LLVM IR (-O2):
define void @initRand() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i64 @time(i32* %1)
%4 = trunc i64 %3 to i32
%5 = call i32 @srand(i32 %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void foo() { printf("hello\n"); }


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

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

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

LLVM IR (-O2):
@str = [6 x i8] c"hello\00"
define void @foo() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0))
ret void
}
adrreg0imm1_set(r0, r1, x0, x1, p0, p1) float r0, r1;
float *p0, *p1;
{ (p0[10000000]) = 33; }


x86 assembly (clang, -O0):
<adrreg0imm1_set>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm1,-0x30(%rbp)
movaps %xmm0,%xmm1
movsd  -0x30(%rbp),%xmm0
cvtsd2ss %xmm1,%xmm1
cvtsd2ss %xmm0,%xmm0
movss  %xmm1,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
mov    %edi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    -0x20(%rbp),%rax
movss  0xec3(%rip),%xmm0
movss  %xmm0,0x2625a00(%rax)
02
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<adrreg0imm1_set>:
movl   $0x42040000,0x2625a00(%rdx)
ret

LLVM IR (-O0):
define i32 @adrreg0imm1_set(double %0, double %1, i32 %2, i32 %3, float* %4, float* %5) {
%7 = alloca i32
%8 = alloca float
%9 = alloca float
%10 = alloca i32
%11 = alloca i32
%12 = alloca float*
%13 = alloca float*
%14 = fptrunc double %0 to float
%15 = fptrunc double %1 to float
store float %14, float* %8
store float %15, float* %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store float* %4, float** %12
store float* %5, float** %13
%16 = load float*, float** %12
%17 = getelementptr inbounds float, float* %16, i64 10000000
store float 3.300000e+01, float* %17
%18 = load i32, i32* %7
ret i32 %18
}

LLVM IR (-O2):
define i32 @adrreg0imm1_set(double %0, double %1, i32 %2, i32 %3, float* nocapture writeonly %4, float* nocapture readnone %5) {
%7 = getelementptr inbounds float, float* %4, i64 10000000
store float 3.300000e+01, float* %7
ret i32 undef
}
int main(void) {
  char(*s)[6];
  s = &"hello";
  (*s)[0] = 'x';
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
lea    0xeee(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movb   $0x78,(%rax)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [6 x i8] c"hello\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [6 x i8]*
store i32 0, i32* %1
store [6 x i8]* @.str, [6 x i8]** %2
%3 = load [6 x i8]*, [6 x i8]** %2
%4 = getelementptr inbounds [6 x i8], [6 x i8]* %3, i64 0, i64 0
store i8 120, i8* %4
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
int get_hw_offset(struct ssp_data *data) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.ssp_data = type opaque
define i32 @get_hw_offset(%struct.ssp_data* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ iscntrl(int);
void t_iscntrl_0xb6() {
  Assert_real((iscntrl(182) == 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_iscntrl.c",
              915, ("iscntrl should be 0 for 0xb6"));
}


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

x86 assembly (clang, -O2):
<t_iscntrl_0xb6>:
push   %rax
mov    $0xb6,%edi
call   1030 <iscntrl@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x393,%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_iscntrl.c\00"
@.str.1 = [29 x i8] c"iscntrl should be 0 for 0xb6\00"
define void @t_iscntrl_0xb6() {
%1 = call i64 @iscntrl(i32 182)
%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 915, 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_iscntrl.c\00"
@.str.1 = [29 x i8] c"iscntrl should be 0 for 0xb6\00"
define void @t_iscntrl_0xb6() {
%1 = tail call i64 @iscntrl(i32 182)
%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 915, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int cairo_code_draw_envTitleLabel_get_width() { return 518; }


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

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

LLVM IR (-O0):
define i32 @cairo_code_draw_envTitleLabel_get_width() {
ret i32 518
}

LLVM IR (-O2):
define i32 @cairo_code_draw_envTitleLabel_get_width() {
ret i32 518
}
int var() { return 42; }


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

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

LLVM IR (-O0):
define i32 @var() {
ret i32 42
}

LLVM IR (-O2):
define i32 @var() {
ret i32 42
}
int ordering_err_1(void) {
  return ((int)-(((int)0x37ED)
                 << (8 *
                     (((!!(((!!(sizeof(int))) * ((sizeof(int)) - 1)))) *
                       ((((!!(sizeof(int))) * ((sizeof(int)) - 1))) - 1))))));
}


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

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

LLVM IR (-O0):
define i32 @ordering_err_1() {
ret i32 -938278912
}

LLVM IR (-O2):
define i32 @ordering_err_1() {
ret i32 -938278912
}