xunge/DecIR huggingface dataset:
/* Variables and functions */
int __pthread_clone(int (*)(void *), char *, int, void *);
int /*<<< orphan*/ exit(int);
char *malloc(int);
int /*<<< orphan*/ sleep(int);
int start_thread(int (*f)(void *), void *arg) {
  char *stack = malloc(0x4000);
  int tid =
      __pthread_clone(f, stack + 0x4000 - sizeof(unsigned long),
                      0x00000200 | 0x00000400 | 0x00000800 | 0x00000100, arg);
  if (tid < 0) {
    exit(1);
  }
  sleep(1);
  return tid;
}


x86 assembly (clang, -O0):
<start_thread>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x4000,%edi
call   1030 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
add    $0x4000,%rsi
add    $0xfffffffffffffff8,%rsi
mov    -0x10(%rbp),%rcx
mov    $0xf00,%edx
call   1060 <__pthread_clone@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
jge    1196 <start_thread+0x56>
mov    $0x1,%edi
call   1040 <exit@plt>
mov    $0x1,%edi
call   1050 <sleep@plt>
mov    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<start_thread>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
mov    $0x4000,%edi
call   1030 <malloc@plt>
lea    0x3ff8(%rax),%rsi
mov    %rbx,%rdi
mov    $0xf00,%edx
mov    %r14,%rcx
call   1060 <__pthread_clone@plt>
test   %eax,%eax
js     1185 <start_thread+0x45>
mov    %eax,%ebx
mov    $0x1,%edi
call   1050 <sleep@plt>
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define i32 @start_thread(i32 (i8*)* %0, i8* %1) {
%3 = alloca i32 (i8*)*
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
store i32 (i8*)* %0, i32 (i8*)** %3
store i8* %1, i8** %4
%7 = call i8* @malloc(i32 16384)
store i8* %7, i8** %5
%8 = load i32 (i8*)*, i32 (i8*)** %3
%9 = load i8*, i8** %5
%10 = getelementptr inbounds i8, i8* %9, i64 16384
%11 = getelementptr inbounds i8, i8* %10, i64 -8
%12 = load i8*, i8** %4
%13 = call i32 @__pthread_clone(i32 (i8*)* %8, i8* %11, i32 3840, i8* %12)
store i32 %13, i32* %6
%14 = load i32, i32* %6
%15 = icmp slt i32 %14, 0
br i1 %15, label %16, label %18
16: ; preds = %2
%17 = call i32 @exit(i32 1)
unreachable
18: ; preds = %2
%19 = call i32 @sleep(i32 1)
%20 = load i32, i32* %6
ret i32 %20
}

LLVM IR (-O2):
define i32 @start_thread(i32 (i8*)* %0, i8* %1) {
%3 = tail call dereferenceable_or_null(16384) i8* @malloc(i32 16384)
%4 = getelementptr inbounds i8, i8* %3, i64 16376
%5 = tail call i32 @__pthread_clone(i32 (i8*)* %0, i8* %4, i32 3840, i8* %1)
%6 = icmp slt i32 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %2
%8 = tail call i32 @exit(i32 1)
unreachable
9: ; preds = %2
%10 = tail call i32 @sleep(i32 1)
ret i32 %5
}
int Operand_op2p1_encode(unsigned int *valp) {
  unsigned op2_0, op2p1_0;
  op2p1_0 = *valp;
  op2_0 = (op2p1_0 - 0x1) & 0xf;
  *valp = op2_0;
  return 0;
}


x86 assembly (clang, -O0):
<Operand_op2p1_encode>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
sub    $0x1,%eax
and    $0xf,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Operand_op2p1_encode>:
mov    (%rdi),%eax
add    $0xffffffff,%eax
and    $0xf,%eax
mov    %eax,(%rdi)
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @Operand_op2p1_encode(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
%4 = alloca i32
store i32* %0, i32** %2
%5 = load i32*, i32** %2
%6 = load i32, i32* %5
store i32 %6, i32* %4
%7 = load i32, i32* %4
%8 = sub i32 %7, 1
%9 = and i32 %8, 15
store i32 %9, i32* %3
%10 = load i32, i32* %3
%11 = load i32*, i32** %2
store i32 %10, i32* %11
ret i32 0
}

LLVM IR (-O2):
define i32 @Operand_op2p1_encode(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = add i32 %2, 15
%4 = and i32 %3, 15
store i32 %4, i32* %0
ret i32 0
}
int fs_iterate_keys(struct onak_dbctx *dbctx,
                    void (*iterfunc)(void *ctx, struct openpgp_publickey *key),
                    void *ctx) {
  return 0;
}


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

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

LLVM IR (-O0):
%struct.onak_dbctx = type opaque
%struct.openpgp_publickey = type opaque
define i32 @fs_iterate_keys(%struct.onak_dbctx* %0, void (i8*, %struct.openpgp_publickey*)* %1, i8* %2) {
%4 = alloca %struct.onak_dbctx*
%5 = alloca void (i8*, %struct.openpgp_publickey*)*
%6 = alloca i8*
store %struct.onak_dbctx* %0, %struct.onak_dbctx** %4
store void (i8*, %struct.openpgp_publickey*)* %1, void (i8*, %struct.openpgp_publickey*)** %5
store i8* %2, i8** %6
ret i32 0
}

LLVM IR (-O2):
%struct.onak_dbctx = type opaque
%struct.openpgp_publickey = type opaque
define i32 @fs_iterate_keys(%struct.onak_dbctx* nocapture readnone %0, void (i8*, %struct.openpgp_publickey*)* nocapture readnone %1, i8* nocapture readnone %2) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ assert(size_t);
unsigned char *most_significant_byte(void *p_memory, size_t size) {
  assert(p_memory);
  assert(size);
  unsigned char *p_most_significant = NULL;
  p_most_significant = (unsigned char *)p_memory;
  p_most_significant = p_most_significant + (size - 1);
  return p_most_significant;
}


x86 assembly (clang, -O0):
<most_significant_byte>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <assert@plt>
mov    -0x10(%rbp),%rdi
call   1030 <assert@plt>
movq   $0x0,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    -0x10(%rbp),%rcx
sub    $0x1,%rcx
add    %rcx,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<most_significant_byte>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <assert@plt>
mov    %r14,%rdi
call   1030 <assert@plt>
lea    (%r14,%rbx,1),%rax
add    $0xffffffffffffffff,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @most_significant_byte(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i8*
store i8* %0, i8** %3
store i64 %1, i64* %4
%6 = load i8*, i8** %3
%7 = ptrtoint i8* %6 to i64
%8 = call i32 @assert(i64 %7)
%9 = load i64, i64* %4
%10 = call i32 @assert(i64 %9)
store i8* null, i8** %5
%11 = load i8*, i8** %3
store i8* %11, i8** %5
%12 = load i8*, i8** %5
%13 = load i64, i64* %4
%14 = sub i64 %13, 1
%15 = getelementptr inbounds i8, i8* %12, i64 %14
store i8* %15, i8** %5
%16 = load i8*, i8** %5
ret i8* %16
}

LLVM IR (-O2):
define i8* @most_significant_byte(i8* %0, i64 %1) {
%3 = ptrtoint i8* %0 to i64
%4 = tail call i32 @assert(i64 %3)
%5 = tail call i32 @assert(i64 %1)
%6 = add i64 %1, -1
%7 = getelementptr inbounds i8, i8* %0, i64 %6
ret i8* %7
}
void PRMJ_NowInit() {}


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

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

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

LLVM IR (-O2):
define void @PRMJ_NowInit() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ write_Centaurus_CX9211_GPIO(unsigned char);
void write_Centaurus_CX9211_DWdata(unsigned long data) {
  int count;
  write_Centaurus_CX9211_GPIO(0x0001);
  for (count = 0; count < 32; count++) {
    write_Centaurus_CX9211_GPIO((unsigned char)(data & 0x01));
    data >>= 1;
  }
  return;
}


x86 assembly (clang, -O0):
<write_Centaurus_CX9211_DWdata>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x1,%edi
call   1030 <write_Centaurus_CX9211_GPIO@plt>
movl   $0x0,-0xc(%rbp)
cmpl   $0x20,-0xc(%rbp)
jge    1161 <write_Centaurus_CX9211_DWdata+0x51>
mov    -0x8(%rbp),%rax
and    $0x1,%rax
movzbl %al,%edi
call   1030 <write_Centaurus_CX9211_GPIO@plt>
mov    -0x8(%rbp),%rax
shr    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    112d <write_Centaurus_CX9211_DWdata+0x1d>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_Centaurus_CX9211_DWdata>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    $0x1,%edi
call   1030 <write_Centaurus_CX9211_GPIO@plt>
mov    $0x20,%ebp
cs nopw 0x0(%rax,%rax,1)
nop
mov    %ebx,%edi
and    $0x1,%edi
call   1030 <write_Centaurus_CX9211_GPIO@plt>
shr    %rbx
add    $0xffffffff,%ebp
jne    1130 <write_Centaurus_CX9211_DWdata+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define void @write_Centaurus_CX9211_DWdata(i64 %0) {
%2 = alloca i64
%3 = alloca i32
store i64 %0, i64* %2
%4 = call i32 @write_Centaurus_CX9211_GPIO(i8 zeroext 1)
store i32 0, i32* %3
br label %5
5: ; preds = %15, %1
%6 = load i32, i32* %3
%7 = icmp slt i32 %6, 32
br i1 %7, label %8, label %18
8: ; preds = %5
%9 = load i64, i64* %2
%10 = and i64 %9, 1
%11 = trunc i64 %10 to i8
%12 = call i32 @write_Centaurus_CX9211_GPIO(i8 zeroext %11)
%13 = load i64, i64* %2
%14 = lshr i64 %13, 1
store i64 %14, i64* %2
br label %15
15: ; preds = %8
%16 = load i32, i32* %3
%17 = add nsw i32 %16, 1
store i32 %17, i32* %3
br label %5
18: ; preds = %5
ret void
}

LLVM IR (-O2):
define void @write_Centaurus_CX9211_DWdata(i64 %0) {
%2 = tail call i32 @write_Centaurus_CX9211_GPIO(i8 zeroext 1)
br label %3
3: ; preds = %1, %3
%4 = phi i32 [ 0, %1 ], [ %10, %3 ]
%5 = phi i64 [ %0, %1 ], [ %9, %3 ]
%6 = trunc i64 %5 to i8
%7 = and i8 %6, 1
%8 = tail call i32 @write_Centaurus_CX9211_GPIO(i8 zeroext %7)
%9 = lshr i64 %5, 1
%10 = add nuw nsw i32 %4, 1
%11 = icmp eq i32 %10, 32
br i1 %11, label %12, label %3
12: ; preds = %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(int *);
int *malloc(int);
int main() {
  int *p = malloc(1024);
  free(p);
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x400,%edi
call   1040 <malloc@plt>
mov    %rax,%rdi
call   1030 <free@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32*
%2 = call i32* @malloc(i32 1024)
store i32* %2, i32** %1
%3 = load i32*, i32** %1
%4 = call i32 @free(i32* %3)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32* @malloc(i32 1024)
%2 = tail call i32 @free(i32* %1)
ret i32 0
}
/* Variables and functions */
double atan2(double, double);
__attribute__((__weak__, __always___)) double softboundmpx_atan2(double y,
                                                                 double x) {
  return atan2(y, x);
}


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

x86 assembly (clang, -O2):
<softboundmpx_atan2>:
jmp    1030 <atan2@plt>

LLVM IR (-O0):
define weak double @softboundmpx_atan2(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = call double @atan2(double %5, double %6)
ret double %7
}

LLVM IR (-O2):
define weak double @softboundmpx_atan2(double %0, double %1) {
%3 = tail call double @atan2(double %0, double %1)
ret double %3
}
unsigned char f39(unsigned char x, int y) {
  return (x >> y) | (x << ((-y) & (8 - 1)));
}


x86 assembly (clang, -O0):
<f39>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %esi,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
mov    -0x8(%rbp),%ecx
sar    %cl,%eax
movzbl -0x1(%rbp),%edx
xor    %ecx,%ecx
sub    -0x8(%rbp),%ecx
and    $0x7,%ecx
shl    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f39>:
mov    %esi,%ecx
mov    %edi,%eax
shr    %cl,%eax
neg    %cl
and    $0x7,%cl
shl    %cl,%edi
or     %edi,%eax
ret

LLVM IR (-O0):
define zeroext i8 @f39(i8 zeroext %0, i32 %1) {
%3 = alloca i8
%4 = alloca i32
store i8 %0, i8* %3
store i32 %1, i32* %4
%5 = load i8, i8* %3
%6 = zext i8 %5 to i32
%7 = load i32, i32* %4
%8 = ashr i32 %6, %7
%9 = load i8, i8* %3
%10 = zext i8 %9 to i32
%11 = load i32, i32* %4
%12 = sub nsw i32 0, %11
%13 = and i32 %12, 7
%14 = shl i32 %10, %13
%15 = or i32 %8, %14
%16 = trunc i32 %15 to i8
ret i8 %16
}

LLVM IR (-O2):
define zeroext i8 @f39(i8 zeroext %0, i32 %1) {
%3 = zext i8 %0 to i32
%4 = lshr i32 %3, %1
%5 = sub nsw i32 0, %1
%6 = and i32 %5, 7
%7 = shl nuw nsw i32 %3, %6
%8 = or i32 %7, %4
%9 = trunc i32 %8 to i8
ret i8 %9
}
/* Type definitions */
typedef int /*<<< orphan*/ ret;

/* Variables and functions */
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ fuzzRandomBlob(int, unsigned char *);
unsigned int fuzzRandomInt(unsigned int nRange) {
  unsigned int ret;
  assert(nRange > 0);
  fuzzRandomBlob(sizeof(ret), (unsigned char *)&ret);
  return (ret % nRange);
}


x86 assembly (clang, -O0):
<fuzzRandomInt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
seta   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
lea    -0x8(%rbp),%rsi
mov    $0x4,%edi
call   1040 <fuzzRandomBlob@plt>
mov    -0x8(%rbp),%eax
xor    %edx,%edx
divl   -0x4(%rbp)
mov    %edx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fuzzRandomInt>:
push   %rbx
sub    $0x10,%rsp
mov    %edi,%ebx
xor    %edi,%edi
test   %ebx,%ebx
setne  %dil
call   1030 <assert@plt>
lea    0xc(%rsp),%rsi
mov    $0x4,%edi
call   1040 <fuzzRandomBlob@plt>
mov    0xc(%rsp),%eax
xor    %edx,%edx
div    %ebx
mov    %edx,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @fuzzRandomInt(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = icmp ugt i32 %4, 0
%6 = zext i1 %5 to i32
%7 = call i32 @assert(i32 %6)
%8 = bitcast i32* %3 to i8*
%9 = call i32 @fuzzRandomBlob(i32 4, i8* %8)
%10 = load i32, i32* %3
%11 = load i32, i32* %2
%12 = urem i32 %10, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @fuzzRandomInt(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = icmp ne i32 %0, 0
%5 = zext i1 %4 to i32
%6 = tail call i32 @assert(i32 %5)
%7 = call i32 @fuzzRandomBlob(i32 4, i8* %3)
%8 = load i32, i32* %2
%9 = urem i32 %8, %0
ret i32 %9
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ sprintf(char *, char *, int);
int /*<<< orphan*/ strcat(char *, char *);
int CheckSaveFile(int _userId) {
  char filename[11];
  sprintf(filename, "%d", _userId);
  strcat(filename, ".bin");
  FILE *file = fopen(filename, "rb");
  return file != NULL;
}


x86 assembly (clang, -O0):
<CheckSaveFile>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
lea    -0xf(%rbp),%rdi
mov    -0x4(%rbp),%edx
lea    0xeb7(%rip),%rsi
call   1050 <sprintf@plt>
lea    -0xf(%rbp),%rdi
lea    0xeaa(%rip),%rsi
call   1040 <strcat@plt>
lea    -0xf(%rbp),%rdi
lea    0xe9f(%rip),%rsi
call   1030 <fopen@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CheckSaveFile>:
push   %rbx
sub    $0x10,%rsp
mov    %edi,%edx
lea    0xec2(%rip),%rsi
lea    0x5(%rsp),%rbx
mov    %rbx,%rdi
call   1050 <sprintf@plt>
lea    0xeb1(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcat@plt>
lea    0xea7(%rip),%rsi
mov    %rbx,%rdi
call   1030 <fopen@plt>
xor    %ecx,%ecx
test   %rax,%rax
setne  %cl
mov    %ecx,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [5 x i8] c".bin\00"
@.str.2 = [3 x i8] c"rb\00"
define i32 @CheckSaveFile(i32 %0) {
%2 = alloca i32
%3 = alloca [11 x i8]
%4 = alloca i32*
store i32 %0, i32* %2
%5 = getelementptr inbounds [11 x i8], [11 x i8]* %3, i64 0, i64 0
%6 = load i32, i32* %2
%7 = call i32 @sprintf(i8* %5, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %6)
%8 = getelementptr inbounds [11 x i8], [11 x i8]* %3, i64 0, i64 0
%9 = call i32 @strcat(i8* %8, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%10 = getelementptr inbounds [11 x i8], [11 x i8]* %3, i64 0, i64 0
%11 = call i32* @fopen(i8* %10, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
store i32* %11, i32** %4
%12 = load i32*, i32** %4
%13 = icmp ne i32* %12, null
%14 = zext i1 %13 to i32
ret i32 %14
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [5 x i8] c".bin\00"
@.str.2 = [3 x i8] c"rb\00"
define i32 @CheckSaveFile(i32 %0) {
%2 = alloca [11 x i8]
%3 = getelementptr inbounds [11 x i8], [11 x i8]* %2, i64 0, i64 0
%4 = call i32 @sprintf(i8* %3, i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %0)
%5 = call i32 @strcat(i8* %3, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%6 = call i32* @fopen(i8* %3, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%7 = icmp ne i32* %6, null
%8 = zext i1 %7 to i32
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void release_file(char *buffer) { free(buffer); }


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

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

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

LLVM IR (-O2):
define void @release_file(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
size_t heap_rix(size_t i) { return (i * 2) + 2; }


x86 assembly (clang, -O0):
<heap_rix>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
shl    $0x1,%rax
add    $0x2,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<heap_rix>:
lea    (%rdi,%rdi,1),%rax
add    $0x2,%rax
ret

LLVM IR (-O0):
define i64 @heap_rix(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = mul i64 %3, 2
%5 = add i64 %4, 2
ret i64 %5
}

LLVM IR (-O2):
define i64 @heap_rix(i64 %0) {
%2 = shl i64 %0, 1
%3 = add i64 %2, 2
ret i64 %3
}
void INT_Excep_SCIFA10_TXIF10(void) {}


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

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

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

LLVM IR (-O2):
define void @INT_Excep_SCIFA10_TXIF10() {
ret void
}
ortho2_(left, right, bottom, top) float *left, *right, *bottom, *top;
{ ortho2(*left, *right, *bottom, *top); }


x86 assembly (clang, -O0):
<ortho2_>:
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    -0x10(%rbp),%rax
movss  (%rax),%xmm0
cvtss2sd %xmm0,%xmm0
mov    -0x18(%rbp),%rax
movss  (%rax),%xmm1
cvtss2sd %xmm1,%xmm1
mov    -0x20(%rbp),%rax
movss  (%rax),%xmm2
cvtss2sd %xmm2,%xmm2
mov    -0x28(%rbp),%rax
movss  (%rax),%xmm3
cvtss2sd %xmm3,%xmm3
mov    $0x4,%al
call   1030 <ortho2@plt>
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ortho2_>:
movss  (%rdi),%xmm0
cvtss2sd %xmm0,%xmm0
movss  (%rsi),%xmm1
cvtss2sd %xmm1,%xmm1
movss  (%rdx),%xmm2
cvtss2sd %xmm2,%xmm2
movss  (%rcx),%xmm3
cvtss2sd %xmm3,%xmm3
mov    $0x4,%al
jmp    1030 <ortho2@plt>

LLVM IR (-O0):
define i32 @ortho2_(float* %0, float* %1, float* %2, float* %3) {
%5 = alloca i32
%6 = alloca float*
%7 = alloca float*
%8 = alloca float*
%9 = alloca float*
store float* %0, float** %6
store float* %1, float** %7
store float* %2, float** %8
store float* %3, float** %9
%10 = load float*, float** %6
%11 = load float, float* %10
%12 = fpext float %11 to double
%13 = load float*, float** %7
%14 = load float, float* %13
%15 = fpext float %14 to double
%16 = load float*, float** %8
%17 = load float, float* %16
%18 = fpext float %17 to double
%19 = load float*, float** %9
%20 = load float, float* %19
%21 = fpext float %20 to double
%22 = call i32 (double, double, double, double, ...) bitcast (i32 (...)* @ortho2 to i32 (double, double, double, double, ...)*)(double %12, double %15, double %18, double %21)
%23 = load i32, i32* %5
ret i32 %23
}

LLVM IR (-O2):
define i32 @ortho2_(float* nocapture %0, float* nocapture %1, float* nocapture %2, float* nocapture %3) {
%5 = load float, float* %0
%6 = fpext float %5 to double
%7 = load float, float* %1
%8 = fpext float %7 to double
%9 = load float, float* %2
%10 = fpext float %9 to double
%11 = load float, float* %3
%12 = fpext float %11 to double
%13 = tail call i32 (double, double, double, double, ...) bitcast (i32 (...)* @ortho2 to i32 (double, double, double, double, ...)*)(double %6, double %8, double %10, double %12)
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ panic(int);
void panic3() { panic(4); }


x86 assembly (clang, -O0):
<panic3>:
push   %rbp
mov    %rsp,%rbp
mov    $0x4,%edi
call   1030 <panic@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<panic3>:
mov    $0x4,%edi
jmp    1030 <panic@plt>

LLVM IR (-O0):
define void @panic3() {
%1 = call i32 @panic(i32 4)
ret void
}

LLVM IR (-O2):
define void @panic3() {
%1 = tail call i32 @panic(i32 4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, int, char *);
void __assert(char *message, char *file, int line) {
  printf("%s:%d Assertion failed: %s", file, line, message);
}


x86 assembly (clang, -O0):
<__assert>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    -0x8(%rbp),%rcx
lea    0xecb(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__assert>:
mov    %rdi,%rcx
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [27 x i8] c"%s:%d Assertion failed: %s\00"
define void @__assert(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i8*, i8** %5
%8 = load i32, i32* %6
%9 = load i8*, i8** %4
%10 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8* %7, i32 %8, i8* %9)
ret void
}

LLVM IR (-O2):
@.str = [27 x i8] c"%s:%d Assertion failed: %s\00"
define void @__assert(i8* %0, i8* %1, i32 %2) {
%4 = tail call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8* %1, i32 %2, i8* %0)
ret void
}
/* Type definitions */
typedef scalar_t__ uint8_t;
typedef int uint16_t;

/* Variables and functions */
uint16_t be_to_h_u16(const uint8_t *buf) {
  return (uint16_t)((uint16_t)buf[1] | (uint16_t)buf[0] << 8);
}


x86 assembly (clang, -O0):
<be_to_h_u16>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%rax
mov    -0x8(%rbp),%rcx
mov    (%rcx),%rcx
shl    $0x8,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<be_to_h_u16>:
mov    (%rdi),%eax
shl    $0x8,%eax
or     0x8(%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @be_to_h_u16(i64* nocapture %0) {
%2 = getelementptr inbounds i64, i64* %0, i64 1
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
%5 = load i64, i64* %0
%6 = trunc i64 %5 to i32
%7 = shl i32 %6, 8
%8 = or i32 %7, %4
ret i32 %8
}
int mix(int a, int b) {
  int c, d, e, f;
  int i;
  for (i = 0; i < 5010; ++i) {
    c = a * b + d;
    e = a * b;
    f = e + d;
  }
  return f;
}


x86 assembly (clang, -O0):
<mix>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x0,-0x1c(%rbp)
cmpl   $0x1392,-0x1c(%rbp)
jge    114c <mix+0x4c>
mov    -0x4(%rbp),%eax
imul   -0x8(%rbp),%eax
add    -0x10(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
imul   -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1111 <mix+0x11>
mov    -0x18(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @mix(i32 %0, i32 %1) {
ret i32 undef
}
void rdp_orders_process_triblt(struct rdp_orders *self, struct stream *s,
                               int present, int delta) {}


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

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

LLVM IR (-O0):
%struct.rdp_orders = type opaque
%struct.stream = type opaque
define void @rdp_orders_process_triblt(%struct.rdp_orders* %0, %struct.stream* %1, i32 %2, i32 %3) {
%5 = alloca %struct.rdp_orders*
%6 = alloca %struct.stream*
%7 = alloca i32
%8 = alloca i32
store %struct.rdp_orders* %0, %struct.rdp_orders** %5
store %struct.stream* %1, %struct.stream** %6
store i32 %2, i32* %7
store i32 %3, i32* %8
ret void
}

LLVM IR (-O2):
%struct.rdp_orders = type opaque
%struct.stream = type opaque
define void @rdp_orders_process_triblt(%struct.rdp_orders* nocapture %0, %struct.stream* nocapture %1, i32 %2, i32 %3) {
ret void
}
int setCharSetConversion(char *to, char *from) { return -1; }


x86 assembly (clang, -O0):
<setCharSetConversion>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0xffffffff,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @setCharSetConversion(i8* nocapture readnone %0, i8* nocapture readnone %1) {
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ srand(unsigned int);
scalar_t__ time(int /*<<< orphan*/ *);
void randominit(void) { srand((unsigned)time(NULL)); }


x86 assembly (clang, -O0):
<randominit>:
push   %rbp
mov    %rsp,%rbp
xor    %eax,%eax
mov    %eax,%edi
call   1040 <time@plt>
mov    %eax,%edi
call   1030 <srand@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @randominit() {
%1 = call i64 @time(i32* null)
%2 = trunc i64 %1 to i32
%3 = call i32 @srand(i32 %2)
ret void
}

LLVM IR (-O2):
define void @randominit() {
%1 = tail call i64 @time(i32* null)
%2 = trunc i64 %1 to i32
%3 = tail call i32 @srand(i32 %2)
ret void
}
unsigned int Ch(const unsigned int *x, const unsigned int *y,
                const unsigned int *z) {
  return (*x & *y) ^ (~(*x) & *z);
}


x86 assembly (clang, -O0):
<Ch>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    -0x10(%rbp),%rcx
and    (%rcx),%eax
mov    -0x8(%rbp),%rcx
mov    (%rcx),%ecx
xor    $0xffffffff,%ecx
mov    -0x18(%rbp),%rdx
and    (%rdx),%ecx
xor    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Ch>:
mov    (%rdx),%ecx
mov    (%rsi),%eax
xor    %ecx,%eax
and    (%rdi),%eax
xor    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @Ch(i32* %0, i32* %1, i32* %2) {
%4 = alloca i32*
%5 = alloca i32*
%6 = alloca i32*
store i32* %0, i32** %4
store i32* %1, i32** %5
store i32* %2, i32** %6
%7 = load i32*, i32** %4
%8 = load i32, i32* %7
%9 = load i32*, i32** %5
%10 = load i32, i32* %9
%11 = and i32 %8, %10
%12 = load i32*, i32** %4
%13 = load i32, i32* %12
%14 = xor i32 %13, -1
%15 = load i32*, i32** %6
%16 = load i32, i32* %15
%17 = and i32 %14, %16
%18 = xor i32 %11, %17
ret i32 %18
}

LLVM IR (-O2):
define i32 @Ch(i32* nocapture %0, i32* nocapture %1, i32* nocapture %2) {
%4 = load i32, i32* %0
%5 = load i32, i32* %1
%6 = and i32 %5, %4
%7 = xor i32 %4, -1
%8 = load i32, i32* %2
%9 = and i32 %8, %7
%10 = or i32 %9, %6
ret i32 %10
}
/* Type definitions */
struct dirent64 {
  int dummy;
};
typedef int /*<<< orphan*/ DIR;

/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ __set_errno(int /*<<< orphan*/);
int readdir64_r(DIR *dirp, struct dirent64 *entry, struct dirent64 **result) {
  __set_errno(ENOSYS);
  *result = NULL;
  return -1;
}


x86 assembly (clang, -O0):
<readdir64_r>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
mov    -0x18(%rbp),%rax
movq   $0x0,(%rax)
mov    $0xffffffff,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<readdir64_r>:
push   %rbx
mov    %rdx,%rbx
mov    0x2ecd(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
movq   $0x0,(%rbx)
mov    $0xffffffff,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.dirent64 = type { i32 }
@ENOSYS = global i32 0
define i32 @readdir64_r(i32* %0, %struct.dirent64* %1, %struct.dirent64** %2) {
%4 = alloca i32*
%5 = alloca %struct.dirent64*
%6 = alloca %struct.dirent64**
store i32* %0, i32** %4
store %struct.dirent64* %1, %struct.dirent64** %5
store %struct.dirent64** %2, %struct.dirent64*** %6
%7 = load i32, i32* @ENOSYS
%8 = call i32 @__set_errno(i32 %7)
%9 = load %struct.dirent64**, %struct.dirent64*** %6
store %struct.dirent64* null, %struct.dirent64** %9
ret i32 -1
}

LLVM IR (-O2):
%struct.dirent64 = type { i32 }
@ENOSYS = global i32 0
define i32 @readdir64_r(i32* nocapture readnone %0, %struct.dirent64* nocapture readnone %1, %struct.dirent64** nocapture writeonly %2) {
%4 = load i32, i32* @ENOSYS
%5 = tail call i32 @__set_errno(i32 %4)
store %struct.dirent64* null, %struct.dirent64** %2
ret i32 -1
}
/* Variables and functions */
void *cmalloc_memalign(int, size_t);
void *cmalloc_valloc(size_t size) { return cmalloc_memalign(4 * 1024, size); }


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

x86 assembly (clang, -O2):
<cmalloc_valloc>:
mov    %rdi,%rsi
mov    $0x1000,%edi
jmp    1030 <cmalloc_memalign@plt>

LLVM IR (-O0):
define i8* @cmalloc_valloc(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i8* @cmalloc_memalign(i32 4096, i64 %3)
ret i8* %4
}

LLVM IR (-O2):
define i8* @cmalloc_valloc(i64 %0) {
%2 = tail call i8* @cmalloc_memalign(i32 4096, i64 %0)
ret i8* %2
}
/* Variables and functions */
char *strstr(char *, char const *);
int strnoc(char *text, const char *sub) {
  int i = 0;
  char *temp = text;
  while ((temp = strstr(temp, sub)) != NULL) {
    i++;
    temp++;
  }
  return i;
}


x86 assembly (clang, -O0):
<strnoc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strstr@plt>
mov    %rax,-0x20(%rbp)
cmp    $0x0,%rax
je     1164 <strnoc+0x54>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    112f <strnoc+0x1f>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strnoc>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
call   1030 <strstr@plt>
xor    %ebp,%ebp
test   %rax,%rax
je     1147 <strnoc+0x37>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
add    $0x1,%ebp
add    $0x1,%rax
mov    %rax,%rdi
mov    %rbx,%rsi
call   1030 <strstr@plt>
test   %rax,%rax
jne    1130 <strnoc+0x20>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @strnoc(i8* %0, i8* nocapture %1) {
%3 = tail call i8* @strstr(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %12, label %5
5: ; preds = %2, %5
%6 = phi i8* [ %10, %5 ], [ %3, %2 ]
%7 = phi i32 [ %8, %5 ], [ 0, %2 ]
%8 = add nuw nsw i32 %7, 1
%9 = getelementptr inbounds i8, i8* %6, i64 1
%10 = tail call i8* @strstr(i8* dereferenceable(1) %9, i8* dereferenceable(1) %1)
%11 = icmp eq i8* %10, null
br i1 %11, label %12, label %5
12: ; preds = %5, %2
%13 = phi i32 [ 0, %2 ], [ %8, %5 ]
ret i32 %13
}
const char *kw_basename(const char *p) {
  const char *q;
  for (q = p; *p; p++)
    if (*q == '/' || *q == '\\')
      q = p;
  return q;
}


x86 assembly (clang, -O0):
<kw_basename>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     115b <kw_basename+0x5b>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2f,%eax
je     113d <kw_basename+0x3d>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x5c,%eax
jne    1145 <kw_basename+0x45>
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
jmp    114a <kw_basename+0x4a>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1110 <kw_basename+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<kw_basename>:
mov    %rdi,%rax
mov    (%rdi),%dl
test   %dl,%dl
je     113b <kw_basename+0x3b>
mov    %rax,%rcx
cmp    $0x5c,%dl
je     1125 <kw_basename+0x25>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
cmp    $0x2f,%dl
jne    1128 <kw_basename+0x28>
mov    %rcx,%rax
cmpb   $0x0,0x1(%rcx)
je     113b <kw_basename+0x3b>
add    $0x1,%rcx
mov    (%rax),%dl
cmp    $0x5c,%dl
jne    1120 <kw_basename+0x20>
jmp    1125 <kw_basename+0x25>
ret

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

LLVM IR (-O2):
define i8* @kw_basename(i8* %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %16, label %4
4: ; preds = %1, %14
%5 = phi i8 [ %15, %14 ], [ %2, %1 ]
%6 = phi i8* [ %10, %14 ], [ %0, %1 ]
%7 = phi i8* [ %11, %14 ], [ %0, %1 ]
switch i8 %5, label %9 [
i8 47, label %8
i8 92, label %8
]
8: ; preds = %4, %4
br label %9
9: ; preds = %4, %8
%10 = phi i8* [ %7, %8 ], [ %6, %4 ]
%11 = getelementptr inbounds i8, i8* %7, i64 1
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 0
br i1 %13, label %16, label %14
14: ; preds = %9
%15 = load i8, i8* %10
br label %4
16: ; preds = %9, %1
%17 = phi i8* [ %0, %1 ], [ %10, %9 ]
ret i8* %17
}
/* Variables and functions */
scalar_t__ exp10(double);
int rand_r(unsigned int *);
int p_judge(unsigned int *seed, int mask, int num) {
  int r;
  r = rand_r(seed);
  if (r % ((int)(exp10((double)mask))) < num) {
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<p_judge>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <rand_r@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
mov    %eax,-0x20(%rbp)
cvtsi2sdl -0x14(%rbp),%xmm0
call   1040 <exp10@plt>
mov    %rax,%rcx
mov    -0x20(%rbp),%eax
cltd
idiv   %ecx
cmp    -0x18(%rbp),%edx
jge    116c <p_judge+0x4c>
movl   $0x1,-0x4(%rbp)
jmp    1173 <p_judge+0x53>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<p_judge>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%r14d
mov    %esi,%ebp
call   1030 <rand_r@plt>
mov    %eax,%ebx
cvtsi2sd %ebp,%xmm0
call   1040 <exp10@plt>
mov    %rax,%rcx
mov    %ebx,%eax
cltd
idiv   %ecx
xor    %eax,%eax
cmp    %r14d,%edx
setl   %al
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @p_judge(i32* %0, i32 %1, i32 %2) {
%4 = tail call i32 @rand_r(i32* %0)
%5 = sitofp i32 %1 to double
%6 = tail call i64 @exp10(double %5)
%7 = trunc i64 %6 to i32
%8 = srem i32 %4, %7
%9 = icmp slt i32 %8, %2
%10 = zext i1 %9 to i32
ret i32 %10
}
int a() {
  __int128_t s;
  __uint128_t t;
}


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

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

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

LLVM IR (-O2):
define i32 @a() {
ret i32 undef
}
/* Type definitions */
struct fins_t {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct fins_t *);
void fins_free(struct fins_t *c) { free(c); }


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

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

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

LLVM IR (-O2):
%struct.fins_t = type { i32 }
define void @fins_free(%struct.fins_t* nocapture %0) {
%2 = tail call i32 @free(%struct.fins_t* %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
size_t coap_opt_put_string(int /*<<< orphan*/ *, int /*<<< orphan*/, int,
                           char const *, char);
size_t coap_opt_put_proxy_uri(uint8_t *buf, uint16_t lastonum,
                              const char *uri) {
  return coap_opt_put_string(buf, lastonum, (35), uri, '\0');
}


x86 assembly (clang, -O0):
<coap_opt_put_proxy_uri>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rcx
mov    $0x23,%edx
xor    %r8d,%r8d
call   1030 <coap_opt_put_string@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<coap_opt_put_proxy_uri>:
mov    %rdx,%rcx
mov    $0x23,%edx
xor    %r8d,%r8d
jmp    1030 <coap_opt_put_string@plt>

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

LLVM IR (-O2):
define i64 @coap_opt_put_proxy_uri(i32* %0, i32 %1, i8* %2) {
%4 = tail call i64 @coap_opt_put_string(i32* %0, i32 %1, i32 35, i8* %2, i8 signext 0)
ret i64 %4
}
/* Variables and functions */
int /*<<< orphan*/ clear();
void nc_clearall() { clear(); }


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

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

LLVM IR (-O0):
define void @nc_clearall() {
%1 = call i32 (...) @clear()
ret void
}

LLVM IR (-O2):
define void @nc_clearall() {
%1 = tail call i32 (...) @clear()
ret void
}
unsigned int gpio_get_mask(unsigned port, unsigned int mask) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @gpio_get_mask(i32 %0, i32 %1) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
int mknod(char *path, int mode, int dev) {
  printf("mknod() not implemented\n");
  exit(-1);
}


x86 assembly (clang, -O0):
<mknod>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
lea    0xec7(%rip),%rdi
call   1030 <printf@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<mknod>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [25 x i8] c"mknod() not implemented\0A\00"
define i32 @mknod(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 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @exit(i32 -1)
unreachable
}

LLVM IR (-O2):
@str = [24 x i8] c"mknod() not implemented\00"
define i32 @mknod(i8* nocapture readnone %0, i32 %1, i32 %2) {
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str, i64 0, i64 0))
%5 = tail call i32 @exit(i32 -1)
unreachable
}
void *test(void *p) {
  int id = (int)p;
  int *result = malloc(sizeof(int));
  printf("hello from thread %d\n", id);
  result = id * id;
  return (void *)result;
}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %eax,-0xc(%rbp)
mov    $0x4,%edi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%esi
lea    0xeb5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
imul   -0xc(%rbp),%eax
cltq
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1030 <printf@plt>
imul   %ebx,%ebx
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [22 x i8] c"hello from thread %d\0A\00"
define i8* @test(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i32*
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = ptrtoint i8* %5 to i32
store i32 %6, i32* %3
%7 = call i8* @malloc(i64 4)
%8 = bitcast i8* %7 to i32*
store i32* %8, i32** %4
%9 = load i32, i32* %3
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = load i32, i32* %3
%12 = load i32, i32* %3
%13 = mul nsw i32 %11, %12
%14 = sext i32 %13 to i64
%15 = inttoptr i64 %14 to i32*
store i32* %15, i32** %4
%16 = load i32*, i32** %4
%17 = bitcast i32* %16 to i8*
ret i8* %17
}

LLVM IR (-O2):
@.str = [22 x i8] c"hello from thread %d\0A\00"
define i8* @test(i8* %0) {
%2 = ptrtoint i8* %0 to i64
%3 = trunc i64 %2 to i32
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = mul i64 %2, %2
%6 = and i64 %5, 4294967295
%7 = inttoptr i64 %6 to i8*
ret i8* %7
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void usage(char *argv0) {
  fprintf(stderr, "Usage: %s {one or more octal numbers ...}\n", argv0);
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [43 x i8] c"Usage: %s {one or more octal numbers ...}\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [43 x i8] c"Usage: %s {one or more octal numbers ...}\0A\00"
define void @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int fc8180_scan_status(void *);
signed int bbm_com_scan_status(void *handle) {
  signed int res;
  res = fc8180_scan_status(handle);
  return res;
}


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

x86 assembly (clang, -O2):
<bbm_com_scan_status>:
jmp    1030 <fc8180_scan_status@plt>

LLVM IR (-O0):
define i32 @bbm_com_scan_status(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @fc8180_scan_status(i8* %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
ret i32 %6
}

LLVM IR (-O2):
define i32 @bbm_com_scan_status(i8* %0) {
%2 = tail call i32 @fc8180_scan_status(i8* %0)
ret i32 %2
}