xunge/DecIR huggingface dataset:
/* Variables and functions */
int strcmp(char *const, char *const);
int _globcmp(const void *p1, const void *p2) {
  return strcmp(*(char *const *)p1, *(char *const *)p2);
}


x86 assembly (clang, -O0):
<_globcmp>:
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):
<_globcmp>:
mov    (%rdi),%rdi
mov    (%rsi),%rsi
jmp    1030 <strcmp@plt>

LLVM IR (-O0):
define i32 @_globcmp(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 @_globcmp(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*/ parse(int, int);
int parseStmt(int state, int flags) { parse(2, flags); }


x86 assembly (clang, -O0):
<parseStmt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%esi
mov    $0x2,%edi
call   1030 <parse@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parseStmt>:
mov    $0x2,%edi
jmp    1030 <parse@plt>

LLVM IR (-O0):
define i32 @parseStmt(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 = call i32 @parse(i32 2, i32 %6)
%8 = load i32, i32* %3
ret i32 %8
}

LLVM IR (-O2):
define i32 @parseStmt(i32 %0, i32 %1) {
%3 = tail call i32 @parse(i32 2, i32 %1)
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isdigit(int);
void t_isdigit_0x28() {
  Assert_real((isdigit(40) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isdigit.c",
              205, ("isdigit should be 0 for ("));
}


x86 assembly (clang, -O0):
<t_isdigit_0x28>:
push   %rbp
mov    %rsp,%rbp
mov    $0x28,%edi
call   1030 <isdigit@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0xcd,%edx
lea    0xf5b(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isdigit_0x28>:
push   %rax
mov    $0x28,%edi
call   1030 <isdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0xcd,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isdigit.c\00"
@.str.1 = [26 x i8] c"isdigit should be 0 for (\00"
define void @t_isdigit_0x28() {
%1 = call i64 @isdigit(i32 40)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 205, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isdigit.c\00"
@.str.1 = [26 x i8] c"isdigit should be 0 for (\00"
define void @t_isdigit_0x28() {
%1 = tail call i64 @isdigit(i32 40)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 205, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
double xfmod(double p1, double p2) {
  int temp;
  temp = p1 / p2;
  p1 = p1 - (p2 * temp);
  return p1;
}


x86 assembly (clang, -O0):
<xfmod>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
divsd  -0x10(%rbp),%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,-0x14(%rbp)
movsd  -0x8(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm0
cvtsi2sdl -0x14(%rbp),%xmm2
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<xfmod>:
movapd %xmm0,%xmm2
divsd  %xmm1,%xmm2
cvttpd2dq %xmm2,%xmm2
cvtdq2pd %xmm2,%xmm2
mulsd  %xmm1,%xmm2
subsd  %xmm2,%xmm0
ret

LLVM IR (-O0):
define double @xfmod(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca i32
store double %0, double* %3
store double %1, double* %4
%6 = load double, double* %3
%7 = load double, double* %4
%8 = fdiv double %6, %7
%9 = fptosi double %8 to i32
store i32 %9, i32* %5
%10 = load double, double* %3
%11 = load double, double* %4
%12 = load i32, i32* %5
%13 = sitofp i32 %12 to double
%14 = fneg double %11
%15 = call double @llvm.fmuladd.f64(double %14, double %13, double %10)
store double %15, double* %3
%16 = load double, double* %3
ret double %16
}

LLVM IR (-O2):
define double @xfmod(double %0, double %1) {
%3 = fdiv double %0, %1
%4 = fptosi double %3 to i32
%5 = sitofp i32 %4 to double
%6 = fneg double %1
%7 = tail call double @llvm.fmuladd.f64(double %6, double %5, double %0)
ret double %7
}
/* Type definitions */
struct option {
  int dummy;
};

/* Variables and functions */
int _getopt_internal(int, char **, char const *, struct option const *, int *,
                     int);
int getopt_long_only(int argc, char *argv[], const char *shortopts,
                     const struct option *longopts, int *longind) {
  return _getopt_internal(argc, argv, shortopts, longopts, longind, 1);
}


x86 assembly (clang, -O0):
<getopt_long_only>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r8
mov    $0x1,%r9d
call   1030 <_getopt_internal@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getopt_long_only>:
mov    $0x1,%r9d
jmp    1030 <_getopt_internal@plt>

LLVM IR (-O0):
%struct.option = type { i32 }
define i32 @getopt_long_only(i32 %0, i8** %1, i8* %2, %struct.option* %3, i32* %4) {
%6 = alloca i32
%7 = alloca i8**
%8 = alloca i8*
%9 = alloca %struct.option*
%10 = alloca i32*
store i32 %0, i32* %6
store i8** %1, i8*** %7
store i8* %2, i8** %8
store %struct.option* %3, %struct.option** %9
store i32* %4, i32** %10
%11 = load i32, i32* %6
%12 = load i8**, i8*** %7
%13 = load i8*, i8** %8
%14 = load %struct.option*, %struct.option** %9
%15 = load i32*, i32** %10
%16 = call i32 @_getopt_internal(i32 %11, i8** %12, i8* %13, %struct.option* %14, i32* %15, i32 1)
ret i32 %16
}

LLVM IR (-O2):
%struct.option = type { i32 }
define i32 @getopt_long_only(i32 %0, i8** %1, i8* %2, %struct.option* %3, i32* %4) {
%6 = tail call i32 @_getopt_internal(i32 %0, i8** %1, i8* %2, %struct.option* %3, i32* %4, i32 1)
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_memblockq_get_attr() {
  printf("NOT IMPLEMENTED:"
         "pa_memblockq_get_attr"
         "\n");
}


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

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

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

LLVM IR (-O2):
@str = [38 x i8] c"NOT IMPLEMENTED:pa_memblockq_get_attr\00"
define i32 @pa_memblockq_get_attr() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
const char *__malidrv_build_info(void) {
  return "malidrv:  API_VERSION=800 REPO_URL= REVISION= CHANGED_REVISION= "
         "CHANGE_DATE= BUILD_DATE=Fri Nov  4 20:22:49 EDT 2016 BUILD=debug "
         "TARGET_PLATFORM= MALI_PLATFORM= KDIR= "
         "OS_MEMORY_KERNEL_BUFFER_SIZE_IN_MB=16 USING_UMP= USING_PROFILING= "
         "USING_INTERNAL_PROFILING= USING_GPU_UTILIZATION=1 USING_DVFS= "
         "MALI_UPPER_HALF_SCHEDULING=1";
}


x86 assembly (clang, -O0):
<__malidrv_build_info>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__malidrv_build_info>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [324 x i8] c"malidrv: API_VERSION=800 REPO_URL= REVISION= CHANGED_REVISION= CHANGE_DATE= BUILD_DATE=Fri Nov 4 20:22:49 EDT 2016 BUILD=debug TARGET_PLATFORM= MALI_PLATFORM= KDIR= OS_MEMORY_KERNEL_BUFFER_SIZE_IN_MB=16 USING_UMP= USING_PROFILING= USING_INTERNAL_PROFILING= USING_GPU_UTILIZATION=1 USING_DVFS= MALI_UPPER_HALF_SCHEDULING=1\00"
define i8* @__malidrv_build_info() {
ret i8* getelementptr inbounds ([324 x i8], [324 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [324 x i8] c"malidrv: API_VERSION=800 REPO_URL= REVISION= CHANGED_REVISION= CHANGE_DATE= BUILD_DATE=Fri Nov 4 20:22:49 EDT 2016 BUILD=debug TARGET_PLATFORM= MALI_PLATFORM= KDIR= OS_MEMORY_KERNEL_BUFFER_SIZE_IN_MB=16 USING_UMP= USING_PROFILING= USING_INTERNAL_PROFILING= USING_GPU_UTILIZATION=1 USING_DVFS= MALI_UPPER_HALF_SCHEDULING=1\00"
define i8* @__malidrv_build_info() {
ret i8* getelementptr inbounds ([324 x i8], [324 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ panic(int);
void panic5() { panic(6); }


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

x86 assembly (clang, -O2):
<panic5>:
mov    $0x6,%edi
jmp    1030 <panic@plt>

LLVM IR (-O0):
define void @panic5() {
%1 = call i32 @panic(i32 6)
ret void
}

LLVM IR (-O2):
define void @panic5() {
%1 = tail call i32 @panic(i32 6)
ret void
}
void reverseUnsignedRange(unsigned *pStart, unsigned *pEnd, int size) {
  unsigned temp;
  temp = *pStart;
  *pStart = size - *pEnd;
  *pEnd = size - temp;
}


x86 assembly (clang, -O0):
<reverseUnsignedRange>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%ecx
mov    -0x10(%rbp),%rax
sub    (%rax),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x14(%rbp),%ecx
sub    -0x18(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<reverseUnsignedRange>:
mov    %edx,%eax
sub    (%rsi),%eax
sub    (%rdi),%edx
mov    %eax,(%rdi)
mov    %edx,(%rsi)
ret

LLVM IR (-O0):
define void @reverseUnsignedRange(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** %4
%9 = load i32, i32* %8
store i32 %9, i32* %7
%10 = load i32, i32* %6
%11 = load i32*, i32** %5
%12 = load i32, i32* %11
%13 = sub i32 %10, %12
%14 = load i32*, i32** %4
store i32 %13, i32* %14
%15 = load i32, i32* %6
%16 = load i32, i32* %7
%17 = sub i32 %15, %16
%18 = load i32*, i32** %5
store i32 %17, i32* %18
ret void
}

LLVM IR (-O2):
define void @reverseUnsignedRange(i32* nocapture %0, i32* nocapture %1, i32 %2) {
%4 = load i32, i32* %0
%5 = load i32, i32* %1
%6 = sub i32 %2, %5
store i32 %6, i32* %0
%7 = sub i32 %2, %4
store i32 %7, i32* %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_proplist_new() {
  printf("NOT IMPLEMENTED:"
         "pa_proplist_new"
         "\n");
}


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

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

LLVM IR (-O0):
@.str = [33 x i8] c"NOT IMPLEMENTED:pa_proplist_new\0A\00"
define i32 @pa_proplist_new() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [32 x i8] c"NOT IMPLEMENTED:pa_proplist_new\00"
define i32 @pa_proplist_new() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_SUCCESS;
#define SIGHUP 129
#define SIGTERM 128
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ remove(char *);
void sig_handler(int signo) {
  switch (signo) {
  case SIGHUP:
    break;
  case SIGTERM:
    remove("/var/run/tiny-ssdpd.pid");
    exit(EXIT_SUCCESS);
    break;
  }
}


x86 assembly (clang, -O0):
<sig_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
sub    $0x80,%eax
je     1159 <sig_handler+0x39>
jmp    1141 <sig_handler+0x21>
mov    -0x8(%rbp),%eax
sub    $0x81,%eax
jne    1173 <sig_handler+0x53>
jmp    1154 <sig_handler+0x34>
jmp    1173 <sig_handler+0x53>
lea    0xea0(%rip),%rdi
call   1030 <remove@plt>
mov    0x2e74(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sig_handler>:
cmp    $0x80,%edi
je     1129 <sig_handler+0x9>
ret
push   %rax
lea    0xecf(%rip),%rdi
call   1030 <remove@plt>
mov    0x2ea3(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [24 x i8] c"/var/run/tiny-ssdpd.pid\00"
@EXIT_SUCCESS = global i32 0
define void @sig_handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
switch i32 %3, label %9 [
i32 129, label %4
i32 128, label %5
]
4: ; preds = %1
br label %9
5: ; preds = %1
%6 = call i32 @remove(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%7 = load i32, i32* @EXIT_SUCCESS
%8 = call i32 @exit(i32 %7)
unreachable
9: ; preds = %1, %4
ret void
}

LLVM IR (-O2):
@.str = [24 x i8] c"/var/run/tiny-ssdpd.pid\00"
@EXIT_SUCCESS = global i32 0
define void @sig_handler(i32 %0) {
%2 = icmp eq i32 %0, 128
br i1 %2, label %3, label %7
3: ; preds = %1
%4 = tail call i32 @remove(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%5 = load i32, i32* @EXIT_SUCCESS
%6 = tail call i32 @exit(i32 %5)
unreachable
7: ; preds = %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EVP_cleanup();
void crypto_free() { EVP_cleanup(); }


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

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

LLVM IR (-O0):
define void @crypto_free() {
%1 = call i32 (...) @EVP_cleanup()
ret void
}

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

/* Variables and functions */
int /*<<< orphan*/ free(struct mapping_iter *);
void mapping_iter_free(struct mapping_iter *it) { free(it); }


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

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

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

LLVM IR (-O2):
%struct.mapping_iter = type { i32 }
define void @mapping_iter_free(%struct.mapping_iter* nocapture %0) {
%2 = tail call i32 @free(%struct.mapping_iter* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
scalar_t__ bar(int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/,
               int /*<<< orphan*/, double, double);
int main(void) {
  if (bar(0, 0, 0, 0, 0.0, 0.0) != 0)
    abort();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xor    %ecx,%ecx
xorps  %xmm1,%xmm1
mov    %ecx,%edi
mov    %ecx,%esi
mov    %ecx,%edx
movaps %xmm1,%xmm0
call   1040 <bar@plt>
cmp    $0x0,%rax
je     1153 <main+0x33>
mov    $0x0,%al
call   1030 <abort@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xorps  %xmm0,%xmm0
xorps  %xmm1,%xmm1
xor    %edi,%edi
xor    %esi,%esi
xor    %edx,%edx
xor    %ecx,%ecx
call   1040 <bar@plt>
test   %rax,%rax
jne    113d <main+0x1d>
xor    %eax,%eax
pop    %rcx
ret
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i64 @bar(i32 0, i32 0, i32 0, i32 0, double 0.000000e+00, double 0.000000e+00)
%3 = icmp ne i64 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = call i32 (...) @abort()
unreachable
6: ; preds = %0
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i64 @bar(i32 0, i32 0, i32 0, i32 0, double 0.000000e+00, double 0.000000e+00)
%2 = icmp eq i64 %1, 0
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 (...) @abort()
unreachable
5: ; preds = %0
ret i32 0
}
/* Variables and functions */
int getline2(char *);
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ reverse(char *);
int main(void) {
  char str[1000];
  int len;
  while ((len = getline2(str)) > 0) {
    reverse(str);
    puts(str);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x400,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x3f0(%rbp),%rdi
call   1040 <getline2@plt>
mov    %eax,-0x3f4(%rbp)
cmp    $0x0,%eax
jle    117a <main+0x4a>
lea    -0x3f0(%rbp),%rdi
call   1030 <reverse@plt>
lea    -0x3f0(%rbp),%rdi
call   1050 <puts@plt>
jmp    1142 <main+0x12>
xor    %eax,%eax
add    $0x400,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x3f0,%rsp
mov    %rsp,%rdi
call   1040 <getline2@plt>
test   %eax,%eax
jle    116c <main+0x3c>
mov    %rsp,%rbx
nopw   0x0(%rax,%rax,1)
mov    %rbx,%rdi
call   1030 <reverse@plt>
mov    %rbx,%rdi
call   1050 <puts@plt>
mov    %rbx,%rdi
call   1040 <getline2@plt>
test   %eax,%eax
jg     1150 <main+0x20>
xor    %eax,%eax
add    $0x3f0,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca [1000 x i8]
%3 = alloca i32
store i32 0, i32* %1
br label %4
4: ; preds = %8, %0
%5 = getelementptr inbounds [1000 x i8], [1000 x i8]* %2, i64 0, i64 0
%6 = call i32 @getline2(i8* %5)
store i32 %6, i32* %3
%7 = icmp sgt i32 %6, 0
br i1 %7, label %8, label %13
8: ; preds = %4
%9 = getelementptr inbounds [1000 x i8], [1000 x i8]* %2, i64 0, i64 0
%10 = call i32 @reverse(i8* %9)
%11 = getelementptr inbounds [1000 x i8], [1000 x i8]* %2, i64 0, i64 0
%12 = call i32 @puts(i8* %11)
br label %4
13: ; preds = %4
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca [1000 x i8]
%2 = getelementptr inbounds [1000 x i8], [1000 x i8]* %1, i64 0, i64 0
%3 = call i32 @getline2(i8* %2)
%4 = icmp sgt i32 %3, 0
br i1 %4, label %5, label %10
5: ; preds = %0, %5
%6 = call i32 @reverse(i8* %2)
%7 = call i32 @puts(i8* %2)
%8 = call i32 @getline2(i8* %2)
%9 = icmp sgt i32 %8, 0
br i1 %9, label %5, label %10
10: ; preds = %5, %0
ret i32 0
}
char digit_to_char(int d) { return d + '0'; }


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

x86 assembly (clang, -O2):
<digit_to_char>:
lea    0x30(%rdi),%eax
ret

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

LLVM IR (-O2):
define signext i8 @digit_to_char(i32 %0) {
%2 = trunc i32 %0 to i8
%3 = add i8 %2, 48
ret i8 %3
}
/* Variables and functions */
scalar_t__ twoBitIsFile(char *);
scalar_t__ twoBitIsRange(char *);
int twoBitIsFileOrRange(char *spec) {
  return twoBitIsFile(spec) || twoBitIsRange(spec);
}


x86 assembly (clang, -O0):
<twoBitIsFileOrRange>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <twoBitIsFile@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x9(%rbp)
jne    115a <twoBitIsFileOrRange+0x3a>
mov    -0x8(%rbp),%rdi
call   1030 <twoBitIsRange@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<twoBitIsFileOrRange>:
push   %rbx
mov    %rdi,%rbx
call   1040 <twoBitIsFile@plt>
mov    %rax,%rcx
mov    $0x1,%eax
test   %rcx,%rcx
je     1138 <twoBitIsFileOrRange+0x18>
pop    %rbx
ret
mov    %rbx,%rdi
call   1030 <twoBitIsRange@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
pop    %rbx
ret

LLVM IR (-O0):
define i32 @twoBitIsFileOrRange(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i64 @twoBitIsFile(i8* %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %10, label %6
6: ; preds = %1
%7 = load i8*, i8** %2
%8 = call i64 @twoBitIsRange(i8* %7)
%9 = icmp ne i64 %8, 0
br label %10
10: ; preds = %6, %1
%11 = phi i1 [ true, %1 ], [ %9, %6 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @twoBitIsFileOrRange(i8* %0) {
%2 = tail call i64 @twoBitIsFile(i8* %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = tail call i64 @twoBitIsRange(i8* %0)
%6 = icmp ne i64 %5, 0
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %4, %1
%9 = phi i32 [ 1, %1 ], [ %7, %4 ]
ret i32 %9
}
unsigned long gf2_matrix_times(mat, vec)
unsigned long *mat;
unsigned long vec;
{
  unsigned long sum;
  sum = 0;
  while (vec) {
    if (vec & 1)
      sum ^= *mat;
    vec >>= 1;
    mat++;
  }
  return sum;
}


x86 assembly (clang, -O0):
<gf2_matrix_times>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     115d <gf2_matrix_times+0x5d>
mov    -0x10(%rbp),%rax
and    $0x1,%rax
cmp    $0x0,%rax
je     1140 <gf2_matrix_times+0x40>
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
xor    -0x18(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
shr    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x8(%rbp)
jmp    1114 <gf2_matrix_times+0x14>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<gf2_matrix_times>:
xor    %eax,%eax
test   %rsi,%rsi
jne    1123 <gf2_matrix_times+0x23>
ret
nopl   0x0(%rax,%rax,1)
mov    %rsi,%rcx
shr    %rcx
add    $0x8,%rdi
cmp    $0x1,%rsi
mov    %rcx,%rsi
jbe    1107 <gf2_matrix_times+0x7>
test   $0x1,%sil
je     1110 <gf2_matrix_times+0x10>
xor    (%rdi),%rax
jmp    1110 <gf2_matrix_times+0x10>

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

LLVM IR (-O2):
define i64 @gf2_matrix_times(i64* nocapture %0, i64 %1) {
%3 = icmp eq i64 %1, 0
br i1 %3, label %18, label %4
4: ; preds = %2, %13
%5 = phi i64 [ %14, %13 ], [ 0, %2 ]
%6 = phi i64 [ %15, %13 ], [ %1, %2 ]
%7 = phi i64* [ %16, %13 ], [ %0, %2 ]
%8 = and i64 %6, 1
%9 = icmp eq i64 %8, 0
br i1 %9, label %13, label %10
10: ; preds = %4
%11 = load i64, i64* %7
%12 = xor i64 %11, %5
br label %13
13: ; preds = %10, %4
%14 = phi i64 [ %12, %10 ], [ %5, %4 ]
%15 = lshr i64 %6, 1
%16 = getelementptr inbounds i64, i64* %7, i64 1
%17 = icmp ult i64 %6, 2
br i1 %17, label %18, label %4
18: ; preds = %13, %2
%19 = phi i64 [ 0, %2 ], [ %14, %13 ]
ret i64 %19
}
/* Type definitions */
typedef scalar_t__ uint8_t;
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ ASSERT(int);
void USBDevAddrSet(uint32_t ui32Base, uint32_t ui32Address) {
  ASSERT(ui32Base == 0x40050000);
  (*((volatile uint8_t *)(ui32Base + 0x00000000))) = (uint8_t)ui32Address;
}


x86 assembly (clang, -O0):
<USBDevAddrSet>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x40050000,-0x4(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <ASSERT@plt>
movslq -0x8(%rbp),%rcx
mov    -0x4(%rbp),%eax
add    $0x0,%eax
cltq
mov    %rcx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<USBDevAddrSet>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
xor    %edi,%edi
cmp    $0x40050000,%ebp
sete   %dil
call   1030 <ASSERT@plt>
movslq %ebx,%rax
movslq %ebp,%rcx
mov    %rax,(%rcx)
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define void @USBDevAddrSet(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 = icmp eq i32 %5, 1074069504
%7 = zext i1 %6 to i32
%8 = call i32 @ASSERT(i32 %7)
%9 = load i32, i32* %4
%10 = sext i32 %9 to i64
%11 = load i32, i32* %3
%12 = add nsw i32 %11, 0
%13 = sext i32 %12 to i64
%14 = inttoptr i64 %13 to i64*
store volatile i64 %10, i64* %14
ret void
}

LLVM IR (-O2):
define void @USBDevAddrSet(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, 1074069504
%4 = zext i1 %3 to i32
%5 = tail call i32 @ASSERT(i32 %4)
%6 = sext i32 %1 to i64
%7 = sext i32 %0 to i64
%8 = inttoptr i64 %7 to i64*
store volatile i64 %6, i64* %8
ret void
}
void debugfs_dma_buf_set(struct dma_buf *dma_buf) {}


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

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

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

LLVM IR (-O2):
%struct.dma_buf = type opaque
define void @debugfs_dma_buf_set(%struct.dma_buf* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ strlen(char *);
int /*<<< orphan*/ write(int, char *, int /*<<< orphan*/);
void pute(char *mess) { write(2, mess, strlen(mess)); }


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

x86 assembly (clang, -O2):
<pute>:
push   %rbx
mov    %rdi,%rbx
call   1040 <strlen@plt>
mov    $0x2,%edi
mov    %rbx,%rsi
mov    %eax,%edx
pop    %rbx
jmp    1030 <write@plt>

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

LLVM IR (-O2):
define void @pute(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = tail call i32 @write(i32 2, i8* %0, i32 %2)
ret void
}
/* Type definitions */
struct stat {
  int dummy;
};

/* Variables and functions */
int ENOENT;
int errno;
int stat(char const *, struct stat *);
int path_exists(const char *path) {
  struct stat statbuf;
  int ret;
  ret = stat(path, &statbuf);
  if (ret < 0) {
    if (errno == ENOENT)
      return 0;
    else
      return -errno;
  }
  return 1;
}


x86 assembly (clang, -O0):
<path_exists>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1030 <stat@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
jge    116d <path_exists+0x5d>
mov    0x2ea3(%rip),%rax
mov    (%rax),%eax
mov    0x2e8a(%rip),%rcx
cmp    (%rcx),%eax
jne    115a <path_exists+0x4a>
movl   $0x0,-0x4(%rbp)
jmp    1174 <path_exists+0x64>
xor    %eax,%eax
mov    0x2e7d(%rip),%rcx
sub    (%rcx),%eax
mov    %eax,-0x4(%rbp)
jmp    1174 <path_exists+0x64>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<path_exists>:
push   %rax
mov    %rsp,%rsi
call   1030 <stat@plt>
mov    %eax,%ecx
mov    $0x1,%eax
test   %ecx,%ecx
js     1126 <path_exists+0x16>
pop    %rcx
ret
mov    0x2eb3(%rip),%rax
mov    (%rax),%ecx
mov    0x2e9a(%rip),%rdx
mov    %ecx,%esi
neg    %esi
xor    %eax,%eax
cmp    (%rdx),%ecx
cmovne %esi,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
@errno = global i32 0
@ENOENT = global i32 0
define i32 @path_exists(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca %struct.stat
%5 = alloca i32
store i8* %0, i8** %3
%6 = load i8*, i8** %3
%7 = call i32 @stat(i8* %6, %struct.stat* %4)
store i32 %7, i32* %5
%8 = load i32, i32* %5
%9 = icmp slt i32 %8, 0
br i1 %9, label %10, label %18
10: ; preds = %1
%11 = load i32, i32* @errno
%12 = load i32, i32* @ENOENT
%13 = icmp eq i32 %11, %12
br i1 %13, label %14, label %15
14: ; preds = %10
store i32 0, i32* %2
br label %19
15: ; preds = %10
%16 = load i32, i32* @errno
%17 = sub nsw i32 0, %16
store i32 %17, i32* %2
br label %19
18: ; preds = %1
store i32 1, i32* %2
br label %19
19: ; preds = %18, %15, %14
%20 = load i32, i32* %2
ret i32 %20
}

LLVM IR (-O2):
%struct.stat = type { i32 }
@errno = global i32 0
@ENOENT = global i32 0
define i32 @path_exists(i8* nocapture %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i32 @stat(i8* %0, %struct.stat* %2)
%5 = icmp slt i32 %4, 0
br i1 %5, label %6, label %12
6: ; preds = %1
%7 = load i32, i32* @errno
%8 = load i32, i32* @ENOENT
%9 = icmp eq i32 %7, %8
%10 = sub nsw i32 0, %7
%11 = select i1 %9, i32 0, i32 %10
br label %12
12: ; preds = %6, %1
%13 = phi i32 [ 1, %1 ], [ %11, %6 ]
ret i32 %13
}
/* Variables and functions */
char *gettext(char *);
int /*<<< orphan*/ printf(char *);
void printmenu() {
  printf(gettext("1. New patient\n"));
  printf(gettext("2. Send Patient in\n"));
  printf(gettext("3. exit\n"));
}


x86 assembly (clang, -O0):
<printmenu>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <gettext@plt>
mov    %rax,%rdi
call   1040 <printf@plt>
lea    0xed1(%rip),%rdi
call   1030 <gettext@plt>
mov    %rax,%rdi
call   1040 <printf@plt>
lea    0xed1(%rip),%rdi
call   1030 <gettext@plt>
mov    %rax,%rdi
call   1040 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<printmenu>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <gettext@plt>
mov    %rax,%rdi
call   1040 <printf@plt>
lea    0xed4(%rip),%rdi
call   1030 <gettext@plt>
mov    %rax,%rdi
call   1040 <printf@plt>
lea    0xed4(%rip),%rdi
call   1030 <gettext@plt>
mov    %rax,%rdi
pop    %rax
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"1. New patient\0A\00"
@.str.1 = [20 x i8] c"2. Send Patient in\0A\00"
@.str.2 = [9 x i8] c"3. exit\0A\00"
define void @printmenu() {
%1 = call i8* @gettext(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* %1)
%3 = call i8* @gettext(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 @printf(i8* %3)
%5 = call i8* @gettext(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0))
%6 = call i32 @printf(i8* %5)
ret void
}

LLVM IR (-O2):
@.str = [16 x i8] c"1. New patient\0A\00"
@.str.1 = [20 x i8] c"2. Send Patient in\0A\00"
@.str.2 = [9 x i8] c"3. exit\0A\00"
define void @printmenu() {
%1 = tail call i8* @gettext(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @printf(i8* dereferenceable(1) %1)
%3 = tail call i8* @gettext(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0))
%4 = tail call i32 @printf(i8* dereferenceable(1) %3)
%5 = tail call i8* @gettext(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0))
%6 = tail call i32 @printf(i8* dereferenceable(1) %5)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void help() {
  fprintf(stderr, "k2d usage:\n");
  fprintf(stderr, "./k2d -k <int> -d <string> -o <string>\n");
}


x86 assembly (clang, -O0):
<help>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2eb0(%rip),%rax
mov    (%rax),%edi
lea    0xed3(%rip),%rsi
call   1030 <fprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<help>:
push   %rbx
mov    0x2ec8(%rip),%rbx
mov    (%rbx),%edi
lea    0xedf(%rip),%rsi
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xedd(%rip),%rsi
pop    %rbx
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [12 x i8] c"k2d usage:\0A\00"
@.str.1 = [40 x i8] c"./k2d -k <int> -d <string> -o <string>\0A\00"
define void @help() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stderr
%4 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [12 x i8] c"k2d usage:\0A\00"
@.str.1 = [40 x i8] c"./k2d -k <int> -d <string> -o <string>\0A\00"
define void @help() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;
struct timeval {
  int /*<<< orphan*/ tv_sec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
uint32_t PICO_TIME(void) {
  struct timeval t;
  gettimeofday(&t, NULL);
  return (uint32_t)t.tv_sec;
}


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

x86 assembly (clang, -O2):
<PICO_TIME>:
push   %rax
mov    %rsp,%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
mov    (%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.timeval = type { i32 }
define i32 @PICO_TIME() {
%1 = alloca %struct.timeval
%2 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%3 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%4 = load i32, i32* %3
ret i32 %4
}

LLVM IR (-O2):
%struct.timeval = type { i32 }
define i32 @PICO_TIME() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%5 = load i32, i32* %4
ret i32 %5
}
char *get_line(p, out)
char *p, *out;
{
  while (*p && *p != '\n') {
    *out++ = *p++;
  }
  *out = 0;
  if (*p)
    p++;
  return p;
}


x86 assembly (clang, -O0):
<get_line>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x11(%rbp)
je     1131 <get_line+0x31>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0xa,%eax
setne  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    1141 <get_line+0x41>
jmp    1168 <get_line+0x68>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
mov    (%rax),%cl
mov    -0x10(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x10(%rbp)
mov    %cl,(%rax)
jmp    110c <get_line+0xc>
mov    -0x10(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1188 <get_line+0x88>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_line>:
mov    %rdi,%rax
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movzbl (%rax),%ecx
test   %cl,%cl
je     1128 <get_line+0x28>
cmp    $0xa,%cl
je     1128 <get_line+0x28>
add    $0x1,%rax
mov    %cl,(%rsi)
add    $0x1,%rsi
jmp    1110 <get_line+0x10>
movb   $0x0,(%rsi)
cmpb   $0x1,(%rax)
sbb    $0xffffffffffffffff,%rax
ret

LLVM IR (-O0):
define i8* @get_line(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
br label %5
5: ; preds = %17, %2
%6 = load i8*, i8** %3
%7 = load i8, i8* %6
%8 = sext i8 %7 to i32
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %15
10: ; preds = %5
%11 = load i8*, i8** %3
%12 = load i8, i8* %11
%13 = sext i8 %12 to i32
%14 = icmp ne i32 %13, 10
br label %15
15: ; preds = %10, %5
%16 = phi i1 [ false, %5 ], [ %14, %10 ]
br i1 %16, label %17, label %23
17: ; preds = %15
%18 = load i8*, i8** %3
%19 = getelementptr inbounds i8, i8* %18, i32 1
store i8* %19, i8** %3
%20 = load i8, i8* %18
%21 = load i8*, i8** %4
%22 = getelementptr inbounds i8, i8* %21, i32 1
store i8* %22, i8** %4
store i8 %20, i8* %21
br label %5
23: ; preds = %15
%24 = load i8*, i8** %4
store i8 0, i8* %24
%25 = load i8*, i8** %3
%26 = load i8, i8* %25
%27 = icmp ne i8 %26, 0
br i1 %27, label %28, label %31
28: ; preds = %23
%29 = load i8*, i8** %3
%30 = getelementptr inbounds i8, i8* %29, i32 1
store i8* %30, i8** %3
br label %31
31: ; preds = %28, %23
%32 = load i8*, i8** %3
ret i8* %32
}

LLVM IR (-O2):
define i8* @get_line(i8* %0, i8* nocapture writeonly %1) {
br label %3
3: ; preds = %7, %2
%4 = phi i8* [ %0, %2 ], [ %8, %7 ]
%5 = phi i8* [ %1, %2 ], [ %9, %7 ]
%6 = load i8, i8* %4
switch i8 %6, label %7 [
i8 0, label %10
i8 10, label %10
]
7: ; preds = %3
%8 = getelementptr inbounds i8, i8* %4, i64 1
%9 = getelementptr inbounds i8, i8* %5, i64 1
store i8 %6, i8* %5
br label %3
10: ; preds = %3, %3
store i8 0, i8* %5
%11 = load i8, i8* %4
%12 = icmp ne i8 %11, 0
%13 = zext i1 %12 to i64
%14 = getelementptr i8, i8* %4, i64 %13
ret i8* %14
}
/* Type definitions */
typedef int /*<<< orphan*/ clockid_t;

/* Variables and functions */
void cdecl_type__clockid_t(clockid_t *unused) {}


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

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

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

LLVM IR (-O2):
define void @cdecl_type__clockid_t(i32* nocapture %0) {
ret void
}
int my_atoi(char *nbr) { int reste; }


x86 assembly (clang, -O0):
<my_atoi>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @my_atoi(i8* nocapture readnone %0) {
ret i32 undef
}
void nrf_wdt_init() {}


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

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

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

LLVM IR (-O2):
define void @nrf_wdt_init() {
ret void
}
double Dot4D(int tbl[], double x, double y, double z, double w) {
  return tbl[0] * x + tbl[1] * y + tbl[2] * z + tbl[3] * w;
}


x86 assembly (clang, -O0):
<Dot4D>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  %xmm2,-0x20(%rbp)
movsd  %xmm3,-0x28(%rbp)
mov    -0x8(%rbp),%rax
cvtsi2sdl (%rax),%xmm0
movsd  -0x10(%rbp),%xmm2
mov    -0x8(%rbp),%rax
cvtsi2sdl 0x4(%rax),%xmm1
mulsd  -0x18(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x8(%rbp),%rax
cvtsi2sdl 0x8(%rax),%xmm1
movsd  -0x20(%rbp),%xmm2
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
mov    -0x8(%rbp),%rax
cvtsi2sdl 0xc(%rax),%xmm0
movsd  -0x28(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<Dot4D>:
cvtsi2sdl (%rdi),%xmm4
cvtsi2sdl 0x4(%rdi),%xmm5
mulsd  %xmm1,%xmm5
mulsd  %xmm4,%xmm0
addsd  %xmm5,%xmm0
xorps  %xmm1,%xmm1
cvtsi2sdl 0x8(%rdi),%xmm1
mulsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
xorps  %xmm1,%xmm1
cvtsi2sdl 0xc(%rdi),%xmm1
mulsd  %xmm3,%xmm1
addsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @Dot4D(i32* %0, double %1, double %2, double %3, double %4) {
%6 = alloca i32*
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = alloca double
store i32* %0, i32** %6
store double %1, double* %7
store double %2, double* %8
store double %3, double* %9
store double %4, double* %10
%11 = load i32*, i32** %6
%12 = getelementptr inbounds i32, i32* %11, i64 0
%13 = load i32, i32* %12
%14 = sitofp i32 %13 to double
%15 = load double, double* %7
%16 = load i32*, i32** %6
%17 = getelementptr inbounds i32, i32* %16, i64 1
%18 = load i32, i32* %17
%19 = sitofp i32 %18 to double
%20 = load double, double* %8
%21 = fmul double %19, %20
%22 = call double @llvm.fmuladd.f64(double %14, double %15, double %21)
%23 = load i32*, i32** %6
%24 = getelementptr inbounds i32, i32* %23, i64 2
%25 = load i32, i32* %24
%26 = sitofp i32 %25 to double
%27 = load double, double* %9
%28 = call double @llvm.fmuladd.f64(double %26, double %27, double %22)
%29 = load i32*, i32** %6
%30 = getelementptr inbounds i32, i32* %29, i64 3
%31 = load i32, i32* %30
%32 = sitofp i32 %31 to double
%33 = load double, double* %10
%34 = call double @llvm.fmuladd.f64(double %32, double %33, double %28)
ret double %34
}

LLVM IR (-O2):
define double @Dot4D(i32* nocapture %0, double %1, double %2, double %3, double %4) {
%6 = load i32, i32* %0
%7 = sitofp i32 %6 to double
%8 = getelementptr inbounds i32, i32* %0, i64 1
%9 = load i32, i32* %8
%10 = sitofp i32 %9 to double
%11 = fmul double %10, %2
%12 = tail call double @llvm.fmuladd.f64(double %7, double %1, double %11)
%13 = getelementptr inbounds i32, i32* %0, i64 2
%14 = load i32, i32* %13
%15 = sitofp i32 %14 to double
%16 = tail call double @llvm.fmuladd.f64(double %15, double %3, double %12)
%17 = getelementptr inbounds i32, i32* %0, i64 3
%18 = load i32, i32* %17
%19 = sitofp i32 %18 to double
%20 = tail call double @llvm.fmuladd.f64(double %19, double %4, double %16)
ret double %20
}
int ft_isprint(int c) {
  if (c > 31 && c < 127)
    return (1);
  return (0);
}


x86 assembly (clang, -O0):
<ft_isprint>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x1f,-0x8(%rbp)
jle    1127 <ft_isprint+0x27>
cmpl   $0x7f,-0x8(%rbp)
jge    1127 <ft_isprint+0x27>
movl   $0x1,-0x4(%rbp)
jmp    112e <ft_isprint+0x2e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_isprint>:
add    $0xffffffe0,%edi
xor    %eax,%eax
cmp    $0x5f,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @ft_isprint(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp sgt i32 %4, 31
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i32, i32* %3
%8 = icmp slt i32 %7, 127
br i1 %8, label %9, label %10
9: ; preds = %6
store i32 1, i32* %2
br label %11
10: ; preds = %6, %1
store i32 0, i32* %2
br label %11
11: ; preds = %10, %9
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
define i32 @ft_isprint(i32 %0) {
%2 = add i32 %0, -32
%3 = icmp ult i32 %2, 95
%4 = zext i1 %3 to i32
ret i32 %4
}
int f_1x(void) { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @f_1x() {
ret i32 1
}
/* Type definitions */
typedef int /*<<< orphan*/ mode_t;

/* Variables and functions */
int S_ISCHR(int /*<<< orphan*/);
int s_ischr(mode_t mode) { return S_ISCHR(mode); }


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

x86 assembly (clang, -O2):
<s_ischr>:
jmp    1030 <S_ISCHR@plt>

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

LLVM IR (-O2):
define i32 @s_ischr(i32 %0) {
%2 = tail call i32 @S_ISCHR(i32 %0)
ret i32 %2
}
int is_numeric(const char c) { return ('0' <= c && '9' >= c); }


x86 assembly (clang, -O0):
<is_numeric>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edx
xor    %eax,%eax
mov    $0x30,%ecx
cmp    %edx,%ecx
mov    %al,-0x2(%rbp)
jg     1131 <is_numeric+0x31>
movsbl -0x1(%rbp),%ecx
mov    $0x39,%eax
cmp    %ecx,%eax
setge  %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_numeric>:
add    $0xd0,%dil
xor    %eax,%eax
cmp    $0xa,%dil
setb   %al
ret

LLVM IR (-O0):
define i32 @is_numeric(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp sle i32 48, %4
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp sge i32 57, %8
br label %10
10: ; preds = %6, %1
%11 = phi i1 [ false, %1 ], [ %9, %6 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @is_numeric(i8 signext %0) {
%2 = add i8 %0, -48
%3 = icmp ult i8 %2, 10
%4 = zext i1 %3 to i32
ret i32 %4
}
int rmdir(const char *pathname) { return -1; }


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

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

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

LLVM IR (-O2):
define i32 @rmdir(i8* nocapture readnone %0) {
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ gets(char *);
int /*<<< orphan*/ printf(char *, int, int, int, char *);
void func(int param1, int param2, int param3) {
  char buf[8];
  gets(buf);
  printf("%d %d %d %s\n", param1, param2, param3, buf);
}


x86 assembly (clang, -O0):
<func>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
lea    -0x14(%rbp),%rdi
call   1040 <gets@plt>
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    -0xc(%rbp),%ecx
lea    -0x14(%rbp),%r8
lea    0xeb2(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<func>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %edx,%r14d
mov    %esi,%ebp
mov    %edi,%ebx
mov    %rsp,%r15
mov    %r15,%rdi
call   1040 <gets@plt>
lea    0xec0(%rip),%rdi
mov    %ebx,%esi
mov    %ebp,%edx
mov    %r14d,%ecx
mov    %r15,%r8
call   1030 <printf@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [13 x i8] c"%d %d %d %s\0A\00"
define void @func(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca [8 x i8]
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = getelementptr inbounds [8 x i8], [8 x i8]* %7, i64 0, i64 0
%9 = call i32 @gets(i8* %8)
%10 = load i32, i32* %4
%11 = load i32, i32* %5
%12 = load i32, i32* %6
%13 = getelementptr inbounds [8 x i8], [8 x i8]* %7, i64 0, i64 0
%14 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %10, i32 %11, i32 %12, i8* %13)
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c"%d %d %d %s\0A\00"
define void @func(i32 %0, i32 %1, i32 %2) {
%4 = alloca [8 x i8]
%5 = getelementptr inbounds [8 x i8], [8 x i8]* %4, i64 0, i64 0
%6 = call i32 @gets(i8* %5)
%7 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1, i32 %2, i8* %5)
ret void
}