xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ stderr;
void syntax(char const *msg) {
  fprintf(stderr, "%s\n", msg);
  fprintf(stderr, "Usage: bin2load [-a] -f inputFile -o outputFile [-b load "
                  "address (octal)] \n");
  exit(128);
}


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

x86 assembly (clang, -O2):
<syntax>:
push   %rbx
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rbx
mov    (%rbx),%edi
lea    0xecc(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xec0(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    $0x80,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [76 x i8] c"Usage: bin2load [-a] -f inputFile -o outputFile [-b load address (octal)] \0A\00"
define void @syntax(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 (i32, i8*, ...) @fprintf(i32 %3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = load i32, i32* @stderr
%7 = call i32 (i32, i8*, ...) @fprintf(i32 %6, i8* getelementptr inbounds ([76 x i8], [76 x i8]* @.str.1, i64 0, i64 0))
%8 = call i32 @exit(i32 128)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [76 x i8] c"Usage: bin2load [-a] -f inputFile -o outputFile [-b load address (octal)] \0A\00"
define void @syntax(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 (i32, i8*, ...) @fprintf(i32 %2, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = load i32, i32* @stderr
%5 = tail call i32 (i32, i8*, ...) @fprintf(i32 %4, i8* getelementptr inbounds ([76 x i8], [76 x i8]* @.str.1, i64 0, i64 0))
%6 = tail call i32 @exit(i32 128)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ FLEXCOMM1_DriverIRQHandler();
__attribute__((weak)) void FLEXCOMM1_IRQHandler(void) {
  FLEXCOMM1_DriverIRQHandler();
}


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

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

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

LLVM IR (-O2):
define weak void @FLEXCOMM1_IRQHandler() {
%1 = tail call i32 (...) @FLEXCOMM1_DriverIRQHandler()
ret void
}
/* Type definitions */
struct ubi_volume_desc {
  int dummy;
};

/* Variables and functions */
int ubi_leb_change(struct ubi_volume_desc *, int, void const *, int);
int ubi_change(struct ubi_volume_desc *desc, int lnum, const void *buf,
               int len) {
  return ubi_leb_change(desc, lnum, buf, len);
}


x86 assembly (clang, -O0):
<ubi_change>:
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    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
call   1030 <ubi_leb_change@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ubi_change>:
jmp    1030 <ubi_leb_change@plt>

LLVM IR (-O0):
%struct.ubi_volume_desc = type { i32 }
define i32 @ubi_change(%struct.ubi_volume_desc* %0, i32 %1, i8* %2, i32 %3) {
%5 = alloca %struct.ubi_volume_desc*
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i32
store %struct.ubi_volume_desc* %0, %struct.ubi_volume_desc** %5
store i32 %1, i32* %6
store i8* %2, i8** %7
store i32 %3, i32* %8
%9 = load %struct.ubi_volume_desc*, %struct.ubi_volume_desc** %5
%10 = load i32, i32* %6
%11 = load i8*, i8** %7
%12 = load i32, i32* %8
%13 = call i32 @ubi_leb_change(%struct.ubi_volume_desc* %9, i32 %10, i8* %11, i32 %12)
ret i32 %13
}

LLVM IR (-O2):
%struct.ubi_volume_desc = type { i32 }
define i32 @ubi_change(%struct.ubi_volume_desc* %0, i32 %1, i8* %2, i32 %3) {
%5 = tail call i32 @ubi_leb_change(%struct.ubi_volume_desc* %0, i32 %1, i8* %2, i32 %3)
ret i32 %5
}
/* Variables and functions */
int strcmp(char const *, char const *);
int cmpstr(const void *a, const void *b) {
  const char *aa = *(const char **)a;
  const char *bb = *(const char **)b;
  return strcmp(aa, bb);
}


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

x86 assembly (clang, -O2):
<cmpstr>:
mov    (%rdi),%rdi
mov    (%rsi),%rsi
jmp    1030 <strcmp@plt>

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

LLVM IR (-O2):
define i32 @cmpstr(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i8**
%4 = load i8*, i8** %3
%5 = bitcast i8* %1 to i8**
%6 = load i8*, i8** %5
%7 = tail call i32 @strcmp(i8* dereferenceable(1) %4, i8* dereferenceable(1) %6)
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ O_RDWR;
int open(char *, int /*<<< orphan*/);
int function_x(void) { int fd = open("Any_file", O_RDWR); }


x86 assembly (clang, -O0):
<function_x>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ec9(%rip),%rax
mov    (%rax),%esi
lea    0xed8(%rip),%rdi
call   1030 <open@plt>
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<function_x>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%esi
lea    0xee0(%rip),%rdi
jmp    1030 <open@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"Any_file\00"
@O_RDWR = global i32 0
define i32 @function_x() {
%1 = alloca i32
%2 = alloca i32
%3 = load i32, i32* @O_RDWR
%4 = call i32 @open(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %3)
store i32 %4, i32* %2
%5 = load i32, i32* %1
ret i32 %5
}

LLVM IR (-O2):
@.str = [9 x i8] c"Any_file\00"
@O_RDWR = global i32 0
define i32 @function_x() {
%1 = load i32, i32* @O_RDWR
%2 = tail call i32 @open(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 undef
}
void add(p, s, sz) struct h8_opcode *p;
char *s;
int sz;
{ printf("%s;\n", s); }


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

x86 assembly (clang, -O2):
<add>:
lea    0xee9(%rip),%rdi
xor    %eax,%eax
jmp    1030 <printf@plt>

LLVM IR (-O0):
%struct.h8_opcode = type opaque
@.str = [5 x i8] c"%s;\0A\00"
define void @add(%struct.h8_opcode* %0, i8* %1, i32 %2) {
%4 = alloca %struct.h8_opcode*
%5 = alloca i8*
%6 = alloca i32
store %struct.h8_opcode* %0, %struct.h8_opcode** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i8*, i8** %5
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %7)
ret void
}

LLVM IR (-O2):
%struct.h8_opcode = type opaque
@.str = [5 x i8] c"%s;\0A\00"
define void @add(%struct.h8_opcode* nocapture readnone %0, i8* %1, i32 %2) {
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %1)
ret void
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  int width_inc;
};
typedef TYPE_1__ XSizeHints;

/* Variables and functions */
void set_XSizeHints_width_inc(void *_p, int _v) {
  ((XSizeHints *)_p)->width_inc = (int)_v;
}


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

x86 assembly (clang, -O2):
<set_XSizeHints_width_inc>:
mov    %esi,(%rdi)
ret

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

LLVM IR (-O2):
define void @set_XSizeHints_width_inc(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
store i32 %1, i32* %3
ret void
}
void X509_print_ex_fp(void) {}


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

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

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

LLVM IR (-O2):
define void @X509_print_ex_fp() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ debug(int, char *);
scalar_t__ malloc(int);
int *mallocedInt(int a) {
  int *mInt = (int *)malloc(sizeof(int));
  if (mInt != NULL) {
    *mInt = a;
    return mInt;
  } else {
    debug(2, "malloc returned NULL\n");
    return mallocedInt(a);
  }
}


x86 assembly (clang, -O0):
<mallocedInt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0xc(%rbp)
mov    $0x4,%edi
call   1050 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     116a <mallocedInt+0x3a>
mov    -0xc(%rbp),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1187 <mallocedInt+0x57>
mov    $0x2,%edi
lea    0xe8a(%rip),%rsi
call   1040 <debug@plt>
mov    -0xc(%rbp),%edi
call   1030 <mallocedInt@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mallocedInt>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebp
mov    $0x4,%edi
call   1040 <malloc@plt>
test   %rax,%rax
jne    115c <mallocedInt+0x3c>
lea    0xec5(%rip),%rbx
nopl   0x0(%rax,%rax,1)
mov    $0x2,%edi
mov    %rbx,%rsi
call   1030 <debug@plt>
mov    $0x4,%edi
call   1040 <malloc@plt>
test   %rax,%rax
je     1140 <mallocedInt+0x20>
mov    %ebp,(%rax)
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [22 x i8] c"malloc returned NULL\0A\00"
define i32* @mallocedInt(i32 %0) {
%2 = alloca i32*
%3 = alloca i32
%4 = alloca i32*
store i32 %0, i32* %3
%5 = call i64 @malloc(i32 4)
%6 = inttoptr i64 %5 to i32*
store i32* %6, i32** %4
%7 = load i32*, i32** %4
%8 = icmp ne i32* %7, null
br i1 %8, label %9, label %13
9: ; preds = %1
%10 = load i32, i32* %3
%11 = load i32*, i32** %4
store i32 %10, i32* %11
%12 = load i32*, i32** %4
store i32* %12, i32** %2
br label %17
13: ; preds = %1
%14 = call i32 @debug(i32 2, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%15 = load i32, i32* %3
%16 = call i32* @mallocedInt(i32 %15)
store i32* %16, i32** %2
br label %17
17: ; preds = %13, %9
%18 = load i32*, i32** %2
ret i32* %18
}

LLVM IR (-O2):
@.str = [22 x i8] c"malloc returned NULL\0A\00"
define i32* @mallocedInt(i32 %0) {
%2 = tail call i64 @malloc(i32 4)
%3 = icmp eq i64 %2, 0
br i1 %3, label %7, label %4
4: ; preds = %7, %1
%5 = phi i64 [ %2, %1 ], [ %9, %7 ]
%6 = inttoptr i64 %5 to i32*
store i32 %0, i32* %6
ret i32* %6
7: ; preds = %1, %7
%8 = tail call i32 @debug(i32 2, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%9 = tail call i64 @malloc(i32 4)
%10 = icmp eq i64 %9, 0
br i1 %10, label %7, label %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int controllo_matrice_nulla(int **matrice) {
  int esito_booleano_allocazione = 1;
  if (matrice == NULL) {
    printf("Attenzione, non è stato possibile allocare lo spazio in memoria "
           "per la matrice!");
    esito_booleano_allocazione = 0;
  }
  return (esito_booleano_allocazione);
}


x86 assembly (clang, -O0):
<controllo_matrice_nulla>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1141 <controllo_matrice_nulla+0x31>
lea    0xecb(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<controllo_matrice_nulla>:
mov    $0x1,%eax
test   %rdi,%rdi
je     111b <controllo_matrice_nulla+0xb>
ret
push   %rax
lea    0xedd(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
ret

LLVM IR (-O0):
@.str = [81 x i8] c"Attenzione, non \C3\A8 stato possibile allocare lo spazio in memoria per la matrice!\00"
define i32 @controllo_matrice_nulla(i32** %0) {
%2 = alloca i32**
%3 = alloca i32
store i32** %0, i32*** %2
store i32 1, i32* %3
%4 = load i32**, i32*** %2
%5 = icmp eq i32** %4, null
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = call i32 @printf(i8* getelementptr inbounds ([81 x i8], [81 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %3
br label %8
8: ; preds = %6, %1
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
@.str = [81 x i8] c"Attenzione, non \C3\A8 stato possibile allocare lo spazio in memoria per la matrice!\00"
define i32 @controllo_matrice_nulla(i32** readnone %0) {
%2 = icmp eq i32** %0, null
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([81 x i8], [81 x i8]* @.str, i64 0, i64 0))
br label %5
5: ; preds = %3, %1
%6 = phi i32 [ 0, %3 ], [ 1, %1 ]
ret i32 %6
}
int test8(int h) { return (h & -2) | 1; }


x86 assembly (clang, -O0):
<test8>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xfffffffe,%eax
or     $0x1,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test8(i32 %0) {
%2 = or i32 %0, 1
ret i32 %2
}
/* Variables and functions */
int encode_mime_type(char *, int, unsigned int, char *);
int encode_content_type(char *hdrstart, int hdrlen, unsigned int bodi,
                        char *where) {
  return encode_mime_type(hdrstart, hdrlen, bodi, where);
}


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

x86 assembly (clang, -O2):
<encode_content_type>:
jmp    1030 <encode_mime_type@plt>

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

LLVM IR (-O2):
define i32 @encode_content_type(i8* %0, i32 %1, i32 %2, i8* %3) {
%5 = tail call i32 @encode_mime_type(i8* %0, i32 %1, i32 %2, i8* %3)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ atoi(char *);
unsigned long integer_new(int /*<<< orphan*/);
char *str2cstr(unsigned long);
unsigned long int string_to_i(unsigned long int self) {
  char *ptr;
  ptr = str2cstr(self);
  return integer_new(atoi(ptr));
}


x86 assembly (clang, -O0):
<string_to_i>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <str2cstr@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <atoi@plt>
mov    %eax,%edi
call   1030 <integer_new@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<string_to_i>:
push   %rax
call   1040 <str2cstr@plt>
mov    %rax,%rdi
call   1050 <atoi@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <integer_new@plt>

LLVM IR (-O0):
define i64 @string_to_i(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @str2cstr(i64 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = call i32 @atoi(i8* %6)
%8 = call i64 @integer_new(i32 %7)
ret i64 %8
}

LLVM IR (-O2):
define i64 @string_to_i(i64 %0) {
%2 = tail call i8* @str2cstr(i64 %0)
%3 = tail call i32 @atoi(i8* %2)
%4 = tail call i64 @integer_new(i32 %3)
ret i64 %4
}
int test_imm_75uint64_midword_reg(unsigned long long val) {
  return ((val >> 16) & (0x75 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_75uint64_midword_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
shr    $0x10,%rdx
and    $0x75,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_75uint64_midword_reg>:
test   $0x750000,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_75uint64_midword_reg(i64 %0) {
%2 = and i64 %0, 7667712
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
void gtk_about_dialog_get_copyright() {}


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

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

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

LLVM IR (-O2):
define void @gtk_about_dialog_get_copyright() {
ret void
}
void copy_bin() {}


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

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

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

LLVM IR (-O2):
define void @copy_bin() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Insertion_Sort(int *, int);
int /*<<< orphan*/ Print_Array(int *, int);
int main() {
  int array[] = {2, 4, 3, 1, 6, 8, 4};
  Insertion_Sort(array, 7);
  Print_Array(array, 7);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xec7(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xec4(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0xec2(%rip),%eax
mov    %eax,-0x8(%rbp)
lea    -0x20(%rbp),%rdi
mov    $0x7,%esi
call   1040 <Insertion_Sort@plt>
lea    -0x20(%rbp),%rdi
mov    $0x7,%esi
call   1030 <Print_Array@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x20,%rsp
movups 0xee0(%rip),%xmm0
movups %xmm0,0xc(%rsp)
movaps 0xec8(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x7,%esi
call   1040 <Insertion_Sort@plt>
mov    %rbx,%rdi
mov    $0x7,%esi
call   1030 <Print_Array@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.array = [7 x i32] [i32 2, i32 4, i32 3, i32 1, i32 6, i32 8, i32 4]
define i32 @main() {
%1 = alloca i32
%2 = alloca [7 x i32]
store i32 0, i32* %1
%3 = bitcast [7 x i32]* %2 to i8*
%4 = getelementptr inbounds [7 x i32], [7 x i32]* %2, i64 0, i64 0
%5 = call i32 @Insertion_Sort(i32* %4, i32 7)
%6 = getelementptr inbounds [7 x i32], [7 x i32]* %2, i64 0, i64 0
%7 = call i32 @Print_Array(i32* %6, i32 7)
ret i32 0
}

LLVM IR (-O2):
@__const.main.array = [7 x i32] [i32 2, i32 4, i32 3, i32 1, i32 6, i32 8, i32 4]
define i32 @main() {
%1 = alloca [7 x i32]
%2 = bitcast [7 x i32]* %1 to i8*
%3 = getelementptr inbounds [7 x i32], [7 x i32]* %1, i64 0, i64 0
%4 = call i32 @Insertion_Sort(i32* %3, i32 7)
%5 = call i32 @Print_Array(i32* %3, i32 7)
ret i32 0
}
/* Variables and functions */
scalar_t__ dlsym(void *, char *);
int wsrep_check_iface_version(char *, char *);
int wsrep_check_version_symbol(void *dlh) {
  char **dlversion = NULL;
  dlversion = (char **)dlsym(dlh, "wsrep_interface_version");
  if (dlversion == NULL)
    return 0;
  return wsrep_check_iface_version(*dlversion, "27dev");
}


x86 assembly (clang, -O0):
<wsrep_check_version_symbol>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xec1(%rip),%rsi
call   1040 <dlsym@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    115f <wsrep_check_version_symbol+0x3f>
movl   $0x0,-0x4(%rbp)
jmp    1175 <wsrep_check_version_symbol+0x55>
mov    -0x18(%rbp),%rax
mov    (%rax),%rdi
lea    0xeab(%rip),%rsi
call   1030 <wsrep_check_iface_version@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wsrep_check_version_symbol>:
push   %rax
lea    0xed8(%rip),%rsi
call   1040 <dlsym@plt>
test   %rax,%rax
je     1142 <wsrep_check_version_symbol+0x22>
mov    (%rax),%rdi
lea    0xedc(%rip),%rsi
pop    %rax
jmp    1030 <wsrep_check_iface_version@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [24 x i8] c"wsrep_interface_version\00"
@.str.1 = [6 x i8] c"27dev\00"
define i32 @wsrep_check_version_symbol(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i8**
store i8* %0, i8** %3
store i8** null, i8*** %4
%5 = load i8*, i8** %3
%6 = call i64 @dlsym(i8* %5, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%7 = inttoptr i64 %6 to i8**
store i8** %7, i8*** %4
%8 = load i8**, i8*** %4
%9 = icmp eq i8** %8, null
br i1 %9, label %10, label %11
10: ; preds = %1
store i32 0, i32* %2
br label %15
11: ; preds = %1
%12 = load i8**, i8*** %4
%13 = load i8*, i8** %12
%14 = call i32 @wsrep_check_iface_version(i8* %13, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
store i32 %14, i32* %2
br label %15
15: ; preds = %11, %10
%16 = load i32, i32* %2
ret i32 %16
}

LLVM IR (-O2):
@.str = [24 x i8] c"wsrep_interface_version\00"
@.str.1 = [6 x i8] c"27dev\00"
define i32 @wsrep_check_version_symbol(i8* %0) {
%2 = tail call i64 @dlsym(i8* %0, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i64 %2, 0
br i1 %3, label %8, label %4
4: ; preds = %1
%5 = inttoptr i64 %2 to i8**
%6 = load i8*, i8** %5
%7 = tail call i32 @wsrep_check_iface_version(i8* %6, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
br label %8
8: ; preds = %1, %4
%9 = phi i32 [ %7, %4 ], [ 0, %1 ]
ret i32 %9
}
void loadWDEF(void) {}


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

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

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

LLVM IR (-O2):
define void @loadWDEF() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int strlen(char *);
int main() {
  int n = strlen("Hello, world!");
  assert(n == 13);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0xd,-0x8(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <strlen@plt>
xor    %edi,%edi
cmp    $0xd,%eax
sete   %dil
call   1040 <assert@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"Hello, world!\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @strlen(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
store i32 %3, i32* %2
%4 = load i32, i32* %2
%5 = icmp eq i32 %4, 13
%6 = zext i1 %5 to i32
%7 = call i32 @assert(i32 %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [14 x i8] c"Hello, world!\00"
define i32 @main() {
%1 = tail call i32 @strlen(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%2 = icmp eq i32 %1, 13
%3 = zext i1 %2 to i32
%4 = tail call i32 @assert(i32 %3)
ret i32 0
}
int main(int argc, char *argv[]) {
  asm("MOVL $5, %eax");
  asm("MOVL %eax, %ebx");
  asm("MOVL $10, %eax");
  asm("MOVL $20, %ebx");
  asm("ADDL %ebx, %eax");
  asm("MOVL $200, %eax");
  asm("MOVL $25, %ebx");
  asm("SUBL %ebx, %eax");
  asm("MOVL $20, %eax");
  asm("MOVL $30, %ebx");
  asm("IMULL %ebx, %eax");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x5,%eax
mov    %eax,%ebx
mov    $0xa,%eax
mov    $0x14,%ebx
add    %ebx,%eax
mov    $0xc8,%eax
mov    $0x19,%ebx
sub    %ebx,%eax
mov    $0x14,%eax
mov    $0x1e,%ebx
imul   %ebx,%eax
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
mov    $0x5,%eax
mov    %eax,%ebx
mov    $0xa,%eax
mov    $0x14,%ebx
add    %ebx,%eax
mov    $0xc8,%eax
mov    $0x19,%ebx
sub    %ebx,%eax
mov    $0x14,%eax
mov    $0x1e,%ebx
imul   %ebx,%eax
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
tail call void asm sideeffect "MOVL $$5, %eax", "~{dirflag},~{fpsr},~{flags}"()
tail call void asm sideeffect "MOVL %eax, %ebx", "~{dirflag},~{fpsr},~{flags}"()
tail call void asm sideeffect "MOVL $$10, %eax", "~{dirflag},~{fpsr},~{flags}"()
tail call void asm sideeffect "MOVL $$20, %ebx", "~{dirflag},~{fpsr},~{flags}"()
tail call void asm sideeffect "ADDL %ebx, %eax", "~{dirflag},~{fpsr},~{flags}"()
tail call void asm sideeffect "MOVL $$200, %eax", "~{dirflag},~{fpsr},~{flags}"()
tail call void asm sideeffect "MOVL $$25, %ebx", "~{dirflag},~{fpsr},~{flags}"()
tail call void asm sideeffect "SUBL %ebx, %eax", "~{dirflag},~{fpsr},~{flags}"()
tail call void asm sideeffect "MOVL $$20, %eax", "~{dirflag},~{fpsr},~{flags}"()
tail call void asm sideeffect "MOVL $$30, %ebx", "~{dirflag},~{fpsr},~{flags}"()
tail call void asm sideeffect "IMULL %ebx, %eax", "~{dirflag},~{fpsr},~{flags}"()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ _IO(int, int);
int ioctl(int, int /*<<< orphan*/);
int CED_LineCount(int fh) { return ioctl(fh, _IO(0xce, 7)); }


x86 assembly (clang, -O0):
<CED_LineCount>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    $0xce,%edi
mov    $0x7,%esi
call   1030 <_IO@plt>
mov    -0x8(%rbp),%edi
mov    %eax,%esi
call   1040 <ioctl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CED_LineCount>:
push   %rbx
mov    %edi,%ebx
mov    $0xce,%edi
mov    $0x7,%esi
call   1030 <_IO@plt>
mov    %ebx,%edi
mov    %eax,%esi
pop    %rbx
jmp    1040 <ioctl@plt>

LLVM IR (-O0):
define i32 @CED_LineCount(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @_IO(i32 206, i32 7)
%5 = call i32 @ioctl(i32 %3, i32 %4)
ret i32 %5
}

LLVM IR (-O2):
define i32 @CED_LineCount(i32 %0) {
%2 = tail call i32 @_IO(i32 206, i32 7)
%3 = tail call i32 @ioctl(i32 %0, i32 %2)
ret i32 %3
}
/* Variables and functions */
scalar_t__ sqrt(double);
double average(double x, double y) { return (float)sqrt(x * y); }


x86 assembly (clang, -O0):
<average>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
mulsd  -0x10(%rbp),%xmm0
call   1030 <sqrt@plt>
cvtsi2ss %rax,%xmm0
cvtss2sd %xmm0,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<average>:
push   %rax
mulsd  %xmm1,%xmm0
call   1030 <sqrt@plt>
xorps  %xmm0,%xmm0
cvtsi2ss %rax,%xmm0
cvtss2sd %xmm0,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @average(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = fmul double %5, %6
%8 = call i64 @sqrt(double %7)
%9 = sitofp i64 %8 to float
%10 = fpext float %9 to double
ret double %10
}

LLVM IR (-O2):
define double @average(double %0, double %1) {
%3 = fmul double %0, %1
%4 = tail call i64 @sqrt(double %3)
%5 = sitofp i64 %4 to float
%6 = fpext float %5 to double
ret double %6
}
float ffi_reinterpret_float(void *result) { return *(float *)&result; }


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

x86 assembly (clang, -O2):
<ffi_reinterpret_float>:
movd   %edi,%xmm0
ret

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

LLVM IR (-O2):
define float @ffi_reinterpret_float(i8* %0) {
%2 = ptrtoint i8* %0 to i64
%3 = trunc i64 %2 to i32
%4 = bitcast i32 %3 to float
ret float %4
}
/* Variables and functions */
int get_input();
int /*<<< orphan*/ stuff(int);
void hip2_1(void (*g)()) {
  int i;
  g();
  for (i = 0; i < get_input(); i++) {
    stuff(2);
    stuff(2 + 2);
  }
}


x86 assembly (clang, -O0):
<hip2_1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   *-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    $0x0,%al
call   1040 <get_input@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
cmp    %ecx,%eax
jge    1174 <hip2_1+0x54>
mov    $0x2,%edi
call   1030 <stuff@plt>
mov    $0x4,%edi
call   1030 <stuff@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1138 <hip2_1+0x18>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hip2_1>:
push   %rbx
xor    %eax,%eax
call   *%rdi
xor    %eax,%eax
call   1040 <get_input@plt>
test   %eax,%eax
jle    1162 <hip2_1+0x42>
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    $0x2,%edi
call   1030 <stuff@plt>
mov    $0x4,%edi
call   1030 <stuff@plt>
add    $0x1,%ebx
xor    %eax,%eax
call   1040 <get_input@plt>
cmp    %eax,%ebx
jl     1140 <hip2_1+0x20>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @hip2_1(void (...)* nocapture %0) {
tail call void (...) %0()
%2 = tail call i32 (...) @get_input()
%3 = icmp sgt i32 %2, 0
br i1 %3, label %4, label %11
4: ; preds = %1, %4
%5 = phi i32 [ %8, %4 ], [ 0, %1 ]
%6 = tail call i32 @stuff(i32 2)
%7 = tail call i32 @stuff(i32 4)
%8 = add nuw nsw i32 %5, 1
%9 = tail call i32 (...) @get_input()
%10 = icmp slt i32 %8, %9
br i1 %10, label %4, label %11
11: ; preds = %4, %1
ret void
}
/* Variables and functions */
int keyzen_self_drop_keys(char const **, int);
int keyzen_self_drop_key(const char *key) {
  return keyzen_self_drop_keys(&key, 1);
}


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

x86 assembly (clang, -O2):
<keyzen_self_drop_key>:
push   %rax
mov    %rdi,(%rsp)
mov    %rsp,%rdi
mov    $0x1,%esi
call   1030 <keyzen_self_drop_keys@plt>
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @keyzen_self_drop_key(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @keyzen_self_drop_keys(i8** %2, i32 1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ sla_prec(double *, double *, double *);
void csla_prec(double ep0, double ep1, double rmatp[3][3]) {
  sla_prec(&ep0, &ep1, &(rmatp[0][0]));
}


x86 assembly (clang, -O0):
<csla_prec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
mov    %rdi,-0x18(%rbp)
mov    -0x18(%rbp),%rdx
lea    -0x8(%rbp),%rdi
lea    -0x10(%rbp),%rsi
call   1030 <sla_prec@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<csla_prec>:
sub    $0x18,%rsp
mov    %rdi,%rdx
movsd  %xmm0,0x10(%rsp)
movsd  %xmm1,0x8(%rsp)
lea    0x10(%rsp),%rdi
lea    0x8(%rsp),%rsi
call   1030 <sla_prec@plt>
add    $0x18,%rsp
ret

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

LLVM IR (-O2):
define void @csla_prec(double %0, double %1, [3 x double]* %2) {
%4 = alloca double
%5 = alloca double
store double %0, double* %4
store double %1, double* %5
%6 = getelementptr inbounds [3 x double], [3 x double]* %2, i64 0, i64 0
%7 = call i32 @sla_prec(double* %4, double* %5, double* %6)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ print(char *, char const *);
int select_firmware(const char *binware_file) {
  print("\t(template driver) select_firmware(%s)\n", binware_file);
  return 0;
}


x86 assembly (clang, -O0):
<select_firmware>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xed9(%rip),%rdi
call   1030 <print@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<select_firmware>:
push   %rax
mov    %rdi,%rsi
lea    0xee5(%rip),%rdi
call   1030 <print@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [40 x i8] c"\09(template driver) select_firmware(%s)\0A\00"
define i32 @select_firmware(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @print(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0), i8* %3)
ret i32 0
}

LLVM IR (-O2):
@.str = [40 x i8] c"\09(template driver) select_firmware(%s)\0A\00"
define i32 @select_firmware(i8* %0) {
%2 = tail call i32 @print(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0), i8* %0)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ vuln(char *);
int main(int argc, char **argv) {
  if (argc != 2) {
    printf("Usage: buffer_overflow [str]\n");
    return 1;
  }
  vuln(argv[1]);
  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)
cmpl   $0x2,-0x8(%rbp)
je     1158 <main+0x38>
lea    0xeb9(%rip),%rdi
call   1040 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    116c <main+0x4c>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1030 <vuln@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
cmp    $0x2,%edi
jne    1133 <main+0x13>
mov    0x8(%rsi),%rdi
call   1040 <vuln@plt>
xor    %eax,%eax
pop    %rcx
ret
lea    0xec6(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [30 x i8] c"Usage: buffer_overflow [str]\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 = load i32, i32* %4
%7 = icmp ne i32 %6, 2
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
store i32 1, i32* %3
br label %15
10: ; preds = %2
%11 = load i8**, i8*** %5
%12 = getelementptr inbounds i8*, i8** %11, i64 1
%13 = load i8*, i8** %12
%14 = call i32 @vuln(i8* %13)
store i32 0, i32* %3
br label %15
15: ; preds = %10, %8
%16 = load i32, i32* %3
ret i32 %16
}

LLVM IR (-O2):
@str = [29 x i8] c"Usage: buffer_overflow [str]\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 2
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @str, i64 0, i64 0))
br label %10
6: ; preds = %2
%7 = getelementptr inbounds i8*, i8** %1, i64 1
%8 = load i8*, i8** %7
%9 = tail call i32 @vuln(i8* %8)
br label %10
10: ; preds = %6, %4
%11 = phi i32 [ 1, %4 ], [ 0, %6 ]
ret i32 %11
}
void streaming_startStreaming() {}


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

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

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

LLVM IR (-O2):
define void @streaming_startStreaming() {
ret void
}
int rn_inithead(head, off) void **head;
int off;
{ return 0; }


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

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

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

LLVM IR (-O2):
define i32 @rn_inithead(i8** nocapture readnone %0, i32 %1) {
ret i32 0
}
void example_for() {
  for (int i = 0; i < 10; ++i) {
    asm volatile("nop # @{ "
                 "log('i = ' + %0.get());"
                 " }@"
                 :
                 : "r"(i)
                 :);
  }
}


x86 assembly (clang, -O0):
<example_for>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
cmpl   $0xa,-0x4(%rbp)
jge    1127 <example_for+0x27>
mov    -0x4(%rbp),%eax
nop
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    110b <example_for+0xb>
pop    %rbp
ret

x86 assembly (clang, -O2):
<example_for>:
xor    %eax,%eax
nop
mov    $0x1,%eax
nop
mov    $0x2,%eax
nop
mov    $0x3,%eax
nop
mov    $0x4,%eax
nop
mov    $0x5,%eax
nop
mov    $0x6,%eax
nop
mov    $0x7,%eax
nop
mov    $0x8,%eax
nop
mov    $0x9,%eax
nop
ret

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

LLVM IR (-O2):
define void @example_for() {
tail call void asm sideeffect "nop # @$( log('i = ' + $0.get()); $)@", "r,~{dirflag},~{fpsr},~{flags}"(i32 0)
tail call void asm sideeffect "nop # @$( log('i = ' + $0.get()); $)@", "r,~{dirflag},~{fpsr},~{flags}"(i32 1)
tail call void asm sideeffect "nop # @$( log('i = ' + $0.get()); $)@", "r,~{dirflag},~{fpsr},~{flags}"(i32 2)
tail call void asm sideeffect "nop # @$( log('i = ' + $0.get()); $)@", "r,~{dirflag},~{fpsr},~{flags}"(i32 3)
tail call void asm sideeffect "nop # @$( log('i = ' + $0.get()); $)@", "r,~{dirflag},~{fpsr},~{flags}"(i32 4)
tail call void asm sideeffect "nop # @$( log('i = ' + $0.get()); $)@", "r,~{dirflag},~{fpsr},~{flags}"(i32 5)
tail call void asm sideeffect "nop # @$( log('i = ' + $0.get()); $)@", "r,~{dirflag},~{fpsr},~{flags}"(i32 6)
tail call void asm sideeffect "nop # @$( log('i = ' + $0.get()); $)@", "r,~{dirflag},~{fpsr},~{flags}"(i32 7)
tail call void asm sideeffect "nop # @$( log('i = ' + $0.get()); $)@", "r,~{dirflag},~{fpsr},~{flags}"(i32 8)
tail call void asm sideeffect "nop # @$( log('i = ' + $0.get()); $)@", "r,~{dirflag},~{fpsr},~{flags}"(i32 9)
ret void
}
int fun283() { return 283; }


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

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

LLVM IR (-O0):
define i32 @fun283() {
ret i32 283
}

LLVM IR (-O2):
define i32 @fun283() {
ret i32 283
}
void of_i2c_register_devices(struct i2c_adapter *adap) {}


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

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

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

LLVM IR (-O2):
%struct.i2c_adapter = type opaque
define void @of_i2c_register_devices(%struct.i2c_adapter* nocapture %0) {
ret void
}
void g_node_reverse_children() {}


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

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

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

LLVM IR (-O2):
define void @g_node_reverse_children() {
ret void
}
/* Variables and functions */
int strcmp(char *, char *);
int ident_compare(const void *a, const void *b) {
  return strcmp((char *)a, (char *)b);
}


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

x86 assembly (clang, -O2):
<ident_compare>:
jmp    1030 <strcmp@plt>

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

LLVM IR (-O2):
define i32 @ident_compare(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ ksThread_SetAffinity(int);
int /*<<< orphan*/ ksThread_SetRealTimePriority(int);
void PoolStartThread(void *data) {
  { (void)(data); };
  ksThread_SetAffinity(-1);
  ksThread_SetRealTimePriority(1);
}


x86 assembly (clang, -O0):
<PoolStartThread>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0xffffffff,%edi
call   1030 <ksThread_SetAffinity@plt>
mov    $0x1,%edi
call   1040 <ksThread_SetRealTimePriority@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PoolStartThread>:
push   %rax
mov    $0xffffffff,%edi
call   1030 <ksThread_SetAffinity@plt>
mov    $0x1,%edi
pop    %rax
jmp    1040 <ksThread_SetRealTimePriority@plt>

LLVM IR (-O0):
define void @PoolStartThread(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @ksThread_SetAffinity(i32 -1)
%5 = call i32 @ksThread_SetRealTimePriority(i32 1)
ret void
}

LLVM IR (-O2):
define void @PoolStartThread(i8* nocapture readnone %0) {
%2 = tail call i32 @ksThread_SetAffinity(i32 -1)
%3 = tail call i32 @ksThread_SetRealTimePriority(i32 1)
ret void
}
/* Variables and functions */
int strcmp(char const *, char const *);
int cmp_string_lt(const void *a, const void *b) {
  return strcmp(*(const char **)a, *(const char **)b);
}


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

x86 assembly (clang, -O2):
<cmp_string_lt>:
mov    (%rdi),%rdi
mov    (%rsi),%rsi
jmp    1030 <strcmp@plt>

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

LLVM IR (-O2):
define i32 @cmp_string_lt(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i8**
%4 = load i8*, i8** %3
%5 = bitcast i8* %1 to i8**
%6 = load i8*, i8** %5
%7 = tail call i32 @strcmp(i8* dereferenceable(1) %4, i8* dereferenceable(1) %6)
ret i32 %7
}
/* Variables and functions */
int rand();
int main(int argc, char **argv) {
  int x, y;
  int r = rand();
  if (0 != r) {
    y = rand();
    x = 42;
  } else {
    rand();
    y = rand();
    x = 7;
  }
  return x;
}


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   1030 <rand@plt>
mov    %eax,-0x1c(%rbp)
xor    %eax,%eax
cmp    -0x1c(%rbp),%eax
je     1151 <main+0x41>
mov    $0x0,%al
call   1030 <rand@plt>
mov    %eax,-0x18(%rbp)
movl   $0x2a,-0x14(%rbp)
jmp    1169 <main+0x59>
mov    $0x0,%al
call   1030 <rand@plt>
mov    $0x0,%al
call   1030 <rand@plt>
mov    %eax,-0x18(%rbp)
movl   $0x7,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1030 <rand@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1030 <rand@plt>
mov    $0x2a,%eax
test   %ebx,%ebx
je     112c <main+0x1c>
pop    %rbx
ret
xor    %eax,%eax
call   1030 <rand@plt>
mov    $0x7,%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
%7 = alloca i32
%8 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%9 = call i32 (...) @rand()
store i32 %9, i32* %8
%10 = load i32, i32* %8
%11 = icmp ne i32 0, %10
br i1 %11, label %12, label %14
12: ; preds = %2
%13 = call i32 (...) @rand()
store i32 %13, i32* %7
store i32 42, i32* %6
br label %17
14: ; preds = %2
%15 = call i32 (...) @rand()
%16 = call i32 (...) @rand()
store i32 %16, i32* %7
store i32 7, i32* %6
br label %17
17: ; preds = %14, %12
%18 = load i32, i32* %6
ret i32 %18
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @rand()
%4 = icmp eq i32 %3, 0
%5 = tail call i32 (...) @rand()
br i1 %4, label %6, label %8
6: ; preds = %2
%7 = tail call i32 (...) @rand()
br label %8
8: ; preds = %2, %6
%9 = phi i32 [ 7, %6 ], [ 42, %2 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ motion_set(int);
void soft_left_2(void) { motion_set(0x01); }


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

x86 assembly (clang, -O2):
<soft_left_2>:
mov    $0x1,%edi
jmp    1030 <motion_set@plt>

LLVM IR (-O0):
define void @soft_left_2() {
%1 = call i32 @motion_set(i32 1)
ret void
}

LLVM IR (-O2):
define void @soft_left_2() {
%1 = tail call i32 @motion_set(i32 1)
ret void
}