xunge/DecIR huggingface dataset:
void SetArrayString(char **a, char *s, int n) { a[n] = s; }


x86 assembly (clang, -O0):
<SetArrayString>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x10(%rbp),%rdx
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    %rdx,(%rax,%rcx,8)
pop    %rbp
ret

x86 assembly (clang, -O2):
<SetArrayString>:
movslq %edx,%rax
mov    %rsi,(%rdi,%rax,8)
ret

LLVM IR (-O0):
define void @SetArrayString(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 i8**, i8*** %4
%9 = load i32, i32* %6
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i8*, i8** %8, i64 %10
store i8* %7, i8** %11
ret void
}

LLVM IR (-O2):
define void @SetArrayString(i8** nocapture writeonly %0, i8* %1, i32 %2) {
%4 = sext i32 %2 to i64
%5 = getelementptr inbounds i8*, i8** %0, i64 %4
store i8* %1, i8** %5
ret void
}
/* Variables and functions */
int /*<<< orphan*/ print_timeofday();
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ test();
int main(int argc, char **argv) {
  test();
  printf("--- print timeofday ----\n");
  print_timeofday();
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [26 x i8] c"--- print timeofday ----\0A\00"
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 = call i32 (...) @test()
%7 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%8 = call i32 (...) @print_timeofday()
ret i32 0
}

LLVM IR (-O2):
@str = [25 x i8] c"--- print timeofday ----\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @test()
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str, i64 0, i64 0))
%5 = tail call i32 (...) @print_timeofday()
ret i32 0
}
void link_required(unit) int unit;
{}


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

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

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

LLVM IR (-O2):
define void @link_required(i32 %0) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int hash(int /*<<< orphan*/ *, size_t, int /*<<< orphan*/ const *, size_t, int,
         int);
int shake256(uint8_t *out, size_t outlen, const uint8_t *in, size_t inlen) {
  return hash(out, outlen, in, inlen, 200 - (256 / 4), 0x1f);
}


x86 assembly (clang, -O0):
<shake256>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x88,%r8d
mov    $0x1f,%r9d
call   1030 <hash@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<shake256>:
mov    $0x88,%r8d
mov    $0x1f,%r9d
jmp    1030 <hash@plt>

LLVM IR (-O0):
define i32 @shake256(i32* %0, i64 %1, i32* %2, i64 %3) {
%5 = alloca i32*
%6 = alloca i64
%7 = alloca i32*
%8 = alloca i64
store i32* %0, i32** %5
store i64 %1, i64* %6
store i32* %2, i32** %7
store i64 %3, i64* %8
%9 = load i32*, i32** %5
%10 = load i64, i64* %6
%11 = load i32*, i32** %7
%12 = load i64, i64* %8
%13 = call i32 @hash(i32* %9, i64 %10, i32* %11, i64 %12, i32 136, i32 31)
ret i32 %13
}

LLVM IR (-O2):
define i32 @shake256(i32* %0, i64 %1, i32* %2, i64 %3) {
%5 = tail call i32 @hash(i32* %0, i64 %1, i32* %2, i64 %3, i32 136, i32 31)
ret i32 %5
}
void rop3_74_0_1(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  unsigned char stk3;
  stk3 = S | *D;
  stk2 = T & stk3;
  stk1 = *D ^ stk2;
  *D = (stk1 & S) | (stk1 & (~T)) | (T & (~S) & *D);
}


x86 assembly (clang, -O0):
<rop3_74_0_1>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
movzbl -0x9(%rbp),%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
or     %ecx,%eax
mov    %al,-0xd(%rbp)
movzbl -0xa(%rbp),%eax
movzbl -0xd(%rbp),%ecx
and    %ecx,%eax
mov    %al,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
movzbl -0xc(%rbp),%ecx
xor    %ecx,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
movzbl -0x9(%rbp),%ecx
and    %ecx,%eax
movzbl -0xb(%rbp),%ecx
movzbl -0xa(%rbp),%edx
xor    $0xffffffff,%edx
and    %edx,%ecx
or     %ecx,%eax
movzbl -0xa(%rbp),%ecx
movzbl -0x9(%rbp),%edx
xor    $0xffffffff,%edx
and    %edx,%ecx
mov    -0x8(%rbp),%rdx
movzbl (%rdx),%edx
and    %edx,%ecx
or     %ecx,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rop3_74_0_1>:
mov    (%rdi),%al
mov    %eax,%ecx
or     %sil,%cl
and    %dl,%cl
xor    %al,%cl
and    %sil,%cl
and    %dl,%sil
not    %sil
and    %al,%sil
or     %cl,%sil
mov    %sil,(%rdi)
ret

LLVM IR (-O0):
define void @rop3_74_0_1(i8* %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
%9 = alloca i8
store i8* %0, i8** %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%10 = load i8, i8* %5
%11 = zext i8 %10 to i32
%12 = load i8*, i8** %4
%13 = load i8, i8* %12
%14 = zext i8 %13 to i32
%15 = or i32 %11, %14
%16 = trunc i32 %15 to i8
store i8 %16, i8* %9
%17 = load i8, i8* %6
%18 = zext i8 %17 to i32
%19 = load i8, i8* %9
%20 = zext i8 %19 to i32
%21 = and i32 %18, %20
%22 = trunc i32 %21 to i8
store i8 %22, i8* %8
%23 = load i8*, i8** %4
%24 = load i8, i8* %23
%25 = zext i8 %24 to i32
%26 = load i8, i8* %8
%27 = zext i8 %26 to i32
%28 = xor i32 %25, %27
%29 = trunc i32 %28 to i8
store i8 %29, i8* %7
%30 = load i8, i8* %7
%31 = zext i8 %30 to i32
%32 = load i8, i8* %5
%33 = zext i8 %32 to i32
%34 = and i32 %31, %33
%35 = load i8, i8* %7
%36 = zext i8 %35 to i32
%37 = load i8, i8* %6
%38 = zext i8 %37 to i32
%39 = xor i32 %38, -1
%40 = and i32 %36, %39
%41 = or i32 %34, %40
%42 = load i8, i8* %6
%43 = zext i8 %42 to i32
%44 = load i8, i8* %5
%45 = zext i8 %44 to i32
%46 = xor i32 %45, -1
%47 = and i32 %43, %46
%48 = load i8*, i8** %4
%49 = load i8, i8* %48
%50 = zext i8 %49 to i32
%51 = and i32 %47, %50
%52 = or i32 %41, %51
%53 = trunc i32 %52 to i8
%54 = load i8*, i8** %4
store i8 %53, i8* %54
ret void
}

LLVM IR (-O2):
define void @rop3_74_0_1(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = load i8, i8* %0
%5 = or i8 %4, %1
%6 = and i8 %5, %2
%7 = xor i8 %6, %4
%8 = and i8 %7, %1
%9 = and i8 %1, %2
%10 = xor i8 %9, -1
%11 = and i8 %4, %10
%12 = or i8 %11, %8
store i8 %12, i8* %0
ret void
}
void ARGB1555ToYRow_NEON() {}


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

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

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

LLVM IR (-O2):
define void @ARGB1555ToYRow_NEON() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void foo() { printf("inside foo\n"); }


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

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

LLVM IR (-O0):
@.str = [12 x i8] c"inside foo\0A\00"
define void @foo() {
%1 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [11 x i8] c"inside foo\00"
define void @foo() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
int /*<<< orphan*/ GetThreadID();
pid_t getpid() { return GetThreadID(); }


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

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

LLVM IR (-O0):
define i32 @getpid() {
%1 = call i32 (...) @GetThreadID()
ret i32 %1
}

LLVM IR (-O2):
define i32 @getpid() {
%1 = tail call i32 (...) @GetThreadID()
ret i32 %1
}
/* Type definitions */
struct qcc_stream_data {
  int dummy;
};
struct qcc_list {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ qcc_list_pop_front(struct qcc_list *);
void qcc_stream_data_pop_front(struct qcc_stream_data *list) {
  qcc_list_pop_front((struct qcc_list *)list);
}


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

x86 assembly (clang, -O2):
<qcc_stream_data_pop_front>:
jmp    1030 <qcc_list_pop_front@plt>

LLVM IR (-O0):
%struct.qcc_stream_data = type { i32 }
%struct.qcc_list = type { i32 }
define void @qcc_stream_data_pop_front(%struct.qcc_stream_data* %0) {
%2 = alloca %struct.qcc_stream_data*
store %struct.qcc_stream_data* %0, %struct.qcc_stream_data** %2
%3 = load %struct.qcc_stream_data*, %struct.qcc_stream_data** %2
%4 = bitcast %struct.qcc_stream_data* %3 to %struct.qcc_list*
%5 = call i32 @qcc_list_pop_front(%struct.qcc_list* %4)
ret void
}

LLVM IR (-O2):
%struct.qcc_stream_data = type { i32 }
%struct.qcc_list = type { i32 }
define void @qcc_stream_data_pop_front(%struct.qcc_stream_data* %0) {
%2 = bitcast %struct.qcc_stream_data* %0 to %struct.qcc_list*
%3 = tail call i32 @qcc_list_pop_front(%struct.qcc_list* %2)
ret void
}
int test_imm_72uint8_mem(unsigned char *val) {
  return ((*val) & (0x72 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_72uint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, 114
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
void XCreateWindow() {}


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

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

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

LLVM IR (-O2):
define void @XCreateWindow() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ F_GETFL;
int /*<<< orphan*/ F_SETFL;
int O_NONBLOCK;
int fcntl(int, int /*<<< orphan*/, int);
void set_block(int fd) {
  int fl;
  fl = fcntl(fd, F_GETFL, 0);
  fl = fcntl(fd, F_SETFL, fl & ~O_NONBLOCK);
}


x86 assembly (clang, -O0):
<set_block>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2eab(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1030 <fcntl@plt>
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2e9d(%rip),%rax
mov    (%rax),%esi
mov    -0x8(%rbp),%edx
mov    0x2ea1(%rip),%rax
mov    (%rax),%eax
xor    $0xffffffff,%eax
and    %eax,%edx
call   1030 <fcntl@plt>
mov    %eax,-0x8(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_block>:
push   %rbx
mov    %edi,%ebx
mov    0x2eb6(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1030 <fcntl@plt>
mov    0x2eae(%rip),%rcx
mov    (%rcx),%esi
mov    0x2eb5(%rip),%rcx
mov    (%rcx),%edx
not    %edx
and    %eax,%edx
mov    %ebx,%edi
pop    %rbx
jmp    1030 <fcntl@plt>

LLVM IR (-O0):
@F_GETFL = global i32 0
@F_SETFL = global i32 0
@O_NONBLOCK = global i32 0
define void @set_block(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = load i32, i32* @F_GETFL
%6 = call i32 @fcntl(i32 %4, i32 %5, i32 0)
store i32 %6, i32* %3
%7 = load i32, i32* %2
%8 = load i32, i32* @F_SETFL
%9 = load i32, i32* %3
%10 = load i32, i32* @O_NONBLOCK
%11 = xor i32 %10, -1
%12 = and i32 %9, %11
%13 = call i32 @fcntl(i32 %7, i32 %8, i32 %12)
store i32 %13, i32* %3
ret void
}

LLVM IR (-O2):
@F_GETFL = global i32 0
@F_SETFL = global i32 0
@O_NONBLOCK = global i32 0
define void @set_block(i32 %0) {
%2 = load i32, i32* @F_GETFL
%3 = tail call i32 @fcntl(i32 %0, i32 %2, i32 0)
%4 = load i32, i32* @F_SETFL
%5 = load i32, i32* @O_NONBLOCK
%6 = xor i32 %5, -1
%7 = and i32 %3, %6
%8 = tail call i32 @fcntl(i32 %0, i32 %4, i32 %7)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ f();
main() {
  if (0)
    f();
}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ do_sockname(struct tcb *, int);
int sys_accept4(struct tcb *tcp) {
  do_sockname(tcp, 3);
  return 010;
}


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

x86 assembly (clang, -O2):
<sys_accept4>:
push   %rax
mov    $0x3,%esi
call   1030 <do_sockname@plt>
mov    $0x8,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.tcb = type { i32 }
define i32 @sys_accept4(%struct.tcb* %0) {
%2 = alloca %struct.tcb*
store %struct.tcb* %0, %struct.tcb** %2
%3 = load %struct.tcb*, %struct.tcb** %2
%4 = call i32 @do_sockname(%struct.tcb* %3, i32 3)
ret i32 8
}

LLVM IR (-O2):
%struct.tcb = type { i32 }
define i32 @sys_accept4(%struct.tcb* %0) {
%2 = tail call i32 @do_sockname(%struct.tcb* %0, i32 3)
ret i32 8
}
int compass_translate(int angle) { return 90 - angle; }


x86 assembly (clang, -O0):
<compass_translate>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0x5a,%eax
sub    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<compass_translate>:
mov    $0x5a,%eax
sub    %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @compass_translate(i32 %0) {
%2 = sub nsw i32 90, %0
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ strncpy_s(char *, size_t, char const *, size_t);
char *strncpy0(char *result, const char *s, size_t n) {
  strncpy_s(result, n, s, n);
  result[n] = '\0';
  return result;
}


x86 assembly (clang, -O0):
<strncpy0>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
call   1030 <strncpy_s@plt>
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strncpy0>:
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rsi,%rdx
mov    %rdi,%rbx
mov    %r14,%rsi
mov    %r14,%rcx
call   1030 <strncpy_s@plt>
movb   $0x0,(%rbx,%r14,1)
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @strncpy0(i8* %0, i8* %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
store i8* %0, i8** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%7 = load i8*, i8** %4
%8 = load i64, i64* %6
%9 = load i8*, i8** %5
%10 = load i64, i64* %6
%11 = call i32 @strncpy_s(i8* %7, i64 %8, i8* %9, i64 %10)
%12 = load i8*, i8** %4
%13 = load i64, i64* %6
%14 = getelementptr inbounds i8, i8* %12, i64 %13
store i8 0, i8* %14
%15 = load i8*, i8** %4
ret i8* %15
}

LLVM IR (-O2):
define i8* @strncpy0(i8* returned %0, i8* %1, i64 %2) {
%4 = tail call i32 @strncpy_s(i8* %0, i64 %2, i8* %1, i64 %2)
%5 = getelementptr inbounds i8, i8* %0, i64 %2
store i8 0, i8* %5
ret i8* %0
}
/* Variables and functions */
int atoi(char *);
int main(int argc, char **argv) {
  int iterations = atoi(argv[1]);
  int array[20] = {0};
  int i = 0;
  for (i = 0; i < iterations; i++) {
    array[i] = 100;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1040 <atoi@plt>
mov    %eax,-0x14(%rbp)
lea    -0x70(%rbp),%rdi
xor    %esi,%esi
mov    $0x50,%edx
call   1030 <memset@plt>
movl   $0x0,-0x74(%rbp)
movl   $0x0,-0x74(%rbp)
mov    -0x74(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    118d <main+0x6d>
movslq -0x74(%rbp),%rax
movl   $0x64,-0x70(%rbp,%rax,4)
mov    -0x74(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x74(%rbp)
jmp    1167 <main+0x47>
xor    %eax,%eax
add    $0x80,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca [20 x i32]
%8 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%9 = load i8**, i8*** %5
%10 = getelementptr inbounds i8*, i8** %9, i64 1
%11 = load i8*, i8** %10
%12 = call i32 @atoi(i8* %11)
store i32 %12, i32* %6
%13 = bitcast [20 x i32]* %7 to i8*
store i32 0, i32* %8
store i32 0, i32* %8
br label %14
14: ; preds = %22, %2
%15 = load i32, i32* %8
%16 = load i32, i32* %6
%17 = icmp slt i32 %15, %16
br i1 %17, label %18, label %25
18: ; preds = %14
%19 = load i32, i32* %8
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds [20 x i32], [20 x i32]* %7, i64 0, i64 %20
store i32 100, i32* %21
br label %22
22: ; preds = %18
%23 = load i32, i32* %8
%24 = add nsw i32 %23, 1
store i32 %24, i32* %8
br label %14
25: ; preds = %14
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
ret i32 0
}
void togle_led() {
  unsigned int gpio;
  gpio = (*(volatile unsigned int *)((
      __typeof__(0x18000000 + 0x00040000 +
                 0x8))(((unsigned long)(0x18000000 + 0x00040000 + 0x8) &
                        0x1fffffff) |
                       0xa0000000)));
  gpio ^= 1 << 26;
  gpio ^= 1 << 0;
  gpio ^= 1 << 17;
  gpio ^= 1 << 27;
  do {
    ((*(volatile unsigned int *)((
         __typeof__(0x18000000 + 0x00040000 +
                    0x8))(((unsigned long)(0x18000000 + 0x00040000 + 0x8) &
                           0x1fffffff) |
                          0xa0000000))) = (gpio));
    (*(volatile unsigned int *)((
        __typeof__(0x18000000 + 0x00040000 +
                   0x8))(((unsigned long)(0x18000000 + 0x00040000 + 0x8) &
                          0x1fffffff) |
                         0xa0000000)));
  } while (0);
  ;
}


x86 assembly (clang, -O0):
<togle_led>:
push   %rbp
mov    %rsp,%rbp
mov    $0xffffffffb8040008,%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
xor    $0x4000000,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
xor    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
xor    $0x20000,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
xor    $0x8000000,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
mov    $0xffffffffb8040008,%rax
mov    %ecx,(%rax)
mov    $0xffffffffb8040008,%rax
mov    (%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<togle_led>:
xorl   $0xc020001,0xffffffffb8040008
mov    0xffffffffb8040008,%eax
ret

LLVM IR (-O0):
define void @togle_led() {
%1 = alloca i32
%2 = load volatile i32, i32* inttoptr (i64 -1207697400 to i32*)
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = xor i32 %3, 67108864
store i32 %4, i32* %1
%5 = load i32, i32* %1
%6 = xor i32 %5, 1
store i32 %6, i32* %1
%7 = load i32, i32* %1
%8 = xor i32 %7, 131072
store i32 %8, i32* %1
%9 = load i32, i32* %1
%10 = xor i32 %9, 134217728
store i32 %10, i32* %1
br label %11
11: ; preds = %0
%12 = load i32, i32* %1
store volatile i32 %12, i32* inttoptr (i64 -1207697400 to i32*)
%13 = load volatile i32, i32* inttoptr (i64 -1207697400 to i32*)
br label %14
14: ; preds = %11
ret void
}

LLVM IR (-O2):
define void @togle_led() {
%1 = load volatile i32, i32* inttoptr (i64 -1207697400 to i32*)
%2 = xor i32 %1, 201457665
store volatile i32 %2, i32* inttoptr (i64 -1207697400 to i32*)
%3 = load volatile i32, i32* inttoptr (i64 -1207697400 to i32*)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *);
void log_clear() {
  FILE *out;
  out = fopen("log.dat", "w");
  fprintf(out, "opvdm log file:\n");
  fclose(out);
}


x86 assembly (clang, -O0):
<log_clear>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
lea    0xec2(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xeb0(%rip),%rsi
call   1040 <fprintf@plt>
mov    -0x8(%rbp),%rdi
call   1030 <fclose@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<log_clear>:
push   %rbx
lea    0xec8(%rip),%rdi
lea    0xec9(%rip),%rsi
call   1040 <fopen@plt>
mov    %rax,%rbx
lea    0xebc(%rip),%rdi
mov    $0x10,%esi
mov    $0x1,%edx
mov    %rax,%rcx
call   1050 <fwrite@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <fclose@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"log.dat\00"
@.str.1 = [2 x i8] c"w\00"
@.str.2 = [17 x i8] c"opvdm log file:\0A\00"
define void @log_clear() {
%1 = alloca i32*
%2 = call i32* @fopen(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %2, i32** %1
%3 = load i32*, i32** %1
%4 = call i32 @fprintf(i32* %3, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0))
%5 = load i32*, i32** %1
%6 = call i32 @fclose(i32* %5)
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"log.dat\00"
@.str.1 = [2 x i8] c"w\00"
@.str.2 = [17 x i8] c"opvdm log file:\0A\00"
define void @log_clear() {
%1 = tail call i32* @fopen(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i64 @fwrite(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0), i64 16, i64 1, i32* %1)
%3 = tail call i32 @fclose(i32* %1)
ret void
}
/* Variables and functions */
int isdigit(char);
int is_digit(char input) { return isdigit(input); }


x86 assembly (clang, -O0):
<is_digit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edi
call   1030 <isdigit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_digit>:
jmp    1030 <isdigit@plt>

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

LLVM IR (-O2):
define i32 @is_digit(i8 signext %0) {
%2 = tail call i32 @isdigit(i8 signext %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ init_strategy1();
int /*<<< orphan*/ init_strategy2();
int /*<<< orphan*/ init_strategy3();
void init_library_apmc(void) {
  init_strategy1();
  init_strategy2();
  init_strategy3();
}


x86 assembly (clang, -O0):
<init_library_apmc>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <init_strategy1@plt>
mov    $0x0,%al
call   1030 <init_strategy2@plt>
mov    $0x0,%al
call   1050 <init_strategy3@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_library_apmc>:
push   %rax
xor    %eax,%eax
call   1040 <init_strategy1@plt>
xor    %eax,%eax
call   1030 <init_strategy2@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <init_strategy3@plt>

LLVM IR (-O0):
define void @init_library_apmc() {
%1 = call i32 (...) @init_strategy1()
%2 = call i32 (...) @init_strategy2()
%3 = call i32 (...) @init_strategy3()
ret void
}

LLVM IR (-O2):
define void @init_library_apmc() {
%1 = tail call i32 (...) @init_strategy1()
%2 = tail call i32 (...) @init_strategy2()
%3 = tail call i32 (...) @init_strategy3()
ret void
}
/* Variables and functions */
int server_write(int, char const *, int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ strlen(char const *);
int simple_write(int fd, const char *str) {
  return server_write(fd, str, strlen(str), 0);
}


x86 assembly (clang, -O0):
<simple_write>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x1c(%rbp),%edi
mov    -0x18(%rbp),%rsi
mov    %eax,%edx
xor    %ecx,%ecx
call   1040 <server_write@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<simple_write>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
mov    %rsi,%rdi
call   1030 <strlen@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %eax,%edx
xor    %ecx,%ecx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <server_write@plt>

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

LLVM IR (-O2):
define i32 @simple_write(i32 %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %1)
%4 = tail call i32 @server_write(i32 %0, i8* %1, i32 %3, i32 0)
ret i32 %4
}
void test2_ptr_arith(int x) {
  int buf[100];
  int *p = buf;
  --p;
  p[0] = 1;
}


x86 assembly (clang, -O0):
<test2_ptr_arith>:
push   %rbp
mov    %rsp,%rbp
sub    $0x130,%rsp
mov    %edi,-0x4(%rbp)
lea    -0x1a0(%rbp),%rax
mov    %rax,-0x1a8(%rbp)
mov    -0x1a8(%rbp),%rax
add    $0xfffffffffffffffc,%rax
mov    %rax,-0x1a8(%rbp)
mov    -0x1a8(%rbp),%rax
movl   $0x1,(%rax)
add    $0x130,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @test2_ptr_arith(i32 %0) {
%2 = alloca i32
%3 = alloca [100 x i32]
%4 = alloca i32*
store i32 %0, i32* %2
%5 = getelementptr inbounds [100 x i32], [100 x i32]* %3, i64 0, i64 0
store i32* %5, i32** %4
%6 = load i32*, i32** %4
%7 = getelementptr inbounds i32, i32* %6, i32 -1
store i32* %7, i32** %4
%8 = load i32*, i32** %4
%9 = getelementptr inbounds i32, i32* %8, i64 0
store i32 1, i32* %9
ret void
}

LLVM IR (-O2):
define void @test2_ptr_arith(i32 %0) {
ret void
}
int main(int argc, char const *argv[]) {
  int l;
  int r = 42;
  while (1) {
    if (l - r <= 0) {
      r--;
    } else {
      break;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x2a,-0x18(%rbp)
mov    -0x14(%rbp),%eax
sub    -0x18(%rbp),%eax
cmp    $0x0,%eax
jg     1136 <main+0x36>
mov    -0x18(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x18(%rbp)
jmp    113b <main+0x3b>
jmp    1140 <main+0x40>
jmp    1119 <main+0x19>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
jmp    1100 <main>

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
br label %3
3: ; preds = %3, %2
br label %3
}
unsigned int p11c_hash_pointer(const void *ptr) { return (unsigned int)ptr; }


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

x86 assembly (clang, -O2):
<p11c_hash_pointer>:
mov    %rdi,%rax
ret

LLVM IR (-O0):
define i32 @p11c_hash_pointer(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = ptrtoint i8* %3 to i32
ret i32 %4
}

LLVM IR (-O2):
define i32 @p11c_hash_pointer(i8* %0) {
%2 = ptrtoint i8* %0 to i64
%3 = trunc i64 %2 to i32
ret i32 %3
}
/* Variables and functions */
int genPrimes(int);
int strtol(char *, int /*<<< orphan*/ *, int /*<<< orphan*/);
int main(int argc, char **argv) {
  int n = argc > 1 ? strtol(argv[1], NULL, 0) : 7500;
  int r = genPrimes(n);
  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)
cmpl   $0x1,-0x8(%rbp)
jle    115b <main+0x3b>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
xor    %eax,%eax
mov    %eax,%esi
xor    %edx,%edx
call   1030 <strtol@plt>
mov    %eax,-0x1c(%rbp)
jmp    1168 <main+0x48>
mov    $0x1d4c,%eax
mov    %eax,-0x1c(%rbp)
jmp    1168 <main+0x48>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
call   1040 <genPrimes@plt>
mov    %eax,-0x18(%rbp)
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    %edi,%eax
mov    $0x1d4c,%edi
cmp    $0x2,%eax
jl     113c <main+0x1c>
mov    0x8(%rsi),%rdi
xor    %esi,%esi
xor    %edx,%edx
call   1030 <strtol@plt>
mov    %eax,%edi
call   1040 <genPrimes@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = load i32, i32* %4
%9 = icmp sgt i32 %8, 1
br i1 %9, label %10, label %15
10: ; preds = %2
%11 = load i8**, i8*** %5
%12 = getelementptr inbounds i8*, i8** %11, i64 1
%13 = load i8*, i8** %12
%14 = call i32 @strtol(i8* %13, i32* null, i32 0)
br label %16
15: ; preds = %2
br label %16
16: ; preds = %15, %10
%17 = phi i32 [ %14, %10 ], [ 7500, %15 ]
store i32 %17, i32* %6
%18 = load i32, i32* %6
%19 = call i32 @genPrimes(i32 %18)
store i32 %19, i32* %7
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 1
br i1 %3, label %4, label %8
4: ; preds = %2
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = tail call i32 @strtol(i8* nocapture %6, i32* null, i32 0)
br label %8
8: ; preds = %2, %4
%9 = phi i32 [ %7, %4 ], [ 7500, %2 ]
%10 = tail call i32 @genPrimes(i32 %9)
ret i32 0
}
/* Type definitions */
struct stat {
  int dummy;
};

/* Variables and functions */
scalar_t__ stat(char *, struct stat *);
int file_exist(char *filename) {
  struct stat buffer;
  return stat(filename, &buffer) == 0;
}


x86 assembly (clang, -O0):
<file_exist>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x10(%rbp),%rsi
call   1030 <stat@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<file_exist>:
push   %rax
mov    %rsp,%rsi
call   1030 <stat@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
define i32 @file_exist(i8* %0) {
%2 = alloca i8*
%3 = alloca %struct.stat
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @stat(i8* %4, %struct.stat* %3)
%6 = icmp eq i64 %5, 0
%7 = zext i1 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @file_exist(i8* %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i64 @stat(i8* %0, %struct.stat* %2)
%5 = icmp eq i64 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(void) {
  printf("MBEDTLS_BIGNUM_C and/or MBEDTLS_RSA_C and/or "
         "MBEDTLS_ENTROPY_C and/or MBEDTLS_FS_IO and/or "
         "MBEDTLS_CTR_DRBG_C 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 = [124 x i8] c"MBEDTLS_BIGNUM_C and/or MBEDTLS_RSA_C and/or MBEDTLS_ENTROPY_C and/or MBEDTLS_FS_IO and/or MBEDTLS_CTR_DRBG_C not defined.\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([124 x i8], [124 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

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


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

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

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

LLVM IR (-O2):
%struct.link = type opaque
define void @l4sccp_inservice(%struct.link* nocapture %0) {
ret void
}
int add(int first, int second) {
  first = first + 2;
  return first + second;
}


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

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

LLVM IR (-O0):
define i32 @add(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 = add nsw i32 %5, 2
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = load i32, i32* %4
%9 = add nsw i32 %7, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @add(i32 %0, i32 %1) {
%3 = add nsw i32 %0, 2
%4 = add nsw i32 %3, %1
ret i32 %4
}
/* Variables and functions */
int memcmp(char *, char *, int);
int valid_psp_header(char *header) {
  char header_bytes[] = {0x31, 0x6E, 0x69, 0x50};
  return (memcmp(header_bytes, header, 4));
}


x86 assembly (clang, -O0):
<valid_psp_header>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0xede(%rip),%eax
mov    %eax,-0xc(%rbp)
lea    -0xc(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    $0x4,%edx
call   1030 <memcmp@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<valid_psp_header>:
push   %rax
mov    %rdi,%rsi
movl   $0x50696e31,0x4(%rsp)
50
lea    0x4(%rsp),%rdi
mov    $0x4,%edx
call   1030 <memcmp@plt>
pop    %rcx
ret

LLVM IR (-O0):
@__const.valid_psp_header.header_bytes = [4 x i8] c"1niP"
define i32 @valid_psp_header(i8* %0) {
%2 = alloca i8*
%3 = alloca [4 x i8]
store i8* %0, i8** %2
%4 = bitcast [4 x i8]* %3 to i8*
%5 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 0
%6 = load i8*, i8** %2
%7 = call i32 @memcmp(i8* %5, i8* %6, i32 4)
ret i32 %7
}

LLVM IR (-O2):
define i32 @valid_psp_header(i8* %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
store i32 1349086769, i32* %2
%4 = call i32 @memcmp(i8* %3, i8* %0, i32 4)
ret i32 %4
}
void foo30() {}


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

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

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

LLVM IR (-O2):
define void @foo30() {
ret void
}
/* Variables and functions */
int call_myclass_func(void *, int);
void *create_myclass();
int /*<<< orphan*/ destroy_myclass(void *);
int /*<<< orphan*/ printf(char *, int);
void c_function(int i) {
  void *mc = create_myclass();
  printf("%d", call_myclass_func(mc, i));
  destroy_myclass(mc);
}


x86 assembly (clang, -O0):
<c_function>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1050 <create_myclass@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x4(%rbp),%esi
call   1030 <call_myclass_func@plt>
mov    %eax,%esi
lea    0xe95(%rip),%rdi
call   1040 <printf@plt>
mov    -0x10(%rbp),%rdi
call   1060 <destroy_myclass@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<c_function>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebp
xor    %eax,%eax
call   1050 <create_myclass@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %ebp,%esi
call   1030 <call_myclass_func@plt>
lea    0xea0(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1060 <destroy_myclass@plt>

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define void @c_function(i32 %0) {
%2 = tail call i8* (...) @create_myclass()
%3 = tail call i32 @call_myclass_func(i8* %2, i32 %0)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = tail call i32 @destroy_myclass(i8* %2)
ret void
}
/* Type definitions */
struct termp {
  int dummy;
};

/* Variables and functions */
size_t ascii_width(const struct termp *p, int c) { return (1); }


x86 assembly (clang, -O0):
<ascii_width>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    $0x1,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.termp = type { i32 }
define i64 @ascii_width(%struct.termp* %0, i32 %1) {
%3 = alloca %struct.termp*
%4 = alloca i32
store %struct.termp* %0, %struct.termp** %3
store i32 %1, i32* %4
ret i64 1
}

LLVM IR (-O2):
%struct.termp = type { i32 }
define i64 @ascii_width(%struct.termp* nocapture readnone %0, i32 %1) {
ret i64 1
}
double pd_c(const double p0, const double qt, const double qv) {
  return p0 * (1.0 - qt) / (1.0 - qt + 1.6074538488331591 * qv);
}


x86 assembly (clang, -O0):
<pd_c>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xee8(%rip),%xmm1
subsd  -0x10(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xed7(%rip),%xmm2
subsd  -0x10(%rbp),%xmm2
movsd  -0x18(%rbp),%xmm1
movsd  0xebd(%rip),%xmm3
mulsd  %xmm3,%xmm1
addsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<pd_c>:
movsd  0xef8(%rip),%xmm3
subsd  %xmm1,%xmm3
mulsd  %xmm3,%xmm0
mulsd  0xef0(%rip),%xmm2
addsd  %xmm3,%xmm2
divsd  %xmm2,%xmm0
ret

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

LLVM IR (-O2):
define double @pd_c(double %0, double %1, double %2) {
%4 = fsub double 1.000000e+00, %1
%5 = fmul double %4, %0
%6 = tail call double @llvm.fmuladd.f64(double %2, double 0x3FF9B82186E9157D, double %4)
%7 = fdiv double %5, %6
ret double %7
}
void RAWToUVRow_C() {}


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

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

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

LLVM IR (-O2):
define void @RAWToUVRow_C() {
ret void
}
void gtk_handle_box_get_handle_position() {}


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

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

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

LLVM IR (-O2):
define void @gtk_handle_box_get_handle_position() {
ret void
}
unsigned int Get16Bit(unsigned char *pBuff) {
  return (pBuff[0] << 8) | pBuff[1];
}


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

x86 assembly (clang, -O2):
<Get16Bit>:
movzwl (%rdi),%eax
shl    $0x10,%eax
bswap  %eax
ret

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

LLVM IR (-O2):
define i32 @Get16Bit(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = zext i8 %2 to i32
%4 = shl nuw nsw i32 %3, 8
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = load i8, i8* %5
%7 = zext i8 %6 to i32
%8 = or i32 %4, %7
ret i32 %8
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
double pow2_u64(int);
double from_msr_eu_atom(uint64_t msrval) {
  return pow2_u64((msrval >> 8) & 0x1F) / 1000000.0;
}


x86 assembly (clang, -O0):
<from_msr_eu_atom>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
sar    $0x8,%edi
and    $0x1f,%edi
call   1030 <pow2_u64@plt>
movsd  0xecf(%rip),%xmm1
divsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<from_msr_eu_atom>:
push   %rax
shr    $0x8,%edi
and    $0x1f,%edi
call   1030 <pow2_u64@plt>
divsd  0xedc(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @from_msr_eu_atom(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = ashr i32 %3, 8
%5 = and i32 %4, 31
%6 = call double @pow2_u64(i32 %5)
%7 = fdiv double %6, 1.000000e+06
ret double %7
}

LLVM IR (-O2):
define double @from_msr_eu_atom(i32 %0) {
%2 = lshr i32 %0, 8
%3 = and i32 %2, 31
%4 = tail call double @pow2_u64(i32 %3)
%5 = fdiv double %4, 1.000000e+06
ret double %5
}
int myFunc() { return 55; }


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

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

LLVM IR (-O0):
define i32 @myFunc() {
ret i32 55
}

LLVM IR (-O2):
define i32 @myFunc() {
ret i32 55
}
void my_post_hook(int val) {
  printf("%s: Post Hooked with %d\n", __FUNCTION__, val);
}


x86 assembly (clang, -O0):
<my_post_hook>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
lea    0xedb(%rip),%rdi
lea    0xeed(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_post_hook>:
mov    %edi,%edx
lea    0xee7(%rip),%rdi
lea    0xef9(%rip),%rsi
xor    %eax,%eax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [25 x i8] c"%s: Post Hooked with %d\0A\00"
@__FUNCTION__.my_post_hook = [13 x i8] c"my_post_hook\00"
define void @my_post_hook(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @__FUNCTION__.my_post_hook, i64 0, i64 0), i32 %3)
ret void
}

LLVM IR (-O2):
@.str = [25 x i8] c"%s: Post Hooked with %d\0A\00"
@__FUNCTION__.my_post_hook = [13 x i8] c"my_post_hook\00"
define void @my_post_hook(i32 %0) {
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @__FUNCTION__.my_post_hook, i64 0, i64 0), i32 %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
struct tm {
  int dummy;
};

/* Variables and functions */
struct tm *localtime(int /*<<< orphan*/ *);
scalar_t__ malloc(int);
int /*<<< orphan*/ strftime(char *, int, char *, struct tm *);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
const char *gettimestamp(void) {
  time_t currenttime = 0;
  struct tm *localtime_tm = NULL;
  char *timestamp = (char *)malloc(512 * sizeof(char));
  time(&currenttime);
  localtime_tm = localtime(&currenttime);
  strftime(timestamp, 512, "%Y-%m-%d %H:%M:%S", localtime_tm);
  return timestamp;
}


x86 assembly (clang, -O0):
<gettimestamp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0x0,-0x10(%rbp)
mov    $0x200,%edi
call   1050 <malloc@plt>
mov    %rax,-0x18(%rbp)
lea    -0x4(%rbp),%rdi
call   1040 <time@plt>
lea    -0x4(%rbp),%rdi
call   1030 <localtime@plt>
mov    %rax,-0x10(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rcx
mov    $0x200,%esi
lea    0xe71(%rip),%rdx
call   1060 <strftime@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gettimestamp>:
push   %r14
push   %rbx
push   %rax
movl   $0x0,0x4(%rsp)
mov    $0x200,%edi
call   1050 <malloc@plt>
mov    %rax,%rbx
lea    0x4(%rsp),%r14
mov    %r14,%rdi
call   1040 <time@plt>
mov    %r14,%rdi
call   1030 <localtime@plt>
lea    0xe8b(%rip),%rdx
mov    %rbx,%rdi
mov    $0x200,%esi
mov    %rax,%rcx
call   1060 <strftime@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.tm = type { i32 }
@.str = [18 x i8] c"%Y-%m-%d %H:%M:%S\00"
define i8* @gettimestamp() {
%1 = alloca i32
%2 = alloca %struct.tm*
%3 = alloca i8*
store i32 0, i32* %1
store %struct.tm* null, %struct.tm** %2
%4 = call i64 @malloc(i32 512)
%5 = inttoptr i64 %4 to i8*
store i8* %5, i8** %3
%6 = call i32 @time(i32* %1)
%7 = call %struct.tm* @localtime(i32* %1)
store %struct.tm* %7, %struct.tm** %2
%8 = load i8*, i8** %3
%9 = load %struct.tm*, %struct.tm** %2
%10 = call i32 @strftime(i8* %8, i32 512, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), %struct.tm* %9)
%11 = load i8*, i8** %3
ret i8* %11
}

LLVM IR (-O2):
%struct.tm = type { i32 }
@.str = [18 x i8] c"%Y-%m-%d %H:%M:%S\00"
define i8* @gettimestamp() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 0, i32* %1
%3 = tail call i64 @malloc(i32 512)
%4 = inttoptr i64 %3 to i8*
%5 = call i32 @time(i32* %1)
%6 = call %struct.tm* @localtime(i32* %1)
%7 = call i32 @strftime(i8* %4, i32 512, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), %struct.tm* %6)
ret i8* %4
}