xunge/DecIR huggingface dataset:
/* Type definitions */
struct libinjection_sqli_state {
  int dummy;
};

/* Variables and functions */
scalar_t__ libinjection_sqli_blacklist(struct libinjection_sqli_state *);
scalar_t__ libinjection_sqli_not_whitelist(struct libinjection_sqli_state *);
int libinjection_sqli_check_fingerprint(
    struct libinjection_sqli_state *sql_state) {
  return libinjection_sqli_blacklist(sql_state) &&
         libinjection_sqli_not_whitelist(sql_state);
}


x86 assembly (clang, -O0):
<libinjection_sqli_check_fingerprint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <libinjection_sqli_blacklist@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x9(%rbp)
je     115a <libinjection_sqli_check_fingerprint+0x3a>
mov    -0x8(%rbp),%rdi
call   1030 <libinjection_sqli_not_whitelist@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):
<libinjection_sqli_check_fingerprint>:
push   %rbx
mov    %rdi,%rbx
call   1040 <libinjection_sqli_blacklist@plt>
test   %rax,%rax
je     1143 <libinjection_sqli_check_fingerprint+0x23>
mov    %rbx,%rdi
call   1030 <libinjection_sqli_not_whitelist@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
pop    %rbx
ret
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.libinjection_sqli_state = type { i32 }
define i32 @libinjection_sqli_check_fingerprint(%struct.libinjection_sqli_state* %0) {
%2 = alloca %struct.libinjection_sqli_state*
store %struct.libinjection_sqli_state* %0, %struct.libinjection_sqli_state** %2
%3 = load %struct.libinjection_sqli_state*, %struct.libinjection_sqli_state** %2
%4 = call i64 @libinjection_sqli_blacklist(%struct.libinjection_sqli_state* %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load %struct.libinjection_sqli_state*, %struct.libinjection_sqli_state** %2
%8 = call i64 @libinjection_sqli_not_whitelist(%struct.libinjection_sqli_state* %7)
%9 = icmp ne i64 %8, 0
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):
%struct.libinjection_sqli_state = type { i32 }
define i32 @libinjection_sqli_check_fingerprint(%struct.libinjection_sqli_state* %0) {
%2 = tail call i64 @libinjection_sqli_blacklist(%struct.libinjection_sqli_state* %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %8, label %4
4: ; preds = %1
%5 = tail call i64 @libinjection_sqli_not_whitelist(%struct.libinjection_sqli_state* %0)
%6 = icmp ne i64 %5, 0
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %4, %1
%9 = phi i32 [ 0, %1 ], [ %7, %4 ]
ret i32 %9
}
/* Variables and functions */
double atanl(double);
long double pi() { return 4.0 * atanl(1.0); }


x86 assembly (clang, -O0):
<pi>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  0xee0(%rip),%xmm0
call   1030 <atanl@plt>
movsd  0xedb(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
fldl   -0x8(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pi>:
push   %rax
movsd  0xee7(%rip),%xmm0
call   1030 <atanl@plt>
mulsd  0xee2(%rip),%xmm0
movsd  %xmm0,(%rsp)
fldl   (%rsp)
pop    %rax
ret

LLVM IR (-O0):
define x86_fp80 @pi() {
%1 = call double @atanl(double 1.000000e+00)
%2 = fmul double 4.000000e+00, %1
%3 = fpext double %2 to x86_fp80
ret x86_fp80 %3
}

LLVM IR (-O2):
define x86_fp80 @pi() {
%1 = tail call double @atanl(double 1.000000e+00)
%2 = fmul double %1, 4.000000e+00
%3 = fpext double %2 to x86_fp80
ret x86_fp80 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void main(void) {
  int x = 0;
  printf("\n\n");
  for (x = 1; x <= 255; x++) {
    printf("/cfg/ip/route/add 192.168.46.%d 255.255.255.255 192.168.99.9 9\n",
           x);
  }
  printf("\n\n");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x1,-0x4(%rbp)
cmpl   $0xff,-0x4(%rbp)
jg     1160 <main+0x50>
mov    -0x4(%rbp),%esi
lea    0xeb8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1134 <main+0x24>
lea    0xe99(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
lea    0xf13(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%ebx
lea    0xec4(%rip),%r14
nopl   0x0(%rax)
mov    %r14,%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%ebx
cmp    $0x100,%ebx
jne    1140 <main+0x20>
lea    0xee0(%rip),%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"\0A\0A\00"
@.str.1 = [64 x i8] c"/cfg/ip/route/add 192.168.46.%d 255.255.255.255 192.168.99.9 9\0A\00"
define void @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
store i32 1, i32* %1
br label %3
3: ; preds = %9, %0
%4 = load i32, i32* %1
%5 = icmp sle i32 %4, 255
br i1 %5, label %6, label %12
6: ; preds = %3
%7 = load i32, i32* %1
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str.1, i64 0, i64 0), i32 %7)
br label %9
9: ; preds = %6
%10 = load i32, i32* %1
%11 = add nsw i32 %10, 1
store i32 %11, i32* %1
br label %3
12: ; preds = %3
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str.1 = [64 x i8] c"/cfg/ip/route/add 192.168.46.%d 255.255.255.255 192.168.99.9 9\0A\00"
@str.2 = [2 x i8] c"\0A\00"
define void @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str.2, i64 0, i64 0))
br label %2
2: ; preds = %0, %2
%3 = phi i32 [ 1, %0 ], [ %5, %2 ]
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([64 x i8], [64 x i8]* @.str.1, i64 0, i64 0), i32 %3)
%5 = add nuw nsw i32 %3, 1
%6 = icmp eq i32 %5, 256
br i1 %6, label %7, label %2
7: ; preds = %2
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str.2, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void ntpst_usage(char *name) {
  fprintf(
      stderr,
      "\nUsage: %s <get | set>\n"
      "\tget - display the contents of the NTP Sync Timestamp to 'stdout'.\n"
      "\tset - record now time to POT partition as a NTP Sync Timestamp,\n"
      "\t\tif thers is a NTP Sync Timestamp existed yet, just display\n"
      "\t\tit without any write action.\n",
      name);
  exit(0);
}


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

x86 assembly (clang, -O2):
<ntpst_usage>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [248 x i8] c"\0AUsage: %s <get | set>\0A\09get - display the contents of the NTP Sync Timestamp to 'stdout'.\0A\09set - record now time to POT partition as a NTP Sync Timestamp,\0A\09\09if thers is a NTP Sync Timestamp existed yet, just display\0A\09\09it without any write action.\0A\00"
define void @ntpst_usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([248 x i8], [248 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [248 x i8] c"\0AUsage: %s <get | set>\0A\09get - display the contents of the NTP Sync Timestamp to 'stdout'.\0A\09set - record now time to POT partition as a NTP Sync Timestamp,\0A\09\09if thers is a NTP Sync Timestamp existed yet, just display\0A\09\09it without any write action.\0A\00"
define void @ntpst_usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([248 x i8], [248 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  int x = 1;
  int y = 2;
  int z = x + y;
  printf("%d", z);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x1,-0x4(%rbp)
movl   $0x2,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%esi
lea    0xec7(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 3)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ _graph(float *, int);
int /*<<< orphan*/ printf(char *);
void graph(float *buf, int size) {
  printf("graph \u14B7 Copyright (C) 2017 Martin Blom\n");
  _graph(buf, size);
}


x86 assembly (clang, -O0):
<graph>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
lea    0xeca(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1040 <_graph@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<graph>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
lea    0xed1(%rip),%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <_graph@plt>

LLVM IR (-O0):
@.str = [42 x i8] c"graph \E1\92\B7 Copyright (C) 2017 Martin Blom\0A\00"
define void @graph(float* %0, i32 %1) {
%3 = alloca float*
%4 = alloca i32
store float* %0, float** %3
store i32 %1, i32* %4
%5 = call i32 @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0))
%6 = load float*, float** %3
%7 = load i32, i32* %4
%8 = call i32 @_graph(float* %6, i32 %7)
ret void
}

LLVM IR (-O2):
@str = [41 x i8] c"graph \E1\92\B7 Copyright (C) 2017 Martin Blom\00"
define void @graph(float* %0, i32 %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @_graph(float* %0, i32 %1)
ret void
}
int allocate_shutdown(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @allocate_shutdown() {
ret i32 0
}
void net_hostname_init(void) {}


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

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

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

LLVM IR (-O2):
define void @net_hostname_init() {
ret void
}
/* Variables and functions */
int FE_ALL_EXCEPT;
int get_fpscr();
int fetestexcept(int mask) { return get_fpscr() & mask & FE_ALL_EXCEPT; }


x86 assembly (clang, -O0):
<fetestexcept>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <get_fpscr@plt>
and    -0x4(%rbp),%eax
mov    0x2eb4(%rip),%rcx
and    (%rcx),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fetestexcept>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <get_fpscr@plt>
and    %ebx,%eax
mov    0x2ebd(%rip),%rcx
and    (%rcx),%eax
pop    %rbx
ret

LLVM IR (-O0):
@FE_ALL_EXCEPT = global i32 0
define i32 @fetestexcept(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @get_fpscr()
%4 = load i32, i32* %2
%5 = and i32 %3, %4
%6 = load i32, i32* @FE_ALL_EXCEPT
%7 = and i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
@FE_ALL_EXCEPT = global i32 0
define i32 @fetestexcept(i32 %0) {
%2 = tail call i32 (...) @get_fpscr()
%3 = and i32 %2, %0
%4 = load i32, i32* @FE_ALL_EXCEPT
%5 = and i32 %3, %4
ret i32 %5
}
int Cilk_arch_specific_options(int i, int argc __attribute__((__unused__)),
                               char *argv[] __attribute__((__unused__))) {
  return i;
}


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

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

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

LLVM IR (-O2):
define i32 @Cilk_arch_specific_options(i32 returned %0, i32 %1, i8** nocapture readnone %2) {
ret i32 %0
}
/* Variables and functions */
long get_double_grid_index(long const *, long const *, long const *);
long grg_get_double_grid_index(const long address_double[3],
                               const long D_diag[3], const long PS[3]) {
  return get_double_grid_index(address_double, D_diag, PS);
}


x86 assembly (clang, -O0):
<grg_get_double_grid_index>:
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 <get_double_grid_index@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<grg_get_double_grid_index>:
jmp    1030 <get_double_grid_index@plt>

LLVM IR (-O0):
define i64 @grg_get_double_grid_index(i64* %0, i64* %1, i64* %2) {
%4 = alloca i64*
%5 = alloca i64*
%6 = alloca i64*
store i64* %0, i64** %4
store i64* %1, i64** %5
store i64* %2, i64** %6
%7 = load i64*, i64** %4
%8 = load i64*, i64** %5
%9 = load i64*, i64** %6
%10 = call i64 @get_double_grid_index(i64* %7, i64* %8, i64* %9)
ret i64 %10
}

LLVM IR (-O2):
define i64 @grg_get_double_grid_index(i64* %0, i64* %1, i64* %2) {
%4 = tail call i64 @get_double_grid_index(i64* %0, i64* %1, i64* %2)
ret i64 %4
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ test_general();
int /*<<< orphan*/ test_lengthQueue();
int /*<<< orphan*/ test_peekQueue();
int /*<<< orphan*/ test_popQueue();
int /*<<< orphan*/ test_resetQueue();
int /*<<< orphan*/ test_voidQueue();
int main(int argc, char *argv[]) {
  test_voidQueue();
  test_resetQueue();
  test_peekQueue();
  test_popQueue();
  test_lengthQueue();
  test_general();
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <test_voidQueue@plt>
mov    $0x0,%al
call   1060 <test_resetQueue@plt>
mov    $0x0,%al
call   1080 <test_peekQueue@plt>
mov    $0x0,%al
call   1040 <test_popQueue@plt>
mov    $0x0,%al
call   1050 <test_lengthQueue@plt>
mov    $0x0,%al
call   1070 <test_general@plt>
mov    0x2e39(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <test_voidQueue@plt>
xor    %eax,%eax
call   1060 <test_resetQueue@plt>
xor    %eax,%eax
call   1080 <test_peekQueue@plt>
xor    %eax,%eax
call   1040 <test_popQueue@plt>
xor    %eax,%eax
call   1050 <test_lengthQueue@plt>
xor    %eax,%eax
call   1070 <test_general@plt>
mov    0x2e4e(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 (...) @test_voidQueue()
%7 = call i32 (...) @test_resetQueue()
%8 = call i32 (...) @test_peekQueue()
%9 = call i32 (...) @test_popQueue()
%10 = call i32 (...) @test_lengthQueue()
%11 = call i32 (...) @test_general()
%12 = load i32, i32* @EXIT_SUCCESS
ret i32 %12
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @test_voidQueue()
%4 = tail call i32 (...) @test_resetQueue()
%5 = tail call i32 (...) @test_peekQueue()
%6 = tail call i32 (...) @test_popQueue()
%7 = tail call i32 (...) @test_lengthQueue()
%8 = tail call i32 (...) @test_general()
%9 = load i32, i32* @EXIT_SUCCESS
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
int warterm_initscr() {
  puts("XYZZY");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [6 x i8] c"XYZZY\00"
define i32 @warterm_initscr() {
%1 = call i32 @puts(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"XYZZY\00"
define i32 @warterm_initscr() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ putchar(char);
int main() {
  char *s = "Hello, world!\n";
  char *p;
  for (p = s; p < s + 14; p++)
    putchar(*p);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    -0x10(%rbp),%rcx
add    $0xe,%rcx
cmp    %rcx,%rax
jae    1164 <main+0x54>
mov    -0x18(%rbp),%rax
movsbl (%rax),%edi
call   1030 <putchar@plt>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1132 <main+0x22>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
lea    0xee5(%rip),%rbx
lea    0xeec(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movsbl (%rbx),%edi
call   1030 <putchar@plt>
add    $0x1,%rbx
cmp    %r14,%rbx
jb     1130 <main+0x20>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [15 x i8] c"Hello, world!\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
%3 = alloca i8*
store i32 0, i32* %1
store i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8** %2
%4 = load i8*, i8** %2
store i8* %4, i8** %3
br label %5
5: ; preds = %14, %0
%6 = load i8*, i8** %3
%7 = load i8*, i8** %2
%8 = getelementptr inbounds i8, i8* %7, i64 14
%9 = icmp ult i8* %6, %8
br i1 %9, label %10, label %17
10: ; preds = %5
%11 = load i8*, i8** %3
%12 = load i8, i8* %11
%13 = call i32 @putchar(i8 signext %12)
br label %14
14: ; preds = %10
%15 = load i8*, i8** %3
%16 = getelementptr inbounds i8, i8* %15, i32 1
store i8* %16, i8** %3
br label %5
17: ; preds = %5
ret i32 0
}

LLVM IR (-O2):
@.str = [15 x i8] c"Hello, world!\0A\00"
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = phi i8* [ getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), %0 ], [ %5, %1 ]
%3 = load i8, i8* %2
%4 = tail call i32 @putchar(i8 signext %3)
%5 = getelementptr inbounds i8, i8* %2, i64 1
%6 = icmp ult i8* %5, getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 14)
br i1 %6, label %1, label %7
7: ; preds = %1
ret i32 0
}
int f6(int x) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @f6(i32 %0) {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ __u8;
typedef int __u32;

/* Variables and functions */
void __put_unaligned_2_le(__u32 __v, register __u8 *__p) {
  *__p++ = __v;
  *__p++ = __v >> 8;
}


x86 assembly (clang, -O0):
<__put_unaligned_2_le>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %rax,%rdx
add    $0x4,%rdx
mov    %rdx,-0x10(%rbp)
mov    %ecx,(%rax)
mov    -0x4(%rbp),%ecx
sar    $0x8,%ecx
mov    -0x10(%rbp),%rax
mov    %rax,%rdx
add    $0x4,%rdx
mov    %rdx,-0x10(%rbp)
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<__put_unaligned_2_le>:
mov    %edi,(%rsi)
sar    $0x8,%edi
mov    %edi,0x4(%rsi)
ret

LLVM IR (-O0):
define void @__put_unaligned_2_le(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 = getelementptr inbounds i32, i32* %6, i32 1
store i32* %7, i32** %4
store i32 %5, i32* %6
%8 = load i32, i32* %3
%9 = ashr i32 %8, 8
%10 = load i32*, i32** %4
%11 = getelementptr inbounds i32, i32* %10, i32 1
store i32* %11, i32** %4
store i32 %9, i32* %10
ret void
}

LLVM IR (-O2):
define void @__put_unaligned_2_le(i32 %0, i32* nocapture writeonly %1) {
%3 = getelementptr inbounds i32, i32* %1, i64 1
store i32 %0, i32* %1
%4 = ashr i32 %0, 8
store i32 %4, i32* %3
ret void
}
void k_means(double *vects, int M, int N, int K, double *centroids) {}


x86 assembly (clang, -O0):
<k_means>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8,-0x20(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @k_means(double* %0, i32 %1, i32 %2, i32 %3, double* %4) {
%6 = alloca double*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca double*
store double* %0, double** %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store double* %4, double** %10
ret void
}

LLVM IR (-O2):
define void @k_means(double* nocapture %0, i32 %1, i32 %2, i32 %3, double* nocapture %4) {
ret void
}
char *mystrcpy(char *dest, char *src) {
  char *d = dest;
  char *s = src;
  while (*s != '\0') {
    *d = *s;
    d++;
    s++;
  }
  *d = '\0';
  return dest;
}


x86 assembly (clang, -O0):
<mystrcpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1155 <mystrcpy+0x55>
mov    -0x20(%rbp),%rax
mov    (%rax),%cl
mov    -0x18(%rbp),%rax
mov    %cl,(%rax)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    111c <mystrcpy+0x1c>
mov    -0x18(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mystrcpy>:
mov    %rdi,%rax
mov    (%rsi),%cl
mov    %rdi,%rdx
test   %cl,%cl
je     1131 <mystrcpy+0x31>
add    $0x1,%rsi
mov    %rax,%rdx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %cl,(%rdx)
add    $0x1,%rdx
movzbl (%rsi),%ecx
add    $0x1,%rsi
test   %cl,%cl
jne    1120 <mystrcpy+0x20>
movb   $0x0,(%rdx)
ret

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

LLVM IR (-O2):
define i8* @mystrcpy(i8* returned writeonly %0, i8* nocapture %1) {
%3 = load i8, i8* %1
%4 = icmp eq i8 %3, 0
br i1 %4, label %13, label %5
5: ; preds = %2, %5
%6 = phi i8 [ %11, %5 ], [ %3, %2 ]
%7 = phi i8* [ %10, %5 ], [ %1, %2 ]
%8 = phi i8* [ %9, %5 ], [ %0, %2 ]
store i8 %6, i8* %8
%9 = getelementptr inbounds i8, i8* %8, i64 1
%10 = getelementptr inbounds i8, i8* %7, i64 1
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %5
13: ; preds = %5, %2
%14 = phi i8* [ %0, %2 ], [ %9, %5 ]
store i8 0, i8* %14
ret i8* %0
}
void h_cfun(char *name, int argc, char **argv, void *user_data) {
  printf("Called: %s\n", __FUNCTION__);
}


x86 assembly (clang, -O0):
<h_cfun>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
lea    0xed2(%rip),%rdi
lea    0xed7(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [12 x i8] c"Called: %s\0A\00"
@__FUNCTION__.h_cfun = [7 x i8] c"h_cfun\00"
define void @h_cfun(i8* %0, i32 %1, i8** %2, i8* %3) {
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i8**
%8 = alloca i8*
store i8* %0, i8** %5
store i32 %1, i32* %6
store i8** %2, i8*** %7
store i8* %3, i8** %8
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @__FUNCTION__.h_cfun, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"Called: %s\0A\00"
@__FUNCTION__.h_cfun = [7 x i8] c"h_cfun\00"
define void @h_cfun(i8* nocapture readnone %0, i32 %1, i8** nocapture readnone %2, i8* nocapture readnone %3) {
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @__FUNCTION__.h_cfun, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef scalar_t__ time_t;

/* Variables and functions */
double difftime(time_t end, time_t start) { return (double)(end - start); }


x86 assembly (clang, -O0):
<difftime>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
sub    -0x10(%rbp),%rax
cvtsi2sd %rax,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<difftime>:
sub    %rsi,%rdi
cvtsi2sd %rdi,%xmm0
ret

LLVM IR (-O0):
define double @difftime(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 = sub nsw i64 %5, %6
%8 = sitofp i64 %7 to double
ret double %8
}

LLVM IR (-O2):
define double @difftime(i64 %0, i64 %1) {
%3 = sub nsw i64 %0, %1
%4 = sitofp i64 %3 to double
ret double %4
}
/* Variables and functions */
int /*<<< orphan*/ STDOUT_FILENO;
int /*<<< orphan*/ write(int /*<<< orphan*/, char *, int);
void init(void) { write(STDOUT_FILENO, "init\n", 5); }


x86 assembly (clang, -O0):
<init>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ed5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
mov    $0x5,%edx
call   1030 <write@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<init>:
mov    0x2ed9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
mov    $0x5,%edx
jmp    1030 <write@plt>

LLVM IR (-O0):
@STDOUT_FILENO = global i32 0
@.str = [6 x i8] c"init\0A\00"
define void @init() {
%1 = load i32, i32* @STDOUT_FILENO
%2 = call i32 @write(i32 %1, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 5)
ret void
}

LLVM IR (-O2):
@STDOUT_FILENO = global i32 0
@.str = [6 x i8] c"init\0A\00"
define void @init() {
%1 = load i32, i32* @STDOUT_FILENO
%2 = tail call i32 @write(i32 %1, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 5)
ret void
}
/* Variables and functions */
scalar_t__ strcmp(char const *, char const *);
int streq(const char *a, const char *b) { return (strcmp(a, b) == 0); }


x86 assembly (clang, -O0):
<streq>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @streq(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = call i64 @strcmp(i8* %5, i8* %6)
%8 = icmp eq i64 %7, 0
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @streq(i8* %0, i8* %1) {
%3 = tail call i64 @strcmp(i8* %0, i8* %1)
%4 = icmp eq i64 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
int copyLSB(int x) { return x << 31 >> 31; }


x86 assembly (clang, -O0):
<copyLSB>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x1f,%eax
sar    $0x1f,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<copyLSB>:
mov    %edi,%eax
and    $0x1,%eax
neg    %eax
ret

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

LLVM IR (-O2):
define i32 @copyLSB(i32 %0) {
%2 = and i32 %0, 1
%3 = sub nsw i32 0, %2
ret i32 %3
}
/* Variables and functions */
double errcheck(int /*<<< orphan*/, char *);
int /*<<< orphan*/ sqrt(double);
double Sqrt(double *args) { return errcheck(sqrt(*args), "sqrt"); }


x86 assembly (clang, -O0):
<Sqrt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
call   1040 <sqrt@plt>
mov    %eax,%edi
lea    0xebe(%rip),%rsi
call   1030 <errcheck@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Sqrt>:
push   %rax
movsd  (%rdi),%xmm0
call   1040 <sqrt@plt>
lea    0xecf(%rip),%rsi
mov    %eax,%edi
pop    %rax
jmp    1030 <errcheck@plt>

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

LLVM IR (-O2):
@.str = [5 x i8] c"sqrt\00"
define double @Sqrt(double* nocapture %0) {
%2 = load double, double* %0
%3 = tail call i32 @sqrt(double %2)
%4 = tail call double @errcheck(i32 %3, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret double %4
}
int digit(int i) {
  if ('0' <= i && i <= '9')
    i -= '0';
  else if ('a' <= i && i <= 'f')
    i -= 'a' - 10;
  else if ('A' <= i && i <= 'F')
    i -= 'A' - 10;
  else
    i = -1;
  return i;
}


x86 assembly (clang, -O0):
<digit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0x30,%eax
cmp    -0x4(%rbp),%eax
jg     112d <digit+0x2d>
cmpl   $0x39,-0x4(%rbp)
jg     112d <digit+0x2d>
mov    -0x4(%rbp),%eax
sub    $0x30,%eax
mov    %eax,-0x4(%rbp)
jmp    118a <digit+0x8a>
mov    $0x61,%eax
cmp    -0x4(%rbp),%eax
jg     1153 <digit+0x53>
cmpl   $0x66,-0x4(%rbp)
jg     1153 <digit+0x53>
mov    -0x4(%rbp),%eax
sub    $0x57,%eax
mov    %eax,-0x4(%rbp)
jmp    1185 <digit+0x85>
mov    $0x41,%eax
cmp    -0x4(%rbp),%eax
jg     1179 <digit+0x79>
cmpl   $0x46,-0x4(%rbp)
jg     1179 <digit+0x79>
mov    -0x4(%rbp),%eax
sub    $0x37,%eax
mov    %eax,-0x4(%rbp)
jmp    1180 <digit+0x80>
movl   $0xffffffff,-0x4(%rbp)
jmp    1185 <digit+0x85>
jmp    118a <digit+0x8a>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<digit>:
lea    -0x30(%rdi),%eax
cmp    $0xa,%eax
jb     1127 <digit+0x27>
lea    -0x61(%rdi),%eax
cmp    $0x5,%eax
ja     1116 <digit+0x16>
add    $0xffffffa9,%edi
mov    %edi,%eax
ret
lea    -0x41(%rdi),%eax
add    $0xffffffc9,%edi
cmp    $0x6,%eax
mov    $0xffffffff,%eax
cmovb  %edi,%eax
ret

LLVM IR (-O0):
define i32 @digit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sle i32 48, %3
br i1 %4, label %5, label %11
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 57
br i1 %7, label %8, label %11
8: ; preds = %5
%9 = load i32, i32* %2
%10 = sub nsw i32 %9, 48
store i32 %10, i32* %2
br label %32
11: ; preds = %5, %1
%12 = load i32, i32* %2
%13 = icmp sle i32 97, %12
br i1 %13, label %14, label %20
14: ; preds = %11
%15 = load i32, i32* %2
%16 = icmp sle i32 %15, 102
br i1 %16, label %17, label %20
17: ; preds = %14
%18 = load i32, i32* %2
%19 = sub nsw i32 %18, 87
store i32 %19, i32* %2
br label %31
20: ; preds = %14, %11
%21 = load i32, i32* %2
%22 = icmp sle i32 65, %21
br i1 %22, label %23, label %29
23: ; preds = %20
%24 = load i32, i32* %2
%25 = icmp sle i32 %24, 70
br i1 %25, label %26, label %29
26: ; preds = %23
%27 = load i32, i32* %2
%28 = sub nsw i32 %27, 55
store i32 %28, i32* %2
br label %30
29: ; preds = %23, %20
store i32 -1, i32* %2
br label %30
30: ; preds = %29, %26
br label %31
31: ; preds = %30, %17
br label %32
32: ; preds = %31, %8
%33 = load i32, i32* %2
ret i32 %33
}

LLVM IR (-O2):
define i32 @digit(i32 %0) {
%2 = add i32 %0, -48
%3 = icmp ult i32 %2, 10
br i1 %3, label %14, label %4
4: ; preds = %1
%5 = add i32 %0, -97
%6 = icmp ult i32 %5, 6
br i1 %6, label %7, label %9
7: ; preds = %4
%8 = add nsw i32 %0, -87
br label %14
9: ; preds = %4
%10 = add i32 %0, -65
%11 = icmp ult i32 %10, 6
%12 = add nsw i32 %0, -55
%13 = select i1 %11, i32 %12, i32 -1
br label %14
14: ; preds = %1, %9, %7
%15 = phi i32 [ %8, %7 ], [ %13, %9 ], [ %2, %1 ]
ret i32 %15
}
/* Variables and functions */
int __isnormal(long double);
int __isnormall(long double a1) { return __isnormal(a1); }


x86 assembly (clang, -O0):
<__isnormall>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
call   1030 <__isnormal@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__isnormall>:
jmp    1030 <__isnormal@plt>

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

LLVM IR (-O2):
define i32 @__isnormall(x86_fp80 %0) {
%2 = tail call i32 @__isnormal(x86_fp80 %0)
ret i32 %2
}
int gbm_is_format_supported(struct gbm_bo *bo) { return 1; }


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

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

LLVM IR (-O0):
%struct.gbm_bo = type opaque
define i32 @gbm_is_format_supported(%struct.gbm_bo* %0) {
%2 = alloca %struct.gbm_bo*
store %struct.gbm_bo* %0, %struct.gbm_bo** %2
ret i32 1
}

LLVM IR (-O2):
%struct.gbm_bo = type opaque
define i32 @gbm_is_format_supported(%struct.gbm_bo* nocapture readnone %0) {
ret i32 1
}
void foo451() {}


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

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

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

LLVM IR (-O2):
define void @foo451() {
ret void
}
int dprecf() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @dprecf() {
ret i32 0
}
void swap(unsigned char *a, unsigned char *b) {
  unsigned char temp;
  temp = *a;
  *a = *b;
  *b = temp;
}


x86 assembly (clang, -O0):
<swap>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x11(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x11(%rbp),%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<swap>:
mov    (%rdi),%al
mov    (%rsi),%cl
mov    %cl,(%rdi)
mov    %al,(%rsi)
ret

LLVM IR (-O0):
define void @swap(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
%7 = load i8, i8* %6
store i8 %7, i8* %5
%8 = load i8*, i8** %4
%9 = load i8, i8* %8
%10 = load i8*, i8** %3
store i8 %9, i8* %10
%11 = load i8, i8* %5
%12 = load i8*, i8** %4
store i8 %11, i8* %12
ret void
}

LLVM IR (-O2):
define void @swap(i8* nocapture %0, i8* nocapture %1) {
%3 = load i8, i8* %0
%4 = load i8, i8* %1
store i8 %4, i8* %0
store i8 %3, i8* %1
ret void
}
int lap_read_nop_cb(int n, struct GPS_SWay **dp) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.GPS_SWay = type opaque
define i32 @lap_read_nop_cb(i32 %0, %struct.GPS_SWay** nocapture readnone %1) {
ret i32 0
}
/* Type definitions */
struct stat {
  int /*<<< orphan*/ st_mode;
};
typedef int /*<<< orphan*/ path_stat;
typedef int int32_t;

/* Variables and functions */
scalar_t__ S_ISLNK(int /*<<< orphan*/);
int /*<<< orphan*/ lstat(char const *, struct stat *);
int /*<<< orphan*/ memset(struct stat *, int /*<<< orphan*/, int);
int32_t mz_os_is_symlink(const char *path) {
  struct stat path_stat;
  memset(&path_stat, 0, sizeof(path_stat));
  lstat(path, &path_stat);
  if (S_ISLNK(path_stat.st_mode))
    return (0);
  return (-107);
}


x86 assembly (clang, -O0):
<mz_os_is_symlink>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
lea    -0x18(%rbp),%rdi
xor    %esi,%esi
mov    $0x4,%edx
call   1040 <memset@plt>
mov    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1050 <lstat@plt>
mov    -0x18(%rbp),%edi
call   1030 <S_ISLNK@plt>
cmp    $0x0,%rax
je     1177 <mz_os_is_symlink+0x47>
movl   $0x0,-0x4(%rbp)
jmp    117e <mz_os_is_symlink+0x4e>
movl   $0xffffff95,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mz_os_is_symlink>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
lea    0x8(%rsp),%r14
xor    %ebp,%ebp
mov    %r14,%rdi
xor    %esi,%esi
mov    $0x4,%edx
call   1040 <memset@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1050 <lstat@plt>
mov    0x8(%rsp),%edi
call   1030 <S_ISLNK@plt>
test   %rax,%rax
mov    $0xffffff95,%eax
cmovne %ebp,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
define i32 @mz_os_is_symlink(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca %struct.stat
store i8* %0, i8** %3
%5 = call i32 @memset(%struct.stat* %4, i32 0, i32 4)
%6 = load i8*, i8** %3
%7 = call i32 @lstat(i8* %6, %struct.stat* %4)
%8 = getelementptr inbounds %struct.stat, %struct.stat* %4, i32 0, i32 0
%9 = load i32, i32* %8
%10 = call i64 @S_ISLNK(i32 %9)
%11 = icmp ne i64 %10, 0
br i1 %11, label %12, label %13
12: ; preds = %1
store i32 0, i32* %2
br label %14
13: ; preds = %1
store i32 -107, i32* %2
br label %14
14: ; preds = %13, %12
%15 = load i32, i32* %2
ret i32 %15
}

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @mz_os_is_symlink(i8* nocapture %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i32 @memset(%struct.stat* %2, i32 0, i32 4)
%5 = call i32 @lstat(i8* %0, %struct.stat* %2)
%6 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%7 = load i32, i32* %6
%8 = call i64 @S_ISLNK(i32 %7)
%9 = icmp eq i64 %8, 0
%10 = select i1 %9, i32 -107, i32 0
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ uart_send_u8(unsigned char);
void uart_send_hex(unsigned int n) {
  unsigned char b1, b2, b3, b4;
  b1 = n & 0xFF;
  b2 = (n >> 8) & 0xFF;
  b3 = (n >> 16) & 0xFF;
  b4 = (n >> 24) & 0xFF;
  uart_send_u8(b4);
  uart_send_u8(b3);
  uart_send_u8(b2);
  uart_send_u8(b1);
}


x86 assembly (clang, -O0):
<uart_send_hex>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xff,%eax
mov    %al,-0x5(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x8,%eax
and    $0xff,%eax
mov    %al,-0x6(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x10,%eax
and    $0xff,%eax
mov    %al,-0x7(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x18,%eax
and    $0xff,%eax
mov    %al,-0x8(%rbp)
movzbl -0x8(%rbp),%edi
call   1030 <uart_send_u8@plt>
movzbl -0x7(%rbp),%edi
call   1030 <uart_send_u8@plt>
movzbl -0x6(%rbp),%edi
call   1030 <uart_send_u8@plt>
movzbl -0x5(%rbp),%edi
call   1030 <uart_send_u8@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uart_send_hex>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
mov    %edi,%ebp
shr    $0x10,%ebp
mov    %edi,%eax
shr    $0x18,%eax
mov    %eax,%edi
call   1030 <uart_send_u8@plt>
movzbl %bpl,%edi
call   1030 <uart_send_u8@plt>
movzbl %bh,%edi
call   1030 <uart_send_u8@plt>
movzbl %bl,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <uart_send_u8@plt>

LLVM IR (-O0):
define void @uart_send_hex(i32 %0) {
%2 = alloca i32
%3 = alloca i8
%4 = alloca i8
%5 = alloca i8
%6 = alloca i8
store i32 %0, i32* %2
%7 = load i32, i32* %2
%8 = and i32 %7, 255
%9 = trunc i32 %8 to i8
store i8 %9, i8* %3
%10 = load i32, i32* %2
%11 = lshr i32 %10, 8
%12 = and i32 %11, 255
%13 = trunc i32 %12 to i8
store i8 %13, i8* %4
%14 = load i32, i32* %2
%15 = lshr i32 %14, 16
%16 = and i32 %15, 255
%17 = trunc i32 %16 to i8
store i8 %17, i8* %5
%18 = load i32, i32* %2
%19 = lshr i32 %18, 24
%20 = and i32 %19, 255
%21 = trunc i32 %20 to i8
store i8 %21, i8* %6
%22 = load i8, i8* %6
%23 = call i32 @uart_send_u8(i8 zeroext %22)
%24 = load i8, i8* %5
%25 = call i32 @uart_send_u8(i8 zeroext %24)
%26 = load i8, i8* %4
%27 = call i32 @uart_send_u8(i8 zeroext %26)
%28 = load i8, i8* %3
%29 = call i32 @uart_send_u8(i8 zeroext %28)
ret void
}

LLVM IR (-O2):
define void @uart_send_hex(i32 %0) {
%2 = trunc i32 %0 to i8
%3 = lshr i32 %0, 8
%4 = trunc i32 %3 to i8
%5 = lshr i32 %0, 16
%6 = trunc i32 %5 to i8
%7 = lshr i32 %0, 24
%8 = trunc i32 %7 to i8
%9 = tail call i32 @uart_send_u8(i8 zeroext %8)
%10 = tail call i32 @uart_send_u8(i8 zeroext %6)
%11 = tail call i32 @uart_send_u8(i8 zeroext %4)
%12 = tail call i32 @uart_send_u8(i8 zeroext %2)
ret void
}
void test7(char *c) {}


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

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

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

LLVM IR (-O2):
define void @test7(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ pthread_exit(int /*<<< orphan*/ *);
void handle_quit(int signo) {
  printf("in qq handle sig %d \n", signo);
  pthread_exit(NULL);
}


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

x86 assembly (clang, -O2):
<handle_quit>:
push   %rax
mov    %edi,%esi
lea    0xed6(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
pop    %rax
jmp    1040 <pthread_exit@plt>

LLVM IR (-O0):
@.str = [22 x i8] c"in qq handle sig %d \0A\00"
define void @handle_quit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = call i32 @pthread_exit(i32* null)
ret void
}

LLVM IR (-O2):
@.str = [22 x i8] c"in qq handle sig %d \0A\00"
define void @handle_quit(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 %0)
%3 = tail call i32 @pthread_exit(i32* null)
ret void
}
int do_176() { return 176; }


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

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

LLVM IR (-O0):
define i32 @do_176() {
ret i32 176
}

LLVM IR (-O2):
define i32 @do_176() {
ret i32 176
}
/* Variables and functions */
void *calloc(unsigned int, unsigned int);
void *myalloc(void *q, unsigned n, unsigned m) {
  q = 0;
  return calloc(n, m);
}


x86 assembly (clang, -O0):
<myalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
movq   $0x0,-0x8(%rbp)
mov    -0xc(%rbp),%edi
mov    -0x10(%rbp),%esi
call   1030 <calloc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<myalloc>:
mov    %esi,%edi
mov    %edx,%esi
jmp    1030 <calloc@plt>

LLVM IR (-O0):
define i8* @myalloc(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
store i8* null, i8** %4
%7 = load i32, i32* %5
%8 = load i32, i32* %6
%9 = call i8* @calloc(i32 %7, i32 %8)
ret i8* %9
}

LLVM IR (-O2):
define noalias i8* @myalloc(i8* nocapture readnone %0, i32 %1, i32 %2) {
%4 = tail call i8* @calloc(i32 %1, i32 %2)
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ MRF24J40_receive();
int /*<<< orphan*/ MRF24J40_send(char *, int, unsigned short);
void MRF24J40_send_string(char *tekst, unsigned short adres) {
  int Data_length_24 = 0;
  while (tekst[Data_length_24] != '\0')
    Data_length_24++;
  MRF24J40_send(tekst, Data_length_24, adres);
  MRF24J40_receive();
}


x86 assembly (clang, -O0):
<MRF24J40_send_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %si,%ax
mov    %rdi,-0x8(%rbp)
mov    %ax,-0xa(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     115d <MRF24J40_send_string+0x3d>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    113a <MRF24J40_send_string+0x1a>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%esi
movzwl -0xa(%rbp),%edx
call   1030 <MRF24J40_send@plt>
mov    $0x0,%al
call   1040 <MRF24J40_receive@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<MRF24J40_send_string>:
push   %rax
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
cmpb   $0x0,(%rdi,%rax,1)
lea    0x1(%rax),%rax
jne    1130 <MRF24J40_send_string+0x10>
add    $0xffffffff,%eax
movzwl %si,%edx
mov    %eax,%esi
call   1030 <MRF24J40_send@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <MRF24J40_receive@plt>

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

LLVM IR (-O2):
define void @MRF24J40_send_string(i8* %0, i16 zeroext %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i64 [ %8, %3 ], [ 0, %2 ]
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 0
%8 = add nuw i64 %4, 1
br i1 %7, label %9, label %3
9: ; preds = %3
%10 = trunc i64 %4 to i32
%11 = tail call i32 @MRF24J40_send(i8* %0, i32 %10, i16 zeroext %1)
%12 = tail call i32 (...) @MRF24J40_receive()
ret void
}