xunge/DecIR huggingface dataset:
int crawlupdate(
    struct collectionFormat *collection,
    int (*documentExist)(struct collectionFormat *collection,
                         struct crawldocumentExistFormat *crawldocumentExist),
    int (*documentAdd)(struct collectionFormat *collection,
                       struct crawldocumentAddFormat *crawldocumentAdd)) {}


x86 assembly (clang, -O0):
<crawlupdate>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.collectionFormat = type opaque
%struct.crawldocumentExistFormat = type opaque
%struct.crawldocumentAddFormat = type opaque
define i32 @crawlupdate(%struct.collectionFormat* %0, i32 (%struct.collectionFormat*, %struct.crawldocumentExistFormat*)* %1, i32 (%struct.collectionFormat*, %struct.crawldocumentAddFormat*)* %2) {
%4 = alloca i32
%5 = alloca %struct.collectionFormat*
%6 = alloca i32 (%struct.collectionFormat*, %struct.crawldocumentExistFormat*)*
%7 = alloca i32 (%struct.collectionFormat*, %struct.crawldocumentAddFormat*)*
store %struct.collectionFormat* %0, %struct.collectionFormat** %5
store i32 (%struct.collectionFormat*, %struct.crawldocumentExistFormat*)* %1, i32 (%struct.collectionFormat*, %struct.crawldocumentExistFormat*)** %6
store i32 (%struct.collectionFormat*, %struct.crawldocumentAddFormat*)* %2, i32 (%struct.collectionFormat*, %struct.crawldocumentAddFormat*)** %7
%8 = load i32, i32* %4
ret i32 %8
}

LLVM IR (-O2):
%struct.collectionFormat = type opaque
%struct.crawldocumentExistFormat = type opaque
%struct.crawldocumentAddFormat = type opaque
define i32 @crawlupdate(%struct.collectionFormat* nocapture readnone %0, i32 (%struct.collectionFormat*, %struct.crawldocumentExistFormat*)* nocapture readnone %1, i32 (%struct.collectionFormat*, %struct.crawldocumentAddFormat*)* nocapture readnone %2) {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void FREE(void **ptrptr) {
  free(*ptrptr);
  *ptrptr = NULL;
}


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

x86 assembly (clang, -O2):
<FREE>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%rdi
call   1030 <free@plt>
movq   $0x0,(%rbx)
pop    %rbx
ret

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

LLVM IR (-O2):
define void @FREE(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = tail call i32 @free(i8* %2)
store i8* null, i8** %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ nand_reset();
void nand_init(void) {
  (*((volatile unsigned long *)0x70200000)) &=
      ~((7 << 12) | (7 << 8) | (7 << 4));
  (*((volatile unsigned long *)0x70200000)) |= (1 << 12) | (2 << 8) | (1 << 4);
  (*((volatile unsigned long *)0x70200004)) = 1 | (1 << 1);
  nand_reset();
}


x86 assembly (clang, -O0):
<nand_init>:
push   %rbp
mov    %rsp,%rbp
mov    $0x70200000,%eax
mov    (%rax),%rcx
and    $0xffffffffffff888f,%rcx
mov    $0x70200000,%eax
mov    %rcx,(%rax)
mov    $0x70200000,%eax
mov    (%rax),%rcx
or     $0x1210,%rcx
mov    $0x70200000,%eax
mov    %rcx,(%rax)
mov    $0x70200004,%eax
movq   $0x3,(%rax)
mov    $0x0,%al
call   1030 <nand_reset@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<nand_init>:
andq   $0xffffffffffff888f,0x70200000
70 8f 88 ff ff
orq    $0x1210,0x70200000
movq   $0x3,0x70200004
xor    %eax,%eax
jmp    1030 <nand_reset@plt>

LLVM IR (-O0):
define void @nand_init() {
%1 = load volatile i64, i64* inttoptr (i64 1881145344 to i64*)
%2 = and i64 %1, -30577
store volatile i64 %2, i64* inttoptr (i64 1881145344 to i64*)
%3 = load volatile i64, i64* inttoptr (i64 1881145344 to i64*)
%4 = or i64 %3, 4624
store volatile i64 %4, i64* inttoptr (i64 1881145344 to i64*)
store volatile i64 3, i64* inttoptr (i64 1881145348 to i64*)
%5 = call i32 (...) @nand_reset()
ret void
}

LLVM IR (-O2):
define void @nand_init() {
%1 = load volatile i64, i64* inttoptr (i64 1881145344 to i64*)
%2 = and i64 %1, -30577
store volatile i64 %2, i64* inttoptr (i64 1881145344 to i64*)
%3 = load volatile i64, i64* inttoptr (i64 1881145344 to i64*)
%4 = or i64 %3, 4624
store volatile i64 %4, i64* inttoptr (i64 1881145344 to i64*)
store volatile i64 3, i64* inttoptr (i64 1881145348 to i64*)
%5 = tail call i32 (...) @nand_reset()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ O_RDONLY;
int isatty(int /*<<< orphan*/);
int /*<<< orphan*/ open(char *, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, int);
int main() {
  printf("%d\n", isatty(open("/dev/tty", O_RDONLY)));
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2eb0(%rip),%rax
mov    (%rax),%esi
lea    0xec3(%rip),%rdi
call   1050 <open@plt>
mov    %eax,%edi
call   1030 <isatty@plt>
lea    0xeac(%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"
@.str.1 = [9 x i8] c"/dev/tty\00"
@O_RDONLY = global i32 0
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = load i32, i32* @O_RDONLY
%3 = call i32 @open(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32 %2)
%4 = call i32 @isatty(i32 %3)
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
@.str.1 = [9 x i8] c"/dev/tty\00"
@O_RDONLY = global i32 0
define i32 @main() {
%1 = load i32, i32* @O_RDONLY
%2 = tail call i32 @open(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32 %1)
%3 = tail call i32 @isatty(i32 %2)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void version() {
  printf("Aquila"
         " "
         "0.1.11-pre2-beta3"
         "\n");
}


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

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

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

LLVM IR (-O2):
@str = [25 x i8] c"Aquila 0.1.11-pre2-beta3\00"
define void @version() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str, i64 0, i64 0))
ret void
}
void debug32_directive(const char *directive, const char *params) {
  (void)directive;
  (void)params;
}


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

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

LLVM IR (-O0):
define void @debug32_directive(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
ret void
}

LLVM IR (-O2):
define void @debug32_directive(i8* nocapture %0, i8* nocapture %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ reset_tty();
int /*<<< orphan*/ tty_restore();
void sreplay_atexit(void) {
  tty_restore();
  reset_tty();
}


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

x86 assembly (clang, -O2):
<sreplay_atexit>:
push   %rax
xor    %eax,%eax
call   1040 <tty_restore@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <reset_tty@plt>

LLVM IR (-O0):
define void @sreplay_atexit() {
%1 = call i32 (...) @tty_restore()
%2 = call i32 (...) @reset_tty()
ret void
}

LLVM IR (-O2):
define void @sreplay_atexit() {
%1 = tail call i32 (...) @tty_restore()
%2 = tail call i32 (...) @reset_tty()
ret void
}
double subtract(double a, double b) { return a - b; }


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

x86 assembly (clang, -O2):
<subtract>:
subsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @subtract(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 = fsub double %5, %6
ret double %7
}

LLVM IR (-O2):
define double @subtract(double %0, double %1) {
%3 = fsub double %0, %1
ret double %3
}
/* Type definitions */
struct sched_param {
  scalar_t__ sched_priority;
};
typedef int /*<<< orphan*/ sched;

/* Variables and functions */
int /*<<< orphan*/ SCHED_OTHER;
int /*<<< orphan*/ memset(struct sched_param *, int /*<<< orphan*/, int);
int /*<<< orphan*/ sched_setscheduler(int /*<<< orphan*/, int /*<<< orphan*/,
                                      struct sched_param *);
void setDefaultPriority() {
  struct sched_param sched;
  memset(&sched, 0, sizeof(sched));
  sched.sched_priority = 0;
  sched_setscheduler(0, SCHED_OTHER, &sched);
}


x86 assembly (clang, -O0):
<setDefaultPriority>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x8(%rbp),%rdi
xor    %esi,%esi
mov    $0x8,%edx
call   1040 <memset@plt>
movq   $0x0,-0x8(%rbp)
mov    0x2e99(%rip),%rax
mov    (%rax),%esi
xor    %edi,%edi
lea    -0x8(%rbp),%rdx
call   1030 <sched_setscheduler@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<setDefaultPriority>:
push   %rbx
sub    $0x10,%rsp
lea    0x8(%rsp),%rbx
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x8,%edx
call   1040 <memset@plt>
movq   $0x0,0x8(%rsp)
mov    0x2e97(%rip),%rax
mov    (%rax),%esi
xor    %edi,%edi
mov    %rbx,%rdx
call   1030 <sched_setscheduler@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.sched_param = type { i64 }
@SCHED_OTHER = global i32 0
define void @setDefaultPriority() {
%1 = alloca %struct.sched_param
%2 = call i32 @memset(%struct.sched_param* %1, i32 0, i32 8)
%3 = getelementptr inbounds %struct.sched_param, %struct.sched_param* %1, i32 0, i32 0
store i64 0, i64* %3
%4 = load i32, i32* @SCHED_OTHER
%5 = call i32 @sched_setscheduler(i32 0, i32 %4, %struct.sched_param* %1)
ret void
}

LLVM IR (-O2):
%struct.sched_param = type { i64 }
@SCHED_OTHER = global i32 0
define void @setDefaultPriority() {
%1 = alloca %struct.sched_param
%2 = bitcast %struct.sched_param* %1 to i8*
%3 = call i32 @memset(%struct.sched_param* %1, i32 0, i32 8)
%4 = getelementptr inbounds %struct.sched_param, %struct.sched_param* %1, i64 0, i32 0
store i64 0, i64* %4
%5 = load i32, i32* @SCHED_OTHER
%6 = call i32 @sched_setscheduler(i32 0, i32 %5, %struct.sched_param* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Yaez(int /*<<< orphan*/);
int /*<<< orphan*/ Zstr(char *);
void ZthrowCstringBadValue(char *msg) { Yaez(Zstr(msg)); }


x86 assembly (clang, -O0):
<ZthrowCstringBadValue>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <Zstr@plt>
mov    %eax,%edi
call   1040 <Yaez@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ZthrowCstringBadValue>:
push   %rax
call   1030 <Zstr@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <Yaez@plt>

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

LLVM IR (-O2):
define void @ZthrowCstringBadValue(i8* %0) {
%2 = tail call i32 @Zstr(i8* %0)
%3 = tail call i32 @Yaez(i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ RETN(int, int);
int /*<<< orphan*/ T_WAIT_UNTIL(int);
void op_ED_0x45(void) {
  RETN(4, 7);
  T_WAIT_UNTIL(10);
  return;
}


x86 assembly (clang, -O0):
<op_ED_0x45>:
push   %rbp
mov    %rsp,%rbp
mov    $0x4,%edi
mov    $0x7,%esi
call   1030 <RETN@plt>
mov    $0xa,%edi
call   1040 <T_WAIT_UNTIL@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<op_ED_0x45>:
push   %rax
mov    $0x4,%edi
mov    $0x7,%esi
call   1030 <RETN@plt>
mov    $0xa,%edi
pop    %rax
jmp    1040 <T_WAIT_UNTIL@plt>

LLVM IR (-O0):
define void @op_ED_0x45() {
%1 = call i32 @RETN(i32 4, i32 7)
%2 = call i32 @T_WAIT_UNTIL(i32 10)
ret void
}

LLVM IR (-O2):
define void @op_ED_0x45() {
%1 = tail call i32 @RETN(i32 4, i32 7)
%2 = tail call i32 @T_WAIT_UNTIL(i32 10)
ret void
}
/* Variables and functions */
char *XtNewString(char *);
char *DummyString() { return XtNewString(""); }


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

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

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define i8* @DummyString() {
%1 = call i8* @XtNewString(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
define i8* @DummyString() {
%1 = tail call i8* @XtNewString(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}
/* Type definitions */
typedef int /*<<< orphan*/ u_char;
struct ip {
  scalar_t__ ip_p;
};

/* Variables and functions */
scalar_t__ IPPROTO_ICMP;
int isICMP(const u_char *p, int source) {
  return ((struct ip *)(p + 14))->ip_p == IPPROTO_ICMP;
}


x86 assembly (clang, -O0):
<isICMP>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    0x38(%rax),%rax
mov    0x2ece(%rip),%rcx
cmp    (%rcx),%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isICMP>:
mov    0x38(%rdi),%rcx
mov    0x2edd(%rip),%rdx
xor    %eax,%eax
cmp    (%rdx),%rcx
sete   %al
ret

LLVM IR (-O0):
%struct.ip = type { i64 }
@IPPROTO_ICMP = global i64 0
define i32 @isICMP(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32*, i32** %3
%6 = getelementptr inbounds i32, i32* %5, i64 14
%7 = bitcast i32* %6 to %struct.ip*
%8 = getelementptr inbounds %struct.ip, %struct.ip* %7, i32 0, i32 0
%9 = load i64, i64* %8
%10 = load i64, i64* @IPPROTO_ICMP
%11 = icmp eq i64 %9, %10
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
@IPPROTO_ICMP = global i64 0
define i32 @isICMP(i32* nocapture %0, i32 %1) {
%3 = getelementptr inbounds i32, i32* %0, i64 14
%4 = bitcast i32* %3 to i64*
%5 = load i64, i64* %4
%6 = load i64, i64* @IPPROTO_ICMP
%7 = icmp eq i64 %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef size_t uint16_t;

/* Variables and functions */
void us_bits_set_octet(void *base, uint16_t offset, uint8_t value) {
  uint8_t *data = (uint8_t *)base;
  data[offset] = value;
}


x86 assembly (clang, -O0):
<us_bits_set_octet>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x14(%rbp),%edx
mov    -0x20(%rbp),%rax
mov    -0x10(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
pop    %rbp
ret

x86 assembly (clang, -O2):
<us_bits_set_octet>:
mov    %edx,(%rdi,%rsi,4)
ret

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

LLVM IR (-O2):
define void @us_bits_set_octet(i8* nocapture writeonly %0, i64 %1, i32 %2) {
%4 = bitcast i8* %0 to i32*
%5 = getelementptr inbounds i32, i32* %4, i64 %1
store i32 %2, i32* %5
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _IO(int, int);
int ioctl(int, int /*<<< orphan*/);
int CED_StateOf1401(int fh) { return ioctl(fh, _IO(0xce, 23)); }


x86 assembly (clang, -O0):
<CED_StateOf1401>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    $0xce,%edi
mov    $0x17,%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_StateOf1401>:
push   %rbx
mov    %edi,%ebx
mov    $0xce,%edi
mov    $0x17,%esi
call   1030 <_IO@plt>
mov    %ebx,%edi
mov    %eax,%esi
pop    %rbx
jmp    1040 <ioctl@plt>

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

LLVM IR (-O2):
define i32 @CED_StateOf1401(i32 %0) {
%2 = tail call i32 @_IO(i32 206, i32 23)
%3 = tail call i32 @ioctl(i32 %0, i32 %2)
ret i32 %3
}
/* Variables and functions */
scalar_t__ nrfx_usbd_errata_type_52840();
bool nrfx_usbd_errata_166(void) { return (1 && nrfx_usbd_errata_type_52840()); }


x86 assembly (clang, -O0):
<nrfx_usbd_errata_166>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <nrfx_usbd_errata_type_52840@plt>
cmp    $0x0,%rax
setne  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<nrfx_usbd_errata_166>:
push   %rax
xor    %eax,%eax
call   1030 <nrfx_usbd_errata_type_52840@plt>
xor    %ecx,%ecx
test   %rax,%rax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @nrfx_usbd_errata_166() {
%1 = call i64 (...) @nrfx_usbd_errata_type_52840()
%2 = icmp ne i64 %1, 0
%3 = zext i1 %2 to i32
ret i32 %3
}

LLVM IR (-O2):
define i32 @nrfx_usbd_errata_166() {
%1 = tail call i64 (...) @nrfx_usbd_errata_type_52840()
%2 = icmp ne i64 %1, 0
%3 = zext i1 %2 to i32
ret i32 %3
}
int sum_recursion(int *nums, unsigned int n_sums) {
  if (n_sums == 0) {
    return 0;
  }
  if (n_sums == 1) {
    return nums[0];
  }
  return nums[0] + sum_recursion(nums + 1, n_sums - 1);
}


x86 assembly (clang, -O0):
<sum_recursion>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jne    1135 <sum_recursion+0x25>
movl   $0x0,-0x4(%rbp)
jmp    1173 <sum_recursion+0x63>
cmpl   $0x1,-0x14(%rbp)
jne    114d <sum_recursion+0x3d>
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1173 <sum_recursion+0x63>
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
add    $0x4,%rdi
mov    -0x14(%rbp),%esi
sub    $0x1,%esi
call   1030 <sum_recursion@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sum_recursion>:
mov    %esi,%eax
xor    %ecx,%ecx
test   %eax,%eax
je     1122 <sum_recursion+0x22>
nopl   0x0(%rax,%rax,1)
cmp    $0x1,%eax
je     1125 <sum_recursion+0x25>
add    $0xffffffff,%eax
add    (%rdi),%ecx
add    $0x4,%rdi
test   %eax,%eax
jne    1110 <sum_recursion+0x10>
add    %ecx,%eax
ret
mov    (%rdi),%eax
add    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @sum_recursion(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* %5
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %2
store i32 0, i32* %3
br label %26
9: ; preds = %2
%10 = load i32, i32* %5
%11 = icmp eq i32 %10, 1
br i1 %11, label %12, label %16
12: ; preds = %9
%13 = load i32*, i32** %4
%14 = getelementptr inbounds i32, i32* %13, i64 0
%15 = load i32, i32* %14
store i32 %15, i32* %3
br label %26
16: ; preds = %9
%17 = load i32*, i32** %4
%18 = getelementptr inbounds i32, i32* %17, i64 0
%19 = load i32, i32* %18
%20 = load i32*, i32** %4
%21 = getelementptr inbounds i32, i32* %20, i64 1
%22 = load i32, i32* %5
%23 = sub i32 %22, 1
%24 = call i32 @sum_recursion(i32* %21, i32 %23)
%25 = add nsw i32 %19, %24
store i32 %25, i32* %3
br label %26
26: ; preds = %16, %12, %8
%27 = load i32, i32* %3
ret i32 %27
}

LLVM IR (-O2):
define i32 @sum_recursion(i32* nocapture %0, i32 %1) {
br label %3
3: ; preds = %9, %2
%4 = phi i32 [ 0, %2 ], [ %13, %9 ]
%5 = phi i32* [ %0, %2 ], [ %11, %9 ]
%6 = phi i32 [ %1, %2 ], [ %12, %9 ]
switch i32 %6, label %9 [
i32 0, label %14
i32 1, label %7
]
7: ; preds = %3
%8 = load i32, i32* %5
br label %14
9: ; preds = %3
%10 = load i32, i32* %5
%11 = getelementptr inbounds i32, i32* %5, i64 1
%12 = add i32 %6, -1
%13 = add nsw i32 %10, %4
br label %3
14: ; preds = %3, %7
%15 = phi i32 [ %8, %7 ], [ %6, %3 ]
%16 = add nsw i32 %15, %4
ret i32 %16
}
int Sequential_Search2(int a[], int n, int key) {
  int i;
  a[0] = key;
  i = n;
  while (a[i] != key)
    i--;
  return i;
}


x86 assembly (clang, -O0):
<Sequential_Search2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x10(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
cmp    -0x10(%rbp),%eax
je     113f <Sequential_Search2+0x3f>
mov    -0x14(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
jmp    111d <Sequential_Search2+0x1d>
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Sequential_Search2>:
mov    %edx,(%rdi)
movslq %esi,%rcx
lea    0x1(%rcx),%eax
lea    (%rdi,%rcx,4),%rcx
nopl   0x0(%rax)
add    $0xffffffff,%eax
lea    -0x4(%rcx),%rsi
cmp    %edx,(%rcx)
mov    %rsi,%rcx
jne    1110 <Sequential_Search2+0x10>
ret

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

LLVM IR (-O2):
define i32 @Sequential_Search2(i32* nocapture %0, i32 %1, i32 %2) {
store i32 %2, i32* %0
%4 = sext i32 %1 to i64
br label %5
5: ; preds = %5, %3
%6 = phi i64 [ %10, %5 ], [ %4, %3 ]
%7 = getelementptr inbounds i32, i32* %0, i64 %6
%8 = load i32, i32* %7
%9 = icmp eq i32 %8, %2
%10 = add i64 %6, -1
br i1 %9, label %11, label %5
11: ; preds = %5
%12 = trunc i64 %6 to i32
ret i32 %12
}
void foo815(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo815(i32 %0) {
ret void
}
void glGetActiveUniformBlockiv(void) { return; }


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

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

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

LLVM IR (-O2):
define void @glGetActiveUniformBlockiv() {
ret void
}
/* Variables and functions */
char *strrchr(char const *, int);
char *last_component(const char *str) {
  char *bp = strrchr(str, (int)'/');
  return ++bp;
}


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

x86 assembly (clang, -O2):
<last_component>:
push   %rax
mov    $0x2f,%esi
call   1030 <strrchr@plt>
add    $0x1,%rax
pop    %rcx
ret

LLVM IR (-O0):
define i8* @last_component(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i8* @strrchr(i8* %4, i32 47)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = getelementptr inbounds i8, i8* %6, i32 1
store i8* %7, i8** %3
ret i8* %7
}

LLVM IR (-O2):
define i8* @last_component(i8* %0) {
%2 = tail call i8* @strrchr(i8* dereferenceable(1) %0, i32 47)
%3 = getelementptr inbounds i8, i8* %2, i64 1
ret i8* %3
}
int __attribute__((stdcall)) __stub_zero_std_4(int a) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @__stub_zero_std_4(i32 %0) {
ret i32 0
}
void f1(int x) {
  float f = x;
  printf("&x:%d\t&f:%d\n", &x, &f);
}


x86 assembly (clang, -O0):
<f1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cvtsi2ssl -0x4(%rbp),%xmm0
movss  %xmm0,-0x8(%rbp)
lea    0xed4(%rip),%rdi
lea    -0x4(%rbp),%rsi
lea    -0x8(%rbp),%rdx
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f1>:
push   %rax
mov    %edi,0x4(%rsp)
cvtsi2ss %edi,%xmm0
movss  %xmm0,(%rsp)
lea    0xedb(%rip),%rdi
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
xor    %eax,%eax
call   1030 <printf@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [13 x i8] c"&x:%d\09&f:%d\0A\00"
define void @f1(i32 %0) {
%2 = alloca i32
%3 = alloca float
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = sitofp i32 %4 to float
store float %5, float* %3
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32* %2, float* %3)
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c"&x:%d\09&f:%d\0A\00"
define void @f1(i32 %0) {
%2 = alloca i32
%3 = alloca float
store i32 %0, i32* %2
%4 = bitcast float* %3 to i8*
%5 = sitofp i32 %0 to float
store float %5, float* %3
%6 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32* %2, float* %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ test_parser_sourcefile(char *, char *);
int /*<<< orphan*/ test_parser_verify_parse(int /*<<< orphan*/, char *, char *,
                                            char *, int /*<<< orphan*/);
void test_scilab_comments() {
  test_parser_verify_parse(test_parser_sourcefile("scilab", " //comment"),
                           "scilab", "", "//comment", 0);
}


x86 assembly (clang, -O0):
<test_scilab_comments>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
lea    0xed5(%rip),%rsi
call   1030 <test_parser_sourcefile@plt>
mov    %eax,%edi
lea    0xec0(%rip),%rsi
lea    0xebf(%rip),%rdx
lea    0xeba(%rip),%rcx
xor    %r8d,%r8d
call   1040 <test_parser_verify_parse@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_scilab_comments>:
push   %rbx
lea    0xed8(%rip),%rbx
lea    0xed8(%rip),%rsi
mov    %rbx,%rdi
call   1030 <test_parser_sourcefile@plt>
lea    0xec8(%rip),%rdx
lea    0xec3(%rip),%rcx
mov    %eax,%edi
mov    %rbx,%rsi
xor    %r8d,%r8d
pop    %rbx
jmp    1040 <test_parser_verify_parse@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"scilab\00"
@.str.1 = [11 x i8] c" //comment\00"
@.str.2 = [1 x i8] zeroinitializer
@.str.3 = [10 x i8] c"//comment\00"
define void @test_scilab_comments() {
%1 = call i32 @test_parser_sourcefile(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%2 = call i32 @test_parser_verify_parse(i32 %1, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0), i32 0)
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"scilab\00"
@.str.1 = [11 x i8] c" //comment\00"
@.str.2 = [1 x i8] zeroinitializer
@.str.3 = [10 x i8] c"//comment\00"
define void @test_scilab_comments() {
%1 = tail call i32 @test_parser_sourcefile(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @test_parser_verify_parse(i32 %1, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0), i32 0)
ret void
}
int main() {
  int i = 0;
  char c[128];
  while (i < 100) {
    c[i] = 'a';
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x64,-0x8(%rbp)
jge    1131 <main+0x31>
movslq -0x8(%rbp),%rax
movb   $0x61,-0x90(%rbp,%rax,1)
61
jmp    1116 <main+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [128 x i8]
store i32 0, i32* %1
store i32 0, i32* %2
br label %4
4: ; preds = %7, %0
%5 = load i32, i32* %2
%6 = icmp slt i32 %5, 100
br i1 %6, label %7, label %11
7: ; preds = %4
%8 = load i32, i32* %2
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds [128 x i8], [128 x i8]* %3, i64 0, i64 %9
store i8 97, i8* %10
br label %4
11: ; preds = %4
ret i32 0
}

LLVM IR (-O2):
/* Variables and functions */
double cout_iter(int, int, int, int);
double nb_iter(int, int, int, int, int);
double cout_total(int n, int k, int w, int p, int l) {
  double x, y;
  x = nb_iter(n, k, w, p, l);
  y = cout_iter(n, k, p, l);
  return x + y;
}


x86 assembly (clang, -O0):
<cout_total>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8d,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
mov    -0x14(%rbp),%r8d
call   1040 <nb_iter@plt>
movsd  %xmm0,-0x20(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x14(%rbp),%ecx
call   1030 <cout_iter@plt>
movsd  %xmm0,-0x28(%rbp)
movsd  -0x20(%rbp),%xmm0
addsd  -0x28(%rbp),%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cout_total>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %r8d,%r14d
mov    %ecx,%r15d
mov    %esi,%ebx
mov    %edi,%ebp
call   1040 <nb_iter@plt>
movsd  %xmm0,(%rsp)
mov    %ebp,%edi
mov    %ebx,%esi
mov    %r15d,%edx
mov    %r14d,%ecx
call   1030 <cout_iter@plt>
addsd  (%rsp),%xmm0
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define double @cout_total(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca double
%12 = alloca double
store i32 %0, i32* %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i32 %4, i32* %10
%13 = load i32, i32* %6
%14 = load i32, i32* %7
%15 = load i32, i32* %8
%16 = load i32, i32* %9
%17 = load i32, i32* %10
%18 = call double @nb_iter(i32 %13, i32 %14, i32 %15, i32 %16, i32 %17)
store double %18, double* %11
%19 = load i32, i32* %6
%20 = load i32, i32* %7
%21 = load i32, i32* %9
%22 = load i32, i32* %10
%23 = call double @cout_iter(i32 %19, i32 %20, i32 %21, i32 %22)
store double %23, double* %12
%24 = load double, double* %11
%25 = load double, double* %12
%26 = fadd double %24, %25
ret double %26
}

LLVM IR (-O2):
define double @cout_total(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = tail call double @nb_iter(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4)
%7 = tail call double @cout_iter(i32 %0, i32 %1, i32 %3, i32 %4)
%8 = fadd double %6, %7
ret double %8
}
int getSmallest(int a, int b, int c) {
  if (a < b && a < c)
    return a;
  if (b < a && b < c)
    return c;
  return c;
}


x86 assembly (clang, -O0):
<getSmallest>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1130 <getSmallest+0x30>
mov    -0x8(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1130 <getSmallest+0x30>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1159 <getSmallest+0x59>
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1153 <getSmallest+0x53>
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1153 <getSmallest+0x53>
mov    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1159 <getSmallest+0x59>
mov    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getSmallest>:
cmp    %edx,%edi
mov    %edx,%eax
cmovl  %edi,%eax
cmp    %esi,%edi
cmovge %edx,%eax
ret

LLVM IR (-O0):
define i32 @getSmallest(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
%8 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = icmp slt i32 %8, %9
br i1 %10, label %11, label %17
11: ; preds = %3
%12 = load i32, i32* %5
%13 = load i32, i32* %7
%14 = icmp slt i32 %12, %13
br i1 %14, label %15, label %17
15: ; preds = %11
%16 = load i32, i32* %5
store i32 %16, i32* %4
br label %29
17: ; preds = %11, %3
%18 = load i32, i32* %6
%19 = load i32, i32* %5
%20 = icmp slt i32 %18, %19
br i1 %20, label %21, label %27
21: ; preds = %17
%22 = load i32, i32* %6
%23 = load i32, i32* %7
%24 = icmp slt i32 %22, %23
br i1 %24, label %25, label %27
25: ; preds = %21
%26 = load i32, i32* %7
store i32 %26, i32* %4
br label %29
27: ; preds = %21, %17
%28 = load i32, i32* %7
store i32 %28, i32* %4
br label %29
29: ; preds = %27, %25, %15
%30 = load i32, i32* %4
ret i32 %30
}

LLVM IR (-O2):
define i32 @getSmallest(i32 %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %0, %1
%5 = icmp slt i32 %0, %2
%6 = and i1 %4, %5
%7 = select i1 %6, i32 %0, i32 %2
ret i32 %7
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ usleep(int);
void thread_sleep(uint32_t milliseconds) { usleep(1000 * milliseconds); }


x86 assembly (clang, -O0):
<thread_sleep>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
imul   $0x3e8,-0x4(%rbp),%edi
call   1030 <usleep@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<thread_sleep>:
imul   $0x3e8,%edi,%edi
jmp    1030 <usleep@plt>

LLVM IR (-O0):
define void @thread_sleep(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = mul nsw i32 1000, %3
%5 = call i32 @usleep(i32 %4)
ret void
}

LLVM IR (-O2):
define void @thread_sleep(i32 %0) {
%2 = mul nsw i32 %0, 1000
%3 = tail call i32 @usleep(i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
void pluscconlysb(unsigned short a, unsigned short b) {
  unsigned short sum = a + b;
  if (sum < b)
    abort();
}


x86 assembly (clang, -O0):
<pluscconlysb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %si,%ax
mov    %di,%cx
mov    %cx,-0x2(%rbp)
mov    %ax,-0x4(%rbp)
movzwl -0x2(%rbp),%eax
movzwl -0x4(%rbp),%ecx
add    %ecx,%eax
mov    %ax,-0x6(%rbp)
movzwl -0x6(%rbp),%eax
movzwl -0x4(%rbp),%ecx
cmp    %ecx,%eax
jge    114b <pluscconlysb+0x3b>
mov    $0x0,%al
call   1030 <abort@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pluscconlysb>:
add    %di,%si
jb     1116 <pluscconlysb+0x6>
ret
push   %rax
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define void @pluscconlysb(i16 zeroext %0, i16 zeroext %1) {
%3 = alloca i16
%4 = alloca i16
%5 = alloca i16
store i16 %0, i16* %3
store i16 %1, i16* %4
%6 = load i16, i16* %3
%7 = zext i16 %6 to i32
%8 = load i16, i16* %4
%9 = zext i16 %8 to i32
%10 = add nsw i32 %7, %9
%11 = trunc i32 %10 to i16
store i16 %11, i16* %5
%12 = load i16, i16* %5
%13 = zext i16 %12 to i32
%14 = load i16, i16* %4
%15 = zext i16 %14 to i32
%16 = icmp slt i32 %13, %15
br i1 %16, label %17, label %19
17: ; preds = %2
%18 = call i32 (...) @abort()
unreachable
19: ; preds = %2
ret void
}

LLVM IR (-O2):
define void @pluscconlysb(i16 zeroext %0, i16 zeroext %1) {
%3 = xor i16 %1, -1
%4 = icmp ult i16 %3, %0
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 (...) @abort()
unreachable
7: ; preds = %2
ret void
}
int f3(int a, char b, float c) { return a + b + (int)c; }


x86 assembly (clang, -O0):
<f3>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %edi,-0x4(%rbp)
mov    %al,-0x5(%rbp)
movss  %xmm0,-0xc(%rbp)
mov    -0x4(%rbp),%eax
movsbl -0x5(%rbp),%ecx
add    %ecx,%eax
cvttss2si -0xc(%rbp),%ecx
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f3>:
cvttss2si %xmm0,%eax
add    %edi,%eax
add    %esi,%eax
ret

LLVM IR (-O0):
define i32 @f3(i32 %0, i8 signext %1, float %2) {
%4 = alloca i32
%5 = alloca i8
%6 = alloca float
store i32 %0, i32* %4
store i8 %1, i8* %5
store float %2, float* %6
%7 = load i32, i32* %4
%8 = load i8, i8* %5
%9 = sext i8 %8 to i32
%10 = add nsw i32 %7, %9
%11 = load float, float* %6
%12 = fptosi float %11 to i32
%13 = add nsw i32 %10, %12
ret i32 %13
}

LLVM IR (-O2):
define i32 @f3(i32 %0, i8 signext %1, float %2) {
%4 = sext i8 %1 to i32
%5 = add nsw i32 %4, %0
%6 = fptosi float %2 to i32
%7 = add nsw i32 %5, %6
ret i32 %7
}
int harvest_user(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @harvest_user() {
ret i32 0
}
/* Variables and functions */
int eval(int, int);
float density(int x, int y) {
  int result;
  result = eval(x, y);
  result = result / 5;
  return (float)result;
}


x86 assembly (clang, -O0):
<density>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <eval@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x5,%ecx
cltd
idiv   %ecx
mov    %eax,-0xc(%rbp)
cvtsi2ssl -0xc(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<density>:
push   %rax
call   1030 <eval@plt>
cltq
imul   $0x66666667,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x21,%rax
add    %ecx,%eax
cvtsi2ss %eax,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @density(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = load i32, i32* %4
%8 = call i32 @eval(i32 %6, i32 %7)
store i32 %8, i32* %5
%9 = load i32, i32* %5
%10 = sdiv i32 %9, 5
store i32 %10, i32* %5
%11 = load i32, i32* %5
%12 = sitofp i32 %11 to float
ret float %12
}

LLVM IR (-O2):
define float @density(i32 %0, i32 %1) {
%3 = tail call i32 @eval(i32 %0, i32 %1)
%4 = sdiv i32 %3, 5
%5 = sitofp i32 %4 to float
ret float %5
}
int d_ble_mm1(double *a1, double *a2) {
  return (__builtin_islessequal(*a1, *a2));
}


x86 assembly (clang, -O0):
<d_ble_mm1>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm1
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
ucomisd %xmm1,%xmm0
setae  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<d_ble_mm1>:
movsd  (%rsi),%xmm0
xor    %eax,%eax
ucomisd (%rdi),%xmm0
setae  %al
ret

LLVM IR (-O0):
define i32 @d_ble_mm1(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* %5
%7 = load double*, double** %4
%8 = load double, double* %7
%9 = fcmp ole double %6, %8
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @d_ble_mm1(double* nocapture %0, double* nocapture %1) {
%3 = load double, double* %0
%4 = load double, double* %1
%5 = fcmp ole double %3, %4
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *, int *, int *);
int main() {
  int num1, num2, num3;
  printf("Digite três números inteiro: \n");
  scanf("%d %d %d", &num1, &num2, &num3);
  printf("Soma: %d", num1 + num2 + num3);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
lea    0xed7(%rip),%rdi
call   1030 <puts@plt>
lea    0xeb9(%rip),%rdi
lea    0x14(%rsp),%rsi
lea    0x10(%rsp),%rdx
lea    0xc(%rsp),%rcx
call   1050 <scanf@plt>
mov    0x10(%rsp),%esi
add    0x14(%rsp),%esi
add    0xc(%rsp),%esi
lea    0xe9b(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [33 x i8] c"Digite tr\C3\AAs n\C3\BAmeros inteiro: \0A\00"
@.str.1 = [9 x i8] c"%d %d %d\00"
@.str.2 = [9 x i8] c"Soma: %d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32* %2, i32* %3, i32* %4)
%7 = load i32, i32* %2
%8 = load i32, i32* %3
%9 = add nsw i32 %7, %8
%10 = load i32, i32* %4
%11 = add nsw i32 %9, %10
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i32 %11)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [9 x i8] c"%d %d %d\00"
@.str.2 = [9 x i8] c"Soma: %d\00"
@str = [32 x i8] c"Digite tr\C3\AAs n\C3\BAmeros inteiro: \00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = bitcast i32* %1 to i8*
%5 = bitcast i32* %2 to i8*
%6 = bitcast i32* %3 to i8*
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @str, i64 0, i64 0))
%8 = call i32 @scanf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32* %1, i32* %2, i32* %3)
%9 = load i32, i32* %1
%10 = load i32, i32* %2
%11 = add nsw i32 %10, %9
%12 = load i32, i32* %3
%13 = add nsw i32 %11, %12
%14 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i32 %13)
ret i32 0
}
/* Variables and functions */
int volume_mod_to_gb(int v) { return (v == 64) ? 0xF : (v >> 2); }


x86 assembly (clang, -O0):
<volume_mod_to_gb>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x40,-0x4(%rbp)
jne    111e <volume_mod_to_gb+0x1e>
mov    $0xf,%eax
mov    %eax,-0x8(%rbp)
jmp    1127 <volume_mod_to_gb+0x27>
mov    -0x4(%rbp),%eax
sar    $0x2,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<volume_mod_to_gb>:
mov    %edi,%ecx
sar    $0x2,%ecx
cmp    $0x40,%edi
mov    $0xf,%eax
cmovne %ecx,%eax
ret

LLVM IR (-O0):
define i32 @volume_mod_to_gb(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 64
br i1 %4, label %5, label %6
5: ; preds = %1
br label %9
6: ; preds = %1
%7 = load i32, i32* %2
%8 = ashr i32 %7, 2
br label %9
9: ; preds = %6, %5
%10 = phi i32 [ 15, %5 ], [ %8, %6 ]
ret i32 %10
}

LLVM IR (-O2):
define i32 @volume_mod_to_gb(i32 %0) {
%2 = icmp eq i32 %0, 64
%3 = ashr i32 %0, 2
%4 = select i1 %2, i32 15, i32 %3
ret i32 %4
}
/* Variables and functions */
int getpid();
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  printf("hello world from process ID %d\n", getpid());
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [32 x i8] c"hello world from process ID %d\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @getpid()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
void wsdebug(char *fmt, ...) {}


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

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

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

LLVM IR (-O2):
define void @wsdebug(i8* nocapture %0, ...) {
ret void
}
long int codebook(long int mask, long int bitchanged, long int numbasis,
                  long int codeword, long int g, const short *d, short ddim,
                  short theta) {
  long int j;
  long int tmpMask;
  tmpMask = mask << 1;
  for (j = bitchanged + 1; j <= numbasis; j++) {
  }
  return g;
}


x86 assembly (clang, -O0):
<codebook>:
push   %rbp
mov    %rsp,%rbp
mov    0x18(%rbp),%ax
mov    0x10(%rbp),%ax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x8(%rbp),%rax
shl    $0x1,%rax
mov    %rax,-0x40(%rbp)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x38(%rbp)
mov    -0x38(%rbp),%rax
cmp    -0x18(%rbp),%rax
jg     1160 <codebook+0x60>
jmp    114f <codebook+0x4f>
mov    -0x38(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x38(%rbp)
jmp    113c <codebook+0x3c>
mov    -0x28(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<codebook>:
mov    %r8,%rax
ret

LLVM IR (-O0):
define i64 @codebook(i64 %0, i64 %1, i64 %2, i64 %3, i64 %4, i16* %5, i16 signext %6, i16 signext %7) {
%9 = alloca i64
%10 = alloca i64
%11 = alloca i64
%12 = alloca i64
%13 = alloca i64
%14 = alloca i16*
%15 = alloca i16
%16 = alloca i16
%17 = alloca i64
%18 = alloca i64
store i64 %0, i64* %9
store i64 %1, i64* %10
store i64 %2, i64* %11
store i64 %3, i64* %12
store i64 %4, i64* %13
store i16* %5, i16** %14
store i16 %6, i16* %15
store i16 %7, i16* %16
%19 = load i64, i64* %9
%20 = shl i64 %19, 1
store i64 %20, i64* %18
%21 = load i64, i64* %10
%22 = add nsw i64 %21, 1
store i64 %22, i64* %17
br label %23
23: ; preds = %28, %8
%24 = load i64, i64* %17
%25 = load i64, i64* %11
%26 = icmp sle i64 %24, %25
br i1 %26, label %27, label %31
27: ; preds = %23
br label %28
28: ; preds = %27
%29 = load i64, i64* %17
%30 = add nsw i64 %29, 1
store i64 %30, i64* %17
br label %23
31: ; preds = %23
%32 = load i64, i64* %13
ret i64 %32
}

LLVM IR (-O2):
define i64 @codebook(i64 %0, i64 %1, i64 %2, i64 %3, i64 returned %4, i16* nocapture readnone %5, i16 signext %6, i16 signext %7) {
ret i64 %4
}
/* Type definitions */
typedef int __m64;

/* Variables and functions */
__m64 __attribute__((__always___, __nodebug__))
_mm_and_si64(__m64 __m1, __m64 __m2) {
  return __m1 & __m2;
}


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

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

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

LLVM IR (-O2):
define i32 @_mm_and_si64(i32 %0, i32 %1) {
%3 = and i32 %1, %0
ret i32 %3
}