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

/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
uint8_t udiv8(uint8_t a, uint8_t b) {
  uint8_t r;
  if (b == 0) {
    fprintf(stderr, "Should not happen\n");
    exit(EXIT_FAILURE);
  }
  r = a / b;
  return r;
}


x86 assembly (clang, -O0):
<udiv8>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    115b <udiv8+0x3b>
mov    0x2ea1(%rip),%rax
mov    (%rax),%edi
lea    0xeb8(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e84(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<udiv8>:
test   %esi,%esi
je     112a <udiv8+0xa>
mov    %edi,%eax
cltd
idiv   %esi
ret
push   %rax
mov    0x2eae(%rip),%rax
mov    (%rax),%edi
lea    0xec5(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e91(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [19 x i8] c"Should not happen\0A\00"
@EXIT_FAILURE = global i32 0
define i32 @udiv8(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* %4
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %13
8: ; preds = %2
%9 = load i32, i32* @stderr
%10 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%11 = load i32, i32* @EXIT_FAILURE
%12 = call i32 @exit(i32 %11)
unreachable
13: ; preds = %2
%14 = load i32, i32* %3
%15 = load i32, i32* %4
%16 = sdiv i32 %14, %15
store i32 %16, i32* %5
%17 = load i32, i32* %5
ret i32 %17
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [19 x i8] c"Should not happen\0A\00"
@EXIT_FAILURE = global i32 0
define i32 @udiv8(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %4, label %9
4: ; preds = %2
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%7 = load i32, i32* @EXIT_FAILURE
%8 = tail call i32 @exit(i32 %7)
unreachable
9: ; preds = %2
%10 = sdiv i32 %0, %1
ret i32 %10
}
void f3() {}


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

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

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

LLVM IR (-O2):
define void @f3() {
ret void
}
/* Type definitions */
typedef scalar_t__ int32_t;

/* Variables and functions */
void ref_sub_int32_t(int32_t arg1, int32_t arg2, int32_t *result) {
  *result = arg1 - arg2;
}


x86 assembly (clang, -O0):
<ref_sub_int32_t>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rcx
sub    -0x10(%rbp),%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<ref_sub_int32_t>:
sub    %rsi,%rdi
mov    %rdi,(%rdx)
ret

LLVM IR (-O0):
define void @ref_sub_int32_t(i64 %0, i64 %1, i64* %2) {
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64*
store i64 %0, i64* %4
store i64 %1, i64* %5
store i64* %2, i64** %6
%7 = load i64, i64* %4
%8 = load i64, i64* %5
%9 = sub nsw i64 %7, %8
%10 = load i64*, i64** %6
store i64 %9, i64* %10
ret void
}

LLVM IR (-O2):
define void @ref_sub_int32_t(i64 %0, i64 %1, i64* nocapture writeonly %2) {
%4 = sub nsw i64 %0, %1
store i64 %4, i64* %2
ret void
}
unsigned int strhash(const char *s, unsigned int len) {
  unsigned int hash;
  for (hash = 0; *s; s++) {
    hash = (hash * 9) ^ *s;
  }
  return hash % len;
}


x86 assembly (clang, -O0):
<strhash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1140 <strhash+0x40>
imul   $0x9,-0x10(%rbp),%eax
mov    -0x8(%rbp),%rcx
movsbl (%rcx),%ecx
xor    %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1112 <strhash+0x12>
mov    -0x10(%rbp),%eax
xor    %edx,%edx
divl   -0xc(%rbp)
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strhash>:
mov    (%rdi),%cl
test   %cl,%cl
je     1125 <strhash+0x25>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
lea    (%rax,%rax,8),%edx
movsbl %cl,%eax
xor    %edx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <strhash+0x10>
jmp    1127 <strhash+0x27>
xor    %eax,%eax
xor    %edx,%edx
div    %esi
mov    %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @strhash(i8* nocapture %0, i32 %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %15, label %5
5: ; preds = %2, %5
%6 = phi i8 [ %13, %5 ], [ %3, %2 ]
%7 = phi i32 [ %11, %5 ], [ 0, %2 ]
%8 = phi i8* [ %12, %5 ], [ %0, %2 ]
%9 = mul i32 %7, 9
%10 = sext i8 %6 to i32
%11 = xor i32 %9, %10
%12 = getelementptr inbounds i8, i8* %8, i64 1
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %5
15: ; preds = %5, %2
%16 = phi i32 [ 0, %2 ], [ %11, %5 ]
%17 = urem i32 %16, %1
ret i32 %17
}
int _rl_restore_tty_signals() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @_rl_restore_tty_signals() {
ret i32 0
}
int hashcode(int capacity, const char *lexeme) {
  int c;
  unsigned long hash = 5381;
  while ((c = *lexeme++))
    hash = ((hash << 5) + hash) + c;
  return (hash % capacity);
}


x86 assembly (clang, -O0):
<hashcode>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x1505,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movsbl (%rax),%eax
mov    %eax,-0x14(%rbp)
cmp    $0x0,%eax
je     114d <hashcode+0x4d>
mov    -0x20(%rbp),%rax
shl    $0x5,%rax
add    -0x20(%rbp),%rax
movslq -0x14(%rbp),%rcx
add    %rcx,%rax
mov    %rax,-0x20(%rbp)
jmp    1113 <hashcode+0x13>
mov    -0x20(%rbp),%rax
movslq -0x4(%rbp),%rcx
xor    %edx,%edx
div    %rcx
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hashcode>:
mov    (%rsi),%cl
test   %cl,%cl
je     112e <hashcode+0x2e>
add    $0x1,%rsi
mov    $0x1505,%eax
nop
mov    %rax,%rdx
shl    $0x5,%rdx
add    %rax,%rdx
movsbq %cl,%rax
add    %rdx,%rax
movzbl (%rsi),%ecx
add    $0x1,%rsi
test   %cl,%cl
jne    1110 <hashcode+0x10>
jmp    1133 <hashcode+0x33>
mov    $0x1505,%eax
movslq %edi,%rcx
mov    %rax,%rdx
or     %rcx,%rdx
shr    $0x20,%rdx
je     114b <hashcode+0x4b>
xor    %edx,%edx
div    %rcx
mov    %rdx,%rax
ret
xor    %edx,%edx
div    %edi
mov    %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @hashcode(i32 %0, i8* nocapture %1) {
%3 = load i8, i8* %1
%4 = icmp eq i8 %3, 0
br i1 %4, label %15, label %5
5: ; preds = %2, %5
%6 = phi i8 [ %13, %5 ], [ %3, %2 ]
%7 = phi i64 [ %12, %5 ], [ 5381, %2 ]
%8 = phi i8* [ %9, %5 ], [ %1, %2 ]
%9 = getelementptr inbounds i8, i8* %8, i64 1
%10 = mul i64 %7, 33
%11 = sext i8 %6 to i64
%12 = add i64 %10, %11
%13 = load i8, i8* %9
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %5
15: ; preds = %5, %2
%16 = phi i64 [ 5381, %2 ], [ %12, %5 ]
%17 = sext i32 %0 to i64
%18 = urem i64 %16, %17
%19 = trunc i64 %18 to i32
ret i32 %19
}
void ARGBLumaColorTableRow_C() {}


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

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

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

LLVM IR (-O2):
define void @ARGBLumaColorTableRow_C() {
ret void
}
/* Variables and functions */
void *realloc(void *, size_t);
int /*<<< orphan*/ xalloc_die();
void *xrealloc(void *p, size_t n) {
  p = realloc(p, n);
  if (p == 0)
    xalloc_die();
  return p;
}


x86 assembly (clang, -O0):
<xrealloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <realloc@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1153 <xrealloc+0x33>
mov    $0x0,%al
call   1030 <xalloc_die@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrealloc>:
push   %rbx
call   1040 <realloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1135 <xrealloc+0x15>
xor    %eax,%eax
call   1030 <xalloc_die@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @xrealloc(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i8*, i8** %3
%6 = load i64, i64* %4
%7 = call i8* @realloc(i8* %5, i64 %6)
store i8* %7, i8** %3
%8 = load i8*, i8** %3
%9 = icmp eq i8* %8, null
br i1 %9, label %10, label %12
10: ; preds = %2
%11 = call i32 (...) @xalloc_die()
br label %12
12: ; preds = %10, %2
%13 = load i8*, i8** %3
ret i8* %13
}

LLVM IR (-O2):
define noalias i8* @xrealloc(i8* nocapture %0, i64 %1) {
%3 = tail call i8* @realloc(i8* %0, i64 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 (...) @xalloc_die()
br label %7
7: ; preds = %5, %2
ret i8* %3
}
int test_imm_26int64_highword_mem(long long *val) {
  return ((*val >> 32) & (0x26 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_26int64_highword_mem>:
testb  $0x26,0x4(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_26int64_highword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 163208757248
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
int IsValidGencode(const int gencode) {
  if (0 == gencode || 1 == gencode)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<IsValidGencode>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
xor    %eax,%eax
cmp    -0x8(%rbp),%eax
je     1120 <IsValidGencode+0x20>
mov    $0x1,%eax
cmp    -0x8(%rbp),%eax
jne    112c <IsValidGencode+0x2c>
movl   $0x1,-0x4(%rbp)
jmp    1133 <IsValidGencode+0x33>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<IsValidGencode>:
xor    %eax,%eax
cmp    $0x2,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @IsValidGencode(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 %9, label %6
6: ; preds = %1
%7 = load i32, i32* %3
%8 = icmp eq i32 1, %7
br i1 %8, label %9, label %10
9: ; preds = %6, %1
store i32 1, i32* %2
br label %11
10: ; preds = %6
store i32 0, i32* %2
br label %11
11: ; preds = %10, %9
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
define i32 @IsValidGencode(i32 %0) {
%2 = icmp ult i32 %0, 2
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ ao();
int /*<<< orphan*/ mav(int, int);
int /*<<< orphan*/ msleep(int);
int main() {
  mav(0, 2000);
  mav(2, 2000);
  msleep(4000);
  ao();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xor    %edi,%edi
mov    $0x7d0,%esi
call   1040 <mav@plt>
mov    $0x2,%edi
mov    $0x7d0,%esi
call   1040 <mav@plt>
mov    $0xfa0,%edi
call   1030 <msleep@plt>
mov    $0x0,%al
call   1050 <ao@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
mov    $0x7d0,%esi
call   1040 <mav@plt>
mov    $0x2,%edi
mov    $0x7d0,%esi
call   1040 <mav@plt>
mov    $0xfa0,%edi
call   1030 <msleep@plt>
xor    %eax,%eax
call   1050 <ao@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @mav(i32 0, i32 2000)
%3 = call i32 @mav(i32 2, i32 2000)
%4 = call i32 @msleep(i32 4000)
%5 = call i32 (...) @ao()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @mav(i32 0, i32 2000)
%2 = tail call i32 @mav(i32 2, i32 2000)
%3 = tail call i32 @msleep(i32 4000)
%4 = tail call i32 (...) @ao()
ret i32 0
}
__attribute__((visibility("default"))) const char *utf8proc_version(void) {
  return "1"
         "."
         "3"
         "."
         "0"
         "";
}


x86 assembly (clang, -O0):
<utf8proc_version>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<utf8proc_version>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [6 x i8] c"1.3.0\00"
define i8* @utf8proc_version() {
ret i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [6 x i8] c"1.3.0\00"
define i8* @utf8proc_version() {
ret i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0)
}
int g(i)
int i __attribute__((__unused__));
{ return 0; }


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

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

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

LLVM IR (-O2):
define i32 @g(i32 %0) {
ret i32 0
}
double hr2ang(angle)
char *angle;
{
  double deg;
  deg = str2dec(angle);
  deg = deg * 15.0;
  return (deg);
}


x86 assembly (clang, -O0):
<hr2ang>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1030 <str2dec@plt>
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  0xec8(%rip),%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hr2ang>:
push   %rax
xor    %eax,%eax
call   1030 <str2dec@plt>
cvtsi2sd %eax,%xmm0
mulsd  0xedc(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @hr2ang(i8* %0) {
%2 = alloca i8*
%3 = alloca double
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 (i8*, ...) bitcast (i32 (...)* @str2dec to i32 (i8*, ...)*)(i8* %4)
%6 = sitofp i32 %5 to double
store double %6, double* %3
%7 = load double, double* %3
%8 = fmul double %7, 1.500000e+01
store double %8, double* %3
%9 = load double, double* %3
ret double %9
}

LLVM IR (-O2):
define double @hr2ang(i8* %0) {
%2 = tail call i32 (i8*, ...) bitcast (i32 (...)* @str2dec to i32 (i8*, ...)*)(i8* %0)
%3 = sitofp i32 %2 to double
%4 = fmul double %3, 1.500000e+01
ret double %4
}
void foo627() {}


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

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

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

LLVM IR (-O2):
define void @foo627() {
ret void
}
/* Type definitions */
struct v7_call_frame_private {
  int dummy;
};
struct v7 {
  int dummy;
};

/* Variables and functions */
scalar_t__ find_call_frame(struct v7 *, int);
struct v7_call_frame_private *find_call_frame_private(struct v7 *v7) {
  return (struct v7_call_frame_private *)find_call_frame(v7, (1 << 1));
}


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

x86 assembly (clang, -O2):
<find_call_frame_private>:
mov    $0x2,%esi
jmp    1030 <find_call_frame@plt>

LLVM IR (-O0):
%struct.v7_call_frame_private = type { i32 }
%struct.v7 = type { i32 }
define %struct.v7_call_frame_private* @find_call_frame_private(%struct.v7* %0) {
%2 = alloca %struct.v7*
store %struct.v7* %0, %struct.v7** %2
%3 = load %struct.v7*, %struct.v7** %2
%4 = call i64 @find_call_frame(%struct.v7* %3, i32 2)
%5 = inttoptr i64 %4 to %struct.v7_call_frame_private*
ret %struct.v7_call_frame_private* %5
}

LLVM IR (-O2):
%struct.v7_call_frame_private = type { i32 }
%struct.v7 = type { i32 }
define %struct.v7_call_frame_private* @find_call_frame_private(%struct.v7* %0) {
%2 = tail call i64 @find_call_frame(%struct.v7* %0, i32 2)
%3 = inttoptr i64 %2 to %struct.v7_call_frame_private*
ret %struct.v7_call_frame_private* %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
main() {
  int a;
  printf("Enter a number:");
  scanf("%d", &a);
  if (((a >> 31) & 1) == 1)
    printf("negative\n");
  else
    printf("positive\n");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
call   1030 <printf@plt>
lea    0xece(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
sar    $0x1f,%eax
and    $0x1,%eax
cmp    $0x1,%eax
jne    116e <main+0x4e>
lea    0xeaf(%rip),%rdi
call   1030 <printf@plt>
jmp    117a <main+0x5a>
lea    0xea8(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
call   1040 <printf@plt>
lea    0xecc(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
cmpl   $0x0,0x4(%rsp)
lea    0xec2(%rip),%rax
lea    0xeb2(%rip),%rdi
cmovs  %rax,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [16 x i8] c"Enter a number:\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [10 x i8] c"negative\0A\00"
@.str.3 = [10 x i8] c"positive\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%5 = load i32, i32* %2
%6 = ashr i32 %5, 31
%7 = and i32 %6, 1
%8 = icmp eq i32 %7, 1
br i1 %8, label %9, label %11
9: ; preds = %0
%10 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0))
br label %13
11: ; preds = %0
%12 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0))
br label %13
13: ; preds = %11, %9
%14 = load i32, i32* %1
ret i32 %14
}

LLVM IR (-O2):
@.str = [16 x i8] c"Enter a number:\00"
@.str.1 = [3 x i8] c"%d\00"
@str = [9 x i8] c"positive\00"
@str.4 = [9 x i8] c"negative\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = icmp slt i32 %5, 0
%7 = select i1 %6, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @str.4, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @str, i64 0, i64 0)
%8 = call i32 @puts(i8* dereferenceable(1) %7)
ret i32 0
}
int isprint(int ch) { return (ch >= 32 && ch < 127); }


x86 assembly (clang, -O0):
<isprint>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x20,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jl     1120 <isprint+0x20>
cmpl   $0x7f,-0x4(%rbp)
setl   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isprint>:
add    $0xffffffe0,%edi
xor    %eax,%eax
cmp    $0x5f,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @isprint(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 32
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp slt i32 %6, 127
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 @isprint(i32 %0) {
%2 = add i32 %0, -32
%3 = icmp ult i32 %2, 95
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ Init();
void _M2_twoDsim_init(__attribute__((unused)) int argc,
                      __attribute__((unused)) char *argv[]) {
  Init();
}


x86 assembly (clang, -O0):
<_M2_twoDsim_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <Init@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @_M2_twoDsim_init(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = call i32 (...) @Init()
ret void
}

LLVM IR (-O2):
define void @_M2_twoDsim_init(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @Init()
ret void
}
void stub_state_pre_print(struct stub_state *s) {}


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

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

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

LLVM IR (-O2):
%struct.stub_state = type opaque
define void @stub_state_pre_print(%struct.stub_state* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ pushNarray(char *, unsigned int);
void pushbooleanarray_(char *x, unsigned int *n) { pushNarray(x, (*n * 4)); }


x86 assembly (clang, -O0):
<pushbooleanarray_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    (%rax),%esi
shl    $0x2,%esi
call   1030 <pushNarray@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pushbooleanarray_>:
mov    (%rsi),%esi
shl    $0x2,%esi
jmp    1030 <pushNarray@plt>

LLVM IR (-O0):
define void @pushbooleanarray_(i8* %0, i32* %1) {
%3 = alloca i8*
%4 = alloca i32*
store i8* %0, i8** %3
store i32* %1, i32** %4
%5 = load i8*, i8** %3
%6 = load i32*, i32** %4
%7 = load i32, i32* %6
%8 = mul i32 %7, 4
%9 = call i32 @pushNarray(i8* %5, i32 %8)
ret void
}

LLVM IR (-O2):
define void @pushbooleanarray_(i8* %0, i32* nocapture %1) {
%3 = load i32, i32* %1
%4 = shl i32 %3, 2
%5 = tail call i32 @pushNarray(i8* %0, i32 %4)
ret void
}
/* Type definitions */
typedef int uint8_t;
typedef int uint32_t;
typedef int volatile int8_t;

/* Variables and functions */
uint8_t GPIO_get(uint8_t pin) {
  ;
  int8_t get1 = pin - 32;
  if (get1 < 0)
    return (*((volatile uint32_t *)(0x00200034))) >> get1;
  else
    return (*((volatile uint32_t *)(0x00200038))) >> pin;
}


x86 assembly (clang, -O0):
<GPIO_get>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
sub    $0x20,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    $0x0,%eax
jge    1130 <GPIO_get+0x30>
mov    $0x200034,%eax
mov    (%rax),%eax
mov    -0xc(%rbp),%ecx
sar    %cl,%eax
mov    %eax,-0x4(%rbp)
jmp    113f <GPIO_get+0x3f>
mov    $0x200038,%eax
mov    (%rax),%eax
mov    -0x8(%rbp),%ecx
sar    %cl,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<GPIO_get>:
lea    -0x20(%rdi),%eax
mov    %eax,-0x4(%rsp)
cmpl   $0x0,-0x4(%rsp)
js     111a <GPIO_get+0x1a>
mov    0x200038,%eax
mov    %edi,%ecx
sar    %cl,%eax
ret
mov    0x200034,%eax
mov    -0x4(%rsp),%ecx
sar    %cl,%eax
ret

LLVM IR (-O0):
define i32 @GPIO_get(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
%5 = load i32, i32* %3
%6 = sub nsw i32 %5, 32
store volatile i32 %6, i32* %4
%7 = load volatile i32, i32* %4
%8 = icmp slt i32 %7, 0
br i1 %8, label %9, label %13
9: ; preds = %1
%10 = load volatile i32, i32* inttoptr (i64 2097204 to i32*)
%11 = load volatile i32, i32* %4
%12 = ashr i32 %10, %11
store i32 %12, i32* %2
br label %17
13: ; preds = %1
%14 = load volatile i32, i32* inttoptr (i64 2097208 to i32*)
%15 = load i32, i32* %3
%16 = ashr i32 %14, %15
store i32 %16, i32* %2
br label %17
17: ; preds = %13, %9
%18 = load i32, i32* %2
ret i32 %18
}

LLVM IR (-O2):
define i32 @GPIO_get(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = add nsw i32 %0, -32
store volatile i32 %4, i32* %2
%5 = load volatile i32, i32* %2
%6 = icmp slt i32 %5, 0
br i1 %6, label %7, label %11
7: ; preds = %1
%8 = load volatile i32, i32* inttoptr (i64 2097204 to i32*)
%9 = load volatile i32, i32* %2
%10 = ashr i32 %8, %9
br label %14
11: ; preds = %1
%12 = load volatile i32, i32* inttoptr (i64 2097208 to i32*)
%13 = ashr i32 %12, %0
br label %14
14: ; preds = %11, %7
%15 = phi i32 [ %10, %7 ], [ %13, %11 ]
ret i32 %15
}
/* Variables and functions */
scalar_t__ is_prime(int);
int /*<<< orphan*/ printf(char *, long);
int main() {
  long sum = 2;
  int p;
  for (p = 3; p < 2000000; p += 2) {
    if (is_prime(p)) {
      sum += p;
    }
  }
  printf("%ld", sum);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0x2,-0x10(%rbp)
movl   $0x3,-0x14(%rbp)
cmpl   $0x1e8480,-0x14(%rbp)
jge    117c <main+0x5c>
mov    -0x14(%rbp),%edi
call   1040 <is_prime@plt>
cmp    $0x0,%rax
je     1169 <main+0x49>
movslq -0x14(%rbp),%rax
add    -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
jmp    116e <main+0x4e>
mov    -0x14(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x14(%rbp)
jmp    113e <main+0x1e>
mov    -0x10(%rbp),%rsi
lea    0xe79(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    $0x2,%r14d
mov    $0x3,%ebx
nop
mov    %ebx,%edi
call   1040 <is_prime@plt>
test   %rax,%rax
cmovne %rbx,%rax
add    %rax,%r14
lea    0x2(%rbx),%rax
cmp    $0x1e847e,%rbx
mov    %rax,%rbx
jb     1130 <main+0x10>
lea    0xea8(%rip),%rdi
mov    %r14,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%ld\00"
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = phi i64 [ 3, %0 ], [ %9, %1 ]
%3 = phi i64 [ 2, %0 ], [ %8, %1 ]
%4 = trunc i64 %2 to i32
%5 = tail call i64 @is_prime(i32 %4)
%6 = icmp eq i64 %5, 0
%7 = select i1 %6, i64 0, i64 %2
%8 = add nuw nsw i64 %7, %3
%9 = add nuw nsw i64 %2, 2
%10 = icmp ult i64 %2, 1999998
br i1 %10, label %1, label %11
11: ; preds = %1
%12 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i64 %8)
ret i32 0
}
/* Type definitions */
struct input_event {
  int dummy;
};
typedef scalar_t__ int32_t;

/* Variables and functions */
int /*<<< orphan*/ die(char *);
scalar_t__ read(scalar_t__, struct input_event *, int);
void get_evt(int32_t evtfd, struct input_event *p_evt) {
  int32_t ret = read(evtfd, p_evt, sizeof(*p_evt));
  if (ret < 0) {
    die("read() failed");
  }
}


x86 assembly (clang, -O0):
<get_evt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    $0x4,%edx
call   1030 <read@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jge    115d <get_evt+0x3d>
lea    0xea8(%rip),%rdi
call   1040 <die@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_evt>:
push   %rax
mov    $0x4,%edx
call   1030 <read@plt>
test   %rax,%rax
js     1132 <get_evt+0x12>
pop    %rax
ret
lea    0xec7(%rip),%rdi
pop    %rax
jmp    1040 <die@plt>

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

LLVM IR (-O2):
%struct.input_event = type { i32 }
@.str = [14 x i8] c"read() failed\00"
define void @get_evt(i64 %0, %struct.input_event* nocapture %1) {
%3 = tail call i64 @read(i64 %0, %struct.input_event* %1, i32 4)
%4 = icmp slt i64 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @die(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %2
ret void
}
float df1x(float x, float y) { return (2 * x - 2); }


x86 assembly (clang, -O0):
<df1x>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
addss  %xmm0,%xmm0
movss  0xee1(%rip),%xmm1
addss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<df1x>:
addss  %xmm0,%xmm0
addss  0xef4(%rip),%xmm0
ret

LLVM IR (-O0):
define float @df1x(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = call float @llvm.fmuladd.f32(float 2.000000e+00, float %5, float -2.000000e+00)
ret float %6
}

LLVM IR (-O2):
define float @df1x(float %0, float %1) {
%3 = tail call float @llvm.fmuladd.f32(float %0, float 2.000000e+00, float -2.000000e+00)
ret float %3
}
/* Variables and functions */
int /*<<< orphan*/ return_struct_f1();
int /*<<< orphan*/ take_struct_f1(int /*<<< orphan*/);
void test_struct_f1() { take_struct_f1(return_struct_f1()); }


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

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

LLVM IR (-O0):
define void @test_struct_f1() {
%1 = call i32 (...) @return_struct_f1()
%2 = call i32 @take_struct_f1(i32 %1)
ret void
}

LLVM IR (-O2):
define void @test_struct_f1() {
%1 = tail call i32 (...) @return_struct_f1()
%2 = tail call i32 @take_struct_f1(i32 %1)
ret void
}
short hash_get_hash(const char *key) {
  if (key)
    return key[0];
  return 0;
}


x86 assembly (clang, -O0):
<hash_get_hash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1123 <hash_get_hash+0x23>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
mov    %ax,-0x2(%rbp)
jmp    1129 <hash_get_hash+0x29>
movw   $0x0,-0x2(%rbp)
movswl -0x2(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash_get_hash>:
test   %rdi,%rdi
je     1109 <hash_get_hash+0x9>
movsbl (%rdi),%eax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define signext i16 @hash_get_hash(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %6, label %3
3: ; preds = %1
%4 = load i8, i8* %0
%5 = sext i8 %4 to i16
br label %6
6: ; preds = %1, %3
%7 = phi i16 [ %5, %3 ], [ 0, %1 ]
ret i16 %7
}
/* Variables and functions */
int /*<<< orphan*/ GL_PROJECTION;
int /*<<< orphan*/ glClearColor(double, double, double, double);
int /*<<< orphan*/ glLoadIdentity();
int /*<<< orphan*/ glMatrixMode(int /*<<< orphan*/);
int /*<<< orphan*/ glOrtho(double, double, double, double, double, double);
void hello_init(void) {
  glClearColor(0.0, 0.0, 0.0, 0.0);
  glMatrixMode(GL_PROJECTION);
  glLoadIdentity();
  glOrtho(0.0, 1.0, 0.0, 1.0, -1.0, 1.0);
}


x86 assembly (clang, -O0):
<hello_init>:
push   %rbp
mov    %rsp,%rbp
xorps  %xmm3,%xmm3
movaps %xmm3,%xmm0
movaps %xmm3,%xmm1
movaps %xmm3,%xmm2
call   1050 <glClearColor@plt>
mov    0x2e84(%rip),%rax
mov    (%rax),%edi
call   1030 <glMatrixMode@plt>
mov    $0x0,%al
call   1060 <glLoadIdentity@plt>
xorps  %xmm2,%xmm2
movsd  0xe8b(%rip),%xmm5
movsd  0xe8b(%rip),%xmm4
movaps %xmm2,%xmm0
movaps %xmm5,%xmm1
movaps %xmm5,%xmm3
call   1040 <glOrtho@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<hello_init>:
push   %rax
xorps  %xmm0,%xmm0
xorps  %xmm1,%xmm1
xorps  %xmm2,%xmm2
xorps  %xmm3,%xmm3
call   1050 <glClearColor@plt>
mov    0x2e87(%rip),%rax
mov    (%rax),%edi
call   1030 <glMatrixMode@plt>
xor    %eax,%eax
call   1060 <glLoadIdentity@plt>
movsd  0xe91(%rip),%xmm4
movsd  0xe91(%rip),%xmm1
xorps  %xmm0,%xmm0
xorps  %xmm2,%xmm2
movaps %xmm1,%xmm3
movaps %xmm1,%xmm5
pop    %rax
jmp    1040 <glOrtho@plt>

LLVM IR (-O0):
@GL_PROJECTION = global i32 0
define void @hello_init() {
%1 = call i32 @glClearColor(double 0.000000e+00, double 0.000000e+00, double 0.000000e+00, double 0.000000e+00)
%2 = load i32, i32* @GL_PROJECTION
%3 = call i32 @glMatrixMode(i32 %2)
%4 = call i32 (...) @glLoadIdentity()
%5 = call i32 @glOrtho(double 0.000000e+00, double 1.000000e+00, double 0.000000e+00, double 1.000000e+00, double -1.000000e+00, double 1.000000e+00)
ret void
}

LLVM IR (-O2):
@GL_PROJECTION = global i32 0
define void @hello_init() {
%1 = tail call i32 @glClearColor(double 0.000000e+00, double 0.000000e+00, double 0.000000e+00, double 0.000000e+00)
%2 = load i32, i32* @GL_PROJECTION
%3 = tail call i32 @glMatrixMode(i32 %2)
%4 = tail call i32 (...) @glLoadIdentity()
%5 = tail call i32 @glOrtho(double 0.000000e+00, double 1.000000e+00, double 0.000000e+00, double 1.000000e+00, double -1.000000e+00, double 1.000000e+00)
ret void
}
XSetIconName() {}


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

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

LLVM IR (-O0):
define i32 @XSetIconName() {
%1 = alloca i32
%2 = load i32, i32* %1
ret i32 %2
}

LLVM IR (-O2):
define i32 @XSetIconName() {
ret i32 undef
}
/* Variables and functions */
scalar_t__ ceil(double);
int get_number_of_bins(double rcut, double rquanta) {
  return (int)ceil(rcut / rquanta);
}


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

x86 assembly (clang, -O2):
<get_number_of_bins>:
divsd  %xmm1,%xmm0
jmp    1030 <ceil@plt>

LLVM IR (-O0):
define i32 @get_number_of_bins(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 = fdiv double %5, %6
%8 = call i64 @ceil(double %7)
%9 = trunc i64 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @get_number_of_bins(double %0, double %1) {
%3 = fdiv double %0, %1
%4 = tail call i64 @ceil(double %3)
%5 = trunc i64 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ edf_free_data_file();
int /*<<< orphan*/ edf_free_header(char const *);
int /*<<< orphan*/ edf_history_free(char const *);
edf_free_all(void) {
  edf_history_free((const char *)NULL);
  edf_free_header((const char *)NULL);
  edf_free_data_file();
  return (1);
}


x86 assembly (clang, -O0):
<edf_free_all>:
push   %rbp
mov    %rsp,%rbp
xor    %eax,%eax
mov    %eax,%edi
call   1030 <edf_history_free@plt>
xor    %eax,%eax
mov    %eax,%edi
call   1040 <edf_free_header@plt>
mov    $0x0,%al
call   1050 <edf_free_data_file@plt>
mov    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<edf_free_all>:
push   %rax
xor    %edi,%edi
call   1030 <edf_history_free@plt>
xor    %edi,%edi
call   1040 <edf_free_header@plt>
xor    %eax,%eax
call   1050 <edf_free_data_file@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @edf_free_all() {
%1 = call i32 @edf_history_free(i8* null)
%2 = call i32 @edf_free_header(i8* null)
%3 = call i32 (...) @edf_free_data_file()
ret i32 1
}

LLVM IR (-O2):
define i32 @edf_free_all() {
%1 = tail call i32 @edf_history_free(i8* null)
%2 = tail call i32 @edf_free_header(i8* null)
%3 = tail call i32 (...) @edf_free_data_file()
ret i32 1
}
const char *bloom_version() { return "BLOOM_VERSION"; }


x86 assembly (clang, -O0):
<bloom_version>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bloom_version>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [14 x i8] c"BLOOM_VERSION\00"
define i8* @bloom_version() {
ret i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [14 x i8] c"BLOOM_VERSION\00"
define i8* @bloom_version() {
ret i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0)
}
void ss(signed short *p, double x) { *p = x; }


x86 assembly (clang, -O0):
<ss>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
cvttsd2si %xmm0,%eax
mov    %ax,%cx
mov    -0x8(%rbp),%rax
mov    %cx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<ss>:
cvttsd2si %xmm0,%eax
mov    %ax,(%rdi)
ret

LLVM IR (-O0):
define void @ss(i16* %0, double %1) {
%3 = alloca i16*
%4 = alloca double
store i16* %0, i16** %3
store double %1, double* %4
%5 = load double, double* %4
%6 = fptosi double %5 to i16
%7 = load i16*, i16** %3
store i16 %6, i16* %7
ret void
}

LLVM IR (-O2):
define void @ss(i16* nocapture writeonly %0, double %1) {
%3 = fptosi double %1 to i16
store i16 %3, i16* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ increment_counter();
int main(void) {
  for (;;) {
    increment_counter();
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <increment_counter@plt>
jmp    111f <main+0xf>

x86 assembly (clang, -O2):
<main>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <increment_counter@plt>
jmp    1120 <main+0x10>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %2, %0
%3 = call i32 (...) @increment_counter()
br label %2
}

LLVM IR (-O2):
define i32 @main() {
br label %1
1: ; preds = %1, %0
%2 = tail call i32 (...) @increment_counter()
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
void swi_handler(void) { puts("swi handler\n"); }


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

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

LLVM IR (-O0):
@.str = [13 x i8] c"swi handler\0A\00"
define void @swi_handler() {
%1 = call i32 @puts(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c"swi handler\0A\00"
define void @swi_handler() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ jerry_port_console(char *, char *);
void print_help(char *name) {
  jerry_port_console("Usage: %s [OPTION]... [FILE]...\n"
                     "\n"
                     "Options:\n"
                     "  -h, --help\n"
                     "  -v, --version\n"
                     "  --mem-stats\n"
                     "  --mem-stats-separate\n"
                     "  --parse-only\n"
                     "  --show-opcodes\n"
                     "  --show-regexp-opcodes\n"
                     "  --start-debug-server\n"
                     "  --save-snapshot-for-global FILE\n"
                     "  --save-snapshot-for-eval FILE\n"
                     "  --save-literals-list-format FILE\n"
                     "  --save-literals-c-format FILE\n"
                     "  --exec-snapshot FILE\n"
                     "  --log-level [0-3]\n"
                     "  --abort-on-fail\n"
                     "  --no-prompt\n"
                     "\n",
                     name);
}


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

x86 assembly (clang, -O2):
<print_help>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <jerry_port_console@plt>

LLVM IR (-O0):
@.str = [397 x i8] c"Usage: %s [OPTION]... [FILE]...\0A\0AOptions:\0A -h, --help\0A -v, --version\0A --mem-stats\0A --mem-stats-separate\0A --parse-only\0A --show-opcodes\0A --show-regexp-opcodes\0A --start-debug-server\0A --save-snapshot-for-global FILE\0A --save-snapshot-for-eval FILE\0A --save-literals-list-format FILE\0A --save-literals-c-format FILE\0A --exec-snapshot FILE\0A --log-level [0-3]\0A --abort-on-fail\0A --no-prompt\0A\0A\00"
define void @print_help(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @jerry_port_console(i8* getelementptr inbounds ([397 x i8], [397 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [397 x i8] c"Usage: %s [OPTION]... [FILE]...\0A\0AOptions:\0A -h, --help\0A -v, --version\0A --mem-stats\0A --mem-stats-separate\0A --parse-only\0A --show-opcodes\0A --show-regexp-opcodes\0A --start-debug-server\0A --save-snapshot-for-global FILE\0A --save-snapshot-for-eval FILE\0A --save-literals-list-format FILE\0A --save-literals-c-format FILE\0A --exec-snapshot FILE\0A --log-level [0-3]\0A --abort-on-fail\0A --no-prompt\0A\0A\00"
define void @print_help(i8* %0) {
%2 = tail call i32 @jerry_port_console(i8* getelementptr inbounds ([397 x i8], [397 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
double __ieee754_asin(double);
double jasin(double x) { return __ieee754_asin(x); }


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

x86 assembly (clang, -O2):
<jasin>:
jmp    1030 <__ieee754_asin@plt>

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

LLVM IR (-O2):
define double @jasin(double %0) {
%2 = tail call double @__ieee754_asin(double %0)
ret double %2
}
unsigned uDivTest12(unsigned X, unsigned Y) { return X / (4 << Y); }


x86 assembly (clang, -O0):
<uDivTest12>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
mov    $0x4,%edx
shl    %cl,%edx
mov    %edx,%ecx
xor    %edx,%edx
div    %ecx
pop    %rbp
ret

x86 assembly (clang, -O2):
<uDivTest12>:
mov    %edi,%eax
lea    0x2(%rsi),%ecx
shr    %cl,%eax
ret

LLVM IR (-O0):
define i32 @uDivTest12(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 = shl i32 4, %6
%8 = udiv i32 %5, %7
ret i32 %8
}

LLVM IR (-O2):
define i32 @uDivTest12(i32 %0, i32 %1) {
%3 = add i32 %1, 2
%4 = lshr i32 %0, %3
ret i32 %4
}
/* Variables and functions */
int strlen(char const *);
const char *find_1st_option(const char *buf) {
  size_t pos = strlen(buf) + 1;
  if (buf[pos] == '-') {
    return &buf[pos];
  }
  return NULL;
}


x86 assembly (clang, -O0):
<find_1st_option>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
add    $0x1,%eax
cltq
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x2d,%eax
jne    1154 <find_1st_option+0x44>
mov    -0x10(%rbp),%rax
add    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    115c <find_1st_option+0x4c>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<find_1st_option>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
movslq %eax,%rcx
lea    (%rcx,%rbx,1),%rdx
add    $0x1,%rdx
xor    %eax,%eax
cmpb   $0x2d,0x1(%rcx,%rbx,1)
cmove  %rdx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @find_1st_option(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = add nsw i32 %2, 1
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 45
%8 = select i1 %7, i8* %5, i8* null
ret i8* %8
}