xunge/DecIR huggingface dataset:
int main(void) {
  char hello[6 + 5 * 8] = "hello";
  char *h = hello;
  h++;
  *hello = 'u';
  int const bb = 1;
  int bbb = 2;
  int const constarr[2] = {1, 2};
  h = "newst";
  h = 'n';
  h = 8;
  h = "no error";
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x40(%rbp),%rdi
xor    %esi,%esi
mov    $0x2e,%edx
call   1030 <memset@plt>
movb   $0x68,-0x40(%rbp)
movb   $0x65,-0x3f(%rbp)
movb   $0x6c,-0x3e(%rbp)
movb   $0x6c,-0x3d(%rbp)
movb   $0x6f,-0x3c(%rbp)
lea    -0x40(%rbp),%rax
mov    %rax,-0x48(%rbp)
mov    -0x48(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x48(%rbp)
movb   $0x75,-0x40(%rbp)
movl   $0x1,-0x4c(%rbp)
movl   $0x2,-0x50(%rbp)
mov    0xe90(%rip),%rax
mov    %rax,-0x58(%rbp)
lea    0xe8d(%rip),%rax
mov    %rax,-0x48(%rbp)
mov    $0x6e,%eax
mov    %rax,-0x48(%rbp)
mov    $0x8,%eax
mov    %rax,-0x48(%rbp)
lea    0xe76(%rip),%rax
mov    %rax,-0x48(%rbp)
xor    %eax,%eax
add    $0x60,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@__const.main.constarr = [2 x i32] [i32 1, i32 2]
@.str = [6 x i8] c"newst\00"
@.str.1 = [9 x i8] c"no error\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [46 x i8]
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
%6 = alloca [2 x i32]
store i32 0, i32* %1
%7 = bitcast [46 x i8]* %2 to i8*
%8 = bitcast i8* %7 to [46 x i8]*
%9 = getelementptr inbounds [46 x i8], [46 x i8]* %8, i32 0, i32 0
store i8 104, i8* %9
%10 = getelementptr inbounds [46 x i8], [46 x i8]* %8, i32 0, i32 1
store i8 101, i8* %10
%11 = getelementptr inbounds [46 x i8], [46 x i8]* %8, i32 0, i32 2
store i8 108, i8* %11
%12 = getelementptr inbounds [46 x i8], [46 x i8]* %8, i32 0, i32 3
store i8 108, i8* %12
%13 = getelementptr inbounds [46 x i8], [46 x i8]* %8, i32 0, i32 4
store i8 111, i8* %13
%14 = getelementptr inbounds [46 x i8], [46 x i8]* %2, i64 0, i64 0
store i8* %14, i8** %3
%15 = load i8*, i8** %3
%16 = getelementptr inbounds i8, i8* %15, i32 1
store i8* %16, i8** %3
%17 = getelementptr inbounds [46 x i8], [46 x i8]* %2, i64 0, i64 0
store i8 117, i8* %17
store i32 1, i32* %4
store i32 2, i32* %5
%18 = bitcast [2 x i32]* %6 to i8*
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8** %3
store i8* inttoptr (i64 110 to i8*), i8** %3
store i8* inttoptr (i64 8 to i8*), i8** %3
store i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i8** %3
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Type definitions */
struct str_t {
  int dummy;
};

/* Variables and functions */
int str_char_concat(struct str_t *, char const *, size_t);
int /*<<< orphan*/ str_init(struct str_t *);
size_t strlen(char const *);
int str_init_create(struct str_t *str, const char const *value, size_t size) {
  str_init(str);
  if (!size)
    size = strlen(value);
  return str_char_concat(str, value, size);
}


x86 assembly (clang, -O0):
<str_init_create>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <str_init@plt>
cmpq   $0x0,-0x18(%rbp)
jne    1165 <str_init_create+0x35>
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1040 <str_char_concat@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<str_init_create>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%rbx
mov    %rsi,%r14
mov    %rdi,%r15
call   1050 <str_init@plt>
test   %rbx,%rbx
jne    1153 <str_init_create+0x23>
mov    %r14,%rdi
call   1030 <strlen@plt>
mov    %rax,%rbx
mov    %r15,%rdi
mov    %r14,%rsi
mov    %rbx,%rdx
pop    %rbx
pop    %r14
pop    %r15
jmp    1040 <str_char_concat@plt>

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

LLVM IR (-O2):
%struct.str_t = type { i32 }
define i32 @str_init_create(%struct.str_t* %0, i8* %1, i64 %2) {
%4 = tail call i32 @str_init(%struct.str_t* %0)
%5 = icmp eq i64 %2, 0
br i1 %5, label %6, label %8
6: ; preds = %3
%7 = tail call i64 @strlen(i8* dereferenceable(1) %1)
br label %8
8: ; preds = %6, %3
%9 = phi i64 [ %2, %3 ], [ %7, %6 ]
%10 = tail call i32 @str_char_concat(%struct.str_t* %0, i8* %1, i64 %9)
ret i32 %10
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t pos_int32_t(uint32_t number) { return number ^ 0x80000000; }


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

x86 assembly (clang, -O2):
<pos_int32_t>:
mov    %edi,%eax
xor    $0x80000000,%eax
ret

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

LLVM IR (-O2):
define i32 @pos_int32_t(i32 %0) {
%2 = xor i32 %0, -2147483648
ret i32 %2
}
/* Variables and functions */
scalar_t__ EINTR;
scalar_t__ errno;
int write(int, char const *, unsigned int);
int fd_write(int fd, char const *buf, unsigned int len) {
  register int r;
  do
    r = write(fd, buf, len);
  while ((r == -1) && (errno == EINTR));
  return r;
}


x86 assembly (clang, -O0):
<fd_write>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <write@plt>
mov    %eax,-0x18(%rbp)
xor    %eax,%eax
cmpl   $0xffffffff,-0x18(%rbp)
mov    %al,-0x19(%rbp)
jne    115d <fd_write+0x4d>
mov    0x2e96(%rip),%rax
mov    (%rax),%rax
mov    0x2e84(%rip),%rcx
cmp    (%rcx),%rax
sete   %al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
test   $0x1,%al
jne    1122 <fd_write+0x12>
mov    -0x18(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fd_write>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %edx,%r14d
mov    %rsi,%rbx
mov    %edi,%ebp
mov    0x2eb9(%rip),%r15
mov    0x2eaa(%rip),%r12
xchg   %ax,%ax
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %r14d,%edx
call   1030 <write@plt>
cmp    $0xffffffff,%eax
jne    114b <fd_write+0x3b>
mov    (%r12),%rcx
cmp    %rcx,(%r15)
je     1130 <fd_write+0x20>
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@errno = global i64 0
@EINTR = global i64 0
define i32 @fd_write(i32 %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %4
store i8* %1, i8** %5
store i32 %2, i32* %6
br label %8
8: ; preds = %20, %3
%9 = load i32, i32* %4
%10 = load i8*, i8** %5
%11 = load i32, i32* %6
%12 = call i32 @write(i32 %9, i8* %10, i32 %11)
store i32 %12, i32* %7
br label %13
13: ; preds = %8
%14 = load i32, i32* %7
%15 = icmp eq i32 %14, -1
br i1 %15, label %16, label %20
16: ; preds = %13
%17 = load i64, i64* @errno
%18 = load i64, i64* @EINTR
%19 = icmp eq i64 %17, %18
br label %20
20: ; preds = %16, %13
%21 = phi i1 [ false, %13 ], [ %19, %16 ]
br i1 %21, label %8, label %22
22: ; preds = %20
%23 = load i32, i32* %7
ret i32 %23
}

LLVM IR (-O2):
@errno = global i64 0
@EINTR = global i64 0
define i32 @fd_write(i32 %0, i8* nocapture %1, i32 %2) {
br label %4
4: ; preds = %4, %3
%5 = tail call i32 @write(i32 %0, i8* %1, i32 %2)
%6 = icmp eq i32 %5, -1
%7 = load i64, i64* @errno
%8 = load i64, i64* @EINTR
%9 = icmp eq i64 %7, %8
%10 = select i1 %6, i1 %9, i1 false
br i1 %10, label %4, label %11
11: ; preds = %4
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ free(int *);
int destroy(void *data) {
  int *a = (int *)data;
  free(a);
  a = NULL;
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @destroy(i8* %0) {
%2 = alloca i8*
%3 = alloca i32*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = bitcast i8* %4 to i32*
store i32* %5, i32** %3
%6 = load i32*, i32** %3
%7 = call i32 @free(i32* %6)
store i32* null, i32** %3
ret i32 0
}

LLVM IR (-O2):
define i32 @destroy(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = tail call i32 @free(i32* %2)
ret i32 0
}
/* Type definitions */
struct ps_process {
  int dummy;
};
struct ps_bus_event {
  int dummy;
};
struct obus_bus_event {
  int dummy;
};

/* Variables and functions */
int obus_bus_event_unregister_object(struct obus_bus_event *,
                                     int /*<<< orphan*/);
int /*<<< orphan*/ ps_process_object(struct ps_process *);
int ps_bus_event_unregister_process(struct ps_bus_event *bus_event,
                                    struct ps_process *object) {
  return obus_bus_event_unregister_object((struct obus_bus_event *)bus_event,
                                          ps_process_object(object));
}


x86 assembly (clang, -O0):
<ps_bus_event_unregister_process>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <ps_process_object@plt>
mov    -0x18(%rbp),%rdi
mov    %eax,%esi
call   1030 <obus_bus_event_unregister_object@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ps_bus_event_unregister_process>:
push   %rbx
mov    %rdi,%rbx
mov    %rsi,%rdi
call   1040 <ps_process_object@plt>
mov    %rbx,%rdi
mov    %eax,%esi
pop    %rbx
jmp    1030 <obus_bus_event_unregister_object@plt>

LLVM IR (-O0):
%struct.ps_bus_event = type { i32 }
%struct.ps_process = type { i32 }
%struct.obus_bus_event = type { i32 }
define i32 @ps_bus_event_unregister_process(%struct.ps_bus_event* %0, %struct.ps_process* %1) {
%3 = alloca %struct.ps_bus_event*
%4 = alloca %struct.ps_process*
store %struct.ps_bus_event* %0, %struct.ps_bus_event** %3
store %struct.ps_process* %1, %struct.ps_process** %4
%5 = load %struct.ps_bus_event*, %struct.ps_bus_event** %3
%6 = bitcast %struct.ps_bus_event* %5 to %struct.obus_bus_event*
%7 = load %struct.ps_process*, %struct.ps_process** %4
%8 = call i32 @ps_process_object(%struct.ps_process* %7)
%9 = call i32 @obus_bus_event_unregister_object(%struct.obus_bus_event* %6, i32 %8)
ret i32 %9
}

LLVM IR (-O2):
%struct.ps_bus_event = type { i32 }
%struct.ps_process = type { i32 }
%struct.obus_bus_event = type { i32 }
define i32 @ps_bus_event_unregister_process(%struct.ps_bus_event* %0, %struct.ps_process* %1) {
%3 = bitcast %struct.ps_bus_event* %0 to %struct.obus_bus_event*
%4 = tail call i32 @ps_process_object(%struct.ps_process* %1)
%5 = tail call i32 @obus_bus_event_unregister_object(%struct.obus_bus_event* %3, i32 %4)
ret i32 %5
}
void __attribute__((weak)) vApplicationStackOverflowHook() {}


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

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

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

LLVM IR (-O2):
define weak void @vApplicationStackOverflowHook() {
ret void
}
/* Variables and functions */
double atan(double);
double cbuiltin_arctan(double x) { return atan(x); }


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

x86 assembly (clang, -O2):
<cbuiltin_arctan>:
jmp    1030 <atan@plt>

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

LLVM IR (-O2):
define double @cbuiltin_arctan(double %0) {
%2 = tail call double @atan(double %0)
ret double %2
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
int readInBit();
uint8_t readChar(void) {
  uint8_t dataRead = 0;
  for (int i = 0; i < 7; i++) {
    dataRead <<= 1;
    uint8_t newBit = readInBit();
    dataRead |= newBit;
  }
  return dataRead;
}


x86 assembly (clang, -O0):
<readChar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x7,-0x8(%rbp)
jge    115a <readChar+0x4a>
mov    -0x4(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1030 <readInBit@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <readChar+0x16>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<readChar>:
push   %rbp
push   %r14
push   %rbx
xor    %eax,%eax
call   1030 <readInBit@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1030 <readInBit@plt>
mov    %eax,%ebp
shl    $0x2,%ebx
add    %eax,%ebp
or     %ebx,%ebp
xor    %eax,%eax
call   1030 <readInBit@plt>
mov    %eax,%ebx
or     %ebp,%ebx
xor    %eax,%eax
call   1030 <readInBit@plt>
mov    %eax,%r14d
shl    $0x2,%ebx
add    %eax,%r14d
xor    %eax,%eax
call   1030 <readInBit@plt>
mov    %eax,%ebp
or     %r14d,%ebp
or     %ebx,%ebp
xor    %eax,%eax
call   1030 <readInBit@plt>
mov    %eax,%ebx
shl    $0x2,%ebp
add    %eax,%ebx
xor    %eax,%eax
call   1030 <readInBit@plt>
or     %ebx,%eax
or     %ebp,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @readChar() {
%1 = tail call i32 (...) @readInBit()
%2 = tail call i32 (...) @readInBit()
%3 = shl i32 %1, 2
%4 = shl i32 %2, 1
%5 = or i32 %3, %4
%6 = tail call i32 (...) @readInBit()
%7 = or i32 %6, %5
%8 = tail call i32 (...) @readInBit()
%9 = shl i32 %7, 2
%10 = shl i32 %8, 1
%11 = or i32 %9, %10
%12 = tail call i32 (...) @readInBit()
%13 = or i32 %12, %11
%14 = tail call i32 (...) @readInBit()
%15 = shl i32 %13, 2
%16 = shl i32 %14, 1
%17 = or i32 %15, %16
%18 = tail call i32 (...) @readInBit()
%19 = or i32 %18, %17
ret i32 %19
}
int C_Utils_compare_longdouble_ptr(const long double *item1,
                                   const long double *item2) {
  long double i1 = *item1;
  long double i2 = *item2;
  if (i1 == i2)
    return 0;
  return i1 < i2 ? -1 : 1;
}


x86 assembly (clang, -O0):
<C_Utils_compare_longdouble_ptr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
fldt   (%rax)
fstpt  -0x30(%rbp)
mov    -0x18(%rbp),%rax
fldt   (%rax)
fstpt  -0x40(%rbp)
fldt   -0x30(%rbp)
fldt   -0x40(%rbp)
fxch   %st(1)
fucomip %st(1),%st
fstp   %st(0)
jne    1147 <C_Utils_compare_longdouble_ptr+0x47>
jp     1147 <C_Utils_compare_longdouble_ptr+0x47>
jmp    113b <C_Utils_compare_longdouble_ptr+0x3b>
movl   $0x0,-0x4(%rbp)
jmp    1160 <C_Utils_compare_longdouble_ptr+0x60>
fldt   -0x30(%rbp)
fldt   -0x40(%rbp)
fucomip %st(1),%st
fstp   %st(0)
setbe  %al
movzbl %al,%ecx
mov    %ecx,%eax
lea    -0x1(%rax,%rax,1),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<C_Utils_compare_longdouble_ptr>:
fldt   (%rdi)
fldt   (%rsi)
xor    %ecx,%ecx
fucomi %st(1),%st
setbe  %cl
xor    %eax,%eax
fxch   %st(1)
fucomip %st(1),%st
fstp   %st(0)
lea    -0x1(%rcx,%rcx,1),%ecx
cmovne %ecx,%eax
cmovp  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @C_Utils_compare_longdouble_ptr(x86_fp80* %0, x86_fp80* %1) {
%3 = alloca i32
%4 = alloca x86_fp80*
%5 = alloca x86_fp80*
%6 = alloca x86_fp80
%7 = alloca x86_fp80
store x86_fp80* %0, x86_fp80** %4
store x86_fp80* %1, x86_fp80** %5
%8 = load x86_fp80*, x86_fp80** %4
%9 = load x86_fp80, x86_fp80* %8
store x86_fp80 %9, x86_fp80* %6
%10 = load x86_fp80*, x86_fp80** %5
%11 = load x86_fp80, x86_fp80* %10
store x86_fp80 %11, x86_fp80* %7
%12 = load x86_fp80, x86_fp80* %6
%13 = load x86_fp80, x86_fp80* %7
%14 = fcmp oeq x86_fp80 %12, %13
br i1 %14, label %15, label %16
15: ; preds = %2
store i32 0, i32* %3
br label %22
16: ; preds = %2
%17 = load x86_fp80, x86_fp80* %6
%18 = load x86_fp80, x86_fp80* %7
%19 = fcmp olt x86_fp80 %17, %18
%20 = zext i1 %19 to i64
%21 = select i1 %19, i32 -1, i32 1
store i32 %21, i32* %3
br label %22
22: ; preds = %16, %15
%23 = load i32, i32* %3
ret i32 %23
}

LLVM IR (-O2):
define i32 @C_Utils_compare_longdouble_ptr(x86_fp80* nocapture %0, x86_fp80* nocapture %1) {
%3 = load x86_fp80, x86_fp80* %0
%4 = load x86_fp80, x86_fp80* %1
%5 = fcmp oeq x86_fp80 %3, %4
%6 = fcmp olt x86_fp80 %3, %4
%7 = select i1 %6, i32 -1, i32 1
%8 = select i1 %5, i32 0, i32 %7
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ isascii(int);
void t_isascii_0x7b() {
  Assert_real((isascii(123)),
              "/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_isascii.c",
              620, ("isascii should be 1 for {"));
}


x86 assembly (clang, -O0):
<t_isascii_0x7b>:
push   %rbp
mov    %rsp,%rbp
mov    $0x7b,%edi
call   1030 <isascii@plt>
mov    %eax,%edi
lea    0xec9(%rip),%rsi
mov    $0x26c,%edx
lea    0xf65(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isascii_0x7b>:
lea    0xee9(%rip),%rsi
lea    0xf8a(%rip),%rcx
mov    $0x1,%edi
mov    $0x26c,%edx
jmp    1030 <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_isascii.c\00"
@.str.1 = [26 x i8] c"isascii should be 1 for {\00"
define void @t_isascii_0x7b() {
%1 = call i32 @isascii(i32 123)
%2 = call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 620, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isascii.c\00"
@.str.1 = [26 x i8] c"isascii should be 1 for {\00"
define void @t_isascii_0x7b() {
%1 = tail call i32 @Assert_real(i32 1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 620, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int ask_availability(char *origin, char *destination, struct inventory *inv) {}


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

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

LLVM IR (-O0):
%struct.inventory = type opaque
define i32 @ask_availability(i8* %0, i8* %1, %struct.inventory* %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca %struct.inventory*
store i8* %0, i8** %5
store i8* %1, i8** %6
store %struct.inventory* %2, %struct.inventory** %7
%8 = load i32, i32* %4
ret i32 %8
}

LLVM IR (-O2):
%struct.inventory = type opaque
define i32 @ask_availability(i8* nocapture readnone %0, i8* nocapture readnone %1, %struct.inventory* nocapture readnone %2) {
ret i32 undef
}
int mus_iclamp(int lo, int val, int hi) {
  if (val > hi)
    return (hi);
  else if (val < lo)
    return (lo);
  else
    return (val);
}


x86 assembly (clang, -O0):
<mus_iclamp>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jle    1124 <mus_iclamp+0x24>
mov    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1141 <mus_iclamp+0x41>
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    113b <mus_iclamp+0x3b>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1141 <mus_iclamp+0x41>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @mus_iclamp(i32 %0, i32 %1, i32 %2) {
%4 = icmp sgt i32 %1, %2
%5 = icmp slt i32 %1, %0
%6 = select i1 %5, i32 %0, i32 %1
%7 = select i1 %4, i32 %2, i32 %6
ret i32 %7
}
/* Type definitions */
struct mempool {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ bzero(void *, unsigned int);
void *mp_alloc(struct mempool *, unsigned int);
void *mp_alloc_zero(struct mempool *pool, unsigned size) {
  void *ptr = mp_alloc(pool, size);
  bzero(ptr, size);
  return ptr;
}


x86 assembly (clang, -O0):
<mp_alloc_zero>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <mp_alloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1040 <bzero@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mp_alloc_zero>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
call   1030 <mp_alloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %ebp,%esi
call   1040 <bzero@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
%struct.mempool = type { i32 }
define i8* @mp_alloc_zero(%struct.mempool* %0, i32 %1) {
%3 = alloca %struct.mempool*
%4 = alloca i32
%5 = alloca i8*
store %struct.mempool* %0, %struct.mempool** %3
store i32 %1, i32* %4
%6 = load %struct.mempool*, %struct.mempool** %3
%7 = load i32, i32* %4
%8 = call i8* @mp_alloc(%struct.mempool* %6, i32 %7)
store i8* %8, i8** %5
%9 = load i8*, i8** %5
%10 = load i32, i32* %4
%11 = call i32 @bzero(i8* %9, i32 %10)
%12 = load i8*, i8** %5
ret i8* %12
}

LLVM IR (-O2):
%struct.mempool = type { i32 }
define i8* @mp_alloc_zero(%struct.mempool* %0, i32 %1) {
%3 = tail call i8* @mp_alloc(%struct.mempool* %0, i32 %1)
%4 = tail call i32 @bzero(i8* %3, i32 %1)
ret i8* %3
}
void printuid(text, uid) const char *text;
unsigned long uid;
{
  tprintf("%s", text);
  tprintf((uid == -1) ? "%ld" : "%lu", uid);
}


x86 assembly (clang, -O0):
<printuid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xed5(%rip),%rdi
mov    $0x0,%al
call   1030 <tprintf@plt>
mov    -0x10(%rbp),%rcx
lea    0xeca(%rip),%rdi
lea    0xebf(%rip),%rax
cmp    $0xffffffffffffffff,%rcx
cmove  %rax,%rdi
mov    -0x10(%rbp),%rsi
mov    $0x0,%al
call   1030 <tprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printuid>:
push   %rbx
mov    %rsi,%rbx
mov    %rdi,%rsi
lea    0xee2(%rip),%rdi
xor    %eax,%eax
call   1030 <tprintf@plt>
cmp    $0xffffffffffffffff,%rbx
lea    0xed3(%rip),%rax
lea    0xed0(%rip),%rdi
cmove  %rax,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
pop    %rbx
jmp    1030 <tprintf@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
@.str.1 = [4 x i8] c"%ld\00"
@.str.2 = [4 x i8] c"%lu\00"
define void @printuid(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 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @tprintf to i32 (i8*, i8*, ...)*)(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %5)
%7 = load i64, i64* %4
%8 = icmp eq i64 %7, -1
%9 = zext i1 %8 to i64
%10 = select i1 %8, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0)
%11 = load i64, i64* %4
%12 = call i32 (i8*, i64, ...) bitcast (i32 (...)* @tprintf to i32 (i8*, i64, ...)*)(i8* %10, i64 %11)
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
@.str.1 = [4 x i8] c"%ld\00"
@.str.2 = [4 x i8] c"%lu\00"
define void @printuid(i8* %0, i64 %1) {
%3 = tail call i32 (i8*, i8*, ...) bitcast (i32 (...)* @tprintf to i32 (i8*, i8*, ...)*)(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = icmp eq i64 %1, -1
%5 = select i1 %4, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0)
%6 = tail call i32 (i8*, i64, ...) bitcast (i32 (...)* @tprintf to i32 (i8*, i64, ...)*)(i8* %5, i64 %1)
ret void
}
int test_imm_EBint64_midword_mem(long long *val) {
  return ((*val >> 16) & (0xEB << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_EBint64_midword_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, 16
%6 = and i64 %5, 235
%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_EBint64_midword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 15400960
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
unsigned numFreeCalls() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @numFreeCalls() {
ret i32 0
}
int is_printable(char c) {
  if (c < ' ' || c == '\"' || c == '\\')
    return 0;
  else
    return 1;
}


x86 assembly (clang, -O0):
<is_printable>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x20,%eax
jl     1131 <is_printable+0x31>
movsbl -0x5(%rbp),%eax
cmp    $0x22,%eax
je     1131 <is_printable+0x31>
movsbl -0x5(%rbp),%eax
cmp    $0x5c,%eax
jne    113d <is_printable+0x3d>
movl   $0x0,-0x4(%rbp)
jmp    1144 <is_printable+0x44>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_printable>:
cmp    $0x20,%dil
setge  %al
cmp    $0x5c,%dil
setne  %cl
cmp    $0x22,%dil
setne  %dl
and    %cl,%dl
and    %al,%dl
movzbl %dl,%eax
ret

LLVM IR (-O0):
define i32 @is_printable(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = icmp slt i32 %5, 32
br i1 %6, label %15, label %7
7: ; preds = %1
%8 = load i8, i8* %3
%9 = sext i8 %8 to i32
%10 = icmp eq i32 %9, 34
br i1 %10, label %15, label %11
11: ; preds = %7
%12 = load i8, i8* %3
%13 = sext i8 %12 to i32
%14 = icmp eq i32 %13, 92
br i1 %14, label %15, label %16
15: ; preds = %11, %7, %1
store i32 0, i32* %2
br label %17
16: ; preds = %11
store i32 1, i32* %2
br label %17
17: ; preds = %16, %15
%18 = load i32, i32* %2
ret i32 %18
}

LLVM IR (-O2):
define i32 @is_printable(i8 signext %0) {
%2 = icmp sgt i8 %0, 31
%3 = icmp ne i8 %0, 92
%4 = icmp ne i8 %0, 34
%5 = and i1 %3, %4
%6 = and i1 %2, %5
%7 = zext i1 %6 to i32
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ CStrings__check_len(int);
void CStrings__set_char(char *str, int i, int to) {
  if ((i < 0) || (i > 8 * 1024))
    CStrings__check_len(i);
  else
    str[i] = (char)to;
}


x86 assembly (clang, -O0):
<CStrings__set_char>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
cmpl   $0x0,-0xc(%rbp)
jl     1139 <CStrings__set_char+0x29>
cmpl   $0x2000,-0xc(%rbp)
jle    1146 <CStrings__set_char+0x36>
mov    -0xc(%rbp),%edi
call   1030 <CStrings__check_len@plt>
jmp    1156 <CStrings__set_char+0x46>
mov    -0x10(%rbp),%eax
mov    %al,%dl
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CStrings__set_char>:
cmp    $0x2001,%esi
jb     111f <CStrings__set_char+0xf>
mov    %esi,%edi
jmp    1030 <CStrings__check_len@plt>
mov    %esi,%eax
mov    %dl,(%rdi,%rax,1)
ret

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

LLVM IR (-O2):
define void @CStrings__set_char(i8* nocapture writeonly %0, i32 %1, i32 %2) {
%4 = icmp ugt i32 %1, 8192
br i1 %4, label %5, label %7
5: ; preds = %3
%6 = tail call i32 @CStrings__check_len(i32 %1)
br label %11
7: ; preds = %3
%8 = trunc i32 %2 to i8
%9 = zext i32 %1 to i64
%10 = getelementptr inbounds i8, i8* %0, i64 %9
store i8 %8, i8* %10
br label %11
11: ; preds = %7, %5
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128d;

/* Variables and functions */
int /*<<< orphan*/ _mm_store1_pd(void *, int /*<<< orphan*/);
void test_store1_pd(__m128d x, void *y) { _mm_store1_pd(y, x); }


x86 assembly (clang, -O0):
<test_store1_pd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x4(%rbp),%esi
call   1030 <_mm_store1_pd@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_store1_pd>:
mov    %edi,%eax
mov    %rsi,%rdi
mov    %eax,%esi
jmp    1030 <_mm_store1_pd@plt>

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

LLVM IR (-O2):
define void @test_store1_pd(i32 %0, i8* %1) {
%3 = tail call i32 @_mm_store1_pd(i8* %1, i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ CG_WeaponIndex(int, int *, int *);
int getNextWeapInBank(int, int);
int getNextWeapInBankBynum(int weapnum) {
  int bank, cycle;
  if (!CG_WeaponIndex(weapnum, &bank, &cycle))
    return weapnum;
  return getNextWeapInBank(bank, cycle);
}


x86 assembly (clang, -O0):
<getNextWeapInBankBynum>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
lea    -0xc(%rbp),%rsi
lea    -0x10(%rbp),%rdx
call   1040 <CG_WeaponIndex@plt>
cmp    $0x0,%eax
jne    114f <getNextWeapInBankBynum+0x2f>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    115d <getNextWeapInBankBynum+0x3d>
mov    -0xc(%rbp),%edi
mov    -0x10(%rbp),%esi
call   1030 <getNextWeapInBank@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getNextWeapInBankBynum>:
push   %rbx
sub    $0x10,%rsp
mov    %edi,%ebx
lea    0xc(%rsp),%rsi
lea    0x8(%rsp),%rdx
call   1040 <CG_WeaponIndex@plt>
test   %eax,%eax
je     1149 <getNextWeapInBankBynum+0x29>
mov    0xc(%rsp),%edi
mov    0x8(%rsp),%esi
call   1030 <getNextWeapInBank@plt>
mov    %eax,%ebx
mov    %ebx,%eax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @getNextWeapInBankBynum(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = bitcast i32* %2 to i8*
%5 = bitcast i32* %3 to i8*
%6 = call i32 @CG_WeaponIndex(i32 %0, i32* %2, i32* %3)
%7 = icmp eq i32 %6, 0
br i1 %7, label %12, label %8
8: ; preds = %1
%9 = load i32, i32* %2
%10 = load i32, i32* %3
%11 = call i32 @getNextWeapInBank(i32 %9, i32 %10)
br label %12
12: ; preds = %1, %8
%13 = phi i32 [ %11, %8 ], [ %0, %1 ]
ret i32 %13
}
double f(double x) { return x * x * x + 3 * x - 20; }


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm2
movsd  0xee8(%rip),%xmm1
mulsd  -0x8(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  0xecb(%rip),%xmm1
subsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
movapd %xmm0,%xmm1
mulsd  %xmm0,%xmm1
mulsd  %xmm0,%xmm1
mulsd  0xeec(%rip),%xmm0
addsd  %xmm1,%xmm0
addsd  0xee8(%rip),%xmm0
ret

LLVM IR (-O0):
define double @f(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = load double, double* %2
%5 = fmul double %3, %4
%6 = load double, double* %2
%7 = load double, double* %2
%8 = fmul double 3.000000e+00, %7
%9 = call double @llvm.fmuladd.f64(double %5, double %6, double %8)
%10 = fsub double %9, 2.000000e+01
ret double %10
}

LLVM IR (-O2):
define double @f(double %0) {
%2 = fmul double %0, %0
%3 = fmul double %0, 3.000000e+00
%4 = tail call double @llvm.fmuladd.f64(double %2, double %0, double %3)
%5 = fadd double %4, -2.000000e+01
ret double %5
}
void BlinkNoTimerTaskC$Leds$led2Toggle(void) { LedsP$Leds$led2Toggle(); }


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

x86 assembly (clang, -O2):
<BlinkNoTimerTaskC$Leds$led2Toggle>:
xor    %eax,%eax
jmp    1030 <LedsP$Leds$led2Toggle@plt>

LLVM IR (-O0):
define void @"BlinkNoTimerTaskC$Leds$led2Toggle"() {
%1 = call i32 (...) @"LedsP$Leds$led2Toggle"()
ret void
}

LLVM IR (-O2):
define void @"BlinkNoTimerTaskC$Leds$led2Toggle"() {
%1 = tail call i32 (...) @"LedsP$Leds$led2Toggle"()
ret void
}
int fib(int n) {
  if (n <= 1)
    return 1;
  else
    return fib(n - 2) + fib(n - 1);
}


x86 assembly (clang, -O0):
<fib>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
jg     1131 <fib+0x21>
movl   $0x1,-0x4(%rbp)
jmp    1154 <fib+0x44>
mov    -0x8(%rbp),%edi
sub    $0x2,%edi
call   1030 <fib@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
sub    $0x1,%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    $0x1,%ebp
cmp    $0x2,%edi
jl     1145 <fib+0x35>
mov    %edi,%ebx
add    $0x1,%ebx
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
lea    -0x3(%rbx),%edi
call   1030 <fib@plt>
add    %eax,%ebp
add    $0xffffffff,%ebx
cmp    $0x2,%ebx
ja     1130 <fib+0x20>
add    $0x1,%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 sle i32 %4, 1
br i1 %5, label %6, label %7
6: ; preds = %1
store i32 1, i32* %2
br label %15
7: ; preds = %1
%8 = load i32, i32* %3
%9 = sub nsw i32 %8, 2
%10 = call i32 @fib(i32 %9)
%11 = load i32, i32* %3
%12 = sub nsw i32 %11, 1
%13 = call i32 @fib(i32 %12)
%14 = add nsw i32 %10, %13
store i32 %14, i32* %2
br label %15
15: ; preds = %7, %6
%16 = load i32, i32* %2
ret i32 %16
}

LLVM IR (-O2):
define i32 @fib(i32 %0) {
%2 = icmp slt i32 %0, 2
br i1 %2, label %13, 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, -2
%7 = tail call i32 @fib(i32 %6)
%8 = add nsw i32 %4, -1
%9 = add nsw i32 %7, %5
%10 = icmp ult i32 %4, 3
br i1 %10, label %11, label %3
11: ; preds = %3
%12 = add i32 %9, 1
br label %13
13: ; preds = %11, %1
%14 = phi i32 [ 1, %1 ], [ %12, %11 ]
ret i32 %14
}
void initbug() {
  const union { float a; } u = {};
  (void)u.a;
}


x86 assembly (clang, -O0):
<initbug>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x8(%rbp),%rdi
xor    %esi,%esi
mov    $0x4,%edx
call   1030 <memset@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%union.anon = type { float }
define void @initbug() {
%1 = alloca %union.anon
%2 = bitcast %union.anon* %1 to i8*
%3 = bitcast %union.anon* %1 to float*
%4 = load float, float* %3
ret void
}

LLVM IR (-O2):
define void @initbug() {
ret void
}
/* Variables and functions */
size_t calc_true_index(size_t index, size_t start, size_t stop) {
  if (start >= stop)
    return start;
  while (index - start < 512)
    index += stop - start;
  return index - 512;
}


x86 assembly (clang, -O0):
<calc_true_index>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x20(%rbp),%rax
jb     112b <calc_true_index+0x2b>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1167 <calc_true_index+0x67>
jmp    1130 <calc_true_index+0x30>
mov    -0x10(%rbp),%rax
sub    -0x18(%rbp),%rax
cmp    $0x200,%rax
jae    1159 <calc_true_index+0x59>
mov    -0x20(%rbp),%rax
sub    -0x18(%rbp),%rax
add    -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
jmp    1130 <calc_true_index+0x30>
mov    -0x10(%rbp),%rax
sub    $0x200,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<calc_true_index>:
mov    %rsi,%rax
sub    %rsi,%rdx
jbe    113a <calc_true_index+0x3a>
mov    %rdi,%rcx
sub    %rax,%rcx
cmp    $0x1ff,%rcx
ja     1130 <calc_true_index+0x30>
neg    %rax
nopw   0x0(%rax,%rax,1)
add    %rdx,%rdi
lea    (%rax,%rdi,1),%rcx
cmp    $0x200,%rcx
jb     1120 <calc_true_index+0x20>
add    $0xfffffffffffffe00,%rdi
mov    %rdi,%rax
ret

LLVM IR (-O0):
define i64 @calc_true_index(i64 %0, i64 %1, i64 %2) {
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
%7 = alloca i64
store i64 %0, i64* %5
store i64 %1, i64* %6
store i64 %2, i64* %7
%8 = load i64, i64* %6
%9 = load i64, i64* %7
%10 = icmp uge i64 %8, %9
br i1 %10, label %11, label %13
11: ; preds = %3
%12 = load i64, i64* %6
store i64 %12, i64* %4
br label %28
13: ; preds = %3
br label %14
14: ; preds = %19, %13
%15 = load i64, i64* %5
%16 = load i64, i64* %6
%17 = sub i64 %15, %16
%18 = icmp ult i64 %17, 512
br i1 %18, label %19, label %25
19: ; preds = %14
%20 = load i64, i64* %7
%21 = load i64, i64* %6
%22 = sub i64 %20, %21
%23 = load i64, i64* %5
%24 = add i64 %23, %22
store i64 %24, i64* %5
br label %14
25: ; preds = %14
%26 = load i64, i64* %5
%27 = sub i64 %26, 512
store i64 %27, i64* %4
br label %28
28: ; preds = %25, %11
%29 = load i64, i64* %4
ret i64 %29
}

LLVM IR (-O2):
define i64 @calc_true_index(i64 %0, i64 %1, i64 %2) {
%4 = icmp ugt i64 %2, %1
br i1 %4, label %5, label %18
5: ; preds = %3
%6 = sub i64 %0, %1
%7 = icmp ult i64 %6, 512
br i1 %7, label %8, label %15
8: ; preds = %5
%9 = sub i64 %2, %1
br label %10
10: ; preds = %8, %10
%11 = phi i64 [ %0, %8 ], [ %12, %10 ]
%12 = add i64 %9, %11
%13 = sub i64 %12, %1
%14 = icmp ult i64 %13, 512
br i1 %14, label %10, label %15
15: ; preds = %10, %5
%16 = phi i64 [ %0, %5 ], [ %12, %10 ]
%17 = add i64 %16, -512
br label %18
18: ; preds = %3, %15
%19 = phi i64 [ %17, %15 ], [ %1, %3 ]
ret i64 %19
}
/* Variables and functions */
scalar_t__ configz_readString(char const *, char const *, char const *, char *,
                              int);
scalar_t__ isValidIP(char *);
int configz_readIP(const char *configfile, const char *label, const char *key,
                   char *value, int num) {
  if (configz_readString(configfile, label, key, value, num) != 0) {
    return -1;
  }
  if (isValidIP(value)) {
    return 0;
  }
  return -1;
}


x86 assembly (clang, -O0):
<configz_readIP>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    %r8d,-0x2c(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
mov    -0x28(%rbp),%rcx
mov    -0x2c(%rbp),%r8d
call   1030 <configz_readString@plt>
cmp    $0x0,%rax
je     116b <configz_readIP+0x4b>
movl   $0xffffffff,-0x4(%rbp)
jmp    1191 <configz_readIP+0x71>
mov    -0x28(%rbp),%rdi
call   1040 <isValidIP@plt>
cmp    $0x0,%rax
je     118a <configz_readIP+0x6a>
movl   $0x0,-0x4(%rbp)
jmp    1191 <configz_readIP+0x71>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<configz_readIP>:
push   %rbx
mov    %rcx,%rbx
call   1030 <configz_readString@plt>
mov    %rax,%rcx
mov    $0xffffffff,%eax
test   %rcx,%rcx
je     1138 <configz_readIP+0x18>
pop    %rbx
ret
mov    %rbx,%rdi
call   1040 <isValidIP@plt>
cmp    $0x1,%rax
sbb    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @configz_readIP(i8* %0, i8* %1, i8* %2, i8* %3, i32 %4) {
%6 = tail call i64 @configz_readString(i8* %0, i8* %1, i8* %2, i8* %3, i32 %4)
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %12
8: ; preds = %5
%9 = tail call i64 @isValidIP(i8* %3)
%10 = icmp eq i64 %9, 0
%11 = sext i1 %10 to i32
br label %12
12: ; preds = %8, %5
%13 = phi i32 [ -1, %5 ], [ %11, %8 ]
ret i32 %13
}
void ff_hevc_put_hevc_uni_pel_pixels12_12_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_uni_pel_pixels12_12_sse4() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ srand(int);
int time(int /*<<< orphan*/ *);
void css_eval_start() {
  int grain = time(NULL);
  srand(grain);
}


x86 assembly (clang, -O0):
<css_eval_start>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xor    %eax,%eax
mov    %eax,%edi
call   1040 <time@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <srand@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @css_eval_start() {
%1 = alloca i32
%2 = call i32 @time(i32* null)
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = call i32 @srand(i32 %3)
ret void
}

LLVM IR (-O2):
define void @css_eval_start() {
%1 = tail call i32 @time(i32* null)
%2 = tail call i32 @srand(i32 %1)
ret void
}
void foo667(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo667(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void usage(char *filename) {
  printf("USAGE: %s <dirs> [ -o <db_file> ]\n", filename);
  printf("       %s -h|--help prints this usage message.\n", filename);
  printf("          -n|--no-rc means the rc file will not be written\n");
}


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

x86 assembly (clang, -O2):
<usage>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xee7(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xf06(%rip),%rdi
pop    %rbx
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [35 x i8] c"USAGE: %s <dirs> [ -o <db_file> ]\0A\00"
@.str.1 = [48 x i8] c" %s -h|--help prints this usage message.\0A\00"
@.str.2 = [60 x i8] c" -n|--no-rc means the rc file will not be written\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = load i8*, i8** %2
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.1, i64 0, i64 0), i8* %5)
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [35 x i8] c"USAGE: %s <dirs> [ -o <db_file> ]\0A\00"
@.str.1 = [48 x i8] c" %s -h|--help prints this usage message.\0A\00"
@str = [59 x i8] c" -n|--no-rc means the rc file will not be written\00"
define void @usage(i8* %0) {
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([48 x i8], [48 x i8]* @.str.1, i64 0, i64 0), i8* %0)
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([59 x i8], [59 x i8]* @str, i64 0, i64 0))
ret void
}