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

/* Variables and functions */
__attribute__((always_)) uint32_t __ROR(uint32_t op1, uint32_t op2) {
  return (op1 >> op2) | (op1 << (32U - op2));
}


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

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

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

LLVM IR (-O2):
define i32 @__ROR(i32 %0, i32 %1) {
%3 = lshr i32 %0, %1
%4 = sub i32 32, %1
%5 = shl i32 %0, %4
%6 = or i32 %5, %3
ret i32 %6
}
/* Variables and functions */
char *malloc(int);
char *memchr(char *, char, int);
int /*<<< orphan*/ memset(char *, int /*<<< orphan*/, int);
int /*<<< orphan*/ sink(char *);
void warn_memchr_cst_memset_cst(const void *s) {
  char *p = malloc(4);
  sink(p);
  p = memchr(p, '1', 4);
  memset(p, 0, 5);
}


x86 assembly (clang, -O0):
<warn_memchr_cst_memset_cst>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x4,%edi
call   1060 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <sink@plt>
mov    -0x10(%rbp),%rdi
mov    $0x31,%esi
mov    $0x4,%edx
call   1040 <memchr@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
xor    %esi,%esi
mov    $0x5,%edx
call   1030 <memset@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<warn_memchr_cst_memset_cst>:
push   %rbx
mov    $0x4,%edi
call   1060 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1050 <sink@plt>
mov    %rbx,%rdi
mov    $0x31,%esi
mov    $0x4,%edx
call   1040 <memchr@plt>
mov    %rax,%rdi
xor    %esi,%esi
mov    $0x5,%edx
pop    %rbx
jmp    1030 <memset@plt>

LLVM IR (-O0):
define void @warn_memchr_cst_memset_cst(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = call i8* @malloc(i32 4)
store i8* %4, i8** %3
%5 = load i8*, i8** %3
%6 = call i32 @sink(i8* %5)
%7 = load i8*, i8** %3
%8 = call i8* @memchr(i8* %7, i8 signext 49, i32 4)
store i8* %8, i8** %3
%9 = load i8*, i8** %3
%10 = call i32 @memset(i8* %9, i32 0, i32 5)
ret void
}

LLVM IR (-O2):
define void @warn_memchr_cst_memset_cst(i8* nocapture readnone %0) {
%2 = tail call dereferenceable_or_null(4) i8* @malloc(i32 4)
%3 = tail call i32 @sink(i8* %2)
%4 = tail call i8* @memchr(i8* %2, i8 signext 49, i32 4)
%5 = tail call i32 @memset(i8* %4, i32 0, i32 5)
ret void
}
/* Variables and functions */
int __builtin_arm_crc32cd(int, long);
int crc32cd(int a, long b) { return __builtin_arm_crc32cd(a, b); }


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

x86 assembly (clang, -O2):
<crc32cd>:
jmp    1030 <__builtin_arm_crc32cd@plt>

LLVM IR (-O0):
define i32 @crc32cd(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 = call i32 @__builtin_arm_crc32cd(i32 %5, i64 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @crc32cd(i32 %0, i64 %1) {
%3 = tail call i32 @__builtin_arm_crc32cd(i32 %0, i64 %1)
ret i32 %3
}
int read_file(char *fname, char **pbuf, int *plen) {
  char *buf;
  int fd, i, n, j;
  return (0);
}


x86 assembly (clang, -O0):
<read_file>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @read_file(i8* nocapture readnone %0, i8** nocapture readnone %1, i32* nocapture readnone %2) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ perror(char *);
int pexit(char *msg) {
  perror(msg);
  exit(1);
}


x86 assembly (clang, -O0):
<pexit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <perror@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<pexit>:
push   %rax
call   1030 <perror@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define i32 @pexit(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @perror(i8* %3)
%5 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
define i32 @pexit(i8* nocapture %0) {
%2 = tail call i32 @perror(i8* %0)
%3 = tail call i32 @exit(i32 1)
unreachable
}
float dot2_neon_hfp(float v0[2], float v1[2]) {}


x86 assembly (clang, -O0):
<dot2_neon_hfp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
movss  -0x4(%rbp),%xmm0
pop    %rbp
ret

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

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

LLVM IR (-O2):
define float @dot2_neon_hfp(float* nocapture readnone %0, float* nocapture readnone %1) {
ret float undef
}
/* Variables and functions */
float abs(float);
int /*<<< orphan*/ wait1Msec(int);
void pause(float duration) {
  duration = abs(duration);
  wait1Msec(1000 * duration);
}


x86 assembly (clang, -O0):
<pause>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <abs@plt>
movss  %xmm0,-0x4(%rbp)
movss  0xebc(%rip),%xmm0
mulss  -0x4(%rbp),%xmm0
cvttss2si %xmm0,%edi
call   1040 <wait1Msec@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pause>:
push   %rax
call   1030 <abs@plt>
mulss  0xed2(%rip),%xmm0
cvttss2si %xmm0,%edi
pop    %rax
jmp    1040 <wait1Msec@plt>

LLVM IR (-O0):
define void @pause(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call float @abs(float %3)
store float %4, float* %2
%5 = load float, float* %2
%6 = fmul float 1.000000e+03, %5
%7 = fptosi float %6 to i32
%8 = call i32 @wait1Msec(i32 %7)
ret void
}

LLVM IR (-O2):
define void @pause(float %0) {
%2 = tail call float @abs(float %0)
%3 = fmul float %2, 1.000000e+03
%4 = fptosi float %3 to i32
%5 = tail call i32 @wait1Msec(i32 %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void print_help(char *bin_name) {
  fprintf(stderr, "usage:\n\t %s input_binary.ply [-o output_ascii.ply]\n",
          bin_name);
}


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

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [52 x i8] c"usage:\0A\09 %s input_binary.ply [-o output_ascii.ply]\0A\00"
define void @print_help(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0), i8* %4)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [52 x i8] c"usage:\0A\09 %s input_binary.ply [-o output_ascii.ply]\0A\00"
define void @print_help(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
int q_islower(int c) { return (c >= 'a' && c <= 'z'); }


x86 assembly (clang, -O0):
<q_islower>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x61,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jl     1120 <q_islower+0x20>
cmpl   $0x7a,-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):
<q_islower>:
add    $0xffffff9f,%edi
xor    %eax,%eax
cmp    $0x1a,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @q_islower(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 97
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 122
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 @q_islower(i32 %0) {
%2 = add i32 %0, -97
%3 = icmp ult i32 %2, 26
%4 = zext i1 %3 to i32
ret i32 %4
}
OP(ed, eb) {}


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

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

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

LLVM IR (-O2):
define i32 @OP(i32 %0, i32 %1) {
ret i32 undef
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ printf(char *);
int main() {
  printf("Hello, world!\n");
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
call   1030 <printf@plt>
mov    0x2eae(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [15 x i8] c"Hello, world!\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @EXIT_SUCCESS
ret i32 %3
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
@str = [14 x i8] c"Hello, world!\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
%2 = load i32, i32* @EXIT_SUCCESS
ret i32 %2
}
/* Variables and functions */
int SEEK_CUR;
__attribute__((visibility("default"))) int get_seek_cur() { return SEEK_CUR; }


x86 assembly (clang, -O0):
<get_seek_cur>:
push   %rbp
mov    %rsp,%rbp
mov    0x2edd(%rip),%rax
mov    (%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_seek_cur>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%eax
ret

LLVM IR (-O0):
@SEEK_CUR = global i32 0
define i32 @get_seek_cur() {
%1 = load i32, i32* @SEEK_CUR
ret i32 %1
}

LLVM IR (-O2):
@SEEK_CUR = global i32 0
define i32 @get_seek_cur() {
%1 = load i32, i32* @SEEK_CUR
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ UART1_TxChar(char);
int /*<<< orphan*/ UART1_TxEmpty();
int /*<<< orphan*/ taskYIELD();
void Debug_Output(char Byte) {
  while (!UART1_TxEmpty())
    taskYIELD();
  UART1_TxChar(Byte);
}


x86 assembly (clang, -O0):
<Debug_Output>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    $0x0,%al
call   1050 <UART1_TxEmpty@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    115a <Debug_Output+0x2a>
jmp    1166 <Debug_Output+0x36>
mov    $0x0,%al
call   1030 <taskYIELD@plt>
jmp    113e <Debug_Output+0xe>
movsbl -0x1(%rbp),%edi
call   1040 <UART1_TxChar@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Debug_Output>:
push   %rbx
mov    %edi,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
xor    %eax,%eax
call   1050 <UART1_TxEmpty@plt>
test   %eax,%eax
jne    1154 <Debug_Output+0x24>
xor    %eax,%eax
call   1030 <taskYIELD@plt>
jmp    1140 <Debug_Output+0x10>
movsbl %bl,%edi
pop    %rbx
jmp    1040 <UART1_TxChar@plt>

LLVM IR (-O0):
define void @Debug_Output(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
br label %3
3: ; preds = %7, %1
%4 = call i32 (...) @UART1_TxEmpty()
%5 = icmp ne i32 %4, 0
%6 = xor i1 %5, true
br i1 %6, label %7, label %9
7: ; preds = %3
%8 = call i32 (...) @taskYIELD()
br label %3
9: ; preds = %3
%10 = load i8, i8* %2
%11 = call i32 @UART1_TxChar(i8 signext %10)
ret void
}

LLVM IR (-O2):
define void @Debug_Output(i8 signext %0) {
%2 = tail call i32 (...) @UART1_TxEmpty()
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %8
4: ; preds = %1, %4
%5 = tail call i32 (...) @taskYIELD()
%6 = tail call i32 (...) @UART1_TxEmpty()
%7 = icmp eq i32 %6, 0
br i1 %7, label %4, label %8
8: ; preds = %4, %1
%9 = tail call i32 @UART1_TxChar(i8 signext %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, char *);
void httpSetCookie(char name[], char content[]) {
  if (name != NULL && content != NULL) {
    printf("Set-Cookie: %s=%s\n", name, content);
  }
  return;
}


x86 assembly (clang, -O0):
<httpSetCookie>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     114a <httpSetCookie+0x3a>
cmpq   $0x0,-0x10(%rbp)
je     114a <httpSetCookie+0x3a>
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
lea    0xebb(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<httpSetCookie>:
test   %rdi,%rdi
je     112c <httpSetCookie+0x1c>
mov    %rsi,%rdx
test   %rsi,%rsi
je     112c <httpSetCookie+0x1c>
mov    %rdi,%rsi
lea    0xed9(%rip),%rdi
jmp    1030 <printf@plt>
ret

LLVM IR (-O0):
@.str = [19 x i8] c"Set-Cookie: %s=%s\0A\00"
define void @httpSetCookie(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 = icmp ne i8* %5, null
br i1 %6, label %7, label %14
7: ; preds = %2
%8 = load i8*, i8** %4
%9 = icmp ne i8* %8, null
br i1 %9, label %10, label %14
10: ; preds = %7
%11 = load i8*, i8** %3
%12 = load i8*, i8** %4
%13 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* %11, i8* %12)
br label %14
14: ; preds = %10, %7, %2
ret void
}

LLVM IR (-O2):
@.str = [19 x i8] c"Set-Cookie: %s=%s\0A\00"
define void @httpSetCookie(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 %8
6: ; preds = %2
%7 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1)
br label %8
8: ; preds = %6, %2
ret void
}
/* Type definitions */
typedef scalar_t__ wchar_t;

/* Variables and functions */
wchar_t *(rawwmemchr)(const wchar_t *segment, wchar_t c) {
  for (;;)
    if (*segment++ == c)
      return segment - 1;
}


x86 assembly (clang, -O0):
<rawwmemchr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x8(%rbp)
mov    (%rax),%rax
cmp    -0x10(%rbp),%rax
jne    1132 <rawwmemchr+0x32>
mov    -0x8(%rbp),%rax
add    $0xfffffffffffffff8,%rax
pop    %rbp
ret
jmp    110c <rawwmemchr+0xc>

x86 assembly (clang, -O2):
<rawwmemchr>:
mov    %rdi,%rax
add    $0xfffffffffffffff8,%rax
nopw   0x0(%rax,%rax,1)
mov    %rax,%rcx
add    $0x8,%rax
cmp    %rsi,0x8(%rcx)
jne    1110 <rawwmemchr+0x10>
ret

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

LLVM IR (-O2):
define i64* @rawwmemchr(i64* %0, i64 %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i64* [ %0, %2 ], [ %5, %3 ]
%5 = getelementptr inbounds i64, i64* %4, i64 1
%6 = load i64, i64* %4
%7 = icmp eq i64 %6, %1
br i1 %7, label %8, label %3
8: ; preds = %3
ret i64* %4
}
/* Variables and functions */
int /*<<< orphan*/ PressMouse244(unsigned char, unsigned long);
void pressmouse(unsigned char m, unsigned long t) { PressMouse244(m, t); }


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

x86 assembly (clang, -O2):
<pressmouse>:
jmp    1030 <PressMouse244@plt>

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

LLVM IR (-O2):
define void @pressmouse(i8 zeroext %0, i64 %1) {
%3 = tail call i32 @PressMouse244(i8 zeroext %0, i64 %1)
ret void
}
float min(float x, float y) {
  if (x <= y)
    return x;
  else
    return y;
}


x86 assembly (clang, -O0):
<min>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x8(%rbp)
movss  %xmm1,-0xc(%rbp)
movss  -0x8(%rbp),%xmm1
movss  -0xc(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jb     1130 <min+0x30>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    113a <min+0x3a>
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<min>:
movaps %xmm0,%xmm2
cmpless %xmm1,%xmm2
andps  %xmm2,%xmm0
andnps %xmm1,%xmm2
orps   %xmm2,%xmm0
ret

LLVM IR (-O0):
define float @min(float %0, float %1) {
%3 = alloca float
%4 = alloca float
%5 = alloca float
store float %0, float* %4
store float %1, float* %5
%6 = load float, float* %4
%7 = load float, float* %5
%8 = fcmp ole float %6, %7
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = load float, float* %4
store float %10, float* %3
br label %13
11: ; preds = %2
%12 = load float, float* %5
store float %12, float* %3
br label %13
13: ; preds = %11, %9
%14 = load float, float* %3
ret float %14
}

LLVM IR (-O2):
define float @min(float %0, float %1) {
%3 = fcmp ole float %0, %1
%4 = select i1 %3, float %0, float %1
ret float %4
}
int read_keyboard_hardware(unsigned int *key) {
  if (*((volatile unsigned int *)((
          (((((0xf0000000)) + (4 * 1024 * 1024)) + (4 * 1024 * 1024)) +
           (4 * 1024 * 1024)) +
          0))) == 0)
    return -1;
  *key = *(((volatile unsigned int *)((
      (((((0xf0000000)) + (4 * 1024 * 1024)) + (4 * 1024 * 1024)) +
       (4 * 1024 * 1024)) +
      4))));
  return 0;
}


x86 assembly (clang, -O0):
<read_keyboard_hardware>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    $0xf0c00000,%eax
mov    (%rax),%eax
cmp    $0x0,%eax
jne    1124 <read_keyboard_hardware+0x24>
movl   $0xffffffff,-0x4(%rbp)
jmp    1138 <read_keyboard_hardware+0x38>
mov    $0xf0c00004,%eax
mov    (%rax),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_keyboard_hardware>:
mov    $0xf0c00000,%eax
cmpl   $0x0,(%rax)
je     1112 <read_keyboard_hardware+0x12>
mov    0x4(%rax),%eax
mov    %eax,(%rdi)
xor    %eax,%eax
ret
mov    $0xffffffff,%eax
ret

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

LLVM IR (-O2):
define i32 @read_keyboard_hardware(i32* nocapture writeonly %0) {
%2 = load volatile i32, i32* inttoptr (i64 4039114752 to i32*)
%3 = icmp eq i32 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = load volatile i32, i32* inttoptr (i64 4039114756 to i32*)
store i32 %5, i32* %0
br label %6
6: ; preds = %1, %4
%7 = phi i32 [ 0, %4 ], [ -1, %1 ]
ret i32 %7
}
/* Variables and functions */
bool ST16_DIV_OVFCHK(unsigned short a, unsigned short b) {
  return (!b || (a == 0x8000U && b == 0xFFFFU));
}


x86 assembly (clang, -O0):
<ST16_DIV_OVFCHK>:
push   %rbp
mov    %rsp,%rbp
mov    %si,%ax
mov    %di,%cx
mov    %cx,-0x2(%rbp)
mov    %ax,-0x4(%rbp)
mov    $0x1,%al
cmpw   $0x0,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     114c <ST16_DIV_OVFCHK+0x4c>
movzwl -0x2(%rbp),%ecx
xor    %eax,%eax
cmp    $0x8000,%ecx
mov    %al,-0x6(%rbp)
jne    1146 <ST16_DIV_OVFCHK+0x46>
movzwl -0x4(%rbp),%eax
cmp    $0xffff,%eax
sete   %al
mov    %al,-0x6(%rbp)
mov    -0x6(%rbp),%al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ST16_DIV_OVFCHK>:
test   %esi,%esi
sete   %al
xor    $0x8000,%edi
not    %esi
or     %di,%si
sete   %cl
or     %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @ST16_DIV_OVFCHK(i16 zeroext %0, i16 zeroext %1) {
%3 = alloca i16
%4 = alloca i16
store i16 %0, i16* %3
store i16 %1, i16* %4
%5 = load i16, i16* %4
%6 = icmp ne i16 %5, 0
br i1 %6, label %7, label %17
7: ; preds = %2
%8 = load i16, i16* %3
%9 = zext i16 %8 to i32
%10 = icmp eq i32 %9, 32768
br i1 %10, label %11, label %15
11: ; preds = %7
%12 = load i16, i16* %4
%13 = zext i16 %12 to i32
%14 = icmp eq i32 %13, 65535
br label %15
15: ; preds = %11, %7
%16 = phi i1 [ false, %7 ], [ %14, %11 ]
br label %17
17: ; preds = %15, %2
%18 = phi i1 [ true, %2 ], [ %16, %15 ]
%19 = zext i1 %18 to i32
ret i32 %19
}

LLVM IR (-O2):
define i32 @ST16_DIV_OVFCHK(i16 zeroext %0, i16 zeroext %1) {
%3 = icmp eq i16 %1, 0
%4 = icmp eq i16 %0, -32768
%5 = icmp eq i16 %1, -1
%6 = and i1 %4, %5
%7 = or i1 %3, %6
%8 = zext i1 %7 to i32
ret i32 %8
}
double icsi_log_v2(const float val, register float *const pTable,
                   register const unsigned precision) {
  register const int *const pVal = (const int *)(&val);
  register const int exp = ((*pVal >> 23) & 255) - 127;
  register const int man = (*pVal & 0x7FFFFF) >> (23 - precision);
  return ((double)(exp) + pTable[man]) * 0.69314718055995f;
}


x86 assembly (clang, -O0):
<icsi_log_v2>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
lea    -0x4(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    (%rax),%eax
sar    $0x17,%eax
and    $0xff,%eax
sub    $0x7f,%eax
mov    %eax,-0x24(%rbp)
mov    -0x20(%rbp),%rax
mov    (%rax),%eax
and    $0x7fffff,%eax
mov    $0x17,%ecx
sub    -0x14(%rbp),%ecx
sar    %cl,%eax
mov    %eax,-0x28(%rbp)
cvtsi2sdl -0x24(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movslq -0x28(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm1
cvtss2sd %xmm1,%xmm1
addsd  %xmm1,%xmm0
movsd  0xe9a(%rip),%xmm1
mulsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<icsi_log_v2>:
movd   %xmm0,%eax
mov    %eax,%ecx
shr    $0x17,%ecx
movzbl %cl,%edx
and    $0x7fffff,%eax
mov    $0x17,%cl
sub    %sil,%cl
shr    %cl,%eax
add    $0xffffff81,%edx
cvtsi2sd %edx,%xmm1
movss  (%rdi,%rax,4),%xmm0
cvtss2sd %xmm0,%xmm0
addsd  %xmm1,%xmm0
mulsd  0xecc(%rip),%xmm0
ret

LLVM IR (-O0):
define double @icsi_log_v2(float %0, float* %1, i32 %2) {
%4 = alloca float
%5 = alloca float*
%6 = alloca i32
%7 = alloca i32*
%8 = alloca i32
%9 = alloca i32
store float %0, float* %4
store float* %1, float** %5
store i32 %2, i32* %6
%10 = bitcast float* %4 to i32*
store i32* %10, i32** %7
%11 = load i32*, i32** %7
%12 = load i32, i32* %11
%13 = ashr i32 %12, 23
%14 = and i32 %13, 255
%15 = sub nsw i32 %14, 127
store i32 %15, i32* %8
%16 = load i32*, i32** %7
%17 = load i32, i32* %16
%18 = and i32 %17, 8388607
%19 = load i32, i32* %6
%20 = sub i32 23, %19
%21 = ashr i32 %18, %20
store i32 %21, i32* %9
%22 = load i32, i32* %8
%23 = sitofp i32 %22 to double
%24 = load float*, float** %5
%25 = load i32, i32* %9
%26 = sext i32 %25 to i64
%27 = getelementptr inbounds float, float* %24, i64 %26
%28 = load float, float* %27
%29 = fpext float %28 to double
%30 = fadd double %23, %29
%31 = fmul double %30, 0x3FE62E4300000000
ret double %31
}

LLVM IR (-O2):
define double @icsi_log_v2(float %0, float* nocapture %1, i32 %2) {
%4 = bitcast float %0 to i32
%5 = lshr i32 %4, 23
%6 = and i32 %5, 255
%7 = add nsw i32 %6, -127
%8 = and i32 %4, 8388607
%9 = sub i32 23, %2
%10 = lshr i32 %8, %9
%11 = sitofp i32 %7 to double
%12 = zext i32 %10 to i64
%13 = getelementptr inbounds float, float* %1, i64 %12
%14 = load float, float* %13
%15 = fpext float %14 to double
%16 = fadd double %11, %15
%17 = fmul double %16, 0x3FE62E4300000000
ret double %17
}
/* Variables and functions */
double star_polymer_kernel(double, double, double);
double Iq(double q, double radius2, double arms) {
  return star_polymer_kernel(q, radius2, arms);
}


x86 assembly (clang, -O0):
<Iq>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm2
call   1030 <star_polymer_kernel@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Iq>:
jmp    1030 <star_polymer_kernel@plt>

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

LLVM IR (-O2):
define double @Iq(double %0, double %1, double %2) {
%4 = tail call double @star_polymer_kernel(double %0, double %1, double %2)
ret double %4
}
/* Variables and functions */
int strlen_custom(const char *string) {
  if (string == NULL) {
    return 0;
  }
  int length = 0;
  while (string[++length]) {
  }
  return length;
}


x86 assembly (clang, -O0):
<strlen_custom>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    111f <strlen_custom+0x1f>
movl   $0x0,-0x4(%rbp)
jmp    114b <strlen_custom+0x4b>
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%ecx
add    $0x1,%ecx
mov    %ecx,-0x14(%rbp)
movslq %ecx,%rcx
cmpb   $0x0,(%rax,%rcx,1)
je     1145 <strlen_custom+0x45>
jmp    1126 <strlen_custom+0x26>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlen_custom>:
xor    %eax,%eax
test   %rdi,%rdi
je     111b <strlen_custom+0x1b>
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,0x1(%rdi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <strlen_custom+0x10>
ret

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

LLVM IR (-O2):
define i32 @strlen_custom(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %11, label %3
3: ; preds = %1, %3
%4 = phi i64 [ %5, %3 ], [ 0, %1 ]
%5 = add nuw nsw i64 %4, 1
%6 = getelementptr inbounds i8, i8* %0, i64 %5
%7 = load i8, i8* %6
%8 = icmp eq i8 %7, 0
br i1 %8, label %9, label %3
9: ; preds = %3
%10 = trunc i64 %5 to i32
br label %11
11: ; preds = %9, %1
%12 = phi i32 [ 0, %1 ], [ %10, %9 ]
ret i32 %12
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
char const *gcodep_parse_pair_with_linenumber(int, char const *, char *,
                                              float *, int /*<<< orphan*/ *);
const char *gcodep_parse_pair(const char *line, char *letter, float *value,
                              FILE *err_stream) {
  return gcodep_parse_pair_with_linenumber(-1, line, letter, value, err_stream);
}


x86 assembly (clang, -O0):
<gcodep_parse_pair>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    -0x20(%rbp),%r8
mov    $0xffffffff,%edi
call   1030 <gcodep_parse_pair_with_linenumber@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gcodep_parse_pair>:
mov    %rcx,%r8
mov    %rdx,%rcx
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    $0xffffffff,%edi
jmp    1030 <gcodep_parse_pair_with_linenumber@plt>

LLVM IR (-O0):
define i8* @gcodep_parse_pair(i8* %0, i8* %1, float* %2, i32* %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca float*
%8 = alloca i32*
store i8* %0, i8** %5
store i8* %1, i8** %6
store float* %2, float** %7
store i32* %3, i32** %8
%9 = load i8*, i8** %5
%10 = load i8*, i8** %6
%11 = load float*, float** %7
%12 = load i32*, i32** %8
%13 = call i8* @gcodep_parse_pair_with_linenumber(i32 -1, i8* %9, i8* %10, float* %11, i32* %12)
ret i8* %13
}

LLVM IR (-O2):
define i8* @gcodep_parse_pair(i8* %0, i8* %1, float* %2, i32* %3) {
%5 = tail call i8* @gcodep_parse_pair_with_linenumber(i32 -1, i8* %0, i8* %1, float* %2, i32* %3)
ret i8* %5
}
/* Variables and functions */
double ts_urand();
double ts_frand(void) {
  double d = ts_urand();
  d /= (0xffffffffU + 1.0);
  return d;
}


x86 assembly (clang, -O0):
<ts_frand>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <ts_urand@plt>
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xecf(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ts_frand>:
push   %rax
xor    %eax,%eax
call   1030 <ts_urand@plt>
mulsd  0xee0(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @ts_frand() {
%1 = alloca double
%2 = call double (...) @ts_urand()
store double %2, double* %1
%3 = load double, double* %1
%4 = fdiv double %3, 0x41F0000000000000
store double %4, double* %1
%5 = load double, double* %1
ret double %5
}

LLVM IR (-O2):
define double @ts_frand() {
%1 = tail call double (...) @ts_urand()
%2 = fmul double %1, 0x3DF0000000000000
ret double %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int number, final, digit = 2;
  int countdigit(int n, int d);
  printf("Enter an integer: ");
  scanf("%d", &number);
  final = countdigit(number, 2);
  printf("Number of digit %d: %d", digit, final);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x2,-0x10(%rbp)
lea    0xeb3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xecc(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x8(%rbp),%edi
mov    $0x2,%esi
call   1040 <countdigit@plt>
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    0xe92(%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    0xec8(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xee1(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
mov    0x4(%rsp),%edi
mov    $0x2,%esi
call   1040 <countdigit@plt>
lea    0xeae(%rip),%rdi
mov    $0x2,%esi
mov    %eax,%edx
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [19 x i8] c"Enter an integer: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [23 x i8] c"Number of digit %d: %d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
store i32 2, i32* %4
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%7 = load i32, i32* %2
%8 = call i32 @countdigit(i32 %7, i32 2)
store i32 %8, i32* %3
%9 = load i32, i32* %4
%10 = load i32, i32* %3
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0), i32 %9, i32 %10)
ret i32 0
}

LLVM IR (-O2):
@.str = [19 x i8] c"Enter an integer: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [23 x i8] c"Number of digit %d: %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 ([19 x i8], [19 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 = call i32 @countdigit(i32 %5, i32 2)
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0), i32 2, i32 %6)
ret i32 0
}
int grid_encode_space(int area) {
  int t, count;
  for (count = 1, t = area; t > 26; t -= 26)
    count++;
  return count * area;
}


x86 assembly (clang, -O0):
<grid_encode_space>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x1,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x1a,-0x8(%rbp)
jle    1135 <grid_encode_space+0x35>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
sub    $0x1a,%eax
mov    %eax,-0x8(%rbp)
jmp    1114 <grid_encode_space+0x14>
mov    -0xc(%rbp),%eax
imul   -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<grid_encode_space>:
mov    $0x1,%eax
cmp    $0x1b,%edi
jl     112a <grid_encode_space+0x2a>
cmp    $0x34,%edi
mov    $0x34,%eax
cmovl  %edi,%eax
neg    %eax
add    %edi,%eax
add    $0x19,%eax
imul   $0x4ec4ec4f,%rax,%rax
shr    $0x23,%rax
add    $0x2,%eax
imul   %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @grid_encode_space(i32 %0) {
%2 = icmp sgt i32 %0, 26
br i1 %2, label %3, label %9
3: ; preds = %1
%4 = add nuw i32 %0, 25
%5 = call i32 @llvm.smin.i32(i32 %0, i32 52)
%6 = sub nuw i32 %4, %5
%7 = udiv i32 %6, 26
%8 = add nuw nsw i32 %7, 2
br label %9
9: ; preds = %3, %1
%10 = phi i32 [ 1, %1 ], [ %8, %3 ]
%11 = mul nsw i32 %10, %0
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ ps();
int main() {
  ps();
  return 0;
}


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

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

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

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


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

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

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

LLVM IR (-O2):
define void @XStoreName() {
ret void
}
/* Variables and functions */
char readc(char *);
int ppp_up_mul(void) { return readc("/etc/ppp/pppoe1-status") == '1'; }


x86 assembly (clang, -O0):
<ppp_up_mul>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <readc@plt>
movsbl %al,%eax
cmp    $0x31,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ppp_up_mul>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <readc@plt>
xor    %ecx,%ecx
cmp    $0x31,%al
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [23 x i8] c"/etc/ppp/pppoe1-status\00"
define i32 @ppp_up_mul() {
%1 = call signext i8 @readc(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%2 = sext i8 %1 to i32
%3 = icmp eq i32 %2, 49
%4 = zext i1 %3 to i32
ret i32 %4
}

LLVM IR (-O2):
@.str = [23 x i8] c"/etc/ppp/pppoe1-status\00"
define i32 @ppp_up_mul() {
%1 = tail call signext i8 @readc(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%2 = icmp eq i8 %1, 49
%3 = zext i1 %2 to i32
ret i32 %3
}
unsigned long daapGetShort(const char **d) {
  const char *p = *d;
  unsigned long a = 0;
  a = *p++ << 8;
  a |= *p++;
  *d = p;
  return a;
}


x86 assembly (clang, -O0):
<daapGetShort>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movsbl (%rax),%eax
shl    $0x8,%eax
cltq
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movsbq (%rax),%rax
or     -0x18(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<daapGetShort>:
mov    (%rdi),%rcx
movsbq (%rcx),%rdx
shl    $0x8,%rdx
movsbq 0x1(%rcx),%rax
add    $0x2,%rcx
or     %rdx,%rax
mov    %rcx,(%rdi)
ret

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

LLVM IR (-O2):
define i64 @daapGetShort(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = getelementptr inbounds i8, i8* %2, i64 1
%4 = load i8, i8* %2
%5 = sext i8 %4 to i32
%6 = shl nsw i32 %5, 8
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds i8, i8* %2, i64 2
%9 = load i8, i8* %3
%10 = sext i8 %9 to i64
%11 = or i64 %7, %10
store i8* %8, i8** %0
ret i64 %11
}
void RandomFunc(unsigned long input[1], unsigned long output[1]) {
  unsigned long state[1];
  unsigned long local1;
  {
    state[0UL] = input[0UL] + 1373777115UL;
    local1 = 0UL;
    while (local1 < 0UL) {
      local1++;
    }
    output[0UL] = ((state[0UL] >> 13UL) | (state[0UL] << 51UL)) * 269947149UL;
  }
}


x86 assembly (clang, -O0):
<RandomFunc>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
add    $0x51e22cdb,%rax
mov    %rax,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jae    1141 <RandomFunc+0x41>
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    1125 <RandomFunc+0x25>
mov    -0x18(%rbp),%rax
shr    $0xd,%rax
mov    -0x18(%rbp),%rcx
shl    $0x33,%rcx
or     %rcx,%rax
imul   $0x1017110d,%rax,%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<RandomFunc>:
mov    $0x51e22cdb,%eax
add    (%rdi),%rax
rol    $0x33,%rax
imul   $0x1017110d,%rax,%rax
mov    %rax,(%rsi)
ret

LLVM IR (-O0):
define void @RandomFunc(i64* %0, i64* %1) {
%3 = alloca i64*
%4 = alloca i64*
%5 = alloca [1 x i64]
%6 = alloca i64
store i64* %0, i64** %3
store i64* %1, i64** %4
%7 = load i64*, i64** %3
%8 = getelementptr inbounds i64, i64* %7, i64 0
%9 = load i64, i64* %8
%10 = add i64 %9, 1373777115
%11 = getelementptr inbounds [1 x i64], [1 x i64]* %5, i64 0, i64 0
store i64 %10, i64* %11
store i64 0, i64* %6
br label %12
12: ; preds = %15, %2
%13 = load i64, i64* %6
%14 = icmp ult i64 %13, 0
br i1 %14, label %15, label %18
15: ; preds = %12
%16 = load i64, i64* %6
%17 = add i64 %16, 1
store i64 %17, i64* %6
br label %12
18: ; preds = %12
%19 = getelementptr inbounds [1 x i64], [1 x i64]* %5, i64 0, i64 0
%20 = load i64, i64* %19
%21 = lshr i64 %20, 13
%22 = getelementptr inbounds [1 x i64], [1 x i64]* %5, i64 0, i64 0
%23 = load i64, i64* %22
%24 = shl i64 %23, 51
%25 = or i64 %21, %24
%26 = mul i64 %25, 269947149
%27 = load i64*, i64** %4
%28 = getelementptr inbounds i64, i64* %27, i64 0
store i64 %26, i64* %28
ret void
}

LLVM IR (-O2):
define void @RandomFunc(i64* nocapture %0, i64* nocapture writeonly %1) {
%3 = load i64, i64* %0
%4 = add i64 %3, 1373777115
%5 = tail call i64 @llvm.fshl.i64(i64 %4, i64 %4, i64 51)
%6 = mul i64 %5, 269947149
store i64 %6, i64* %1
ret void
}
void __div0(void) {
  while (1) {
  }
}


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

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

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

LLVM IR (-O2):
define void @__div0() {
br label %1
1: ; preds = %0, %1
br label %1
}
/* Type definitions */
struct rlimit {
  int dummy;
};
typedef enum __rlimit_resource {
  ____Placeholder___rlimit_resource
} __rlimit_resource;
typedef int /*<<< orphan*/ __pid_t;

/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ __set_errno(int /*<<< orphan*/);
int prlimit(__pid_t pid, enum __rlimit_resource resource,
            const struct rlimit *new_rlimit, struct rlimit *old_rlimit) {
  __set_errno(ENOSYS);
  return -1;
}


x86 assembly (clang, -O0):
<prlimit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    0x2ebb(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
mov    $0xffffffff,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<prlimit>:
push   %rax
mov    0x2ed0(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.rlimit = type { i32 }
@ENOSYS = global i32 0
define i32 @prlimit(i32 %0, i32 %1, %struct.rlimit* %2, %struct.rlimit* %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca %struct.rlimit*
%8 = alloca %struct.rlimit*
store i32 %0, i32* %5
store i32 %1, i32* %6
store %struct.rlimit* %2, %struct.rlimit** %7
store %struct.rlimit* %3, %struct.rlimit** %8
%9 = load i32, i32* @ENOSYS
%10 = call i32 @__set_errno(i32 %9)
ret i32 -1
}

LLVM IR (-O2):
%struct.rlimit = type { i32 }
@ENOSYS = global i32 0
define i32 @prlimit(i32 %0, i32 %1, %struct.rlimit* nocapture readnone %2, %struct.rlimit* nocapture readnone %3) {
%5 = load i32, i32* @ENOSYS
%6 = tail call i32 @__set_errno(i32 %5)
ret i32 -1
}
double bar_double(void) { return creal(foo_double(2.0 - 2.5i)); }


x86 assembly (clang, -O0):
<bar_double>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  0xee8(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  0xed3(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm1
mov    $0x2,%al
call   1030 <foo_double@plt>
cvtsi2sd %eax,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bar_double>:
push   %rax
movsd  0xee7(%rip),%xmm0
movsd  0xee7(%rip),%xmm1
mov    $0x2,%al
call   1030 <foo_double@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @bar_double() {
%1 = alloca { double, double }
%2 = getelementptr inbounds { double, double }, { double, double }* %1, i32 0, i32 0
%3 = getelementptr inbounds { double, double }, { double, double }* %1, i32 0, i32 1
store double 2.000000e+00, double* %2
store double -2.500000e+00, double* %3
%4 = getelementptr inbounds { double, double }, { double, double }* %1, i32 0, i32 0
%5 = load double, double* %4
%6 = getelementptr inbounds { double, double }, { double, double }* %1, i32 0, i32 1
%7 = load double, double* %6
%8 = call i32 (double, double, ...) bitcast (i32 (...)* @foo_double to i32 (double, double, ...)*)(double %5, double %7)
%9 = sitofp i32 %8 to double
ret double %9
}

LLVM IR (-O2):
define double @bar_double() {
%1 = tail call i32 (double, double, ...) bitcast (i32 (...)* @foo_double to i32 (double, double, ...)*)(double 2.000000e+00, double -2.500000e+00)
%2 = sitofp i32 %1 to double
ret double %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void displayAge(int anAge) { printf("Wow, %i is really old\n", anAge); }


x86 assembly (clang, -O0):
<displayAge>:
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):
<displayAge>:
mov    %edi,%esi
lea    0xee7(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [23 x i8] c"Wow, %i is really old\0A\00"
define void @displayAge(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
int absoluteSquared8Dot24(int value) {
  int word2;
  int word1;
  word1 = value & 65535;
  word2 = (((unsigned)value >> 16)) & 255;
  return ((unsigned)(((((unsigned)(((unsigned)(word1 * word1))) >> 16)) +
                      ((word1 * word2) * 2)) +
                     (((unsigned)(word2 * word2) << 16))) >>
          8);
}


x86 assembly (clang, -O0):
<absoluteSquared8Dot24>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xffff,%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x10,%eax
and    $0xff,%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
imul   -0xc(%rbp),%eax
shr    $0x10,%eax
mov    -0xc(%rbp),%ecx
imul   -0x8(%rbp),%ecx
shl    $0x1,%ecx
add    %ecx,%eax
mov    -0x8(%rbp),%ecx
imul   -0x8(%rbp),%ecx
shl    $0x10,%ecx
add    %ecx,%eax
shr    $0x8,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<absoluteSquared8Dot24>:
movzwl %di,%ecx
shr    $0x10,%edi
movzbl %dil,%edx
mov    %edx,%eax
shl    $0x10,%eax
lea    (%rax,%rcx,2),%eax
imul   %ecx,%ecx
shr    $0x10,%ecx
imul   %edx,%eax
add    %ecx,%eax
shr    $0x8,%eax
ret

LLVM IR (-O0):
define i32 @absoluteSquared8Dot24(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
%5 = load i32, i32* %2
%6 = and i32 %5, 65535
store i32 %6, i32* %4
%7 = load i32, i32* %2
%8 = lshr i32 %7, 16
%9 = and i32 %8, 255
store i32 %9, i32* %3
%10 = load i32, i32* %4
%11 = load i32, i32* %4
%12 = mul nsw i32 %10, %11
%13 = lshr i32 %12, 16
%14 = load i32, i32* %4
%15 = load i32, i32* %3
%16 = mul nsw i32 %14, %15
%17 = mul nsw i32 %16, 2
%18 = add i32 %13, %17
%19 = load i32, i32* %3
%20 = load i32, i32* %3
%21 = mul nsw i32 %19, %20
%22 = shl i32 %21, 16
%23 = add i32 %18, %22
%24 = lshr i32 %23, 8
ret i32 %24
}

LLVM IR (-O2):
define i32 @absoluteSquared8Dot24(i32 %0) {
%2 = and i32 %0, 65535
%3 = lshr i32 %0, 16
%4 = and i32 %3, 255
%5 = mul nuw nsw i32 %2, %2
%6 = lshr i32 %5, 16
%7 = shl nuw nsw i32 %2, 1
%8 = shl nuw nsw i32 %4, 16
%9 = add nuw nsw i32 %8, %7
%10 = mul nuw i32 %9, %4
%11 = add nuw i32 %10, %6
%12 = lshr i32 %11, 8
ret i32 %12
}