xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, char *);
int main(int argc, char *argv[]) {
  if (argc < 3) {
    printf("Usage: %s <name> <integer>\n", argv[0]);
    exit(-1);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x3,-0x4(%rbp)
jge    1156 <main+0x36>
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
lea    0xeb9(%rip),%rdi
call   1030 <printf@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
cmp    $0x2,%edi
jle    1128 <main+0x8>
xor    %eax,%eax
ret
push   %rax
mov    (%rsi),%rsi
lea    0xecd(%rip),%rdi
call   1030 <printf@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [28 x i8] c"Usage: %s <name> <integer>\0A\00"
define i32 @main(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 = icmp slt i32 %5, 3
br i1 %6, label %7, label %13
7: ; preds = %2
%8 = load i8**, i8*** %4
%9 = getelementptr inbounds i8*, i8** %8, i64 0
%10 = load i8*, i8** %9
%11 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i8* %10)
%12 = call i32 @exit(i32 -1)
unreachable
13: ; preds = %2
ret i32 0
}

LLVM IR (-O2):
@.str = [28 x i8] c"Usage: %s <name> <integer>\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp slt i32 %0, 3
br i1 %3, label %4, label %8
4: ; preds = %2
%5 = load i8*, i8** %1
%6 = tail call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i8* %5)
%7 = tail call i32 @exit(i32 -1)
unreachable
8: ; preds = %2
ret i32 0
}
/* Type definitions */
struct timex {
  scalar_t__ status;
  void *modes;
};

/* Variables and functions */
void *ADJ_STATUS;
scalar_t__ STA_PLL;
int adjtimex(struct timex *);
void clear_time_state(void) {
  struct timex tx;
  int ret;
  tx.modes = ADJ_STATUS;
  tx.status = STA_PLL;
  ret = adjtimex(&tx);
  tx.modes = ADJ_STATUS;
  tx.status = 0;
  ret = adjtimex(&tx);
}


x86 assembly (clang, -O0):
<clear_time_state>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    0x2ec1(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x8(%rbp)
mov    0x2ebb(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x10(%rbp)
lea    -0x10(%rbp),%rdi
call   1030 <adjtimex@plt>
mov    %eax,-0x14(%rbp)
mov    0x2e99(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
lea    -0x10(%rbp),%rdi
call   1030 <adjtimex@plt>
mov    %eax,-0x14(%rbp)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clear_time_state>:
push   %r14
push   %rbx
sub    $0x18,%rsp
mov    0x2ec2(%rip),%r14
mov    (%r14),%rax
mov    %rax,0x10(%rsp)
mov    0x2ebb(%rip),%rax
mov    (%rax),%rax
mov    %rax,0x8(%rsp)
lea    0x8(%rsp),%rbx
mov    %rbx,%rdi
call   1030 <adjtimex@plt>
mov    (%r14),%rax
mov    %rax,0x10(%rsp)
movq   $0x0,0x8(%rsp)
mov    %rbx,%rdi
call   1030 <adjtimex@plt>
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.timex = type { i64, i8* }
@ADJ_STATUS = global i8* null
@STA_PLL = global i64 0
define void @clear_time_state() {
%1 = alloca %struct.timex
%2 = alloca i32
%3 = load i8*, i8** @ADJ_STATUS
%4 = getelementptr inbounds %struct.timex, %struct.timex* %1, i32 0, i32 1
store i8* %3, i8** %4
%5 = load i64, i64* @STA_PLL
%6 = getelementptr inbounds %struct.timex, %struct.timex* %1, i32 0, i32 0
store i64 %5, i64* %6
%7 = call i32 @adjtimex(%struct.timex* %1)
store i32 %7, i32* %2
%8 = load i8*, i8** @ADJ_STATUS
%9 = getelementptr inbounds %struct.timex, %struct.timex* %1, i32 0, i32 1
store i8* %8, i8** %9
%10 = getelementptr inbounds %struct.timex, %struct.timex* %1, i32 0, i32 0
store i64 0, i64* %10
%11 = call i32 @adjtimex(%struct.timex* %1)
store i32 %11, i32* %2
ret void
}

LLVM IR (-O2):
%struct.timex = type { i64, i8* }
@ADJ_STATUS = global i8* null
@STA_PLL = global i64 0
define void @clear_time_state() {
%1 = alloca %struct.timex
%2 = bitcast %struct.timex* %1 to i8*
%3 = load i8*, i8** @ADJ_STATUS
%4 = getelementptr inbounds %struct.timex, %struct.timex* %1, i64 0, i32 1
store i8* %3, i8** %4
%5 = load i64, i64* @STA_PLL
%6 = getelementptr inbounds %struct.timex, %struct.timex* %1, i64 0, i32 0
store i64 %5, i64* %6
%7 = call i32 @adjtimex(%struct.timex* %1)
%8 = load i8*, i8** @ADJ_STATUS
store i8* %8, i8** %4
store i64 0, i64* %6
%9 = call i32 @adjtimex(%struct.timex* %1)
ret void
}
/* Type definitions */
struct sha512 {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ sha512_update(struct sha512 *, void const *, unsigned int);
void hashmd(struct sha512 *s, unsigned int n, const void *md) {
  unsigned int i;
  for (i = n; i > 64; i -= 64)
    sha512_update(s, md, 64);
  sha512_update(s, md, i);
}


x86 assembly (clang, -O0):
<hashmd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x1c(%rbp)
cmpl   $0x40,-0x1c(%rbp)
jbe    1153 <hashmd+0x43>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    $0x40,%edx
call   1030 <sha512_update@plt>
mov    -0x1c(%rbp),%eax
sub    $0x40,%eax
mov    %eax,-0x1c(%rbp)
jmp    1129 <hashmd+0x19>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x1c(%rbp),%edx
call   1030 <sha512_update@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hashmd>:
push   %rbp
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %esi,%ebp
mov    %rdi,%rbx
cmp    $0x41,%esi
jb     1148 <hashmd+0x38>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0x40,%edx
call   1030 <sha512_update@plt>
add    $0xffffffc0,%ebp
cmp    $0x40,%ebp
ja     1130 <hashmd+0x20>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %ebp,%edx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <sha512_update@plt>

LLVM IR (-O0):
%struct.sha512 = type { i32 }
define void @hashmd(%struct.sha512* %0, i32 %1, i8* %2) {
%4 = alloca %struct.sha512*
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i32
store %struct.sha512* %0, %struct.sha512** %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%8 = load i32, i32* %5
store i32 %8, i32* %7
br label %9
9: ; preds = %16, %3
%10 = load i32, i32* %7
%11 = icmp ugt i32 %10, 64
br i1 %11, label %12, label %19
12: ; preds = %9
%13 = load %struct.sha512*, %struct.sha512** %4
%14 = load i8*, i8** %6
%15 = call i32 @sha512_update(%struct.sha512* %13, i8* %14, i32 64)
br label %16
16: ; preds = %12
%17 = load i32, i32* %7
%18 = sub i32 %17, 64
store i32 %18, i32* %7
br label %9
19: ; preds = %9
%20 = load %struct.sha512*, %struct.sha512** %4
%21 = load i8*, i8** %6
%22 = load i32, i32* %7
%23 = call i32 @sha512_update(%struct.sha512* %20, i8* %21, i32 %22)
ret void
}

LLVM IR (-O2):
%struct.sha512 = type { i32 }
define void @hashmd(%struct.sha512* %0, i32 %1, i8* %2) {
%4 = icmp ugt i32 %1, 64
br i1 %4, label %5, label %10
5: ; preds = %3, %5
%6 = phi i32 [ %8, %5 ], [ %1, %3 ]
%7 = tail call i32 @sha512_update(%struct.sha512* %0, i8* %2, i32 64)
%8 = add i32 %6, -64
%9 = icmp ugt i32 %8, 64
br i1 %9, label %5, label %10
10: ; preds = %5, %3
%11 = phi i32 [ %1, %3 ], [ %8, %5 ]
%12 = tail call i32 @sha512_update(%struct.sha512* %0, i8* %2, i32 %11)
ret void
}
void TRACE(const char *format, ...) {}


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

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

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

LLVM IR (-O2):
define void @TRACE(i8* nocapture %0, ...) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ IntEnable(int);
int /*<<< orphan*/ IntRegister(int, void (*)());
void I2SIntRegister(unsigned long ulBase, void (*pfnHandler)(void)) {
  ;
  ;
  IntRegister(68, pfnHandler);
  IntEnable(68);
}


x86 assembly (clang, -O0):
<I2SIntRegister>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
mov    $0x44,%edi
call   1040 <IntRegister@plt>
mov    $0x44,%edi
call   1030 <IntEnable@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<I2SIntRegister>:
push   %rax
mov    $0x44,%edi
call   1040 <IntRegister@plt>
mov    $0x44,%edi
pop    %rax
jmp    1030 <IntEnable@plt>

LLVM IR (-O0):
define void @I2SIntRegister(i64 %0, void ()* %1) {
%3 = alloca i64
%4 = alloca void ()*
store i64 %0, i64* %3
store void ()* %1, void ()** %4
%5 = load void ()*, void ()** %4
%6 = bitcast void ()* %5 to void (...)*
%7 = call i32 @IntRegister(i32 68, void (...)* %6)
%8 = call i32 @IntEnable(i32 68)
ret void
}

LLVM IR (-O2):
define void @I2SIntRegister(i64 %0, void ()* %1) {
%3 = bitcast void ()* %1 to void (...)*
%4 = tail call i32 @IntRegister(i32 68, void (...)* %3)
%5 = tail call i32 @IntEnable(i32 68)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ GL_FLAT;
int /*<<< orphan*/ glClearColor(double, double, double, double);
int /*<<< orphan*/ glShadeModel(int /*<<< orphan*/);
void init(void) {
  glClearColor(0.9, 0.3, 0.1, 0.0);
  glShadeModel(GL_FLAT);
}


x86 assembly (clang, -O0):
<init>:
push   %rbp
mov    %rsp,%rbp
movsd  0xed4(%rip),%xmm0
movsd  0xed4(%rip),%xmm1
movsd  0xed4(%rip),%xmm2
xorps  %xmm3,%xmm3
call   1030 <glClearColor@plt>
mov    0x2e9d(%rip),%rax
mov    (%rax),%edi
call   1040 <glShadeModel@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<init>:
push   %rax
movsd  0xed7(%rip),%xmm0
movsd  0xed7(%rip),%xmm1
movsd  0xed7(%rip),%xmm2
xorps  %xmm3,%xmm3
call   1030 <glClearColor@plt>
mov    0x2ea0(%rip),%rax
mov    (%rax),%edi
pop    %rax
jmp    1040 <glShadeModel@plt>

LLVM IR (-O0):
@GL_FLAT = global i32 0
define void @init() {
%1 = call i32 @glClearColor(double 9.000000e-01, double 3.000000e-01, double 1.000000e-01, double 0.000000e+00)
%2 = load i32, i32* @GL_FLAT
%3 = call i32 @glShadeModel(i32 %2)
ret void
}

LLVM IR (-O2):
@GL_FLAT = global i32 0
define void @init() {
%1 = tail call i32 @glClearColor(double 9.000000e-01, double 3.000000e-01, double 1.000000e-01, double 0.000000e+00)
%2 = load i32, i32* @GL_FLAT
%3 = tail call i32 @glShadeModel(i32 %2)
ret void
}
int cmp_int_ptr(int *a, int *b) {
  if (*a < *b)
    return -1;
  else if (*a > *b)
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<cmp_int_ptr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    -0x18(%rbp),%rcx
cmp    (%rcx),%eax
jge    112a <cmp_int_ptr+0x2a>
movl   $0xffffffff,-0x4(%rbp)
jmp    114f <cmp_int_ptr+0x4f>
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    -0x18(%rbp),%rcx
cmp    (%rcx),%eax
jle    1148 <cmp_int_ptr+0x48>
movl   $0x1,-0x4(%rbp)
jmp    114f <cmp_int_ptr+0x4f>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmp_int_ptr>:
mov    (%rdi),%eax
xor    %ecx,%ecx
cmp    (%rsi),%eax
setg   %cl
mov    $0xffffffff,%eax
cmovge %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @cmp_int_ptr(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %0
%4 = load i32, i32* %1
%5 = icmp slt i32 %3, %4
%6 = icmp sgt i32 %3, %4
%7 = zext i1 %6 to i32
%8 = select i1 %5, i32 -1, i32 %7
ret i32 %8
}
/* Variables and functions */
char getchar();
char get_char() {
  char c;
  c = getchar();
  if (c != '\n')
    while (getchar() != '\n')
      ;
  return c;
}


x86 assembly (clang, -O0):
<get_char>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <getchar@plt>
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0xa,%eax
je     1151 <get_char+0x41>
jmp    1134 <get_char+0x24>
mov    $0x0,%al
call   1030 <getchar@plt>
movsbl %al,%eax
cmp    $0xa,%eax
je     114c <get_char+0x3c>
jmp    1134 <get_char+0x24>
jmp    1151 <get_char+0x41>
movsbl -0x1(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_char>:
push   %rbx
xor    %eax,%eax
call   1030 <getchar@plt>
mov    %eax,%ebx
cmp    $0xa,%al
je     112b <get_char+0x1b>
xchg   %ax,%ax
xor    %eax,%eax
call   1030 <getchar@plt>
cmp    $0xa,%al
jne    1120 <get_char+0x10>
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define signext i8 @get_char() {
%1 = tail call signext i8 (...) @getchar()
%2 = icmp eq i8 %1, 10
br i1 %2, label %6, label %3
3: ; preds = %0, %3
%4 = tail call signext i8 (...) @getchar()
%5 = icmp eq i8 %4, 10
br i1 %5, label %6, label %3
6: ; preds = %3, %0
ret i8 %1
}
/* Type definitions */
typedef int /*<<< orphan*/ errbuf;

/* Variables and functions */
int /*<<< orphan*/ ERR_error_string_n(unsigned long, char *, int);
unsigned long ERR_get_error();
__attribute__((unused)) char *ssl_err(void) {
  unsigned long errdetail;
  static char errbuf[1024];
  errdetail = ERR_get_error();
  ERR_error_string_n(errdetail, errbuf, sizeof(errbuf));
  return errbuf;
}


x86 assembly (clang, -O0):
<ssl_err>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <ERR_get_error@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0x2f02(%rip),%rsi
mov    $0x400,%edx
call   1030 <ERR_error_string_n@plt>
lea    0x2ef1(%rip),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ssl_err>:
push   %rbx
xor    %eax,%eax
call   1040 <ERR_get_error@plt>
lea    0x2f11(%rip),%rbx
mov    %rax,%rdi
mov    %rbx,%rsi
mov    $0x400,%edx
call   1030 <ERR_error_string_n@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@ssl_err.errbuf = internal global [1024 x i8] zeroinitializer
define i8* @ssl_err() {
%1 = alloca i64
%2 = call i64 (...) @ERR_get_error()
store i64 %2, i64* %1
%3 = load i64, i64* %1
%4 = call i32 @ERR_error_string_n(i64 %3, i8* getelementptr inbounds ([1024 x i8], [1024 x i8]* @ssl_err.errbuf, i64 0, i64 0), i32 1024)
ret i8* getelementptr inbounds ([1024 x i8], [1024 x i8]* @ssl_err.errbuf, i64 0, i64 0)
}

LLVM IR (-O2):
@ssl_err.errbuf = internal global [1024 x i8] zeroinitializer
define i8* @ssl_err() {
%1 = tail call i64 (...) @ERR_get_error()
%2 = tail call i32 @ERR_error_string_n(i64 %1, i8* getelementptr inbounds ([1024 x i8], [1024 x i8]* @ssl_err.errbuf, i64 0, i64 0), i32 1024)
ret i8* getelementptr inbounds ([1024 x i8], [1024 x i8]* @ssl_err.errbuf, i64 0, i64 0)
}
/* Variables and functions */
unsigned int ntohl(unsigned int);
void keytoid(unsigned int *id, unsigned char *key) {
  *id = *((unsigned int *)key);
  *id = ntohl(*id);
}


x86 assembly (clang, -O0):
<keytoid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
call   1030 <ntohl@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<keytoid>:
push   %rbx
mov    %rdi,%rbx
mov    (%rsi),%edi
call   1030 <ntohl@plt>
mov    %eax,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @keytoid(i32* %0, i8* %1) {
%3 = alloca i32*
%4 = alloca i8*
store i32* %0, i32** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = bitcast i8* %5 to i32*
%7 = load i32, i32* %6
%8 = load i32*, i32** %3
store i32 %7, i32* %8
%9 = load i32*, i32** %3
%10 = load i32, i32* %9
%11 = call i32 @ntohl(i32 %10)
%12 = load i32*, i32** %3
store i32 %11, i32* %12
ret void
}

LLVM IR (-O2):
define void @keytoid(i32* nocapture writeonly %0, i8* nocapture %1) {
%3 = bitcast i8* %1 to i32*
%4 = load i32, i32* %3
%5 = tail call i32 @ntohl(i32 %4)
store i32 %5, i32* %0
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
long odirure(uint32_t key, uint32_t seed) {
  uint32_t m1 = seed * (key ^ (key >> 16));
  uint32_t m2 = (seed * (m1 ^ (m1 >> 16)));
  return m2 ^ (m2 >> 16);
}


x86 assembly (clang, -O0):
<odirure>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    -0x4(%rbp),%ecx
mov    -0x4(%rbp),%edx
sar    $0x10,%edx
xor    %edx,%ecx
imul   %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    -0xc(%rbp),%ecx
mov    -0xc(%rbp),%edx
sar    $0x10,%edx
xor    %edx,%ecx
imul   %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    -0x10(%rbp),%ecx
sar    $0x10,%ecx
xor    %ecx,%eax
cltq
pop    %rbp
ret

x86 assembly (clang, -O2):
<odirure>:
mov    %edi,%eax
sar    $0x10,%eax
xor    %edi,%eax
imul   %esi,%eax
mov    %eax,%ecx
sar    $0x10,%ecx
xor    %eax,%ecx
imul   %esi,%ecx
mov    %ecx,%eax
sar    $0x10,%eax
xor    %ecx,%eax
cltq
ret

LLVM IR (-O0):
define i64 @odirure(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%7 = load i32, i32* %4
%8 = load i32, i32* %3
%9 = load i32, i32* %3
%10 = ashr i32 %9, 16
%11 = xor i32 %8, %10
%12 = mul nsw i32 %7, %11
store i32 %12, i32* %5
%13 = load i32, i32* %4
%14 = load i32, i32* %5
%15 = load i32, i32* %5
%16 = ashr i32 %15, 16
%17 = xor i32 %14, %16
%18 = mul nsw i32 %13, %17
store i32 %18, i32* %6
%19 = load i32, i32* %6
%20 = load i32, i32* %6
%21 = ashr i32 %20, 16
%22 = xor i32 %19, %21
%23 = sext i32 %22 to i64
ret i64 %23
}

LLVM IR (-O2):
define i64 @odirure(i32 %0, i32 %1) {
%3 = ashr i32 %0, 16
%4 = xor i32 %3, %0
%5 = mul nsw i32 %4, %1
%6 = ashr i32 %5, 16
%7 = xor i32 %6, %5
%8 = mul nsw i32 %7, %1
%9 = ashr i32 %8, 16
%10 = xor i32 %9, %8
%11 = sext i32 %10 to i64
ret i64 %11
}
long int largest_prime_factor(long int n) {
  long int f = 2;
  while (n > 1 && f <= n) {
    if (n % f == 0) {
      n /= f;
    } else {
      f++;
    }
  }
  return f;
}


x86 assembly (clang, -O0):
<largest_prime_factor>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x2,-0x10(%rbp)
xor    %eax,%eax
cmpq   $0x1,-0x8(%rbp)
mov    %al,-0x11(%rbp)
jle    112e <largest_prime_factor+0x2e>
mov    -0x10(%rbp),%rax
cmp    -0x8(%rbp),%rax
setle  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    113e <largest_prime_factor+0x3e>
jmp    1179 <largest_prime_factor+0x79>
mov    -0x8(%rbp),%rax
cqto
idivq  -0x10(%rbp)
cmp    $0x0,%rdx
jne    1168 <largest_prime_factor+0x68>
mov    -0x10(%rbp),%rcx
mov    -0x8(%rbp),%rax
cqto
idiv   %rcx
mov    %rax,-0x8(%rbp)
jmp    1174 <largest_prime_factor+0x74>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <largest_prime_factor+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<largest_prime_factor>:
mov    $0x2,%ecx
cmp    $0x2,%rdi
jl     1150 <largest_prime_factor+0x50>
nopl   0x0(%rax,%rax,1)
mov    %rdi,%rax
or     %rcx,%rax
shr    $0x20,%rax
je     1130 <largest_prime_factor+0x30>
mov    %rdi,%rax
cqto
idiv   %rcx
jmp    1136 <largest_prime_factor+0x36>
cs nopw 0x0(%rax,%rax,1)
mov    %edi,%eax
xor    %edx,%edx
div    %ecx
test   %rdx,%rdx
cmove  %rax,%rdi
lea    0x1(%rcx),%rax
cmovne %rax,%rcx
cmp    $0x2,%rdi
jl     1150 <largest_prime_factor+0x50>
cmp    %rdi,%rcx
jle    1110 <largest_prime_factor+0x10>
mov    %rcx,%rax
ret

LLVM IR (-O0):
define i64 @largest_prime_factor(i64 %0) {
%2 = alloca i64
%3 = alloca i64
store i64 %0, i64* %2
store i64 2, i64* %3
br label %4
4: ; preds = %25, %1
%5 = load i64, i64* %2
%6 = icmp sgt i64 %5, 1
br i1 %6, label %7, label %11
7: ; preds = %4
%8 = load i64, i64* %3
%9 = load i64, i64* %2
%10 = icmp sle i64 %8, %9
br label %11
11: ; preds = %7, %4
%12 = phi i1 [ false, %4 ], [ %10, %7 ]
br i1 %12, label %13, label %26
13: ; preds = %11
%14 = load i64, i64* %2
%15 = load i64, i64* %3
%16 = srem i64 %14, %15
%17 = icmp eq i64 %16, 0
br i1 %17, label %18, label %22
18: ; preds = %13
%19 = load i64, i64* %3
%20 = load i64, i64* %2
%21 = sdiv i64 %20, %19
store i64 %21, i64* %2
br label %25
22: ; preds = %13
%23 = load i64, i64* %3
%24 = add nsw i64 %23, 1
store i64 %24, i64* %3
br label %25
25: ; preds = %22, %18
br label %4
26: ; preds = %11
%27 = load i64, i64* %3
ret i64 %27
}

LLVM IR (-O2):
define i64 @largest_prime_factor(i64 %0) {
%2 = icmp sgt i64 %0, 1
br i1 %2, label %3, label %15
3: ; preds = %1, %3
%4 = phi i64 [ %11, %3 ], [ 2, %1 ]
%5 = phi i64 [ %10, %3 ], [ %0, %1 ]
%6 = srem i64 %5, %4
%7 = sdiv i64 %5, %4
%8 = icmp eq i64 %6, 0
%9 = add nsw i64 %4, 1
%10 = select i1 %8, i64 %7, i64 %5
%11 = select i1 %8, i64 %4, i64 %9
%12 = icmp sgt i64 %10, 1
%13 = icmp sle i64 %11, %10
%14 = select i1 %12, i1 %13, i1 false
br i1 %14, label %3, label %15
15: ; preds = %3, %1
%16 = phi i64 [ 2, %1 ], [ %11, %3 ]
ret i64 %16
}
int a() { return 27; }


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

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

LLVM IR (-O0):
define i32 @a() {
ret i32 27
}

LLVM IR (-O2):
define i32 @a() {
ret i32 27
}
signed char cstylecast_1(unsigned int x) { return (signed char)x; }


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

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

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

LLVM IR (-O2):
define signext i8 @cstylecast_1(i32 %0) {
%2 = trunc i32 %0 to i8
ret i8 %2
}
/* Variables and functions */
int /*<<< orphan*/ CreateWin43(unsigned long);
void createwin(unsigned long cbg) { CreateWin43(cbg); }


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

x86 assembly (clang, -O2):
<createwin>:
jmp    1030 <CreateWin43@plt>

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

LLVM IR (-O2):
define void @createwin(i64 %0) {
%2 = tail call i32 @CreateWin43(i64 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void main() {
  int i = 0;
  printf("impressao dos valores de I %d\n", i++);
  printf("impressao dos valores de I %d\n", ++i);
  printf("impressao dos valores de I %d\n", i--);
  printf("impressao dos valores de I %d\n", --i);
}


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

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xee8(%rip),%rbx
mov    %rbx,%rdi
xor    %esi,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x2,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x2,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
xor    %esi,%esi
pop    %rbx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [31 x i8] c"impressao dos valores de I %d\0A\00"
define void @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = load i32, i32* %1
%3 = add nsw i32 %2, 1
store i32 %3, i32* %1
%4 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i32 %2)
%5 = load i32, i32* %1
%6 = add nsw i32 %5, 1
store i32 %6, i32* %1
%7 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i32 %6)
%8 = load i32, i32* %1
%9 = add nsw i32 %8, -1
store i32 %9, i32* %1
%10 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i32 %8)
%11 = load i32, i32* %1
%12 = add nsw i32 %11, -1
store i32 %12, i32* %1
%13 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i32 %12)
ret void
}

LLVM IR (-O2):
@.str = [31 x i8] c"impressao dos valores de I %d\0A\00"
define void @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i32 0)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i32 2)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i32 2)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i32 0)
ret void
}
void g(int *x, int *y, int z) {
  if (z > 0) {
    g(x, y, z - 2);
    *y = *x * *y;
  } else
    *y = *y + 1;
}


x86 assembly (clang, -O0):
<g>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jle    1158 <g+0x48>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
sub    $0x2,%edx
call   1030 <g@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
mov    -0x10(%rbp),%rax
imul   (%rax),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
jmp    1167 <g+0x57>
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
add    $0x1,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<g>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
test   %edx,%edx
jle    1131 <g+0x21>
mov    %rdi,%r14
add    $0xfffffffe,%edx
mov    %rbx,%rsi
call   1030 <g@plt>
mov    (%rbx),%eax
imul   (%r14),%eax
jmp    1136 <g+0x26>
mov    (%rbx),%eax
add    $0x1,%eax
mov    %eax,(%rbx)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define void @g(i32* nocapture %0, i32* nocapture %1, i32 %2) {
%4 = icmp sgt i32 %2, 0
br i1 %4, label %5, label %10
5: ; preds = %3
%6 = add nsw i32 %2, -2
tail call void @g(i32* %0, i32* %1, i32 %6)
%7 = load i32, i32* %0
%8 = load i32, i32* %1
%9 = mul nsw i32 %8, %7
br label %13
10: ; preds = %3
%11 = load i32, i32* %1
%12 = add nsw i32 %11, 1
br label %13
13: ; preds = %10, %5
%14 = phi i32 [ %12, %10 ], [ %9, %5 ]
store i32 %14, i32* %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *, int *);
int main() {
  int a, b;
  scanf("%d %d\n", &a, &b);
  printf("%d\n", a + b);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
call   1040 <scanf@plt>
mov    -0x8(%rbp),%esi
add    -0xc(%rbp),%esi
lea    0xeb3(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
call   1040 <scanf@plt>
mov    (%rsp),%esi
add    0x4(%rsp),%esi
lea    0xec0(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [7 x i8] c"%d %d\0A\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2)
%6 = load i32, i32* %1
%7 = load i32, i32* %2
%8 = add nsw i32 %7, %6
%9 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %8)
ret i32 0
}
/* Variables and functions */
int strlen(const char *str) {
  int retval;
  for (retval = 0; *str != '\0'; str++)
    retval++;
  return retval;
}


x86 assembly (clang, -O0):
<strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1139 <strlen+0x39>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    110f <strlen+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlen>:
cmpb   $0x0,(%rdi)
je     111c <strlen+0x1c>
xor    %eax,%eax
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,0x1(%rdi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <strlen+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @strlen(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i32 [ %7, %4 ], [ 0, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = add nuw nsw i32 %5, 1
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
%12 = phi i32 [ 0, %1 ], [ %7, %4 ]
ret i32 %12
}
unsigned short int16_be_at(unsigned char *c) { return (c[0] << 8) | c[1]; }


x86 assembly (clang, -O0):
<int16_be_at>:
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
movzwl %ax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<int16_be_at>:
movzwl (%rdi),%eax
rol    $0x8,%ax
ret

LLVM IR (-O0):
define zeroext i16 @int16_be_at(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
%13 = trunc i32 %12 to i16
ret i16 %13
}

LLVM IR (-O2):
define zeroext i16 @int16_be_at(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = zext i8 %2 to i16
%4 = shl nuw i16 %3, 8
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = load i8, i8* %5
%7 = zext i8 %6 to i16
%8 = or i16 %4, %7
ret i16 %8
}
/* Variables and functions */
char log(char);
char internal_log_b(char value) { return log(value); }


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

x86 assembly (clang, -O2):
<internal_log_b>:
jmp    1030 <log@plt>

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

LLVM IR (-O2):
define signext i8 @internal_log_b(i8 signext %0) {
%2 = tail call signext i8 @log(i8 signext %0)
ret i8 %2
}
/* Variables and functions */
void *malloc(size_t);
void *calloc(size_t nmemb, size_t size) {
__ESBMC_HIDE:;
  size_t total_size = nmemb * size;
  void *res = malloc(total_size);
  return res;
}


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

x86 assembly (clang, -O2):
<calloc>:
imul   %rsi,%rdi
jmp    1030 <malloc@plt>

LLVM IR (-O0):
define i8* @calloc(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
%6 = alloca i8*
store i64 %0, i64* %3
store i64 %1, i64* %4
br label %7
7: ; preds = %2
%8 = load i64, i64* %3
%9 = load i64, i64* %4
%10 = mul i64 %8, %9
store i64 %10, i64* %5
%11 = load i64, i64* %5
%12 = call i8* @malloc(i64 %11)
store i8* %12, i8** %6
%13 = load i8*, i8** %6
ret i8* %13
}

LLVM IR (-O2):
define noalias i8* @calloc(i64 %0, i64 %1) {
%3 = mul i64 %1, %0
%4 = tail call i8* @malloc(i64 %3)
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ idris2_writeLine(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stdout;
void idris2_putStr(char *f) { idris2_writeLine(stdout, f); }


x86 assembly (clang, -O0):
<idris2_putStr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rsi
call   1030 <idris2_writeLine@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<idris2_putStr>:
mov    %rdi,%rsi
mov    0x2ec6(%rip),%rax
mov    (%rax),%edi
jmp    1030 <idris2_writeLine@plt>

LLVM IR (-O0):
@stdout = global i32 0
define void @idris2_putStr(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stdout
%4 = load i8*, i8** %2
%5 = call i32 @idris2_writeLine(i32 %3, i8* %4)
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
define void @idris2_putStr(i8* %0) {
%2 = load i32, i32* @stdout
%3 = tail call i32 @idris2_writeLine(i32 %2, i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int main(int argc, char *argv[]) {
  printf("this does nothing yet. I'm hopeful though...\n");
  exit(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)
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

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

LLVM IR (-O0):
@.str = [46 x i8] c"this does nothing yet. I'm hopeful though...\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 @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@str = [45 x i8] c"this does nothing yet. I'm hopeful though...\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([45 x i8], [45 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @exit(i32 0)
unreachable
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ memcpy(int /*<<< orphan*/ *, int /*<<< orphan*/ *, int);
void c2sM(uint8_t *c, uint16_t *s) {
  memcpy(s, c, sizeof(uint16_t));
  return;
}


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

x86 assembly (clang, -O2):
<c2sM>:
mov    %rdi,%rax
mov    %rsi,%rdi
mov    %rax,%rsi
mov    $0x4,%edx
jmp    1030 <memcpy@plt>

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

LLVM IR (-O2):
define void @c2sM(i32* %0, i32* %1) {
%3 = tail call i32 @memcpy(i32* %1, i32* %0, i32 4)
ret void
}
/* Variables and functions */
int *do_an_allocation();
int /*<<< orphan*/ free_an_allocation(int *);
int main(int argc, char *argv[]) {
  int *ptr = do_an_allocation();
  free_an_allocation(ptr);
  free_an_allocation(ptr);
  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)
mov    $0x0,%al
call   1040 <do_an_allocation@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <free_an_allocation@plt>
mov    -0x18(%rbp),%rdi
call   1030 <free_an_allocation@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1040 <do_an_allocation@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1030 <free_an_allocation@plt>
mov    %rbx,%rdi
call   1030 <free_an_allocation@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
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
%7 = call i32* (...) @do_an_allocation()
store i32* %7, i32** %6
%8 = load i32*, i32** %6
%9 = call i32 @free_an_allocation(i32* %8)
%10 = load i32*, i32** %6
%11 = call i32 @free_an_allocation(i32* %10)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32* (...) @do_an_allocation()
%4 = tail call i32 @free_an_allocation(i32* %3)
%5 = tail call i32 @free_an_allocation(i32* %3)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void ofi_freealign(void *memptr) { free(memptr); }


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

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

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

LLVM IR (-O2):
define void @ofi_freealign(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
void kbase_timeline_pm_l2_transition_done(struct kbase_device *kbdev) {}


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

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

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

LLVM IR (-O2):
%struct.kbase_device = type opaque
define void @kbase_timeline_pm_l2_transition_done(%struct.kbase_device* nocapture %0) {
ret void
}
void writeData(volatile unsigned int *data, int value) {
  for (int i = 0; i < 0x4000000; i++)
    *(data++) = value;
}


x86 assembly (clang, -O0):
<writeData>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
cmpl   $0x4000000,-0x10(%rbp)
jge    1141 <writeData+0x41>
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x4,%rdx
mov    %rdx,-0x8(%rbp)
mov    %ecx,(%rax)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1112 <writeData+0x12>
pop    %rbp
ret

x86 assembly (clang, -O2):
<writeData>:
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %esi,(%rdi,%rax,4)
mov    %esi,0x4(%rdi,%rax,4)
mov    %esi,0x8(%rdi,%rax,4)
mov    %esi,0xc(%rdi,%rax,4)
mov    %esi,0x10(%rdi,%rax,4)
mov    %esi,0x14(%rdi,%rax,4)
mov    %esi,0x18(%rdi,%rax,4)
mov    %esi,0x1c(%rdi,%rax,4)
add    $0x8,%rax
cmp    $0x4000000,%eax
jne    1110 <writeData+0x10>
ret

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

LLVM IR (-O2):
define void @writeData(i32* %0, i32 %1) {
br label %4
3: ; preds = %4
ret void
4: ; preds = %4, %2
%5 = phi i32 [ 0, %2 ], [ %15, %4 ]
%6 = phi i32* [ %0, %2 ], [ %14, %4 ]
%7 = getelementptr inbounds i32, i32* %6, i64 1
store volatile i32 %1, i32* %6
%8 = getelementptr inbounds i32, i32* %6, i64 2
store volatile i32 %1, i32* %7
%9 = getelementptr inbounds i32, i32* %6, i64 3
store volatile i32 %1, i32* %8
%10 = getelementptr inbounds i32, i32* %6, i64 4
store volatile i32 %1, i32* %9
%11 = getelementptr inbounds i32, i32* %6, i64 5
store volatile i32 %1, i32* %10
%12 = getelementptr inbounds i32, i32* %6, i64 6
store volatile i32 %1, i32* %11
%13 = getelementptr inbounds i32, i32* %6, i64 7
store volatile i32 %1, i32* %12
%14 = getelementptr inbounds i32, i32* %6, i64 8
store volatile i32 %1, i32* %13
%15 = add nuw nsw i32 %5, 8
%16 = icmp eq i32 %15, 67108864
br i1 %16, label %3, label %4
}
/* Variables and functions */
size_t makeWcharsFromUtf8(char const *, int /*<<< orphan*/ *,
                          int /*<<< orphan*/);
size_t countUtf8Characters(const char *text) {
  return makeWcharsFromUtf8(text, NULL, 0);
}


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

x86 assembly (clang, -O2):
<countUtf8Characters>:
xor    %esi,%esi
xor    %edx,%edx
jmp    1030 <makeWcharsFromUtf8@plt>

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

LLVM IR (-O2):
define i64 @countUtf8Characters(i8* %0) {
%2 = tail call i64 @makeWcharsFromUtf8(i8* %0, i32* null, i32 0)
ret i64 %2
}
/* Type definitions */
struct v4l_fd {
  int dummy;
};
struct v4l2_format {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ VIDIOC_TRY_FMT;
int v4l_ioctl(struct v4l_fd *, int /*<<< orphan*/, struct v4l2_format *);
int v4l_try_fmt(struct v4l_fd *f, struct v4l2_format *fmt) {
  return v4l_ioctl(f, VIDIOC_TRY_FMT, fmt);
}


x86 assembly (clang, -O0):
<v4l_try_fmt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2eb5(%rip),%rax
mov    (%rax),%esi
mov    -0x10(%rbp),%rdx
call   1030 <v4l_ioctl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<v4l_try_fmt>:
mov    %rsi,%rdx
mov    0x2ec6(%rip),%rax
mov    (%rax),%esi
jmp    1030 <v4l_ioctl@plt>

LLVM IR (-O0):
%struct.v4l_fd = type { i32 }
%struct.v4l2_format = type { i32 }
@VIDIOC_TRY_FMT = global i32 0
define i32 @v4l_try_fmt(%struct.v4l_fd* %0, %struct.v4l2_format* %1) {
%3 = alloca %struct.v4l_fd*
%4 = alloca %struct.v4l2_format*
store %struct.v4l_fd* %0, %struct.v4l_fd** %3
store %struct.v4l2_format* %1, %struct.v4l2_format** %4
%5 = load %struct.v4l_fd*, %struct.v4l_fd** %3
%6 = load i32, i32* @VIDIOC_TRY_FMT
%7 = load %struct.v4l2_format*, %struct.v4l2_format** %4
%8 = call i32 @v4l_ioctl(%struct.v4l_fd* %5, i32 %6, %struct.v4l2_format* %7)
ret i32 %8
}

LLVM IR (-O2):
%struct.v4l_fd = type { i32 }
%struct.v4l2_format = type { i32 }
@VIDIOC_TRY_FMT = global i32 0
define i32 @v4l_try_fmt(%struct.v4l_fd* %0, %struct.v4l2_format* %1) {
%3 = load i32, i32* @VIDIOC_TRY_FMT
%4 = tail call i32 @v4l_ioctl(%struct.v4l_fd* %0, i32 %3, %struct.v4l2_format* %1)
ret i32 %4
}
double Tween_QuarticInEasing(double k) { return k * k * k * k; }


x86 assembly (clang, -O0):
<Tween_QuarticInEasing>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
mulsd  -0x8(%rbp),%xmm0
mulsd  -0x8(%rbp),%xmm0
mulsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<Tween_QuarticInEasing>:
movapd %xmm0,%xmm1
mulsd  %xmm0,%xmm1
mulsd  %xmm0,%xmm1
mulsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @Tween_QuarticInEasing(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = load double, double* %2
%5 = fmul double %3, %4
%6 = load double, double* %2
%7 = fmul double %5, %6
%8 = load double, double* %2
%9 = fmul double %7, %8
ret double %9
}

LLVM IR (-O2):
define double @Tween_QuarticInEasing(double %0) {
%2 = fmul double %0, %0
%3 = fmul double %2, %0
%4 = fmul double %3, %0
ret double %4
}