xunge/DecIR huggingface dataset:
int fun2(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @fun2() {
ret i32 0
}
int rep(char *s, int left, int right) {
  for (; left < right; left++)
    if (s[left] == s[right])
      return (left);
  return (-1);
}


x86 assembly (clang, -O0):
<rep>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x18(%rbp),%eax
jge    1158 <rep+0x58>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
mov    -0x10(%rbp),%rcx
movslq -0x18(%rbp),%rdx
movsbl (%rcx,%rdx,1),%ecx
cmp    %ecx,%eax
jne    1145 <rep+0x45>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    115f <rep+0x5f>
jmp    114a <rep+0x4a>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    110e <rep+0xe>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rep>:
mov    $0xffffffff,%eax
cmp    %edx,%esi
jge    1130 <rep+0x30>
movslq %edx,%rcx
mov    (%rdi,%rcx,1),%r8b
movslq %esi,%rcx
add    %rdi,%rcx
cs nopw 0x0(%rax,%rax,1)
cmp    %r8b,(%rcx)
je     1131 <rep+0x31>
add    $0x1,%esi
add    $0x1,%rcx
cmp    %esi,%edx
jne    1120 <rep+0x20>
ret
mov    %esi,%eax
ret

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

LLVM IR (-O2):
define i32 @rep(i8* nocapture %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %1, %2
br i1 %4, label %5, label %21
5: ; preds = %3
%6 = sext i32 %2 to i64
%7 = getelementptr inbounds i8, i8* %0, i64 %6
%8 = load i8, i8* %7
%9 = sext i32 %1 to i64
br label %10
10: ; preds = %5, %15
%11 = phi i64 [ %9, %5 ], [ %16, %15 ]
%12 = getelementptr inbounds i8, i8* %0, i64 %11
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, %8
br i1 %14, label %19, label %15
15: ; preds = %10
%16 = add nsw i64 %11, 1
%17 = trunc i64 %16 to i32
%18 = icmp eq i32 %17, %2
br i1 %18, label %21, label %10
19: ; preds = %10
%20 = trunc i64 %11 to i32
br label %21
21: ; preds = %15, %19, %3
%22 = phi i32 [ -1, %3 ], [ %20, %19 ], [ -1, %15 ]
ret i32 %22
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
struct ns_connection {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ ns_mqtt_prepend_header(struct ns_connection *, int,
                                          int /*<<< orphan*/, int);
int /*<<< orphan*/ ns_send(struct ns_connection *, int /*<<< orphan*/ *, int);
void ns_mqtt_connack(struct ns_connection *nc, uint8_t return_code) {
  uint8_t unused = 0;
  ns_send(nc, &unused, 1);
  ns_send(nc, &return_code, 1);
  ns_mqtt_prepend_header(nc, 2, 0, 2);
}


x86 assembly (clang, -O0):
<ns_mqtt_connack>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x10(%rbp),%rsi
mov    $0x1,%edx
call   1030 <ns_send@plt>
mov    -0x8(%rbp),%rdi
lea    -0xc(%rbp),%rsi
mov    $0x1,%edx
call   1030 <ns_send@plt>
mov    -0x8(%rbp),%rdi
mov    $0x2,%ecx
xor    %edx,%edx
mov    %ecx,%esi
call   1040 <ns_mqtt_prepend_header@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ns_mqtt_connack>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
mov    %esi,0xc(%rsp)
movl   $0x0,0x8(%rsp)
lea    0x8(%rsp),%rsi
mov    $0x1,%edx
call   1030 <ns_send@plt>
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
mov    $0x1,%edx
call   1030 <ns_send@plt>
mov    %rbx,%rdi
mov    $0x2,%esi
xor    %edx,%edx
mov    $0x2,%ecx
call   1040 <ns_mqtt_prepend_header@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.ns_connection = type { i32 }
define void @ns_mqtt_connack(%struct.ns_connection* %0, i32 %1) {
%3 = alloca %struct.ns_connection*
%4 = alloca i32
%5 = alloca i32
store %struct.ns_connection* %0, %struct.ns_connection** %3
store i32 %1, i32* %4
store i32 0, i32* %5
%6 = load %struct.ns_connection*, %struct.ns_connection** %3
%7 = call i32 @ns_send(%struct.ns_connection* %6, i32* %5, i32 1)
%8 = load %struct.ns_connection*, %struct.ns_connection** %3
%9 = call i32 @ns_send(%struct.ns_connection* %8, i32* %4, i32 1)
%10 = load %struct.ns_connection*, %struct.ns_connection** %3
%11 = call i32 @ns_mqtt_prepend_header(%struct.ns_connection* %10, i32 2, i32 0, i32 2)
ret void
}

LLVM IR (-O2):
%struct.ns_connection = type { i32 }
define void @ns_mqtt_connack(%struct.ns_connection* %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %1, i32* %3
%5 = bitcast i32* %4 to i8*
store i32 0, i32* %4
%6 = call i32 @ns_send(%struct.ns_connection* %0, i32* %4, i32 1)
%7 = call i32 @ns_send(%struct.ns_connection* %0, i32* %3, i32 1)
%8 = call i32 @ns_mqtt_prepend_header(%struct.ns_connection* %0, i32 2, i32 0, i32 2)
ret void
}
/* Variables and functions */
int randf();
float signed_randf() { return randf() * 2 - 1; }


x86 assembly (clang, -O0):
<signed_randf>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <randf@plt>
shl    $0x1,%eax
sub    $0x1,%eax
cvtsi2ss %eax,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<signed_randf>:
push   %rax
xor    %eax,%eax
call   1030 <randf@plt>
add    %eax,%eax
add    $0xffffffff,%eax
cvtsi2ss %eax,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @signed_randf() {
%1 = call i32 (...) @randf()
%2 = mul nsw i32 %1, 2
%3 = sub nsw i32 %2, 1
%4 = sitofp i32 %3 to float
ret float %4
}

LLVM IR (-O2):
define float @signed_randf() {
%1 = tail call i32 (...) @randf()
%2 = shl nsw i32 %1, 1
%3 = add nsw i32 %2, -1
%4 = sitofp i32 %3 to float
ret float %4
}
void radix_int(const void *ptr, void *radix, void *arg) {
  *(int *)radix = *(const int *)ptr;
}


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

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

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

LLVM IR (-O2):
define void @radix_int(i8* nocapture %0, i8* nocapture writeonly %1, i8* nocapture readnone %2) {
%4 = bitcast i8* %0 to i32*
%5 = load i32, i32* %4
%6 = bitcast i8* %1 to i32*
store i32 %5, i32* %6
ret void
}
/* Variables and functions */
int _ada_use_c2phc(int, int *, int *, double *);
int sample_to_new_slices(void) {
  int *a, *b, fail;
  double *c;
  fail = _ada_use_c2phc(45, a, b, c);
  return fail;
}


x86 assembly (clang, -O0):
<sample_to_new_slices>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x2d,%edi
call   1030 <_ada_use_c2phc@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sample_to_new_slices>:
mov    $0x2d,%edi
jmp    1030 <_ada_use_c2phc@plt>

LLVM IR (-O0):
define i32 @sample_to_new_slices() {
%1 = alloca i32*
%2 = alloca i32*
%3 = alloca i32
%4 = alloca double*
%5 = load i32*, i32** %1
%6 = load i32*, i32** %2
%7 = load double*, double** %4
%8 = call i32 @_ada_use_c2phc(i32 45, i32* %5, i32* %6, double* %7)
store i32 %8, i32* %3
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
define i32 @sample_to_new_slices() {
%1 = tail call i32 @_ada_use_c2phc(i32 45, i32* undef, i32* undef, double* undef)
ret i32 %1
}
void stop_gbx_ticker(void) {}


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

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

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

LLVM IR (-O2):
define void @stop_gbx_ticker() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
void divideOvf(int x, int y) {
  int sum = x * x + y * y;
  int rem = (1 << 31) / sum;
  printf("divide after overflow = %d (0x%x)\n", rem, rem);
}


x86 assembly (clang, -O0):
<divideOvf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
imul   -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
imul   -0x8(%rbp),%ecx
add    %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    $0x80000000,%eax
cltd
idivl  -0xc(%rbp)
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%esi
mov    -0x10(%rbp),%edx
lea    0xeb6(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<divideOvf>:
imul   %edi,%edi
imul   %esi,%esi
add    %edi,%esi
mov    $0x80000000,%eax
cltd
idiv   %esi
lea    0xed9(%rip),%rdi
mov    %eax,%esi
mov    %eax,%edx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [35 x i8] c"divide after overflow = %d (0x%x)\0A\00"
define void @divideOvf(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%7 = load i32, i32* %3
%8 = load i32, i32* %3
%9 = mul nsw i32 %7, %8
%10 = load i32, i32* %4
%11 = load i32, i32* %4
%12 = mul nsw i32 %10, %11
%13 = add nsw i32 %9, %12
store i32 %13, i32* %5
%14 = load i32, i32* %5
%15 = sdiv i32 -2147483648, %14
store i32 %15, i32* %6
%16 = load i32, i32* %6
%17 = load i32, i32* %6
%18 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i32 %16, i32 %17)
ret void
}

LLVM IR (-O2):
@.str = [35 x i8] c"divide after overflow = %d (0x%x)\0A\00"
define void @divideOvf(i32 %0, i32 %1) {
%3 = mul nsw i32 %0, %0
%4 = mul nsw i32 %1, %1
%5 = add nuw nsw i32 %4, %3
%6 = sdiv i32 -2147483648, %5
%7 = tail call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i32 %6, i32 %6)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EMSGSIZE;
int dn_expand(unsigned char const *, unsigned char const *,
              unsigned char const *, char *, size_t);
int /*<<< orphan*/ errno;
int ns_name_uncompress(const unsigned char *msg, const unsigned char *eom,
                       const unsigned char *src, char *dst, size_t dstsiz) {
  int r;
  r = dn_expand(msg, eom, src, dst, dstsiz);
  if (r < 0)
    errno = EMSGSIZE;
  return r;
}


x86 assembly (clang, -O0):
<ns_name_uncompress>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r8
call   1030 <dn_expand@plt>
mov    %eax,-0x2c(%rbp)
cmpl   $0x0,-0x2c(%rbp)
jge    1164 <ns_name_uncompress+0x54>
mov    0x2e8f(%rip),%rax
mov    (%rax),%ecx
mov    0x2e76(%rip),%rax
mov    %ecx,(%rax)
mov    -0x2c(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ns_name_uncompress>:
push   %rax
call   1030 <dn_expand@plt>
test   %eax,%eax
js     111c <ns_name_uncompress+0xc>
pop    %rcx
ret
mov    0x2ec5(%rip),%rcx
mov    (%rcx),%ecx
mov    0x2eac(%rip),%rdx
mov    %ecx,(%rdx)
pop    %rcx
ret

LLVM IR (-O0):
@EMSGSIZE = global i32 0
@errno = global i32 0
define i32 @ns_name_uncompress(i8* %0, i8* %1, i8* %2, i8* %3, i64 %4) {
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca i64
%11 = alloca i32
store i8* %0, i8** %6
store i8* %1, i8** %7
store i8* %2, i8** %8
store i8* %3, i8** %9
store i64 %4, i64* %10
%12 = load i8*, i8** %6
%13 = load i8*, i8** %7
%14 = load i8*, i8** %8
%15 = load i8*, i8** %9
%16 = load i64, i64* %10
%17 = call i32 @dn_expand(i8* %12, i8* %13, i8* %14, i8* %15, i64 %16)
store i32 %17, i32* %11
%18 = load i32, i32* %11
%19 = icmp slt i32 %18, 0
br i1 %19, label %20, label %22
20: ; preds = %5
%21 = load i32, i32* @EMSGSIZE
store i32 %21, i32* @errno
br label %22
22: ; preds = %20, %5
%23 = load i32, i32* %11
ret i32 %23
}

LLVM IR (-O2):
@EMSGSIZE = global i32 0
@errno = global i32 0
define i32 @ns_name_uncompress(i8* %0, i8* %1, i8* %2, i8* %3, i64 %4) {
%6 = tail call i32 @dn_expand(i8* %0, i8* %1, i8* %2, i8* %3, i64 %4)
%7 = icmp slt i32 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %5
%9 = load i32, i32* @EMSGSIZE
store i32 %9, i32* @errno
br label %10
10: ; preds = %8, %5
ret i32 %6
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ close(int /*<<< orphan*/);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ fileno(int /*<<< orphan*/ *);
void close_tcp_stream(FILE *stream) {
  close(fileno(stream));
  fclose(stream);
}


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

x86 assembly (clang, -O2):
<close_tcp_stream>:
push   %rbx
mov    %rdi,%rbx
call   1050 <fileno@plt>
mov    %eax,%edi
call   1040 <close@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <fclose@plt>

LLVM IR (-O0):
define void @close_tcp_stream(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @fileno(i32* %3)
%5 = call i32 @close(i32 %4)
%6 = load i32*, i32** %2
%7 = call i32 @fclose(i32* %6)
ret void
}

LLVM IR (-O2):
define void @close_tcp_stream(i32* nocapture %0) {
%2 = tail call i32 @fileno(i32* %0)
%3 = tail call i32 @close(i32 %2)
%4 = tail call i32 @fclose(i32* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ link_error();
void stest(int x) {
  if (x >> 0 != x)
    link_error();
  if (x << 0 != x)
    link_error();
  if (0 << x != 0)
    link_error();
  if (0 >> x != 0)
    link_error();
  if (-1 >> x != -1)
    link_error();
  if (~0 >> x != ~0)
    link_error();
}


x86 assembly (clang, -O0):
<stest>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x0,%eax
cmp    -0x4(%rbp),%eax
je     1131 <stest+0x21>
mov    $0x0,%al
call   1030 <link_error@plt>
mov    -0x4(%rbp),%eax
shl    $0x0,%eax
cmp    -0x4(%rbp),%eax
je     1147 <stest+0x37>
mov    $0x0,%al
call   1030 <link_error@plt>
mov    -0x4(%rbp),%ecx
xor    %eax,%eax
shl    %cl,%eax
cmp    $0x0,%eax
je     115e <stest+0x4e>
mov    $0x0,%al
call   1030 <link_error@plt>
mov    -0x4(%rbp),%ecx
xor    %eax,%eax
sar    %cl,%eax
cmp    $0x0,%eax
je     1175 <stest+0x65>
mov    $0x0,%al
call   1030 <link_error@plt>
mov    -0x4(%rbp),%ecx
mov    $0xffffffff,%eax
sar    %cl,%eax
cmp    $0xffffffff,%eax
je     118f <stest+0x7f>
mov    $0x0,%al
call   1030 <link_error@plt>
mov    -0x4(%rbp),%ecx
mov    $0xffffffff,%eax
sar    %cl,%eax
cmp    $0xffffffff,%eax
je     11a9 <stest+0x99>
mov    $0x0,%al
call   1030 <link_error@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @stest(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = ashr i32 %3, 0
%5 = load i32, i32* %2
%6 = icmp ne i32 %4, %5
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = call i32 (...) @link_error()
br label %9
9: ; preds = %7, %1
%10 = load i32, i32* %2
%11 = shl i32 %10, 0
%12 = load i32, i32* %2
%13 = icmp ne i32 %11, %12
br i1 %13, label %14, label %16
14: ; preds = %9
%15 = call i32 (...) @link_error()
br label %16
16: ; preds = %14, %9
%17 = load i32, i32* %2
%18 = shl i32 0, %17
%19 = icmp ne i32 %18, 0
br i1 %19, label %20, label %22
20: ; preds = %16
%21 = call i32 (...) @link_error()
br label %22
22: ; preds = %20, %16
%23 = load i32, i32* %2
%24 = ashr i32 0, %23
%25 = icmp ne i32 %24, 0
br i1 %25, label %26, label %28
26: ; preds = %22
%27 = call i32 (...) @link_error()
br label %28
28: ; preds = %26, %22
%29 = load i32, i32* %2
%30 = ashr i32 -1, %29
%31 = icmp ne i32 %30, -1
br i1 %31, label %32, label %34
32: ; preds = %28
%33 = call i32 (...) @link_error()
br label %34
34: ; preds = %32, %28
%35 = load i32, i32* %2
%36 = ashr i32 -1, %35
%37 = icmp ne i32 %36, -1
br i1 %37, label %38, label %40
38: ; preds = %34
%39 = call i32 (...) @link_error()
br label %40
40: ; preds = %38, %34
ret void
}

LLVM IR (-O2):
define void @stest(i32 %0) {
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
void FlashIntClear(uint32_t ui32IntFlags) {
  uint32_t ui32TempVal;
  ui32TempVal = 0;
  if (ui32IntFlags & 0x00400000) {
    ui32TempVal = 0x01000000;
  }
  if (ui32IntFlags & 0x00010000) {
    ui32TempVal |= 0x02000000;
  }
  (*((volatile unsigned long *)(0x40030000 + 0x0000201C))) = ui32TempVal;
}


x86 assembly (clang, -O0):
<FlashIntClear>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x4(%rbp),%eax
and    $0x400000,%eax
cmp    $0x0,%eax
je     1126 <FlashIntClear+0x26>
movl   $0x1000000,-0x8(%rbp)
mov    -0x4(%rbp),%eax
and    $0x10000,%eax
cmp    $0x0,%eax
je     1142 <FlashIntClear+0x42>
mov    -0x8(%rbp),%eax
or     $0x2000000,%eax
mov    %eax,-0x8(%rbp)
movslq -0x8(%rbp),%rcx
mov    $0x4003201c,%eax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<FlashIntClear>:
mov    %edi,%eax
and    $0x400000,%eax
shl    $0x9,%edi
and    $0x2000000,%edi
lea    (%rdi,%rax,4),%eax
mov    %rax,0x4003201c
40
ret

LLVM IR (-O0):
define void @FlashIntClear(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
%4 = load i32, i32* %2
%5 = and i32 %4, 4194304
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 16777216, i32* %3
br label %8
8: ; preds = %7, %1
%9 = load i32, i32* %2
%10 = and i32 %9, 65536
%11 = icmp ne i32 %10, 0
br i1 %11, label %12, label %15
12: ; preds = %8
%13 = load i32, i32* %3
%14 = or i32 %13, 33554432
store i32 %14, i32* %3
br label %15
15: ; preds = %12, %8
%16 = load i32, i32* %3
%17 = sext i32 %16 to i64
store volatile i64 %17, i64* inttoptr (i64 1073946652 to i64*)
ret void
}

LLVM IR (-O2):
define void @FlashIntClear(i32 %0) {
%2 = shl i32 %0, 2
%3 = and i32 %2, 16777216
%4 = shl i32 %0, 9
%5 = and i32 %4, 33554432
%6 = or i32 %5, %3
%7 = zext i32 %6 to i64
store volatile i64 %7, i64* inttoptr (i64 1073946652 to i64*)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __real_main4();
int /*<<< orphan*/ igt_exit();
int /*<<< orphan*/
igt_simple_init_parse_opts(int *, char **, int /*<<< orphan*/ *,
                           int /*<<< orphan*/ *, int /*<<< orphan*/ *,
                           int /*<<< orphan*/ *, int /*<<< orphan*/ *);
int main(int argc, char **argv) {
  igt_simple_init_parse_opts(&argc, argv, NULL, NULL, NULL, NULL, NULL);
  __real_main4();
  igt_exit();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
lea    -0x4(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%r9d
mov    %r9,%rdx
mov    %r9,%rcx
mov    %r9,%r8
movq   $0x0,(%rsp)
call   1040 <igt_simple_init_parse_opts@plt>
mov    $0x0,%al
call   1030 <__real_main4@plt>
mov    $0x0,%al
call   1050 <igt_exit@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
mov    %edi,0x14(%rsp)
movq   $0x0,(%rsp)
lea    0x14(%rsp),%rdi
xor    %edx,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
xor    %r9d,%r9d
call   1040 <igt_simple_init_parse_opts@plt>
xor    %eax,%eax
call   1030 <__real_main4@plt>
xor    %eax,%eax
call   1050 <igt_exit@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
store i32 %0, i32* %3
%4 = call i32 @igt_simple_init_parse_opts(i32* %3, i8** %1, i32* null, i32* null, i32* null, i32* null, i32* null)
%5 = call i32 (...) @__real_main4()
%6 = call i32 (...) @igt_exit()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ strcmp(char *, char *);
int isup(char buf[8]) { return !strcmp(buf, "\033[A"); }


x86 assembly (clang, -O0):
<isup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xed9(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [4 x i8] c"\1B[A\00"
define i32 @isup(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @strcmp(i8* %3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%5 = icmp ne i32 %4, 0
%6 = xor i1 %5, true
%7 = zext i1 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
@.str = [4 x i8] c"\1B[A\00"
define i32 @isup(i8* nocapture %0) {
%2 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(4) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i32 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
__attribute__((__noreturn__)) void exitfunc11(void) {
  printf("Executing exitfunc"
         "11"
         ".\n");
  exit(0);
}


x86 assembly (clang, -O0):
<exitfunc11>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<exitfunc11>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [23 x i8] c"Executing exitfunc11.\0A\00"
define void @exitfunc11() {
%1 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@str = [22 x i8] c"Executing exitfunc11.\00"
define void @exitfunc11() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_context_get_autoload_info_by_index() {
  printf("NOT IMPLEMENTED:"
         "pa_context_get_autoload_info_by_index"
         "\n");
}


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

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

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

LLVM IR (-O2):
@str = [54 x i8] c"NOT IMPLEMENTED:pa_context_get_autoload_info_by_index\00"
define i32 @pa_context_get_autoload_info_by_index() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([54 x i8], [54 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
float _Complex __conjf(float _Complex z) { return ~z; }


x86 assembly (clang, -O0):
<__conjf>:
push   %rbp
mov    %rsp,%rbp
movlpd %xmm0,-0x10(%rbp)
movss  -0x10(%rbp),%xmm1
movaps 0xeeb(%rip),%xmm2
movss  -0xc(%rbp),%xmm0
pxor   %xmm2,%xmm0
movss  %xmm1,-0x8(%rbp)
movss  %xmm0,-0x4(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<__conjf>:
movaps %xmm0,%xmm1
shufps $0x55,%xmm0,%xmm1
xorps  0xef2(%rip),%xmm1
movlhps %xmm0,%xmm1
shufps $0xe2,%xmm0,%xmm1
movaps %xmm1,%xmm0
ret

LLVM IR (-O0):
define <2 x float> @__conjf(<2 x float> %0) {
%2 = alloca { float, float }
%3 = alloca { float, float }
%4 = bitcast { float, float }* %3 to <2 x float>*
store <2 x float> %0, <2 x float>* %4
%5 = getelementptr inbounds { float, float }, { float, float }* %3, i32 0, i32 0
%6 = load float, float* %5
%7 = getelementptr inbounds { float, float }, { float, float }* %3, i32 0, i32 1
%8 = load float, float* %7
%9 = fneg float %8
%10 = getelementptr inbounds { float, float }, { float, float }* %2, i32 0, i32 0
%11 = getelementptr inbounds { float, float }, { float, float }* %2, i32 0, i32 1
store float %6, float* %10
store float %9, float* %11
%12 = bitcast { float, float }* %2 to <2 x float>*
%13 = load <2 x float>, <2 x float>* %12
ret <2 x float> %13
}

LLVM IR (-O2):
define <2 x float> @__conjf(<2 x float> %0) {
%2 = extractelement <2 x float> %0, i64 1
%3 = fneg float %2
%4 = insertelement <2 x float> %0, float %3, i64 1
ret <2 x float> %4
}
void removeNewLine(char *oldInputStr, char *newInputStr) {
  int i = 0;
  for (; oldInputStr[i] != '\n'; i++)
    newInputStr[i] = oldInputStr[i];
  newInputStr[i] = '\0';
}


x86 assembly (clang, -O0):
<removeNewLine>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0xa,%eax
je     114c <removeNewLine+0x4c>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,1),%dl
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1113 <removeNewLine+0x13>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
pop    %rbp
ret

x86 assembly (clang, -O2):
<removeNewLine>:
mov    (%rdi),%al
cmp    $0xa,%al
jne    110d <removeNewLine+0xd>
xor    %eax,%eax
movb   $0x0,(%rsi,%rax,1)
ret
xor    %ecx,%ecx
nop
mov    %al,(%rsi,%rcx,1)
movzbl 0x1(%rdi,%rcx,1),%eax
add    $0x1,%rcx
cmp    $0xa,%al
jne    1110 <removeNewLine+0x10>
mov    %ecx,%eax
movb   $0x0,(%rsi,%rax,1)
ret

LLVM IR (-O0):
define void @removeNewLine(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
store i8* %0, i8** %3
store i8* %1, i8** %4
store i32 0, i32* %5
br label %6
6: ; preds = %24, %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, 10
br i1 %13, label %14, label %27
14: ; preds = %6
%15 = load i8*, i8** %3
%16 = load i32, i32* %5
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds i8, i8* %15, i64 %17
%19 = load i8, i8* %18
%20 = load i8*, i8** %4
%21 = load i32, i32* %5
%22 = sext i32 %21 to i64
%23 = getelementptr inbounds i8, i8* %20, i64 %22
store i8 %19, i8* %23
br label %24
24: ; preds = %14
%25 = load i32, i32* %5
%26 = add nsw i32 %25, 1
store i32 %26, i32* %5
br label %6
27: ; preds = %6
%28 = load i8*, i8** %4
%29 = load i32, i32* %5
%30 = sext i32 %29 to i64
%31 = getelementptr inbounds i8, i8* %28, i64 %30
store i8 0, i8* %31
ret void
}

LLVM IR (-O2):
define void @removeNewLine(i8* nocapture %0, i8* nocapture writeonly %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 10
br i1 %4, label %15, label %5
5: ; preds = %2, %5
%6 = phi i64 [ %9, %5 ], [ 0, %2 ]
%7 = phi i8 [ %11, %5 ], [ %3, %2 ]
%8 = getelementptr inbounds i8, i8* %1, i64 %6
store i8 %7, i8* %8
%9 = add nuw nsw i64 %6, 1
%10 = getelementptr inbounds i8, i8* %0, i64 %9
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 10
br i1 %12, label %13, label %5
13: ; preds = %5
%14 = and i64 %9, 4294967295
br label %15
15: ; preds = %13, %2
%16 = phi i64 [ 0, %2 ], [ %14, %13 ]
%17 = getelementptr inbounds i8, i8* %1, i64 %16
store i8 0, i8* %17
ret void
}
/* Variables and functions */
int f106(int *);
int f107(int *p) { return f106(p); }


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

x86 assembly (clang, -O2):
<f107>:
jmp    1030 <f106@plt>

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

LLVM IR (-O2):
define i32 @f107(i32* %0) {
%2 = tail call i32 @f106(i32* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ abort();
void *malloc(size_t);
void *xmalloc(size_t size) {
  void *ret = malloc(size);
  if (ret == NULL)
    abort();
  return ret;
}


x86 assembly (clang, -O0):
<xmalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    114b <xmalloc+0x2b>
mov    $0x0,%al
call   1030 <abort@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmalloc>:
push   %rax
call   1040 <malloc@plt>
test   %rax,%rax
je     112d <xmalloc+0xd>
pop    %rcx
ret
xor    %eax,%eax
call   1030 <abort@plt>

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

LLVM IR (-O2):
define noalias i8* @xmalloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 (...) @abort()
unreachable
6: ; preds = %1
ret i8* %2
}
int length(int value) {
  int l = 1;
  while (value > 9) {
    l++;
    value /= 10;
  }
  return l;
}


x86 assembly (clang, -O0):
<length>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
cmpl   $0x9,-0x4(%rbp)
jle    1134 <length+0x34>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
jmp    110e <length+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<length>:
mov    $0x1,%eax
cmp    $0xa,%edi
jl     1134 <length+0x34>
mov    $0x1,%eax
mov    $0xcccccccd,%ecx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
add    $0x1,%eax
mov    %edi,%edx
imul   %rcx,%rdx
shr    $0x23,%rdx
cmp    $0x63,%edi
mov    %edx,%edi
ja     1120 <length+0x20>
ret

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

LLVM IR (-O2):
define i32 @length(i32 %0) {
%2 = icmp sgt i32 %0, 9
br i1 %2, label %3, label %9
3: ; preds = %1, %3
%4 = phi i32 [ %6, %3 ], [ 1, %1 ]
%5 = phi i32 [ %7, %3 ], [ %0, %1 ]
%6 = add nuw nsw i32 %4, 1
%7 = udiv i32 %5, 10
%8 = icmp ugt i32 %5, 99
br i1 %8, label %3, label %9
9: ; preds = %3, %1
%10 = phi i32 [ 1, %1 ], [ %6, %3 ]
ret i32 %10
}
/* Type definitions */
typedef size_t int32_t;

/* Variables and functions */
__attribute__((visibility("hidden"))) void dset_link(int32_t *S, int32_t r2,
                                                     int32_t r1) {
  if (r1 > r2) {
    S[r1] = r2;
  }
  if (r1 < r2) {
    S[r2] = r1;
  }
}


x86 assembly (clang, -O0):
<dset_link>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x10(%rbp),%rax
jbe    112e <dset_link+0x2e>
mov    -0x10(%rbp),%rdx
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    %rdx,(%rax,%rcx,8)
mov    -0x18(%rbp),%rax
cmp    -0x10(%rbp),%rax
jae    114c <dset_link+0x4c>
mov    -0x18(%rbp),%rdx
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
mov    %rdx,(%rax,%rcx,8)
pop    %rbp
ret

x86 assembly (clang, -O2):
<dset_link>:
cmp    %rsi,%rdx
ja     110b <dset_link+0xb>
cmp    %rsi,%rdx
jb     1114 <dset_link+0x14>
ret
mov    %rsi,(%rdi,%rdx,8)
cmp    %rsi,%rdx
jae    110a <dset_link+0xa>
mov    %rdx,(%rdi,%rsi,8)
ret

LLVM IR (-O0):
define hidden void @dset_link(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* %6
%8 = load i64, i64* %5
%9 = icmp ugt i64 %7, %8
br i1 %9, label %10, label %15
10: ; preds = %3
%11 = load i64, i64* %5
%12 = load i64*, i64** %4
%13 = load i64, i64* %6
%14 = getelementptr inbounds i64, i64* %12, i64 %13
store i64 %11, i64* %14
br label %15
15: ; preds = %10, %3
%16 = load i64, i64* %6
%17 = load i64, i64* %5
%18 = icmp ult i64 %16, %17
br i1 %18, label %19, label %24
19: ; preds = %15
%20 = load i64, i64* %6
%21 = load i64*, i64** %4
%22 = load i64, i64* %5
%23 = getelementptr inbounds i64, i64* %21, i64 %22
store i64 %20, i64* %23
br label %24
24: ; preds = %19, %15
ret void
}

LLVM IR (-O2):
define hidden void @dset_link(i64* nocapture writeonly %0, i64 %1, i64 %2) {
%4 = icmp ugt i64 %2, %1
br i1 %4, label %5, label %7
5: ; preds = %3
%6 = getelementptr inbounds i64, i64* %0, i64 %2
store i64 %1, i64* %6
br label %7
7: ; preds = %5, %3
%8 = icmp ult i64 %2, %1
br i1 %8, label %9, label %11
9: ; preds = %7
%10 = getelementptr inbounds i64, i64* %0, i64 %1
store i64 %2, i64* %10
br label %11
11: ; preds = %9, %7
ret void
}
/* Variables and functions */
char *U_WMRCORENONE_set(char *);
char *U_WMRA8_set(void) { return U_WMRCORENONE_set("U_WMRA8"); }


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

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

LLVM IR (-O0):
@.str = [8 x i8] c"U_WMRA8\00"
define i8* @U_WMRA8_set() {
%1 = call i8* @U_WMRCORENONE_set(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}

LLVM IR (-O2):
@.str = [8 x i8] c"U_WMRA8\00"
define i8* @U_WMRA8_set() {
%1 = tail call i8* @U_WMRCORENONE_set(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}
/* Variables and functions */
int exp(double);
double logistic(double val) { return 1 / (1 + exp(-val)); }


x86 assembly (clang, -O0):
<logistic>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
call   1030 <exp@plt>
mov    %eax,%ecx
add    $0x1,%ecx
mov    $0x1,%eax
cltd
idiv   %ecx
cvtsi2sd %eax,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<logistic>:
push   %rax
xorps  0xee8(%rip),%xmm0
call   1030 <exp@plt>
lea    0x1(%rax),%ecx
add    $0x2,%eax
xor    %edx,%edx
cmp    $0x3,%eax
cmovb  %ecx,%edx
xorps  %xmm0,%xmm0
cvtsi2sd %edx,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @logistic(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fneg double %3
%5 = call i32 @exp(double %4)
%6 = add nsw i32 1, %5
%7 = sdiv i32 1, %6
%8 = sitofp i32 %7 to double
ret double %8
}

LLVM IR (-O2):
define double @logistic(double %0) {
%2 = fneg double %0
%3 = tail call i32 @exp(double %2)
%4 = add nsw i32 %3, 1
%5 = add i32 %3, 2
%6 = icmp ult i32 %5, 3
%7 = select i1 %6, i32 %4, i32 0
%8 = sitofp i32 %7 to double
ret double %8
}
/* Variables and functions */
int /*<<< orphan*/ Msp430ClockP__Msp430ClockInit__default__initTimerA();
void Msp430ClockP__Msp430ClockInit__initTimerA(void) {
  Msp430ClockP__Msp430ClockInit__default__initTimerA();
}


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

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

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

LLVM IR (-O2):
define void @Msp430ClockP__Msp430ClockInit__initTimerA() {
%1 = tail call i32 (...) @Msp430ClockP__Msp430ClockInit__default__initTimerA()
ret void
}
/* Variables and functions */
scalar_t__ qe_inrange(int, char, float);
scalar_t__ qe_isdigit(int);
int to_hex(int key) {
  if (qe_isdigit(key))
    return key - '0';
  else if (qe_inrange(key | ('a' - 'A'), 'a', 'f'))
    return (key & 7) + 9;
  else
    return -1;
}


x86 assembly (clang, -O0):
<to_hex>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <qe_isdigit@plt>
cmp    $0x0,%rax
je     114b <to_hex+0x2b>
mov    -0x8(%rbp),%eax
sub    $0x30,%eax
mov    %eax,-0x4(%rbp)
jmp    1185 <to_hex+0x65>
mov    -0x8(%rbp),%edi
or     $0x20,%edi
mov    $0x61,%esi
movss  0xea2(%rip),%xmm0
call   1040 <qe_inrange@plt>
cmp    $0x0,%rax
je     117e <to_hex+0x5e>
mov    -0x8(%rbp),%eax
and    $0x7,%eax
add    $0x9,%eax
mov    %eax,-0x4(%rbp)
jmp    1185 <to_hex+0x65>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<to_hex>:
push   %rbx
mov    %edi,%ebx
call   1030 <qe_isdigit@plt>
test   %rax,%rax
je     1132 <to_hex+0x12>
add    $0xffffffd0,%ebx
jmp    115b <to_hex+0x3b>
mov    %ebx,%edi
or     $0x20,%edi
movss  0xec1(%rip),%xmm0
mov    $0x61,%esi
call   1040 <qe_inrange@plt>
test   %rax,%rax
je     1156 <to_hex+0x36>
and    $0x7,%ebx
add    $0x9,%ebx
jmp    115b <to_hex+0x3b>
mov    $0xffffffff,%ebx
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @to_hex(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = call i64 @qe_isdigit(i32 %4)
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %1
%8 = load i32, i32* %3
%9 = sub nsw i32 %8, 48
store i32 %9, i32* %2
br label %20
10: ; preds = %1
%11 = load i32, i32* %3
%12 = or i32 %11, 32
%13 = call i64 @qe_inrange(i32 %12, i8 signext 97, float 1.020000e+02)
%14 = icmp ne i64 %13, 0
br i1 %14, label %15, label %19
15: ; preds = %10
%16 = load i32, i32* %3
%17 = and i32 %16, 7
%18 = add nsw i32 %17, 9
store i32 %18, i32* %2
br label %20
19: ; preds = %10
store i32 -1, i32* %2
br label %20
20: ; preds = %19, %15, %7
%21 = load i32, i32* %2
ret i32 %21
}

LLVM IR (-O2):
define i32 @to_hex(i32 %0) {
%2 = tail call i64 @qe_isdigit(i32 %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = add nsw i32 %0, -48
br label %13
6: ; preds = %1
%7 = or i32 %0, 32
%8 = tail call i64 @qe_inrange(i32 %7, i8 signext 97, float 1.020000e+02)
%9 = icmp eq i64 %8, 0
br i1 %9, label %13, label %10
10: ; preds = %6
%11 = and i32 %0, 7
%12 = add nuw nsw i32 %11, 9
br label %13
13: ; preds = %6, %10, %4
%14 = phi i32 [ %5, %4 ], [ %12, %10 ], [ -1, %6 ]
ret i32 %14
}
int test_imm_6Cuint64_highword_reg(unsigned long long val) {
  return ((val >> 32) & (0x6C << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_6Cuint64_highword_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
shr    $0x20,%rdx
and    $0x6c,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_6Cuint64_highword_reg>:
movabs $0x6c00000000,%rax
test   %rax,%rdi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_6Cuint64_highword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = lshr i64 %3, 32
%5 = and i64 %4, 108
%6 = icmp ne i64 %5, 0
%7 = zext i1 %6 to i64
%8 = select i1 %6, i32 -20, i32 -40
ret i32 %8
}

LLVM IR (-O2):
define i32 @test_imm_6Cuint64_highword_reg(i64 %0) {
%2 = and i64 %0, 463856467968
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ MODULE_ERR(char *);
int /*<<< orphan*/ cleanup(int /*<<< orphan*/);
void STRDELETE(char *S, short P, short N) {
  MODULE_ERR("STRDELETE not supported");
  cleanup(0);
  return;
}


x86 assembly (clang, -O0):
<STRDELETE>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dx,%ax
mov    %si,%cx
mov    %rdi,-0x8(%rbp)
mov    %cx,-0xa(%rbp)
mov    %ax,-0xc(%rbp)
lea    0xebf(%rip),%rdi
call   1040 <MODULE_ERR@plt>
xor    %edi,%edi
call   1030 <cleanup@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<STRDELETE>:
push   %rax
lea    0xed8(%rip),%rdi
call   1040 <MODULE_ERR@plt>
xor    %edi,%edi
pop    %rax
jmp    1030 <cleanup@plt>

LLVM IR (-O0):
@.str = [24 x i8] c"STRDELETE not supported\00"
define void @STRDELETE(i8* %0, i16 signext %1, i16 signext %2) {
%4 = alloca i8*
%5 = alloca i16
%6 = alloca i16
store i8* %0, i8** %4
store i16 %1, i16* %5
store i16 %2, i16* %6
%7 = call i32 @MODULE_ERR(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @cleanup(i32 0)
ret void
}

LLVM IR (-O2):
@.str = [24 x i8] c"STRDELETE not supported\00"
define void @STRDELETE(i8* nocapture readnone %0, i16 signext %1, i16 signext %2) {
%4 = tail call i32 @MODULE_ERR(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%5 = tail call i32 @cleanup(i32 0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ siginfo_t;

/* Variables and functions */
void rtsig_handler(int sig, siginfo_t *si, void *ctx) {}


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

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

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

LLVM IR (-O2):
define void @rtsig_handler(i32 %0, i32* nocapture %1, i8* nocapture %2) {
ret void
}
int ResetLink(link_fd)
int link_fd;
{
  if ((ioctl(link_fd, 0, 0)) == -1) {
    printf("BRS Error : Reset() failed.\r\n");
    return (1);
  }
  return (0);
}


x86 assembly (clang, -O0):
<ResetLink>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
xor    %edx,%edx
mov    %edx,%esi
mov    $0x0,%al
call   1040 <ioctl@plt>
cmp    $0xffffffff,%eax
jne    115c <ResetLink+0x3c>
lea    0xeb7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    1163 <ResetLink+0x43>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ResetLink>:
push   %rbx
xor    %ebx,%ebx
xor    %esi,%esi
xor    %edx,%edx
xor    %eax,%eax
call   1040 <ioctl@plt>
cmp    $0xffffffff,%eax
jne    1144 <ResetLink+0x24>
lea    0xec6(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%ebx
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [30 x i8] c"BRS Error : Reset() failed.\0D\0A\00"
define i32 @ResetLink(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = call i32 (i32, i32, i32, ...) bitcast (i32 (...)* @ioctl to i32 (i32, i32, i32, ...)*)(i32 %4, i32 0, i32 0)
%6 = icmp eq i32 %5, -1
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
store i32 1, i32* %2
br label %10
9: ; preds = %1
store i32 0, i32* %2
br label %10
10: ; preds = %9, %7
%11 = load i32, i32* %2
ret i32 %11
}

LLVM IR (-O2):
@str = [29 x i8] c"BRS Error : Reset() failed.\0D\00"
define i32 @ResetLink(i32 %0) {
%2 = tail call i32 (i32, i32, i32, ...) bitcast (i32 (...)* @ioctl to i32 (i32, i32, i32, ...)*)(i32 %0, i32 0, i32 0)
%3 = icmp eq i32 %2, -1
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @str, i64 0, i64 0))
br label %6
6: ; preds = %1, %4
%7 = phi i32 [ 1, %4 ], [ 0, %1 ]
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, long);
void main() {
  long l;
  l = 6;
  printf("l=%d\n", l);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movq   $0x6,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
lea    0xee9(%rip),%rdi
mov    $0x6,%esi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [6 x i8] c"l=%d\0A\00"
define void @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i64 6)
ret void
}
/* Variables and functions */
double sin(double);
double geom_J_sph_tpr(double x[]) { return sin(x[0]); }


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

x86 assembly (clang, -O2):
<geom_J_sph_tpr>:
movsd  (%rdi),%xmm0
jmp    1030 <sin@plt>

LLVM IR (-O0):
define double @geom_J_sph_tpr(double* %0) {
%2 = alloca double*
store double* %0, double** %2
%3 = load double*, double** %2
%4 = getelementptr inbounds double, double* %3, i64 0
%5 = load double, double* %4
%6 = call double @sin(double %5)
ret double %6
}

LLVM IR (-O2):
define double @geom_J_sph_tpr(double* nocapture %0) {
%2 = load double, double* %0
%3 = tail call double @sin(double %2)
ret double %3
}
void CRYPTO_ex_data_new_class(void) {}


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

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

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

LLVM IR (-O2):
define void @CRYPTO_ex_data_new_class() {
ret void
}
void swap(int *x0, int *y0) {
  int tmp = *x0;
  *x0 = *y0;
  *y0 = tmp;
}


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

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

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

LLVM IR (-O2):
define void @swap(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %0
%4 = load i32, i32* %1
store i32 %4, i32* %0
store i32 %3, i32* %1
ret void
}