xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
scalar_t__ strlen(int /*<<< orphan*/);
main() {
  int i = 0;
  char *cat = "cic\0test";
  while (strlen(*cat++)) {
    i++;
    printf("%d\n", i);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
lea    0xec3(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movsbl (%rax),%edi
call   1030 <strlen@plt>
cmp    $0x0,%rax
je     117f <main+0x5f>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xe94(%rip),%rdi
call   1040 <printf@plt>
jmp    1141 <main+0x21>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
mov    $0x63,%edi
call   1030 <strlen@plt>
test   %rax,%rax
je     116d <main+0x4d>
mov    $0x1,%ebx
lea    0xec0(%rip),%r15
lea    0xec2(%rip),%r14
nopw   0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    %ebx,%esi
call   1040 <printf@plt>
movsbl (%rbx,%r15,1),%edi
call   1030 <strlen@plt>
add    $0x1,%rbx
test   %rax,%rax
jne    1150 <main+0x30>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [9 x i8] c"cic\00test\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i64 @strlen(i32 99)
%2 = icmp eq i64 %1, 0
br i1 %2, label %13, label %3
3: ; preds = %0, %3
%4 = phi i8* [ %6, %3 ], [ getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), %0 ]
%5 = phi i32 [ %7, %3 ], [ 0, %0 ]
%6 = getelementptr inbounds i8, i8* %4, i64 1
%7 = add nuw nsw i32 %5, 1
%8 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %7)
%9 = load i8, i8* %6
%10 = sext i8 %9 to i32
%11 = tail call i64 @strlen(i32 %10)
%12 = icmp eq i64 %11, 0
br i1 %12, label %13, label %3
13: ; preds = %3, %0
ret i32 0
}
/* Variables and functions */
char *CopynString(char const *, size_t);
char *CopyrString(const char *beg, const char *end) {
  if (!beg || !end)
    return NULL;
  return CopynString(beg, (size_t)(end - beg));
}


x86 assembly (clang, -O0):
<CopyrString>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1136 <CopyrString+0x26>
cmpq   $0x0,-0x18(%rbp)
jne    1143 <CopyrString+0x33>
movq   $0x0,-0x8(%rbp)
jmp    115b <CopyrString+0x4b>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x10(%rbp),%rax
sub    %rax,%rsi
call   1030 <CopynString@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CopyrString>:
test   %rdi,%rdi
je     1122 <CopyrString+0x12>
test   %rsi,%rsi
je     1122 <CopyrString+0x12>
sub    %rdi,%rsi
jmp    1030 <CopynString@plt>
xor    %eax,%eax
ret

LLVM IR (-O0):
define i8* @CopyrString(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
%6 = load i8*, i8** %4
%7 = icmp ne i8* %6, null
br i1 %7, label %8, label %11
8: ; preds = %2
%9 = load i8*, i8** %5
%10 = icmp ne i8* %9, null
br i1 %10, label %12, label %11
11: ; preds = %8, %2
store i8* null, i8** %3
br label %20
12: ; preds = %8
%13 = load i8*, i8** %4
%14 = load i8*, i8** %5
%15 = load i8*, i8** %4
%16 = ptrtoint i8* %14 to i64
%17 = ptrtoint i8* %15 to i64
%18 = sub i64 %16, %17
%19 = call i8* @CopynString(i8* %13, i64 %18)
store i8* %19, i8** %3
br label %20
20: ; preds = %12, %11
%21 = load i8*, i8** %3
ret i8* %21
}

LLVM IR (-O2):
define i8* @CopyrString(i8* %0, i8* %1) {
%3 = icmp ne i8* %0, null
%4 = icmp ne i8* %1, null
%5 = and i1 %3, %4
br i1 %5, label %6, label %11
6: ; preds = %2
%7 = ptrtoint i8* %1 to i64
%8 = ptrtoint i8* %0 to i64
%9 = sub i64 %7, %8
%10 = tail call i8* @CopynString(i8* %0, i64 %9)
br label %11
11: ; preds = %2, %6
%12 = phi i8* [ %10, %6 ], [ null, %2 ]
ret i8* %12
}
/* Variables and functions */
unsigned int sumd(double const *, unsigned int);
double meand(const double *x, unsigned n) { return sumd(x, n) / n; }


x86 assembly (clang, -O0):
<meand>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <sumd@plt>
mov    -0xc(%rbp),%ecx
xor    %edx,%edx
div    %ecx
cvtsi2sd %rax,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<meand>:
push   %rbx
mov    %esi,%ebx
call   1030 <sumd@plt>
xor    %edx,%edx
div    %ebx
cvtsi2sd %rax,%xmm0
pop    %rbx
ret

LLVM IR (-O0):
define double @meand(double* %0, i32 %1) {
%3 = alloca double*
%4 = alloca i32
store double* %0, double** %3
store i32 %1, i32* %4
%5 = load double*, double** %3
%6 = load i32, i32* %4
%7 = call i32 @sumd(double* %5, i32 %6)
%8 = load i32, i32* %4
%9 = udiv i32 %7, %8
%10 = uitofp i32 %9 to double
ret double %10
}

LLVM IR (-O2):
define double @meand(double* %0, i32 %1) {
%3 = tail call i32 @sumd(double* %0, i32 %1)
%4 = udiv i32 %3, %1
%5 = uitofp i32 %4 to double
ret double %5
}
void RAWToI420() {}


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

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

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

LLVM IR (-O2):
define void @RAWToI420() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ExtSelect(char *, char *, int /*<<< orphan*/);
void ExttServerSelect(void) {
  ExtSelect("tServer",
            "tServer.uServer,tServer.cLabel,tServer.uOwner,tServer.uCreatedBy,"
            "tServer.uCreatedDate,tServer.uModBy,tServer.uModDate",
            0);
}


x86 assembly (clang, -O0):
<ExttServerSelect>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
lea    0xee6(%rip),%rsi
xor    %edx,%edx
call   1030 <ExtSelect@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<ExttServerSelect>:
lea    0xee9(%rip),%rdi
lea    0xeea(%rip),%rsi
xor    %edx,%edx
jmp    1030 <ExtSelect@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"tServer\00"
@.str.1 = [118 x i8] c"tServer.uServer,tServer.cLabel,tServer.uOwner,tServer.uCreatedBy,tServer.uCreatedDate,tServer.uModBy,tServer.uModDate\00"
define void @ExttServerSelect() {
%1 = call i32 @ExtSelect(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([118 x i8], [118 x i8]* @.str.1, i64 0, i64 0), i32 0)
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"tServer\00"
@.str.1 = [118 x i8] c"tServer.uServer,tServer.cLabel,tServer.uOwner,tServer.uCreatedBy,tServer.uCreatedDate,tServer.uModBy,tServer.uModDate\00"
define void @ExttServerSelect() {
%1 = tail call i32 @ExtSelect(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([118 x i8], [118 x i8]* @.str.1, i64 0, i64 0), i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
__attribute__((visibility("default"))) void MyFunc(int x) { printf("%d\n", x); }


x86 assembly (clang, -O0):
<MyFunc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xedb(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<MyFunc>:
mov    %edi,%esi
lea    0xee7(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define void @MyFunc(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
int typeof1(char c) {
  if (c == '(')
    return 1;
  if (c == ')')
    return 2;
  if (c == '+' || c == '.')
    return 3;
  if (c == ' ')
    return 4;
  else
    return 5;
}


x86 assembly (clang, -O0):
<typeof1>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x28,%eax
jne    1123 <typeof1+0x23>
movl   $0x1,-0x4(%rbp)
jmp    1182 <typeof1+0x82>
movsbl -0x5(%rbp),%eax
cmp    $0x29,%eax
jne    113c <typeof1+0x3c>
movl   $0x2,-0x4(%rbp)
jmp    1182 <typeof1+0x82>
movsbl -0x5(%rbp),%eax
cmp    $0x2b,%eax
je     1156 <typeof1+0x56>
movsbl -0x5(%rbp),%eax
cmp    $0x2e,%eax
jne    1162 <typeof1+0x62>
movl   $0x3,-0x4(%rbp)
jmp    1182 <typeof1+0x82>
movsbl -0x5(%rbp),%eax
cmp    $0x20,%eax
jne    117b <typeof1+0x7b>
movl   $0x4,-0x4(%rbp)
jmp    1182 <typeof1+0x82>
movl   $0x5,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<typeof1>:
add    $0xe0,%dil
cmp    $0xe,%dil
ja     112f <typeof1+0x2f>
mov    $0x1,%eax
movzbl %dil,%ecx
lea    0xee6(%rip),%rdx
movslq (%rdx,%rcx,4),%rcx
add    %rdx,%rcx
jmp    *%rcx
mov    $0x3,%eax
ret
mov    $0x4,%eax
ret
mov    $0x5,%eax
ret
mov    $0x2,%eax
ret

LLVM IR (-O0):
define i32 @typeof1(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = icmp eq i32 %5, 40
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 1, i32* %2
br label %28
8: ; preds = %1
%9 = load i8, i8* %3
%10 = sext i8 %9 to i32
%11 = icmp eq i32 %10, 41
br i1 %11, label %12, label %13
12: ; preds = %8
store i32 2, i32* %2
br label %28
13: ; preds = %8
%14 = load i8, i8* %3
%15 = sext i8 %14 to i32
%16 = icmp eq i32 %15, 43
br i1 %16, label %21, label %17
17: ; preds = %13
%18 = load i8, i8* %3
%19 = sext i8 %18 to i32
%20 = icmp eq i32 %19, 46
br i1 %20, label %21, label %22
21: ; preds = %17, %13
store i32 3, i32* %2
br label %28
22: ; preds = %17
%23 = load i8, i8* %3
%24 = sext i8 %23 to i32
%25 = icmp eq i32 %24, 32
br i1 %25, label %26, label %27
26: ; preds = %22
store i32 4, i32* %2
br label %28
27: ; preds = %22
store i32 5, i32* %2
br label %28
28: ; preds = %27, %26, %21, %12, %7
%29 = load i32, i32* %2
ret i32 %29
}

LLVM IR (-O2):
define i32 @typeof1(i8 signext %0) {
switch i8 %0, label %4 [
i8 40, label %6
i8 41, label %2
i8 46, label %5
i8 43, label %5
i8 32, label %3
]
2: ; preds = %1
br label %6
3: ; preds = %1
br label %6
4: ; preds = %1
br label %6
5: ; preds = %1, %1
br label %6
6: ; preds = %1, %5, %4, %3, %2
%7 = phi i32 [ 2, %2 ], [ 4, %3 ], [ 5, %4 ], [ 1, %1 ], [ 3, %5 ]
ret i32 %7
}
int lib_func(void) { return 42; }


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

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

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

LLVM IR (-O2):
define i32 @lib_func() {
ret i32 42
}
/* Variables and functions */
int /*<<< orphan*/ __coverity_string_size_sanitize__(int /*<<< orphan*/);
int UTF8_getc(const unsigned char *str, int len, unsigned long *val) {
  if (len <= 0) {
    __coverity_string_size_sanitize__(0);
    return 0;
  } else if (len <= 6) {
    __coverity_string_size_sanitize__(0);
    return len;
  }
  return -2;
}


x86 assembly (clang, -O0):
<UTF8_getc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
cmpl   $0x0,-0x14(%rbp)
jg     1140 <UTF8_getc+0x30>
xor    %edi,%edi
call   1030 <__coverity_string_size_sanitize__@plt>
movl   $0x0,-0x4(%rbp)
jmp    1168 <UTF8_getc+0x58>
cmpl   $0x6,-0x14(%rbp)
jg     115c <UTF8_getc+0x4c>
xor    %edi,%edi
call   1030 <__coverity_string_size_sanitize__@plt>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1168 <UTF8_getc+0x58>
jmp    1161 <UTF8_getc+0x51>
movl   $0xfffffffe,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<UTF8_getc>:
push   %rbx
test   %esi,%esi
jle    1123 <UTF8_getc+0x13>
mov    %esi,%ebx
mov    $0xfffffffe,%eax
cmp    $0x6,%esi
jbe    1125 <UTF8_getc+0x15>
pop    %rbx
ret
xor    %ebx,%ebx
xor    %edi,%edi
call   1030 <__coverity_string_size_sanitize__@plt>
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @UTF8_getc(i8* nocapture readnone %0, i32 %1, i64* nocapture readnone %2) {
%4 = icmp slt i32 %1, 1
br i1 %4, label %7, label %5
5: ; preds = %3
%6 = icmp ult i32 %1, 7
br i1 %6, label %7, label %10
7: ; preds = %5, %3
%8 = phi i32 [ 0, %3 ], [ %1, %5 ]
%9 = tail call i32 @__coverity_string_size_sanitize__(i32 0)
br label %10
10: ; preds = %7, %5
%11 = phi i32 [ -2, %5 ], [ %8, %7 ]
ret i32 %11
}
/* Type definitions */
typedef int uint8_t;
typedef int uint32_t;

/* Variables and functions */
void crc_be_cycle(uint32_t *table, uint32_t *remainder, uint8_t c) {
  const uint8_t i = (*remainder >> 24) ^ c;
  *remainder = (*remainder << 8) ^ table[i];
}


x86 assembly (clang, -O0):
<crc_be_cycle>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
sar    $0x18,%eax
xor    -0x14(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
shl    $0x8,%ecx
mov    -0x8(%rbp),%rax
movslq -0x18(%rbp),%rdx
xor    (%rax,%rdx,4),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<crc_be_cycle>:
mov    (%rsi),%eax
mov    %eax,%ecx
sar    $0x18,%ecx
xor    %edx,%ecx
shl    $0x8,%eax
movslq %ecx,%rcx
xor    (%rdi,%rcx,4),%eax
mov    %eax,(%rsi)
ret

LLVM IR (-O0):
define void @crc_be_cycle(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** %5
%9 = load i32, i32* %8
%10 = ashr i32 %9, 24
%11 = load i32, i32* %6
%12 = xor i32 %10, %11
store i32 %12, i32* %7
%13 = load i32*, i32** %5
%14 = load i32, i32* %13
%15 = shl i32 %14, 8
%16 = load i32*, i32** %4
%17 = load i32, i32* %7
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds i32, i32* %16, i64 %18
%20 = load i32, i32* %19
%21 = xor i32 %15, %20
%22 = load i32*, i32** %5
store i32 %21, i32* %22
ret void
}

LLVM IR (-O2):
define void @crc_be_cycle(i32* nocapture %0, i32* nocapture %1, i32 %2) {
%4 = load i32, i32* %1
%5 = ashr i32 %4, 24
%6 = xor i32 %5, %2
%7 = shl i32 %4, 8
%8 = sext i32 %6 to i64
%9 = getelementptr inbounds i32, i32* %0, i64 %8
%10 = load i32, i32* %9
%11 = xor i32 %7, %10
store i32 %11, i32* %1
ret void
}
unsigned int f74(unsigned int x, unsigned long int y) {
  return (x << y) + (x >> (8 * sizeof(unsigned int) - y));
}


x86 assembly (clang, -O0):
<f74>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x10(%rbp),%rcx
shl    %cl,%eax
mov    -0x4(%rbp),%edx
mov    $0x20,%ecx
sub    -0x10(%rbp),%rcx
shr    %cl,%edx
mov    %edx,%ecx
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f74>:
mov    %rsi,%rcx
mov    %edi,%eax
shl    %cl,%eax
neg    %cl
shr    %cl,%edi
add    %edi,%eax
ret

LLVM IR (-O0):
define i32 @f74(i32 %0, i64 %1) {
%3 = alloca i32
%4 = alloca i64
store i32 %0, i32* %3
store i64 %1, i64* %4
%5 = load i32, i32* %3
%6 = load i64, i64* %4
%7 = trunc i64 %6 to i32
%8 = shl i32 %5, %7
%9 = load i32, i32* %3
%10 = load i64, i64* %4
%11 = sub i64 32, %10
%12 = trunc i64 %11 to i32
%13 = lshr i32 %9, %12
%14 = add i32 %8, %13
ret i32 %14
}

LLVM IR (-O2):
define i32 @f74(i32 %0, i64 %1) {
%3 = trunc i64 %1 to i32
%4 = shl i32 %0, %3
%5 = sub i32 32, %3
%6 = lshr i32 %0, %5
%7 = add i32 %6, %4
ret i32 %7
}
void t5325_init(void) {}


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

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

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

LLVM IR (-O2):
define void @t5325_init() {
ret void
}
/* Variables and functions */
int _ada_use_c2phc4c(int, int *, int *, double *, int /*<<< orphan*/);
int clear_quaddobl_homotopy(void) {
  int *a, *b, fail;
  double *c;
  fail = _ada_use_c2phc4c(184, a, b, c, 0);
  return fail;
}


x86 assembly (clang, -O0):
<clear_quaddobl_homotopy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0xb8,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clear_quaddobl_homotopy>:
mov    $0xb8,%edi
xor    %r8d,%r8d
jmp    1030 <_ada_use_c2phc4c@plt>

LLVM IR (-O0):
define i32 @clear_quaddobl_homotopy() {
%1 = alloca i32*
%2 = alloca i32*
%3 = alloca i32
%4 = alloca double*
%5 = load i32*, i32** %1
%6 = load i32*, i32** %2
%7 = load double*, double** %4
%8 = call i32 @_ada_use_c2phc4c(i32 184, i32* %5, i32* %6, double* %7, i32 0)
store i32 %8, i32* %3
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
define i32 @clear_quaddobl_homotopy() {
%1 = tail call i32 @_ada_use_c2phc4c(i32 184, i32* undef, i32* undef, double* undef, i32 0)
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  fprintf(stderr, "usage:\n\tchkprintcap [-dv] [-f printcapfile]\n");
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [45 x i8] c"usage:\0A\09chkprintcap [-dv] [-f printcapfile]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [45 x i8] c"usage:\0A\09chkprintcap [-dv] [-f printcapfile]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ refresh();
void Pac_Blit(void *pCtx) { refresh(); }


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

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

LLVM IR (-O0):
define void @Pac_Blit(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (...) @refresh()
ret void
}

LLVM IR (-O2):
define void @Pac_Blit(i8* nocapture readnone %0) {
%2 = tail call i32 (...) @refresh()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
scalar_t__ getoptions(int, char **);
scalar_t__ playwav();
int /*<<< orphan*/ srand(int /*<<< orphan*/);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
int main(int argc, char *argv[], char **envp) {
  if (getoptions(argc, argv))
    exit(1);
  srand(time(NULL));
  if (playwav())
    exit(2);
  exit(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    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <getoptions@plt>
cmp    $0x0,%rax
je     118a <main+0x3a>
mov    $0x1,%edi
call   1070 <exit@plt>
xor    %eax,%eax
mov    %eax,%edi
call   1060 <time@plt>
mov    %eax,%edi
call   1040 <srand@plt>
mov    $0x0,%al
call   1050 <playwav@plt>
cmp    $0x0,%rax
je     11b5 <main+0x65>
mov    $0x2,%edi
call   1070 <exit@plt>
xor    %edi,%edi
call   1070 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
call   1030 <getoptions@plt>
test   %rax,%rax
jne    117c <main+0x2c>
xor    %edi,%edi
call   1060 <time@plt>
mov    %eax,%edi
call   1040 <srand@plt>
xor    %eax,%eax
call   1050 <playwav@plt>
test   %rax,%rax
jne    1186 <main+0x36>
xor    %edi,%edi
call   1070 <exit@plt>
mov    $0x1,%edi
call   1070 <exit@plt>
mov    $0x2,%edi
call   1070 <exit@plt>

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1, i8** %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8**
%7 = alloca i8**
store i32 0, i32* %4
store i32 %0, i32* %5
store i8** %1, i8*** %6
store i8** %2, i8*** %7
%8 = load i32, i32* %5
%9 = load i8**, i8*** %6
%10 = call i64 @getoptions(i32 %8, i8** %9)
%11 = icmp ne i64 %10, 0
br i1 %11, label %12, label %14
12: ; preds = %3
%13 = call i32 @exit(i32 1)
unreachable
14: ; preds = %3
%15 = call i32 @time(i32* null)
%16 = call i32 @srand(i32 %15)
%17 = call i64 (...) @playwav()
%18 = icmp ne i64 %17, 0
br i1 %18, label %19, label %21
19: ; preds = %14
%20 = call i32 @exit(i32 2)
unreachable
21: ; preds = %14
%22 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1, i8** nocapture readnone %2) {
%4 = tail call i64 @getoptions(i32 %0, i8** %1)
%5 = icmp eq i64 %4, 0
br i1 %5, label %8, label %6
6: ; preds = %3
%7 = tail call i32 @exit(i32 1)
unreachable
8: ; preds = %3
%9 = tail call i32 @time(i32* null)
%10 = tail call i32 @srand(i32 %9)
%11 = tail call i64 (...) @playwav()
%12 = icmp eq i64 %11, 0
br i1 %12, label %15, label %13
13: ; preds = %8
%14 = tail call i32 @exit(i32 2)
unreachable
15: ; preds = %8
%16 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int n, quad;
  printf("Entre com um numero positivo: ");
  scanf("%d", &n);
  quad = n * n;
  printf("Quadrado: %d", quad);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xee5(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
imul   -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%esi
lea    0xebe(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xef3(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%esi
imul   %esi,%esi
lea    0xed1(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [31 x i8] c"Entre com um numero positivo: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [13 x i8] c"Quadrado: %d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%6 = load i32, i32* %2
%7 = load i32, i32* %2
%8 = mul nsw i32 %6, %7
store i32 %8, i32* %3
%9 = load i32, i32* %3
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), i32 %9)
ret i32 0
}

LLVM IR (-O2):
@.str = [31 x i8] c"Entre com um numero positivo: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [13 x i8] c"Quadrado: %d\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = mul nsw i32 %5, %5
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), i32 %6)
ret i32 0
}
void bar(float f) {
  f *f + f;
  (double)f *f - f;
  (long double)-f *f + f;
}


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

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

LLVM IR (-O0):
define void @bar(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = load float, float* %2
%5 = load float, float* %2
%6 = call float @llvm.fmuladd.f32(float %3, float %4, float %5)
%7 = load float, float* %2
%8 = fpext float %7 to double
%9 = load float, float* %2
%10 = fpext float %9 to double
%11 = load float, float* %2
%12 = fpext float %11 to double
%13 = fneg double %12
%14 = call double @llvm.fmuladd.f64(double %8, double %10, double %13)
%15 = load float, float* %2
%16 = fneg float %15
%17 = fpext float %16 to x86_fp80
%18 = load float, float* %2
%19 = fpext float %18 to x86_fp80
%20 = load float, float* %2
%21 = fpext float %20 to x86_fp80
%22 = call x86_fp80 @llvm.fmuladd.f80(x86_fp80 %17, x86_fp80 %19, x86_fp80 %21)
ret void
}

LLVM IR (-O2):
define void @bar(float %0) {
ret void
}
/* Variables and functions */
int CompareFiles(char *, char *);
int CompareResult(char *sample, char *result) {
  return CompareFiles(sample, result);
}


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

x86 assembly (clang, -O2):
<CompareResult>:
jmp    1030 <CompareFiles@plt>

LLVM IR (-O0):
define i32 @CompareResult(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = call i32 @CompareFiles(i8* %5, i8* %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @CompareResult(i8* %0, i8* %1) {
%3 = tail call i32 @CompareFiles(i8* %0, i8* %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void main(void) {
  printf("%d\n", sizeof(int));
  printf("%d\n", sizeof(char));
  printf("%d\n", sizeof(float));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x4,%esi
call   1030 <printf@plt>
lea    0xed4(%rip),%rdi
mov    $0x1,%esi
call   1030 <printf@plt>
lea    0xec3(%rip),%rdi
mov    $0x4,%esi
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xee8(%rip),%rbx
mov    %rbx,%rdi
mov    $0x4,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x1,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x4,%esi
pop    %rbx
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define void @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 4)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 1)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 4)
ret void
}
void *__attribute__((malloc)) foo(void) { return 0; }


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

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

LLVM IR (-O0):
define noalias i8* @foo() {
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @foo() {
ret i8* null
}
/* Type definitions */
struct msgu_stream {
  int dummy;
};
struct msgu_fragment {
  int dummy;
};

/* Variables and functions */
int msgu_string_read(struct msgu_stream *, struct msgu_fragment *, void *);
int msgu_string_read_frag(struct msgu_stream *src, struct msgu_fragment *f,
                          void *str) {
  return msgu_string_read(src, f, str);
}


x86 assembly (clang, -O0):
<msgu_string_read_frag>:
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),%rdx
call   1030 <msgu_string_read@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<msgu_string_read_frag>:
jmp    1030 <msgu_string_read@plt>

LLVM IR (-O0):
%struct.msgu_stream = type { i32 }
%struct.msgu_fragment = type { i32 }
define i32 @msgu_string_read_frag(%struct.msgu_stream* %0, %struct.msgu_fragment* %1, i8* %2) {
%4 = alloca %struct.msgu_stream*
%5 = alloca %struct.msgu_fragment*
%6 = alloca i8*
store %struct.msgu_stream* %0, %struct.msgu_stream** %4
store %struct.msgu_fragment* %1, %struct.msgu_fragment** %5
store i8* %2, i8** %6
%7 = load %struct.msgu_stream*, %struct.msgu_stream** %4
%8 = load %struct.msgu_fragment*, %struct.msgu_fragment** %5
%9 = load i8*, i8** %6
%10 = call i32 @msgu_string_read(%struct.msgu_stream* %7, %struct.msgu_fragment* %8, i8* %9)
ret i32 %10
}

LLVM IR (-O2):
%struct.msgu_stream = type { i32 }
%struct.msgu_fragment = type { i32 }
define i32 @msgu_string_read_frag(%struct.msgu_stream* %0, %struct.msgu_fragment* %1, i8* %2) {
%4 = tail call i32 @msgu_string_read(%struct.msgu_stream* %0, %struct.msgu_fragment* %1, i8* %2)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ Fatal_InternalInconsistency(char *);
void EnsureSetIndexInRange(long p_index) {
  if (p_index < 0 || p_index > 31)
    Fatal_InternalInconsistency("Index out of range for set operation");
}


x86 assembly (clang, -O0):
<EnsureSetIndexInRange>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jl     1132 <EnsureSetIndexInRange+0x22>
cmpq   $0x1f,-0x8(%rbp)
jle    113e <EnsureSetIndexInRange+0x2e>
lea    0xec7(%rip),%rdi
call   1030 <Fatal_InternalInconsistency@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<EnsureSetIndexInRange>:
cmp    $0x20,%rdi
jb     1122 <EnsureSetIndexInRange+0x12>
lea    0xee3(%rip),%rdi
jmp    1030 <Fatal_InternalInconsistency@plt>
ret

LLVM IR (-O0):
@.str = [37 x i8] c"Index out of range for set operation\00"
define void @EnsureSetIndexInRange(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = icmp slt i64 %3, 0
br i1 %4, label %8, label %5
5: ; preds = %1
%6 = load i64, i64* %2
%7 = icmp sgt i64 %6, 31
br i1 %7, label %8, label %10
8: ; preds = %5, %1
%9 = call i32 @Fatal_InternalInconsistency(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %8, %5
ret void
}

LLVM IR (-O2):
@.str = [37 x i8] c"Index out of range for set operation\00"
define void @EnsureSetIndexInRange(i64 %0) {
%2 = icmp ugt i64 %0, 31
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 @Fatal_InternalInconsistency(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
br label %5
5: ; preds = %1, %3
ret void
}
void cwt_len_cal(int sigInLength, int scale, int *sigOutLength, double *delta) {
  *sigOutLength = scale;
  *delta = (double)(sigInLength - 1) / (double)(scale - 1);
  return;
}


x86 assembly (clang, -O0):
<cwt_len_cal>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    -0x8(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x4(%rbp),%eax
sub    $0x1,%eax
cvtsi2sd %eax,%xmm0
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
cvtsi2sd %eax,%xmm1
divsd  %xmm1,%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<cwt_len_cal>:
mov    %esi,(%rdx)
add    $0xffffffff,%edi
cvtsi2sd %edi,%xmm0
add    $0xffffffff,%esi
cvtsi2sd %esi,%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,(%rcx)
ret

LLVM IR (-O0):
define void @cwt_len_cal(i32 %0, i32 %1, i32* %2, double* %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32*
%8 = alloca double*
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32* %2, i32** %7
store double* %3, double** %8
%9 = load i32, i32* %6
%10 = load i32*, i32** %7
store i32 %9, i32* %10
%11 = load i32, i32* %5
%12 = sub nsw i32 %11, 1
%13 = sitofp i32 %12 to double
%14 = load i32, i32* %6
%15 = sub nsw i32 %14, 1
%16 = sitofp i32 %15 to double
%17 = fdiv double %13, %16
%18 = load double*, double** %8
store double %17, double* %18
ret void
}

LLVM IR (-O2):
define void @cwt_len_cal(i32 %0, i32 %1, i32* nocapture writeonly %2, double* nocapture writeonly %3) {
store i32 %1, i32* %2
%5 = add nsw i32 %0, -1
%6 = sitofp i32 %5 to double
%7 = add nsw i32 %1, -1
%8 = sitofp i32 %7 to double
%9 = fdiv double %6, %8
store double %9, double* %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
bool tread_val_start(void *s) {
  fprintf(stderr, "val_start\n");
  return true;
}


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

x86 assembly (clang, -O2):
<tread_val_start>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%edi
lea    0xedf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [11 x i8] c"val_start\0A\00"
define i32 @tread_val_start(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
ret i32 1
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [11 x i8] c"val_start\0A\00"
define i32 @tread_val_start(i8* nocapture readnone %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ done();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ init(int, char **);
int /*<<< orphan*/ run();
int main(int argc, char **argv) {
  init(argc, argv);
  run();
  done();
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1050 <init@plt>
mov    $0x0,%al
call   1040 <run@plt>
mov    $0x0,%al
call   1030 <done@plt>
xor    %edi,%edi
call   1060 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
call   1050 <init@plt>
xor    %eax,%eax
call   1040 <run@plt>
xor    %eax,%eax
call   1030 <done@plt>
xor    %edi,%edi
call   1060 <exit@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 @init(i32 %6, i8** %7)
%9 = call i32 (...) @run()
%10 = call i32 (...) @done()
%11 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @init(i32 %0, i8** %1)
%4 = tail call i32 (...) @run()
%5 = tail call i32 (...) @done()
%6 = tail call i32 @exit(i32 0)
unreachable
}
int get32(unsigned char *p) {
  return p[0] << 24 | p[1] << 16 | p[2] << 8 | p[3];
}


x86 assembly (clang, -O0):
<get32>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
shl    $0x18,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x1(%rcx),%ecx
shl    $0x10,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x2(%rcx),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x3(%rcx),%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get32>:
mov    (%rdi),%eax
bswap  %eax
ret

LLVM IR (-O0):
define i32 @get32(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 0
%5 = load i8, i8* %4
%6 = zext i8 %5 to i32
%7 = shl i32 %6, 24
%8 = load i8*, i8** %2
%9 = getelementptr inbounds i8, i8* %8, i64 1
%10 = load i8, i8* %9
%11 = zext i8 %10 to i32
%12 = shl i32 %11, 16
%13 = or i32 %7, %12
%14 = load i8*, i8** %2
%15 = getelementptr inbounds i8, i8* %14, i64 2
%16 = load i8, i8* %15
%17 = zext i8 %16 to i32
%18 = shl i32 %17, 8
%19 = or i32 %13, %18
%20 = load i8*, i8** %2
%21 = getelementptr inbounds i8, i8* %20, i64 3
%22 = load i8, i8* %21
%23 = zext i8 %22 to i32
%24 = or i32 %19, %23
ret i32 %24
}

LLVM IR (-O2):
define i32 @get32(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = zext i8 %2 to i32
%4 = shl nuw i32 %3, 24
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = load i8, i8* %5
%7 = zext i8 %6 to i32
%8 = shl nuw nsw i32 %7, 16
%9 = or i32 %8, %4
%10 = getelementptr inbounds i8, i8* %0, i64 2
%11 = load i8, i8* %10
%12 = zext i8 %11 to i32
%13 = shl nuw nsw i32 %12, 8
%14 = or i32 %9, %13
%15 = getelementptr inbounds i8, i8* %0, i64 3
%16 = load i8, i8* %15
%17 = zext i8 %16 to i32
%18 = or i32 %14, %17
ret i32 %18
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void printMessage(void) { printf("Programming is fun.\n"); }


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

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

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

LLVM IR (-O2):
@str = [20 x i8] c"Programming is fun.\00"
define void @printMessage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ xputc2(char **, int /*<<< orphan*/);
void xputs2(char **buff, const char *str) {
  while (*str)
    xputc2(buff, *str++);
  return;
}


x86 assembly (clang, -O0):
<xputs2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     114d <xputs2+0x3d>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movsbl (%rax),%esi
call   1030 <xputc2@plt>
jmp    1120 <xputs2+0x10>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xputs2>:
push   %r14
push   %rbx
push   %rax
mov    (%rsi),%al
test   %al,%al
je     1146 <xputs2+0x36>
mov    %rsi,%rbx
mov    %rdi,%r14
add    $0x1,%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movsbl %al,%esi
mov    %r14,%rdi
call   1030 <xputc2@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1130 <xputs2+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define void @xputs2(i8** %0, i8* nocapture %1) {
%3 = load i8, i8* %1
%4 = icmp eq i8 %3, 0
br i1 %4, label %13, label %5
5: ; preds = %2, %5
%6 = phi i8 [ %11, %5 ], [ %3, %2 ]
%7 = phi i8* [ %8, %5 ], [ %1, %2 ]
%8 = getelementptr inbounds i8, i8* %7, i64 1
%9 = sext i8 %6 to i32
%10 = tail call i32 @xputc2(i8** %0, i32 %9)
%11 = load i8, i8* %8
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %5
13: ; preds = %5, %2
ret void
}
void L4_KDB_ClearPage(void) {
  __asm__ __volatile__("/* L4_KDB_"
                       "ClearPage"
                       "() */		\n"
                       "	int	$3		\n"
                       "	cmpb	%0, %%al	\n"
                       :
                       : "i"(0x02));
}


x86 assembly (clang, -O0):
<L4_KDB_ClearPage>:
push   %rbp
mov    %rsp,%rbp
int3
cmp    $0x2,%al
pop    %rbp
ret

x86 assembly (clang, -O2):
<L4_KDB_ClearPage>:
int3
cmp    $0x2,%al
ret

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

LLVM IR (-O2):
define void @L4_KDB_ClearPage() {
tail call void asm sideeffect "/* L4_KDB_ClearPage() */\09\09\0A\09int\09$$3\09\09\0A\09cmpb\09$0, %al\09\0A", "i,~{dirflag},~{fpsr},~{flags}"(i32 2)
ret void
}
int get16(char *addr) {
  return ((unsigned char)addr[0]) | (((int)(unsigned char)addr[1]) << 8);
}


x86 assembly (clang, -O0):
<get16>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
mov    -0x8(%rbp),%rcx
movzbl 0x1(%rcx),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get16>:
movzwl (%rdi),%eax
ret

LLVM IR (-O0):
define i32 @get16(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 0
%5 = load i8, i8* %4
%6 = zext i8 %5 to i32
%7 = load i8*, i8** %2
%8 = getelementptr inbounds i8, i8* %7, i64 1
%9 = load i8, i8* %8
%10 = zext i8 %9 to i32
%11 = shl i32 %10, 8
%12 = or i32 %6, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @get16(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = zext i8 %2 to i32
%4 = getelementptr inbounds i8, i8* %0, i64 1
%5 = load i8, i8* %4
%6 = zext i8 %5 to i32
%7 = shl nuw nsw i32 %6, 8
%8 = or i32 %7, %3
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ test(int);
int main(int argc) {
  test(-5);
  test(-2);
  test(0);
  test(argc);
  test(5);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    %edi,%ebx
mov    $0xfffffffb,%edi
call   1030 <test@plt>
mov    $0xfffffffe,%edi
call   1030 <test@plt>
xor    %edi,%edi
call   1030 <test@plt>
mov    %ebx,%edi
call   1030 <test@plt>
mov    $0x5,%edi
call   1030 <test@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %2
store i32 %0, i32* %3
%4 = call i32 @test(i32 -5)
%5 = call i32 @test(i32 -2)
%6 = call i32 @test(i32 0)
%7 = load i32, i32* %3
%8 = call i32 @test(i32 %7)
%9 = call i32 @test(i32 5)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0) {
%2 = tail call i32 @test(i32 -5)
%3 = tail call i32 @test(i32 -2)
%4 = tail call i32 @test(i32 0)
%5 = tail call i32 @test(i32 %0)
%6 = tail call i32 @test(i32 5)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void usage() {
  printf("Usage: test_fstat [OPTIONS]\n\n");
  printf("   -h, --help\t\t\tprint this message.\n");
  printf("   -m, --mountpoint=directory\t"
         "specify the mountpoint used for test (default: none).\n");
}


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

x86 assembly (clang, -O2):
<usage>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xef9(%rip),%rdi
call   1030 <puts@plt>
lea    0xf11(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [30 x i8] c"Usage: test_fstat [OPTIONS]\0A\0A\00"
@.str.1 = [37 x i8] c" -h, --help\09\09\09print this message.\0A\00"
@.str.2 = [85 x i8] c" -m, --mountpoint=directory\09specify the mountpoint used for test (default: none).\0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([85 x i8], [85 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [29 x i8] c"Usage: test_fstat [OPTIONS]\0A\00"
@str.3 = [36 x i8] c" -h, --help\09\09\09print this message.\00"
@str.4 = [84 x i8] c" -m, --mountpoint=directory\09specify the mountpoint used for test (default: none).\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @str.3, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([84 x i8], [84 x i8]* @str.4, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
scalar_t__ strcmp(char const *, char *);
int test_1(const char *str, char *ptr) {
  if (strcmp(str, "VALUE"))
    free(ptr);
  free(ptr);
}


x86 assembly (clang, -O0):
<test_1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xec5(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
je     1153 <test_1+0x33>
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_1>:
push   %rbx
mov    %rsi,%rbx
lea    0xed5(%rip),%rsi
call   1040 <strcmp@plt>
test   %rax,%rax
je     113d <test_1+0x1d>
mov    %rbx,%rdi
call   1030 <free@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

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

LLVM IR (-O2):
@.str = [6 x i8] c"VALUE\00"
define i32 @test_1(i8* %0, i8* nocapture %1) {
%3 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%4 = icmp eq i64 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 @free(i8* %1)
br label %7
7: ; preds = %5, %2
%8 = tail call i32 @free(i8* %1)
ret i32 undef
}
/* Variables and functions */
void *cpm_malloc(size_t);
void *malloc(size_t size) { return cpm_malloc(size); }


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

x86 assembly (clang, -O2):
<malloc>:
jmp    1030 <cpm_malloc@plt>

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

LLVM IR (-O2):
define i8* @malloc(i64 %0) {
%2 = tail call i8* @cpm_malloc(i64 %0)
ret i8* %2
}