xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ get_piece(int, int, int **);
scalar_t__ get_piece_color(int /*<<< orphan*/);
int is_square_empty(int x, int y, int **board) {
  if (get_piece_color(get_piece(x, y, board)) == 0) {
    return 1;
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<is_square_empty>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
call   1030 <get_piece@plt>
mov    %eax,%edi
call   1040 <get_piece_color@plt>
cmp    $0x0,%rax
jne    115e <is_square_empty+0x3e>
movl   $0x1,-0x4(%rbp)
jmp    1165 <is_square_empty+0x45>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_square_empty>:
push   %rax
call   1030 <get_piece@plt>
mov    %eax,%edi
call   1040 <get_piece_color@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @is_square_empty(i32 %0, i32 %1, i32** %2) {
%4 = tail call i32 @get_piece(i32 %0, i32 %1, i32** %2)
%5 = tail call i64 @get_piece_color(i32 %4)
%6 = icmp eq i64 %5, 0
%7 = zext i1 %6 to i32
ret i32 %7
}
/* Type definitions */
typedef scalar_t__ int64_t;

/* Variables and functions */
scalar_t__ roundf(float const);
void round_l_s(const float *source, int64_t *dest) {
  *dest = (int64_t)roundf(*source);
}


x86 assembly (clang, -O0):
<round_l_s>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm0
call   1030 <roundf@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<round_l_s>:
push   %rbx
mov    %rsi,%rbx
movss  (%rdi),%xmm0
call   1030 <roundf@plt>
mov    %rax,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @round_l_s(float* %0, i64* %1) {
%3 = alloca float*
%4 = alloca i64*
store float* %0, float** %3
store i64* %1, i64** %4
%5 = load float*, float** %3
%6 = load float, float* %5
%7 = call i64 @roundf(float %6)
%8 = load i64*, i64** %4
store i64 %7, i64* %8
ret void
}

LLVM IR (-O2):
define void @round_l_s(float* nocapture %0, i64* nocapture writeonly %1) {
%3 = load float, float* %0
%4 = tail call i64 @roundf(float %3)
store i64 %4, i64* %1
ret void
}
int strtol(const char *number, long *result) { unsigned long n; }


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

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

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

LLVM IR (-O2):
define i32 @strtol(i8* nocapture readnone %0, i64* nocapture readnone %1) {
ret i32 undef
}
int test_imm_31uint8_reg(unsigned char val) {
  return ((val) & (-0x31 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_31uint8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%edx
and    $0xffffffcf,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_31uint8_reg(i8 zeroext %0) {
%2 = and i8 %0, -49
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
bool smpte_fec_check_d(const uint8_t *p_fec) { return !!(p_fec[12] & 0x40); }


x86 assembly (clang, -O0):
<smpte_fec_check_d>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x30(%rax),%eax
and    $0x40,%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<smpte_fec_check_d>:
mov    0x30(%rdi),%eax
shr    $0x6,%eax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @smpte_fec_check_d(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 12
%5 = load i32, i32* %4
%6 = and i32 %5, 64
%7 = icmp ne i32 %6, 0
%8 = xor i1 %7, true
%9 = xor i1 %8, true
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @smpte_fec_check_d(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 12
%3 = load i32, i32* %2
%4 = lshr i32 %3, 6
%5 = and i32 %4, 1
ret i32 %5
}
int test_imm_F7uint64_lowword_reg(unsigned long long val) {
  return ((val) & (0xF7 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_F7uint64_lowword_reg(i64 %0) {
%2 = and i64 %0, 247
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
void FloatSwap(float *one, float *two) {
  float temp = *one;
  *one = *two;
  *two = temp;
}


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

x86 assembly (clang, -O2):
<FloatSwap>:
movss  (%rdi),%xmm0
movss  (%rsi),%xmm1
movss  %xmm1,(%rdi)
movss  %xmm0,(%rsi)
ret

LLVM IR (-O0):
define void @FloatSwap(float* %0, float* %1) {
%3 = alloca float*
%4 = alloca float*
%5 = alloca float
store float* %0, float** %3
store float* %1, float** %4
%6 = load float*, float** %3
%7 = load float, float* %6
store float %7, float* %5
%8 = load float*, float** %4
%9 = load float, float* %8
%10 = load float*, float** %3
store float %9, float* %10
%11 = load float, float* %5
%12 = load float*, float** %4
store float %11, float* %12
ret void
}

LLVM IR (-O2):
define void @FloatSwap(float* nocapture %0, float* nocapture %1) {
%3 = load float, float* %0
%4 = load float, float* %1
store float %4, float* %0
store float %3, float* %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ devideNum(int *, int, int, int);
int /*<<< orphan*/ printArr(int *, int);
void devide(int *arr, int len, int remain, int thr) {
  arr[remain] = thr;
  remain -= thr;
  if (!remain) {
    printArr(arr, len);
    return;
  }
  devideNum(arr, len, remain, thr);
}


x86 assembly (clang, -O0):
<devide>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    -0x14(%rbp),%edx
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x14(%rbp),%ecx
mov    -0x10(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
jne    1169 <devide+0x49>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <printArr@plt>
jmp    117b <devide+0x5b>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x14(%rbp),%ecx
call   1040 <devideNum@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<devide>:
movslq %edx,%rdx
mov    %ecx,(%rdi,%rdx,4)
sub    %ecx,%edx
je     112f <devide+0xf>
jmp    1040 <devideNum@plt>
jmp    1030 <printArr@plt>

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

LLVM IR (-O2):
define void @devide(i32* %0, i32 %1, i32 %2, i32 %3) {
%5 = sext i32 %2 to i64
%6 = getelementptr inbounds i32, i32* %0, i64 %5
store i32 %3, i32* %6
%7 = sub nsw i32 %2, %3
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %4
%10 = tail call i32 @printArr(i32* %0, i32 %1)
br label %13
11: ; preds = %4
%12 = tail call i32 @devideNum(i32* %0, i32 %1, i32 %7, i32 %3)
br label %13
13: ; preds = %11, %9
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
char *lsm_process_label_get(pid_t pid) { return NULL; }


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

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

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

LLVM IR (-O2):
define noalias i8* @lsm_process_label_get(i32 %0) {
ret i8* null
}
int bigger(int a, int b) {
  if (a > b)
    return a;
  else if (a < b)
    return b;
  else
    return a;
}


x86 assembly (clang, -O0):
<bigger>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    1121 <bigger+0x21>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    113e <bigger+0x3e>
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1138 <bigger+0x38>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    113e <bigger+0x3e>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bigger>:
mov    %esi,%eax
cmp    %esi,%edi
cmovge %edi,%eax
cmovg  %edi,%eax
ret

LLVM IR (-O0):
define i32 @bigger(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* %4
%7 = load i32, i32* %5
%8 = icmp sgt i32 %6, %7
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = load i32, i32* %4
store i32 %10, i32* %3
br label %19
11: ; preds = %2
%12 = load i32, i32* %4
%13 = load i32, i32* %5
%14 = icmp slt i32 %12, %13
br i1 %14, label %15, label %17
15: ; preds = %11
%16 = load i32, i32* %5
store i32 %16, i32* %3
br label %19
17: ; preds = %11
%18 = load i32, i32* %4
store i32 %18, i32* %3
br label %19
19: ; preds = %17, %15, %9
%20 = load i32, i32* %3
ret i32 %20
}

LLVM IR (-O2):
define i32 @bigger(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = icmp slt i32 %0, %1
%5 = select i1 %4, i32 %1, i32 %0
%6 = select i1 %3, i32 %0, i32 %5
ret i32 %6
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, ...);
void header(FILE *fp, char *content_type) {
  fprintf(fp, "HTTP/1.0 200 OK\r\n");
  if (content_type)
    fprintf(fp, "Content-type: %s\r\n", content_type);
}


x86 assembly (clang, -O0):
<header>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xed5(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
cmpq   $0x0,-0x10(%rbp)
je     1153 <header+0x43>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
lea    0xec6(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<header>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
lea    0xecf(%rip),%rdi
mov    $0x11,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1040 <fwrite@plt>
test   %r14,%r14
je     1163 <header+0x43>
lea    0xec3(%rip),%rsi
mov    %rbx,%rdi
mov    %r14,%rdx
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <fprintf@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [18 x i8] c"HTTP/1.0 200 OK\0D\0A\00"
@.str.1 = [19 x i8] c"Content-type: %s\0D\0A\00"
define void @header(i32* %0, i8* %1) {
%3 = alloca i32*
%4 = alloca i8*
store i32* %0, i32** %3
store i8* %1, i8** %4
%5 = load i32*, i32** %3
%6 = call i32 (i32*, i8*, ...) @fprintf(i32* %5, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%7 = load i8*, i8** %4
%8 = icmp ne i8* %7, null
br i1 %8, label %9, label %13
9: ; preds = %2
%10 = load i32*, i32** %3
%11 = load i8*, i8** %4
%12 = call i32 (i32*, i8*, ...) @fprintf(i32* %10, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), i8* %11)
br label %13
13: ; preds = %9, %2
ret void
}

LLVM IR (-O2):
@.str = [18 x i8] c"HTTP/1.0 200 OK\0D\0A\00"
@.str.1 = [19 x i8] c"Content-type: %s\0D\0A\00"
define void @header(i32* nocapture %0, i8* %1) {
%3 = tail call i64 @fwrite(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i64 17, i64 1, i32* %0)
%4 = icmp eq i8* %1, null
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %0, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), i8* %1)
br label %7
7: ; preds = %5, %2
ret void
}
/* Variables and functions */
scalar_t__ isalnum(int);
int blank_line(char *line) {
  while (*line != '\0') {
    if (isalnum((int)*line))
      return 0;
    ++line;
  }
  return 1;
}


x86 assembly (clang, -O0):
<blank_line>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     115f <blank_line+0x4f>
mov    -0x10(%rbp),%rax
movsbl (%rax),%edi
call   1030 <isalnum@plt>
cmp    $0x0,%rax
je     114e <blank_line+0x3e>
movl   $0x0,-0x4(%rbp)
jmp    1166 <blank_line+0x56>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    111c <blank_line+0xc>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<blank_line>:
push   %rbp
push   %rbx
push   %rax
mov    (%rdi),%al
mov    $0x1,%ebp
test   %al,%al
je     114c <blank_line+0x3c>
mov    %rdi,%rbx
add    $0x1,%rbx
cs nopw 0x0(%rax,%rax,1)
nop
movsbl %al,%edi
call   1030 <isalnum@plt>
test   %rax,%rax
jne    114a <blank_line+0x3a>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1130 <blank_line+0x20>
jmp    114c <blank_line+0x3c>
xor    %ebp,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @blank_line(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %14, label %7
4: ; preds = %7
%5 = load i8, i8* %13
%6 = icmp eq i8 %5, 0
br i1 %6, label %14, label %7
7: ; preds = %1, %4
%8 = phi i8 [ %5, %4 ], [ %2, %1 ]
%9 = phi i8* [ %13, %4 ], [ %0, %1 ]
%10 = sext i8 %8 to i32
%11 = tail call i64 @isalnum(i32 %10)
%12 = icmp eq i64 %11, 0
%13 = getelementptr inbounds i8, i8* %9, i64 1
br i1 %12, label %4, label %14
14: ; preds = %7, %4, %1
%15 = phi i32 [ 1, %1 ], [ 1, %4 ], [ 0, %7 ]
ret i32 %15
}
is_op(c) char c;
{
  if (any(c, "+-*/&%|^"))
    return (1);
  return (0);
}


x86 assembly (clang, -O0):
<is_op>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%edi
lea    0xed7(%rip),%rsi
mov    $0x0,%al
call   1030 <any@plt>
cmp    $0x0,%eax
je     1145 <is_op+0x35>
movl   $0x1,-0x4(%rbp)
jmp    114c <is_op+0x3c>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_op>:
push   %rax
movsbl %dil,%edi
lea    0xee4(%rip),%rsi
xor    %eax,%eax
call   1030 <any@plt>
xor    %ecx,%ecx
test   %eax,%eax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [9 x i8] c"+-*/&%|^\00"
define i32 @is_op(i32 %0) {
%2 = alloca i32
%3 = alloca i8
%4 = trunc i32 %0 to i8
store i8 %4, i8* %3
%5 = load i8, i8* %3
%6 = sext i8 %5 to i32
%7 = call i32 (i32, i8*, ...) bitcast (i32 (...)* @any to i32 (i32, i8*, ...)*)(i32 %6, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %10
9: ; preds = %1
store i32 1, i32* %2
br label %11
10: ; preds = %1
store i32 0, i32* %2
br label %11
11: ; preds = %10, %9
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
@.str = [9 x i8] c"+-*/&%|^\00"
define i32 @is_op(i32 %0) {
%2 = shl i32 %0, 24
%3 = ashr exact i32 %2, 24
%4 = tail call i32 (i32, i8*, ...) bitcast (i32 (...)* @any to i32 (i32, i8*, ...)*)(i32 %3, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%5 = icmp ne i32 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
double floor(double);
double wrap_into(double x, double period) {
  return x - period * floor(x / period);
}


x86 assembly (clang, -O0):
<wrap_into>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
divsd  -0x10(%rbp),%xmm0
call   1030 <floor@plt>
movsd  -0x20(%rbp),%xmm1
movaps %xmm0,%xmm2
movsd  -0x18(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wrap_into>:
sub    $0x18,%rsp
movsd  %xmm1,0x8(%rsp)
movsd  %xmm0,0x10(%rsp)
divsd  %xmm1,%xmm0
call   1030 <floor@plt>
mulsd  0x8(%rsp),%xmm0
movsd  0x10(%rsp),%xmm1
subsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @wrap_into(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = load double, double* %3
%8 = load double, double* %4
%9 = fdiv double %7, %8
%10 = call double @llvm.floor.f64(double %9)
%11 = fneg double %6
%12 = call double @llvm.fmuladd.f64(double %11, double %10, double %5)
ret double %12
}

LLVM IR (-O2):
define double @wrap_into(double %0, double %1) {
%3 = fdiv double %0, %1
%4 = tail call double @llvm.floor.f64(double %3)
%5 = fneg double %1
%6 = tail call double @llvm.fmuladd.f64(double %5, double %4, double %0)
ret double %6
}
void test_arguments(void) { printf("\nStarting test %s():%d\n", __func__, 26); }


x86 assembly (clang, -O0):
<test_arguments>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
lea    0xef6(%rip),%rsi
mov    $0x1a,%edx
mov    $0x0,%al
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_arguments>:
lea    0xee9(%rip),%rdi
lea    0xefa(%rip),%rsi
mov    $0x1a,%edx
xor    %eax,%eax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [24 x i8] c"\0AStarting test %s():%d\0A\00"
@__func__.test_arguments = [15 x i8] c"test_arguments\00"
define void @test_arguments() {
%1 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @__func__.test_arguments, i64 0, i64 0), i32 26)
ret void
}

LLVM IR (-O2):
@.str = [24 x i8] c"\0AStarting test %s():%d\0A\00"
@__func__.test_arguments = [15 x i8] c"test_arguments\00"
define void @test_arguments() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @__func__.test_arguments, i64 0, i64 0), i32 26)
ret void
}
/* Variables and functions */
int cos(double);
int sin(double);
int yuiTurnY(int x, int y, double r) { return y * cos(r) - x * sin(r); }


x86 assembly (clang, -O0):
<yuiTurnY>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x1c(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1040 <cos@plt>
mov    %eax,%ecx
mov    -0x1c(%rbp),%eax
imul   %ecx,%eax
mov    %eax,-0x14(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1030 <sin@plt>
mov    -0x18(%rbp),%ecx
mov    %eax,%edx
mov    -0x14(%rbp),%eax
imul   %edx,%ecx
sub    %ecx,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<yuiTurnY>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
movsd  %xmm0,0x8(%rsp)
mov    %esi,%ebx
mov    %edi,%r14d
call   1040 <cos@plt>
mov    %eax,%ebp
imul   %ebx,%ebp
movsd  0x8(%rsp),%xmm0
call   1030 <sin@plt>
imul   %r14d,%eax
sub    %eax,%ebp
mov    %ebp,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @yuiTurnY(i32 %0, i32 %1, double %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca double
store i32 %0, i32* %4
store i32 %1, i32* %5
store double %2, double* %6
%7 = load i32, i32* %5
%8 = load double, double* %6
%9 = call i32 @cos(double %8)
%10 = mul nsw i32 %7, %9
%11 = load i32, i32* %4
%12 = load double, double* %6
%13 = call i32 @sin(double %12)
%14 = mul nsw i32 %11, %13
%15 = sub nsw i32 %10, %14
ret i32 %15
}

LLVM IR (-O2):
define i32 @yuiTurnY(i32 %0, i32 %1, double %2) {
%4 = tail call i32 @cos(double %2)
%5 = mul nsw i32 %4, %1
%6 = tail call i32 @sin(double %2)
%7 = mul nsw i32 %6, %0
%8 = sub nsw i32 %5, %7
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ expand(char *, char *);
int /*<<< orphan*/ printf(char *, char *);
int main() {
  char s1[10] = "a-z0-9";
  char s2[100];
  expand(s1, s2);
  printf("%s\n", s2);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xec7(%rip),%rax
mov    %rax,-0xe(%rbp)
mov    0xec4(%rip),%ax
mov    %ax,-0x6(%rbp)
lea    -0xe(%rbp),%rdi
lea    -0x80(%rbp),%rsi
call   1040 <expand@plt>
lea    -0x80(%rbp),%rsi
lea    0xeaa(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x80,%rsp
movabs $0x392d307a2d61,%rax
mov    %rax,(%rsp)
movw   $0x0,0x8(%rsp)
mov    %rsp,%rdi
lea    0x10(%rsp),%rbx
mov    %rbx,%rsi
call   1040 <expand@plt>
lea    0xeb6(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x80,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.s1 = [10 x i8] c"a-z0-9\00\00\00\00"
@.str = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [10 x i8]
%3 = alloca [100 x i8]
store i32 0, i32* %1
%4 = bitcast [10 x i8]* %2 to i8*
%5 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%6 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%7 = call i32 @expand(i8* %5, i8* %6)
%8 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%9 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %8)
ret i32 0
}

LLVM IR (-O2):
@__const.main.s1 = [10 x i8] c"a-z0-9\00\00\00\00"
@.str = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca [10 x i8]
%2 = alloca [100 x i8]
%3 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%5 = call i32 @expand(i8* %3, i8* %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %4)
ret i32 0
}
/* Type definitions */
struct server_list {
  int dummy;
};
struct server {
  int dummy;
};
struct genlist {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ genlist_prepend(struct genlist *, struct server *);
void server_list_prepend(struct server_list *tthis, struct server *pfoo) {
  genlist_prepend(((struct genlist *)(tthis)), pfoo);
}


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

x86 assembly (clang, -O2):
<server_list_prepend>:
jmp    1030 <genlist_prepend@plt>

LLVM IR (-O0):
%struct.server_list = type { i32 }
%struct.server = type { i32 }
%struct.genlist = type { i32 }
define void @server_list_prepend(%struct.server_list* %0, %struct.server* %1) {
%3 = alloca %struct.server_list*
%4 = alloca %struct.server*
store %struct.server_list* %0, %struct.server_list** %3
store %struct.server* %1, %struct.server** %4
%5 = load %struct.server_list*, %struct.server_list** %3
%6 = bitcast %struct.server_list* %5 to %struct.genlist*
%7 = load %struct.server*, %struct.server** %4
%8 = call i32 @genlist_prepend(%struct.genlist* %6, %struct.server* %7)
ret void
}

LLVM IR (-O2):
%struct.server_list = type { i32 }
%struct.server = type { i32 }
%struct.genlist = type { i32 }
define void @server_list_prepend(%struct.server_list* %0, %struct.server* %1) {
%3 = bitcast %struct.server_list* %0 to %struct.genlist*
%4 = tail call i32 @genlist_prepend(%struct.genlist* %3, %struct.server* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ reverseString(char *);
int main(int argc, char **argv) {
  reverseString(argv[1]);
  return 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    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1030 <reverseString@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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 i8**, i8*** %5
%7 = getelementptr inbounds i8*, i8** %6, i64 1
%8 = load i8*, i8** %7
%9 = call i32 @reverseString(i8* %8)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = load i8*, i8** %3
%5 = tail call i32 @reverseString(i8* %4)
ret i32 0
}
/* Type definitions */
struct castable {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ fatal_error(char *);
void *try_cast(struct castable *, char const *);
void *cast(struct castable *castable, const char *type_name) {
  void *result = try_cast(castable, type_name);
  if (castable == NULL)
    fatal_error("Invalid cast.");
  return result;
}


x86 assembly (clang, -O0):
<cast>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <try_cast@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1158 <cast+0x38>
lea    0xead(%rip),%rdi
call   1040 <fatal_error@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cast>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1030 <try_cast@plt>
mov    %rax,%r14
test   %rbx,%rbx
jne    1140 <cast+0x20>
lea    0xec5(%rip),%rdi
call   1040 <fatal_error@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
%struct.castable = type { i32 }
@.str = [14 x i8] c"Invalid cast.\00"
define i8* @cast(%struct.castable* %0, i8* %1) {
%3 = tail call i8* @try_cast(%struct.castable* %0, i8* %1)
%4 = icmp eq %struct.castable* %0, null
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @fatal_error(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %2
ret i8* %3
}
int defined(void) { return 0; }


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

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

LLVM IR (-O0):
define i32 @defined() {
ret i32 0
}

LLVM IR (-O2):
define i32 @defined() {
ret i32 0
}
/* Variables and functions */
int strncasecmp(char const *, char const *, size_t);
int os_strncasecmp(const char *s1, const char *s2, size_t n) {
  return strncasecmp(s1, s2, n);
}


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

x86 assembly (clang, -O2):
<os_strncasecmp>:
jmp    1030 <strncasecmp@plt>

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

LLVM IR (-O2):
define i32 @os_strncasecmp(i8* nocapture %0, i8* nocapture %1, i64 %2) {
%4 = tail call i32 @strncasecmp(i8* %0, i8* %1, i64 %2)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ ft_putchar_fd(int, char);
void ft_putchar(char c) { ft_putchar_fd(1, c); }


x86 assembly (clang, -O0):
<ft_putchar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    $0x1,%edi
movsbl -0x1(%rbp),%esi
call   1030 <ft_putchar_fd@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_putchar>:
mov    %edi,%esi
mov    $0x1,%edi
jmp    1030 <ft_putchar_fd@plt>

LLVM IR (-O0):
define void @ft_putchar(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = call i32 @ft_putchar_fd(i32 1, i8 signext %3)
ret void
}

LLVM IR (-O2):
define void @ft_putchar(i8 signext %0) {
%2 = tail call i32 @ft_putchar_fd(i32 1, i8 signext %0)
ret void
}
/* Variables and functions */
double tanh(double);
extern __attribute__((visibility("hidden"))) double lj_vm_tanh(double x) {
  return tanh(x);
}


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

x86 assembly (clang, -O2):
<lj_vm_tanh>:
jmp    1030 <tanh@plt>

LLVM IR (-O0):
define hidden double @lj_vm_tanh(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call double @tanh(double %3)
ret double %4
}

LLVM IR (-O2):
define hidden double @lj_vm_tanh(double %0) {
%2 = tail call double @tanh(double %0)
ret double %2
}
unsigned int apply_frontend_param(unsigned int spi_bias) {
  static const int ppm = 8000;
  spi_bias /= 1000ULL + ppm / 1000;
  return spi_bias;
}


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

x86 assembly (clang, -O2):
<apply_frontend_param>:
shr    $0x4,%edi
imul   $0x10410411,%rdi,%rax
shr    $0x22,%rax
ret

LLVM IR (-O0):
@apply_frontend_param.ppm = internal constant i32 8000
define i32 @apply_frontend_param(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = zext i32 %3 to i64
%5 = udiv i64 %4, 1008
%6 = trunc i64 %5 to i32
store i32 %6, i32* %2
%7 = load i32, i32* %2
ret i32 %7
}

LLVM IR (-O2):
define i32 @apply_frontend_param(i32 %0) {
%2 = udiv i32 %0, 1008
ret i32 %2
}
int check_support_card(void) { return 0; }


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

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

LLVM IR (-O0):
define i32 @check_support_card() {
ret i32 0
}

LLVM IR (-O2):
define i32 @check_support_card() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void usage(char *execname) {
  fprintf(stderr,
          "\033[1mUSAGE\033[0m\n\n"
          "\t%s [ \033[4mOPTIONS\033[0m... ] \033[4mTARGET\033[0m\n\n"
          "\033[1mOPTIONS\033[0m\n\n"
          "\t\033[1m-r\033[0m\n"
          "\t\tBegin search at random position.\n\n"
          "\t\033[1m-p\033[0m \033[4mPROCS\033[0m\n"
          "\t\tNumber of processes to use. (default: 1)\n\n"
          "\t\033[1m-i\033[0m\n"
          "\t\tIgnore case when matching.\n\n"
          "\t\033[1m-h\033[0m\n"
          "\t\tDisplay this message and exit.\n\n",
          execname);
  exit(1);
}


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

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [282 x i8] c"\1B[1mUSAGE\1B[0m\0A\0A\09%s [ \1B[4mOPTIONS\1B[0m... ] \1B[4mTARGET\1B[0m\0A\0A\1B[1mOPTIONS\1B[0m\0A\0A\09\1B[1m-r\1B[0m\0A\09\09Begin search at random position.\0A\0A\09\1B[1m-p\1B[0m \1B[4mPROCS\1B[0m\0A\09\09Number of processes to use. (default: 1)\0A\0A\09\1B[1m-i\1B[0m\0A\09\09Ignore case when matching.\0A\0A\09\1B[1m-h\1B[0m\0A\09\09Display this message and exit.\0A\0A\00"
define void @usage(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 ([282 x i8], [282 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [282 x i8] c"\1B[1mUSAGE\1B[0m\0A\0A\09%s [ \1B[4mOPTIONS\1B[0m... ] \1B[4mTARGET\1B[0m\0A\0A\1B[1mOPTIONS\1B[0m\0A\0A\09\1B[1m-r\1B[0m\0A\09\09Begin search at random position.\0A\0A\09\1B[1m-p\1B[0m \1B[4mPROCS\1B[0m\0A\09\09Number of processes to use. (default: 1)\0A\0A\09\1B[1m-i\1B[0m\0A\09\09Ignore case when matching.\0A\0A\09\1B[1m-h\1B[0m\0A\09\09Display this message and exit.\0A\0A\00"
define void @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([282 x i8], [282 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 1)
unreachable
}
void mycopy(char to[], char from[]) {
  int i;
  i = 0;
  while ((to[i] = from[i]) != '\0')
    ++i;
}


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

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

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

LLVM IR (-O2):
define void @mycopy(i8* nocapture writeonly %0, i8* nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i64 [ %9, %3 ], [ 0, %2 ]
%5 = getelementptr inbounds i8, i8* %1, i64 %4
%6 = load i8, i8* %5
%7 = getelementptr inbounds i8, i8* %0, i64 %4
store i8 %6, i8* %7
%8 = icmp eq i8 %6, 0
%9 = add nuw i64 %4, 1
br i1 %8, label %10, label %3
10: ; preds = %3
ret void
}
/* Variables and functions */
int abs(int);
float fabs(float);
int stb_float_eq(float x, float y, float delta, int max_ulps) {
  if (fabs(x - y) <= delta)
    return 1;
  if (abs(*(int *)&x - *(int *)&y) <= max_ulps)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<stb_float_eq>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movss  %xmm0,-0x8(%rbp)
movss  %xmm1,-0xc(%rbp)
movss  %xmm2,-0x10(%rbp)
mov    %edi,-0x14(%rbp)
movss  -0x8(%rbp),%xmm0
subss  -0xc(%rbp),%xmm0
call   1040 <fabs@plt>
movaps %xmm0,%xmm1
movss  -0x10(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jb     1166 <stb_float_eq+0x46>
movl   $0x1,-0x4(%rbp)
jmp    118d <stb_float_eq+0x6d>
mov    -0x8(%rbp),%edi
sub    -0xc(%rbp),%edi
call   1030 <abs@plt>
cmp    -0x14(%rbp),%eax
jg     1186 <stb_float_eq+0x66>
movl   $0x1,-0x4(%rbp)
jmp    118d <stb_float_eq+0x6d>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stb_float_eq>:
movaps %xmm0,%xmm3
subss  %xmm1,%xmm3
andps  0xef2(%rip),%xmm3
mov    $0x1,%eax
ucomiss %xmm3,%xmm2
jae    1130 <stb_float_eq+0x30>
movd   %xmm0,%eax
movd   %xmm1,%ecx
sub    %ecx,%eax
mov    %eax,%ecx
neg    %ecx
cmovs  %eax,%ecx
xor    %eax,%eax
cmp    %edi,%ecx
setle  %al
ret

LLVM IR (-O0):
define i32 @stb_float_eq(float %0, float %1, float %2, i32 %3) {
%5 = alloca i32
%6 = alloca float
%7 = alloca float
%8 = alloca float
%9 = alloca i32
store float %0, float* %6
store float %1, float* %7
store float %2, float* %8
store i32 %3, i32* %9
%10 = load float, float* %6
%11 = load float, float* %7
%12 = fsub float %10, %11
%13 = call float @fabs(float %12)
%14 = load float, float* %8
%15 = fcmp ole float %13, %14
br i1 %15, label %16, label %17
16: ; preds = %4
store i32 1, i32* %5
br label %28
17: ; preds = %4
%18 = bitcast float* %6 to i32*
%19 = load i32, i32* %18
%20 = bitcast float* %7 to i32*
%21 = load i32, i32* %20
%22 = sub nsw i32 %19, %21
%23 = call i32 @abs(i32 %22)
%24 = load i32, i32* %9
%25 = icmp sle i32 %23, %24
br i1 %25, label %26, label %27
26: ; preds = %17
store i32 1, i32* %5
br label %28
27: ; preds = %17
store i32 0, i32* %5
br label %28
28: ; preds = %27, %26, %16
%29 = load i32, i32* %5
ret i32 %29
}

LLVM IR (-O2):
define i32 @stb_float_eq(float %0, float %1, float %2, i32 %3) {
%5 = fsub float %0, %1
%6 = tail call float @llvm.fabs.f32(float %5)
%7 = fcmp ugt float %6, %2
br i1 %7, label %8, label %15
8: ; preds = %4
%9 = bitcast float %0 to i32
%10 = bitcast float %1 to i32
%11 = sub nsw i32 %9, %10
%12 = tail call i32 @llvm.abs.i32(i32 %11, i1 true)
%13 = icmp sle i32 %12, %3
%14 = zext i1 %13 to i32
br label %15
15: ; preds = %8, %4
%16 = phi i32 [ 1, %4 ], [ %14, %8 ]
ret i32 %16
}
/* Variables and functions */
int /*<<< orphan*/ test_strstr();
int main() {
  test_strstr();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @test_strstr()
ret i32 0
}
/* Variables and functions */
float powf(float, int);
float quintic_out(float step, float max_steps, float max_val) {
  float ratio = (step / max_steps) - 1;
  return max_val + max_val * powf(ratio, 5);
}


x86 assembly (clang, -O0):
<quintic_out>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  -0x4(%rbp),%xmm0
divss  -0x8(%rbp),%xmm0
movss  0xec7(%rip),%xmm1
subss  %xmm1,%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x18(%rbp)
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x10(%rbp),%xmm0
mov    $0x5,%edi
call   1030 <powf@plt>
movss  -0x18(%rbp),%xmm1
movaps %xmm0,%xmm2
movss  -0x14(%rbp),%xmm0
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<quintic_out>:
push   %rax
movss  %xmm2,0x4(%rsp)
divss  %xmm1,%xmm0
addss  0xedd(%rip),%xmm0
mov    $0x5,%edi
call   1030 <powf@plt>
movss  0x4(%rsp),%xmm1
mulss  %xmm1,%xmm0
addss  %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @quintic_out(float %0, float %1, float %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca float
%7 = alloca float
store float %0, float* %4
store float %1, float* %5
store float %2, float* %6
%8 = load float, float* %4
%9 = load float, float* %5
%10 = fdiv float %8, %9
%11 = fsub float %10, 1.000000e+00
store float %11, float* %7
%12 = load float, float* %6
%13 = load float, float* %6
%14 = load float, float* %7
%15 = call float @powf(float %14, i32 5)
%16 = call float @llvm.fmuladd.f32(float %13, float %15, float %12)
ret float %16
}

LLVM IR (-O2):
define float @quintic_out(float %0, float %1, float %2) {
%4 = fdiv float %0, %1
%5 = fadd float %4, -1.000000e+00
%6 = tail call float @powf(float %5, i32 5)
%7 = tail call float @llvm.fmuladd.f32(float %2, float %6, float %2)
ret float %7
}
/* Variables and functions */
int strcasecmp(char const *, char const *);
int c_strcasecmp(const char *arg0, const char *arg1) {
  return strcasecmp(arg0, arg1);
}


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

x86 assembly (clang, -O2):
<c_strcasecmp>:
jmp    1030 <strcasecmp@plt>

LLVM IR (-O0):
define i32 @c_strcasecmp(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 @strcasecmp(i8* %5, i8* %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @c_strcasecmp(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32 @strcasecmp(i8* %0, i8* %1)
ret i32 %3
}
int mat_to_arr(unsigned int row, unsigned int column, unsigned int row_length) {
  row = row - 1;
  column = column - 1;
  return row * row_length + column;
}


x86 assembly (clang, -O0):
<mat_to_arr>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
imul   -0xc(%rbp),%eax
add    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mat_to_arr>:
add    $0xffffffff,%edi
imul   %edx,%edi
lea    (%rsi,%rdi,1),%eax
add    $0xffffffff,%eax
ret

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

LLVM IR (-O2):
define i32 @mat_to_arr(i32 %0, i32 %1, i32 %2) {
%4 = add i32 %0, -1
%5 = add i32 %1, -1
%6 = mul i32 %4, %2
%7 = add i32 %5, %6
ret i32 %7
}
double myUlongToDouble(unsigned int ul) {
  double val;
  if (ul & ((unsigned int)0x80000000))
    val = ((double)2147483648.0) + (ul & (~((unsigned int)0x80000000)));
  else
    val = ul;
  return val;
}


x86 assembly (clang, -O0):
<myUlongToDouble>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x80000000,%eax
cmp    $0x0,%eax
je     113a <myUlongToDouble+0x3a>
mov    -0x4(%rbp),%eax
and    $0x7fffffff,%eax
cvtsi2sd %eax,%xmm1
movsd  0xed4(%rip),%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
jmp    1147 <myUlongToDouble+0x47>
mov    -0x4(%rbp),%eax
cvtsi2sd %rax,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<myUlongToDouble>:
test   %edi,%edi
jns    1117 <myUlongToDouble+0x17>
and    $0x7fffffff,%edi
cvtsi2sd %edi,%xmm0
addsd  0xeea(%rip),%xmm0
ret
mov    %edi,%eax
cvtsi2sd %rax,%xmm0
ret

LLVM IR (-O0):
define double @myUlongToDouble(i32 %0) {
%2 = alloca i32
%3 = alloca double
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = and i32 %4, -2147483648
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %12
7: ; preds = %1
%8 = load i32, i32* %2
%9 = and i32 %8, 2147483647
%10 = uitofp i32 %9 to double
%11 = fadd double 0x41E0000000000000, %10
store double %11, double* %3
br label %15
12: ; preds = %1
%13 = load i32, i32* %2
%14 = uitofp i32 %13 to double
store double %14, double* %3
br label %15
15: ; preds = %12, %7
%16 = load double, double* %3
ret double %16
}

LLVM IR (-O2):
define double @myUlongToDouble(i32 %0) {
%2 = icmp sgt i32 %0, -1
%3 = and i32 %0, 2147483647
%4 = uitofp i32 %3 to double
%5 = fadd double %4, 0x41E0000000000000
%6 = uitofp i32 %0 to double
%7 = select i1 %2, double %6, double %5
ret double %7
}