xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stdout;
int /*<<< orphan*/ tek_vector(short, short);
void plD_line_tek(short x1, short y1, short x2, short y2) {
  fprintf(stdout, "\035");
  tek_vector(x1, y1);
  tek_vector(x2, y2);
}


x86 assembly (clang, -O0):
<plD_line_tek>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %cx,%ax
mov    %dx,%cx
mov    %si,%dx
mov    %di,%si
mov    %si,-0x2(%rbp)
mov    %dx,-0x4(%rbp)
mov    %cx,-0x6(%rbp)
mov    %ax,-0x8(%rbp)
mov    0x2e95(%rip),%rax
mov    (%rax),%edi
lea    0xeac(%rip),%rsi
call   1040 <fprintf@plt>
mov    -0x2(%rbp),%ax
movswl %ax,%edi
movswl -0x4(%rbp),%esi
call   1030 <tek_vector@plt>
mov    -0x6(%rbp),%ax
movswl %ax,%edi
movswl -0x8(%rbp),%esi
call   1030 <tek_vector@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<plD_line_tek>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %ecx,%r14d
mov    %edx,%r15d
mov    %esi,%ebx
mov    %edi,%ebp
mov    0x2ea8(%rip),%rax
mov    (%rax),%edi
lea    0xebf(%rip),%rsi
call   1040 <fprintf@plt>
mov    %ebp,%edi
mov    %ebx,%esi
call   1030 <tek_vector@plt>
mov    %r15d,%edi
mov    %r14d,%esi
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <tek_vector@plt>

LLVM IR (-O0):
@stdout = global i32 0
@.str = [2 x i8] c"\1D\00"
define void @plD_line_tek(i16 signext %0, i16 signext %1, i16 signext %2, i16 signext %3) {
%5 = alloca i16
%6 = alloca i16
%7 = alloca i16
%8 = alloca i16
store i16 %0, i16* %5
store i16 %1, i16* %6
store i16 %2, i16* %7
store i16 %3, i16* %8
%9 = load i32, i32* @stdout
%10 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%11 = load i16, i16* %5
%12 = load i16, i16* %6
%13 = call i32 @tek_vector(i16 signext %11, i16 signext %12)
%14 = load i16, i16* %7
%15 = load i16, i16* %8
%16 = call i32 @tek_vector(i16 signext %14, i16 signext %15)
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [2 x i8] c"\1D\00"
define void @plD_line_tek(i16 signext %0, i16 signext %1, i16 signext %2, i16 signext %3) {
%5 = load i32, i32* @stdout
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%7 = tail call i32 @tek_vector(i16 signext %0, i16 signext %1)
%8 = tail call i32 @tek_vector(i16 signext %2, i16 signext %3)
ret void
}
struct s {
  int x;
  int y;
} f() {
  struct s v = {1, 2};
  return v;
}


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

x86 assembly (clang, -O2):
<f>:
movabs $0x200000001,%rax
ret

LLVM IR (-O0):
%struct.s = type { i32, i32 }
@__const.f.v = %struct.s { i32 1, i32 2 }
define i64 @f() {
%1 = alloca %struct.s
%2 = bitcast %struct.s* %1 to i8*
%3 = bitcast %struct.s* %1 to i64*
%4 = load i64, i64* %3
ret i64 %4
}

LLVM IR (-O2):
define i64 @f() {
ret i64 8589934593
}
void *memcpy(void *restrict __dest, const void *restrict __src,
             unsigned long int __len) {
  void *return_value___builtin___memcpy_chk$1;
  return_value___builtin___memcpy_chk$1 = __builtin___memcpy_chk(
      __dest, __src, (unsigned int)__len, 18446744073709551615ul);
  return return_value___builtin___memcpy_chk$1;
}


x86 assembly (clang, -O0):
<memcpy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rax
mov    %eax,%eax
mov    %eax,%edx
mov    $0xffffffffffffffff,%rcx
call   1030 <__memcpy_chk@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<memcpy>:
mov    %edx,%edx
jmp    1030 <memcpy@plt>

LLVM IR (-O0):
define i8* @memcpy(i8* noalias %0, i8* noalias %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%8 = load i8*, i8** %4
%9 = load i8*, i8** %5
%10 = load i64, i64* %6
%11 = trunc i64 %10 to i32
%12 = zext i32 %11 to i64
%13 = call i8* @__memcpy_chk(i8* %8, i8* %9, i64 %12, i64 -1)
store i8* %13, i8** %7
%14 = load i8*, i8** %7
ret i8* %14
}

LLVM IR (-O2):
define i8* @memcpy(i8* noalias returned writeonly %0, i8* noalias nocapture %1, i64 %2) {
%4 = and i64 %2, 4294967295
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 %0, i8* align 1 %1, i64 %4, i1 false)
ret i8* %0
}
/* Variables and functions */
int CHAR_BIT;
int my_ctzll(unsigned long long x) {
  int i;
  for (i = 0; i < CHAR_BIT * sizeof(unsigned long long); i++)
    if (x & ((unsigned long long)1 << i))
      break;
  return i;
}


x86 assembly (clang, -O0):
<my_ctzll>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movslq -0xc(%rbp),%rax
mov    0x2ec6(%rip),%rcx
movslq (%rcx),%rcx
shl    $0x3,%rcx
cmp    %rcx,%rax
jae    1161 <my_ctzll+0x61>
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%rdx
mov    %rdx,%rcx
and    %rcx,%rax
cmp    $0x0,%rax
je     114e <my_ctzll+0x4e>
jmp    1161 <my_ctzll+0x61>
jmp    1153 <my_ctzll+0x53>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <my_ctzll+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_ctzll>:
mov    0x2ed9(%rip),%rax
movslq (%rax),%rax
test   %rax,%rax
je     1143 <my_ctzll+0x43>
shl    $0x3,%rax
cmp    $0x2,%rax
mov    $0x1,%ecx
cmovae %rax,%rcx
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
bt     %rax,%rdi
jb     1142 <my_ctzll+0x42>
add    $0x1,%rax
cmp    %rax,%rcx
jne    1130 <my_ctzll+0x30>
mov    %rcx,%rax
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
@CHAR_BIT = global i32 0
define i32 @my_ctzll(i64 %0) {
%2 = alloca i64
%3 = alloca i32
store i64 %0, i64* %2
store i32 0, i32* %3
br label %4
4: ; preds = %20, %1
%5 = load i32, i32* %3
%6 = sext i32 %5 to i64
%7 = load i32, i32* @CHAR_BIT
%8 = sext i32 %7 to i64
%9 = mul i64 %8, 8
%10 = icmp ult i64 %6, %9
br i1 %10, label %11, label %23
11: ; preds = %4
%12 = load i64, i64* %2
%13 = load i32, i32* %3
%14 = zext i32 %13 to i64
%15 = shl i64 1, %14
%16 = and i64 %12, %15
%17 = icmp ne i64 %16, 0
br i1 %17, label %18, label %19
18: ; preds = %11
br label %23
19: ; preds = %11
br label %20
20: ; preds = %19
%21 = load i32, i32* %3
%22 = add nsw i32 %21, 1
store i32 %22, i32* %3
br label %4
23: ; preds = %18, %4
%24 = load i32, i32* %3
ret i32 %24
}

LLVM IR (-O2):
@CHAR_BIT = global i32 0
define i32 @my_ctzll(i64 %0) {
%2 = load i32, i32* @CHAR_BIT
%3 = icmp eq i32 %2, 0
br i1 %3, label %19, label %4
4: ; preds = %1
%5 = sext i32 %2 to i64
%6 = shl nsw i64 %5, 3
%7 = call i64 @llvm.umax.i64(i64 %6, i64 1)
br label %8
8: ; preds = %4, %13
%9 = phi i64 [ 0, %4 ], [ %14, %13 ]
%10 = shl nuw i64 1, %9
%11 = and i64 %10, %0
%12 = icmp eq i64 %11, 0
br i1 %12, label %13, label %16
13: ; preds = %8
%14 = add nuw i64 %9, 1
%15 = icmp eq i64 %14, %7
br i1 %15, label %16, label %8
16: ; preds = %8, %13
%17 = phi i64 [ %7, %13 ], [ %9, %8 ]
%18 = trunc i64 %17 to i32
br label %19
19: ; preds = %16, %1
%20 = phi i32 [ 0, %1 ], [ %18, %16 ]
ret i32 %20
}
char *printString(const void *element) { return *(char **)element; }


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

x86 assembly (clang, -O2):
<printString>:
mov    (%rdi),%rax
ret

LLVM IR (-O0):
define i8* @printString(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to i8**
%5 = load i8*, i8** %4
ret i8* %5
}

LLVM IR (-O2):
define i8* @printString(i8* nocapture %0) {
%2 = bitcast i8* %0 to i8**
%3 = load i8*, i8** %2
ret i8* %3
}
void test2_helper(int x, int y) {}


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

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

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

LLVM IR (-O2):
define void @test2_helper(i32 %0, i32 %1) {
ret void
}
int lehmer(int x) { return (x * 123456789) % 987654321; }


x86 assembly (clang, -O0):
<lehmer>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
imul   $0x75bcd15,-0x4(%rbp),%eax
mov    $0x3ade68b1,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<lehmer>:
imul   $0x75bcd15,%edi,%eax
cltq
imul   $0xffffffff8b282d3f,%rax,%rcx
shr    $0x20,%rcx
add    %eax,%ecx
mov    %ecx,%edx
shr    $0x1f,%edx
sar    $0x1d,%ecx
add    %edx,%ecx
imul   $0x3ade68b1,%ecx,%ecx
sub    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @lehmer(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = mul nsw i32 %3, 123456789
%5 = srem i32 %4, 987654321
ret i32 %5
}

LLVM IR (-O2):
define i32 @lehmer(i32 %0) {
%2 = mul nsw i32 %0, 123456789
%3 = srem i32 %2, 987654321
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
void nrerror(const char message[]) {
  fprintf(stderr, "\n%s\n", message);
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<nrerror>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e8c(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<nrerror>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e98(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [5 x i8] c"\0A%s\0A\00"
@EXIT_FAILURE = global i32 0
define void @nrerror(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = load i32, i32* @EXIT_FAILURE
%7 = call i32 @exit(i32 %6)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [5 x i8] c"\0A%s\0A\00"
@EXIT_FAILURE = global i32 0
define void @nrerror(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = load i32, i32* @EXIT_FAILURE
%5 = tail call i32 @exit(i32 %4)
unreachable
}
int check(char num[], int rep) {
  int count;
  for (count = 0; num[count] != '\0'; count++) {
    if (num[count] == 'm') {
      return rep;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<check>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     115a <check+0x5a>
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x6d,%eax
jne    1147 <check+0x47>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1161 <check+0x61>
jmp    114c <check+0x4c>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1112 <check+0x12>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<check>:
mov    %esi,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movzbl (%rdi),%ecx
test   %cl,%cl
je     1122 <check+0x22>
cmp    $0x6d,%cl
je     1124 <check+0x24>
add    $0x1,%rdi
jmp    1110 <check+0x10>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @check(i8* nocapture %0, i32 %1) {
br label %3
3: ; preds = %7, %2
%4 = phi i64 [ %8, %7 ], [ 0, %2 ]
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = load i8, i8* %5
switch i8 %6, label %7 [
i8 0, label %10
i8 109, label %9
]
7: ; preds = %3
%8 = add nuw i64 %4, 1
br label %3
9: ; preds = %3
br label %10
10: ; preds = %3, %9
%11 = phi i32 [ %1, %9 ], [ 0, %3 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ test_append();
int /*<<< orphan*/ test_create();
int /*<<< orphan*/ test_delete();
int /*<<< orphan*/ test_pop();
int /*<<< orphan*/ test_push();
int /*<<< orphan*/ test_search();
int /*<<< orphan*/ test_shift();
int /*<<< orphan*/ test_size();
int main(void) {
  test_create();
  test_push();
  test_append();
  test_search();
  test_size();
  test_delete();
  test_shift();
  test_pop();
  printf("All tests passed\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   10b0 <test_create@plt>
mov    $0x0,%al
call   1090 <test_push@plt>
mov    $0x0,%al
call   10a0 <test_append@plt>
mov    $0x0,%al
call   1080 <test_search@plt>
mov    $0x0,%al
call   1040 <test_size@plt>
mov    $0x0,%al
call   1070 <test_delete@plt>
mov    $0x0,%al
call   1030 <test_shift@plt>
mov    $0x0,%al
call   1060 <test_pop@plt>
lea    0xe22(%rip),%rdi
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   10b0 <test_create@plt>
xor    %eax,%eax
call   1090 <test_push@plt>
xor    %eax,%eax
call   10a0 <test_append@plt>
xor    %eax,%eax
call   1080 <test_search@plt>
xor    %eax,%eax
call   1050 <test_size@plt>
xor    %eax,%eax
call   1070 <test_delete@plt>
xor    %eax,%eax
call   1030 <test_shift@plt>
xor    %eax,%eax
call   1060 <test_pop@plt>
lea    0xe30(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [18 x i8] c"All tests passed\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @test_create()
%3 = call i32 (...) @test_push()
%4 = call i32 (...) @test_append()
%5 = call i32 (...) @test_search()
%6 = call i32 (...) @test_size()
%7 = call i32 (...) @test_delete()
%8 = call i32 (...) @test_shift()
%9 = call i32 (...) @test_pop()
%10 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [17 x i8] c"All tests passed\00"
define i32 @main() {
%1 = tail call i32 (...) @test_create()
%2 = tail call i32 (...) @test_push()
%3 = tail call i32 (...) @test_append()
%4 = tail call i32 (...) @test_search()
%5 = tail call i32 (...) @test_size()
%6 = tail call i32 (...) @test_delete()
%7 = tail call i32 (...) @test_shift()
%8 = tail call i32 (...) @test_pop()
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
struct task_struct {
  int dummy;
};
struct rq {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ rq_last_tick_reset(struct rq *);
void put_prev_task_idle(struct rq *rq, struct task_struct *prev) {
  rq_last_tick_reset(rq);
}


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

x86 assembly (clang, -O2):
<put_prev_task_idle>:
jmp    1030 <rq_last_tick_reset@plt>

LLVM IR (-O0):
%struct.rq = type { i32 }
%struct.task_struct = type { i32 }
define void @put_prev_task_idle(%struct.rq* %0, %struct.task_struct* %1) {
%3 = alloca %struct.rq*
%4 = alloca %struct.task_struct*
store %struct.rq* %0, %struct.rq** %3
store %struct.task_struct* %1, %struct.task_struct** %4
%5 = load %struct.rq*, %struct.rq** %3
%6 = call i32 @rq_last_tick_reset(%struct.rq* %5)
ret void
}

LLVM IR (-O2):
%struct.rq = type { i32 }
%struct.task_struct = type { i32 }
define void @put_prev_task_idle(%struct.rq* %0, %struct.task_struct* nocapture readnone %1) {
%3 = tail call i32 @rq_last_tick_reset(%struct.rq* %0)
ret void
}
/* Variables and functions */
int pow(double, int);
float get_temperature(unsigned char ocho_t, unsigned char seis_t) {
  unsigned int result = ((ocho_t << 8) + seis_t) >> 2;
  float val = (result / (pow(2.0, 14) - 2) * 165) - 40;
  return val;
}


x86 assembly (clang, -O0):
<get_temperature>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
shr    $0x2,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
movsd  0xebb(%rip),%xmm0
mov    $0xe,%edi
call   1030 <pow@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
add    $0xfffffffe,%ecx
xor    %edx,%edx
div    %ecx
imul   $0xa5,%eax,%eax
add    $0xffffffd8,%eax
cvtsi2ss %rax,%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_temperature>:
push   %rbx
shl    $0x8,%edi
lea    (%rdi,%rsi,1),%ebx
shr    $0x2,%ebx
movsd  0xede(%rip),%xmm0
mov    $0xe,%edi
call   1030 <pow@plt>
mov    %eax,%ecx
add    $0xfffffffe,%ecx
mov    %ebx,%eax
xor    %edx,%edx
div    %ecx
imul   $0xa5,%eax,%eax
add    $0xffffffd8,%eax
xorps  %xmm0,%xmm0
cvtsi2ss %rax,%xmm0
pop    %rbx
ret

LLVM IR (-O0):
define float @get_temperature(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
%6 = alloca float
store i8 %0, i8* %3
store i8 %1, i8* %4
%7 = load i8, i8* %3
%8 = zext i8 %7 to i32
%9 = shl i32 %8, 8
%10 = load i8, i8* %4
%11 = zext i8 %10 to i32
%12 = add nsw i32 %9, %11
%13 = ashr i32 %12, 2
store i32 %13, i32* %5
%14 = load i32, i32* %5
%15 = call i32 @pow(double 2.000000e+00, i32 14)
%16 = sub nsw i32 %15, 2
%17 = udiv i32 %14, %16
%18 = mul i32 %17, 165
%19 = sub i32 %18, 40
%20 = uitofp i32 %19 to float
store float %20, float* %6
%21 = load float, float* %6
ret float %21
}

LLVM IR (-O2):
define float @get_temperature(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = shl nuw nsw i32 %3, 8
%5 = zext i8 %1 to i32
%6 = or i32 %4, %5
%7 = lshr i32 %6, 2
%8 = tail call i32 @pow(double 2.000000e+00, i32 14)
%9 = add nsw i32 %8, -2
%10 = udiv i32 %7, %9
%11 = mul nuw nsw i32 %10, 165
%12 = add nsw i32 %11, -40
%13 = uitofp i32 %12 to float
ret float %13
}
/* Type definitions */
struct command {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct command *);
void free_command(struct command *cmd) { free(cmd); }


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

x86 assembly (clang, -O2):
<free_command>:
jmp    1030 <free@plt>

LLVM IR (-O0):
%struct.command = type { i32 }
define void @free_command(%struct.command* %0) {
%2 = alloca %struct.command*
store %struct.command* %0, %struct.command** %2
%3 = load %struct.command*, %struct.command** %2
%4 = call i32 @free(%struct.command* %3)
ret void
}

LLVM IR (-O2):
%struct.command = type { i32 }
define void @free_command(%struct.command* nocapture %0) {
%2 = tail call i32 @free(%struct.command* %0)
ret void
}
/* Type definitions */
struct ukvm_hv {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ gdb_handle_exception(struct ukvm_hv *, int /*<<< orphan*/);
int /*<<< orphan*/ wait_for_connect();
void gdb_stub_start(struct ukvm_hv *hv) {
  wait_for_connect();
  gdb_handle_exception(hv, 0);
}


x86 assembly (clang, -O0):
<gdb_stub_start>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1040 <wait_for_connect@plt>
mov    -0x8(%rbp),%rdi
xor    %esi,%esi
call   1030 <gdb_handle_exception@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gdb_stub_start>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1040 <wait_for_connect@plt>
mov    %rbx,%rdi
xor    %esi,%esi
pop    %rbx
jmp    1030 <gdb_handle_exception@plt>

LLVM IR (-O0):
%struct.ukvm_hv = type { i32 }
define void @gdb_stub_start(%struct.ukvm_hv* %0) {
%2 = alloca %struct.ukvm_hv*
store %struct.ukvm_hv* %0, %struct.ukvm_hv** %2
%3 = call i32 (...) @wait_for_connect()
%4 = load %struct.ukvm_hv*, %struct.ukvm_hv** %2
%5 = call i32 @gdb_handle_exception(%struct.ukvm_hv* %4, i32 0)
ret void
}

LLVM IR (-O2):
%struct.ukvm_hv = type { i32 }
define void @gdb_stub_start(%struct.ukvm_hv* %0) {
%2 = tail call i32 (...) @wait_for_connect()
%3 = tail call i32 @gdb_handle_exception(%struct.ukvm_hv* %0, i32 0)
ret void
}
void foo681(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo681(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, char *);
void main(int argc, char *argv[]) {
  for (int i = 0; i < argc; i++) {
    printf("argv[%d] = %s\n", i, argv[i]);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    115b <main+0x4b>
mov    -0x14(%rbp),%esi
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdx
lea    0xeb8(%rip),%rdi
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1126 <main+0x16>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %edi,%edi
jle    1147 <main+0x37>
mov    %rsi,%r14
mov    %edi,%r12d
xor    %ebx,%ebx
lea    0xed5(%rip),%r15
nopl   0x0(%rax,%rax,1)
mov    (%r14,%rbx,8),%rdx
mov    %r15,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1130 <main+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [15 x i8] c"argv[%d] = %s\0A\00"
define void @main(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 0
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = zext i32 %0 to i64
br label %7
6: ; preds = %7, %2
ret void
7: ; preds = %4, %7
%8 = phi i64 [ 0, %4 ], [ %13, %7 ]
%9 = getelementptr inbounds i8*, i8** %1, i64 %8
%10 = load i8*, i8** %9
%11 = trunc i64 %8 to i32
%12 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %11, i8* %10)
%13 = add nuw nsw i64 %8, 1
%14 = icmp eq i64 %13, %5
br i1 %14, label %6, label %7
}
/* Variables and functions */
int /*<<< orphan*/ b1_put_byte(unsigned int, int /*<<< orphan*/);
int /*<<< orphan*/ b1_put_word(unsigned int, unsigned int);
void b1_put_slice(unsigned int base, unsigned char *dp, unsigned int len) {
  unsigned i = len;
  b1_put_word(base, i);
  while (i-- > 0)
    b1_put_byte(base, *dp++);
}


x86 assembly (clang, -O0):
<b1_put_slice>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x18(%rbp),%esi
call   1030 <b1_put_word@plt>
mov    -0x18(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x18(%rbp)
cmp    $0x0,%eax
jbe    1176 <b1_put_slice+0x56>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movzbl (%rax),%esi
call   1040 <b1_put_byte@plt>
jmp    1143 <b1_put_slice+0x23>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<b1_put_slice>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %edx,%r14d
mov    %rsi,%r15
mov    %edi,%r12d
mov    %edx,%esi
call   1030 <b1_put_word@plt>
test   %r14d,%r14d
je     1165 <b1_put_slice+0x45>
mov    %r14d,%ebx
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movzbl (%r15,%rbp,1),%esi
mov    %r12d,%edi
call   1040 <b1_put_byte@plt>
add    $0x1,%rbp
cmp    %ebp,%ebx
jne    1150 <b1_put_slice+0x30>
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define void @b1_put_slice(i32 %0, i8* nocapture %1, i32 %2) {
%4 = tail call i32 @b1_put_word(i32 %0, i32 %2)
%5 = icmp eq i32 %2, 0
br i1 %5, label %15, label %6
6: ; preds = %3, %6
%7 = phi i32 [ %9, %6 ], [ %2, %3 ]
%8 = phi i8* [ %10, %6 ], [ %1, %3 ]
%9 = add i32 %7, -1
%10 = getelementptr inbounds i8, i8* %8, i64 1
%11 = load i8, i8* %8
%12 = zext i8 %11 to i32
%13 = tail call i32 @b1_put_byte(i32 %0, i32 %12)
%14 = icmp eq i32 %9, 0
br i1 %14, label %15, label %6
15: ; preds = %6, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void help(char **argv) {
  fprintf(stderr,
          "%s [-R <socket directory>] [-m <nb max clients>] [-u <user>][ -h]\n",
          argv[0]);
}


x86 assembly (clang, -O0):
<help>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rax
mov    (%rax),%rdx
lea    0xecd(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<help>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%eax
mov    (%rdi),%rdx
lea    0xedd(%rip),%rsi
mov    %eax,%edi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [67 x i8] c"%s [-R <socket directory>] [-m <nb max clients>] [-u <user>][ -h]\0A\00"
define void @help(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
%3 = load i32, i32* @stderr
%4 = load i8**, i8*** %2
%5 = getelementptr inbounds i8*, i8** %4, i64 0
%6 = load i8*, i8** %5
%7 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([67 x i8], [67 x i8]* @.str, i64 0, i64 0), i8* %6)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [67 x i8] c"%s [-R <socket directory>] [-m <nb max clients>] [-u <user>][ -h]\0A\00"
define void @help(i8** nocapture %0) {
%2 = load i32, i32* @stderr
%3 = load i8*, i8** %0
%4 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([67 x i8], [67 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ err(int, char *);
void *malloc(size_t);
void *mymalloc(size_t size) {
  void *result = malloc(size);
  if (!result)
    err(-2, "mymalloc() failed!");
  return result;
}


x86 assembly (clang, -O0):
<mymalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1155 <mymalloc+0x35>
mov    $0xfffffffe,%edi
lea    0xeb0(%rip),%rsi
call   1030 <err@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mymalloc>:
push   %rbx
call   1040 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    113f <mymalloc+0x1f>
lea    0xecb(%rip),%rsi
mov    $0xfffffffe,%edi
call   1030 <err@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [19 x i8] c"mymalloc() failed!\00"
define i8* @mymalloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %10, label %8
8: ; preds = %1
%9 = call i32 @err(i32 -2, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %8, %1
%11 = load i8*, i8** %3
ret i8* %11
}

LLVM IR (-O2):
@.str = [19 x i8] c"mymalloc() failed!\00"
define noalias i8* @mymalloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @err(i32 -2, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %1
ret i8* %2
}
int bar(struct X *p, int i) { return *((int *)p + i + 8); }


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

x86 assembly (clang, -O2):
<bar>:
movslq %esi,%rax
mov    0x20(%rdi,%rax,4),%eax
ret

LLVM IR (-O0):
%struct.X = type opaque
define i32 @bar(%struct.X* %0, i32 %1) {
%3 = alloca %struct.X*
%4 = alloca i32
store %struct.X* %0, %struct.X** %3
store i32 %1, i32* %4
%5 = load %struct.X*, %struct.X** %3
%6 = bitcast %struct.X* %5 to i32*
%7 = load i32, i32* %4
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i32, i32* %6, i64 %8
%10 = getelementptr inbounds i32, i32* %9, i64 8
%11 = load i32, i32* %10
ret i32 %11
}

LLVM IR (-O2):
%struct.X = type opaque
define i32 @bar(%struct.X* nocapture %0, i32 %1) {
%3 = bitcast %struct.X* %0 to i32*
%4 = sext i32 %1 to i64
%5 = getelementptr inbounds i32, i32* %3, i64 %4
%6 = getelementptr inbounds i32, i32* %5, i64 8
%7 = load i32, i32* %6
ret i32 %7
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  int /*<<< orphan*/ *screen;
};
typedef TYPE_1__ XEDataObject;
typedef int /*<<< orphan*/ Screen;

/* Variables and functions */
void set_XEDataObject_screen(void *_p, void *_v) {
  ((XEDataObject *)_p)->screen = (Screen *)_v;
}


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

x86 assembly (clang, -O2):
<set_XEDataObject_screen>:
mov    %rsi,(%rdi)
ret

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

LLVM IR (-O2):
define void @set_XEDataObject_screen(i8* nocapture writeonly %0, i8* %1) {
%3 = bitcast i8* %0 to i8**
store i8* %1, i8** %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ testStoreRegister();
void testStorageSuit() { testStoreRegister(); }


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

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

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

LLVM IR (-O2):
define void @testStorageSuit() {
%1 = tail call i32 (...) @testStoreRegister()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ MOTOR_DIR_SaveConfig();
void MOTOR_DIR_Sleep(void) { MOTOR_DIR_SaveConfig(); }


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

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

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

LLVM IR (-O2):
define void @MOTOR_DIR_Sleep() {
%1 = tail call i32 (...) @MOTOR_DIR_SaveConfig()
ret void
}
/* Variables and functions */
int core(int, char **);
int main(int argc, char **argv) { return core(argc, argv); }


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    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <core@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
jmp    1030 <core@plt>

LLVM IR (-O0):
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 = load i32, i32* %4
%7 = load i8**, i8*** %5
%8 = call i32 @core(i32 %6, i8** %7)
ret i32 %8
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @core(i32 %0, i8** %1)
ret i32 %3
}
/* Variables and functions */
void *realloc(void *, size_t);
void *vktrace_realloc(void *ptr, size_t size) {
  void *pMemory;
  if (size == 0)
    return NULL;
  pMemory = realloc(ptr, size);
  return pMemory;
}


x86 assembly (clang, -O0):
<vktrace_realloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1138 <vktrace_realloc+0x28>
movq   $0x0,-0x8(%rbp)
jmp    1151 <vktrace_realloc+0x41>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <realloc@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define noalias i8* @vktrace_realloc(i8* nocapture %0, i64 %1) {
%3 = icmp eq i64 %1, 0
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i8* @realloc(i8* %0, i64 %1)
br label %6
6: ; preds = %2, %4
%7 = phi i8* [ %5, %4 ], [ null, %2 ]
ret i8* %7
}
void uksm_remove_vma(struct vm_area_struct *vma) {}


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

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

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

LLVM IR (-O2):
%struct.vm_area_struct = type opaque
define void @uksm_remove_vma(%struct.vm_area_struct* nocapture %0) {
ret void
}
int d_size_diag_strmat(int m, int n) {
  int size = 0;
  int tmp = m < n ? m : n;
  size = tmp * sizeof(double);
  return size;
}


x86 assembly (clang, -O0):
<d_size_diag_strmat>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1128 <d_size_diag_strmat+0x28>
mov    -0x4(%rbp),%eax
mov    %eax,-0x14(%rbp)
jmp    112e <d_size_diag_strmat+0x2e>
mov    -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x10(%rbp)
movslq -0x10(%rbp),%rax
shl    $0x3,%rax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<d_size_diag_strmat>:
cmp    %esi,%edi
cmovl  %edi,%esi
lea    0x0(,%rsi,8),%eax
ret

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

LLVM IR (-O2):
define i32 @d_size_diag_strmat(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
%5 = shl i32 %4, 3
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ perror(char const *);
int /*<<< orphan*/ teardown();
void judge_sys_return(int ret, const char *sys_func) {
  if (ret < 0) {
    perror(sys_func);
    teardown();
    exit(1);
  }
  return;
}


x86 assembly (clang, -O0):
<judge_sys_return>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    1163 <judge_sys_return+0x33>
mov    -0x10(%rbp),%rdi
call   1030 <perror@plt>
mov    $0x0,%al
call   1050 <teardown@plt>
mov    $0x1,%edi
call   1040 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<judge_sys_return>:
test   %edi,%edi
js     1135 <judge_sys_return+0x5>
ret
push   %rax
mov    %rsi,%rdi
call   1030 <perror@plt>
xor    %eax,%eax
call   1050 <teardown@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define void @judge_sys_return(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i32, i32* %3
%6 = icmp slt i32 %5, 0
br i1 %6, label %7, label %12
7: ; preds = %2
%8 = load i8*, i8** %4
%9 = call i32 @perror(i8* %8)
%10 = call i32 (...) @teardown()
%11 = call i32 @exit(i32 1)
unreachable
12: ; preds = %2
ret void
}

LLVM IR (-O2):
define void @judge_sys_return(i32 %0, i8* nocapture %1) {
%3 = icmp slt i32 %0, 0
br i1 %3, label %4, label %8
4: ; preds = %2
%5 = tail call i32 @perror(i8* %1)
%6 = tail call i32 (...) @teardown()
%7 = tail call i32 @exit(i32 1)
unreachable
8: ; preds = %2
ret void
}
float sqrtf(float x) {
  float r;
  if (x < 0)
    return __domain_error();
  __asm__ __volatile__("fsqrt" : "=t"(r) : "0"(x));
  return r;
}


x86 assembly (clang, -O0):
<sqrtf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movss  %xmm0,-0x8(%rbp)
xorps  %xmm0,%xmm0
ucomiss -0x8(%rbp),%xmm0
jbe    113f <sqrtf+0x2f>
mov    $0x0,%al
call   1030 <__domain_error@plt>
cvtsi2ss %eax,%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    1165 <sqrtf+0x55>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
flds   -0x10(%rbp)
fsqrt
fstps  -0x14(%rbp)
movss  -0x14(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sqrtf>:
push   %rax
xorps  %xmm1,%xmm1
ucomiss %xmm0,%xmm1
jbe    1129 <sqrtf+0x19>
xor    %eax,%eax
call   1030 <__domain_error@plt>
xorps  %xmm0,%xmm0
cvtsi2ss %eax,%xmm0
pop    %rax
ret
movss  %xmm0,0x4(%rsp)
flds   0x4(%rsp)
fsqrt
fstps  (%rsp)
movss  (%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @sqrtf(float %0) {
%2 = alloca float
%3 = alloca float
%4 = alloca float
store float %0, float* %3
%5 = load float, float* %3
%6 = fcmp olt float %5, 0.000000e+00
br i1 %6, label %7, label %10
7: ; preds = %1
%8 = call i32 (...) @__domain_error()
%9 = sitofp i32 %8 to float
store float %9, float* %2
br label %14
10: ; preds = %1
%11 = load float, float* %3
%12 = call float asm sideeffect "fsqrt", "={st},0,~{dirflag},~{fpsr},~{flags}"(float %11)
store float %12, float* %4
%13 = load float, float* %4
store float %13, float* %2
br label %14
14: ; preds = %10, %7
%15 = load float, float* %2
ret float %15
}

LLVM IR (-O2):
define float @sqrtf(float %0) {
%2 = fcmp olt float %0, 0.000000e+00
br i1 %2, label %3, label %6
3: ; preds = %1
%4 = tail call i32 (...) @__domain_error()
%5 = sitofp i32 %4 to float
br label %8
6: ; preds = %1
%7 = tail call float asm sideeffect "fsqrt", "={st},0,~{dirflag},~{fpsr},~{flags}"(float %0)
br label %8
8: ; preds = %6, %3
%9 = phi float [ %5, %3 ], [ %7, %6 ]
ret float %9
}
/* Type definitions */
typedef int uint16_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int test();
int main(int argc, char **argv) {
  uint16_t result = test();
  if (result == 0x1337) {
    printf("OK\n");
  } else {
    printf("BAD\n");
  }
  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    $0x0,%al
call   1040 <test@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x1337,-0x14(%rbp)
jne    115e <main+0x3e>
lea    0xeac(%rip),%rdi
call   1030 <printf@plt>
jmp    116a <main+0x4a>
lea    0xe9f(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <test@plt>
cmp    $0x1337,%eax
lea    0xed0(%rip),%rax
lea    0xec5(%rip),%rdi
cmove  %rax,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@str = [4 x i8] c"BAD\00"
@str.2 = [3 x i8] c"OK\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @test()
%4 = icmp eq i32 %3, 4919
%5 = select i1 %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @str.2, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @str, i64 0, i64 0)
%6 = tail call i32 @puts(i8* dereferenceable(1) %5)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ combination(int *, int, int, int *, int);
int /*<<< orphan*/ free(int *);
scalar_t__ malloc(int);
void printCombination(int arr[], int nLen, int m) {
  if (m > nLen) {
    return;
  }
  int *out = (int *)malloc(sizeof(int));
  combination(arr, nLen, m, out, m);
  free(out);
}


x86 assembly (clang, -O0):
<printCombination>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    1153 <printCombination+0x23>
jmp    1181 <printCombination+0x51>
mov    $0x4,%edi
call   1050 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x18(%rbp),%rcx
mov    -0x10(%rbp),%r8d
call   1040 <combination@plt>
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printCombination>:
cmp    %esi,%edx
jle    1135 <printCombination+0x5>
ret
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %edx,%ebx
mov    %esi,%ebp
mov    %rdi,%r14
mov    $0x4,%edi
call   1050 <malloc@plt>
mov    %rax,%r15
mov    %r14,%rdi
mov    %ebp,%esi
mov    %ebx,%edx
mov    %rax,%rcx
mov    %ebx,%r8d
call   1040 <combination@plt>
mov    %r15,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @printCombination(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* %6
%9 = load i32, i32* %5
%10 = icmp sgt i32 %8, %9
br i1 %10, label %11, label %12
11: ; preds = %3
br label %23
12: ; preds = %3
%13 = call i64 @malloc(i32 4)
%14 = inttoptr i64 %13 to i32*
store i32* %14, i32** %7
%15 = load i32*, i32** %4
%16 = load i32, i32* %5
%17 = load i32, i32* %6
%18 = load i32*, i32** %7
%19 = load i32, i32* %6
%20 = call i32 @combination(i32* %15, i32 %16, i32 %17, i32* %18, i32 %19)
%21 = load i32*, i32** %7
%22 = call i32 @free(i32* %21)
br label %23
23: ; preds = %12, %11
ret void
}

LLVM IR (-O2):
define void @printCombination(i32* %0, i32 %1, i32 %2) {
%4 = icmp sgt i32 %2, %1
br i1 %4, label %10, label %5
5: ; preds = %3
%6 = tail call i64 @malloc(i32 4)
%7 = inttoptr i64 %6 to i32*
%8 = tail call i32 @combination(i32* %0, i32 %1, i32 %2, i32* %7, i32 %2)
%9 = tail call i32 @free(i32* %7)
br label %10
10: ; preds = %3, %5
ret void
}
void _strcpy(char *a, char *b) {
  int i;
  for (i = 0; (a[i] = b[i]) != 0; i++)
    ;
}


x86 assembly (clang, -O0):
<_strcpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,1),%al
mov    -0x8(%rbp),%rcx
movslq -0x14(%rbp),%rdx
mov    %al,(%rcx,%rdx,1)
movsbl %al,%eax
cmp    $0x0,%eax
je     1148 <_strcpy+0x48>
jmp    113a <_strcpy+0x3a>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1113 <_strcpy+0x13>
pop    %rbp
ret

x86 assembly (clang, -O2):
<_strcpy>:
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movzbl (%rsi,%rax,1),%ecx
mov    %cl,(%rdi,%rax,1)
add    $0x1,%rax
test   %cl,%cl
jne    1110 <_strcpy+0x10>
ret

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

LLVM IR (-O2):
define void @_strcpy(i8* nocapture writeonly %0, i8* nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i64 [ %9, %3 ], [ 0, %2 ]
%5 = getelementptr inbounds i8, i8* %1, i64 %4
%6 = load i8, i8* %5
%7 = getelementptr inbounds i8, i8* %0, i64 %4
store i8 %6, i8* %7
%8 = icmp eq i8 %6, 0
%9 = add nuw i64 %4, 1
br i1 %8, label %10, label %3
10: ; preds = %3
ret void
}