xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ internal_fiat_p256_sub(uintptr_t, uintptr_t, uintptr_t);
void fiat_p256_sub(uint32_t out1[8], const uint32_t arg1[8],
                   const uint32_t arg2[8]) {
  internal_fiat_p256_sub((uintptr_t)out1, (uintptr_t)arg1, (uintptr_t)arg2);
}


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

x86 assembly (clang, -O2):
<fiat_p256_sub>:
jmp    1030 <internal_fiat_p256_sub@plt>

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

LLVM IR (-O2):
define void @fiat_p256_sub(i32* %0, i32* %1, i32* %2) {
%4 = ptrtoint i32* %0 to i64
%5 = ptrtoint i32* %1 to i64
%6 = ptrtoint i32* %2 to i64
%7 = tail call i32 @internal_fiat_p256_sub(i64 %4, i64 %5, i64 %6)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ e_abs();
int /*<<< orphan*/ e_lda();
void e_lda_abs() {
  e_abs();
  e_lda();
}


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

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

LLVM IR (-O0):
define void @e_lda_abs() {
%1 = call i32 (...) @e_abs()
%2 = call i32 (...) @e_lda()
ret void
}

LLVM IR (-O2):
define void @e_lda_abs() {
%1 = tail call i32 (...) @e_abs()
%2 = tail call i32 (...) @e_lda()
ret void
}
/* Variables and functions */
size_t backtrace(void **, int);
int /*<<< orphan*/ backtrace_symbols_fd(void **, size_t, int);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int);
int /*<<< orphan*/ stderr;
void print_backtrace(int signal) {
  void *array[10];
  size_t size;
  size = backtrace(array, 10);
  fprintf(stderr, "Error: signal %d:\n", signal);
  backtrace_symbols_fd(array, size, 2);
  exit(1);
}


x86 assembly (clang, -O0):
<print_backtrace>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
mov    %edi,-0x4(%rbp)
lea    -0x60(%rbp),%rdi
mov    $0xa,%esi
call   1040 <backtrace@plt>
mov    %rax,-0x68(%rbp)
mov    0x2e7c(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%edx
lea    0xe90(%rip),%rsi
call   1050 <fprintf@plt>
lea    -0x60(%rbp),%rdi
mov    -0x68(%rbp),%rsi
mov    $0x2,%edx
call   1030 <backtrace_symbols_fd@plt>
mov    $0x1,%edi
call   1060 <exit@plt>

x86 assembly (clang, -O2):
<print_backtrace>:
push   %rbp
push   %r14
push   %rbx
sub    $0x50,%rsp
mov    %edi,%ebp
mov    %rsp,%r14
mov    %r14,%rdi
mov    $0xa,%esi
call   1040 <backtrace@plt>
mov    %rax,%rbx
mov    0x2e7c(%rip),%rax
mov    (%rax),%edi
lea    0xe93(%rip),%rsi
mov    %ebp,%edx
call   1050 <fprintf@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    $0x2,%edx
call   1030 <backtrace_symbols_fd@plt>
mov    $0x1,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [19 x i8] c"Error: signal %d:\0A\00"
define void @print_backtrace(i32 %0) {
%2 = alloca i32
%3 = alloca [10 x i8*]
%4 = alloca i64
store i32 %0, i32* %2
%5 = getelementptr inbounds [10 x i8*], [10 x i8*]* %3, i64 0, i64 0
%6 = call i64 @backtrace(i8** %5, i32 10)
store i64 %6, i64* %4
%7 = load i32, i32* @stderr
%8 = load i32, i32* %2
%9 = call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %8)
%10 = getelementptr inbounds [10 x i8*], [10 x i8*]* %3, i64 0, i64 0
%11 = load i64, i64* %4
%12 = call i32 @backtrace_symbols_fd(i8** %10, i64 %11, i32 2)
%13 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [19 x i8] c"Error: signal %d:\0A\00"
define void @print_backtrace(i32 %0) {
%2 = alloca [10 x i8*]
%3 = bitcast [10 x i8*]* %2 to i8*
%4 = getelementptr inbounds [10 x i8*], [10 x i8*]* %2, i64 0, i64 0
%5 = call i64 @backtrace(i8** %4, i32 10)
%6 = load i32, i32* @stderr
%7 = call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %0)
%8 = call i32 @backtrace_symbols_fd(i8** %4, i64 %5, i32 2)
%9 = call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ sesc_exit(int /*<<< orphan*/);
int sesc_commit() {
  sesc_exit(0);
  return 1;
}


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

x86 assembly (clang, -O2):
<sesc_commit>:
push   %rax
xor    %edi,%edi
call   1030 <sesc_exit@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @sesc_commit() {
%1 = call i32 @sesc_exit(i32 0)
ret i32 1
}

LLVM IR (-O2):
define i32 @sesc_commit() {
%1 = tail call i32 @sesc_exit(i32 0)
ret i32 1
}
char const *_Locale_extract_time_name(const char *__DUMMY_PAR1,
                                      char *__DUMMY_PAR,
                                      struct _Locale_name_hint *hint) {
  return 0;
}


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

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

LLVM IR (-O0):
%struct._Locale_name_hint = type opaque
define i8* @_Locale_extract_time_name(i8* %0, i8* %1, %struct._Locale_name_hint* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca %struct._Locale_name_hint*
store i8* %0, i8** %4
store i8* %1, i8** %5
store %struct._Locale_name_hint* %2, %struct._Locale_name_hint** %6
ret i8* null
}

LLVM IR (-O2):
%struct._Locale_name_hint = type opaque
define noalias i8* @_Locale_extract_time_name(i8* nocapture readnone %0, i8* nocapture readnone %1, %struct._Locale_name_hint* nocapture readnone %2) {
ret i8* null
}
/* Variables and functions */
int /*<<< orphan*/ Die(char *);
void *malloc(size_t);
void *MallocOrDie(size_t size) {
  void *ptr;
  if ((ptr = malloc(size)) == NULL)
    Die("malloc failed");
  return ptr;
}


x86 assembly (clang, -O0):
<MallocOrDie>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
jne    114f <MallocOrDie+0x2f>
lea    0xeb6(%rip),%rdi
call   1040 <Die@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<MallocOrDie>:
push   %rbx
call   1030 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    113a <MallocOrDie+0x1a>
lea    0xecb(%rip),%rdi
call   1040 <Die@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"malloc failed\00"
define i8* @MallocOrDie(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = icmp eq i8* %5, null
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = call i32 @Die(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %9
9: ; preds = %7, %1
%10 = load i8*, i8** %3
ret i8* %10
}

LLVM IR (-O2):
@.str = [14 x i8] c"malloc failed\00"
define noalias i8* @MallocOrDie(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @Die(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %1
ret i8* %2
}
const char *__attribute__((no)) strong_n1(void) { return "strong_n1"; }


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

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

LLVM IR (-O0):
@.str = [10 x i8] c"strong_n1\00"
define i8* @strong_n1() {
ret i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [10 x i8] c"strong_n1\00"
define i8* @strong_n1() {
ret i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ ReverseGPIOP__0__In__clr();
void ReverseGPIOP__0__Out__set(void) { ReverseGPIOP__0__In__clr(); }


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

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

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

LLVM IR (-O2):
define void @ReverseGPIOP__0__Out__set() {
%1 = tail call i32 (...) @ReverseGPIOP__0__In__clr()
ret void
}
/* Type definitions */
struct timespec {
  int member_0;
  int /*<<< orphan*/ member_1;
};

/* Variables and functions */
int /*<<< orphan*/ nanosleep(struct timespec *, int /*<<< orphan*/);
int main(int argc, char *argv[]) {
  struct timespec t = {1, 0};
  while (1) {
    nanosleep(&t, 0);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0xed3(%rip),%rax
mov    %rax,-0x18(%rbp)
lea    -0x18(%rbp),%rdi
xor    %esi,%esi
call   1030 <nanosleep@plt>
jmp    1131 <main+0x21>

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
movq   $0x1,0x8(%rsp)
lea    0x8(%rsp),%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %rbx,%rdi
xor    %esi,%esi
call   1030 <nanosleep@plt>
jmp    1130 <main+0x20>

LLVM IR (-O0):
%struct.timespec = type { i32, i32 }
@__const.main.t = %struct.timespec { i32 1, i32 0 }
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca %struct.timespec
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = bitcast %struct.timespec* %6 to i8*
br label %8
8: ; preds = %2, %8
%9 = call i32 @nanosleep(%struct.timespec* %6, i32 0)
br label %8
}

LLVM IR (-O2):
%struct.timespec = type { i32, i32 }
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i64
%4 = bitcast i64* %3 to %struct.timespec*
%5 = bitcast i64* %3 to i8*
store i64 1, i64* %3
br label %6
6: ; preds = %6, %2
%7 = call i32 @nanosleep(%struct.timespec* %4, i32 0)
br label %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int main(void) {
  int n;
  printf("Enter any number to check whether it is positive or negative: ");
  scanf("%d", &n);
  if (n > 0)
    printf("\nThe number is positive");
  else
    printf("\nThe number is negative");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
call   1030 <printf@plt>
lea    0xefd(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
cmpl   $0x0,-0x8(%rbp)
jle    1166 <main+0x46>
lea    0xee6(%rip),%rdi
call   1030 <printf@plt>
jmp    1172 <main+0x52>
lea    0xeed(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <printf@plt>
lea    0xf0b(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
cmpl   $0x0,0x4(%rsp)
lea    0xef8(%rip),%rax
lea    0xf09(%rip),%rdi
cmovg  %rax,%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [63 x i8] c"Enter any number to check whether it is positive or negative: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [24 x i8] c"\0AThe number is positive\00"
@.str.3 = [24 x i8] c"\0AThe number is negative\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @printf(i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%5 = load i32, i32* %2
%6 = icmp sgt i32 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %0
%8 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0))
br label %11
9: ; preds = %0
%10 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.3, i64 0, i64 0))
br label %11
11: ; preds = %9, %7
ret i32 0
}

LLVM IR (-O2):
@.str = [63 x i8] c"Enter any number to check whether it is positive or negative: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [24 x i8] c"\0AThe number is positive\00"
@.str.3 = [24 x i8] c"\0AThe number is negative\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([63 x i8], [63 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = icmp sgt i32 %5, 0
%7 = select i1 %6, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.3, i64 0, i64 0)
%8 = call i32 @printf(i8* dereferenceable(1) %7)
ret i32 0
}
__attribute__((format_arg(1))) __attribute__((format_arg(2))) const char *
Q_(const char *msgid, const char *plu, unsigned long n) {
  if (0)
    return "# GETTEXT POISON #";
  return n == 1 ? msgid : plu;
}


x86 assembly (clang, -O0):
<Q_>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
cmpq   $0x1,-0x18(%rbp)
jne    1128 <Q_+0x28>
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
jmp    1130 <Q_+0x30>
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Q_>:
mov    %rdi,%rax
cmp    $0x1,%rdx
cmovne %rsi,%rax
ret

LLVM IR (-O0):
define i8* @Q_(i8* %0, i8* %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
store i8* %0, i8** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%7 = load i64, i64* %6
%8 = icmp eq i64 %7, 1
br i1 %8, label %9, label %11
9: ; preds = %3
%10 = load i8*, i8** %4
br label %13
11: ; preds = %3
%12 = load i8*, i8** %5
br label %13
13: ; preds = %11, %9
%14 = phi i8* [ %10, %9 ], [ %12, %11 ]
ret i8* %14
}

LLVM IR (-O2):
define i8* @Q_(i8* readnone %0, i8* readnone %1, i64 %2) {
%4 = icmp eq i64 %2, 1
%5 = select i1 %4, i8* %0, i8* %1
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_context_get_card_info_by_name() {
  printf("NOT IMPLEMENTED:"
         "pa_context_get_card_info_by_name"
         "\n");
}


x86 assembly (clang, -O0):
<pa_context_get_card_info_by_name>:
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_context_get_card_info_by_name>:
lea    0xee9(%rip),%rdi
jmp    1030 <puts@plt>

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

LLVM IR (-O2):
@str = [49 x i8] c"NOT IMPLEMENTED:pa_context_get_card_info_by_name\00"
define i32 @pa_context_get_card_info_by_name() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([49 x i8], [49 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
long long strtoll(char const *, int /*<<< orphan*/ *, int);
long long atoll(const char *s) { return strtoll(s, NULL, 10); }


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

x86 assembly (clang, -O2):
<atoll>:
xor    %esi,%esi
mov    $0xa,%edx
jmp    1030 <strtoll@plt>

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

LLVM IR (-O2):
define i64 @atoll(i8* nocapture %0) {
%2 = tail call i64 @strtoll(i8* nocapture %0, i32* null, i32 10)
ret i64 %2
}
void X509_REQ_dup(void) {}


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

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

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

LLVM IR (-O2):
define void @X509_REQ_dup() {
ret void
}
void ft_striteri(char *s, void (*f)(unsigned int, char *)) {
  unsigned int i;
  i = 0;
  while (*s != '\0')
    f(i++, s++);
}


x86 assembly (clang, -O0):
<ft_striteri>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     114c <ft_striteri+0x4c>
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%edi
mov    %edi,%ecx
add    $0x1,%ecx
mov    %ecx,-0x14(%rbp)
mov    -0x8(%rbp),%rsi
mov    %rsi,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
call   *%rax
jmp    1117 <ft_striteri+0x17>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_striteri>:
push   %r15
push   %r14
push   %rbx
cmpb   $0x0,(%rdi)
je     1135 <ft_striteri+0x35>
mov    %rsi,%r14
mov    %rdi,%r15
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
lea    (%r15,%rbx,1),%rsi
mov    %ebx,%edi
call   *%r14
cmpb   $0x0,0x1(%r15,%rbx,1)
lea    0x1(%rbx),%rbx
jne    1120 <ft_striteri+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @ft_striteri(i8* %0, void (i32, i8*)* nocapture %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %12, label %5
5: ; preds = %2, %5
%6 = phi i32 [ %8, %5 ], [ 0, %2 ]
%7 = phi i8* [ %9, %5 ], [ %0, %2 ]
%8 = add i32 %6, 1
%9 = getelementptr inbounds i8, i8* %7, i64 1
tail call void %1(i32 %6, i8* %7)
%10 = load i8, i8* %9
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %5
12: ; preds = %5, %2
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ __u64;

/* Variables and functions */
int /*<<< orphan*/ hea_set_u64_bits(int /*<<< orphan*/, int /*<<< orphan*/, int,
                                    int);
void hea_cq_aer_mem_access_err_reset(__u64 *aer) {
  *aer = hea_set_u64_bits(*aer, 0, 10, 33);
}


x86 assembly (clang, -O0):
<hea_cq_aer_mem_access_err_reset>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
xor    %esi,%esi
mov    $0xa,%edx
mov    $0x21,%ecx
call   1030 <hea_set_u64_bits@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hea_cq_aer_mem_access_err_reset>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%edi
xor    %esi,%esi
mov    $0xa,%edx
mov    $0x21,%ecx
call   1030 <hea_set_u64_bits@plt>
mov    %eax,(%rbx)
pop    %rbx
ret

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

LLVM IR (-O2):
define void @hea_cq_aer_mem_access_err_reset(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = tail call i32 @hea_set_u64_bits(i32 %2, i32 0, i32 10, i32 33)
store i32 %3, i32* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _call_handler(char *, char *);
int /*<<< orphan*/ set_signal_handlers();
int main() {
  set_signal_handlers();
  _call_handler("swapoff", "/sbin/"
                           "swapoff");
  _call_handler("swapon", "/sbin/"
                          "swapon");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <set_signal_handlers@plt>
lea    0xec9(%rip),%rdi
lea    0xebc(%rip),%rsi
call   1040 <_call_handler@plt>
lea    0xec4(%rip),%rdi
lea    0xeb7(%rip),%rsi
call   1040 <_call_handler@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <set_signal_handlers@plt>
lea    0xed7(%rip),%rdi
lea    0xeca(%rip),%rsi
call   1040 <_call_handler@plt>
lea    0xed2(%rip),%rdi
lea    0xec5(%rip),%rsi
call   1040 <_call_handler@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [8 x i8] c"swapoff\00"
@.str.1 = [14 x i8] c"/sbin/swapoff\00"
@.str.2 = [7 x i8] c"swapon\00"
@.str.3 = [13 x i8] c"/sbin/swapon\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @set_signal_handlers()
%3 = call i32 @_call_handler(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 @_call_handler(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [8 x i8] c"swapoff\00"
@.str.1 = [14 x i8] c"/sbin/swapoff\00"
@.str.2 = [7 x i8] c"swapon\00"
@.str.3 = [13 x i8] c"/sbin/swapon\00"
define i32 @main() {
%1 = tail call i32 (...) @set_signal_handlers()
%2 = tail call i32 @_call_handler(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @_call_handler(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void usage() {
  printf(
      "Usage: random_ctl [-h] <action> [<action arguments...>]\n"
      "\n"
      "Commands:\n"
      "  get_entropy_cnt           Retrieve entropy count in input pool.\n"
      "  add_entropy_cnt <N>       Inc-/Decrease input pool entropy count with "
      "<N>.\n"
      "  add_entropy <N> <file>    Add <file> to input pool and increase "
      "entropy\n"
      "                            count with <N>.\n"
      "  add_random <file>         Mix content of <file> into blocking and "
      "non-blocking\n"
      "                            pool. The entropy count is not increased.\n"
      "  clear_pool                Clear entropy count of all random pools.\n"
      "\n"
      "If '-' is used as filename, data is read from stdin.\n");
}


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

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

LLVM IR (-O0):
@.str = [603 x i8] c"Usage: random_ctl [-h] <action> [<action arguments...>]\0A\0ACommands:\0A get_entropy_cnt Retrieve entropy count in input pool.\0A add_entropy_cnt <N> Inc-/Decrease input pool entropy count with <N>.\0A add_entropy <N> <file> Add <file> to input pool and increase entropy\0A count with <N>.\0A add_random <file> Mix content of <file> into blocking and non-blocking\0A pool. The entropy count is not increased.\0A clear_pool Clear entropy count of all random pools.\0A\0AIf '-' is used as filename, data is read from stdin.\0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([603 x i8], [603 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [602 x i8] c"Usage: random_ctl [-h] <action> [<action arguments...>]\0A\0ACommands:\0A get_entropy_cnt Retrieve entropy count in input pool.\0A add_entropy_cnt <N> Inc-/Decrease input pool entropy count with <N>.\0A add_entropy <N> <file> Add <file> to input pool and increase entropy\0A count with <N>.\0A add_random <file> Mix content of <file> into blocking and non-blocking\0A pool. The entropy count is not increased.\0A clear_pool Clear entropy count of all random pools.\0A\0AIf '-' is used as filename, data is read from stdin.\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([602 x i8], [602 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ roadmap_line_get_range(int);
int roadmap_range_get_street(int /*<<< orphan*/);
int roadmap_line_get_street(int line) {
  return roadmap_range_get_street(roadmap_line_get_range(line));
}


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

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

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

LLVM IR (-O2):
define i32 @roadmap_line_get_street(i32 %0) {
%2 = tail call i32 @roadmap_line_get_range(i32 %0)
%3 = tail call i32 @roadmap_range_get_street(i32 %2)
ret i32 %3
}
int int_divide_overflow(int a, int b) { return a / b; }


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

x86 assembly (clang, -O2):
<int_divide_overflow>:
mov    %edi,%eax
cltd
idiv   %esi
ret

LLVM IR (-O0):
define i32 @int_divide_overflow(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 = sdiv i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @int_divide_overflow(i32 %0, i32 %1) {
%3 = sdiv i32 %0, %1
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
float asfloat(uint32_t i) {
  union {
    uint32_t i;
    float f;
  } u = {i};
  return u.f;
}


x86 assembly (clang, -O0):
<asfloat>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
pop    %rbp
ret

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

LLVM IR (-O0):
%union.anon = type { i32 }
define float @asfloat(i32 %0) {
%2 = alloca i32
%3 = alloca %union.anon
store i32 %0, i32* %2
%4 = bitcast %union.anon* %3 to i32*
%5 = load i32, i32* %2
store i32 %5, i32* %4
%6 = bitcast %union.anon* %3 to float*
%7 = load float, float* %6
ret float %7
}

LLVM IR (-O2):
define float @asfloat(i32 %0) {
%2 = bitcast i32 %0 to float
ret float %2
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
size_t write_FP(int /*<<< orphan*/ *, int /*<<< orphan*/ const *, int);
size_t uint8WriteToFP(FILE *fp, const uint8_t *data) {
  return write_FP(fp, data, sizeof(uint8_t));
}


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

x86 assembly (clang, -O2):
<uint8WriteToFP>:
mov    $0x4,%edx
jmp    1030 <write_FP@plt>

LLVM IR (-O0):
define i64 @uint8WriteToFP(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 = call i64 @write_FP(i32* %5, i32* %6, i32 4)
ret i64 %7
}

LLVM IR (-O2):
define i64 @uint8WriteToFP(i32* %0, i32* %1) {
%3 = tail call i64 @write_FP(i32* %0, i32* %1, i32 4)
ret i64 %3
}
/* Variables and functions */
int values_equal_display_error(unsigned long const, unsigned long const);
int check_value(const unsigned long int value,
                const unsigned long int check_value_data) {
  return values_equal_display_error(value, check_value_data);
}


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

x86 assembly (clang, -O2):
<check_value>:
jmp    1030 <values_equal_display_error@plt>

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

LLVM IR (-O2):
define i32 @check_value(i64 %0, i64 %1) {
%3 = tail call i32 @values_equal_display_error(i64 %0, i64 %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
void test_exceptions(const char *test_name, short int exception,
                     int ignore_inexact) {
  printf("Test: %s\n", test_name);
}


x86 assembly (clang, -O0):
<test_exceptions>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %si,%ax
mov    %rdi,-0x8(%rbp)
mov    %ax,-0xa(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xecf(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_exceptions>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [10 x i8] c"Test: %s\0A\00"
define void @test_exceptions(i8* %0, i16 signext %1, i32 %2) {
%4 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ hfree(char *);
char *hstrdup(char *);
int do_string(char **dest, int argc, char **argv) {
  if (argc < 2)
    return -1;
  if (*dest)
    hfree(*dest);
  *dest = hstrdup(argv[1]);
  return 0;
}


x86 assembly (clang, -O0):
<do_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
cmpl   $0x2,-0x14(%rbp)
jge    1149 <do_string+0x29>
movl   $0xffffffff,-0x4(%rbp)
jmp    1181 <do_string+0x61>
mov    -0x10(%rbp),%rax
cmpq   $0x0,(%rax)
je     1163 <do_string+0x43>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1030 <hfree@plt>
mov    -0x20(%rbp),%rax
mov    0x8(%rax),%rdi
call   1040 <hstrdup@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_string>:
mov    $0xffffffff,%eax
cmp    $0x2,%esi
jl     1156 <do_string+0x36>
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rdi,%rbx
mov    (%rdi),%rdi
test   %rdi,%rdi
je     1141 <do_string+0x21>
call   1030 <hfree@plt>
mov    0x8(%r14),%rdi
call   1040 <hstrdup@plt>
mov    %rax,(%rbx)
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i32 @do_string(i8** nocapture %0, i32 %1, i8** nocapture %2) {
%4 = icmp slt i32 %1, 2
br i1 %4, label %14, label %5
5: ; preds = %3
%6 = load i8*, i8** %0
%7 = icmp eq i8* %6, null
br i1 %7, label %10, label %8
8: ; preds = %5
%9 = tail call i32 @hfree(i8* %6)
br label %10
10: ; preds = %8, %5
%11 = getelementptr inbounds i8*, i8** %2, i64 1
%12 = load i8*, i8** %11
%13 = tail call i8* @hstrdup(i8* %12)
store i8* %13, i8** %0
br label %14
14: ; preds = %3, %10
%15 = phi i32 [ 0, %10 ], [ -1, %3 ]
ret i32 %15
}
/* Variables and functions */
int /*<<< orphan*/ link_error();
void f13(unsigned long int s) {
  if ((unsigned long int)s == 0)
    return;
  if (s == 0)
    link_error();
}


x86 assembly (clang, -O0):
<f13>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    112c <f13+0x1c>
jmp    113e <f13+0x2e>
cmpq   $0x0,-0x8(%rbp)
jne    113e <f13+0x2e>
mov    $0x0,%al
call   1030 <link_error@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @f13(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %6
5: ; preds = %1
br label %11
6: ; preds = %1
%7 = load i64, i64* %2
%8 = icmp eq i64 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %6
%10 = call i32 (...) @link_error()
br label %11
11: ; preds = %5, %9, %6
ret void
}

LLVM IR (-O2):
define void @f13(i64 %0) {
ret void
}
/* Variables and functions */
int rand();
int Rand(int min, int max) { return (rand() % (max - min + 1)) + min; }


x86 assembly (clang, -O0):
<Rand>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
mov    -0x8(%rbp),%ecx
sub    -0x4(%rbp),%ecx
add    $0x1,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
add    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Rand>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
xor    %eax,%eax
call   1030 <rand@plt>
sub    %ebp,%ebx
add    $0x1,%ebx
cltd
idiv   %ebx
add    %edx,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @Rand(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = call i32 (...) @rand()
%6 = load i32, i32* %4
%7 = load i32, i32* %3
%8 = sub nsw i32 %6, %7
%9 = add nsw i32 %8, 1
%10 = srem i32 %5, %9
%11 = load i32, i32* %3
%12 = add nsw i32 %10, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @Rand(i32 %0, i32 %1) {
%3 = tail call i32 (...) @rand()
%4 = sub i32 1, %0
%5 = add i32 %4, %1
%6 = srem i32 %3, %5
%7 = add nsw i32 %6, %0
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void usage(char *program) {
  printf("\n");
  printf("Stop being dumb.\n");
  printf("Usage: %s <filename>\n", program);
  printf("\n");
}


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

x86 assembly (clang, -O2):
<usage>:
push   %rbx
mov    %rdi,%rbx
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xed1(%rip),%rdi
call   1040 <puts@plt>
lea    0xeaf(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0xa,%edi
pop    %rbx
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"\0A\00"
@.str.1 = [18 x i8] c"Stop being dumb.\0A\00"
@.str.2 = [22 x i8] c"Usage: %s <filename>\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0))
%5 = load i8*, i8** %2
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.2, i64 0, i64 0), i8* %5)
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str.2 = [22 x i8] c"Usage: %s <filename>\0A\00"
@str = [17 x i8] c"Stop being dumb.\00"
define void @usage(i8* %0) {
%2 = tail call i32 @putchar(i32 10)
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.2, i64 0, i64 0), i8* %0)
%5 = tail call i32 @putchar(i32 10)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ jmp_buf;

/* Variables and functions */
scalar_t__ a(char *, int /*<<< orphan*/);
int /*<<< orphan*/ b(int, int /*<<< orphan*/);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
main(int argc, char **argv) {
  jmp_buf env;
  if (a("KP", env) != 0)
    exit(0);
  b(3, env);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x14(%rbp),%esi
lea    0xeb7(%rip),%rdi
call   1040 <a@plt>
cmp    $0x0,%rax
je     115f <main+0x2f>
xor    %edi,%edi
call   1050 <exit@plt>
mov    -0x14(%rbp),%esi
mov    $0x3,%edi
call   1030 <b@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
call   1040 <a@plt>
test   %rax,%rax
jne    1150 <main+0x20>
mov    $0x3,%edi
call   1030 <b@plt>
xor    %eax,%eax
pop    %rcx
ret
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"KP\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca i32
store i32 %0, i32* %3
store i8** %1, i8*** %4
%6 = load i32, i32* %5
%7 = call i64 @a(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %6)
%8 = icmp ne i64 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = call i32 @exit(i32 0)
unreachable
11: ; preds = %2
%12 = load i32, i32* %5
%13 = call i32 @b(i32 3, i32 %12)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"KP\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i64 @a(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 undef)
%4 = icmp eq i64 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 @exit(i32 0)
unreachable
7: ; preds = %2
%8 = tail call i32 @b(i32 3, i32 undef)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int omp_get_max_threads();
int /*<<< orphan*/ omp_set_dynamic(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
main() {
  int thds;
  thds = omp_get_max_threads();
  if (thds == 1) {
    printf("should be run this program on multi threads.\n");
    exit(0);
  }
  omp_set_dynamic(0);
#pragma omp parallel
  {
#pragma omp single nowait nowait
    {}
  }
  printf("err_single 001 : FAILED, can not compile this program.\n");
  return 1;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1050 <omp_get_max_threads@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
jne    1176 <main+0x36>
lea    0xe96(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1060 <exit@plt>
xor    %edi,%edi
call   1040 <omp_set_dynamic@plt>
lea    0xeaa(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1050 <omp_get_max_threads@plt>
cmp    $0x1,%eax
je     1167 <main+0x27>
xor    %edi,%edi
call   1040 <omp_set_dynamic@plt>
lea    0xea5(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%eax
pop    %rcx
ret
lea    0xec9(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@.str = [46 x i8] c"should be run this program on multi threads.\0A\00"
@.str.1 = [56 x i8] c"err_single 001 : FAILED, can not compile this program.\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 (...) @omp_get_max_threads()
store i32 %3, i32* %2
%4 = load i32, i32* %2
%5 = icmp eq i32 %4, 1
br i1 %5, label %6, label %9
6: ; preds = %0
%7 = call i32 @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @exit(i32 0)
unreachable
9: ; preds = %0
%10 = call i32 @omp_set_dynamic(i32 0)
%11 = call i32 @printf(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str.1, i64 0, i64 0))
ret i32 1
}

LLVM IR (-O2):
@str = [55 x i8] c"err_single 001 : FAILED, can not compile this program.\00"
@str.2 = [45 x i8] c"should be run this program on multi threads.\00"
define i32 @main() {
%1 = tail call i32 (...) @omp_get_max_threads()
%2 = icmp eq i32 %1, 1
br i1 %2, label %3, label %6
3: ; preds = %0
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([45 x i8], [45 x i8]* @str.2, i64 0, i64 0))
%5 = tail call i32 @exit(i32 0)
unreachable
6: ; preds = %0
%7 = tail call i32 @omp_set_dynamic(i32 0)
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([55 x i8], [55 x i8]* @str, i64 0, i64 0))
ret i32 1
}
int reverseOrder(int a, int b) { return b - a; }


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

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

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

LLVM IR (-O2):
define i32 @reverseOrder(i32 %0, i32 %1) {
%3 = sub nsw i32 %1, %0
ret i32 %3
}
/* Variables and functions */
int memory_init(size_t size, int algorithm) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @memory_init(i64 %0, i32 %1) {
ret i32 0
}
int pldummy_mscvga() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @pldummy_mscvga() {
ret i32 0
}
int getbit(unsigned char *array, int offset) {
  return (array[offset / 8] & (0x80 >> (offset % 8))) ? 255 : 0;
}


x86 assembly (clang, -O0):
<getbit>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
movslq %ecx,%rcx
movzbl (%rax,%rcx,1),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
mov    %edx,%ecx
mov    -0x10(%rbp),%edx
mov    $0x80,%eax
sar    %cl,%eax
and    %eax,%edx
xor    %eax,%eax
mov    $0xff,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getbit>:
mov    %esi,%ecx
lea    0x7(%rcx),%eax
test   %esi,%esi
cmovns %esi,%eax
sar    $0x3,%eax
cltq
movzbl (%rdi,%rax,1),%eax
and    $0x7,%cl
shl    %cl,%eax
movsbl %al,%eax
shr    $0x7,%eax
movzbl %al,%eax
ret

LLVM IR (-O0):
define i32 @getbit(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = load i32, i32* %4
%7 = sdiv i32 %6, 8
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i8, i8* %5, i64 %8
%10 = load i8, i8* %9
%11 = zext i8 %10 to i32
%12 = load i32, i32* %4
%13 = srem i32 %12, 8
%14 = ashr i32 128, %13
%15 = and i32 %11, %14
%16 = icmp ne i32 %15, 0
%17 = zext i1 %16 to i64
%18 = select i1 %16, i32 255, i32 0
ret i32 %18
}

LLVM IR (-O2):
define i32 @getbit(i8* nocapture %0, i32 %1) {
%3 = sdiv i32 %1, 8
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = load i8, i8* %5
%7 = zext i8 %6 to i32
%8 = and i32 %1, 7
%9 = lshr i32 128, %8
%10 = and i32 %9, %7
%11 = icmp eq i32 %10, 0
%12 = select i1 %11, i32 0, i32 255
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ Error(char *);
void Usage(void) {
  Error("USAGE SCREWUP: extractfuncs <file1> [<file2> ..] [-t <structname>] "
        "[-o <func_list> <func_decs>] [-d <define>]\n"
        "no -o defaults to g_func_list.h g_func_decs.h or "
        "g_<structname>_list.h g_<structname>_decs.h\n");
}


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

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

LLVM IR (-O0):
@.str = [204 x i8] c"USAGE SCREWUP: extractfuncs <file1> [<file2> ..] [-t <structname>] [-o <func_list> <func_decs>] [-d <define>]\0Ano -o defaults to g_func_list.h g_func_decs.h or g_<structname>_list.h g_<structname>_decs.h\0A\00"
define void @Usage() {
%1 = call i32 @Error(i8* getelementptr inbounds ([204 x i8], [204 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [204 x i8] c"USAGE SCREWUP: extractfuncs <file1> [<file2> ..] [-t <structname>] [-o <func_list> <func_decs>] [-d <define>]\0Ano -o defaults to g_func_list.h g_func_decs.h or g_<structname>_list.h g_<structname>_decs.h\0A\00"
define void @Usage() {
%1 = tail call i32 @Error(i8* getelementptr inbounds ([204 x i8], [204 x i8]* @.str, i64 0, i64 0))
ret void
}
void s3c_pm_restored_gpios(void) {}


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

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

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

LLVM IR (-O2):
define void @s3c_pm_restored_gpios() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ dpeek();
int /*<<< orphan*/ drepl(int /*<<< orphan*/);
int /*<<< orphan*/ fixnum_to_bignum(int /*<<< orphan*/);
int /*<<< orphan*/ tag_bignum(int /*<<< orphan*/);
int /*<<< orphan*/ untag_fixnum_fast(int /*<<< orphan*/);
void primitive_fixnum_to_bignum_impl(void) {
  drepl(tag_bignum(fixnum_to_bignum(untag_fixnum_fast(dpeek()))));
}


x86 assembly (clang, -O0):
<primitive_fixnum_to_bignum_impl>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <dpeek@plt>
mov    %eax,%edi
call   1040 <untag_fixnum_fast@plt>
mov    %eax,%edi
call   1060 <fixnum_to_bignum@plt>
mov    %eax,%edi
call   1070 <tag_bignum@plt>
mov    %eax,%edi
call   1050 <drepl@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<primitive_fixnum_to_bignum_impl>:
push   %rax
xor    %eax,%eax
call   1030 <dpeek@plt>
mov    %eax,%edi
call   1040 <untag_fixnum_fast@plt>
mov    %eax,%edi
call   1060 <fixnum_to_bignum@plt>
mov    %eax,%edi
call   1070 <tag_bignum@plt>
mov    %eax,%edi
pop    %rax
jmp    1050 <drepl@plt>

LLVM IR (-O0):
define void @primitive_fixnum_to_bignum_impl() {
%1 = call i32 (...) @dpeek()
%2 = call i32 @untag_fixnum_fast(i32 %1)
%3 = call i32 @fixnum_to_bignum(i32 %2)
%4 = call i32 @tag_bignum(i32 %3)
%5 = call i32 @drepl(i32 %4)
ret void
}

LLVM IR (-O2):
define void @primitive_fixnum_to_bignum_impl() {
%1 = tail call i32 (...) @dpeek()
%2 = tail call i32 @untag_fixnum_fast(i32 %1)
%3 = tail call i32 @fixnum_to_bignum(i32 %2)
%4 = tail call i32 @tag_bignum(i32 %3)
%5 = tail call i32 @drepl(i32 %4)
ret void
}