xunge/DecIR huggingface dataset:
/* Variables and functions */
void *Heap_REGMOD(unsigned char *, int /*<<< orphan*/);
void *Configuration__init(void) {
  static void *m;
  if (m != 0) {
    return m;
  };
  if (m == 0) {
    m = Heap_REGMOD((unsigned char *)"Configuration", 0);
  };
  return m;
}


x86 assembly (clang, -O0):
<Configuration__init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
cmpq   $0x0,0x2f10(%rip)
je     1136 <Configuration__init+0x26>
mov    0x2f03(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1164 <Configuration__init+0x54>
cmpq   $0x0,0x2ef2(%rip)
jne    1159 <Configuration__init+0x49>
lea    0xeb5(%rip),%rdi
xor    %esi,%esi
call   1030 <Heap_REGMOD@plt>
mov    %rax,0x2ed7(%rip)
mov    0x2ed0(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Configuration__init>:
push   %rax
mov    0x2f18(%rip),%rax
test   %rax,%rax
je     111f <Configuration__init+0xf>
pop    %rcx
ret
lea    0xeda(%rip),%rdi
xor    %esi,%esi
call   1030 <Heap_REGMOD@plt>
mov    %rax,0x2efc(%rip)
pop    %rcx
ret

LLVM IR (-O0):
@Configuration__init.m = internal global i8* null
@.str = [14 x i8] c"Configuration\00"
define i8* @Configuration__init() {
%1 = alloca i8*
%2 = load i8*, i8** @Configuration__init.m
%3 = icmp ne i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = load i8*, i8** @Configuration__init.m
store i8* %5, i8** %1
br label %13
6: ; preds = %0
%7 = load i8*, i8** @Configuration__init.m
%8 = icmp eq i8* %7, null
br i1 %8, label %9, label %11
9: ; preds = %6
%10 = call i8* @Heap_REGMOD(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 0)
store i8* %10, i8** @Configuration__init.m
br label %11
11: ; preds = %9, %6
%12 = load i8*, i8** @Configuration__init.m
store i8* %12, i8** %1
br label %13
13: ; preds = %11, %4
%14 = load i8*, i8** %1
ret i8* %14
}

LLVM IR (-O2):
@Configuration__init.m = internal unnamed_addr global i8* null
@.str = [14 x i8] c"Configuration\00"
define i8* @Configuration__init() {
%1 = load i8*, i8** @Configuration__init.m
%2 = icmp eq i8* %1, null
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i8* @Heap_REGMOD(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 0)
store i8* %4, i8** @Configuration__init.m
br label %5
5: ; preds = %0, %3
%6 = phi i8* [ %4, %3 ], [ %1, %0 ]
ret i8* %6
}
/* Variables and functions */
int /*<<< orphan*/ SIGHUP;
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ signal(int /*<<< orphan*/, void (*)(int));
int system(char *);
void sighup(int n __attribute__((unused))) {
  if (system("openvt -s -l -- login -h spawn") == -1) {
    perror("system");
    exit(1);
  }
  signal(SIGHUP, sighup);
}


x86 assembly (clang, -O0):
<sighup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xeae(%rip),%rdi
call   1030 <system@plt>
cmp    $0xffffffff,%eax
jne    1176 <sighup+0x36>
lea    0xeb8(%rip),%rdi
call   1050 <perror@plt>
mov    $0x1,%edi
call   1060 <exit@plt>
mov    0x2e73(%rip),%rax
mov    (%rax),%edi
mov    0x2e5a(%rip),%rsi
call   1040 <signal@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sighup>:
push   %rax
lea    0xeb8(%rip),%rdi
call   1030 <system@plt>
cmp    $0xffffffff,%eax
je     1168 <sighup+0x28>
mov    0x2e97(%rip),%rax
mov    (%rax),%edi
mov    0x2e7e(%rip),%rsi
pop    %rax
jmp    1040 <signal@plt>
lea    0xeb0(%rip),%rdi
call   1050 <perror@plt>
mov    $0x1,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@.str = [31 x i8] c"openvt -s -l -- login -h spawn\00"
@.str.1 = [7 x i8] c"system\00"
@SIGHUP = global i32 0
define void @sighup(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @system(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
%4 = icmp eq i32 %3, -1
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%7 = call i32 @exit(i32 1)
unreachable
8: ; preds = %1
%9 = load i32, i32* @SIGHUP
%10 = call i32 @signal(i32 %9, void (i32)* @sighup)
ret void
}

LLVM IR (-O2):
@.str = [31 x i8] c"openvt -s -l -- login -h spawn\00"
@.str.1 = [7 x i8] c"system\00"
@SIGHUP = global i32 0
define void @sighup(i32 %0) {
%2 = tail call i32 @system(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i32 %2, -1
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = tail call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%6 = tail call i32 @exit(i32 1)
unreachable
7: ; preds = %1
%8 = load i32, i32* @SIGHUP
%9 = tail call i32 @signal(i32 %8, void (i32)* @sighup)
ret void
}
int fun771() { return 771; }


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

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

LLVM IR (-O0):
define i32 @fun771() {
ret i32 771
}

LLVM IR (-O2):
define i32 @fun771() {
ret i32 771
}
double buoyancy_c(const double alpha0, const double alpha) {
  return 9.80665 * (alpha - alpha0) / alpha0;
}


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

x86 assembly (clang, -O2):
<buoyancy_c>:
subsd  %xmm0,%xmm1
mulsd  0xef4(%rip),%xmm1
divsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @buoyancy_c(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %4
%6 = load double, double* %3
%7 = fsub double %5, %6
%8 = fmul double 0x40239D013A92A305, %7
%9 = load double, double* %3
%10 = fdiv double %8, %9
ret double %10
}

LLVM IR (-O2):
define double @buoyancy_c(double %0, double %1) {
%3 = fsub double %1, %0
%4 = fmul double %3, 0x40239D013A92A305
%5 = fdiv double %4, %0
ret double %5
}
/* Variables and functions */
char const *config_get_item(int /*<<< orphan*/, char const *);
int /*<<< orphan*/ config_get_section(char const *);
const char *config_item(const char *section, const char *item) {
  return config_get_item(config_get_section(section), item);
}


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

x86 assembly (clang, -O2):
<config_item>:
push   %rbx
mov    %rsi,%rbx
call   1040 <config_get_section@plt>
mov    %eax,%edi
mov    %rbx,%rsi
pop    %rbx
jmp    1030 <config_get_item@plt>

LLVM IR (-O0):
define i8* @config_item(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 = call i32 @config_get_section(i8* %5)
%7 = load i8*, i8** %4
%8 = call i8* @config_get_item(i32 %6, i8* %7)
ret i8* %8
}

LLVM IR (-O2):
define i8* @config_item(i8* %0, i8* %1) {
%3 = tail call i32 @config_get_section(i8* %0)
%4 = tail call i8* @config_get_item(i32 %3, i8* %1)
ret i8* %4
}
/* Variables and functions */
void _bwa_dns_label_count_symbols(void *user_data,
                                  char symbol __attribute__((__unused__))) {
  size_t *label_length = user_data;
  (*label_length)++;
}


x86 assembly (clang, -O0):
<_bwa_dns_label_count_symbols>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%rcx
add    $0x1,%rcx
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<_bwa_dns_label_count_symbols>:
addq   $0x1,(%rdi)
ret

LLVM IR (-O0):
define void @_bwa_dns_label_count_symbols(i8* %0, i8 signext %1) {
%3 = alloca i8*
%4 = alloca i8
%5 = alloca i64*
store i8* %0, i8** %3
store i8 %1, i8* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to i64*
store i64* %7, i64** %5
%8 = load i64*, i64** %5
%9 = load i64, i64* %8
%10 = add i64 %9, 1
store i64 %10, i64* %8
ret void
}

LLVM IR (-O2):
define void @_bwa_dns_label_count_symbols(i8* nocapture %0, i8 signext %1) {
%3 = bitcast i8* %0 to i64*
%4 = load i64, i64* %3
%5 = add i64 %4, 1
store i64 %5, i64* %3
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int /*<<< orphan*/ bswap64(int /*<<< orphan*/);
uint64_t cpu_to_be64(uint64_t v) { return bswap64(v); }


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

x86 assembly (clang, -O2):
<cpu_to_be64>:
jmp    1030 <bswap64@plt>

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

LLVM IR (-O2):
define i32 @cpu_to_be64(i32 %0) {
%2 = tail call i32 @bswap64(i32 %0)
ret i32 %2
}
/* Type definitions */
struct wl_proxy {
  int dummy;
};
struct wl_pointer {
  int dummy;
};

/* Variables and functions */
void *wl_proxy_get_user_data(struct wl_proxy *);
void *wl_pointer_get_user_data(struct wl_pointer *wl_pointer) {
  return wl_proxy_get_user_data((struct wl_proxy *)wl_pointer);
}


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

x86 assembly (clang, -O2):
<wl_pointer_get_user_data>:
jmp    1030 <wl_proxy_get_user_data@plt>

LLVM IR (-O0):
%struct.wl_pointer = type { i32 }
%struct.wl_proxy = type { i32 }
define i8* @wl_pointer_get_user_data(%struct.wl_pointer* %0) {
%2 = alloca %struct.wl_pointer*
store %struct.wl_pointer* %0, %struct.wl_pointer** %2
%3 = load %struct.wl_pointer*, %struct.wl_pointer** %2
%4 = bitcast %struct.wl_pointer* %3 to %struct.wl_proxy*
%5 = call i8* @wl_proxy_get_user_data(%struct.wl_proxy* %4)
ret i8* %5
}

LLVM IR (-O2):
%struct.wl_pointer = type { i32 }
%struct.wl_proxy = type { i32 }
define i8* @wl_pointer_get_user_data(%struct.wl_pointer* %0) {
%2 = bitcast %struct.wl_pointer* %0 to %struct.wl_proxy*
%3 = tail call i8* @wl_proxy_get_user_data(%struct.wl_proxy* %2)
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ getopts(int, char **);
int main(int argc, char *argv[]) {
  getopts(argc, argv);
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <getopts@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
call   1030 <getopts@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @getopts(i32 %0, i8** %1)
ret i32 0
}
/* Type definitions */
struct vpx_read_bit_buffer {
  int dummy;
};

/* Variables and functions */
int vpx_rb_read_signed_literal(struct vpx_read_bit_buffer *, int);
int vpx_rb_read_inv_signed_literal(struct vpx_read_bit_buffer *rb, int bits) {
  return vpx_rb_read_signed_literal(rb, bits);
}


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

x86 assembly (clang, -O2):
<vpx_rb_read_inv_signed_literal>:
jmp    1030 <vpx_rb_read_signed_literal@plt>

LLVM IR (-O0):
%struct.vpx_read_bit_buffer = type { i32 }
define i32 @vpx_rb_read_inv_signed_literal(%struct.vpx_read_bit_buffer* %0, i32 %1) {
%3 = alloca %struct.vpx_read_bit_buffer*
%4 = alloca i32
store %struct.vpx_read_bit_buffer* %0, %struct.vpx_read_bit_buffer** %3
store i32 %1, i32* %4
%5 = load %struct.vpx_read_bit_buffer*, %struct.vpx_read_bit_buffer** %3
%6 = load i32, i32* %4
%7 = call i32 @vpx_rb_read_signed_literal(%struct.vpx_read_bit_buffer* %5, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
%struct.vpx_read_bit_buffer = type { i32 }
define i32 @vpx_rb_read_inv_signed_literal(%struct.vpx_read_bit_buffer* %0, i32 %1) {
%3 = tail call i32 @vpx_rb_read_signed_literal(%struct.vpx_read_bit_buffer* %0, i32 %1)
ret i32 %3
}
void genc_nge_d() {}


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

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

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

LLVM IR (-O2):
define void @genc_nge_d() {
ret void
}
void foo770() {}


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

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

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

LLVM IR (-O2):
define void @foo770() {
ret void
}
double f4_cb_send_pre_double_float(double (*cb)(double, float)) {
  float r = 55.0;
  return cb(8.25, r) + 1.0;
}


x86 assembly (clang, -O0):
<f4_cb_send_pre_double_float>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movss  0xefc(%rip),%xmm0
movss  %xmm0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movss  -0xc(%rbp),%xmm1
movsd  0xede(%rip),%xmm0
call   *%rax
movsd  0xecc(%rip),%xmm1
addsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f4_cb_send_pre_double_float>:
push   %rax
movsd  0xef7(%rip),%xmm0
movss  0xeff(%rip),%xmm1
call   *%rdi
addsd  0xeed(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @f4_cb_send_pre_double_float(double (double, float)* %0) {
%2 = alloca double (double, float)*
%3 = alloca float
store double (double, float)* %0, double (double, float)** %2
store float 5.500000e+01, float* %3
%4 = load double (double, float)*, double (double, float)** %2
%5 = load float, float* %3
%6 = call double %4(double 8.250000e+00, float %5)
%7 = fadd double %6, 1.000000e+00
ret double %7
}

LLVM IR (-O2):
define double @f4_cb_send_pre_double_float(double (double, float)* nocapture %0) {
%2 = tail call double %0(double 8.250000e+00, float 5.500000e+01)
%3 = fadd double %2, 1.000000e+00
ret double %3
}
void ch_backoff() { __asm__ volatile("pause"); }


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

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

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

LLVM IR (-O2):
define void @ch_backoff() {
tail call void asm sideeffect "pause", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ write(int, long long *, int);
void _writell(int fd, long long ll) { write(fd, &ll, sizeof(long long)); }


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

x86 assembly (clang, -O2):
<_writell>:
push   %rax
mov    %rsi,(%rsp)
mov    %rsp,%rsi
mov    $0x8,%edx
call   1030 <write@plt>
pop    %rax
ret

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

LLVM IR (-O2):
define void @_writell(i32 %0, i64 %1) {
%3 = alloca i64
store i64 %1, i64* %3
%4 = call i32 @write(i32 %0, i64* %3, i32 8)
ret void
}
/* Type definitions */
typedef char *uint64_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
uint64_t rdpmc(void) {
  union {
    uint64_t tsc_64;
    struct {
      uint32_t lo_32;
      uint32_t hi_32;
    } t32;
  } tsc;
  asm volatile("rdpmc"
               : "=a"(tsc.t32.lo_32), "=d"(tsc.t32.hi_32)
               : "c"(0x10000));
  return tsc.tsc_64;
}


x86 assembly (clang, -O0):
<rdpmc>:
push   %rbp
mov    %rsp,%rbp
mov    $0x10000,%ecx
rdpmc
mov    %eax,-0x8(%rbp)
mov    %edx,-0x4(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rdpmc>:
mov    $0x10000,%ecx
rdpmc
mov    %eax,%eax
shl    $0x20,%rdx
or     %rdx,%rax
ret

LLVM IR (-O0):
%union.anon = type { i8* }
%struct.anon = type { i32, i32 }
define i8* @rdpmc() {
%1 = alloca %union.anon
%2 = bitcast %union.anon* %1 to %struct.anon*
%3 = getelementptr inbounds %struct.anon, %struct.anon* %2, i32 0, i32 0
%4 = bitcast %union.anon* %1 to %struct.anon*
%5 = getelementptr inbounds %struct.anon, %struct.anon* %4, i32 0, i32 1
%6 = call { i32, i32 } asm sideeffect "rdpmc", "={ax},={dx},{cx},~{dirflag},~{fpsr},~{flags}"(i32 65536)
%7 = extractvalue { i32, i32 } %6, 0
%8 = extractvalue { i32, i32 } %6, 1
store i32 %7, i32* %3
store i32 %8, i32* %5
%9 = bitcast %union.anon* %1 to i8**
%10 = load i8*, i8** %9
ret i8* %10
}

LLVM IR (-O2):
define i8* @rdpmc() {
%1 = tail call { i32, i32 } asm sideeffect "rdpmc", "={ax},={dx},{cx},~{dirflag},~{fpsr},~{flags}"(i32 65536)
%2 = extractvalue { i32, i32 } %1, 0
%3 = extractvalue { i32, i32 } %1, 1
%4 = zext i32 %2 to i64
%5 = zext i32 %3 to i64
%6 = shl nuw i64 %5, 32
%7 = or i64 %6, %4
%8 = inttoptr i64 %7 to i8*
ret i8* %8
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void print(int nums[], int length) {
  int i;
  for (i = 0; i < length; i++) {
    printf(" %d", nums[i]);
  }
}


x86 assembly (clang, -O0):
<print>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1157 <print+0x47>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xebc(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <print+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1145 <print+0x35>
mov    %rdi,%r15
mov    %esi,%r12d
xor    %ebx,%ebx
lea    0xed5(%rip),%r14
nopl   0x0(%rax,%rax,1)
mov    (%r15,%rbx,4),%esi
mov    %r14,%rdi
call   1030 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1130 <print+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [4 x i8] c" %d\00"
define void @print(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
store i32 0, i32* %5
br label %6
6: ; preds = %17, %2
%7 = load i32, i32* %5
%8 = load i32, i32* %4
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %20
10: ; preds = %6
%11 = load i32*, i32** %3
%12 = load i32, i32* %5
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i32, i32* %11, i64 %13
%15 = load i32, i32* %14
%16 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %15)
br label %17
17: ; preds = %10
%18 = load i32, i32* %5
%19 = add nsw i32 %18, 1
store i32 %19, i32* %5
br label %6
20: ; preds = %6
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c" %d\00"
define void @print(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = load i32, i32* %8
%10 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ system(char *);
int main(int argc, char *argv[]) {
  system("dir");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xed3(%rip),%rdi
call   1030 <system@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"dir\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @system(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
int main() {
  int i;
  int res = 0;
  goto L1;
  for (i = 0; i < 10; i++) {
  L2:
    res++;
    if (i > 100) {
    L1:
      i = 0;
      goto L2;
    }
  }
  return res;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
jmp    113e <main+0x3e>
cmpl   $0xa,-0x8(%rbp)
jge    115d <main+0x5d>
jmp    1126 <main+0x26>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x64,-0x8(%rbp)
jle    114a <main+0x4a>
jmp    113e <main+0x3e>
movl   $0x0,-0x8(%rbp)
jmp    1126 <main+0x26>
jmp    114f <main+0x4f>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1117 <main+0x17>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %3
br label %15
4: ; No predecessors!
store i32 0, i32* %2
br label %5
5: ; preds = %17, %4
%6 = load i32, i32* %2
%7 = icmp slt i32 %6, 10
br i1 %7, label %8, label %20
8: ; preds = %5
br label %9
9: ; preds = %15, %8
%10 = load i32, i32* %3
%11 = add nsw i32 %10, 1
store i32 %11, i32* %3
%12 = load i32, i32* %2
%13 = icmp sgt i32 %12, 100
br i1 %13, label %14, label %16
14: ; preds = %9
br label %15
15: ; preds = %14, %0
store i32 0, i32* %2
br label %9
16: ; preds = %9
br label %17
17: ; preds = %16
%18 = load i32, i32* %2
%19 = add nsw i32 %18, 1
store i32 %19, i32* %2
br label %5
20: ; preds = %5
%21 = load i32, i32* %3
ret i32 %21
}

LLVM IR (-O2):
define i32 @main() {
ret i32 10
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, char const *);
int /*<<< orphan*/ puts(char *);
void print_usage(const char *prog) {
  printf("Usage: %s [-dsbholac]\n", prog);
  puts("  -d --device   device to use (default /dev/spidev1.0)\n"
       "  -s --speed    max speed (Hz)\n"
       "  -b --bpw      bits per word \n"
       "  -h --cpha     clock phase\n"
       "  -o --cpol     clock polarity\n"
       "  -l --lsb      least significant bit first\n"
       "  -a --data     the data to be send\n"
       "  -c --count    read in 'count' words\n");
  exit(1);
}


x86 assembly (clang, -O0):
<print_usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xeb9(%rip),%rdi
call   1040 <printf@plt>
lea    0xec4(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<print_usage>:
push   %rax
mov    %rdi,%rsi
lea    0xec5(%rip),%rdi
call   1040 <printf@plt>
lea    0xed0(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [23 x i8] c"Usage: %s [-dsbholac]\0A\00"
@.str.1 = [295 x i8] c" -d --device device to use (default /dev/spidev1.0)\0A -s --speed max speed (Hz)\0A -b --bpw bits per word \0A -h --cpha clock phase\0A -o --cpol clock polarity\0A -l --lsb least significant bit first\0A -a --data the data to be send\0A -c --count read in 'count' words\0A\00"
define void @print_usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = call i32 @puts(i8* getelementptr inbounds ([295 x i8], [295 x i8]* @.str.1, i64 0, i64 0))
%6 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [23 x i8] c"Usage: %s [-dsbholac]\0A\00"
@.str.1 = [295 x i8] c" -d --device device to use (default /dev/spidev1.0)\0A -s --speed max speed (Hz)\0A -b --bpw bits per word \0A -h --cpha clock phase\0A -o --cpol clock polarity\0A -l --lsb least significant bit first\0A -a --data the data to be send\0A -c --count read in 'count' words\0A\00"
define void @print_usage(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([295 x i8], [295 x i8]* @.str.1, i64 0, i64 0))
%4 = tail call i32 @exit(i32 1)
unreachable
}
char *tskip(bp)
register char *bp;
{
  while (*bp && *bp != ':')
    bp++;
  if (*bp == ':')
    bp++;
  return (bp);
}


x86 assembly (clang, -O0):
<tskip>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x9(%rbp)
je     112d <tskip+0x2d>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x3a,%eax
setne  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
test   $0x1,%al
jne    113d <tskip+0x3d>
jmp    114e <tskip+0x4e>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1108 <tskip+0x8>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x3a,%eax
jne    116a <tskip+0x6a>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<tskip>:
mov    %rdi,%rax
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movzbl (%rax),%ecx
test   %cl,%cl
je     1122 <tskip+0x22>
cmp    $0x3a,%cl
je     1122 <tskip+0x22>
add    $0x1,%rax
jmp    1110 <tskip+0x10>
xor    %edx,%edx
cmp    $0x3a,%cl
sete   %dl
add    %rdx,%rax
ret

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

LLVM IR (-O2):
define i8* @tskip(i8* %0) {
br label %2
2: ; preds = %5, %1
%3 = phi i8* [ %0, %1 ], [ %6, %5 ]
%4 = load i8, i8* %3
switch i8 %4, label %5 [
i8 0, label %7
i8 58, label %7
]
5: ; preds = %2
%6 = getelementptr inbounds i8, i8* %3, i64 1
br label %2
7: ; preds = %2, %2
%8 = icmp eq i8 %4, 58
%9 = zext i1 %8 to i64
%10 = getelementptr i8, i8* %3, i64 %9
ret i8* %10
}
int mydlinfo(void *handle, int request, void *arg, void *dl_caller) {
  ;
  return -1;
}


x86 assembly (clang, -O0):
<mydlinfo>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    $0xffffffff,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @mydlinfo(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
ret i32 -1
}

LLVM IR (-O2):
define i32 @mydlinfo(i8* nocapture readnone %0, i32 %1, i8* nocapture readnone %2, i8* nocapture readnone %3) {
ret i32 -1
}
void RTStrUniLenEx(void) {}


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

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

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

LLVM IR (-O2):
define void @RTStrUniLenEx() {
ret void
}
int sync_test_bit(int nr, const volatile void *addr) {
  return test_bit(nr, addr);
}


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

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

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

LLVM IR (-O2):
define i32 @sync_test_bit(i32 %0, i8* %1) {
%3 = tail call i32 (i32, i8*, ...) bitcast (i32 (...)* @test_bit to i32 (i32, i8*, ...)*)(i32 %0, i8* %1)
ret i32 %3
}
/* Variables and functions */
size_t strcspn(char const *const, char *);
int has_wildcards(char const *const str) {
  return str[strcspn(str, "[]*?")] ? 1 : 0;
}


x86 assembly (clang, -O0):
<has_wildcards>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xed1(%rip),%rsi
call   1030 <strcspn@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
movsbl (%rax,%rcx,1),%edx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<has_wildcards>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rsi
call   1030 <strcspn@plt>
xor    %ecx,%ecx
cmpb   $0x0,(%rbx,%rax,1)
setne  %cl
mov    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"[]*?\00"
define i32 @has_wildcards(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @strcspn(i8* %4, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%6 = getelementptr inbounds i8, i8* %3, i64 %5
%7 = load i8, i8* %6
%8 = sext i8 %7 to i32
%9 = icmp ne i32 %8, 0
%10 = zext i1 %9 to i64
%11 = select i1 %9, i32 1, i32 0
ret i32 %11
}

LLVM IR (-O2):
@.str = [5 x i8] c"[]*?\00"
define i32 @has_wildcards(i8* nocapture %0) {
%2 = tail call i64 @strcspn(i8* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%3 = getelementptr inbounds i8, i8* %0, i64 %2
%4 = load i8, i8* %3
%5 = icmp ne i8 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
char *strchr(const char *s, int c) {
  register char *sb = (char *)s;
  register char ch = (char)c;
  do {
    if (*sb == ch)
      return sb;
  } while (*(sb++) != '\0');
  return NULL;
}


x86 assembly (clang, -O0):
<strchr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x14(%rbp),%eax
mov    %al,-0x21(%rbp)
mov    -0x20(%rbp),%rax
movsbl (%rax),%eax
movsbl -0x21(%rbp),%ecx
cmp    %ecx,%eax
jne    1139 <strchr+0x39>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1161 <strchr+0x61>
jmp    113e <strchr+0x3e>
mov    -0x20(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x20(%rbp)
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    1119 <strchr+0x19>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strchr>:
mov    %rdi,%rax
movsbl %sil,%ecx
nopw   0x0(%rax,%rax,1)
movsbl (%rax),%edx
cmp    %edx,%ecx
je     1121 <strchr+0x21>
add    $0x1,%rax
test   %dl,%dl
jne    1110 <strchr+0x10>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i8* @strchr(i8* %0, i32 %1) {
%3 = shl i32 %1, 24
%4 = ashr exact i32 %3, 24
br label %5
5: ; preds = %10, %2
%6 = phi i8* [ %0, %2 ], [ %11, %10 ]
%7 = load i8, i8* %6
%8 = sext i8 %7 to i32
%9 = icmp eq i32 %4, %8
br i1 %9, label %13, label %10
10: ; preds = %5
%11 = getelementptr inbounds i8, i8* %6, i64 1
%12 = icmp eq i8 %7, 0
br i1 %12, label %13, label %5
13: ; preds = %10, %5
%14 = phi i8* [ %6, %5 ], [ null, %10 ]
ret i8* %14
}
double sll2d(s)
long long int s;
{ return s; }


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

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

LLVM IR (-O0):
define double @sll2d(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = sitofp i64 %3 to double
ret double %4
}

LLVM IR (-O2):
define double @sll2d(i64 %0) {
%2 = sitofp i64 %0 to double
ret double %2
}
/* Variables and functions */
size_t strnlen(const char *str, size_t n) {
  size_t ret = 0;
  while (str[ret++] && n--)
    ;
  return ret;
}


x86 assembly (clang, -O0):
<strnlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x18(%rbp)
movsbl (%rax,%rcx,1),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x19(%rbp)
je     1152 <strnlen+0x52>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0xffffffffffffffff,%rcx
mov    %rcx,-0x10(%rbp)
cmp    $0x0,%rax
setne  %al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
test   $0x1,%al
jne    1162 <strnlen+0x62>
jmp    1167 <strnlen+0x67>
jmp    1114 <strnlen+0x14>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strnlen>:
xor    %ecx,%ecx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
lea    0x1(%rcx),%rax
cmpb   $0x0,(%rdi,%rcx,1)
je     1122 <strnlen+0x22>
cmp    %rcx,%rsi
mov    %rax,%rcx
jne    1110 <strnlen+0x10>
ret

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

LLVM IR (-O2):
define i64 @strnlen(i8* nocapture %0, i64 %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i64 [ %1, %2 ], [ %10, %3 ]
%5 = phi i64 [ 0, %2 ], [ %6, %3 ]
%6 = add i64 %5, 1
%7 = getelementptr inbounds i8, i8* %0, i64 %5
%8 = load i8, i8* %7
%9 = icmp eq i8 %8, 0
%10 = add i64 %4, -1
%11 = icmp eq i64 %4, 0
%12 = select i1 %9, i1 true, i1 %11
br i1 %12, label %13, label %3
13: ; preds = %3
ret i64 %6
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ printf(char *);
void syserr(char *s) {
  printf("Exit \n ");
  perror(s);
  exit(1);
}


x86 assembly (clang, -O0):
<syserr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xebd(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rdi
call   1040 <perror@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<syserr>:
push   %rbx
mov    %rdi,%rbx
lea    0xec5(%rip),%rdi
call   1030 <printf@plt>
mov    %rbx,%rdi
call   1040 <perror@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"Exit \0A \00"
define void @syserr(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i32 @perror(i8* %4)
%6 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [8 x i8] c"Exit \0A \00"
define void @syserr(i8* nocapture %0) {
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @perror(i8* %0)
%4 = tail call i32 @exit(i32 1)
unreachable
}
int my_is_prime(int nombre) { return (0); }


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

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

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

LLVM IR (-O2):
define i32 @my_is_prime(i32 %0) {
ret i32 0
}
int add_strcut(struct {
  int x;
  int y;
} a) {
  return a.x + a.y;
}


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

x86 assembly (clang, -O2):
<add_strcut>:
mov    %rdi,%rax
shr    $0x20,%rax
add    %edi,%eax
ret

LLVM IR (-O0):
%struct.anon = type { i32, i32 }
define i32 @add_strcut(i64 %0) {
%2 = alloca %struct.anon
%3 = bitcast %struct.anon* %2 to i64*
store i64 %0, i64* %3
%4 = getelementptr inbounds %struct.anon, %struct.anon* %2, i32 0, i32 0
%5 = load i32, i32* %4
%6 = getelementptr inbounds %struct.anon, %struct.anon* %2, i32 0, i32 1
%7 = load i32, i32* %6
%8 = add nsw i32 %5, %7
ret i32 %8
}

LLVM IR (-O2):
define i32 @add_strcut(i64 %0) {
%2 = trunc i64 %0 to i32
%3 = lshr i64 %0, 32
%4 = trunc i64 %3 to i32
%5 = add nsw i32 %4, %2
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ pem_password_cb;
typedef int /*<<< orphan*/ d2i_of_void;
typedef int /*<<< orphan*/ FILE;
typedef int /*<<< orphan*/ DSA;

/* Variables and functions */
int /*<<< orphan*/ *PEM_ASN1_read(int /*<<< orphan*/ *, int /*<<< orphan*/,
                                  int /*<<< orphan*/ *, void **,
                                  int /*<<< orphan*/ *, void *);
int /*<<< orphan*/ PEM_STRING_PUBLIC;
scalar_t__ d2i_DSA_PUBKEY;
DSA *PEM_read_DSA_PUBKEY(FILE *fp, DSA **x, pem_password_cb *cb, void *u) {
  return PEM_ASN1_read((d2i_of_void *)d2i_DSA_PUBKEY, PEM_STRING_PUBLIC, fp,
                       (void **)x, cb, u);
}


x86 assembly (clang, -O0):
<PEM_read_DSA_PUBKEY>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    0x2ea9(%rip),%rax
mov    (%rax),%rdi
mov    0x2eaf(%rip),%rax
mov    (%rax),%esi
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
mov    -0x18(%rbp),%r8
mov    -0x20(%rbp),%r9
call   1030 <PEM_ASN1_read@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PEM_read_DSA_PUBKEY>:
mov    %rcx,%r9
mov    %rdx,%r8
mov    %rsi,%rcx
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%rdi
mov    0x2ebb(%rip),%rax
mov    (%rax),%esi
jmp    1030 <PEM_ASN1_read@plt>

LLVM IR (-O0):
@d2i_DSA_PUBKEY = global i64 0
@PEM_STRING_PUBLIC = global i32 0
define i32* @PEM_read_DSA_PUBKEY(i32* %0, i32** %1, i32* %2, i8* %3) {
%5 = alloca i32*
%6 = alloca i32**
%7 = alloca i32*
%8 = alloca i8*
store i32* %0, i32** %5
store i32** %1, i32*** %6
store i32* %2, i32** %7
store i8* %3, i8** %8
%9 = load i64, i64* @d2i_DSA_PUBKEY
%10 = inttoptr i64 %9 to i32*
%11 = load i32, i32* @PEM_STRING_PUBLIC
%12 = load i32*, i32** %5
%13 = load i32**, i32*** %6
%14 = bitcast i32** %13 to i8**
%15 = load i32*, i32** %7
%16 = load i8*, i8** %8
%17 = call i32* @PEM_ASN1_read(i32* %10, i32 %11, i32* %12, i8** %14, i32* %15, i8* %16)
ret i32* %17
}

LLVM IR (-O2):
@d2i_DSA_PUBKEY = global i64 0
@PEM_STRING_PUBLIC = global i32 0
define i32* @PEM_read_DSA_PUBKEY(i32* %0, i32** %1, i32* %2, i8* %3) {
%5 = load i64, i64* @d2i_DSA_PUBKEY
%6 = inttoptr i64 %5 to i32*
%7 = load i32, i32* @PEM_STRING_PUBLIC
%8 = bitcast i32** %1 to i8**
%9 = tail call i32* @PEM_ASN1_read(i32* %6, i32 %7, i32* %0, i8** %8, i32* %2, i8* %3)
ret i32* %9
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
test_fail(char *test) {
  printf("\033[1m\033[35m"
         "%s Failed\n"
         "\033[0m",
         test);
}


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

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

LLVM IR (-O0):
@.str = [24 x i8] c"\1B[1m\1B[35m%s Failed\0A\1B[0m\00"
define i32 @test_fail(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = load i32, i32* %2
ret i32 %6
}

LLVM IR (-O2):
@.str = [24 x i8] c"\1B[1m\1B[35m%s Failed\0A\1B[0m\00"
define i32 @test_fail(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* %0)
ret i32 undef
}
/* Type definitions */
struct timespec {
  int /*<<< orphan*/ tv_nsec;
  int /*<<< orphan*/ tv_sec;
};

/* Variables and functions */
int /*<<< orphan*/ CLOCK_PROCESS_CPUTIME_ID;
int /*<<< orphan*/ clock_gettime(int /*<<< orphan*/, struct timespec *);
int /*<<< orphan*/ printf(char *, int /*<<< orphan*/);
int main() {
  struct timespec ts;
  clock_gettime(CLOCK_PROCESS_CPUTIME_ID, &ts);
  printf("time ( s): %ld\n", ts.tv_sec);
  printf("time (ns): %ld\n", ts.tv_nsec);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2eb9(%rip),%rax
mov    (%rax),%edi
lea    -0x8(%rbp),%rsi
call   1030 <clock_gettime@plt>
mov    -0x4(%rbp),%esi
lea    0xebc(%rip),%rdi
call   1040 <printf@plt>
mov    -0x8(%rbp),%esi
lea    0xebd(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2ec0(%rip),%rax
mov    (%rax),%edi
mov    %rsp,%rsi
call   1030 <clock_gettime@plt>
mov    0x4(%rsp),%esi
lea    0xec3(%rip),%rdi
call   1040 <printf@plt>
mov    (%rsp),%esi
lea    0xec4(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.timespec = type { i32, i32 }
@CLOCK_PROCESS_CPUTIME_ID = global i32 0
@.str = [16 x i8] c"time ( s): %ld\0A\00"
@.str.1 = [16 x i8] c"time (ns): %ld\0A\00"
define i32 @main() {
%1 = alloca %struct.timespec
%2 = load i32, i32* @CLOCK_PROCESS_CPUTIME_ID
%3 = call i32 @clock_gettime(i32 %2, %struct.timespec* %1)
%4 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i32 0, i32 1
%5 = load i32, i32* %4
%6 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i32 0, i32 0
%8 = load i32, i32* %7
%9 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i32 %8)
ret i32 0
}

LLVM IR (-O2):
%struct.timespec = type { i32, i32 }
@CLOCK_PROCESS_CPUTIME_ID = global i32 0
@.str = [16 x i8] c"time ( s): %ld\0A\00"
@.str.1 = [16 x i8] c"time (ns): %ld\0A\00"
define i32 @main() {
%1 = alloca %struct.timespec
%2 = bitcast %struct.timespec* %1 to i8*
%3 = load i32, i32* @CLOCK_PROCESS_CPUTIME_ID
%4 = call i32 @clock_gettime(i32 %3, %struct.timespec* %1)
%5 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 1
%6 = load i32, i32* %5
%7 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %6)
%8 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 0
%9 = load i32, i32* %8
%10 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i32 %9)
ret i32 0
}
int defcheck_shutdown(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @defcheck_shutdown() {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int hecmw_write_bin_value(unsigned char *, int, int /*<<< orphan*/ *);
int hecmw_write_bin_double(double x, FILE *fp) {
  return hecmw_write_bin_value((unsigned char *)&x, sizeof(double), fp);
}


x86 assembly (clang, -O0):
<hecmw_write_bin_double>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    %rdi,-0x10(%rbp)
lea    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    $0x8,%esi
call   1030 <hecmw_write_bin_value@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hecmw_write_bin_double>:
push   %rax
mov    %rdi,%rdx
movsd  %xmm0,(%rsp)
mov    %rsp,%rdi
mov    $0x8,%esi
call   1030 <hecmw_write_bin_value@plt>
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @hecmw_write_bin_double(double %0, i32* %1) {
%3 = alloca double
store double %0, double* %3
%4 = bitcast double* %3 to i8*
%5 = call i32 @hecmw_write_bin_value(i8* %4, i32 8, i32* %1)
ret i32 %5
}
/* Variables and functions */
void putc(unsigned char c) {
  while ((*((volatile unsigned long *)0x7F005018)) & (1 << 14))
    ;
  (*((volatile unsigned char *)0x7F005020)) = c;
  if (c == '\n')
    putc('\r');
}


x86 assembly (clang, -O0):
<putc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    $0x7f005018,%eax
mov    (%rax),%rax
and    $0x4000,%rax
cmp    $0x0,%rax
je     113b <putc+0x2b>
jmp    111e <putc+0xe>
mov    -0x1(%rbp),%cl
mov    $0x7f005020,%eax
mov    %cl,(%rax)
movzbl -0x1(%rbp),%eax
cmp    $0xa,%eax
jne    115c <putc+0x4c>
mov    $0xd,%edi
call   1030 <putc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<putc>:
testq  $0x4000,0x7f005018
jne    1100 <putc>
mov    %dil,0x7f005020
7f
cmp    $0xa,%dil
jne    1136 <putc+0x36>
nopl   0x0(%rax)
testq  $0x4000,0x7f005018
jne    1120 <putc+0x20>
movb   $0xd,0x7f005020
0d
ret

LLVM IR (-O0):
define void @putc(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
br label %3
3: ; preds = %7, %1
%4 = load volatile i64, i64* inttoptr (i64 2130726936 to i64*)
%5 = and i64 %4, 16384
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %3
br label %3
8: ; preds = %3
%9 = load i8, i8* %2
store volatile i8 %9, i8* inttoptr (i64 2130726944 to i8*)
%10 = load i8, i8* %2
%11 = zext i8 %10 to i32
%12 = icmp eq i32 %11, 10
br i1 %12, label %13, label %14
13: ; preds = %8
br label %14
14: ; preds = %13, %8
ret void
}

LLVM IR (-O2):
define void @putc(i8 zeroext %0) {
br label %2
2: ; preds = %2, %1
%3 = load volatile i64, i64* inttoptr (i64 2130726936 to i64*)
%4 = and i64 %3, 16384
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %2
6: ; preds = %2
store volatile i8 %0, i8* inttoptr (i64 2130726944 to i8*)
%7 = icmp eq i8 %0, 10
br i1 %7, label %8, label %13
8: ; preds = %6, %8
%9 = load volatile i64, i64* inttoptr (i64 2130726936 to i64*)
%10 = and i64 %9, 16384
%11 = icmp eq i64 %10, 0
br i1 %11, label %12, label %8
12: ; preds = %8
store volatile i8 13, i8* inttoptr (i64 2130726944 to i8*)
br label %13
13: ; preds = %12, %6
ret void
}