xunge/DecIR huggingface dataset:
int dividing_code_p(int code) {
  switch (code) {
  case '\n':
  case '\r':
  case '\t':
  case ';':
  case ' ':
  case '(':
  case ')':
    return 1;
  default:
    return 0;
  }
}


x86 assembly (clang, -O0):
<dividing_code_p>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
add    $0xfffffff7,%eax
sub    $0x2,%eax
jb     1165 <dividing_code_p+0x65>
jmp    111e <dividing_code_p+0x1e>
mov    -0xc(%rbp),%eax
sub    $0xd,%eax
je     1165 <dividing_code_p+0x65>
jmp    112f <dividing_code_p+0x2f>
mov    -0xc(%rbp),%eax
sub    $0x20,%eax
je     1165 <dividing_code_p+0x65>
jmp    1140 <dividing_code_p+0x40>
mov    -0xc(%rbp),%eax
add    $0xffffffd8,%eax
sub    $0x2,%eax
jb     1165 <dividing_code_p+0x65>
jmp    1154 <dividing_code_p+0x54>
mov    -0xc(%rbp),%eax
sub    $0x3b,%eax
jne    1171 <dividing_code_p+0x71>
jmp    1165 <dividing_code_p+0x65>
movl   $0x1,-0x4(%rbp)
jmp    1178 <dividing_code_p+0x78>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<dividing_code_p>:
cmp    $0x3b,%edi
ja     111d <dividing_code_p+0x1d>
mov    $0x1,%eax
mov    %edi,%ecx
movabs $0x800030100002600,%rdx
bt     %rcx,%rdx
jae    111d <dividing_code_p+0x1d>
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @dividing_code_p(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %6 [
i32 10, label %5
i32 13, label %5
i32 9, label %5
i32 59, label %5
i32 32, label %5
i32 40, label %5
i32 41, label %5
]
5: ; preds = %1, %1, %1, %1, %1, %1, %1
store i32 1, i32* %2
br label %7
6: ; preds = %1
store i32 0, i32* %2
br label %7
7: ; preds = %6, %5
%8 = load i32, i32* %2
ret i32 %8
}

LLVM IR (-O2):
define i32 @dividing_code_p(i32 %0) {
switch i32 %0, label %2 [
i32 10, label %3
i32 13, label %3
i32 9, label %3
i32 59, label %3
i32 32, label %3
i32 40, label %3
i32 41, label %3
]
2: ; preds = %1
br label %3
3: ; preds = %1, %1, %1, %1, %1, %1, %1, %2
%4 = phi i32 [ 0, %2 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ]
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ OPER_PCDI_16();
int /*<<< orphan*/ m68ki_set_ccr(int /*<<< orphan*/);
void m68k_op_move_16_toc_pcdi(void) { m68ki_set_ccr(OPER_PCDI_16()); }


x86 assembly (clang, -O0):
<m68k_op_move_16_toc_pcdi>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <OPER_PCDI_16@plt>
mov    %eax,%edi
call   1040 <m68ki_set_ccr@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<m68k_op_move_16_toc_pcdi>:
push   %rax
xor    %eax,%eax
call   1030 <OPER_PCDI_16@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <m68ki_set_ccr@plt>

LLVM IR (-O0):
define void @m68k_op_move_16_toc_pcdi() {
%1 = call i32 (...) @OPER_PCDI_16()
%2 = call i32 @m68ki_set_ccr(i32 %1)
ret void
}

LLVM IR (-O2):
define void @m68k_op_move_16_toc_pcdi() {
%1 = tail call i32 (...) @OPER_PCDI_16()
%2 = tail call i32 @m68ki_set_ccr(i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isspace(int);
void t_isspace_0x3a() {
  Assert_real((isspace(58) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isspace.c",
              295, ("isspace should be 0 for :"));
}


x86 assembly (clang, -O0):
<t_isspace_0x3a>:
push   %rbp
mov    %rsp,%rbp
mov    $0x3a,%edi
call   1030 <isspace@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x127,%edx
lea    0xf5b(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isspace_0x3a>:
push   %rax
mov    $0x3a,%edi
call   1030 <isspace@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x127,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isspace.c\00"
@.str.1 = [26 x i8] c"isspace should be 0 for :\00"
define void @t_isspace_0x3a() {
%1 = call i64 @isspace(i32 58)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 295, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isspace.c\00"
@.str.1 = [26 x i8] c"isspace should be 0 for :\00"
define void @t_isspace_0x3a() {
%1 = tail call i64 @isspace(i32 58)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 295, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ printf(char *);
int main(void) {
  bool keep_going = true;
  while (keep_going) {
    printf("This will run as long as keep_going is true.\n");
    keep_going = false;
  }
  printf("Stopping!\n");
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1148 <main+0x38>
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x8(%rbp)
jmp    1126 <main+0x16>
lea    0xedf(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e85(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [46 x i8] c"This will run as long as keep_going is true.\0A\00"
@.str.1 = [11 x i8] c"Stopping!\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 1, i32* %2
br label %3
3: ; preds = %6, %0
%4 = load i32, i32* %2
%5 = icmp ne i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %3
%7 = call i32 @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %2
br label %3
8: ; preds = %3
%9 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%10 = load i32, i32* @EXIT_SUCCESS
ret i32 %10
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
@str = [10 x i8] c"Stopping!\00"
@str.2 = [45 x i8] c"This will run as long as keep_going is true.\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([45 x i8], [45 x i8]* @str.2, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @str, i64 0, i64 0))
%3 = load i32, i32* @EXIT_SUCCESS
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ bio_info_cb;
typedef int /*<<< orphan*/ BIO;

/* Variables and functions */
long BIO_callback_ctrl(int /*<<< orphan*/ *, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ *BIO_next(int /*<<< orphan*/ *);
long enc_callback_ctrl(BIO *b, int cmd, bio_info_cb *fp) {
  long ret = 1;
  BIO *next = BIO_next(b);
  if (next == NULL)
    return (0);
  switch (cmd) {
  default:
    ret = BIO_callback_ctrl(next, cmd, fp);
    break;
  }
  return (ret);
}


x86 assembly (clang, -O0):
<enc_callback_ctrl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
movq   $0x1,-0x28(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <BIO_next@plt>
mov    %rax,-0x30(%rbp)
cmpq   $0x0,-0x30(%rbp)
jne    1160 <enc_callback_ctrl+0x40>
movq   $0x0,-0x8(%rbp)
jmp    117c <enc_callback_ctrl+0x5c>
mov    -0x30(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0x20(%rbp),%rdx
call   1030 <BIO_callback_ctrl@plt>
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<enc_callback_ctrl>:
push   %rbp
push   %rbx
push   %rax
mov    %rdx,%rbx
mov    %esi,%ebp
call   1040 <BIO_next@plt>
test   %rax,%rax
je     1145 <enc_callback_ctrl+0x25>
mov    %rax,%rdi
mov    %ebp,%esi
mov    %rbx,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <BIO_callback_ctrl@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i64 @enc_callback_ctrl(i32* %0, i32 %1, i32* %2) {
%4 = alloca i64
%5 = alloca i32*
%6 = alloca i32
%7 = alloca i32*
%8 = alloca i64
%9 = alloca i32*
store i32* %0, i32** %5
store i32 %1, i32* %6
store i32* %2, i32** %7
store i64 1, i64* %8
%10 = load i32*, i32** %5
%11 = call i32* @BIO_next(i32* %10)
store i32* %11, i32** %9
%12 = load i32*, i32** %9
%13 = icmp eq i32* %12, null
br i1 %13, label %14, label %15
14: ; preds = %3
store i64 0, i64* %4
br label %24
15: ; preds = %3
%16 = load i32, i32* %6
switch i32 %16, label %17 [
]
17: ; preds = %15
%18 = load i32*, i32** %9
%19 = load i32, i32* %6
%20 = load i32*, i32** %7
%21 = call i64 @BIO_callback_ctrl(i32* %18, i32 %19, i32* %20)
store i64 %21, i64* %8
br label %22
22: ; preds = %17
%23 = load i64, i64* %8
store i64 %23, i64* %4
br label %24
24: ; preds = %22, %14
%25 = load i64, i64* %4
ret i64 %25
}

LLVM IR (-O2):
define i64 @enc_callback_ctrl(i32* %0, i32 %1, i32* %2) {
%4 = tail call i32* @BIO_next(i32* %0)
%5 = icmp eq i32* %4, null
br i1 %5, label %8, label %6
6: ; preds = %3
%7 = tail call i64 @BIO_callback_ctrl(i32* %4, i32 %1, i32* %2)
br label %8
8: ; preds = %3, %6
%9 = phi i64 [ %7, %6 ], [ 0, %3 ]
ret i64 %9
}
void g_signal_accumulator_true_handled() {}


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

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

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

LLVM IR (-O2):
define void @g_signal_accumulator_true_handled() {
ret void
}
void BSP_PLL_Init(void) { (*(volatile unsigned *)0x4C000004) = 0x00038022; }


x86 assembly (clang, -O0):
<BSP_PLL_Init>:
push   %rbp
mov    %rsp,%rbp
mov    $0x4c000004,%eax
movl   $0x38022,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<BSP_PLL_Init>:
movl   $0x38022,0x4c000004
ret

LLVM IR (-O0):
define void @BSP_PLL_Init() {
store volatile i32 229410, i32* inttoptr (i64 1275068420 to i32*)
ret void
}

LLVM IR (-O2):
define void @BSP_PLL_Init() {
store volatile i32 229410, i32* inttoptr (i64 1275068420 to i32*)
ret void
}
int fnFibonacci(int n) {
  if (0 == n)
    return 0;
  else if (1 == n)
    return 1;
  else {
    return fnFibonacci(n - 1) + fnFibonacci(n - 2);
  }
}


x86 assembly (clang, -O0):
<fnFibonacci>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
xor    %eax,%eax
cmp    -0x8(%rbp),%eax
jne    1132 <fnFibonacci+0x22>
movl   $0x0,-0x4(%rbp)
jmp    116f <fnFibonacci+0x5f>
mov    $0x1,%eax
cmp    -0x8(%rbp),%eax
jne    114c <fnFibonacci+0x3c>
movl   $0x1,-0x4(%rbp)
jmp    116f <fnFibonacci+0x5f>
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
call   1030 <fnFibonacci@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
sub    $0x2,%edi
call   1030 <fnFibonacci@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fnFibonacci>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
xor    %ebp,%ebp
cmp    $0x2,%ebx
jb     1132 <fnFibonacci+0x22>
nopl   0x0(%rax)
lea    -0x1(%rbx),%edi
call   1030 <fnFibonacci@plt>
add    %eax,%ebp
add    $0xfffffffe,%ebx
cmp    $0x2,%ebx
jae    1120 <fnFibonacci+0x10>
add    %ebp,%ebx
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @fnFibonacci(i32 %0) {
br label %2
2: ; preds = %6, %1
%3 = phi i32 [ 0, %1 ], [ %10, %6 ]
%4 = phi i32 [ %0, %1 ], [ %9, %6 ]
%5 = icmp ult i32 %4, 2
br i1 %5, label %11, label %6
6: ; preds = %2
%7 = add nsw i32 %4, -1
%8 = tail call i32 @fnFibonacci(i32 %7)
%9 = add nsw i32 %4, -2
%10 = add nsw i32 %8, %3
br label %2
11: ; preds = %2
%12 = add nsw i32 %4, %3
ret i32 %12
}
float Sleef_sinf_u10(float x) { return __builtin_sinf(x); }


x86 assembly (clang, -O0):
<Sleef_sinf_u10>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <sinf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Sleef_sinf_u10>:
jmp    1030 <sinf@plt>

LLVM IR (-O0):
define float @Sleef_sinf_u10(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call float @sinf(float %3)
ret float %4
}

LLVM IR (-O2):
define float @Sleef_sinf_u10(float %0) {
%2 = tail call float @sinf(float %0)
ret float %2
}
int getWriteLock(void *mem) {
  int *p = mem;
  return p[(3)];
}


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

x86 assembly (clang, -O2):
<getWriteLock>:
mov    0xc(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @getWriteLock(i8* %0) {
%2 = alloca i8*
%3 = alloca i32*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = bitcast i8* %4 to i32*
store i32* %5, i32** %3
%6 = load i32*, i32** %3
%7 = getelementptr inbounds i32, i32* %6, i64 3
%8 = load i32, i32* %7
ret i32 %8
}

LLVM IR (-O2):
define i32 @getWriteLock(i8* nocapture %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 12
%3 = bitcast i8* %2 to i32*
%4 = load i32, i32* %3
ret i32 %4
}
__attribute__((no, noclone)) unsigned __int128 t100_5add(signed char x) {
  unsigned __int128 r;
  if (__builtin_add_overflow(x, (signed char)(0), &r))
    bar();
  return r;
}


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %dil,%al
mov    %al,-0x11(%rbp)
movsbq -0x11(%rbp),%rdx
mov    %rdx,%rcx
sar    $0x3f,%rcx
mov    %cl,%al
and    $0x1,%al
mov    %rdx,-0x30(%rbp)
mov    %rcx,-0x28(%rbp)
test   $0x1,%al
jne    1143 <t100_5add+0x33>
jmp    114a <t100_5add+0x3a>
mov    $0x0,%al
call   1030 <bar@plt>
mov    -0x30(%rbp),%rax
mov    -0x28(%rbp),%rcx
mov    %rcx,-0x8(%rbp)
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rdx
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
push   %rbx
mov    %edi,%ebx
movslq %edi,%rax
sar    $0x3f,%rax
je     1123 <t100_5add+0x13>
xor    %eax,%eax
call   1030 <bar@plt>
movsbq %bl,%rax
mov    %eax,%ecx
sar    $0x7,%cl
movsbq %cl,%rdx
pop    %rbx
ret

LLVM IR (-O0):
define { i64, i64 } @t100_5add(i8 signext %0) {
%2 = alloca i128
%3 = alloca i8
%4 = alloca i128
store i8 %0, i8* %3
%5 = load i8, i8* %3
%6 = sext i8 %5 to i129
%7 = call { i129, i1 } @llvm.sadd.with.overflow.i129(i129 %6, i129 0)
%8 = extractvalue { i129, i1 } %7, 1
%9 = extractvalue { i129, i1 } %7, 0
%10 = trunc i129 %9 to i128
%11 = zext i128 %10 to i129
%12 = icmp ne i129 %9, %11
%13 = or i1 %8, %12
store i128 %10, i128* %4
br i1 %13, label %14, label %16
14: ; preds = %1
%15 = call i32 (...) @bar()
br label %16
16: ; preds = %14, %1
%17 = load i128, i128* %4
store i128 %17, i128* %2
%18 = bitcast i128* %2 to { i64, i64 }*
%19 = load { i64, i64 }, { i64, i64 }* %18
ret { i64, i64 } %19
}

LLVM IR (-O2):
define { i64, i64 } @t100_5add(i8 signext %0) {
%2 = sext i8 %0 to i129
%3 = sext i8 %0 to i128
%4 = zext i128 %3 to i129
%5 = icmp eq i129 %2, %4
br i1 %5, label %8, label %6
6: ; preds = %1
%7 = tail call i32 (...) @bar()
br label %8
8: ; preds = %6, %1
%9 = sext i8 %0 to i64
%10 = ashr i8 %0, 7
%11 = sext i8 %10 to i64
%12 = insertvalue { i64, i64 } poison, i64 %9, 0
%13 = insertvalue { i64, i64 } %12, i64 %11, 1
ret { i64, i64 } %13
}
/* Type definitions */
typedef int /*<<< orphan*/ buf;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
scalar_t__ read(int, char *, int);
void *listenForMessages(void *void_ptr) {
  char buf[512];
  int *sd = (int *)void_ptr;
  while (read(*sd, buf, sizeof(buf))) {
    printf("%s\n", buf);
  }
  return NULL;
}


x86 assembly (clang, -O0):
<listenForMessages>:
push   %rbp
mov    %rsp,%rbp
sub    $0x220,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x218(%rbp)
mov    -0x218(%rbp),%rax
mov    (%rax),%edi
lea    -0x210(%rbp),%rsi
mov    $0x200,%edx
call   1040 <read@plt>
cmp    $0x0,%rax
je     1176 <listenForMessages+0x56>
lea    -0x210(%rbp),%rsi
lea    0xe94(%rip),%rdi
call   1030 <printf@plt>
jmp    113a <listenForMessages+0x1a>
xor    %eax,%eax
add    $0x220,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<listenForMessages>:
push   %r15
push   %r14
push   %rbx
sub    $0x200,%rsp
mov    %rdi,%r15
mov    (%rdi),%edi
mov    %rsp,%rsi
mov    $0x200,%edx
call   1040 <read@plt>
test   %rax,%rax
je     1170 <listenForMessages+0x50>
lea    0xeb6(%rip),%r14
mov    %rsp,%rbx
nopl   (%rax)
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
mov    (%r15),%edi
mov    %rbx,%rsi
mov    $0x200,%edx
call   1040 <read@plt>
test   %rax,%rax
jne    1150 <listenForMessages+0x30>
xor    %eax,%eax
add    $0x200,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define noalias i8* @listenForMessages(i8* nocapture %0) {
%2 = alloca [512 x i8]
%3 = getelementptr inbounds [512 x i8], [512 x i8]* %2, i64 0, i64 0
%4 = bitcast i8* %0 to i32*
%5 = load i32, i32* %4
%6 = call i64 @read(i32 %5, i8* %3, i32 512)
%7 = icmp eq i64 %6, 0
br i1 %7, label %13, label %8
8: ; preds = %1, %8
%9 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %3)
%10 = load i32, i32* %4
%11 = call i64 @read(i32 %10, i8* %3, i32 512)
%12 = icmp eq i64 %11, 0
br i1 %12, label %13, label %8
13: ; preds = %8, %1
ret i8* null
}
/* Variables and functions */
int /*<<< orphan*/ do_send(int, char *);
void japi_terminate_recog(int sd) { do_send(sd, "TERMINATE\n"); }


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

x86 assembly (clang, -O2):
<japi_terminate_recog>:
lea    0xee9(%rip),%rsi
jmp    1030 <do_send@plt>

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

LLVM IR (-O2):
@.str = [11 x i8] c"TERMINATE\0A\00"
define void @japi_terminate_recog(i32 %0) {
%2 = tail call i32 @do_send(i32 %0, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
ret void
}
void bad_access(int *buf, int n) {
  for (int i = 0; i <= n; i++) {
    if (buf[i] != 0)
      return;
    buf[i] = 0;
  }
}


x86 assembly (clang, -O0):
<bad_access>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jg     1152 <bad_access+0x52>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
cmpl   $0x0,(%rax,%rcx,4)
je     1135 <bad_access+0x35>
jmp    1152 <bad_access+0x52>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movl   $0x0,(%rax,%rcx,4)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1112 <bad_access+0x12>
pop    %rbp
ret

x86 assembly (clang, -O2):
<bad_access>:
test   %esi,%esi
js     1126 <bad_access+0x26>
add    $0x1,%esi
xor    %eax,%eax
nopl   0x0(%rax)
cmpl   $0x0,(%rdi,%rax,4)
jne    1126 <bad_access+0x26>
movl   $0x0,(%rdi,%rax,4)
add    $0x1,%rax
cmp    %rax,%rsi
jne    1110 <bad_access+0x10>
ret

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

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

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char const *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, char const *);
void write_file(const char *name, const char *content) {
  FILE *out_file;
  out_file = fopen(name, "w");
  fprintf(out_file, "%s\n", content);
  fclose(out_file);
}


x86 assembly (clang, -O0):
<write_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xeb5(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rdx
lea    0xe9f(%rip),%rsi
call   1040 <fprintf@plt>
mov    -0x18(%rbp),%rdi
call   1030 <fclose@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_file>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
lea    0xec2(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,%rbx
lea    0xeb5(%rip),%rsi
mov    %rax,%rdi
mov    %r14,%rdx
call   1040 <fprintf@plt>
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <fclose@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"w\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define void @write_file(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32*
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
%7 = call i32* @fopen(i8* %6, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32* %7, i32** %5
%8 = load i32*, i32** %5
%9 = load i8*, i8** %4
%10 = call i32 @fprintf(i32* %8, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %9)
%11 = load i32*, i32** %5
%12 = call i32 @fclose(i32* %11)
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c"w\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define void @write_file(i8* nocapture %0, i8* %1) {
%3 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @fprintf(i32* %3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %1)
%5 = tail call i32 @fclose(i32* %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ put32(unsigned long);
int /*<<< orphan*/ put8(int);
void jge_near_rj(unsigned long saut) {
  put8(0x0F);
  put8(0x8D);
  put32(saut);
}


x86 assembly (clang, -O0):
<jge_near_rj>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0xf,%edi
call   1030 <put8@plt>
mov    $0x8d,%edi
call   1030 <put8@plt>
mov    -0x8(%rbp),%rdi
call   1040 <put32@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<jge_near_rj>:
push   %rbx
mov    %rdi,%rbx
mov    $0xf,%edi
call   1030 <put8@plt>
mov    $0x8d,%edi
call   1030 <put8@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <put32@plt>

LLVM IR (-O0):
define void @jge_near_rj(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = call i32 @put8(i32 15)
%4 = call i32 @put8(i32 141)
%5 = load i64, i64* %2
%6 = call i32 @put32(i64 %5)
ret void
}

LLVM IR (-O2):
define void @jge_near_rj(i64 %0) {
%2 = tail call i32 @put8(i32 15)
%3 = tail call i32 @put8(i32 141)
%4 = tail call i32 @put32(i64 %0)
ret void
}
/* Variables and functions */
int EOF;
int getchar();
int /*<<< orphan*/ printf(char *, int);
int main() {
  int in, chars;
  while ((in = getchar()) != EOF) {
    if (in != '\n') {
      ++chars;
    }
  }
  printf("number of chars is: %d\n", chars);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0x8(%rbp)
mov    0x2ea8(%rip),%rcx
cmp    (%rcx),%eax
je     1160 <main+0x40>
cmpl   $0xa,-0x8(%rbp)
je     115b <main+0x3b>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    112f <main+0xf>
mov    -0xc(%rbp),%esi
lea    0xe96(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
xor    %eax,%eax
call   1040 <getchar@plt>
mov    0x2eb6(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
xor    %ecx,%ecx
cmp    $0xa,%eax
setne  %cl
add    %ecx,%ebx
xor    %eax,%eax
call   1040 <getchar@plt>
cmp    (%r14),%eax
jne    1140 <main+0x20>
lea    0xea3(%rip),%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@EOF = global i32 0
@.str = [24 x i8] c"number of chars is: %d\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @getchar()
%2 = load i32, i32* @EOF
%3 = icmp ne i32 %1, %2
br label %4
4: ; preds = %0, %4
%5 = phi i32 [ %10, %4 ], [ %1, %0 ]
%6 = phi i32 [ %9, %4 ], [ undef, %0 ]
%7 = icmp ne i32 %5, 10
%8 = zext i1 %7 to i32
%9 = add nsw i32 %6, %8
%10 = tail call i32 (...) @getchar()
%11 = load i32, i32* @EOF
%12 = icmp eq i32 %10, %11
br i1 %12, label %13, label %4
13: ; preds = %4
%14 = tail call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 %9)
ret i32 0
}
void SetModelMass(double *subjectMass) {}


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

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

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

LLVM IR (-O2):
define void @SetModelMass(double* nocapture %0) {
ret void
}
void swap_key(int *a, int *b) {
  int tmp;
  tmp = *a;
  *a = *b;
  *b = tmp;
}


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

x86 assembly (clang, -O2):
<swap_key>:
mov    (%rdi),%eax
mov    (%rsi),%ecx
mov    %ecx,(%rdi)
mov    %eax,(%rsi)
ret

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

LLVM IR (-O2):
define void @swap_key(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %0
%4 = load i32, i32* %1
store i32 %4, i32* %0
store i32 %3, i32* %1
ret void
}
void interrupt_generate(unsigned priority) {}


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

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

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

LLVM IR (-O2):
define void @interrupt_generate(i32 %0) {
ret void
}
/* Variables and functions */
int is_comment_line(const char *line) {
  return (line == NULL || line[0] == '#');
}


x86 assembly (clang, -O0):
<is_comment_line>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    $0x1,%al
cmpq   $0x0,-0x8(%rbp)
mov    %al,-0x9(%rbp)
je     1128 <is_comment_line+0x28>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x23,%eax
sete   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_comment_line>:
test   %rdi,%rdi
je     110e <is_comment_line+0xe>
xor    %eax,%eax
cmpb   $0x23,(%rdi)
sete   %al
ret
mov    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @is_comment_line(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp eq i8* %3, null
br i1 %4, label %11, label %5
5: ; preds = %1
%6 = load i8*, i8** %2
%7 = getelementptr inbounds i8, i8* %6, i64 0
%8 = load i8, i8* %7
%9 = sext i8 %8 to i32
%10 = icmp eq i32 %9, 35
br label %11
11: ; preds = %5, %1
%12 = phi i1 [ true, %1 ], [ %10, %5 ]
%13 = zext i1 %12 to i32
ret i32 %13
}

LLVM IR (-O2):
define i32 @is_comment_line(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %7, label %3
3: ; preds = %1
%4 = load i8, i8* %0
%5 = icmp eq i8 %4, 35
%6 = zext i1 %5 to i32
br label %7
7: ; preds = %3, %1
%8 = phi i32 [ 1, %1 ], [ %6, %3 ]
ret i32 %8
}
/* Type definitions */
struct tempfile {
  int dummy;
};

/* Variables and functions */
int mks_tempfile_tsm(struct tempfile *, char const *, int /*<<< orphan*/, int);
int mks_tempfile_tm(struct tempfile *tempfile, const char *template, int mode) {
  return mks_tempfile_tsm(tempfile, template, 0, mode);
}


x86 assembly (clang, -O0):
<mks_tempfile_tm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%ecx
xor    %edx,%edx
call   1030 <mks_tempfile_tsm@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mks_tempfile_tm>:
mov    %edx,%ecx
xor    %edx,%edx
jmp    1030 <mks_tempfile_tsm@plt>

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

LLVM IR (-O2):
%struct.tempfile = type { i32 }
define i32 @mks_tempfile_tm(%struct.tempfile* %0, i8* %1, i32 %2) {
%4 = tail call i32 @mks_tempfile_tsm(%struct.tempfile* %0, i8* %1, i32 0, i32 %2)
ret i32 %4
}
double sub(double m1, double m2) { return m1 - m2; }


x86 assembly (clang, -O0):
<sub>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
subsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<sub>:
subsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @sub(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 = fsub double %5, %6
ret double %7
}

LLVM IR (-O2):
define double @sub(double %0, double %1) {
%3 = fsub double %0, %1
ret double %3
}
int xmlUCSIsYiRadicals(int code) {
  return (((code >= 0xA490) && (code <= 0xA4CF)));
}


x86 assembly (clang, -O0):
<xmlUCSIsYiRadicals>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0xa490,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jl     1126 <xmlUCSIsYiRadicals+0x26>
cmpl   $0xa4cf,-0x4(%rbp)
setle  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmlUCSIsYiRadicals>:
add    $0xffff5b70,%edi
xor    %eax,%eax
cmp    $0x40,%edi
setb   %al
ret

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

LLVM IR (-O2):
define i32 @xmlUCSIsYiRadicals(i32 %0) {
%2 = add i32 %0, -42128
%3 = icmp ult i32 %2, 64
%4 = zext i1 %3 to i32
ret i32 %4
}
unsigned short __atomic_fetch_add_2(volatile void *atom, unsigned short value,
                                    int memorder) {
  unsigned short xchg;
  unsigned short cmp;
  __atomic_load((unsigned short *)atom, (unsigned short *)&cmp, 0);
  do {
    xchg = ((cmp + value));
  } while (
      !__atomic_compare_exchange((unsigned short *)atom, &cmp, &xchg, 1, 5, 5));
  return cmp;
}


x86 assembly (clang, -O0):
<__atomic_fetch_add_2>:
push   %rbp
mov    %rsp,%rbp
mov    %si,%ax
mov    %rdi,-0x8(%rbp)
mov    %ax,-0xa(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%ax
mov    %ax,-0x14(%rbp)
movzwl -0x14(%rbp),%eax
movzwl -0xa(%rbp),%ecx
add    %ecx,%eax
mov    %ax,-0x12(%rbp)
mov    -0x8(%rbp),%rcx
mov    -0x14(%rbp),%ax
mov    -0x12(%rbp),%dx
lock cmpxchg %dx,(%rcx)
mov    %ax,%cx
sete   %al
mov    %al,-0x19(%rbp)
mov    %cx,-0x18(%rbp)
test   $0x1,%al
jne    1159 <__atomic_fetch_add_2+0x59>
mov    -0x18(%rbp),%ax
mov    %ax,-0x14(%rbp)
mov    -0x19(%rbp),%al
and    $0x1,%al
mov    %al,-0x15(%rbp)
mov    -0x15(%rbp),%al
xor    $0xff,%al
test   $0x1,%al
jne    111d <__atomic_fetch_add_2+0x1d>
movzwl -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__atomic_fetch_add_2>:
movzwl (%rdi),%eax
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %eax,%ecx
lea    (%rcx,%rsi,1),%edx
lock cmpxchg %dx,(%rdi)
jne    1110 <__atomic_fetch_add_2+0x10>
mov    %ecx,%eax
ret

LLVM IR (-O0):
define zeroext i16 @__atomic_fetch_add_2(i8* %0, i16 zeroext %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i16
%6 = alloca i32
%7 = alloca i16
%8 = alloca i16
%9 = alloca i8
store i8* %0, i8** %4
store i16 %1, i16* %5
store i32 %2, i32* %6
%10 = load i8*, i8** %4
%11 = bitcast i8* %10 to i16*
%12 = load atomic i16, i16* %11 monotonic
store i16 %12, i16* %8
br label %13
13: ; preds = %29, %3
%14 = load i16, i16* %8
%15 = zext i16 %14 to i32
%16 = load i16, i16* %5
%17 = zext i16 %16 to i32
%18 = add nsw i32 %15, %17
%19 = trunc i32 %18 to i16
store i16 %19, i16* %7
br label %20
20: ; preds = %13
%21 = load i8*, i8** %4
%22 = bitcast i8* %21 to i16*
%23 = load i16, i16* %8
%24 = load i16, i16* %7
%25 = cmpxchg weak i16* %22, i16 %23, i16 %24 seq_cst seq_cst
%26 = extractvalue { i16, i1 } %25, 0
%27 = extractvalue { i16, i1 } %25, 1
br i1 %27, label %29, label %28
28: ; preds = %20
store i16 %26, i16* %8
br label %29
29: ; preds = %28, %20
%30 = zext i1 %27 to i8
store i8 %30, i8* %9
%31 = load i8, i8* %9
%32 = trunc i8 %31 to i1
%33 = xor i1 %32, true
br i1 %33, label %13, label %34
34: ; preds = %29
%35 = load i16, i16* %8
ret i16 %35
}

LLVM IR (-O2):
define zeroext i16 @__atomic_fetch_add_2(i8* nocapture %0, i16 zeroext %1, i32 %2) {
%4 = bitcast i8* %0 to i16*
%5 = load atomic i16, i16* %4 monotonic
br label %6
6: ; preds = %6, %3
%7 = phi i16 [ %5, %3 ], [ %11, %6 ]
%8 = add i16 %7, %1
%9 = cmpxchg weak i16* %4, i16 %7, i16 %8 seq_cst seq_cst
%10 = extractvalue { i16, i1 } %9, 1
%11 = extractvalue { i16, i1 } %9, 0
br i1 %10, label %12, label %6
12: ; preds = %6
ret i16 %7
}
double ceil(double x) {
  int intRoundsDown = (int)x;
  if (x == (double)intRoundsDown) {
    return intRoundsDown;
  } else {
    return ((double)intRoundsDown) + 1;
  }
}


x86 assembly (clang, -O0):
<ceil>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
cvttsd2si -0x10(%rbp),%eax
mov    %eax,-0x14(%rbp)
movsd  -0x10(%rbp),%xmm0
cvtsi2sdl -0x14(%rbp),%xmm1
ucomisd %xmm1,%xmm0
jne    113a <ceil+0x3a>
jp     113a <ceil+0x3a>
cvtsi2sdl -0x14(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1150 <ceil+0x50>
cvtsi2sdl -0x14(%rbp),%xmm0
movsd  0xeb9(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<ceil>:
cvttpd2dq %xmm0,%xmm1
cvtdq2pd %xmm1,%xmm1
movsd  0xef0(%rip),%xmm2
addsd  %xmm1,%xmm2
cmpeqsd %xmm1,%xmm0
andpd  %xmm0,%xmm1
andnpd %xmm2,%xmm0
orpd   %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @ceil(double %0) {
%2 = alloca double
%3 = alloca double
%4 = alloca i32
store double %0, double* %3
%5 = load double, double* %3
%6 = fptosi double %5 to i32
store i32 %6, i32* %4
%7 = load double, double* %3
%8 = load i32, i32* %4
%9 = sitofp i32 %8 to double
%10 = fcmp oeq double %7, %9
br i1 %10, label %11, label %14
11: ; preds = %1
%12 = load i32, i32* %4
%13 = sitofp i32 %12 to double
store double %13, double* %2
br label %18
14: ; preds = %1
%15 = load i32, i32* %4
%16 = sitofp i32 %15 to double
%17 = fadd double %16, 1.000000e+00
store double %17, double* %2
br label %18
18: ; preds = %14, %11
%19 = load double, double* %2
ret double %19
}

LLVM IR (-O2):
define double @ceil(double %0) {
%2 = fptosi double %0 to i32
%3 = sitofp i32 %2 to double
%4 = fcmp oeq double %3, %0
%5 = fadd double %3, 1.000000e+00
%6 = select i1 %4, double %3, double %5
ret double %6
}
/* Variables and functions */
int rand();
void main() {
  int a = 0;
  int b = 100;
  b = rand();
  a = 40;
  if (a + b == 42 && b == 7) {
  ERROR:
    return;
  }
  return;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x64,-0x8(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
mov    %eax,-0x8(%rbp)
movl   $0x28,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
cmp    $0x2a,%eax
jne    115a <main+0x4a>
cmpl   $0x7,-0x8(%rbp)
jne    115a <main+0x4a>
jmp    1155 <main+0x45>
jmp    115f <main+0x4f>
jmp    115f <main+0x4f>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 100, i32* %2
%3 = call i32 (...) @rand()
store i32 %3, i32* %2
store i32 40, i32* %1
%4 = load i32, i32* %1
%5 = load i32, i32* %2
%6 = add nsw i32 %4, %5
%7 = icmp eq i32 %6, 42
br i1 %7, label %8, label %13
8: ; preds = %0
%9 = load i32, i32* %2
%10 = icmp eq i32 %9, 7
br i1 %10, label %11, label %13
11: ; preds = %8
br label %12
12: ; preds = %11
br label %14
13: ; preds = %8, %0
br label %14
14: ; preds = %13, %12
ret void
}

LLVM IR (-O2):
define void @main() {
%1 = tail call i32 (...) @rand()
ret void
}
int gmp_detect_endian(void) {
  static const int i = 1;
  const unsigned char *p = (const unsigned char *)&i;
  if (*p == 1)
    return -1;
  else
    return 1;
}


x86 assembly (clang, -O0):
<gmp_detect_endian>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movzbl (%rax),%eax
cmp    $0x1,%eax
jne    112b <gmp_detect_endian+0x2b>
movl   $0xffffffff,-0x4(%rbp)
jmp    1132 <gmp_detect_endian+0x32>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@gmp_detect_endian.i = internal constant i32 1
define i32 @gmp_detect_endian() {
%1 = alloca i32
%2 = alloca i8*
store i8* bitcast (i32* @gmp_detect_endian.i to i8*), i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = zext i8 %4 to i32
%6 = icmp eq i32 %5, 1
br i1 %6, label %7, label %8
7: ; preds = %0
store i32 -1, i32* %1
br label %9
8: ; preds = %0
store i32 1, i32* %1
br label %9
9: ; preds = %8, %7
%10 = load i32, i32* %1
ret i32 %10
}

LLVM IR (-O2):
define i32 @gmp_detect_endian() {
ret i32 -1
}
unsigned short get_u16(void *addr) {
  unsigned char *b = addr;
  return ((b[0] << 8) | (b[1] << 0));
}


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

x86 assembly (clang, -O2):
<get_u16>:
movzwl (%rdi),%eax
rol    $0x8,%ax
ret

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

LLVM IR (-O2):
define zeroext i16 @get_u16(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = zext i8 %2 to i16
%4 = shl nuw i16 %3, 8
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = load i8, i8* %5
%7 = zext i8 %6 to i16
%8 = or i16 %4, %7
ret i16 %8
}
/* Variables and functions */
char *SafeMalloc(int);
int strlen(char const *);
int /*<<< orphan*/ strncpy(char *, char const *, int);
char *StrDup(const char *zSrc, int nByte) {
  char *zDest;
  if (nByte <= 0) {
    nByte = strlen(zSrc);
  }
  zDest = SafeMalloc(nByte + 1);
  strncpy(zDest, zSrc, nByte);
  zDest[nByte] = 0;
  return zDest;
}


x86 assembly (clang, -O0):
<StrDup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jg     1155 <StrDup+0x25>
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%edi
add    $0x1,%edi
call   1050 <SafeMalloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
call   1030 <strncpy@plt>
mov    -0x18(%rbp),%rax
movslq -0xc(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<StrDup>:
push   %r15
push   %r14
push   %rbx
mov    %esi,%r15d
mov    %rdi,%r14
test   %esi,%esi
jg     114a <StrDup+0x1a>
mov    %r14,%rdi
call   1040 <strlen@plt>
mov    %eax,%r15d
lea    0x1(%r15),%edi
call   1050 <SafeMalloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
mov    %r15d,%edx
call   1030 <strncpy@plt>
movslq %r15d,%rax
movb   $0x0,(%rbx,%rax,1)
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i8* @StrDup(i8* %0, i32 %1) {
%3 = icmp slt i32 %1, 1
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i32 @strlen(i8* %0)
br label %6
6: ; preds = %4, %2
%7 = phi i32 [ %5, %4 ], [ %1, %2 ]
%8 = add nsw i32 %7, 1
%9 = tail call i8* @SafeMalloc(i32 %8)
%10 = tail call i32 @strncpy(i8* %9, i8* %0, i32 %7)
%11 = sext i32 %7 to i64
%12 = getelementptr inbounds i8, i8* %9, i64 %11
store i8 0, i8* %12
ret i8* %9
}
void f5(void) {
  int i;
#pragma omp for
  for (i = 0; i < 10; i++) {
#pragma omp ordered
    ;
  }
#pragma omp for ordered
  for (i = 0; i < 10; i++) {
#pragma omp ordered
    ;
  }
}


x86 assembly (clang, -O0):
<f5>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
cmpl   $0xa,-0x4(%rbp)
jge    1128 <f5+0x28>
jmp    111a <f5+0x1a>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    110b <f5+0xb>
movl   $0x0,-0x4(%rbp)
cmpl   $0xa,-0x4(%rbp)
jge    114c <f5+0x4c>
jmp    113e <f5+0x3e>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    112f <f5+0x2f>
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @f5() {
ret void
}
extern int int_to_int(int x, int k) { return x + k; }


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

x86 assembly (clang, -O2):
<int_to_int>:
lea    (%rdi,%rsi,1),%eax
ret

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

LLVM IR (-O2):
define i32 @int_to_int(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
ret i32 %3
}