xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(void) {
  printf("MBEDTLS_ENTROPY_C and/or MBEDTLS_FS_IO not defined.\n");
  return (0);
}


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

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

LLVM IR (-O0):
@.str = [53 x i8] c"MBEDTLS_ENTROPY_C and/or MBEDTLS_FS_IO not defined.\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [52 x i8] c"MBEDTLS_ENTROPY_C and/or MBEDTLS_FS_IO not defined.\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([52 x i8], [52 x i8]* @str, i64 0, i64 0))
ret i32 0
}
void smsdvb_debugfs_unregister(void) {}


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

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

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

LLVM IR (-O2):
define void @smsdvb_debugfs_unregister() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int test_i();
int /*<<< orphan*/ test_void();
int main() {
  printf("%d\n", test_i());
  test_void();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <test_i@plt>
mov    %eax,%esi
lea    0xebc(%rip),%rdi
call   1050 <printf@plt>
mov    $0x0,%al
call   1030 <test_void@plt>
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @test_i()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 (...) @test_void()
ret i32 0
}
/* Type definitions */
struct model_s {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ CG_SkeletonForModel(struct model_s *);
struct model_s *trap_R_RegisterModel(char const *);
scalar_t__ trap_R_SkeletalGetNumBones(struct model_s *, void *);
struct model_s *CG_RegisterModel(const char *name) {
  struct model_s *model;
  model = trap_R_RegisterModel(name);
  if (trap_R_SkeletalGetNumBones(model, ((void *)0)))
    CG_SkeletonForModel(model);
  return model;
}


x86 assembly (clang, -O0):
<CG_RegisterModel>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <trap_R_RegisterModel@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1040 <trap_R_SkeletalGetNumBones@plt>
cmp    $0x0,%rax
je     1169 <CG_RegisterModel+0x39>
mov    -0x10(%rbp),%rdi
call   1050 <CG_SkeletonForModel@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CG_RegisterModel>:
push   %rbx
call   1030 <trap_R_RegisterModel@plt>
mov    %rax,%rbx
mov    %rax,%rdi
xor    %esi,%esi
call   1040 <trap_R_SkeletalGetNumBones@plt>
test   %rax,%rax
je     1150 <CG_RegisterModel+0x20>
mov    %rbx,%rdi
call   1050 <CG_SkeletonForModel@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
%struct.model_s = type { i32 }
define %struct.model_s* @CG_RegisterModel(i8* %0) {
%2 = alloca i8*
%3 = alloca %struct.model_s*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call %struct.model_s* @trap_R_RegisterModel(i8* %4)
store %struct.model_s* %5, %struct.model_s** %3
%6 = load %struct.model_s*, %struct.model_s** %3
%7 = call i64 @trap_R_SkeletalGetNumBones(%struct.model_s* %6, i8* null)
%8 = icmp ne i64 %7, 0
br i1 %8, label %9, label %12
9: ; preds = %1
%10 = load %struct.model_s*, %struct.model_s** %3
%11 = call i32 @CG_SkeletonForModel(%struct.model_s* %10)
br label %12
12: ; preds = %9, %1
%13 = load %struct.model_s*, %struct.model_s** %3
ret %struct.model_s* %13
}

LLVM IR (-O2):
%struct.model_s = type { i32 }
define %struct.model_s* @CG_RegisterModel(i8* %0) {
%2 = tail call %struct.model_s* @trap_R_RegisterModel(i8* %0)
%3 = tail call i64 @trap_R_SkeletalGetNumBones(%struct.model_s* %2, i8* null)
%4 = icmp eq i64 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = tail call i32 @CG_SkeletonForModel(%struct.model_s* %2)
br label %7
7: ; preds = %5, %1
ret %struct.model_s* %2
}
/* Type definitions */
struct dict {
  int dummy;
};

/* Variables and functions */
void *dict_ipop(struct dict *, char *, int /*<<< orphan*/);
int /*<<< orphan*/ strlen(char *);
void *dict_pop(struct dict *dict, char *key) {
  return dict_ipop(dict, key, strlen(key));
}


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

x86 assembly (clang, -O2):
<dict_pop>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1030 <strlen@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %eax,%edx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <dict_ipop@plt>

LLVM IR (-O0):
%struct.dict = type { i32 }
define i8* @dict_pop(%struct.dict* %0, i8* %1) {
%3 = alloca %struct.dict*
%4 = alloca i8*
store %struct.dict* %0, %struct.dict** %3
store i8* %1, i8** %4
%5 = load %struct.dict*, %struct.dict** %3
%6 = load i8*, i8** %4
%7 = load i8*, i8** %4
%8 = call i32 @strlen(i8* %7)
%9 = call i8* @dict_ipop(%struct.dict* %5, i8* %6, i32 %8)
ret i8* %9
}

LLVM IR (-O2):
%struct.dict = type { i32 }
define i8* @dict_pop(%struct.dict* %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %1)
%4 = tail call i8* @dict_ipop(%struct.dict* %0, i8* %1, i32 %3)
ret i8* %4
}
/* Variables and functions */
int SocketAndSendto(int /*<<< orphan*/, int, char const *);
int sendReplyPacket(const char *dest) { return SocketAndSendto(0, 1, dest); }


x86 assembly (clang, -O0):
<sendReplyPacket>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
xor    %edi,%edi
mov    $0x1,%esi
call   1030 <SocketAndSendto@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sendReplyPacket>:
mov    %rdi,%rdx
xor    %edi,%edi
mov    $0x1,%esi
jmp    1030 <SocketAndSendto@plt>

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

LLVM IR (-O2):
define i32 @sendReplyPacket(i8* %0) {
%2 = tail call i32 @SocketAndSendto(i32 0, i32 1, i8* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, double);
void printData(double data[], int length) {
  int i;
  for (i = 0; i < length; ++i) {
    printf(">> data[%d] = %0.2lf\n", i, data[i]);
  }
}


x86 assembly (clang, -O0):
<printData>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    115c <printData+0x4c>
mov    -0x10(%rbp),%esi
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
lea    0xeb7(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <printData+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printData>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1149 <printData+0x39>
mov    %rdi,%r14
mov    %esi,%r12d
xor    %ebx,%ebx
lea    0xed5(%rip),%r15
nopl   0x0(%rax,%rax,1)
movsd  (%r14,%rbx,8),%xmm0
mov    %r15,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1130 <printData+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [22 x i8] c">> data[%d] = %0.2lf\0A\00"
define void @printData(double* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %14
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %12, %6 ]
%8 = getelementptr inbounds double, double* %0, i64 %7
%9 = load double, double* %8
%10 = trunc i64 %7 to i32
%11 = tail call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 %10, double %9)
%12 = add nuw nsw i64 %7, 1
%13 = icmp eq i64 %12, %5
br i1 %13, label %14, label %6
14: ; preds = %6, %2
ret void
}
/* Type definitions */
struct iovec {
  int dummy;
};
typedef int ssize_t;
typedef int /*<<< orphan*/ off_t;

/* Variables and functions */
ssize_t pwritev(int fd, const struct iovec *v, int veccount, off_t offset) {
  return -1;
}


x86 assembly (clang, -O0):
<pwritev>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    $0xffffffff,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
%struct.iovec = type { i32 }
define i32 @pwritev(i32 %0, %struct.iovec* nocapture readnone %1, i32 %2, i32 %3) {
ret i32 -1
}
int addr_size(int type) {
  if (type == 1) {
    return 4;
  } else if (type == 2) {
    return 16;
  } else if (type == 3) {
    return 6;
  }
  return -1;
}


x86 assembly (clang, -O0):
<addr_size>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
jne    111d <addr_size+0x1d>
movl   $0x4,-0x4(%rbp)
jmp    115a <addr_size+0x5a>
cmpl   $0x2,-0x8(%rbp)
jne    1133 <addr_size+0x33>
movl   $0x10,-0x4(%rbp)
jmp    115a <addr_size+0x5a>
cmpl   $0x3,-0x8(%rbp)
jne    1149 <addr_size+0x49>
movl   $0x6,-0x4(%rbp)
jmp    115a <addr_size+0x5a>
jmp    114e <addr_size+0x4e>
jmp    1153 <addr_size+0x53>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<addr_size>:
add    $0xffffffff,%edi
mov    $0xffffffff,%eax
cmp    $0x2,%edi
ja     111a <addr_size+0x1a>
movslq %edi,%rax
lea    0xee9(%rip),%rcx
mov    (%rcx,%rax,4),%eax
ret

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

LLVM IR (-O2):
@switch.table.addr_size = [3 x i32] [i32 4, i32 16, i32 6]
define i32 @addr_size(i32 %0) {
%2 = add i32 %0, -1
%3 = icmp ult i32 %2, 3
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = sext i32 %2 to i64
%6 = getelementptr inbounds [3 x i32], [3 x i32]* @switch.table.addr_size, i64 0, i64 %5
%7 = load i32, i32* %6
br label %8
8: ; preds = %1, %4
%9 = phi i32 [ %7, %4 ], [ -1, %1 ]
ret i32 %9
}
double svm_smo_tval_to_err(double si, double b, int y) { return 0.0; }


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

x86 assembly (clang, -O2):
<svm_smo_tval_to_err>:
xorps  %xmm0,%xmm0
ret

LLVM IR (-O0):
define double @svm_smo_tval_to_err(double %0, double %1, i32 %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca i32
store double %0, double* %4
store double %1, double* %5
store i32 %2, i32* %6
ret double 0.000000e+00
}

LLVM IR (-O2):
define double @svm_smo_tval_to_err(double %0, double %1, i32 %2) {
ret double 0.000000e+00
}
/* Type definitions */
struct comp {
  int dummy;
};
struct BrzBinaryFuncConstR_ {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ SEND_ACKDOWN_DELAYED(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ SEND_DATAOFF_DELAYED(int /*<<< orphan*/, int);
void BrzBinaryFuncConstR_ackdown(struct comp *comp, int port) {
  struct BrzBinaryFuncConstR_ *c = (struct BrzBinaryFuncConstR_ *)comp;
  SEND_ACKDOWN_DELAYED(0, 0);
  SEND_DATAOFF_DELAYED(0, 1);
}


x86 assembly (clang, -O0):
<BrzBinaryFuncConstR_ackdown>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
xor    %esi,%esi
mov    %esi,%edi
call   1030 <SEND_ACKDOWN_DELAYED@plt>
xor    %edi,%edi
mov    $0x1,%esi
call   1040 <SEND_DATAOFF_DELAYED@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<BrzBinaryFuncConstR_ackdown>:
push   %rax
xor    %edi,%edi
xor    %esi,%esi
call   1030 <SEND_ACKDOWN_DELAYED@plt>
xor    %edi,%edi
mov    $0x1,%esi
pop    %rax
jmp    1040 <SEND_DATAOFF_DELAYED@plt>

LLVM IR (-O0):
%struct.comp = type { i32 }
%struct.BrzBinaryFuncConstR_ = type { i32 }
define void @BrzBinaryFuncConstR_ackdown(%struct.comp* %0, i32 %1) {
%3 = alloca %struct.comp*
%4 = alloca i32
%5 = alloca %struct.BrzBinaryFuncConstR_*
store %struct.comp* %0, %struct.comp** %3
store i32 %1, i32* %4
%6 = load %struct.comp*, %struct.comp** %3
%7 = bitcast %struct.comp* %6 to %struct.BrzBinaryFuncConstR_*
store %struct.BrzBinaryFuncConstR_* %7, %struct.BrzBinaryFuncConstR_** %5
%8 = call i32 @SEND_ACKDOWN_DELAYED(i32 0, i32 0)
%9 = call i32 @SEND_DATAOFF_DELAYED(i32 0, i32 1)
ret void
}

LLVM IR (-O2):
%struct.comp = type { i32 }
define void @BrzBinaryFuncConstR_ackdown(%struct.comp* nocapture readnone %0, i32 %1) {
%3 = tail call i32 @SEND_ACKDOWN_DELAYED(i32 0, i32 0)
%4 = tail call i32 @SEND_DATAOFF_DELAYED(i32 0, i32 1)
ret void
}
/* Variables and functions */
char *low_libfn(char *, int);
char *libfn(char *file) { return low_libfn(file, 1); }


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

x86 assembly (clang, -O2):
<libfn>:
mov    $0x1,%esi
jmp    1030 <low_libfn@plt>

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

LLVM IR (-O2):
define i8* @libfn(i8* %0) {
%2 = tail call i8* @low_libfn(i8* %0, i32 1)
ret i8* %2
}
void RandomFunc(unsigned char input[1], unsigned char output[1]) {
  unsigned char state[1];
  unsigned char local1;
  {
    state[0UL] = input[0UL] + (unsigned char)69;
    local1 = 0UL;
    while (local1 < (unsigned char)0) {
      state[local1] += state[local1];
      local1 += 2UL;
    }
    output[0UL] = (state[0UL] + 903211243UL) - (unsigned char)116;
  }
}


x86 assembly (clang, -O0):
<RandomFunc>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
add    $0x45,%eax
mov    %al,-0x11(%rbp)
movb   $0x0,-0x12(%rbp)
movzbl -0x12(%rbp),%eax
cmp    $0x0,%eax
jge    1152 <RandomFunc+0x52>
movzbl -0x12(%rbp),%eax
movzbl -0x11(%rbp,%rax,1),%edx
movzbl -0x12(%rbp),%eax
movzbl -0x11(%rbp,%rax,1),%ecx
add    %edx,%ecx
mov    %cl,-0x11(%rbp,%rax,1)
movzbl -0x12(%rbp),%eax
add    $0x2,%rax
mov    %al,-0x12(%rbp)
jmp    111d <RandomFunc+0x1d>
movzbl -0x11(%rbp),%eax
add    $0x35d5e8eb,%rax
sub    $0x74,%rax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<RandomFunc>:
mov    (%rdi),%al
add    $0xbc,%al
mov    %al,(%rsi)
ret

LLVM IR (-O0):
define void @RandomFunc(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca [1 x i8]
%6 = alloca i8
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = getelementptr inbounds i8, i8* %7, i64 0
%9 = load i8, i8* %8
%10 = zext i8 %9 to i32
%11 = add nsw i32 %10, 69
%12 = trunc i32 %11 to i8
%13 = getelementptr inbounds [1 x i8], [1 x i8]* %5, i64 0, i64 0
store i8 %12, i8* %13
store i8 0, i8* %6
br label %14
14: ; preds = %18, %2
%15 = load i8, i8* %6
%16 = zext i8 %15 to i32
%17 = icmp slt i32 %16, 0
br i1 %17, label %18, label %35
18: ; preds = %14
%19 = load i8, i8* %6
%20 = zext i8 %19 to i64
%21 = getelementptr inbounds [1 x i8], [1 x i8]* %5, i64 0, i64 %20
%22 = load i8, i8* %21
%23 = zext i8 %22 to i32
%24 = load i8, i8* %6
%25 = zext i8 %24 to i64
%26 = getelementptr inbounds [1 x i8], [1 x i8]* %5, i64 0, i64 %25
%27 = load i8, i8* %26
%28 = zext i8 %27 to i32
%29 = add nsw i32 %28, %23
%30 = trunc i32 %29 to i8
store i8 %30, i8* %26
%31 = load i8, i8* %6
%32 = zext i8 %31 to i64
%33 = add i64 %32, 2
%34 = trunc i64 %33 to i8
store i8 %34, i8* %6
br label %14
35: ; preds = %14
%36 = getelementptr inbounds [1 x i8], [1 x i8]* %5, i64 0, i64 0
%37 = load i8, i8* %36
%38 = zext i8 %37 to i64
%39 = add i64 %38, 903211243
%40 = sub i64 %39, 116
%41 = trunc i64 %40 to i8
%42 = load i8*, i8** %4
%43 = getelementptr inbounds i8, i8* %42, i64 0
store i8 %41, i8* %43
ret void
}

LLVM IR (-O2):
define void @RandomFunc(i8* nocapture %0, i8* nocapture writeonly %1) {
%3 = load i8, i8* %0
%4 = add i8 %3, -68
store i8 %4, i8* %1
ret void
}
/* Variables and functions */
int cli_yuck_main(int, char **);
int main(int argc, char **argv) { return cli_yuck_main(argc, argv); }


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

x86 assembly (clang, -O2):
<main>:
jmp    1030 <cli_yuck_main@plt>

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @cli_yuck_main(i32 %0, i8** %1)
ret i32 %3
}
long long add(long long a, long long b) {
  long long c = a + b;
  return c;
}


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

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

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

LLVM IR (-O2):
define i64 @add(i64 %0, i64 %1) {
%3 = add nsw i64 %1, %0
ret i64 %3
}
double AMAX1(double a, double b) { return a > b ? a : b; }


x86 assembly (clang, -O0):
<AMAX1>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    112d <AMAX1+0x2d>
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
jmp    1137 <AMAX1+0x37>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<AMAX1>:
maxsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @AMAX1(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 = fcmp ogt double %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load double, double* %3
br label %12
10: ; preds = %2
%11 = load double, double* %4
br label %12
12: ; preds = %10, %8
%13 = phi double [ %9, %8 ], [ %11, %10 ]
ret double %13
}

LLVM IR (-O2):
define double @AMAX1(double %0, double %1) {
%3 = fcmp ogt double %0, %1
%4 = select i1 %3, double %0, double %1
ret double %4
}
void md_raw_standend() {}


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

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

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

LLVM IR (-O2):
define void @md_raw_standend() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;
struct wl_resource {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ wl_resource_post_event(struct wl_resource *, int,
                                          int /*<<< orphan*/);
void wl_registry_send_global_remove(struct wl_resource *resource_,
                                    uint32_t name) {
  wl_resource_post_event(resource_, 1, name);
}


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

x86 assembly (clang, -O2):
<wl_registry_send_global_remove>:
mov    %esi,%edx
mov    $0x1,%esi
jmp    1030 <wl_resource_post_event@plt>

LLVM IR (-O0):
%struct.wl_resource = type { i32 }
define void @wl_registry_send_global_remove(%struct.wl_resource* %0, i32 %1) {
%3 = alloca %struct.wl_resource*
%4 = alloca i32
store %struct.wl_resource* %0, %struct.wl_resource** %3
store i32 %1, i32* %4
%5 = load %struct.wl_resource*, %struct.wl_resource** %3
%6 = load i32, i32* %4
%7 = call i32 @wl_resource_post_event(%struct.wl_resource* %5, i32 1, i32 %6)
ret void
}

LLVM IR (-O2):
%struct.wl_resource = type { i32 }
define void @wl_registry_send_global_remove(%struct.wl_resource* %0, i32 %1) {
%3 = tail call i32 @wl_resource_post_event(%struct.wl_resource* %0, i32 1, i32 %1)
ret void
}
int foo(int a, int b) {
  if (a == b)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jne    1122 <foo+0x22>
movl   $0x1,-0x4(%rbp)
jmp    1129 <foo+0x29>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
xor    %eax,%eax
cmp    %esi,%edi
sete   %al
ret

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

LLVM IR (-O2):
define i32 @foo(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printBase(int, int);
void printBin(int value) { printBase(value, 2); }


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

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

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

LLVM IR (-O2):
define void @printBin(i32 %0) {
%2 = tail call i32 @printBase(i32 %0, i32 2)
ret void
}
void sgi_set_ilfact(void) {}


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

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

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

LLVM IR (-O2):
define void @sgi_set_ilfact() {
ret void
}
/* Variables and functions */
int read_string(int, unsigned char *, int, long);
scalar_t__ strncmp(char *, char *, int);
int skytraq_read_ok(int fd) {
  unsigned char buf[50];
  int len;
  len = read_string(fd, (unsigned char *)&buf, 50, 2000l);
  if (len > 0) {
    return strncmp("OK", (char *)&buf, 50) == 0;
  }
  return 0;
}


x86 assembly (clang, -O0):
<skytraq_read_ok>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
lea    -0x40(%rbp),%rsi
mov    $0x32,%edx
mov    $0x7d0,%ecx
call   1040 <read_string@plt>
mov    %eax,-0x44(%rbp)
cmpl   $0x0,-0x44(%rbp)
jle    1177 <skytraq_read_ok+0x57>
lea    -0x40(%rbp),%rsi
lea    0xea7(%rip),%rdi
mov    $0x32,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
jmp    117e <skytraq_read_ok+0x5e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<skytraq_read_ok>:
sub    $0x38,%rsp
mov    %rsp,%rsi
mov    $0x7d0,%ecx
mov    $0x32,%edx
call   1040 <read_string@plt>
test   %eax,%eax
jle    115e <skytraq_read_ok+0x3e>
lea    0xebf(%rip),%rdi
mov    %rsp,%rsi
mov    $0x32,%edx
call   1030 <strncmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
sete   %al
add    $0x38,%rsp
ret
xor    %eax,%eax
add    $0x38,%rsp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"OK\00"
define i32 @skytraq_read_ok(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca [50 x i8]
%5 = alloca i32
store i32 %0, i32* %3
%6 = load i32, i32* %3
%7 = bitcast [50 x i8]* %4 to i8*
%8 = call i32 @read_string(i32 %6, i8* %7, i32 50, i64 2000)
store i32 %8, i32* %5
%9 = load i32, i32* %5
%10 = icmp sgt i32 %9, 0
br i1 %10, label %11, label %16
11: ; preds = %1
%12 = bitcast [50 x i8]* %4 to i8*
%13 = call i64 @strncmp(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %12, i32 50)
%14 = icmp eq i64 %13, 0
%15 = zext i1 %14 to i32
store i32 %15, i32* %2
br label %17
16: ; preds = %1
store i32 0, i32* %2
br label %17
17: ; preds = %16, %11
%18 = load i32, i32* %2
ret i32 %18
}

LLVM IR (-O2):
@.str = [3 x i8] c"OK\00"
define i32 @skytraq_read_ok(i32 %0) {
%2 = alloca [50 x i8]
%3 = getelementptr inbounds [50 x i8], [50 x i8]* %2, i64 0, i64 0
%4 = call i32 @read_string(i32 %0, i8* %3, i32 50, i64 2000)
%5 = icmp sgt i32 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = call i64 @strncmp(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %3, i32 50)
%8 = icmp eq i64 %7, 0
%9 = zext i1 %8 to i32
br label %10
10: ; preds = %1, %6
%11 = phi i32 [ %9, %6 ], [ 0, %1 ]
ret i32 %11
}
/* Type definitions */
struct conn_s {
  int dummy;
};
typedef int /*<<< orphan*/ buf;

/* Variables and functions */
int add_error_variable(struct conn_s *, char *, char *);
int /*<<< orphan*/ snprintf(char *, int, char *, unsigned long);
int add_stat_variable(struct conn_s *connptr, char *key,
                      unsigned long int value) {
  char buf[128];
  snprintf(buf, sizeof(buf), "%lu", value);
  return add_error_variable(connptr, key, buf);
}


x86 assembly (clang, -O0):
<add_stat_variable>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa0,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
lea    -0xa0(%rbp),%rdi
mov    -0x18(%rbp),%rcx
mov    $0x80,%esi
lea    0xeb2(%rip),%rdx
call   1040 <snprintf@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
lea    -0xa0(%rbp),%rdx
call   1030 <add_error_variable@plt>
add    $0xa0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<add_stat_variable>:
push   %r15
push   %r14
push   %rbx
sub    $0x80,%rsp
mov    %rdx,%rcx
mov    %rsi,%r14
mov    %rdi,%rbx
lea    0xec4(%rip),%rdx
mov    %rsp,%r15
mov    %r15,%rdi
mov    $0x80,%esi
call   1040 <snprintf@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
call   1030 <add_error_variable@plt>
add    $0x80,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
%struct.conn_s = type { i32 }
@.str = [4 x i8] c"%lu\00"
define i32 @add_stat_variable(%struct.conn_s* %0, i8* %1, i64 %2) {
%4 = alloca %struct.conn_s*
%5 = alloca i8*
%6 = alloca i64
%7 = alloca [128 x i8]
store %struct.conn_s* %0, %struct.conn_s** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%8 = getelementptr inbounds [128 x i8], [128 x i8]* %7, i64 0, i64 0
%9 = load i64, i64* %6
%10 = call i32 @snprintf(i8* %8, i32 128, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i64 %9)
%11 = load %struct.conn_s*, %struct.conn_s** %4
%12 = load i8*, i8** %5
%13 = getelementptr inbounds [128 x i8], [128 x i8]* %7, i64 0, i64 0
%14 = call i32 @add_error_variable(%struct.conn_s* %11, i8* %12, i8* %13)
ret i32 %14
}

LLVM IR (-O2):
%struct.conn_s = type { i32 }
@.str = [4 x i8] c"%lu\00"
define i32 @add_stat_variable(%struct.conn_s* %0, i8* %1, i64 %2) {
%4 = alloca [128 x i8]
%5 = getelementptr inbounds [128 x i8], [128 x i8]* %4, i64 0, i64 0
%6 = call i32 @snprintf(i8* %5, i32 128, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i64 %2)
%7 = call i32 @add_error_variable(%struct.conn_s* %0, i8* %1, i8* %5)
ret i32 %7
}
/* Variables and functions */
double sqrt(int);
double calc_half_period(double shaper_freq, double damping_ratio) {
  return .5 / (shaper_freq * sqrt(1. - damping_ratio * damping_ratio));
}


x86 assembly (clang, -O0):
<calc_half_period>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm1,%xmm0
movsd  0xeaf(%rip),%xmm1
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
call   1030 <sqrt@plt>
movsd  -0x18(%rbp),%xmm1
mulsd  %xmm0,%xmm1
movsd  0xe89(%rip),%xmm0
divsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<calc_half_period>:
push   %rax
movsd  %xmm0,(%rsp)
mulsd  %xmm1,%xmm1
movsd  0xede(%rip),%xmm0
subsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
call   1030 <sqrt@plt>
mulsd  (%rsp),%xmm0
movsd  0xecc(%rip),%xmm1
divsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @calc_half_period(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 = load double, double* %4
%8 = fneg double %6
%9 = call double @llvm.fmuladd.f64(double %8, double %7, double 1.000000e+00)
%10 = fptosi double %9 to i32
%11 = call double @sqrt(i32 %10)
%12 = fmul double %5, %11
%13 = fdiv double 5.000000e-01, %12
ret double %13
}

LLVM IR (-O2):
define double @calc_half_period(double %0, double %1) {
%3 = fneg double %1
%4 = tail call double @llvm.fmuladd.f64(double %3, double %1, double 1.000000e+00)
%5 = fptosi double %4 to i32
%6 = tail call double @sqrt(i32 %5)
%7 = fmul double %6, %0
%8 = fdiv double 5.000000e-01, %7
ret double %8
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ hq2x_32_rb(int *, int, int *, int, int, int);
void hq2x_32(uint32_t *sp, uint32_t *dp, int Xres, int Yres) {
  uint32_t rowBytesL = Xres * 4;
  hq2x_32_rb(sp, rowBytesL, dp, rowBytesL * 2, Xres, Yres);
}


x86 assembly (clang, -O0):
<hq2x_32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    -0x14(%rbp),%eax
shl    $0x2,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x1c(%rbp),%esi
mov    -0x10(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
shl    $0x1,%ecx
mov    -0x14(%rbp),%r8d
mov    -0x18(%rbp),%r9d
call   1030 <hq2x_32_rb@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hq2x_32>:
mov    %ecx,%r9d
mov    %edx,%r8d
mov    %rsi,%rdx
lea    0x0(,%r8,4),%esi
lea    0x0(,%r8,8),%ecx
jmp    1030 <hq2x_32_rb@plt>

LLVM IR (-O0):
define void @hq2x_32(i32* %0, i32* %1, i32 %2, i32 %3) {
%5 = alloca i32*
%6 = alloca i32*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i32* %0, i32** %5
store i32* %1, i32** %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%10 = load i32, i32* %7
%11 = mul nsw i32 %10, 4
store i32 %11, i32* %9
%12 = load i32*, i32** %5
%13 = load i32, i32* %9
%14 = load i32*, i32** %6
%15 = load i32, i32* %9
%16 = mul nsw i32 %15, 2
%17 = load i32, i32* %7
%18 = load i32, i32* %8
%19 = call i32 @hq2x_32_rb(i32* %12, i32 %13, i32* %14, i32 %16, i32 %17, i32 %18)
ret void
}

LLVM IR (-O2):
define void @hq2x_32(i32* %0, i32* %1, i32 %2, i32 %3) {
%5 = shl nsw i32 %2, 2
%6 = shl nsw i32 %2, 3
%7 = tail call i32 @hq2x_32_rb(i32* %0, i32 %5, i32* %1, i32 %6, i32 %2, i32 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char *argv[]) {
  int distance = 100;
  printf("You're %d miles away.\n", distance);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x64,-0x14(%rbp)
mov    -0x14(%rbp),%esi
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
mov    $0x64,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [23 x i8] c"You're %d miles away.\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 100, i32* %6
%7 = load i32, i32* %6
%8 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 %7)
ret i32 0
}

LLVM IR (-O2):
@.str = [23 x i8] c"You're %d miles away.\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 100)
ret i32 0
}
/* Variables and functions */
int IPC_CREAT;
int shmget(int, int, int);
int create_shmem(int key, int memsize) {
  return shmget(key, memsize, 0660 | IPC_CREAT);
}


x86 assembly (clang, -O0):
<create_shmem>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    0x2eb5(%rip),%rax
mov    (%rax),%edx
or     $0x1b0,%edx
call   1030 <shmget@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<create_shmem>:
mov    0x2ec9(%rip),%rax
mov    $0x1b0,%edx
or     (%rax),%edx
jmp    1030 <shmget@plt>

LLVM IR (-O0):
@IPC_CREAT = global i32 0
define i32 @create_shmem(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = load i32, i32* @IPC_CREAT
%8 = or i32 432, %7
%9 = call i32 @shmget(i32 %5, i32 %6, i32 %8)
ret i32 %9
}

LLVM IR (-O2):
@IPC_CREAT = global i32 0
define i32 @create_shmem(i32 %0, i32 %1) {
%3 = load i32, i32* @IPC_CREAT
%4 = or i32 %3, 432
%5 = tail call i32 @shmget(i32 %0, i32 %1, i32 %4)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void mostraresultado(int ach, int n) {
  if (ach)
    printf("Numero %d foi achado", n);
  else
    printf("Numero %d nao foi achado", n);
}


x86 assembly (clang, -O0):
<mostraresultado>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     113c <mostraresultado+0x2c>
mov    -0x8(%rbp),%esi
lea    0xece(%rip),%rdi
call   1030 <printf@plt>
jmp    114b <mostraresultado+0x3b>
mov    -0x8(%rbp),%esi
lea    0xecf(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mostraresultado>:
test   %edi,%edi
lea    0xefc(%rip),%rax
lea    0xee0(%rip),%rdi
cmove  %rax,%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [21 x i8] c"Numero %d foi achado\00"
@.str.1 = [25 x i8] c"Numero %d nao foi achado\00"
define void @mostraresultado(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %2
%8 = load i32, i32* %4
%9 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 %8)
br label %13
10: ; preds = %2
%11 = load i32, i32* %4
%12 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0), i32 %11)
br label %13
13: ; preds = %10, %7
ret void
}

LLVM IR (-O2):
@.str = [21 x i8] c"Numero %d foi achado\00"
@.str.1 = [25 x i8] c"Numero %d nao foi achado\00"
define void @mostraresultado(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, 0
%4 = select i1 %3, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0)
%5 = tail call i32 @printf(i8* %4, i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(int argc, const char *argv[]) {
  int importantData = 1;
  int buffer[10];
  int i;
  for (i = 0; i <= 10; i++) {
    buffer[i] = 9999;
  }
  printf("importantData = %d\n", importantData);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x1,-0x14(%rbp)
movl   $0x0,-0x44(%rbp)
cmpl   $0xa,-0x44(%rbp)
jg     1158 <main+0x48>
movslq -0x44(%rbp),%rax
movl   $0x270f,-0x40(%rbp,%rax,4)
mov    -0x44(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x44(%rbp)
jmp    1134 <main+0x24>
mov    -0x14(%rbp),%esi
lea    0xe9e(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
mov    $0x1,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [20 x i8] c"importantData = %d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ allocfile(char *, unsigned long);
scalar_t__ remove(int /*<<< orphan*/);
int __mp_remalloc(char *s, unsigned long n) {
  if (remove(allocfile(s, n)))
    return 0;
  return 1;
}


x86 assembly (clang, -O0):
<__mp_remalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <allocfile@plt>
mov    %eax,%edi
call   1040 <remove@plt>
cmp    $0x0,%rax
je     115a <__mp_remalloc+0x3a>
movl   $0x0,-0x4(%rbp)
jmp    1161 <__mp_remalloc+0x41>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__mp_remalloc>:
push   %rax
call   1030 <allocfile@plt>
mov    %eax,%edi
call   1040 <remove@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @__mp_remalloc(i8* %0, i64 %1) {
%3 = tail call i32 @allocfile(i8* %0, i64 %1)
%4 = tail call i64 @remove(i32 %3)
%5 = icmp eq i64 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}
void outl(unsigned int value, int port) {
  asm volatile("out"
               "l"
               " %"
               ""
               "0, %w1"
               :
               : "a"(value), "Nd"(port));
}


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

x86 assembly (clang, -O2):
<outl>:
mov    %esi,%edx
mov    %edi,%eax
out    %eax,(%dx)
ret

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

LLVM IR (-O2):
define void @outl(i32 %0, i32 %1) {
tail call void asm sideeffect "outl $0, ${1:w}", "{ax},N{dx},~{dirflag},~{fpsr},~{flags}"(i32 %0, i32 %1)
ret void
}
int fun809() { return 809; }


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

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

LLVM IR (-O0):
define i32 @fun809() {
ret i32 809
}

LLVM IR (-O2):
define i32 @fun809() {
ret i32 809
}
/* Variables and functions */
int cio_read(int);
void jp2_read_ftyp(int length) {
  int BR, MinV, type, i;
  BR = cio_read(4);
  MinV = cio_read(4);
  length -= 8;
  for (i = length / 4; i > 0; i--)
    type = cio_read(4);
}


x86 assembly (clang, -O0):
<jp2_read_ftyp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x4,%edi
call   1030 <cio_read@plt>
mov    %eax,-0x8(%rbp)
mov    $0x4,%edi
call   1030 <cio_read@plt>
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
sub    $0x8,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jle    1171 <jp2_read_ftyp+0x61>
mov    $0x4,%edi
call   1030 <cio_read@plt>
mov    %eax,-0x10(%rbp)
mov    -0x14(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
jmp    114c <jp2_read_ftyp+0x3c>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<jp2_read_ftyp>:
push   %rbx
mov    %edi,%ebx
mov    $0x4,%edi
call   1030 <cio_read@plt>
mov    $0x4,%edi
call   1030 <cio_read@plt>
cmp    $0xc,%ebx
jl     1152 <jp2_read_ftyp+0x42>
add    $0xfffffff8,%ebx
shr    $0x2,%ebx
add    $0x1,%ebx
cs nopw 0x0(%rax,%rax,1)
nop
mov    $0x4,%edi
call   1030 <cio_read@plt>
add    $0xffffffff,%ebx
cmp    $0x1,%ebx
ja     1140 <jp2_read_ftyp+0x30>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @jp2_read_ftyp(i32 %0) {
%2 = tail call i32 @cio_read(i32 4)
%3 = tail call i32 @cio_read(i32 4)
%4 = icmp sgt i32 %0, 11
br i1 %4, label %5, label %13
5: ; preds = %1
%6 = add nsw i32 %0, -8
%7 = lshr i32 %6, 2
br label %8
8: ; preds = %5, %8
%9 = phi i32 [ %11, %8 ], [ %7, %5 ]
%10 = tail call i32 @cio_read(i32 4)
%11 = add nsw i32 %9, -1
%12 = icmp ugt i32 %9, 1
br i1 %12, label %8, label %13
13: ; preds = %8, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fc8300_read(void *, unsigned short, int, unsigned char *);
int fc8300_es2_get_rssi(void *handle, unsigned short devid, int *rssi) {
  unsigned char reg_value = 0;
  int rssi_value = 0;
  fc8300_read(handle, devid, 0xeb, &reg_value);
  rssi_value = reg_value - 256;
  *rssi = rssi_value;
  return 0;
}


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %si,%ax
mov    %rdi,-0x8(%rbp)
mov    %ax,-0xa(%rbp)
mov    %rdx,-0x18(%rbp)
movb   $0x0,-0x19(%rbp)
movl   $0x0,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0xeb,%edx
lea    -0x19(%rbp),%rcx
movzwl -0xa(%rbp),%esi
call   1030 <fc8300_read@plt>
movzbl -0x19(%rbp),%eax
sub    $0x100,%eax
mov    %eax,-0x20(%rbp)
mov    -0x20(%rbp),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
push   %rbx
sub    $0x10,%rsp
mov    %rdx,%rbx
movb   $0x0,0xf(%rsp)
lea    0xf(%rsp),%rcx
mov    $0xeb,%edx
call   1030 <fc8300_read@plt>
movzbl 0xf(%rsp),%eax
or     $0xffffff00,%eax
mov    %eax,(%rbx)
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @fc8300_es2_get_rssi(i8* %0, i16 zeroext %1, i32* %2) {
%4 = alloca i8*
%5 = alloca i16
%6 = alloca i32*
%7 = alloca i8
%8 = alloca i32
store i8* %0, i8** %4
store i16 %1, i16* %5
store i32* %2, i32** %6
store i8 0, i8* %7
store i32 0, i32* %8
%9 = load i8*, i8** %4
%10 = load i16, i16* %5
%11 = call i32 @fc8300_read(i8* %9, i16 zeroext %10, i32 235, i8* %7)
%12 = load i8, i8* %7
%13 = zext i8 %12 to i32
%14 = sub nsw i32 %13, 256
store i32 %14, i32* %8
%15 = load i32, i32* %8
%16 = load i32*, i32** %6
store i32 %15, i32* %16
ret i32 0
}

LLVM IR (-O2):
define i32 @fc8300_es2_get_rssi(i8* %0, i16 zeroext %1, i32* nocapture writeonly %2) {
%4 = alloca i8
store i8 0, i8* %4
%5 = call i32 @fc8300_read(i8* %0, i16 zeroext %1, i32 235, i8* %4)
%6 = load i8, i8* %4
%7 = zext i8 %6 to i32
%8 = or i32 %7, -256
store i32 %8, i32* %2
ret i32 0
}