xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
long rul__sql_commit(void) {
  long sql_status;
  printf("\n Now in routine rul__sql_commit ... \n");
  return 1;
}


x86 assembly (clang, -O0):
<rul__sql_commit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [39 x i8] c"\0A Now in routine rul__sql_commit ... \0A\00"
define i64 @rul__sql_commit() {
%1 = alloca i64
%2 = call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0))
ret i64 1
}

LLVM IR (-O2):
@str = [38 x i8] c"\0A Now in routine rul__sql_commit ... \00"
define i64 @rul__sql_commit() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @str, i64 0, i64 0))
ret i64 1
}
int anyOddBit(int x) {
  int t = 0xAA;
  t = t | (t << 8);
  t = t | (t << 16);
  return !!(x & t);
}


x86 assembly (clang, -O0):
<anyOddBit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0xaa,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    -0x8(%rbp),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    -0x8(%rbp),%ecx
shl    $0x10,%ecx
or     %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
and    -0x8(%rbp),%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<anyOddBit>:
xor    %eax,%eax
test   $0xaaaaaaaa,%edi
setne  %al
ret

LLVM IR (-O0):
define i32 @anyOddBit(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 170, i32* %3
%4 = load i32, i32* %3
%5 = load i32, i32* %3
%6 = shl i32 %5, 8
%7 = or i32 %4, %6
store i32 %7, i32* %3
%8 = load i32, i32* %3
%9 = load i32, i32* %3
%10 = shl i32 %9, 16
%11 = or i32 %8, %10
store i32 %11, i32* %3
%12 = load i32, i32* %2
%13 = load i32, i32* %3
%14 = and i32 %12, %13
%15 = icmp ne i32 %14, 0
%16 = xor i1 %15, true
%17 = xor i1 %16, true
%18 = zext i1 %17 to i32
ret i32 %18
}

LLVM IR (-O2):
define i32 @anyOddBit(i32 %0) {
%2 = and i32 %0, -1431655766
%3 = icmp ne i32 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ root;
};
typedef TYPE_1__ XPointerMovedEvent;

/* Variables and functions */
unsigned long get_XPointerMovedEvent_root(void *_p) {
  return (unsigned long)((XPointerMovedEvent *)_p)->root;
}


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

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

LLVM IR (-O0):
%struct.TYPE_2__ = type { i64 }
define i64 @get_XPointerMovedEvent_root(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.TYPE_2__*
%5 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %4, i32 0, i32 0
%6 = load i64, i64* %5
ret i64 %6
}

LLVM IR (-O2):
define i64 @get_XPointerMovedEvent_root(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
ret i64 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int /*<<< orphan*/ be64toh(int /*<<< orphan*/);
void in8(uint64_t *x) { *x = be64toh(*x); }


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

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

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

LLVM IR (-O2):
define void @in8(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = tail call i32 @be64toh(i32 %2)
store i32 %3, i32* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(int **);
void freeIntMatrixInline(int **matrix) { free(matrix); }


x86 assembly (clang, -O0):
<freeIntMatrixInline>:
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):
<freeIntMatrixInline>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @freeIntMatrixInline(i32** nocapture %0) {
%2 = tail call i32 @free(i32** %0)
ret void
}
void idr_remove(void) { nsc_assert(0, __func__); }


x86 assembly (clang, -O0):
<idr_remove>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
lea    0xee3(%rip),%rsi
mov    $0x0,%al
call   1030 <nsc_assert@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<idr_remove>:
lea    0xee9(%rip),%rsi
xor    %edi,%edi
xor    %eax,%eax
jmp    1030 <nsc_assert@plt>

LLVM IR (-O0):
@__func__.idr_remove = [11 x i8] c"idr_remove\00"
define void @idr_remove() {
%1 = call i32 (i32, i8*, ...) bitcast (i32 (...)* @nsc_assert to i32 (i32, i8*, ...)*)(i32 0, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @__func__.idr_remove, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@__func__.idr_remove = [11 x i8] c"idr_remove\00"
define void @idr_remove() {
%1 = tail call i32 (i32, i8*, ...) bitcast (i32 (...)* @nsc_assert to i32 (i32, i8*, ...)*)(i32 0, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @__func__.idr_remove, i64 0, i64 0))
ret void
}
char to_lower(char ch) { return ch | 32; }


x86 assembly (clang, -O0):
<to_lower>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
or     $0x20,%eax
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<to_lower>:
mov    %edi,%eax
or     $0x20,%al
ret

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

LLVM IR (-O2):
define signext i8 @to_lower(i8 signext %0) {
%2 = or i8 %0, 32
ret i8 %2
}
/* Variables and functions */
int /*<<< orphan*/ printstr(char *);
int __attribute__((weak)) main(int argc, char **argv) {
  printstr("Implement main(), foo!\n");
  return -1;
}


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    0xed3(%rip),%rdi
call   1030 <printstr@plt>
mov    $0xffffffff,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [24 x i8] c"Implement main(), foo!\0A\00"
define weak 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 @printstr(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
ret i32 -1
}

LLVM IR (-O2):
@.str = [24 x i8] c"Implement main(), foo!\0A\00"
define weak i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @printstr(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  (void)fprintf(stderr, "quiz [-t] [-i file] category1 category2\n");
  exit(1);
}


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

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [41 x i8] c"quiz [-t] [-i file] category1 category2\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [41 x i8] c"quiz [-t] [-i file] category1 category2\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ foo();
int /*<<< orphan*/ printf(char *);
int main(int ac, char *av[]) {
  foo();
  printf("If you see this statement, it means that the buffer\n");
  printf("overflow never occurred.\n");
  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   1040 <foo@plt>
lea    0xebc(%rip),%rdi
call   1030 <printf@plt>
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [53 x i8] c"If you see this statement, it means that the buffer\0A\00"
@.str.1 = [26 x i8] c"overflow never occurred.\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 (...) @foo()
%7 = call i32 @printf(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [52 x i8] c"If you see this statement, it means that the buffer\00"
@str.2 = [25 x i8] c"overflow never occurred.\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @foo()
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([52 x i8], [52 x i8]* @str, i64 0, i64 0))
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str.2, i64 0, i64 0))
ret i32 0
}
int cbe_sysreset_hack(void) { return 1; }


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

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

LLVM IR (-O0):
define i32 @cbe_sysreset_hack() {
ret i32 1
}

LLVM IR (-O2):
define i32 @cbe_sysreset_hack() {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
int strlen(char const *);
int print_string(const char *s) {
  printf("'%s'\n", s);
  return strlen(s);
}


x86 assembly (clang, -O0):
<print_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec9(%rip),%rdi
call   1040 <printf@plt>
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_string>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <strlen@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"'%s'\0A\00"
define i32 @print_string(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = load i8*, i8** %2
%6 = call i32 @strlen(i8* %5)
ret i32 %6
}

LLVM IR (-O2):
@.str = [6 x i8] c"'%s'\0A\00"
define i32 @print_string(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @strlen(i8* %0)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int, int);
main() {
  int i = 10, j = 9, k = 0;
  k = (i++) > (j++) ? (i++) : (j++);
  printf("%d %d %d", i, j, k);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xa,-0x8(%rbp)
movl   $0x9,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0x8(%rbp)
mov    -0xc(%rbp),%ecx
mov    %ecx,%edx
add    $0x1,%edx
mov    %edx,-0xc(%rbp)
cmp    %ecx,%eax
jle    1165 <main+0x55>
mov    -0x8(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0x8(%rbp)
mov    %eax,-0x14(%rbp)
jmp    1173 <main+0x63>
mov    -0xc(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0xc(%rbp)
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
lea    0xe77(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [9 x i8] c"%d %d %d\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 12, i32 10, i32 11)
ret i32 0
}
/* Variables and functions */
void *Cyc_BansheeIf_composite_constraint(unsigned int, void *,
                                         int /*<<< orphan*/);
void *Cyc_BansheeIf_not_constraint(void *b) {
  void *_T0;
  _T0 = Cyc_BansheeIf_composite_constraint(2U, b, 0);
  return _T0;
}


x86 assembly (clang, -O0):
<Cyc_BansheeIf_not_constraint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
mov    $0x2,%edi
xor    %edx,%edx
call   1030 <Cyc_BansheeIf_composite_constraint@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Cyc_BansheeIf_not_constraint>:
mov    %rdi,%rsi
mov    $0x2,%edi
xor    %edx,%edx
jmp    1030 <Cyc_BansheeIf_composite_constraint@plt>

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

LLVM IR (-O2):
define i8* @Cyc_BansheeIf_not_constraint(i8* %0) {
%2 = tail call i8* @Cyc_BansheeIf_composite_constraint(i32 2, i8* %0, i32 0)
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int helloWorld() {
  printf("HelloWorld, %d\n", 1);
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [16 x i8] c"HelloWorld, %d\0A\00"
define i32 @helloWorld() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ free(double *);
void dvector_free(double *v) {
  free(v);
  return;
}


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

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

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

LLVM IR (-O2):
define void @dvector_free(double* nocapture %0) {
%2 = tail call i32 @free(double* %0)
ret void
}
/* Variables and functions */
unsigned long VIM_HAPI_GetCaptureLength();
unsigned long V5H_Capture_GetLength(void) {
  { return (VIM_HAPI_GetCaptureLength()); }
}


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

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

LLVM IR (-O0):
define i64 @V5H_Capture_GetLength() {
%1 = call i64 (...) @VIM_HAPI_GetCaptureLength()
ret i64 %1
}

LLVM IR (-O2):
define i64 @V5H_Capture_GetLength() {
%1 = tail call i64 (...) @VIM_HAPI_GetCaptureLength()
ret i64 %1
}
/* Variables and functions */
scalar_t__ RAND_MAX;
scalar_t__ rand();
float frand(float low, float high) {
  return low + ((high - low) * ((float)rand() / (float)RAND_MAX));
}


x86 assembly (clang, -O0):
<frand>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0x8(%rbp),%xmm0
subss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
movss  -0x10(%rbp),%xmm0
movss  -0xc(%rbp),%xmm1
cvtsi2ss %rax,%xmm2
mov    0x2e90(%rip),%rax
cvtsi2ssq (%rax),%xmm3
divss  %xmm3,%xmm2
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<frand>:
push   %rax
movss  %xmm0,0x4(%rsp)
subss  %xmm0,%xmm1
movss  %xmm1,(%rsp)
xor    %eax,%eax
call   1030 <rand@plt>
xorps  %xmm0,%xmm0
cvtsi2ss %rax,%xmm0
mov    0x2eb2(%rip),%rax
xorps  %xmm1,%xmm1
cvtsi2ssq (%rax),%xmm1
divss  %xmm1,%xmm0
mulss  (%rsp),%xmm0
addss  0x4(%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
@RAND_MAX = global i64 0
define float @frand(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = load float, float* %4
%7 = load float, float* %3
%8 = fsub float %6, %7
%9 = call i64 (...) @rand()
%10 = sitofp i64 %9 to float
%11 = load i64, i64* @RAND_MAX
%12 = sitofp i64 %11 to float
%13 = fdiv float %10, %12
%14 = call float @llvm.fmuladd.f32(float %8, float %13, float %5)
ret float %14
}

LLVM IR (-O2):
@RAND_MAX = global i64 0
define float @frand(float %0, float %1) {
%3 = fsub float %1, %0
%4 = tail call i64 (...) @rand()
%5 = sitofp i64 %4 to float
%6 = load i64, i64* @RAND_MAX
%7 = sitofp i64 %6 to float
%8 = fdiv float %5, %7
%9 = tail call float @llvm.fmuladd.f32(float %3, float %8, float %0)
ret float %9
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t rot32l13(uint32_t x) { return (x << 13) | (x >> 19); }


x86 assembly (clang, -O0):
<rot32l13>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0xd,%eax
mov    -0x4(%rbp),%ecx
sar    $0x13,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rot32l13>:
mov    %edi,%eax
shl    $0xd,%eax
sar    $0x13,%edi
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @rot32l13(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = shl i32 %3, 13
%5 = load i32, i32* %2
%6 = ashr i32 %5, 19
%7 = or i32 %4, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @rot32l13(i32 %0) {
%2 = shl i32 %0, 13
%3 = ashr i32 %0, 19
%4 = or i32 %2, %3
ret i32 %4
}
/* Variables and functions */
int strlen(char *);
void check_length(char *name) {
  if (strlen(name) > 80 - 1)
    name[80 - 1] = '\0';
}


x86 assembly (clang, -O0):
<check_length>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
cmp    $0x4f,%eax
jle    1136 <check_length+0x26>
mov    -0x8(%rbp),%rax
movb   $0x0,0x4f(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_length>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
cmp    $0x50,%eax
jl     1122 <check_length+0x12>
movb   $0x0,0x4f(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @check_length(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @strlen(i8* %3)
%5 = icmp sgt i32 %4, 79
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load i8*, i8** %2
%8 = getelementptr inbounds i8, i8* %7, i64 79
store i8 0, i8* %8
br label %9
9: ; preds = %6, %1
ret void
}

LLVM IR (-O2):
define void @check_length(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = icmp sgt i32 %2, 79
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = getelementptr inbounds i8, i8* %0, i64 79
store i8 0, i8* %5
br label %6
6: ; preds = %4, %1
ret void
}
void beep_spinup(void) {}


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

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

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

LLVM IR (-O2):
define void @beep_spinup() {
ret void
}
/* Variables and functions */
char *strdup(char const *);
char *gstrdup(const char *str) {
  if (!str)
    return NULL;
  return strdup(str);
}


x86 assembly (clang, -O0):
<gstrdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1134 <gstrdup+0x24>
movq   $0x0,-0x8(%rbp)
jmp    1141 <gstrdup+0x31>
mov    -0x10(%rbp),%rdi
call   1030 <strdup@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gstrdup>:
test   %rdi,%rdi
je     111a <gstrdup+0xa>
jmp    1030 <strdup@plt>
xor    %eax,%eax
ret

LLVM IR (-O0):
define i8* @gstrdup(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = icmp ne i8* %4, null
br i1 %5, label %7, label %6
6: ; preds = %1
store i8* null, i8** %2
br label %10
7: ; preds = %1
%8 = load i8*, i8** %3
%9 = call i8* @strdup(i8* %8)
store i8* %9, i8** %2
br label %10
10: ; preds = %7, %6
%11 = load i8*, i8** %2
ret i8* %11
}

LLVM IR (-O2):
define noalias i8* @gstrdup(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i8* @strdup(i8* %0)
br label %5
5: ; preds = %1, %3
%6 = phi i8* [ %4, %3 ], [ null, %1 ]
ret i8* %6
}
void apu_reset(struct APU *apu) { (void)apu; }


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

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

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

LLVM IR (-O2):
%struct.APU = type opaque
define void @apu_reset(%struct.APU* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int queen(int);
int main() {
  printf("%d\n", queen(4));
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 @queen(i32 4)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
s(y) { r(0, --y ? s(y), y : y); }


x86 assembly (clang, -O0):

:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
cmp    $0x0,%eax
je     1150 <s+0x30>
mov    -0x8(%rbp),%edi
call   1040 <s@plt>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1156 <s+0x36>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%esi
xor    %edi,%edi
mov    $0x0,%al
call   1030 <r@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):

:
push   %rbx
mov    %edi,%ebx
add    $0xffffffff,%ebx
je     112f <s+0xf>
mov    %ebx,%edi
call   1040 <s@plt>
xor    %edi,%edi
mov    %ebx,%esi
xor    %eax,%eax
pop    %rbx
jmp    1030 <r@plt>

LLVM IR (-O0):
define i32 @s(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = add nsw i32 %4, -1
store i32 %5, i32* %3
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %11
7: ; preds = %1
%8 = load i32, i32* %3
%9 = call i32 @s(i32 %8)
%10 = load i32, i32* %3
br label %13
11: ; preds = %1
%12 = load i32, i32* %3
br label %13
13: ; preds = %11, %7
%14 = phi i32 [ %10, %7 ], [ %12, %11 ]
%15 = call i32 (i32, i32, ...) bitcast (i32 (...)* @r to i32 (i32, i32, ...)*)(i32 0, i32 %14)
%16 = load i32, i32* %2
ret i32 %16
}

LLVM IR (-O2):
define i32 @s(i32 %0) {
%2 = add nsw i32 %0, -1
%3 = icmp eq i32 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @s(i32 %2)
br label %6
6: ; preds = %1, %4
%7 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @r to i32 (i32, i32, ...)*)(i32 0, i32 %2)
ret i32 undef
}
int glmMaxIndex2f(float a, float b, int i1, int i2) {
  if (a > b)
    return i1;
  return i2;
}


x86 assembly (clang, -O0):
<glmMaxIndex2f>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x8(%rbp)
movss  %xmm1,-0xc(%rbp)
mov    %edi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
movss  -0x8(%rbp),%xmm0
ucomiss -0xc(%rbp),%xmm0
jbe    112e <glmMaxIndex2f+0x2e>
mov    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1134 <glmMaxIndex2f+0x34>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<glmMaxIndex2f>:
ucomiss %xmm1,%xmm0
mov    %edi,%eax
cmovbe %esi,%eax
ret

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

LLVM IR (-O2):
define i32 @glmMaxIndex2f(float %0, float %1, i32 %2, i32 %3) {
%5 = fcmp ogt float %0, %1
%6 = select i1 %5, i32 %2, i32 %3
ret i32 %6
}
void llvm_gc_write(void *V, void *ObjPtr, void **FieldPtr) { *FieldPtr = V; }


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

x86 assembly (clang, -O2):
<llvm_gc_write>:
mov    %rdi,(%rdx)
ret

LLVM IR (-O0):
define void @llvm_gc_write(i8* %0, i8* %1, i8** %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8**
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8** %2, i8*** %6
%7 = load i8*, i8** %4
%8 = load i8**, i8*** %6
store i8* %7, i8** %8
ret void
}

LLVM IR (-O2):
define void @llvm_gc_write(i8* %0, i8* nocapture readnone %1, i8** nocapture writeonly %2) {
store i8* %0, i8** %2
ret void
}
int main() {
  volatile int *address = 0x64104004;
  *address = 0xbbbbbbbb;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    $0x64104004,%eax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movl   $0xbbbbbbbb,(%rax)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
movl   $0xbbbbbbbb,0x64104004
bb bb bb bb
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
store i32 0, i32* %1
store i32* inttoptr (i64 1678786564 to i32*), i32** %2
%3 = load i32*, i32** %2
store volatile i32 -1145324613, i32* %3
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
store volatile i32 -1145324613, i32* inttoptr (i64 1678786564 to i32*)
ret i32 0
}
/* Variables and functions */
char **malloc(int);
int /*<<< orphan*/ memcpy(char **, char const **, int);
char **argv_dup(int argc, const char **argv) {
  char **new_argv = malloc((argc + 1) * sizeof(*argv));
  memcpy(new_argv, argv, argc * sizeof(*argv));
  new_argv[argc] = NULL;
  return new_argv;
}


x86 assembly (clang, -O0):
<argv_dup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
cltq
shl    $0x3,%rax
mov    %eax,%edi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
movslq -0x4(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edx
call   1030 <memcpy@plt>
mov    -0x18(%rbp),%rax
movslq -0x4(%rbp),%rcx
movq   $0x0,(%rax,%rcx,8)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<argv_dup>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %edi,%ebx
lea    0x0(,%rbx,8),%r15d
lea    0x8(,%rbx,8),%edi
call   1040 <malloc@plt>
mov    %rax,%rbp
movslq %ebx,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
mov    %r15d,%edx
call   1030 <memcpy@plt>
movq   $0x0,0x0(%rbp,%rbx,8)
mov    %rbp,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i8** @argv_dup(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%6 = load i32, i32* %3
%7 = add nsw i32 %6, 1
%8 = sext i32 %7 to i64
%9 = mul i64 %8, 8
%10 = trunc i64 %9 to i32
%11 = call i8** @malloc(i32 %10)
store i8** %11, i8*** %5
%12 = load i8**, i8*** %5
%13 = load i8**, i8*** %4
%14 = load i32, i32* %3
%15 = sext i32 %14 to i64
%16 = mul i64 %15, 8
%17 = trunc i64 %16 to i32
%18 = call i32 @memcpy(i8** %12, i8** %13, i32 %17)
%19 = load i8**, i8*** %5
%20 = load i32, i32* %3
%21 = sext i32 %20 to i64
%22 = getelementptr inbounds i8*, i8** %19, i64 %21
store i8* null, i8** %22
%23 = load i8**, i8*** %5
ret i8** %23
}

LLVM IR (-O2):
define i8** @argv_dup(i32 %0, i8** %1) {
%3 = shl i32 %0, 3
%4 = add i32 %3, 8
%5 = tail call i8** @malloc(i32 %4)
%6 = sext i32 %0 to i64
%7 = tail call i32 @memcpy(i8** %5, i8** %1, i32 %3)
%8 = getelementptr inbounds i8*, i8** %5, i64 %6
store i8* null, i8** %8
ret i8** %5
}
int compare_int(int a, int b) {
  if (a == b) {
    return 0;
  } else if (a < b) {
    return -1;
  }
  return 1;
}


x86 assembly (clang, -O0):
<compare_int>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jne    1122 <compare_int+0x22>
movl   $0x0,-0x4(%rbp)
jmp    1146 <compare_int+0x46>
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    113a <compare_int+0x3a>
movl   $0xffffffff,-0x4(%rbp)
jmp    1146 <compare_int+0x46>
jmp    113f <compare_int+0x3f>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<compare_int>:
xor    %ecx,%ecx
xor    %eax,%eax
cmp    %esi,%edi
setge  %al
lea    -0x1(%rax,%rax,1),%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @compare_int(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, %1
%4 = icmp slt i32 %0, %1
%5 = select i1 %4, i32 -1, i32 1
%6 = select i1 %3, i32 0, i32 %5
ret i32 %6
}
/* Variables and functions */
scalar_t__ malloc(size_t);
int /*<<< orphan*/ snprintf(char *, size_t, char *, char *);
size_t strlen(char *);
char *createReponse(char *resp_template, char *arg) {
  char *resp;
  size_t len = strlen(resp_template) + strlen(arg);
  resp = (char *)malloc(len);
  snprintf(resp, len, resp_template, arg);
  return resp;
}


x86 assembly (clang, -O0):
<createReponse>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,%rcx
mov    -0x28(%rbp),%rax
add    %rcx,%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
call   1050 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
call   1040 <snprintf@plt>
mov    -0x18(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<createReponse>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%r15
call   1030 <strlen@plt>
mov    %rax,%rbx
mov    %r14,%rdi
call   1030 <strlen@plt>
add    %rax,%rbx
mov    %rbx,%rdi
call   1050 <malloc@plt>
mov    %rax,%r12
mov    %rax,%rdi
mov    %rbx,%rsi
mov    %r15,%rdx
mov    %r14,%rcx
call   1040 <snprintf@plt>
mov    %r12,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @createReponse(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = call i64 @strlen(i8* %7)
%9 = load i8*, i8** %4
%10 = call i64 @strlen(i8* %9)
%11 = add i64 %8, %10
store i64 %11, i64* %6
%12 = load i64, i64* %6
%13 = call i64 @malloc(i64 %12)
%14 = inttoptr i64 %13 to i8*
store i8* %14, i8** %5
%15 = load i8*, i8** %5
%16 = load i64, i64* %6
%17 = load i8*, i8** %3
%18 = load i8*, i8** %4
%19 = call i32 @snprintf(i8* %15, i64 %16, i8* %17, i8* %18)
%20 = load i8*, i8** %5
ret i8* %20
}

LLVM IR (-O2):
define i8* @createReponse(i8* %0, i8* %1) {
%3 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%4 = tail call i64 @strlen(i8* dereferenceable(1) %1)
%5 = add i64 %4, %3
%6 = tail call i64 @malloc(i64 %5)
%7 = inttoptr i64 %6 to i8*
%8 = tail call i32 @snprintf(i8* %7, i64 %5, i8* %0, i8* %1)
ret i8* %7
}
void delayacct_add_stats(struct taskstats *d, struct taskstats *s) {}


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

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

LLVM IR (-O0):
%struct.taskstats = type opaque
define void @delayacct_add_stats(%struct.taskstats* %0, %struct.taskstats* %1) {
%3 = alloca %struct.taskstats*
%4 = alloca %struct.taskstats*
store %struct.taskstats* %0, %struct.taskstats** %3
store %struct.taskstats* %1, %struct.taskstats** %4
ret void
}

LLVM IR (-O2):
%struct.taskstats = type opaque
define void @delayacct_add_stats(%struct.taskstats* nocapture %0, %struct.taskstats* nocapture %1) {
ret void
}
/* Variables and functions */
size_t strlen(char *);
char *appender(char *str, const char c) {
  size_t len = strlen(str);
  if (len < 256) {
    str[len + 1] = str[len];
    str[len] = c;
  }
  return str;
}


x86 assembly (clang, -O0):
<appender>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x100,-0x18(%rbp)
jae    1162 <appender+0x52>
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    (%rax,%rcx,1),%dl
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    %dl,0x1(%rax,%rcx,1)
mov    -0x9(%rbp),%dl
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<appender>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
call   1030 <strlen@plt>
cmp    $0xff,%rax
ja     1130 <appender+0x20>
mov    (%rbx,%rax,1),%cl
mov    %cl,0x1(%rbx,%rax,1)
mov    %bpl,(%rbx,%rax,1)
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i8* @appender(i8* %0, i8 signext %1) {
%3 = alloca i8*
%4 = alloca i8
%5 = alloca i64
store i8* %0, i8** %3
store i8 %1, i8* %4
%6 = load i8*, i8** %3
%7 = call i64 @strlen(i8* %6)
store i64 %7, i64* %5
%8 = load i64, i64* %5
%9 = icmp ult i64 %8, 256
br i1 %9, label %10, label %23
10: ; preds = %2
%11 = load i8*, i8** %3
%12 = load i64, i64* %5
%13 = getelementptr inbounds i8, i8* %11, i64 %12
%14 = load i8, i8* %13
%15 = load i8*, i8** %3
%16 = load i64, i64* %5
%17 = add i64 %16, 1
%18 = getelementptr inbounds i8, i8* %15, i64 %17
store i8 %14, i8* %18
%19 = load i8, i8* %4
%20 = load i8*, i8** %3
%21 = load i64, i64* %5
%22 = getelementptr inbounds i8, i8* %20, i64 %21
store i8 %19, i8* %22
br label %23
23: ; preds = %10, %2
%24 = load i8*, i8** %3
ret i8* %24
}

LLVM IR (-O2):
define i8* @appender(i8* returned %0, i8 signext %1) {
%3 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%4 = icmp ult i64 %3, 256
br i1 %4, label %5, label %10
5: ; preds = %2
%6 = getelementptr inbounds i8, i8* %0, i64 %3
%7 = load i8, i8* %6
%8 = add nuw nsw i64 %3, 1
%9 = getelementptr inbounds i8, i8* %0, i64 %8
store i8 %7, i8* %9
store i8 %1, i8* %6
br label %10
10: ; preds = %5, %2
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *, char *);
int /*<<< orphan*/ stderr;
void _usage(char *cmd) {
  fprintf(stderr, "Usage: %s [-I %s] <serial> [baudrate]\n", cmd, "sl0");
  fprintf(stderr, "Usage: %s [-I %s] tcp:<host> [port]\n", cmd, "sl0");
}


x86 assembly (clang, -O0):
<_usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xed0(%rip),%rsi
lea    0xef0(%rip),%rcx
call   1030 <fprintf@plt>
mov    0x2e9d(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xedb(%rip),%rsi
lea    0xed0(%rip),%rcx
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_usage>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%rbx
mov    0x2ec1(%rip),%r15
mov    (%r15),%edi
lea    0xed7(%rip),%rsi
lea    0xef7(%rip),%r14
mov    %rbx,%rdx
mov    %r14,%rcx
call   1030 <fprintf@plt>
mov    (%r15),%edi
lea    0xee6(%rip),%rsi
mov    %rbx,%rdx
mov    %r14,%rcx
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [39 x i8] c"Usage: %s [-I %s] <serial> [baudrate]\0A\00"
@.str.1 = [4 x i8] c"sl0\00"
@.str.2 = [37 x i8] c"Usage: %s [-I %s] tcp:<host> [port]\0A\00"
define void @_usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i8* %4, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%6 = load i32, i32* @stderr
%7 = load i8*, i8** %2
%8 = call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.2, i64 0, i64 0), i8* %7, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [39 x i8] c"Usage: %s [-I %s] <serial> [baudrate]\0A\00"
@.str.1 = [4 x i8] c"sl0\00"
@.str.2 = [37 x i8] c"Usage: %s [-I %s] tcp:<host> [port]\0A\00"
define void @_usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i8* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%4 = load i32, i32* @stderr
%5 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.2, i64 0, i64 0), i8* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _IONBF;
int /*<<< orphan*/ setvbuf(int /*<<< orphan*/, int /*<<< orphan*/ *,
                           int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ stdout;
__attribute__((constructor)) void init() {
  setvbuf(stdout, NULL, _IONBF, 0);
  setvbuf(stderr, NULL, _IONBF, 0);
}


x86 assembly (clang, -O0):
<init>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
mov    0x2ec4(%rip),%rax
mov    (%rax),%edx
xor    %eax,%eax
mov    %eax,%esi
xor    %ecx,%ecx
call   1030 <setvbuf@plt>
mov    0x2ea0(%rip),%rax
mov    (%rax),%edi
mov    0x2ea7(%rip),%rax
mov    (%rax),%edx
xor    %eax,%eax
mov    %eax,%esi
xor    %ecx,%ecx
call   1030 <setvbuf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<init>:
push   %rbx
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
mov    0x2ec7(%rip),%rbx
mov    (%rbx),%edx
xor    %esi,%esi
xor    %ecx,%ecx
call   1030 <setvbuf@plt>
mov    0x2ea5(%rip),%rax
mov    (%rax),%edi
mov    (%rbx),%edx
xor    %esi,%esi
xor    %ecx,%ecx
pop    %rbx
jmp    1030 <setvbuf@plt>

LLVM IR (-O0):
@stdout = global i32 0
@_IONBF = global i32 0
@stderr = global i32 0
@llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @init, i8* null }]
define void @init() {
%1 = load i32, i32* @stdout
%2 = load i32, i32* @_IONBF
%3 = call i32 @setvbuf(i32 %1, i32* null, i32 %2, i32 0)
%4 = load i32, i32* @stderr
%5 = load i32, i32* @_IONBF
%6 = call i32 @setvbuf(i32 %4, i32* null, i32 %5, i32 0)
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@_IONBF = global i32 0
@stderr = global i32 0
@llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @init, i8* null }]
define void @init() {
%1 = load i32, i32* @stdout
%2 = load i32, i32* @_IONBF
%3 = tail call i32 @setvbuf(i32 %1, i32* null, i32 %2, i32 0)
%4 = load i32, i32* @stderr
%5 = load i32, i32* @_IONBF
%6 = tail call i32 @setvbuf(i32 %4, i32* null, i32 %5, i32 0)
ret void
}
/* Type definitions */
struct UPnPService {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, unsigned int);
void RNDResponseSink_ContentDirectory_GetSystemUpdateID(
    struct UPnPService *Service, int ErrorCode, void *User, unsigned int Id) {
  printf("RND Invoke Response: "
         "ContentDirectory/GetSystemUpdateID[ErrorCode:%d](%u)\r\n",
         ErrorCode, Id);
}


x86 assembly (clang, -O0):
<RNDResponseSink_ContentDirectory_GetSystemUpdateID>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0xc(%rbp),%esi
mov    -0x1c(%rbp),%edx
lea    0xecd(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<RNDResponseSink_ContentDirectory_GetSystemUpdateID>:
lea    0xee9(%rip),%rdi
mov    %ecx,%edx
jmp    1030 <printf@plt>

LLVM IR (-O0):
%struct.UPnPService = type { i32 }
@.str = [76 x i8] c"RND Invoke Response: ContentDirectory/GetSystemUpdateID[ErrorCode:%d](%u)\0D\0A\00"
define void @RNDResponseSink_ContentDirectory_GetSystemUpdateID(%struct.UPnPService* %0, i32 %1, i8* %2, i32 %3) {
%5 = alloca %struct.UPnPService*
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i32
store %struct.UPnPService* %0, %struct.UPnPService** %5
store i32 %1, i32* %6
store i8* %2, i8** %7
store i32 %3, i32* %8
%9 = load i32, i32* %6
%10 = load i32, i32* %8
%11 = call i32 @printf(i8* getelementptr inbounds ([76 x i8], [76 x i8]* @.str, i64 0, i64 0), i32 %9, i32 %10)
ret void
}

LLVM IR (-O2):
%struct.UPnPService = type { i32 }
@.str = [76 x i8] c"RND Invoke Response: ContentDirectory/GetSystemUpdateID[ErrorCode:%d](%u)\0D\0A\00"
define void @RNDResponseSink_ContentDirectory_GetSystemUpdateID(%struct.UPnPService* nocapture readnone %0, i32 %1, i8* nocapture readnone %2, i32 %3) {
%5 = tail call i32 @printf(i8* getelementptr inbounds ([76 x i8], [76 x i8]* @.str, i64 0, i64 0), i32 %1, i32 %3)
ret void
}
float _f_rintf(float x) {
  float _result;
  asm("frndint" : "=t"(_result) : "0"(x));
  return _result;
}


x86 assembly (clang, -O0):
<_f_rintf>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
flds   -0xc(%rbp)
frndint
fstps  -0x10(%rbp)
movss  -0x10(%rbp),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<_f_rintf>:
movss  %xmm0,-0x4(%rsp)
flds   -0x4(%rsp)
frndint
fstps  -0x8(%rsp)
movss  -0x8(%rsp),%xmm0
ret

LLVM IR (-O0):
define float @_f_rintf(float %0) {
%2 = alloca float
%3 = alloca float
store float %0, float* %2
%4 = load float, float* %2
%5 = call float asm "frndint", "={st},0,~{dirflag},~{fpsr},~{flags}"(float %4)
store float %5, float* %3
%6 = load float, float* %3
ret float %6
}

LLVM IR (-O2):
define float @_f_rintf(float %0) {
%2 = tail call float asm "frndint", "={st},0,~{dirflag},~{fpsr},~{flags}"(float %0)
ret float %2
}
/* Variables and functions */
int /*<<< orphan*/ USB_OTG2_DriverIRQHandler();
__attribute__((weak)) void USB_OTG2_IRQHandler(void) {
  USB_OTG2_DriverIRQHandler();
}


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

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

LLVM IR (-O0):
define weak void @USB_OTG2_IRQHandler() {
%1 = call i32 (...) @USB_OTG2_DriverIRQHandler()
ret void
}

LLVM IR (-O2):
define weak void @USB_OTG2_IRQHandler() {
%1 = tail call i32 (...) @USB_OTG2_DriverIRQHandler()
ret void
}
char *ERR_error_string(int errval, char *err_buf) {
  errval = 0;
  return (err_buf);
}


x86 assembly (clang, -O0):
<ERR_error_string>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x4(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ERR_error_string>:
mov    %rsi,%rax
ret

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

LLVM IR (-O2):
define i8* @ERR_error_string(i32 %0, i8* readnone returned %1) {
ret i8* %1
}
unsigned long SIO1_readCtrl32(void) { return 0; }


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

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

LLVM IR (-O0):
define i64 @SIO1_readCtrl32() {
ret i64 0
}

LLVM IR (-O2):
define i64 @SIO1_readCtrl32() {
ret i64 0
}