xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ parser_Error(char *);
int /*<<< orphan*/ parser_Halt();
void parser_Abort(char *s) {
  parser_Error(s);
  parser_Halt();
}


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

x86 assembly (clang, -O2):
<parser_Abort>:
push   %rax
call   1030 <parser_Error@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <parser_Halt@plt>

LLVM IR (-O0):
define void @parser_Abort(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @parser_Error(i8* %3)
%5 = call i32 (...) @parser_Halt()
ret void
}

LLVM IR (-O2):
define void @parser_Abort(i8* %0) {
%2 = tail call i32 @parser_Error(i8* %0)
%3 = tail call i32 (...) @parser_Halt()
ret void
}
void foo203(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo203(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ usage_file_format();
int /*<<< orphan*/ usage_machine();
int /*<<< orphan*/ usage_symbols_mode();
int /*<<< orphan*/ usage_word_format();
void usage(char **argv) {
  fprintf(stderr,
          "Usage: %s [-6] [-r] [-F<file format>] [-S<symbol mode>] [-W<word "
          "format>] [-D<DDT address>] <file>\n\n",
          argv[0]);
  usage_file_format();
  usage_word_format();
  usage_symbols_mode();
  usage_machine();
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2e6d(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rax
mov    (%rax),%rdx
lea    0xe7d(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x0,%al
call   1030 <usage_file_format@plt>
mov    $0x0,%al
call   1080 <usage_word_format@plt>
mov    $0x0,%al
call   1060 <usage_symbols_mode@plt>
mov    $0x0,%al
call   1050 <usage_machine@plt>
mov    $0x1,%edi
call   1070 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    0x2e78(%rip),%rax
mov    (%rax),%eax
mov    (%rdi),%rdx
lea    0xe8c(%rip),%rsi
mov    %eax,%edi
call   1040 <fprintf@plt>
xor    %eax,%eax
call   1030 <usage_file_format@plt>
xor    %eax,%eax
call   1080 <usage_word_format@plt>
xor    %eax,%eax
call   1060 <usage_symbols_mode@plt>
xor    %eax,%eax
call   1050 <usage_machine@plt>
mov    $0x1,%edi
call   1070 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [101 x i8] c"Usage: %s [-6] [-r] [-F<file format>] [-S<symbol mode>] [-W<word format>] [-D<DDT address>] <file>\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 = getelementptr inbounds i8*, i8** %4, i64 0
%6 = load i8*, i8** %5
%7 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([101 x i8], [101 x i8]* @.str, i64 0, i64 0), i8* %6)
%8 = call i32 (...) @usage_file_format()
%9 = call i32 (...) @usage_word_format()
%10 = call i32 (...) @usage_symbols_mode()
%11 = call i32 (...) @usage_machine()
%12 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [101 x i8] c"Usage: %s [-6] [-r] [-F<file format>] [-S<symbol mode>] [-W<word format>] [-D<DDT address>] <file>\0A\0A\00"
define void @usage(i8** nocapture %0) {
%2 = load i32, i32* @stderr
%3 = load i8*, i8** %0
%4 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([101 x i8], [101 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = tail call i32 (...) @usage_file_format()
%6 = tail call i32 (...) @usage_word_format()
%7 = tail call i32 (...) @usage_symbols_mode()
%8 = tail call i32 (...) @usage_machine()
%9 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ arm_arith_add(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ t16_data_imm3_op();
void t16_add_imm3() { arm_arith_add(t16_data_imm3_op(), 0); }


x86 assembly (clang, -O0):
<t16_add_imm3>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <t16_data_imm3_op@plt>
mov    %eax,%edi
xor    %esi,%esi
call   1030 <arm_arith_add@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t16_add_imm3>:
push   %rax
xor    %eax,%eax
call   1040 <t16_data_imm3_op@plt>
mov    %eax,%edi
xor    %esi,%esi
pop    %rax
jmp    1030 <arm_arith_add@plt>

LLVM IR (-O0):
define void @t16_add_imm3() {
%1 = call i32 (...) @t16_data_imm3_op()
%2 = call i32 @arm_arith_add(i32 %1, i32 0)
ret void
}

LLVM IR (-O2):
define void @t16_add_imm3() {
%1 = tail call i32 (...) @t16_data_imm3_op()
%2 = tail call i32 @arm_arith_add(i32 %1, i32 0)
ret void
}
int grbDecode(int filetype, unsigned char *gribbuffer, int gribsize,
              double *data, int gridsize, int unreduced, int *nmiss,
              double missval, int vlistID, int varID) {
  int status = 0;
  {
    (void)vlistID;
    (void)varID;
    Error_(__func__, "GRIB_API support not compiled in!");
  }
  return (status);
}


x86 assembly (clang, -O0):
<grbDecode>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    0x20(%rbp),%eax
mov    0x18(%rbp),%eax
mov    0x10(%rbp),%rax
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
mov    %r9d,-0x28(%rbp)
movsd  %xmm0,-0x30(%rbp)
movl   $0x0,-0x34(%rbp)
lea    0xeb5(%rip),%rdi
lea    0xeb8(%rip),%rsi
mov    $0x0,%al
call   1030 <Error_@plt>
mov    -0x34(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@__func__.grbDecode = [10 x i8] c"grbDecode\00"
@.str = [34 x i8] c"GRIB_API support not compiled in!\00"
define i32 @grbDecode(i32 %0, i8* %1, i32 %2, double* %3, i32 %4, i32 %5, i32* %6, double %7, i32 %8, i32 %9) {
%11 = alloca i32
%12 = alloca i8*
%13 = alloca i32
%14 = alloca double*
%15 = alloca i32
%16 = alloca i32
%17 = alloca i32*
%18 = alloca double
%19 = alloca i32
%20 = alloca i32
%21 = alloca i32
store i32 %0, i32* %11
store i8* %1, i8** %12
store i32 %2, i32* %13
store double* %3, double** %14
store i32 %4, i32* %15
store i32 %5, i32* %16
store i32* %6, i32** %17
store double %7, double* %18
store i32 %8, i32* %19
store i32 %9, i32* %20
store i32 0, i32* %21
%22 = load i32, i32* %19
%23 = load i32, i32* %20
%24 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @Error_ to i32 (i8*, i8*, ...)*)(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @__func__.grbDecode, i64 0, i64 0), i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
%25 = load i32, i32* %21
ret i32 %25
}

LLVM IR (-O2):
@__func__.grbDecode = [10 x i8] c"grbDecode\00"
@.str = [34 x i8] c"GRIB_API support not compiled in!\00"
define i32 @grbDecode(i32 %0, i8* nocapture readnone %1, i32 %2, double* nocapture readnone %3, i32 %4, i32 %5, i32* nocapture readnone %6, double %7, i32 %8, i32 %9) {
%11 = tail call i32 (i8*, i8*, ...) bitcast (i32 (...)* @Error_ to i32 (i8*, i8*, ...)*)(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @__func__.grbDecode, i64 0, i64 0), i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
void Timer0B_Enable(void) {
  (*((volatile unsigned long *)0x4003000C)) |= 0x00000100;
}


x86 assembly (clang, -O0):
<Timer0B_Enable>:
push   %rbp
mov    %rsp,%rbp
mov    $0x4003000c,%eax
mov    (%rax),%rcx
or     $0x100,%rcx
mov    $0x4003000c,%eax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<Timer0B_Enable>:
orq    $0x100,0x4003000c
ret

LLVM IR (-O0):
define void @Timer0B_Enable() {
%1 = load volatile i64, i64* inttoptr (i64 1073938444 to i64*)
%2 = or i64 %1, 256
store volatile i64 %2, i64* inttoptr (i64 1073938444 to i64*)
ret void
}

LLVM IR (-O2):
define void @Timer0B_Enable() {
%1 = load volatile i64, i64* inttoptr (i64 1073938444 to i64*)
%2 = or i64 %1, 256
store volatile i64 %2, i64* inttoptr (i64 1073938444 to i64*)
ret void
}
double inf(void) { return 1.0 / 0.0; }


x86 assembly (clang, -O0):
<inf>:
push   %rbp
mov    %rsp,%rbp
movsd  0xef4(%rip),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<inf>:
movsd  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define double @inf() {
ret double 0x7FF0000000000000
}

LLVM IR (-O2):
define double @inf() {
ret double 0x7FF0000000000000
}
int main() { return sizeof(char); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    $0x1,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 1
}
void create_dirs(void) {}


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

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

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

LLVM IR (-O2):
define void @create_dirs() {
ret void
}
void player_clear(struct player_t *pl) {}


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

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

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

LLVM IR (-O2):
%struct.player_t = type opaque
define void @player_clear(%struct.player_t* nocapture %0) {
ret void
}
/* Variables and functions */
char toupper(unsigned char);
void eb_cmd_uppercase(char *buf) {
  while (*buf++ != '\0')
    *buf = toupper((unsigned char)*buf);
}


x86 assembly (clang, -O0):
<eb_cmd_uppercase>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1150 <eb_cmd_uppercase+0x40>
mov    -0x8(%rbp),%rax
movzbl (%rax),%edi
call   1030 <toupper@plt>
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
jmp    111c <eb_cmd_uppercase+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<eb_cmd_uppercase>:
push   %rbx
cmpb   $0x0,(%rdi)
je     1132 <eb_cmd_uppercase+0x22>
mov    %rdi,%rbx
add    $0x1,%rbx
nopl   (%rax)
movzbl (%rbx),%edi
call   1030 <toupper@plt>
mov    %al,(%rbx)
add    $0x1,%rbx
test   %al,%al
jne    1120 <eb_cmd_uppercase+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @eb_cmd_uppercase(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %10, label %4
4: ; preds = %1, %4
%5 = phi i8* [ %6, %4 ], [ %0, %1 ]
%6 = getelementptr inbounds i8, i8* %5, i64 1
%7 = load i8, i8* %6
%8 = tail call signext i8 @toupper(i8 zeroext %7)
store i8 %8, i8* %6
%9 = icmp eq i8 %8, 0
br i1 %9, label %10, label %4
10: ; preds = %4, %1
ret void
}
/* Type definitions */
typedef scalar_t__ int64_t;

/* Variables and functions */
int64_t max_int64(int64_t a, int64_t b) {
  if (a > b)
    return a;
  else
    return b;
}


x86 assembly (clang, -O0):
<max_int64>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
jle    1127 <max_int64+0x27>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    112f <max_int64+0x2f>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<max_int64>:
mov    %rsi,%rax
cmp    %rsi,%rdi
cmovg  %rdi,%rax
ret

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

LLVM IR (-O2):
define i64 @max_int64(i64 %0, i64 %1) {
%3 = icmp sgt i64 %0, %1
%4 = select i1 %3, i64 %0, i64 %1
ret i64 %4
}
/* Type definitions */
struct BCState {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ WriteHSCXCMDR(struct BCState *, int);
void reset_xmit(struct BCState *bcs) { WriteHSCXCMDR(bcs, 0x01); }


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

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

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

LLVM IR (-O2):
%struct.BCState = type { i32 }
define void @reset_xmit(%struct.BCState* %0) {
%2 = tail call i32 @WriteHSCXCMDR(%struct.BCState* %0, i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ add_buffer(char);
int /*<<< orphan*/ http_parse_content_type(char);
void http_parse_parameter(int id, char ch) {
  switch (id) {
  case 0:
    http_parse_content_type(ch);
    break;
  case 1:
    add_buffer(ch);
    break;
  default:
    break;
  }
}


x86 assembly (clang, -O0):
<http_parse_parameter>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %edi,-0x4(%rbp)
mov    %al,-0x5(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
test   %eax,%eax
je     1155 <http_parse_parameter+0x35>
jmp    1144 <http_parse_parameter+0x24>
mov    -0xc(%rbp),%eax
sub    $0x1,%eax
je     1163 <http_parse_parameter+0x43>
jmp    1171 <http_parse_parameter+0x51>
movsbl -0x5(%rbp),%edi
call   1030 <http_parse_content_type@plt>
jmp    1176 <http_parse_parameter+0x56>
movsbl -0x5(%rbp),%edi
call   1040 <add_buffer@plt>
jmp    1176 <http_parse_parameter+0x56>
jmp    1176 <http_parse_parameter+0x56>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<http_parse_parameter>:
cmp    $0x1,%edi
je     1132 <http_parse_parameter+0x12>
test   %edi,%edi
jne    113b <http_parse_parameter+0x1b>
movsbl %sil,%edi
jmp    1030 <http_parse_content_type@plt>
movsbl %sil,%edi
jmp    1040 <add_buffer@plt>
ret

LLVM IR (-O0):
define void @http_parse_parameter(i32 %0, i8 signext %1) {
%3 = alloca i32
%4 = alloca i8
store i32 %0, i32* %3
store i8 %1, i8* %4
%5 = load i32, i32* %3
switch i32 %5, label %12 [
i32 0, label %6
i32 1, label %9
]
6: ; preds = %2
%7 = load i8, i8* %4
%8 = call i32 @http_parse_content_type(i8 signext %7)
br label %13
9: ; preds = %2
%10 = load i8, i8* %4
%11 = call i32 @add_buffer(i8 signext %10)
br label %13
12: ; preds = %2
br label %13
13: ; preds = %12, %9, %6
ret void
}

LLVM IR (-O2):
define void @http_parse_parameter(i32 %0, i8 signext %1) {
switch i32 %0, label %7 [
i32 0, label %3
i32 1, label %5
]
3: ; preds = %2
%4 = tail call i32 @http_parse_content_type(i8 signext %1)
br label %7
5: ; preds = %2
%6 = tail call i32 @add_buffer(i8 signext %1)
br label %7
7: ; preds = %2, %5, %3
ret void
}
int main(int argc, char *argv[]) {
  printf("This is %s()\n", __func__);
  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)
lea    0xed3(%rip),%rdi
lea    0xeda(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [14 x i8] c"This is %s()\0A\00"
@__func__.main = [5 x i8] c"main\00"
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 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @__func__.main, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [14 x i8] c"This is %s()\0A\00"
@__func__.main = [5 x i8] c"main\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @__func__.main, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ sfree(void *);
void parser_free_grule(void *rarg) {
  if (rarg) {
    sfree(rarg);
  }
  return;
}


x86 assembly (clang, -O0):
<parser_free_grule>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1130 <parser_free_grule+0x20>
mov    -0x8(%rbp),%rdi
call   1030 <sfree@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parser_free_grule>:
test   %rdi,%rdi
je     111a <parser_free_grule+0xa>
jmp    1030 <sfree@plt>
ret

LLVM IR (-O0):
define void @parser_free_grule(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp ne i8* %3, null
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i8*, i8** %2
%7 = call i32 @sfree(i8* %6)
br label %8
8: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
define void @parser_free_grule(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @sfree(i8* %0)
br label %5
5: ; preds = %3, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ initBuffer();
int /*<<< orphan*/ initExtensionEntries();
int /*<<< orphan*/ initRendering();
int /*<<< orphan*/ initShader();
void init(void) {
  initExtensionEntries();
  initBuffer();
  initShader();
  initRendering();
}


x86 assembly (clang, -O0):
<init>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <initExtensionEntries@plt>
mov    $0x0,%al
call   1040 <initBuffer@plt>
mov    $0x0,%al
call   1060 <initShader@plt>
mov    $0x0,%al
call   1050 <initRendering@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<init>:
push   %rax
xor    %eax,%eax
call   1030 <initExtensionEntries@plt>
xor    %eax,%eax
call   1040 <initBuffer@plt>
xor    %eax,%eax
call   1060 <initShader@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <initRendering@plt>

LLVM IR (-O0):
define void @init() {
%1 = call i32 (...) @initExtensionEntries()
%2 = call i32 (...) @initBuffer()
%3 = call i32 (...) @initShader()
%4 = call i32 (...) @initRendering()
ret void
}

LLVM IR (-O2):
define void @init() {
%1 = tail call i32 (...) @initExtensionEntries()
%2 = tail call i32 (...) @initBuffer()
%3 = tail call i32 (...) @initShader()
%4 = tail call i32 (...) @initRendering()
ret void
}
void foo117(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo117(i32 %0) {
ret void
}
void draw_layout(void) {}


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

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

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

LLVM IR (-O2):
define void @draw_layout() {
ret void
}
void CRYPTO_set_id_callback(void) {}


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

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

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

LLVM IR (-O2):
define void @CRYPTO_set_id_callback() {
ret void
}
char *strcat(char *s, const char *append) {
  char *p = s;
  while (*p)
    p++;
  while ((*p++ = *append++) != 0)
    ;
  return s;
}


x86 assembly (clang, -O0):
<strcat>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmpb   $0x0,(%rax)
je     1132 <strcat+0x32>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1114 <strcat+0x14>
jmp    1137 <strcat+0x37>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%al
mov    -0x18(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x18(%rbp)
mov    %al,(%rcx)
movsbl %al,%eax
cmp    $0x0,%eax
je     116a <strcat+0x6a>
jmp    1137 <strcat+0x37>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcat>:
mov    %rdi,%rax
mov    %rdi,%rcx
cs nopw 0x0(%rax,%rax,1)
cmpb   $0x0,(%rcx)
lea    0x1(%rcx),%rcx
jne    1110 <strcat+0x10>
xor    %edx,%edx
nopl   0x0(%rax,%rax,1)
movzbl (%rsi,%rdx,1),%edi
mov    %dil,-0x1(%rcx,%rdx,1)
add    $0x1,%rdx
test   %dil,%dil
jne    1120 <strcat+0x20>
ret

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

LLVM IR (-O2):
define i8* @strcat(i8* returned %0, i8* nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %0, %2 ], [ %7, %3 ]
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = getelementptr inbounds i8, i8* %4, i64 1
br i1 %6, label %8, label %3
8: ; preds = %3, %8
%9 = phi i8* [ %11, %8 ], [ %1, %3 ]
%10 = phi i8* [ %13, %8 ], [ %4, %3 ]
%11 = getelementptr inbounds i8, i8* %9, i64 1
%12 = load i8, i8* %9
%13 = getelementptr inbounds i8, i8* %10, i64 1
store i8 %12, i8* %10
%14 = icmp eq i8 %12, 0
br i1 %14, label %15, label %8
15: ; preds = %8
ret i8* %0
}
int XOR(char btoenc, char keybit) { return btoenc ^ keybit; }


x86 assembly (clang, -O0):
<XOR>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movsbl -0x1(%rbp),%eax
movsbl -0x2(%rbp),%ecx
xor    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<XOR>:
mov    %edi,%eax
xor    %esi,%eax
ret

LLVM IR (-O0):
define i32 @XOR(i8 signext %0, i8 signext %1) {
%3 = alloca i8
%4 = alloca i8
store i8 %0, i8* %3
store i8 %1, i8* %4
%5 = load i8, i8* %3
%6 = sext i8 %5 to i32
%7 = load i8, i8* %4
%8 = sext i8 %7 to i32
%9 = xor i32 %6, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @XOR(i8 signext %0, i8 signext %1) {
%3 = xor i8 %1, %0
%4 = sext i8 %3 to i32
ret i32 %4
}
int numberOfVChar(const char *z) {
  int N = 0;
  while (z[0] && z[0] == 'v') {
    z++;
    N++;
  }
  return z[0] == 0 ? N : 0;
}


x86 assembly (clang, -O0):
<numberOfVChar>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0xd(%rbp)
je     1134 <numberOfVChar+0x34>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x76,%eax
sete   %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
test   $0x1,%al
jne    1144 <numberOfVChar+0x44>
jmp    115e <numberOfVChar+0x5e>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <numberOfVChar+0xf>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    1179 <numberOfVChar+0x79>
mov    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
jmp    1183 <numberOfVChar+0x83>
xor    %eax,%eax
mov    %eax,-0x14(%rbp)
jmp    1183 <numberOfVChar+0x83>
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<numberOfVChar>:
mov    (%rdi),%dl
xor    %eax,%eax
mov    $0x0,%ecx
cmp    $0x76,%dl
jne    111e <numberOfVChar+0x1e>
xor    %ecx,%ecx
movzbl 0x1(%rdi,%rcx,1),%edx
add    $0x1,%rcx
cmp    $0x76,%dl
je     1110 <numberOfVChar+0x10>
test   %dl,%dl
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @numberOfVChar(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 118
br i1 %3, label %4, label %11
4: ; preds = %1, %4
%5 = phi i32 [ %8, %4 ], [ 0, %1 ]
%6 = phi i8* [ %7, %4 ], [ %0, %1 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = add nuw nsw i32 %5, 1
%9 = load i8, i8* %7
%10 = icmp eq i8 %9, 118
br i1 %10, label %4, label %11
11: ; preds = %4, %1
%12 = phi i32 [ 0, %1 ], [ %8, %4 ]
%13 = phi i8 [ %2, %1 ], [ %9, %4 ]
%14 = icmp eq i8 %13, 0
%15 = select i1 %14, i32 %12, i32 0
ret i32 %15
}
int sys_closedir(int fd) {}


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

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

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

LLVM IR (-O2):
define i32 @sys_closedir(i32 %0) {
ret i32 undef
}
IR0RX1(r0, r1, x0, x1, p0, p1) char r0, r1;
char *p0, *p1;
{ (*p0) = (p1[x1]); }


x86 assembly (clang, -O0):
<IR0RX1>:
push   %rbp
mov    %rsp,%rbp
mov    %esi,%eax
mov    %dil,%sil
mov    %sil,-0x5(%rbp)
mov    %al,-0x6(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8,-0x18(%rbp)
mov    %r9,-0x20(%rbp)
mov    -0x20(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,1),%cl
mov    -0x18(%rbp),%rax
mov    %cl,(%rax)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<IR0RX1>:
movslq %ecx,%rax
mov    (%r9,%rax,1),%al
mov    %al,(%r8)
ret

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

LLVM IR (-O2):
define i32 @IR0RX1(i32 %0, i32 %1, i32 %2, i32 %3, i8* nocapture writeonly %4, i8* nocapture %5) {
%7 = sext i32 %3 to i64
%8 = getelementptr inbounds i8, i8* %5, i64 %7
%9 = load i8, i8* %8
store i8 %9, i8* %4
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
usage() { printf("usage : servmulti numero_port_serveur\n"); }


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

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

LLVM IR (-O0):
@.str = [39 x i8] c"usage : servmulti numero_port_serveur\0A\00"
define i32 @usage() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [38 x i8] c"usage : servmulti numero_port_serveur\00"
define i32 @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
int test() {
  int i, j = 0, k;
  for (i = 0; i < 8; i++, j++) {
    if (i == 4)
      break;
    i++;
  }
  return (i == 4 && j == 2) ? 0 : 1;
}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0x4(%rbp)
cmpl   $0x8,-0x4(%rbp)
jge    114b <test+0x4b>
cmpl   $0x4,-0x4(%rbp)
jne    112b <test+0x2b>
jmp    114b <test+0x4b>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1112 <test+0x12>
xor    %eax,%eax
cmpl   $0x4,-0x4(%rbp)
mov    %al,-0xd(%rbp)
jne    1164 <test+0x64>
cmpl   $0x2,-0x8(%rbp)
sete   %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%dl
mov    $0x1,%eax
xor    %ecx,%ecx
test   $0x1,%dl
cmovne %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %2
store i32 0, i32* %1
br label %4
4: ; preds = %14, %0
%5 = load i32, i32* %1
%6 = icmp slt i32 %5, 8
br i1 %6, label %7, label %19
7: ; preds = %4
%8 = load i32, i32* %1
%9 = icmp eq i32 %8, 4
br i1 %9, label %10, label %11
10: ; preds = %7
br label %19
11: ; preds = %7
%12 = load i32, i32* %1
%13 = add nsw i32 %12, 1
store i32 %13, i32* %1
br label %14
14: ; preds = %11
%15 = load i32, i32* %1
%16 = add nsw i32 %15, 1
store i32 %16, i32* %1
%17 = load i32, i32* %2
%18 = add nsw i32 %17, 1
store i32 %18, i32* %2
br label %4
19: ; preds = %10, %4
%20 = load i32, i32* %1
%21 = icmp eq i32 %20, 4
br i1 %21, label %22, label %25
22: ; preds = %19
%23 = load i32, i32* %2
%24 = icmp eq i32 %23, 2
br label %25
25: ; preds = %22, %19
%26 = phi i1 [ false, %19 ], [ %24, %22 ]
%27 = zext i1 %26 to i64
%28 = select i1 %26, i32 0, i32 1
ret i32 %28
}

LLVM IR (-O2):
define i32 @test() {
ret i32 0
}
long _tailRecursionHelper(long EV_value, long EV_sum) {
  if ((EV_value == 0)) {
    return EV_sum;
  } else {
    return _tailRecursionHelper((EV_value - 1), (EV_sum + EV_value));
  }
}


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

x86 assembly (clang, -O2):
<_tailRecursionHelper>:
test   %rdi,%rdi
je     1125 <_tailRecursionHelper+0x25>
lea    -0x1(%rdi),%rax
mov    %rax,%rcx
lea    -0x2(%rdi),%rdx
mul    %rdx
shld   $0x3f,%rax,%rdx
imul   %rcx,%rcx
add    %rdi,%rsi
add    %rcx,%rsi
sub    %rdx,%rsi
mov    %rsi,%rax
ret

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

LLVM IR (-O2):
define i64 @_tailRecursionHelper(i64 %0, i64 %1) {
%3 = icmp eq i64 %0, 0
br i1 %3, label %16, label %4
4: ; preds = %2
%5 = add i64 %0, -1
%6 = mul i64 %5, %5
%7 = zext i64 %5 to i65
%8 = add i64 %0, -2
%9 = zext i64 %8 to i65
%10 = mul i65 %7, %9
%11 = lshr i65 %10, 1
%12 = trunc i65 %11 to i64
%13 = add i64 %1, %0
%14 = add i64 %13, %6
%15 = sub i64 %14, %12
br label %16
16: ; preds = %4, %2
%17 = phi i64 [ %1, %2 ], [ %15, %4 ]
ret i64 %17
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, long long);
void STEST906(long long v) {
  printf("sub  (test15f - C906): Call by value long long literal "
         ":(%13lld=1234567890123)\n",
         v);
  v = v - 3;
  printf("sub  (test15f - C906): Call by value long long literal "
         ":(%13lld=1234567890120)\n",
         v);
}


x86 assembly (clang, -O0):
<STEST906>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xed9(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
sub    $0x3,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xf0d(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<STEST906>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
add    $0xfffffffffffffffd,%rbx
lea    0xf22(%rip),%rdi
mov    %rbx,%rsi
pop    %rbx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [80 x i8] c"sub (test15f - C906): Call by value long long literal :(%13lld=1234567890123)\0A\00"
@.str.1 = [80 x i8] c"sub (test15f - C906): Call by value long long literal :(%13lld=1234567890120)\0A\00"
define void @STEST906(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([80 x i8], [80 x i8]* @.str, i64 0, i64 0), i64 %3)
%5 = load i64, i64* %2
%6 = sub nsw i64 %5, 3
store i64 %6, i64* %2
%7 = load i64, i64* %2
%8 = call i32 @printf(i8* getelementptr inbounds ([80 x i8], [80 x i8]* @.str.1, i64 0, i64 0), i64 %7)
ret void
}

LLVM IR (-O2):
@.str = [80 x i8] c"sub (test15f - C906): Call by value long long literal :(%13lld=1234567890123)\0A\00"
@.str.1 = [80 x i8] c"sub (test15f - C906): Call by value long long literal :(%13lld=1234567890120)\0A\00"
define void @STEST906(i64 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([80 x i8], [80 x i8]* @.str, i64 0, i64 0), i64 %0)
%3 = add nsw i64 %0, -3
%4 = tail call i32 @printf(i8* getelementptr inbounds ([80 x i8], [80 x i8]* @.str.1, i64 0, i64 0), i64 %3)
ret void
}
void do_nothing(struct otherendian *c) {}


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

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

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

LLVM IR (-O2):
%struct.otherendian = type opaque
define void @do_nothing(%struct.otherendian* nocapture %0) {
ret void
}
void message(format, arg1, arg2) char const *format, *arg1, *arg2;
{ message5(format, arg1, arg2, 0, 0); }


x86 assembly (clang, -O0):
<message>:
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
xor    %r8d,%r8d
mov    %r8d,%ecx
mov    $0x0,%al
call   1030 <message5@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<message>:
xor    %ecx,%ecx
xor    %r8d,%r8d
xor    %eax,%eax
jmp    1030 <message5@plt>

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

LLVM IR (-O2):
define void @message(i8* %0, i8* %1, i8* %2) {
%4 = tail call i32 (i8*, i8*, i8*, i32, i32, ...) bitcast (i32 (...)* @message5 to i32 (i8*, i8*, i8*, i32, i32, ...)*)(i8* %0, i8* %1, i8* %2, i32 0, i32 0)
ret void
}
int isPunctuation(char a) {
  char *p = "!.?";
  for (int i = 0; i < 3; i++) {
    if (a == p[i])
      return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<isPunctuation>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
lea    0xeef(%rip),%rax
mov    %rax,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x3,-0x14(%rbp)
jge    115d <isPunctuation+0x5d>
movsbl -0x5(%rbp),%eax
mov    -0x10(%rbp),%rcx
movslq -0x14(%rbp),%rdx
movsbl (%rcx,%rdx,1),%ecx
cmp    %ecx,%eax
jne    114a <isPunctuation+0x4a>
movl   $0x1,-0x4(%rbp)
jmp    1164 <isPunctuation+0x64>
jmp    114f <isPunctuation+0x4f>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    111c <isPunctuation+0x1c>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isPunctuation>:
cmp    $0x3f,%dil
ja     1120 <isPunctuation+0x20>
mov    $0x1,%eax
movzbl %dil,%ecx
movabs $0x8000400200000000,%rdx
bt     %rcx,%rdx
jae    1120 <isPunctuation+0x20>
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
@.str = [4 x i8] c"!.?\00"
define i32 @isPunctuation(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
%4 = alloca i8*
%5 = alloca i32
store i8 %0, i8* %3
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8** %4
store i32 0, i32* %5
br label %6
6: ; preds = %21, %1
%7 = load i32, i32* %5
%8 = icmp slt i32 %7, 3
br i1 %8, label %9, label %24
9: ; preds = %6
%10 = load i8, i8* %3
%11 = sext i8 %10 to i32
%12 = load i8*, i8** %4
%13 = load i32, i32* %5
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds i8, i8* %12, i64 %14
%16 = load i8, i8* %15
%17 = sext i8 %16 to i32
%18 = icmp eq i32 %11, %17
br i1 %18, label %19, label %20
19: ; preds = %9
store i32 1, i32* %2
br label %25
20: ; preds = %9
br label %21
21: ; preds = %20
%22 = load i32, i32* %5
%23 = add nsw i32 %22, 1
store i32 %23, i32* %5
br label %6
24: ; preds = %6
store i32 0, i32* %2
br label %25
25: ; preds = %24, %19
%26 = load i32, i32* %2
ret i32 %26
}

LLVM IR (-O2):
define i32 @isPunctuation(i8 signext %0) {
switch i8 %0, label %2 [
i8 33, label %3
i8 46, label %3
i8 63, label %3
]
2: ; preds = %1
br label %3
3: ; preds = %1, %1, %1, %2
%4 = phi i32 [ 1, %1 ], [ 0, %2 ], [ 1, %1 ], [ 1, %1 ]
ret i32 %4
}
void XrmGetStringDatabase() {}


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

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

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

LLVM IR (-O2):
define void @XrmGetStringDatabase() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void wind_free(void *ptr) { free(ptr); }


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

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

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

LLVM IR (-O2):
define void @wind_free(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ destroycl();
void _destroycl(int *ws) { destroycl(); }


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

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

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

LLVM IR (-O2):
define void @_destroycl(i32* nocapture readnone %0) {
%2 = tail call i32 (...) @destroycl()
ret void
}
/* Type definitions */
struct timespec {
  int dummy;
};
typedef int /*<<< orphan*/ clockid_t;

/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ __set_errno(int /*<<< orphan*/);
int clock_getres(clockid_t clock_id, struct timespec *res) {
  __set_errno(ENOSYS);
  return -1;
}


x86 assembly (clang, -O0):
<clock_getres>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2ec2(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
mov    $0xffffffff,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.timespec = type { i32 }
@ENOSYS = global i32 0
define i32 @clock_getres(i32 %0, %struct.timespec* %1) {
%3 = alloca i32
%4 = alloca %struct.timespec*
store i32 %0, i32* %3
store %struct.timespec* %1, %struct.timespec** %4
%5 = load i32, i32* @ENOSYS
%6 = call i32 @__set_errno(i32 %5)
ret i32 -1
}

LLVM IR (-O2):
%struct.timespec = type { i32 }
@ENOSYS = global i32 0
define i32 @clock_getres(i32 %0, %struct.timespec* nocapture readnone %1) {
%3 = load i32, i32* @ENOSYS
%4 = tail call i32 @__set_errno(i32 %3)
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ inc_IP(int *);
void Jmz(int adr1, int op2, int *ip) {
  if ((op2) == 0)
    *ip = adr1;
  else
    inc_IP(ip);
}


x86 assembly (clang, -O0):
<Jmz>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    113a <Jmz+0x2a>
mov    -0x4(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
jmp    1143 <Jmz+0x33>
mov    -0x10(%rbp),%rdi
call   1030 <inc_IP@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Jmz>:
test   %esi,%esi
je     111c <Jmz+0xc>
mov    %rdx,%rdi
jmp    1030 <inc_IP@plt>
mov    %edi,(%rdx)
ret

LLVM IR (-O0):
define void @Jmz(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* %5
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %12
9: ; preds = %3
%10 = load i32, i32* %4
%11 = load i32*, i32** %6
store i32 %10, i32* %11
br label %15
12: ; preds = %3
%13 = load i32*, i32** %6
%14 = call i32 @inc_IP(i32* %13)
br label %15
15: ; preds = %12, %9
ret void
}

LLVM IR (-O2):
define void @Jmz(i32 %0, i32 %1, i32* %2) {
%4 = icmp eq i32 %1, 0
br i1 %4, label %5, label %6
5: ; preds = %3
store i32 %0, i32* %2
br label %8
6: ; preds = %3
%7 = tail call i32 @inc_IP(i32* %2)
br label %8
8: ; preds = %6, %5
ret void
}
/* Variables and functions */
int /*<<< orphan*/ O_RDWR;
int /*<<< orphan*/ close(int);
int open(char const *, int /*<<< orphan*/);
int file_exists(const char *path) {
  int fd = open(path, O_RDWR);
  if (fd > -1) {
    close(fd);
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<file_exists>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    0x2eb1(%rip),%rax
mov    (%rax),%esi
call   1040 <open@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0xffffffff,-0x14(%rbp)
jle    115f <file_exists+0x3f>
mov    -0x14(%rbp),%edi
call   1030 <close@plt>
movl   $0x1,-0x4(%rbp)
jmp    1166 <file_exists+0x46>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<file_exists>:
push   %rax
mov    0x2ec0(%rip),%rax
mov    (%rax),%esi
call   1040 <open@plt>
test   %eax,%eax
js     1141 <file_exists+0x21>
mov    %eax,%edi
call   1030 <close@plt>
mov    $0x1,%eax
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@O_RDWR = global i32 0
define i32 @file_exists(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = load i32, i32* @O_RDWR
%7 = call i32 @open(i8* %5, i32 %6)
store i32 %7, i32* %4
%8 = load i32, i32* %4
%9 = icmp sgt i32 %8, -1
br i1 %9, label %10, label %13
10: ; preds = %1
%11 = load i32, i32* %4
%12 = call i32 @close(i32 %11)
store i32 1, i32* %2
br label %14
13: ; preds = %1
store i32 0, i32* %2
br label %14
14: ; preds = %13, %10
%15 = load i32, i32* %2
ret i32 %15
}

LLVM IR (-O2):
@O_RDWR = global i32 0
define i32 @file_exists(i8* nocapture %0) {
%2 = load i32, i32* @O_RDWR
%3 = tail call i32 @open(i8* %0, i32 %2)
%4 = icmp sgt i32 %3, -1
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = tail call i32 @close(i32 %3)
br label %7
7: ; preds = %1, %5
%8 = phi i32 [ 1, %5 ], [ 0, %1 ]
ret i32 %8
}
unsigned int strhash(const char *str) {
  int c;
  int hash = 5381;
  while ((c = *str++))
    hash = hash * 33 + c;
  return hash == 0 ? 1 : hash;
}


x86 assembly (clang, -O0):
<strhash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x1505,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%eax
mov    %eax,-0xc(%rbp)
cmp    $0x0,%eax
je     113c <strhash+0x3c>
imul   $0x21,-0x10(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    110f <strhash+0xf>
cmpl   $0x0,-0x10(%rbp)
jne    1153 <strhash+0x53>
mov    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1159 <strhash+0x59>
mov    -0x10(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strhash>:
mov    (%rdi),%al
test   %al,%al
je     1132 <strhash+0x32>
add    $0x1,%rdi
mov    $0x1505,%ecx
nop
movsbl %al,%eax
mov    %ecx,%edx
shl    $0x5,%edx
add    %edx,%ecx
add    %eax,%ecx
movzbl (%rdi),%eax
add    $0x1,%rdi
test   %al,%al
jne    1110 <strhash+0x10>
test   %ecx,%ecx
mov    $0x1,%eax
cmovne %ecx,%eax
ret
mov    $0x1505,%eax
ret

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

LLVM IR (-O2):
define i32 @strhash(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %17, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i32 [ %11, %4 ], [ 5381, %1 ]
%7 = phi i8* [ %9, %4 ], [ %0, %1 ]
%8 = sext i8 %5 to i32
%9 = getelementptr inbounds i8, i8* %7, i64 1
%10 = mul nsw i32 %6, 33
%11 = add nsw i32 %10, %8
%12 = load i8, i8* %9
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4
%15 = icmp eq i32 %11, 0
%16 = select i1 %15, i32 1, i32 %11
br label %17
17: ; preds = %14, %1
%18 = phi i32 [ 5381, %1 ], [ %16, %14 ]
ret i32 %18
}
/* Variables and functions */
int get_maxxgrid();
int get_maxxgrid_(void) { return get_maxxgrid(); }


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

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

LLVM IR (-O0):
define i32 @get_maxxgrid_() {
%1 = call i32 (...) @get_maxxgrid()
ret i32 %1
}

LLVM IR (-O2):
define i32 @get_maxxgrid_() {
%1 = tail call i32 (...) @get_maxxgrid()
ret i32 %1
}