xunge/DecIR huggingface dataset:
/* Variables and functions */
char *strstr(char *, char *);
int mySearch(char *ptr, char *word) {
  int _count = 0;
  ptr = strstr(ptr, word);
  if (ptr) {
    _count++;
    ptr += 1;
    _count += mySearch(ptr, word);
  }
  return _count;
}


x86 assembly (clang, -O0):
<mySearch>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <strstr@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     117b <mySearch+0x5b>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <mySearch@plt>
add    -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mySearch>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
call   1030 <strstr@plt>
xor    %ebp,%ebp
test   %rax,%rax
je     1147 <mySearch+0x37>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
add    $0x1,%rax
add    $0x1,%ebp
mov    %rax,%rdi
mov    %rbx,%rsi
call   1030 <strstr@plt>
test   %rax,%rax
jne    1130 <mySearch+0x20>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @mySearch(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
%6 = load i8*, i8** %3
%7 = load i8*, i8** %4
%8 = call i8* @strstr(i8* %6, i8* %7)
store i8* %8, i8** %3
%9 = load i8*, i8** %3
%10 = icmp ne i8* %9, null
br i1 %10, label %11, label %21
11: ; preds = %2
%12 = load i32, i32* %5
%13 = add nsw i32 %12, 1
store i32 %13, i32* %5
%14 = load i8*, i8** %3
%15 = getelementptr inbounds i8, i8* %14, i64 1
store i8* %15, i8** %3
%16 = load i8*, i8** %3
%17 = load i8*, i8** %4
%18 = call i32 @mySearch(i8* %16, i8* %17)
%19 = load i32, i32* %5
%20 = add nsw i32 %19, %18
store i32 %20, i32* %5
br label %21
21: ; preds = %11, %2
%22 = load i32, i32* %5
ret i32 %22
}

LLVM IR (-O2):
define i32 @mySearch(i8* %0, i8* nocapture %1) {
%3 = tail call i8* @strstr(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %12, label %5
5: ; preds = %2, %5
%6 = phi i8* [ %10, %5 ], [ %3, %2 ]
%7 = phi i32 [ %9, %5 ], [ 0, %2 ]
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = add nuw nsw i32 %7, 1
%10 = tail call i8* @strstr(i8* dereferenceable(1) %8, i8* dereferenceable(1) %1)
%11 = icmp eq i8* %10, null
br i1 %11, label %12, label %5
12: ; preds = %5, %2
%13 = phi i32 [ 0, %2 ], [ %9, %5 ]
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ free(int *);
int *malloc(int);
int main() {
  int *x = malloc(8);
  free(x);
  x = 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x8,%edi
call   1040 <malloc@plt>
mov    %rax,%rdi
call   1030 <free@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32*
%2 = call i32* @malloc(i32 8)
store i32* %2, i32** %1
%3 = load i32*, i32** %1
%4 = call i32 @free(i32* %3)
store i32* null, i32** %1
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32* @malloc(i32 8)
%2 = tail call i32 @free(i32* %1)
ret i32 0
}
void genfloor_w_s() {}


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

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

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

LLVM IR (-O2):
define void @genfloor_w_s() {
ret void
}
/* Type definitions */
typedef scalar_t__ locale_t;

/* Variables and functions */
int /*<<< orphan*/ freelocale(scalar_t__);
void freelocalep(locale_t *p) {
  if (*p == (locale_t)0)
    return;
  freelocale(*p);
}


x86 assembly (clang, -O0):
<freelocalep>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpq   $0x0,(%rax)
jne    112f <freelocalep+0x1f>
jmp    113b <freelocalep+0x2b>
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
call   1030 <freelocale@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<freelocalep>:
mov    (%rdi),%rdi
test   %rdi,%rdi
je     111d <freelocalep+0xd>
jmp    1030 <freelocale@plt>
ret

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

LLVM IR (-O2):
define void @freelocalep(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = icmp eq i64 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @freelocale(i64 %2)
br label %6
6: ; preds = %1, %4
ret void
}
/* Type definitions */
typedef scalar_t__ uint8_t;
typedef int uint64_t;

/* Variables and functions */
uint64_t get64le(const uint8_t *bytes) {
  return (uint64_t)bytes[0] | ((uint64_t)bytes[1] << 8) |
         ((uint64_t)bytes[2] << 16) | ((uint64_t)bytes[3] << 24) |
         ((uint64_t)bytes[4] << 32) | ((uint64_t)bytes[5] << 40) |
         ((uint64_t)bytes[6] << 48) | ((uint64_t)bytes[7] << 56);
}


x86 assembly (clang, -O0):
<get64le>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    -0x8(%rbp),%rcx
mov    0x8(%rcx),%rcx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
mov    0x10(%rcx),%rcx
shl    $0x10,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
mov    0x18(%rcx),%rcx
shl    $0x18,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
mov    0x20(%rcx),%rcx
mov    %ecx,%edx
mov    $0x20,%ecx
shl    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
mov    0x28(%rcx),%rcx
mov    %ecx,%edx
mov    $0x28,%ecx
shl    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
mov    0x30(%rcx),%rcx
mov    %ecx,%edx
mov    $0x30,%ecx
shl    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
mov    0x38(%rcx),%rcx
mov    %ecx,%edx
mov    $0x38,%ecx
shl    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @get64le(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = getelementptr inbounds i64, i64* %3, i64 0
%5 = load i64, i64* %4
%6 = trunc i64 %5 to i32
%7 = load i64*, i64** %2
%8 = getelementptr inbounds i64, i64* %7, i64 1
%9 = load i64, i64* %8
%10 = trunc i64 %9 to i32
%11 = shl i32 %10, 8
%12 = or i32 %6, %11
%13 = load i64*, i64** %2
%14 = getelementptr inbounds i64, i64* %13, i64 2
%15 = load i64, i64* %14
%16 = trunc i64 %15 to i32
%17 = shl i32 %16, 16
%18 = or i32 %12, %17
%19 = load i64*, i64** %2
%20 = getelementptr inbounds i64, i64* %19, i64 3
%21 = load i64, i64* %20
%22 = trunc i64 %21 to i32
%23 = shl i32 %22, 24
%24 = or i32 %18, %23
%25 = load i64*, i64** %2
%26 = getelementptr inbounds i64, i64* %25, i64 4
%27 = load i64, i64* %26
%28 = trunc i64 %27 to i32
%29 = shl i32 %28, 32
%30 = or i32 %24, %29
%31 = load i64*, i64** %2
%32 = getelementptr inbounds i64, i64* %31, i64 5
%33 = load i64, i64* %32
%34 = trunc i64 %33 to i32
%35 = shl i32 %34, 40
%36 = or i32 %30, %35
%37 = load i64*, i64** %2
%38 = getelementptr inbounds i64, i64* %37, i64 6
%39 = load i64, i64* %38
%40 = trunc i64 %39 to i32
%41 = shl i32 %40, 48
%42 = or i32 %36, %41
%43 = load i64*, i64** %2
%44 = getelementptr inbounds i64, i64* %43, i64 7
%45 = load i64, i64* %44
%46 = trunc i64 %45 to i32
%47 = shl i32 %46, 56
%48 = or i32 %42, %47
ret i32 %48
}

LLVM IR (-O2):
define i32 @get64le(i64* nocapture readnone %0) {
ret i32 poison
}
void blah(char *m0, void *m1) {
  *m0 = 1;
  m1;
}


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

x86 assembly (clang, -O2):
<blah>:
movb   $0x1,(%rdi)
ret

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

LLVM IR (-O2):
define void @blah(i8* nocapture writeonly %0, i8* nocapture readnone %1) {
store i8 1, i8* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ test_parser_sourcefile(char *, char *);
int /*<<< orphan*/ test_parser_verify_parse(int /*<<< orphan*/, char *, char *,
                                            char *, int /*<<< orphan*/);
void test_r_comments() {
  test_parser_verify_parse(test_parser_sourcefile("r", " #comment"), "r", "",
                           "#comment", 0);
}


x86 assembly (clang, -O0):
<test_r_comments>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
lea    0xed0(%rip),%rsi
call   1030 <test_parser_sourcefile@plt>
mov    %eax,%edi
lea    0xec0(%rip),%rsi
lea    0xeba(%rip),%rdx
lea    0xeb5(%rip),%rcx
xor    %r8d,%r8d
call   1040 <test_parser_verify_parse@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_r_comments>:
push   %rbx
lea    0xed8(%rip),%rbx
lea    0xed3(%rip),%rsi
mov    %rbx,%rdi
call   1030 <test_parser_sourcefile@plt>
lea    0xec3(%rip),%rdx
lea    0xebe(%rip),%rcx
mov    %eax,%edi
mov    %rbx,%rsi
xor    %r8d,%r8d
pop    %rbx
jmp    1040 <test_parser_verify_parse@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"r\00"
@.str.1 = [10 x i8] c" #comment\00"
@.str.2 = [1 x i8] zeroinitializer
@.str.3 = [9 x i8] c"#comment\00"
define void @test_r_comments() {
%1 = call i32 @test_parser_sourcefile(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%2 = call i32 @test_parser_verify_parse(i32 %1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0), i32 0)
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c"r\00"
@.str.1 = [10 x i8] c" #comment\00"
@.str.2 = [1 x i8] zeroinitializer
@.str.3 = [9 x i8] c"#comment\00"
define void @test_r_comments() {
%1 = tail call i32 @test_parser_sourcefile(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @test_parser_verify_parse(i32 %1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0), i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, char *);
int /*<<< orphan*/ scanf(char *, char *);
int main(int argc, const char *argv[]) {
  char string[8];
  char string2[8];
  scanf("%7s", string);
  scanf("%7s", string2);
  printf("%s##%s##", string, string2);
  char buffer[100] = "";
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x18(%rbp),%rsi
lea    0xeac(%rip),%rdi
call   1050 <scanf@plt>
lea    -0x20(%rbp),%rsi
lea    0xe9c(%rip),%rdi
call   1050 <scanf@plt>
lea    -0x18(%rbp),%rsi
lea    -0x20(%rbp),%rdx
lea    0xe8c(%rip),%rdi
call   1030 <printf@plt>
lea    -0x90(%rbp),%rdi
xor    %esi,%esi
mov    $0x64,%edx
call   1040 <memset@plt>
xor    %eax,%eax
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
lea    0xed0(%rip),%rbx
lea    0x8(%rsp),%r14
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <scanf@plt>
mov    %rsp,%r15
mov    %rbx,%rdi
mov    %r15,%rsi
call   1040 <scanf@plt>
lea    0xeaf(%rip),%rdi
mov    %r14,%rsi
mov    %r15,%rdx
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%7s\00"
@.str.1 = [9 x i8] c"%s##%s##\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [8 x i8]
%4 = alloca [8 x i8]
%5 = getelementptr inbounds [8 x i8], [8 x i8]* %3, i64 0, i64 0
%6 = getelementptr inbounds [8 x i8], [8 x i8]* %4, i64 0, i64 0
%7 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %5)
%8 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %6)
%9 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i8* %5, i8* %6)
ret i32 0
}
/* Variables and functions */
int PAPI_flips(float *, float *, long long *, float *);
void PAPIF_FLIPS(float *real_time, float *proc_time, long long *flpins,
                 float *mflips, int *check) {
  *check = PAPI_flips(real_time, proc_time, flpins, mflips);
}


x86 assembly (clang, -O0):
<PAPIF_FLIPS>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
call   1030 <PAPI_flips@plt>
mov    %eax,%ecx
mov    -0x28(%rbp),%rax
mov    %ecx,(%rax)
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PAPIF_FLIPS>:
push   %rbx
mov    %r8,%rbx
call   1030 <PAPI_flips@plt>
mov    %eax,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @PAPIF_FLIPS(float* %0, float* %1, i64* %2, float* %3, i32* %4) {
%6 = alloca float*
%7 = alloca float*
%8 = alloca i64*
%9 = alloca float*
%10 = alloca i32*
store float* %0, float** %6
store float* %1, float** %7
store i64* %2, i64** %8
store float* %3, float** %9
store i32* %4, i32** %10
%11 = load float*, float** %6
%12 = load float*, float** %7
%13 = load i64*, i64** %8
%14 = load float*, float** %9
%15 = call i32 @PAPI_flips(float* %11, float* %12, i64* %13, float* %14)
%16 = load i32*, i32** %10
store i32 %15, i32* %16
ret void
}

LLVM IR (-O2):
define void @PAPIF_FLIPS(float* %0, float* %1, i64* %2, float* %3, i32* nocapture writeonly %4) {
%6 = tail call i32 @PAPI_flips(float* %0, float* %1, i64* %2, float* %3)
store i32 %6, i32* %4
ret void
}
/* Variables and functions */
int /*<<< orphan*/ socket_bind(int, int);
int /*<<< orphan*/ socket_listen(int, int);
int socket_open();
int /*<<< orphan*/ socket_server(int);
int main(int argc, char **argv) {
  int server;
  server = socket_open();
  socket_bind(server, 7284);
  socket_listen(server, 10);
  socket_server(server);
  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   1050 <socket_open@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
mov    $0x1c74,%esi
call   1030 <socket_bind@plt>
mov    -0x14(%rbp),%edi
mov    $0xa,%esi
call   1060 <socket_listen@plt>
mov    -0x14(%rbp),%edi
call   1040 <socket_server@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1050 <socket_open@plt>
mov    %eax,%ebx
mov    %eax,%edi
mov    $0x1c74,%esi
call   1030 <socket_bind@plt>
mov    %ebx,%edi
mov    $0xa,%esi
call   1060 <socket_listen@plt>
mov    %ebx,%edi
call   1040 <socket_server@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
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 (...) @socket_open()
store i32 %7, i32* %6
%8 = load i32, i32* %6
%9 = call i32 @socket_bind(i32 %8, i32 7284)
%10 = load i32, i32* %6
%11 = call i32 @socket_listen(i32 %10, i32 10)
%12 = load i32, i32* %6
%13 = call i32 @socket_server(i32 %12)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @socket_open()
%4 = tail call i32 @socket_bind(i32 %3, i32 7284)
%5 = tail call i32 @socket_listen(i32 %3, i32 10)
%6 = tail call i32 @socket_server(i32 %3)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ nullpo_info_core(char const *, int, char const *,
                                    int /*<<< orphan*/ *, int /*<<< orphan*/ *);
void nullpo_info(const char *file, int line, const char *func) {
  nullpo_info_core(file, line, func, NULL, NULL);
}


x86 assembly (clang, -O0):
<nullpo_info>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
xor    %eax,%eax
mov    %eax,%r8d
mov    %r8,%rcx
call   1030 <nullpo_info_core@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nullpo_info>:
xor    %ecx,%ecx
xor    %r8d,%r8d
jmp    1030 <nullpo_info_core@plt>

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

LLVM IR (-O2):
define void @nullpo_info(i8* %0, i32 %1, i8* %2) {
%4 = tail call i32 @nullpo_info_core(i8* %0, i32 %1, i8* %2, i32* null, i32* null)
ret void
}
int ft_isupper(int c) { return (c >= 'A' && c <= 'Z'); }


x86 assembly (clang, -O0):
<ft_isupper>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x41,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jl     1120 <ft_isupper+0x20>
cmpl   $0x5a,-0x4(%rbp)
setle  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_isupper>:
add    $0xffffffbf,%edi
xor    %eax,%eax
cmp    $0x1a,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @ft_isupper(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 65
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 90
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ false, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @ft_isupper(i32 %0) {
%2 = add i32 %0, -65
%3 = icmp ult i32 %2, 26
%4 = zext i1 %3 to i32
ret i32 %4
}
void xxx_stats(struct drbd_transport *transport,
               struct drbd_transport_stats *stats) {}


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

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

LLVM IR (-O0):
%struct.drbd_transport = type opaque
%struct.drbd_transport_stats = type opaque
define void @xxx_stats(%struct.drbd_transport* %0, %struct.drbd_transport_stats* %1) {
%3 = alloca %struct.drbd_transport*
%4 = alloca %struct.drbd_transport_stats*
store %struct.drbd_transport* %0, %struct.drbd_transport** %3
store %struct.drbd_transport_stats* %1, %struct.drbd_transport_stats** %4
ret void
}

LLVM IR (-O2):
%struct.drbd_transport = type opaque
%struct.drbd_transport_stats = type opaque
define void @xxx_stats(%struct.drbd_transport* nocapture %0, %struct.drbd_transport_stats* nocapture %1) {
ret void
}
float log10f(float x) { return log2(x) * (1 / 0x1.A934F0979A371p+1F); }


x86 assembly (clang, -O0):
<log10f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
call   1030 <log2@plt>
movsd  0xecd(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<log10f>:
push   %rax
cvtss2sd %xmm0,%xmm0
call   1030 <log2@plt>
mulsd  0xede(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @log10f(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fpext float %3 to double
%5 = call double @log2(double %4)
%6 = fmul double %5, 0x3FD3441360000000
%7 = fptrunc double %6 to float
ret float %7
}

LLVM IR (-O2):
define float @log10f(float %0) {
%2 = fpext float %0 to double
%3 = tail call double @log2(double %2)
%4 = fmul double %3, 0x3FD3441360000000
%5 = fptrunc double %4 to float
ret float %5
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
uint64_t eorlm1(uint64_t x) { return x ^ -1; }


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

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

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

LLVM IR (-O2):
define i32 @eorlm1(i32 %0) {
%2 = xor i32 %0, -1
ret i32 %2
}
/* Variables and functions */
double abs(double x) { return x < 0 ? -x : x; }


x86 assembly (clang, -O0):
<abs>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x8(%rbp),%xmm0
jbe    113d <abs+0x3d>
movsd  -0x8(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x10(%rbp)
jmp    1147 <abs+0x47>
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<abs>:
movapd 0xef8(%rip),%xmm2
xorpd  %xmm0,%xmm2
xorpd  %xmm3,%xmm3
movapd %xmm0,%xmm1
cmpltsd %xmm3,%xmm1
andpd  %xmm1,%xmm2
andnpd %xmm0,%xmm1
orpd   %xmm2,%xmm1
movapd %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @abs(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fcmp olt double %3, 0.000000e+00
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load double, double* %2
%7 = fneg double %6
br label %10
8: ; preds = %1
%9 = load double, double* %2
br label %10
10: ; preds = %8, %5
%11 = phi double [ %7, %5 ], [ %9, %8 ]
ret double %11
}

LLVM IR (-O2):
define double @abs(double %0) {
%2 = fcmp olt double %0, 0.000000e+00
%3 = fneg double %0
%4 = select i1 %2, double %3, double %0
ret double %4
}
/* Type definitions */
typedef int ssize_t;

/* Variables and functions */
int /*<<< orphan*/ EAGAIN;
int /*<<< orphan*/ errno;
ssize_t teredo_recverr(int fd) {
  (void)fd;
  errno = EAGAIN;
  return -1;
}


x86 assembly (clang, -O0):
<teredo_recverr>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    0x2ec2(%rip),%rax
mov    (%rax),%ecx
mov    0x2ec9(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<teredo_recverr>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%eax
mov    0x2ed0(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
ret

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

LLVM IR (-O2):
@EAGAIN = global i32 0
@errno = global i32 0
define i32 @teredo_recverr(i32 %0) {
%2 = load i32, i32* @EAGAIN
store i32 %2, i32* @errno
ret i32 -1
}
/* Variables and functions */
double hypot(double, double);
int /*<<< orphan*/ sincos(double, double *, double *);
double aberration(double x, double y) {
  double t = y / x;
  double st, ct;
  sincos(t, &st, &ct);
  return hypot(x * (1 - ct), y - x * st);
}


x86 assembly (clang, -O0):
<aberration>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
divsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
lea    -0x20(%rbp),%rdi
lea    -0x28(%rbp),%rsi
call   1030 <sincos@plt>
movsd  -0x8(%rbp),%xmm0
movsd  0xea0(%rip),%xmm1
subsd  -0x28(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  -0x10(%rbp),%xmm2
movsd  -0x8(%rbp),%xmm1
movsd  -0x20(%rbp),%xmm3
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm3,%xmm1
addsd  %xmm2,%xmm1
call   1040 <hypot@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<aberration>:
sub    $0x28,%rsp
movsd  %xmm1,0x10(%rsp)
movapd %xmm0,%xmm2
movsd  %xmm0,0x8(%rsp)
movapd %xmm1,%xmm0
divsd  %xmm2,%xmm0
lea    0x20(%rsp),%rdi
lea    0x18(%rsp),%rsi
call   1030 <sincos@plt>
movsd  0xead(%rip),%xmm0
subsd  0x18(%rsp),%xmm0
movsd  0x8(%rsp),%xmm1
mulsd  %xmm1,%xmm0
mulsd  0x20(%rsp),%xmm1
movapd %xmm1,%xmm2
movsd  0x10(%rsp),%xmm1
subsd  %xmm2,%xmm1
call   1040 <hypot@plt>
add    $0x28,%rsp
ret

LLVM IR (-O0):
define double @aberration(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca double
store double %0, double* %3
store double %1, double* %4
%8 = load double, double* %4
%9 = load double, double* %3
%10 = fdiv double %8, %9
store double %10, double* %5
%11 = load double, double* %5
%12 = call i32 @sincos(double %11, double* %6, double* %7)
%13 = load double, double* %3
%14 = load double, double* %7
%15 = fsub double 1.000000e+00, %14
%16 = fmul double %13, %15
%17 = load double, double* %4
%18 = load double, double* %3
%19 = load double, double* %6
%20 = fneg double %18
%21 = call double @llvm.fmuladd.f64(double %20, double %19, double %17)
%22 = call double @hypot(double %16, double %21)
ret double %22
}

LLVM IR (-O2):
define double @aberration(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = fdiv double %1, %0
%6 = bitcast double* %3 to i8*
%7 = bitcast double* %4 to i8*
%8 = call i32 @sincos(double %5, double* %3, double* %4)
%9 = load double, double* %4
%10 = fsub double 1.000000e+00, %9
%11 = fmul double %10, %0
%12 = load double, double* %3
%13 = fneg double %0
%14 = call double @llvm.fmuladd.f64(double %13, double %12, double %1)
%15 = call double @hypot(double %11, double %14)
ret double %15
}
int test_imm_C0uint32_reg(unsigned int val) {
  return ((val) & (0xC0 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_C0uint32_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
and    $0xc0,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_C0uint32_reg>:
test   $0xc0,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_C0uint32_reg(i32 %0) {
%2 = and i32 %0, 192
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
float EaseLinearIn(float t, float b, float c, float d) {
  return (c * t / d + b);
}


x86 assembly (clang, -O0):
<EaseLinearIn>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  %xmm3,-0x10(%rbp)
movss  -0xc(%rbp),%xmm0
mulss  -0x4(%rbp),%xmm0
divss  -0x10(%rbp),%xmm0
addss  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<EaseLinearIn>:
mulss  %xmm2,%xmm0
divss  %xmm3,%xmm0
addss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @EaseLinearIn(float %0, float %1, float %2, float %3) {
%5 = alloca float
%6 = alloca float
%7 = alloca float
%8 = alloca float
store float %0, float* %5
store float %1, float* %6
store float %2, float* %7
store float %3, float* %8
%9 = load float, float* %7
%10 = load float, float* %5
%11 = fmul float %9, %10
%12 = load float, float* %8
%13 = fdiv float %11, %12
%14 = load float, float* %6
%15 = fadd float %13, %14
ret float %15
}

LLVM IR (-O2):
define float @EaseLinearIn(float %0, float %1, float %2, float %3) {
%5 = fmul float %0, %2
%6 = fdiv float %5, %3
%7 = fadd float %6, %1
ret float %7
}
/* Variables and functions */
int do_show(int, char **);
int st_do_show(int a, char **b) { return do_show(a, b); }


x86 assembly (clang, -O0):
<st_do_show>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <do_show@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<st_do_show>:
jmp    1030 <do_show@plt>

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

LLVM IR (-O2):
define i32 @st_do_show(i32 %0, i8** %1) {
%3 = tail call i32 @do_show(i32 %0, i8** %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ __NR_fcntl;
int syscall(int /*<<< orphan*/, int, int, int);
int fcntl_(int fd, int cmd, int arg) {
  return syscall(__NR_fcntl, fd, cmd, arg);
}


x86 assembly (clang, -O0):
<fcntl_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    -0xc(%rbp),%ecx
call   1030 <syscall@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fcntl_>:
mov    %edx,%ecx
mov    %esi,%edx
mov    %edi,%esi
mov    0x2ec3(%rip),%rax
mov    (%rax),%edi
jmp    1030 <syscall@plt>

LLVM IR (-O0):
@__NR_fcntl = global i32 0
define i32 @fcntl_(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* @__NR_fcntl
%8 = load i32, i32* %4
%9 = load i32, i32* %5
%10 = load i32, i32* %6
%11 = call i32 @syscall(i32 %7, i32 %8, i32 %9, i32 %10)
ret i32 %11
}

LLVM IR (-O2):
@__NR_fcntl = global i32 0
define i32 @fcntl_(i32 %0, i32 %1, i32 %2) {
%4 = load i32, i32* @__NR_fcntl
%5 = tail call i32 @syscall(i32 %4, i32 %0, i32 %1, i32 %2)
ret i32 %5
}
double test_nexttoward(double x, double y) {
  return __builtin_nexttoward(x, y);
}


x86 assembly (clang, -O0):
<test_nexttoward>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
fldl   -0x10(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
call   1030 <nexttoward@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_nexttoward>:
sub    $0x18,%rsp
movsd  %xmm1,0x10(%rsp)
fldl   0x10(%rsp)
fstpt  (%rsp)
call   1030 <nexttoward@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @test_nexttoward(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = fpext double %6 to x86_fp80
%8 = call double @nexttoward(double %5, x86_fp80 %7)
ret double %8
}

LLVM IR (-O2):
define double @test_nexttoward(double %0, double %1) {
%3 = fpext double %1 to x86_fp80
%4 = tail call double @nexttoward(double %0, x86_fp80 %3)
ret double %4
}
/* Variables and functions */
int /*<<< orphan*/ drv_CW_send(char const *, int const);
void drv_CW_write(const int row, const int col, const char *data,
                  const int len) {
  char cmd[6] = "\376Gxy\375";
  cmd[2] = (char)col;
  cmd[3] = (char)row;
  drv_CW_send(cmd, 5);
  drv_CW_send(data, len);
}


x86 assembly (clang, -O0):
<drv_CW_write>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    0xed5(%rip),%eax
mov    %eax,-0x1a(%rbp)
mov    0xecf(%rip),%ax
mov    %ax,-0x16(%rbp)
mov    -0x8(%rbp),%eax
mov    %al,-0x18(%rbp)
mov    -0x4(%rbp),%eax
mov    %al,-0x17(%rbp)
lea    -0x1a(%rbp),%rdi
mov    $0x5,%esi
call   1030 <drv_CW_send@plt>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1030 <drv_CW_send@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<drv_CW_write>:
push   %rbp
push   %rbx
push   %rax
mov    %ecx,%ebp
mov    %rdx,%rbx
movl   $0x797847fe,(%rsp)
movw   $0xfd,0x4(%rsp)
mov    %sil,0x2(%rsp)
mov    %dil,0x3(%rsp)
mov    %rsp,%rdi
mov    $0x5,%esi
call   1030 <drv_CW_send@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
call   1030 <drv_CW_send@plt>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@__const.drv_CW_write.cmd = [6 x i8] c"\FEGxy\FD\00"
define void @drv_CW_write(i32 %0, i32 %1, i8* %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i32
%9 = alloca [6 x i8]
store i32 %0, i32* %5
store i32 %1, i32* %6
store i8* %2, i8** %7
store i32 %3, i32* %8
%10 = bitcast [6 x i8]* %9 to i8*
%11 = load i32, i32* %6
%12 = trunc i32 %11 to i8
%13 = getelementptr inbounds [6 x i8], [6 x i8]* %9, i64 0, i64 2
store i8 %12, i8* %13
%14 = load i32, i32* %5
%15 = trunc i32 %14 to i8
%16 = getelementptr inbounds [6 x i8], [6 x i8]* %9, i64 0, i64 3
store i8 %15, i8* %16
%17 = getelementptr inbounds [6 x i8], [6 x i8]* %9, i64 0, i64 0
%18 = call i32 @drv_CW_send(i8* %17, i32 5)
%19 = load i8*, i8** %7
%20 = load i32, i32* %8
%21 = call i32 @drv_CW_send(i8* %19, i32 %20)
ret void
}

LLVM IR (-O2):
@__const.drv_CW_write.cmd = [6 x i8] c"\FEGxy\FD\00"
define void @drv_CW_write(i32 %0, i32 %1, i8* %2, i32 %3) {
%5 = alloca [6 x i8]
%6 = getelementptr inbounds [6 x i8], [6 x i8]* %5, i64 0, i64 0
%7 = trunc i32 %1 to i8
%8 = getelementptr inbounds [6 x i8], [6 x i8]* %5, i64 0, i64 2
store i8 %7, i8* %8
%9 = trunc i32 %0 to i8
%10 = getelementptr inbounds [6 x i8], [6 x i8]* %5, i64 0, i64 3
store i8 %9, i8* %10
%11 = call i32 @drv_CW_send(i8* %6, i32 5)
%12 = call i32 @drv_CW_send(i8* %2, i32 %3)
ret void
}
int get_message_payload() { return (8192 - sizeof(long)); }


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

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

LLVM IR (-O0):
define i32 @get_message_payload() {
ret i32 8184
}

LLVM IR (-O2):
define i32 @get_message_payload() {
ret i32 8184
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int fileExist(char *path) {
  FILE *f = fopen(path, "rb");
  if (f != NULL) {
    fclose(f);
    return 1;
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<fileExist>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xec9(%rip),%rsi
call   1040 <fopen@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1160 <fileExist+0x40>
mov    -0x18(%rbp),%rdi
call   1030 <fclose@plt>
movl   $0x1,-0x4(%rbp)
jmp    1167 <fileExist+0x47>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fileExist>:
push   %rax
lea    0xed8(%rip),%rsi
call   1040 <fopen@plt>
test   %rax,%rax
je     1141 <fileExist+0x21>
mov    %rax,%rdi
call   1030 <fclose@plt>
mov    $0x1,%eax
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"rb\00"
define i32 @fileExist(i8* nocapture %0) {
%2 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i32* %2, null
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @fclose(i32* %2)
br label %6
6: ; preds = %1, %4
%7 = phi i32 [ 1, %4 ], [ 0, %1 ]
ret i32 %7
}
int nint(double x) {
  if (x < 0.0)
    return (int)(x - 0.5);
  return (int)(x + 0.5);
}


x86 assembly (clang, -O0):
<nint>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    1134 <nint+0x34>
movsd  -0x10(%rbp),%xmm0
movsd  0xedc(%rip),%xmm1
subsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,-0x4(%rbp)
jmp    1148 <nint+0x48>
movsd  0xec4(%rip),%xmm0
addsd  -0x10(%rbp),%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<nint>:
xorpd  %xmm1,%xmm1
xor    %eax,%eax
ucomisd %xmm0,%xmm1
seta   %al
lea    0xeec(%rip),%rcx
addsd  (%rcx,%rax,8),%xmm0
cvttsd2si %xmm0,%eax
ret

LLVM IR (-O0):
define i32 @nint(double %0) {
%2 = alloca i32
%3 = alloca double
store double %0, double* %3
%4 = load double, double* %3
%5 = fcmp olt double %4, 0.000000e+00
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load double, double* %3
%8 = fsub double %7, 5.000000e-01
%9 = fptosi double %8 to i32
store i32 %9, i32* %2
br label %14
10: ; preds = %1
%11 = load double, double* %3
%12 = fadd double %11, 5.000000e-01
%13 = fptosi double %12 to i32
store i32 %13, i32* %2
br label %14
14: ; preds = %10, %6
%15 = load i32, i32* %2
ret i32 %15
}

LLVM IR (-O2):
define i32 @nint(double %0) {
%2 = fcmp olt double %0, 0.000000e+00
%3 = select i1 %2, double -5.000000e-01, double 5.000000e-01
%4 = fadd double %3, %0
%5 = fptosi double %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ output(char *, int);
int /*<<< orphan*/ sscanf(char const *, char *, int *);
int strlen(char *);
void printInterruptxInfo(const char *cmd) {
  int id;
  sscanf(cmd + strlen("cpu/interrupt/int"), "%d", &id);
  output("Interrupt %d\t0\t0\t1/s\n", id);
}


x86 assembly (clang, -O0):
<printInterruptxInfo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
lea    0xeb5(%rip),%rdi
call   1040 <strlen@plt>
mov    -0x18(%rbp),%rdi
cltq
add    %rax,%rdi
lea    0xeb2(%rip),%rsi
lea    -0xc(%rbp),%rdx
call   1050 <sscanf@plt>
mov    -0xc(%rbp),%esi
lea    0xea2(%rip),%rdi
call   1030 <output@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printInterruptxInfo>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
lea    0xec1(%rip),%rdi
call   1040 <strlen@plt>
movslq %eax,%rdi
add    %rbx,%rdi
lea    0xec1(%rip),%rsi
lea    0xc(%rsp),%rdx
call   1050 <sscanf@plt>
mov    0xc(%rsp),%esi
lea    0xeaf(%rip),%rdi
call   1030 <output@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [18 x i8] c"cpu/interrupt/int\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [22 x i8] c"Interrupt %d\090\090\091/s\0A\00"
define void @printInterruptxInfo(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @strlen(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%6 = sext i32 %5 to i64
%7 = getelementptr inbounds i8, i8* %4, i64 %6
%8 = call i32 @sscanf(i8* %7, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %3)
%9 = load i32, i32* %3
%10 = call i32 @output(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.2, i64 0, i64 0), i32 %9)
ret void
}

LLVM IR (-O2):
@.str = [18 x i8] c"cpu/interrupt/int\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [22 x i8] c"Interrupt %d\090\090\091/s\0A\00"
define void @printInterruptxInfo(i8* nocapture %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = tail call i32 @strlen(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%5 = sext i32 %4 to i64
%6 = getelementptr inbounds i8, i8* %0, i64 %5
%7 = call i32 @sscanf(i8* %6, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%8 = load i32, i32* %2
%9 = call i32 @output(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.2, i64 0, i64 0), i32 %8)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char const);
int /*<<< orphan*/ stdout;
void rotator(void) {
  static const char rotator[] = {'|', '/', '-', '\\'};
  static int pos = 0;
  printf("%c\b", rotator[pos]);
  fflush(stdout);
  pos = (pos + 1) % 4;
}


x86 assembly (clang, -O0):
<rotator>:
push   %rbp
mov    %rsp,%rbp
movslq 0x2f09(%rip),%rcx
lea    0xed2(%rip),%rdi
lea    0xec7(%rip),%rax
movsbl (%rax,%rcx,1),%esi
call   1030 <printf@plt>
mov    0x2e97(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
mov    0x2ede(%rip),%eax
add    $0x1,%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
mov    %edx,0x2ecd(%rip)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rotator>:
push   %rax
mov    0x2f0d(%rip),%eax
lea    0xed2(%rip),%rcx
movsbl (%rax,%rcx,1),%esi
lea    0xecb(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e9b(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
mov    0x2ee2(%rip),%eax
lea    0x1(%rax),%ecx
lea    0x4(%rax),%edx
test   %ecx,%ecx
cmovns %ecx,%edx
and    $0xfffffffc,%edx
neg    %edx
add    %edx,%eax
add    $0x1,%eax
mov    %eax,0x2ec7(%rip)
pop    %rax
ret

LLVM IR (-O0):
@rotator.rotator = internal constant [4 x i8] c"|/-\\"
@rotator.pos = internal global i32 0
@.str = [4 x i8] c"%c\08\00"
@stdout = global i32 0
define void @rotator() {
%1 = load i32, i32* @rotator.pos
%2 = sext i32 %1 to i64
%3 = getelementptr inbounds [4 x i8], [4 x i8]* @rotator.rotator, i64 0, i64 %2
%4 = load i8, i8* %3
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8 signext %4)
%6 = load i32, i32* @stdout
%7 = call i32 @fflush(i32 %6)
%8 = load i32, i32* @rotator.pos
%9 = add nsw i32 %8, 1
%10 = srem i32 %9, 4
store i32 %10, i32* @rotator.pos
ret void
}

LLVM IR (-O2):
@rotator.rotator = internal unnamed_addr constant [4 x i8] c"|/-\\"
@rotator.pos = internal unnamed_addr global i32 0
@.str = [4 x i8] c"%c\08\00"
@stdout = global i32 0
define void @rotator() {
%1 = load i32, i32* @rotator.pos
%2 = zext i32 %1 to i64
%3 = getelementptr inbounds [4 x i8], [4 x i8]* @rotator.rotator, i64 0, i64 %2
%4 = load i8, i8* %3
%5 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8 signext %4)
%6 = load i32, i32* @stdout
%7 = tail call i32 @fflush(i32 %6)
%8 = load i32, i32* @rotator.pos
%9 = add nsw i32 %8, 1
%10 = srem i32 %9, 4
store i32 %10, i32* @rotator.pos
ret void
}
/* Variables and functions */
int /*<<< orphan*/ prime();
int main(void) {
  prime();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <prime@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <prime@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @prime()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @prime()
ret i32 0
}
void isr_int_div_by_zero() {}


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

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

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

LLVM IR (-O2):
define void @isr_int_div_by_zero() {
ret void
}
unsigned f1(unsigned x) { return x / 100; }


x86 assembly (clang, -O0):
<f1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x64,%ecx
xor    %edx,%edx
div    %ecx
pop    %rbp
ret

x86 assembly (clang, -O2):
<f1>:
mov    %edi,%eax
imul   $0x51eb851f,%rax,%rax
shr    $0x25,%rax
ret

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

LLVM IR (-O2):
define i32 @f1(i32 %0) {
%2 = udiv i32 %0, 100
ret i32 %2
}
/* Variables and functions */
scalar_t__ floor(double);
int _Floor(double in1) { return (int)floor(in1); }


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

x86 assembly (clang, -O2):
<_Floor>:
jmp    1030 <floor@plt>

LLVM IR (-O0):
define i32 @_Floor(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call i64 @floor(double %3)
%5 = trunc i64 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @_Floor(double %0) {
%2 = tail call i64 @floor(double %0)
%3 = trunc i64 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
report_end() {
  printf("\nTested ended\n");
  return (0);
}


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

x86 assembly (clang, -O2):
<report_end>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@str = [14 x i8] c"\0ATested ended\00"
define i32 @report_end() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char const *);
int /*<<< orphan*/ stdout;
void mycallback(const char *str) {
  printf("%s\n", str);
  fflush(stdout);
}


x86 assembly (clang, -O0):
<mycallback>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e9d(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mycallback>:
push   %rax
mov    %rdi,%rsi
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    0x2ea9(%rip),%rax
mov    (%rax),%edi
pop    %rax
jmp    1040 <fflush@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%s\0A\00"
@stdout = global i32 0
define void @mycallback(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = load i32, i32* @stdout
%6 = call i32 @fflush(i32 %5)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
@stdout = global i32 0
define void @mycallback(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = load i32, i32* @stdout
%4 = tail call i32 @fflush(i32 %3)
ret void
}
/* Type definitions */
typedef scalar_t__ volatile uint32_t;

/* Variables and functions */
uint32_t get_mem(uint32_t address) { return *((volatile uint32_t *)address); }


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

x86 assembly (clang, -O2):
<get_mem>:
mov    %rdi,-0x8(%rsp)
mov    -0x8(%rsp),%rax
mov    (%rax),%rax
ret

LLVM IR (-O0):
define i64 @get_mem(i64 %0) {
%2 = alloca i64
store volatile i64 %0, i64* %2
%3 = load volatile i64, i64* %2
%4 = inttoptr i64 %3 to i64*
%5 = load volatile i64, i64* %4
ret i64 %5
}

LLVM IR (-O2):
define i64 @get_mem(i64 %0) {
%2 = alloca i64
store volatile i64 %0, i64* %2
%3 = load volatile i64, i64* %2
%4 = inttoptr i64 %3 to i64*
%5 = load volatile i64, i64* %4
ret i64 %5
}