xunge/DecIR huggingface dataset:
/* Variables and functions */
int sqrt(int);
int es_primo(int n) {
  int i;
  int marca = 0;
  for (i = 0; i < sqrt(n); i++) {
    if ((n % i) == 0) {
      marca = 1;
      break;
    }
  }
  return marca;
}


x86 assembly (clang, -O0):
<es_primo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <sqrt@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
cmp    %ecx,%eax
jge    1173 <es_primo+0x63>
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
cmp    $0x0,%edx
jne    1160 <es_primo+0x50>
movl   $0x1,-0xc(%rbp)
jmp    1173 <es_primo+0x63>
jmp    1165 <es_primo+0x55>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1129 <es_primo+0x19>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<es_primo>:
push   %rbx
mov    %edi,%ebx
call   1030 <sqrt@plt>
test   %eax,%eax
jle    1123 <es_primo+0x13>
mov    %ebx,%edi
call   1030 <sqrt@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @es_primo(i32 %0) {
%2 = tail call i32 @sqrt(i32 %0)
%3 = icmp sgt i32 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @sqrt(i32 %0)
br label %6
6: ; preds = %4, %1
ret i32 0
}
/* Variables and functions */
int ipc_connect(int *, char *, int);
int iscsid_connect(int *fd, int start_iscsid) {
  return ipc_connect(fd, "ISCSIADM_ABSTRACT_NAMESPACE", start_iscsid);
}


x86 assembly (clang, -O0):
<iscsid_connect>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
lea    0xed3(%rip),%rsi
call   1030 <ipc_connect@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<iscsid_connect>:
mov    %esi,%edx
lea    0xee7(%rip),%rsi
jmp    1030 <ipc_connect@plt>

LLVM IR (-O0):
@.str = [28 x i8] c"ISCSIADM_ABSTRACT_NAMESPACE\00"
define i32 @iscsid_connect(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 = call i32 @ipc_connect(i32* %5, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i32 %6)
ret i32 %7
}

LLVM IR (-O2):
@.str = [28 x i8] c"ISCSIADM_ABSTRACT_NAMESPACE\00"
define i32 @iscsid_connect(i32* %0, i32 %1) {
%3 = tail call i32 @ipc_connect(i32* %0, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ tok_init(char *, char);
void ack_parse_init(char *file) { tok_init(file, '!'); }


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

x86 assembly (clang, -O2):
<ack_parse_init>:
mov    $0x21,%esi
jmp    1030 <tok_init@plt>

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

LLVM IR (-O2):
define void @ack_parse_init(i8* %0) {
%2 = tail call i32 @tok_init(i8* %0, i8 signext 33)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ putchar(char);
void stdout_putf(void *unused, char c) { putchar(c); }


x86 assembly (clang, -O0):
<stdout_putf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
movsbl -0x9(%rbp),%edi
call   1030 <putchar@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stdout_putf>:
mov    %esi,%edi
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
define void @stdout_putf(i8* nocapture readnone %0, i8 signext %1) {
%3 = tail call i32 @putchar(i8 signext %1)
ret void
}
/* Type definitions */
typedef int uint8_t;
typedef int uint32_t;

/* Variables and functions */
uint8_t parity(uint32_t val) {
  uint8_t parity = 0x01u;
  while (val > 0) {
    parity ^= (val & 0x00000001u);
    val >>= 1u;
  }
  return parity;
}


x86 assembly (clang, -O0):
<parity>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
jle    1132 <parity+0x32>
mov    -0x4(%rbp),%eax
and    $0x1,%eax
xor    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    110e <parity+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<parity>:
mov    $0x1,%eax
test   %edi,%edi
jle    1120 <parity+0x20>
mov    %edi,%ecx
nopl   0x0(%rax,%rax,1)
mov    %edi,%edx
and    $0x1,%edx
xor    %edx,%eax
shr    %ecx
cmp    $0x1,%edi
mov    %ecx,%edi
ja     1110 <parity+0x10>
ret

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

LLVM IR (-O2):
define i32 @parity(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %10
3: ; preds = %1, %3
%4 = phi i32 [ %7, %3 ], [ 1, %1 ]
%5 = phi i32 [ %8, %3 ], [ %0, %1 ]
%6 = and i32 %5, 1
%7 = xor i32 %4, %6
%8 = lshr i32 %5, 1
%9 = icmp ult i32 %5, 2
br i1 %9, label %10, label %3
10: ; preds = %3, %1
%11 = phi i32 [ 1, %1 ], [ %7, %3 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ strlen(char const *);
scalar_t__ strncmp(char *, char const *, int /*<<< orphan*/);
int arg_matches(char *arg, const char *flag) {
  return (strncmp(arg, flag, strlen(flag)) == 0) ? 1 : 0;
}


x86 assembly (clang, -O0):
<arg_matches>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    %eax,%edx
call   1030 <strncmp@plt>
mov    %rax,%rdx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0x0,%rdx
cmove  %ecx,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<arg_matches>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1040 <strlen@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %eax,%edx
call   1030 <strncmp@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @arg_matches(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = load i8*, i8** %4
%8 = call i32 @strlen(i8* %7)
%9 = call i64 @strncmp(i8* %5, i8* %6, i32 %8)
%10 = icmp eq i64 %9, 0
%11 = zext i1 %10 to i64
%12 = select i1 %10, i32 1, i32 0
ret i32 %12
}

LLVM IR (-O2):
define i32 @arg_matches(i8* %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %1)
%4 = tail call i64 @strncmp(i8* %0, i8* %1, i32 %3)
%5 = icmp eq i64 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isalpha(int);
void t_isalpha_0x9e() {
  Assert_real((isalpha(158) == 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_isalpha.c",
              795, ("isalpha should be 0 for 0x9e"));
}


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

x86 assembly (clang, -O2):
<t_isalpha_0x9e>:
push   %rax
mov    $0x9e,%edi
call   1030 <isalpha@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x31b,%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_isalpha.c\00"
@.str.1 = [29 x i8] c"isalpha should be 0 for 0x9e\00"
define void @t_isalpha_0x9e() {
%1 = call i64 @isalpha(i32 158)
%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 795, i8* getelementptr inbounds ([29 x i8], [29 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_isalpha.c\00"
@.str.1 = [29 x i8] c"isalpha should be 0 for 0x9e\00"
define void @t_isalpha_0x9e() {
%1 = tail call i64 @isalpha(i32 158)
%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 795, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
struct htable {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ htable_resize(struct htable *, size_t);
void htable_reserve(struct htable *ht, size_t items) {
  htable_resize(ht, items * 4);
}


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

x86 assembly (clang, -O2):
<htable_reserve>:
shl    $0x2,%rsi
jmp    1030 <htable_resize@plt>

LLVM IR (-O0):
%struct.htable = type { i32 }
define void @htable_reserve(%struct.htable* %0, i64 %1) {
%3 = alloca %struct.htable*
%4 = alloca i64
store %struct.htable* %0, %struct.htable** %3
store i64 %1, i64* %4
%5 = load %struct.htable*, %struct.htable** %3
%6 = load i64, i64* %4
%7 = mul i64 %6, 4
%8 = call i32 @htable_resize(%struct.htable* %5, i64 %7)
ret void
}

LLVM IR (-O2):
%struct.htable = type { i32 }
define void @htable_reserve(%struct.htable* %0, i64 %1) {
%3 = shl i64 %1, 2
%4 = tail call i32 @htable_resize(%struct.htable* %0, i64 %3)
ret void
}
foo() {}


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

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

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

LLVM IR (-O2):
define i32 @foo() {
ret i32 undef
}
/* Variables and functions */
double floor(double);
double _floor(double in1) { return floor(in1); }


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

x86 assembly (clang, -O2):
<_floor>:
jmp    1030 <floor@plt>

LLVM IR (-O0):
define double @_floor(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call double @llvm.floor.f64(double %3)
ret double %4
}

LLVM IR (-O2):
define double @_floor(double %0) {
%2 = tail call double @llvm.floor.f64(double %0)
ret double %2
}
/* Variables and functions */
scalar_t__ VIM_HAPI_GetOneJpeg(void *, unsigned long, unsigned long *);
unsigned char V5H_Capture_MultiFrame_GetOne(unsigned char *StillBuf,
                                            unsigned long BUF_Length,
                                            unsigned long *dwOneLen) {
  {
    return ((unsigned short)VIM_HAPI_GetOneJpeg((void *)StillBuf, BUF_Length,
                                                (unsigned long *)dwOneLen));
  }
}


x86 assembly (clang, -O0):
<V5H_Capture_MultiFrame_GetOne>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <VIM_HAPI_GetOneJpeg@plt>
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<V5H_Capture_MultiFrame_GetOne>:
push   %rax
call   1030 <VIM_HAPI_GetOneJpeg@plt>
pop    %rcx
ret

LLVM IR (-O0):
define zeroext i8 @V5H_Capture_MultiFrame_GetOne(i8* %0, i64 %1, i64* %2) {
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i64*
store i8* %0, i8** %4
store i64 %1, i64* %5
store i64* %2, i64** %6
%7 = load i8*, i8** %4
%8 = load i64, i64* %5
%9 = load i64*, i64** %6
%10 = call i64 @VIM_HAPI_GetOneJpeg(i8* %7, i64 %8, i64* %9)
%11 = trunc i64 %10 to i16
%12 = trunc i16 %11 to i8
ret i8 %12
}

LLVM IR (-O2):
define zeroext i8 @V5H_Capture_MultiFrame_GetOne(i8* %0, i64 %1, i64* %2) {
%4 = tail call i64 @VIM_HAPI_GetOneJpeg(i8* %0, i64 %1, i64* %2)
%5 = trunc i64 %4 to i8
ret i8 %5
}
/* Variables and functions */
int /*<<< orphan*/ panic(char *);
void machine_check_abort(void) {
  panic("exception(abort): machine check aborted");
}


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

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

LLVM IR (-O0):
@.str = [40 x i8] c"exception(abort): machine check aborted\00"
define void @machine_check_abort() {
%1 = call i32 @panic(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [40 x i8] c"exception(abort): machine check aborted\00"
define void @machine_check_abort() {
%1 = tail call i32 @panic(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int dwarf_get_VIS_name(unsigned int, char const **);
char const *ellipname(int, unsigned int, char const *, char *, int);
const char *get_VIS_name(unsigned int val_in, int printonerr) {
  const char *v = 0;
  int res = dwarf_get_VIS_name(val_in, &v);
  return ellipname(res, val_in, v, "VIS", printonerr);
}


x86 assembly (clang, -O0):
<get_VIS_name>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x10(%rbp),%rsi
call   1030 <dwarf_get_VIS_name@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rdx
mov    -0x8(%rbp),%r8d
lea    0xea6(%rip),%rcx
call   1040 <ellipname@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_VIS_name>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
movq   $0x0,(%rsp)
mov    %rsp,%rsi
call   1030 <dwarf_get_VIS_name@plt>
mov    (%rsp),%rdx
lea    0xebe(%rip),%rcx
mov    %eax,%edi
mov    %ebp,%esi
mov    %ebx,%r8d
call   1040 <ellipname@plt>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [4 x i8] c"VIS\00"
define i8* @get_VIS_name(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
store i8* null, i8** %5
%7 = load i32, i32* %3
%8 = call i32 @dwarf_get_VIS_name(i32 %7, i8** %5)
store i32 %8, i32* %6
%9 = load i32, i32* %6
%10 = load i32, i32* %3
%11 = load i8*, i8** %5
%12 = load i32, i32* %4
%13 = call i8* @ellipname(i32 %9, i32 %10, i8* %11, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %12)
ret i8* %13
}

LLVM IR (-O2):
@.str = [4 x i8] c"VIS\00"
define i8* @get_VIS_name(i32 %0, i32 %1) {
%3 = alloca i8*
%4 = bitcast i8** %3 to i8*
store i8* null, i8** %3
%5 = call i32 @dwarf_get_VIS_name(i32 %0, i8** %3)
%6 = load i8*, i8** %3
%7 = call i8* @ellipname(i32 %5, i32 %0, i8* %6, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i8* %7
}
/* Variables and functions */
char *CreateLongString();
int /*<<< orphan*/ free(char *);
scalar_t__ strlen(char *);
int IsLongStringEmpty(void) {
  char *pStr = CreateLongString();
  int result = (strlen(pStr) == 0);
  free(pStr);
  pStr = NULL;
  return result;
}


x86 assembly (clang, -O0):
<IsLongStringEmpty>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1050 <CreateLongString@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
movq   $0x0,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<IsLongStringEmpty>:
push   %rbx
xor    %eax,%eax
call   1040 <CreateLongString@plt>
xor    %ebx,%ebx
cmpb   $0x0,(%rax)
sete   %bl
mov    %rax,%rdi
call   1030 <free@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @IsLongStringEmpty() {
%1 = alloca i8*
%2 = alloca i32
%3 = call i8* (...) @CreateLongString()
store i8* %3, i8** %1
%4 = load i8*, i8** %1
%5 = call i64 @strlen(i8* %4)
%6 = icmp eq i64 %5, 0
%7 = zext i1 %6 to i32
store i32 %7, i32* %2
%8 = load i8*, i8** %1
%9 = call i32 @free(i8* %8)
store i8* null, i8** %1
%10 = load i32, i32* %2
ret i32 %10
}

LLVM IR (-O2):
define i32 @IsLongStringEmpty() {
%1 = tail call i8* (...) @CreateLongString()
%2 = load i8, i8* %1
%3 = icmp eq i8 %2, 0
%4 = zext i1 %3 to i32
%5 = tail call i32 @free(i8* %1)
ret i32 %4
}
float interpf(float target, float origin, float fac) {
  return (fac * target) + (1.0f - fac) * origin;
}


x86 assembly (clang, -O0):
<interpf>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
movss  -0x4(%rbp),%xmm2
movss  0xedb(%rip),%xmm1
subss  -0xc(%rbp),%xmm1
mulss  -0x8(%rbp),%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<interpf>:
movss  0xef8(%rip),%xmm3
subss  %xmm2,%xmm3
mulss  %xmm1,%xmm3
mulss  %xmm2,%xmm0
addss  %xmm3,%xmm0
ret

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

LLVM IR (-O2):
define float @interpf(float %0, float %1, float %2) {
%4 = fsub float 1.000000e+00, %2
%5 = fmul float %4, %1
%6 = tail call float @llvm.fmuladd.f32(float %2, float %0, float %5)
ret float %6
}
void board_init_end(void) {}


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

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

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

LLVM IR (-O2):
define void @board_init_end() {
ret void
}
int fib(int n) {
  if (n < 2) {
    return n;
  } else {
    return (fib(n - 1) + fib(n - 2));
  }
}


x86 assembly (clang, -O0):
<fib>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x2,-0x8(%rbp)
jge    1130 <fib+0x20>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1153 <fib+0x43>
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
call   1030 <fib@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
sub    $0x2,%edi
call   1030 <fib@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):
<fib>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
xor    %ebp,%ebp
cmp    $0x2,%edi
jge    1120 <fib+0x10>
mov    %ebx,%ecx
jmp    1144 <fib+0x34>
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
lea    -0x1(%rbx),%edi
call   1030 <fib@plt>
lea    -0x2(%rbx),%ecx
add    %eax,%ebp
cmp    $0x3,%ebx
mov    %ecx,%ebx
ja     1130 <fib+0x20>
add    %ecx,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @fib(i32 %0) {
%2 = icmp slt i32 %0, 2
br i1 %2, label %11, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %8, %3 ], [ %0, %1 ]
%5 = phi i32 [ %9, %3 ], [ 0, %1 ]
%6 = add nsw i32 %4, -1
%7 = tail call i32 @fib(i32 %6)
%8 = add nsw i32 %4, -2
%9 = add nsw i32 %7, %5
%10 = icmp ult i32 %4, 4
br i1 %10, label %11, label %3
11: ; preds = %3, %1
%12 = phi i32 [ 0, %1 ], [ %9, %3 ]
%13 = phi i32 [ %0, %1 ], [ %8, %3 ]
%14 = add nsw i32 %13, %12
ret i32 %14
}
/* Variables and functions */
scalar_t__ isPrime(int);
int /*<<< orphan*/ printf(char *, int);
void printPrimeNumbers(int m, int n) {
  int i;
  for (i = m; i <= n; i++) {
    if (isPrime(i))
      printf("%d\n", i);
  }
}


x86 assembly (clang, -O0):
<printPrimeNumbers>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jg     1174 <printPrimeNumbers+0x54>
mov    -0xc(%rbp),%edi
call   1040 <isPrime@plt>
cmp    $0x0,%rax
je     1161 <printPrimeNumbers+0x41>
mov    -0xc(%rbp),%esi
lea    0xea4(%rip),%rdi
call   1030 <printf@plt>
jmp    1166 <printPrimeNumbers+0x46>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1134 <printPrimeNumbers+0x14>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printPrimeNumbers>:
push   %rbp
push   %r14
push   %rbx
cmp    %esi,%edi
jle    112d <printPrimeNumbers+0xd>
pop    %rbx
pop    %r14
pop    %rbp
ret
mov    %esi,%ebx
mov    %edi,%ebp
add    $0x1,%ebx
lea    0xec5(%rip),%r14
jmp    1147 <printPrimeNumbers+0x27>
nopl   (%rax)
add    $0x1,%ebp
cmp    %ebp,%ebx
je     1128 <printPrimeNumbers+0x8>
mov    %ebp,%edi
call   1040 <isPrime@plt>
test   %rax,%rax
je     1140 <printPrimeNumbers+0x20>
mov    %r14,%rdi
mov    %ebp,%esi
call   1030 <printf@plt>
jmp    1140 <printPrimeNumbers+0x20>

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
define void @printPrimeNumbers(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
store i32 %6, i32* %5
br label %7
7: ; preds = %19, %2
%8 = load i32, i32* %5
%9 = load i32, i32* %4
%10 = icmp sle i32 %8, %9
br i1 %10, label %11, label %22
11: ; preds = %7
%12 = load i32, i32* %5
%13 = call i64 @isPrime(i32 %12)
%14 = icmp ne i64 %13, 0
br i1 %14, label %15, label %18
15: ; preds = %11
%16 = load i32, i32* %5
%17 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %16)
br label %18
18: ; preds = %15, %11
br label %19
19: ; preds = %18
%20 = load i32, i32* %5
%21 = add nsw i32 %20, 1
store i32 %21, i32* %5
br label %7
22: ; preds = %7
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define void @printPrimeNumbers(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
br i1 %3, label %13, label %4
4: ; preds = %2, %10
%5 = phi i32 [ %11, %10 ], [ %0, %2 ]
%6 = tail call i64 @isPrime(i32 %5)
%7 = icmp eq i64 %6, 0
br i1 %7, label %10, label %8
8: ; preds = %4
%9 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %5)
br label %10
10: ; preds = %4, %8
%11 = add i32 %5, 1
%12 = icmp eq i32 %5, %1
br i1 %12, label %13, label %4
13: ; preds = %10, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ getchar();
int /*<<< orphan*/ printf(char *);
int main() {
  printf("Hello World!\n");
  printf("Well done! Press any key to continue...");
  getchar();
  return 0;
}


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    0xecc(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xef0(%rip),%rdi
call   1030 <puts@plt>
lea    0xebc(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
call   1050 <getchar@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"Hello World!\0A\00"
@.str.1 = [40 x i8] c"Well done! Press any key to continue...\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 (...) @getchar()
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [40 x i8] c"Well done! Press any key to continue...\00"
@str = [13 x i8] c"Hello World!\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 (...) @getchar()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ msleep(int);
void cb_msleep(void *data, int msecs) { msleep(msecs); }


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

x86 assembly (clang, -O2):
<cb_msleep>:
mov    %esi,%edi
jmp    1030 <msleep@plt>

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

LLVM IR (-O2):
define void @cb_msleep(i8* nocapture readnone %0, i32 %1) {
%3 = tail call i32 @msleep(i32 %1)
ret void
}
/* Variables and functions */
float acos(float);
float calculate_virtual_distance(float slope, float dist) {
  return acos(slope) * dist;
}


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

x86 assembly (clang, -O2):
<calculate_virtual_distance>:
push   %rax
movss  %xmm1,0x4(%rsp)
call   1030 <acos@plt>
mulss  0x4(%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @calculate_virtual_distance(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 @acos(float %5)
%7 = load float, float* %4
%8 = fmul float %6, %7
ret float %8
}

LLVM IR (-O2):
define float @calculate_virtual_distance(float %0, float %1) {
%3 = tail call float @acos(float %0)
%4 = fmul float %3, %1
ret float %4
}
void *Parrot_dlopen(const char *filename) { return 0; }


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

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

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

LLVM IR (-O2):
define noalias i8* @Parrot_dlopen(i8* nocapture readnone %0) {
ret i8* null
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, double);
int /*<<< orphan*/ readoubles();
double sum(int /*<<< orphan*/);
int main() {
  printf("%g\n", sum(readoubles()));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1050 <readoubles@plt>
mov    %eax,%edi
call   1040 <sum@plt>
lea    0xeac(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1050 <readoubles@plt>
mov    %eax,%edi
call   1040 <sum@plt>
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%g\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @readoubles()
%3 = call double @sum(i32 %2)
%4 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double %3)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%g\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @readoubles()
%2 = tail call double @sum(i32 %1)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double %2)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ gets(char **);
int /*<<< orphan*/ printf(char *, char ***);
void nothing() {
  char *buf0[50];
  printf("%p\n", &buf0);
  gets(buf0);
}


x86 assembly (clang, -O0):
<nothing>:
push   %rbp
mov    %rsp,%rbp
sub    $0x190,%rsp
lea    -0x190(%rbp),%rsi
lea    0xec7(%rip),%rdi
call   1030 <printf@plt>
lea    -0x190(%rbp),%rdi
call   1040 <gets@plt>
add    $0x190,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nothing>:
push   %rbx
sub    $0x190,%rsp
lea    0xed1(%rip),%rdi
mov    %rsp,%rbx
mov    %rbx,%rsi
call   1030 <printf@plt>
mov    %rbx,%rdi
call   1040 <gets@plt>
add    $0x190,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%p\0A\00"
define void @nothing() {
%1 = alloca [50 x i8*]
%2 = bitcast [50 x i8*]* %1 to i8***
%3 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8*** %2)
%4 = getelementptr inbounds [50 x i8*], [50 x i8*]* %1, i64 0, i64 0
%5 = call i32 @gets(i8** %4)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%p\0A\00"
define void @nothing() {
%1 = alloca [50 x i8*]
%2 = bitcast [50 x i8*]* %1 to i8*
%3 = bitcast [50 x i8*]* %1 to i8***
%4 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8*** %3)
%5 = getelementptr inbounds [50 x i8*], [50 x i8*]* %1, i64 0, i64 0
%6 = call i32 @gets(i8** %5)
ret void
}
int fun155() { return 155; }


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

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

LLVM IR (-O0):
define i32 @fun155() {
ret i32 155
}

LLVM IR (-O2):
define i32 @fun155() {
ret i32 155
}
int test_imm_83uint64_lowword_mem(unsigned long long *val) {
  return ((*val) & (0x83 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_83uint64_lowword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 131
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
__attribute__((no)) double bar(double a, double b, double c, double d,
                               char *h) {
  *h = 0;
  return a * b + b + c;
}


x86 assembly (clang, -O0):
<bar>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
mov    %rdi,-0x28(%rbp)
mov    -0x28(%rbp),%rax
movb   $0x0,(%rax)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm2
movsd  -0x10(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
addsd  -0x18(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<bar>:
movb   $0x0,(%rdi)
mulsd  %xmm1,%xmm0
addsd  %xmm1,%xmm0
addsd  %xmm2,%xmm0
ret

LLVM IR (-O0):
define double @bar(double %0, double %1, double %2, double %3, i8* %4) {
%6 = alloca double
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = alloca i8*
store double %0, double* %6
store double %1, double* %7
store double %2, double* %8
store double %3, double* %9
store i8* %4, i8** %10
%11 = load i8*, i8** %10
store i8 0, i8* %11
%12 = load double, double* %6
%13 = load double, double* %7
%14 = load double, double* %7
%15 = call double @llvm.fmuladd.f64(double %12, double %13, double %14)
%16 = load double, double* %8
%17 = fadd double %15, %16
ret double %17
}

LLVM IR (-O2):
define double @bar(double %0, double %1, double %2, double %3, i8* nocapture writeonly %4) {
store i8 0, i8* %4
%6 = tail call double @llvm.fmuladd.f64(double %0, double %1, double %1)
%7 = fadd double %6, %2
ret double %7
}
/* Variables and functions */
int Scl_ConGetInLoad_(int /*<<< orphan*/, int);
int /*<<< orphan*/ Scl_ConReadMan();
int Scl_ConGetInLoad(int i) { return Scl_ConGetInLoad_(Scl_ConReadMan(), i); }


x86 assembly (clang, -O0):
<Scl_ConGetInLoad>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1040 <Scl_ConReadMan@plt>
mov    %eax,%edi
mov    -0x4(%rbp),%esi
call   1030 <Scl_ConGetInLoad_@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Scl_ConGetInLoad>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1040 <Scl_ConReadMan@plt>
mov    %eax,%edi
mov    %ebx,%esi
pop    %rbx
jmp    1030 <Scl_ConGetInLoad_@plt>

LLVM IR (-O0):
define i32 @Scl_ConGetInLoad(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @Scl_ConReadMan()
%4 = load i32, i32* %2
%5 = call i32 @Scl_ConGetInLoad_(i32 %3, i32 %4)
ret i32 %5
}

LLVM IR (-O2):
define i32 @Scl_ConGetInLoad(i32 %0) {
%2 = tail call i32 (...) @Scl_ConReadMan()
%3 = tail call i32 @Scl_ConGetInLoad_(i32 %2, i32 %0)
ret i32 %3
}
long long uzsz() { return 0x7fff0000ffff0000LL; }


x86 assembly (clang, -O0):
<uzsz>:
push   %rbp
mov    %rsp,%rbp
movabs $0x7fff0000ffff0000,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<uzsz>:
movabs $0x7fff0000ffff0000,%rax
ret

LLVM IR (-O0):
define i64 @uzsz() {
ret i64 9223090566172966912
}

LLVM IR (-O2):
define i64 @uzsz() {
ret i64 9223090566172966912
}
/* Variables and functions */
int syscall_execve(char *, char **, char **);
int execve(char *name, char **argv, char **env) {
  return syscall_execve(name, argv, env);
}


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

x86 assembly (clang, -O2):
<execve>:
jmp    1030 <syscall_execve@plt>

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

LLVM IR (-O2):
define i32 @execve(i8* %0, i8** %1, i8** %2) {
%4 = tail call i32 @syscall_execve(i8* %0, i8** %1, i8** %2)
ret i32 %4
}
/* Type definitions */
typedef int uint8_t;
typedef int uint32_t;

/* Variables and functions */
void put_u32(uint8_t *d, uint32_t v) {
  d[0] = v >> 24;
  d[1] = v >> 16;
  d[2] = v >> 8;
  d[3] = v;
}


x86 assembly (clang, -O0):
<put_u32>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
sar    $0x18,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0xc(%rbp),%ecx
sar    $0x10,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x4(%rax)
mov    -0xc(%rbp),%ecx
sar    $0x8,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x8(%rax)
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0xc(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<put_u32>:
mov    %esi,%eax
sar    $0x18,%eax
mov    %eax,(%rdi)
mov    %esi,%eax
sar    $0x10,%eax
mov    %eax,0x4(%rdi)
mov    %esi,%eax
sar    $0x8,%eax
mov    %eax,0x8(%rdi)
mov    %esi,0xc(%rdi)
ret

LLVM IR (-O0):
define void @put_u32(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = ashr i32 %5, 24
%7 = load i32*, i32** %3
%8 = getelementptr inbounds i32, i32* %7, i64 0
store i32 %6, i32* %8
%9 = load i32, i32* %4
%10 = ashr i32 %9, 16
%11 = load i32*, i32** %3
%12 = getelementptr inbounds i32, i32* %11, i64 1
store i32 %10, i32* %12
%13 = load i32, i32* %4
%14 = ashr i32 %13, 8
%15 = load i32*, i32** %3
%16 = getelementptr inbounds i32, i32* %15, i64 2
store i32 %14, i32* %16
%17 = load i32, i32* %4
%18 = load i32*, i32** %3
%19 = getelementptr inbounds i32, i32* %18, i64 3
store i32 %17, i32* %19
ret void
}

LLVM IR (-O2):
define void @put_u32(i32* nocapture writeonly %0, i32 %1) {
%3 = ashr i32 %1, 24
store i32 %3, i32* %0
%4 = ashr i32 %1, 16
%5 = getelementptr inbounds i32, i32* %0, i64 1
store i32 %4, i32* %5
%6 = ashr i32 %1, 8
%7 = getelementptr inbounds i32, i32* %0, i64 2
store i32 %6, i32* %7
%8 = getelementptr inbounds i32, i32* %0, i64 3
store i32 %1, i32* %8
ret void
}
int bit_get_lsb_val(int n) { return (n & -n); }


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

x86 assembly (clang, -O2):
<bit_get_lsb_val>:
mov    %edi,%eax
neg    %eax
and    %edi,%eax
ret

LLVM IR (-O0):
define i32 @bit_get_lsb_val(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* %2
%5 = sub nsw i32 0, %4
%6 = and i32 %3, %5
ret i32 %6
}

LLVM IR (-O2):
define i32 @bit_get_lsb_val(i32 %0) {
%2 = sub nsw i32 0, %0
%3 = and i32 %2, %0
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ FaultSettingsHandle();
int /*<<< orphan*/ UAVObjRequestUpdate(int /*<<< orphan*/);
void FaultSettingsRequestUpdate() {
  UAVObjRequestUpdate(FaultSettingsHandle());
}


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

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

LLVM IR (-O0):
define void @FaultSettingsRequestUpdate() {
%1 = call i32 (...) @FaultSettingsHandle()
%2 = call i32 @UAVObjRequestUpdate(i32 %1)
ret void
}

LLVM IR (-O2):
define void @FaultSettingsRequestUpdate() {
%1 = tail call i32 (...) @FaultSettingsHandle()
%2 = tail call i32 @UAVObjRequestUpdate(i32 %1)
ret void
}
int main() {
  int a = 5;
  int b = (a == 5) ? 3 : 0;
  return b;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x5,-0x8(%rbp)
mov    -0x8(%rbp),%edx
xor    %eax,%eax
mov    $0x3,%ecx
cmp    $0x5,%edx
cmove  %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 5, i32* %2
%4 = load i32, i32* %2
%5 = icmp eq i32 %4, 5
%6 = zext i1 %5 to i64
%7 = select i1 %5, i32 3, i32 0
store i32 %7, i32* %3
%8 = load i32, i32* %3
ret i32 %8
}

LLVM IR (-O2):
define i32 @main() {
ret i32 3
}
/* Variables and functions */
scalar_t__ is_in_set(char, char *);
int is_rna(char x) { return (is_in_set(x, "Uu") && !is_in_set(x, "-.#*~")); }


x86 assembly (clang, -O0):
<is_rna>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
lea    0xedb(%rip),%rsi
movsbl -0x1(%rbp),%edi
call   1030 <is_in_set@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x2(%rbp)
je     115c <is_rna+0x4c>
lea    0xebc(%rip),%rsi
movsbl -0x1(%rbp),%edi
call   1030 <is_in_set@plt>
cmp    $0x0,%rax
setne  %al
xor    $0xff,%al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_rna>:
push   %rbx
mov    %edi,%ebx
lea    0xee6(%rip),%rsi
call   1030 <is_in_set@plt>
test   %rax,%rax
je     1140 <is_rna+0x30>
movsbl %bl,%edi
lea    0xed5(%rip),%rsi
call   1030 <is_in_set@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
sete   %al
pop    %rbx
ret
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"Uu\00"
@.str.1 = [6 x i8] c"-.#*~\00"
define i32 @is_rna(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = call i64 @is_in_set(i8 signext %3, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %11
6: ; preds = %1
%7 = load i8, i8* %2
%8 = call i64 @is_in_set(i8 signext %7, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%9 = icmp ne i64 %8, 0
%10 = xor i1 %9, true
br label %11
11: ; preds = %6, %1
%12 = phi i1 [ false, %1 ], [ %10, %6 ]
%13 = zext i1 %12 to i32
ret i32 %13
}

LLVM IR (-O2):
@.str = [3 x i8] c"Uu\00"
@.str.1 = [6 x i8] c"-.#*~\00"
define i32 @is_rna(i8 signext %0) {
%2 = tail call i64 @is_in_set(i8 signext %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i64 %2, 0
br i1 %3, label %8, label %4
4: ; preds = %1
%5 = tail call i64 @is_in_set(i8 signext %0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%6 = icmp eq i64 %5, 0
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %4, %1
%9 = phi i32 [ 0, %1 ], [ %7, %4 ]
ret i32 %9
}
void fun(char *a, char c) {
  char *p = a;
  while (*p) {
    if (*p != c)
      *a++ = *p++;
    else
      p++;
  }
  *a = '\0';
}


x86 assembly (clang, -O0):
<fun>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmpb   $0x0,(%rax)
je     116e <fun+0x6e>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
movsbl -0x9(%rbp),%ecx
cmp    %ecx,%eax
je     115d <fun+0x5d>
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x18(%rbp)
mov    (%rax),%cl
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %cl,(%rax)
jmp    1169 <fun+0x69>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1116 <fun+0x16>
mov    -0x8(%rbp),%rax
movb   $0x0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<fun>:
mov    (%rdi),%cl
test   %cl,%cl
je     1128 <fun+0x28>
lea    0x1(%rdi),%rax
jmp    111b <fun+0x1b>
nopl   0x0(%rax)
movzbl (%rax),%ecx
add    $0x1,%rax
test   %cl,%cl
je     1128 <fun+0x28>
cmp    %sil,%cl
je     1110 <fun+0x10>
mov    %cl,(%rdi)
add    $0x1,%rdi
jmp    1110 <fun+0x10>
movb   $0x0,(%rdi)
ret

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

LLVM IR (-O2):
define void @fun(i8* nocapture %0, i8 signext %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %17, label %5
5: ; preds = %2, %12
%6 = phi i8 [ %15, %12 ], [ %3, %2 ]
%7 = phi i8* [ %14, %12 ], [ %0, %2 ]
%8 = phi i8* [ %13, %12 ], [ %0, %2 ]
%9 = icmp eq i8 %6, %1
br i1 %9, label %12, label %10
10: ; preds = %5
%11 = getelementptr inbounds i8, i8* %8, i64 1
store i8 %6, i8* %8
br label %12
12: ; preds = %5, %10
%13 = phi i8* [ %11, %10 ], [ %8, %5 ]
%14 = getelementptr inbounds i8, i8* %7, i64 1
%15 = load i8, i8* %14
%16 = icmp eq i8 %15, 0
br i1 %16, label %17, label %5
17: ; preds = %12, %2
%18 = phi i8* [ %0, %2 ], [ %13, %12 ]
store i8 0, i8* %18
ret void
}
void foo069() {}


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

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

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

LLVM IR (-O2):
define void @foo069() {
ret void
}
void CheckWholeQueue(void) {}


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

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

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

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

/* Variables and functions */
struct vm_class *lookup_class(char const *);
void *lookup_method(struct vm_class *, char const *);
void *vm_lookup_native(const char *class_name, const char *method_name) {
  struct vm_class *class;
  class = lookup_class(class_name);
  if (!class)
    return NULL;
  return lookup_method(class, method_name);
}


x86 assembly (clang, -O0):
<vm_lookup_native>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <lookup_class@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    1155 <vm_lookup_native+0x35>
movq   $0x0,-0x8(%rbp)
jmp    1166 <vm_lookup_native+0x46>
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <lookup_method@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vm_lookup_native>:
push   %rbx
mov    %rsi,%rbx
call   1040 <lookup_class@plt>
test   %rax,%rax
je     113a <vm_lookup_native+0x1a>
mov    %rax,%rdi
mov    %rbx,%rsi
pop    %rbx
jmp    1030 <lookup_method@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.vm_class = type { i32 }
define i8* @vm_lookup_native(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca %struct.vm_class*
store i8* %0, i8** %4
store i8* %1, i8** %5
%7 = load i8*, i8** %4
%8 = call %struct.vm_class* @lookup_class(i8* %7)
store %struct.vm_class* %8, %struct.vm_class** %6
%9 = load %struct.vm_class*, %struct.vm_class** %6
%10 = icmp ne %struct.vm_class* %9, null
br i1 %10, label %12, label %11
11: ; preds = %2
store i8* null, i8** %3
br label %16
12: ; preds = %2
%13 = load %struct.vm_class*, %struct.vm_class** %6
%14 = load i8*, i8** %5
%15 = call i8* @lookup_method(%struct.vm_class* %13, i8* %14)
store i8* %15, i8** %3
br label %16
16: ; preds = %12, %11
%17 = load i8*, i8** %3
ret i8* %17
}

LLVM IR (-O2):
%struct.vm_class = type { i32 }
define i8* @vm_lookup_native(i8* %0, i8* %1) {
%3 = tail call %struct.vm_class* @lookup_class(i8* %0)
%4 = icmp eq %struct.vm_class* %3, null
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i8* @lookup_method(%struct.vm_class* %3, i8* %1)
br label %7
7: ; preds = %2, %5
%8 = phi i8* [ %6, %5 ], [ null, %2 ]
ret i8* %8
}