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

/* Variables and functions */
int /*<<< orphan*/ bcf_dec_int1(int const *, int const, int **);
int32_t bcf_dec_typed_int1(const uint8_t *p, uint8_t **q) {
  return bcf_dec_int1(p + 1, *p & 0xf, q);
}


x86 assembly (clang, -O0):
<bcf_dec_typed_int1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
add    $0x4,%rdi
mov    -0x8(%rbp),%rax
mov    (%rax),%esi
and    $0xf,%esi
mov    -0x10(%rbp),%rdx
call   1030 <bcf_dec_int1@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bcf_dec_typed_int1>:
mov    %rsi,%rdx
mov    (%rdi),%esi
add    $0x4,%rdi
and    $0xf,%esi
jmp    1030 <bcf_dec_int1@plt>

LLVM IR (-O0):
define i32 @bcf_dec_typed_int1(i32* %0, i32** %1) {
%3 = alloca i32*
%4 = alloca i32**
store i32* %0, i32** %3
store i32** %1, i32*** %4
%5 = load i32*, i32** %3
%6 = getelementptr inbounds i32, i32* %5, i64 1
%7 = load i32*, i32** %3
%8 = load i32, i32* %7
%9 = and i32 %8, 15
%10 = load i32**, i32*** %4
%11 = call i32 @bcf_dec_int1(i32* %6, i32 %9, i32** %10)
ret i32 %11
}

LLVM IR (-O2):
define i32 @bcf_dec_typed_int1(i32* %0, i32** %1) {
%3 = getelementptr inbounds i32, i32* %0, i64 1
%4 = load i32, i32* %0
%5 = and i32 %4, 15
%6 = tail call i32 @bcf_dec_int1(i32* %3, i32 %5, i32** %1)
ret i32 %6
}
/* Type definitions */
struct ibv_context {
  int dummy;
};
struct ibv_comp_channel {
  int dummy;
};

/* Variables and functions */
struct ibv_comp_channel *ibv_create_comp_channel(struct ibv_context *);
struct ibv_comp_channel *
mlx4_glue_create_comp_channel(struct ibv_context *context) {
  return ibv_create_comp_channel(context);
}


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

x86 assembly (clang, -O2):
<mlx4_glue_create_comp_channel>:
jmp    1030 <ibv_create_comp_channel@plt>

LLVM IR (-O0):
%struct.ibv_comp_channel = type { i32 }
%struct.ibv_context = type { i32 }
define %struct.ibv_comp_channel* @mlx4_glue_create_comp_channel(%struct.ibv_context* %0) {
%2 = alloca %struct.ibv_context*
store %struct.ibv_context* %0, %struct.ibv_context** %2
%3 = load %struct.ibv_context*, %struct.ibv_context** %2
%4 = call %struct.ibv_comp_channel* @ibv_create_comp_channel(%struct.ibv_context* %3)
ret %struct.ibv_comp_channel* %4
}

LLVM IR (-O2):
%struct.ibv_comp_channel = type { i32 }
%struct.ibv_context = type { i32 }
define %struct.ibv_comp_channel* @mlx4_glue_create_comp_channel(%struct.ibv_context* %0) {
%2 = tail call %struct.ibv_comp_channel* @ibv_create_comp_channel(%struct.ibv_context* %0)
ret %struct.ibv_comp_channel* %2
}
void doubles_mat_to_xyz(const double M[16], double xyz[3]) {
  xyz[0] = M[3];
  xyz[1] = M[7];
  xyz[2] = M[11];
}


x86 assembly (clang, -O0):
<doubles_mat_to_xyz>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsd  0x18(%rax),%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x8(%rbp),%rax
movsd  0x38(%rax),%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,0x8(%rax)
mov    -0x8(%rbp),%rax
movsd  0x58(%rax),%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,0x10(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<doubles_mat_to_xyz>:
movsd  0x18(%rdi),%xmm0
movsd  %xmm0,(%rsi)
movsd  0x38(%rdi),%xmm0
movsd  %xmm0,0x8(%rsi)
movsd  0x58(%rdi),%xmm0
movsd  %xmm0,0x10(%rsi)
ret

LLVM IR (-O0):
define void @doubles_mat_to_xyz(double* %0, double* %1) {
%3 = alloca double*
%4 = alloca double*
store double* %0, double** %3
store double* %1, double** %4
%5 = load double*, double** %3
%6 = getelementptr inbounds double, double* %5, i64 3
%7 = load double, double* %6
%8 = load double*, double** %4
%9 = getelementptr inbounds double, double* %8, i64 0
store double %7, double* %9
%10 = load double*, double** %3
%11 = getelementptr inbounds double, double* %10, i64 7
%12 = load double, double* %11
%13 = load double*, double** %4
%14 = getelementptr inbounds double, double* %13, i64 1
store double %12, double* %14
%15 = load double*, double** %3
%16 = getelementptr inbounds double, double* %15, i64 11
%17 = load double, double* %16
%18 = load double*, double** %4
%19 = getelementptr inbounds double, double* %18, i64 2
store double %17, double* %19
ret void
}

LLVM IR (-O2):
define void @doubles_mat_to_xyz(double* nocapture %0, double* nocapture writeonly %1) {
%3 = getelementptr inbounds double, double* %0, i64 3
%4 = load double, double* %3
store double %4, double* %1
%5 = getelementptr inbounds double, double* %0, i64 7
%6 = load double, double* %5
%7 = getelementptr inbounds double, double* %1, i64 1
store double %6, double* %7
%8 = getelementptr inbounds double, double* %0, i64 11
%9 = load double, double* %8
%10 = getelementptr inbounds double, double* %1, i64 2
store double %9, double* %10
ret void
}
/* Variables and functions */
char const *SDL_GetErrorMsg(char *, int);
const char *SDL_GetError(void) {
  static char errmsg[1024];
  return SDL_GetErrorMsg(errmsg, 1024);
}


x86 assembly (clang, -O0):
<SDL_GetError>:
push   %rbp
mov    %rsp,%rbp
lea    0x2f25(%rip),%rdi
mov    $0x400,%esi
call   1030 <SDL_GetErrorMsg@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<SDL_GetError>:
lea    0x2f29(%rip),%rdi
mov    $0x400,%esi
jmp    1030 <SDL_GetErrorMsg@plt>

LLVM IR (-O0):
@SDL_GetError.errmsg = internal global [1024 x i8] zeroinitializer
define i8* @SDL_GetError() {
%1 = call i8* @SDL_GetErrorMsg(i8* getelementptr inbounds ([1024 x i8], [1024 x i8]* @SDL_GetError.errmsg, i64 0, i64 0), i32 1024)
ret i8* %1
}

LLVM IR (-O2):
@SDL_GetError.errmsg = internal global [1024 x i8] zeroinitializer
define i8* @SDL_GetError() {
%1 = tail call i8* @SDL_GetErrorMsg(i8* getelementptr inbounds ([1024 x i8], [1024 x i8]* @SDL_GetError.errmsg, i64 0, i64 0), i32 1024)
ret i8* %1
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
int ndelay_on(int);
int socket_sctp6b();
int socket_sctp6(void) {
  int s = socket_sctp6b();
  if (s == -1)
    return -1;
  if (ndelay_on(s) == -1) {
    close(s);
    return -1;
  }
  return s;
}


x86 assembly (clang, -O0):
<socket_sctp6>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1050 <socket_sctp6b@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0xffffffff,-0x8(%rbp)
jne    1158 <socket_sctp6+0x28>
movl   $0xffffffff,-0x4(%rbp)
jmp    1183 <socket_sctp6+0x53>
mov    -0x8(%rbp),%edi
call   1040 <ndelay_on@plt>
cmp    $0xffffffff,%eax
jne    117d <socket_sctp6+0x4d>
mov    -0x8(%rbp),%edi
call   1030 <close@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1183 <socket_sctp6+0x53>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<socket_sctp6>:
push   %rbp
push   %rbx
push   %rax
xor    %eax,%eax
call   1050 <socket_sctp6b@plt>
mov    $0xffffffff,%ebx
cmp    $0xffffffff,%eax
je     115d <socket_sctp6+0x2d>
mov    %eax,%ebp
mov    %eax,%edi
call   1040 <ndelay_on@plt>
cmp    $0xffffffff,%eax
je     1156 <socket_sctp6+0x26>
mov    %ebp,%ebx
jmp    115d <socket_sctp6+0x2d>
mov    %ebp,%edi
call   1030 <close@plt>
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @socket_sctp6() {
%1 = alloca i32
%2 = alloca i32
%3 = call i32 (...) @socket_sctp6b()
store i32 %3, i32* %2
%4 = load i32, i32* %2
%5 = icmp eq i32 %4, -1
br i1 %5, label %6, label %7
6: ; preds = %0
store i32 -1, i32* %1
br label %16
7: ; preds = %0
%8 = load i32, i32* %2
%9 = call i32 @ndelay_on(i32 %8)
%10 = icmp eq i32 %9, -1
br i1 %10, label %11, label %14
11: ; preds = %7
%12 = load i32, i32* %2
%13 = call i32 @close(i32 %12)
store i32 -1, i32* %1
br label %16
14: ; preds = %7
%15 = load i32, i32* %2
store i32 %15, i32* %1
br label %16
16: ; preds = %14, %11, %6
%17 = load i32, i32* %1
ret i32 %17
}

LLVM IR (-O2):
define i32 @socket_sctp6() {
%1 = tail call i32 (...) @socket_sctp6b()
%2 = icmp eq i32 %1, -1
br i1 %2, label %8, label %3
3: ; preds = %0
%4 = tail call i32 @ndelay_on(i32 %1)
%5 = icmp eq i32 %4, -1
br i1 %5, label %6, label %8
6: ; preds = %3
%7 = tail call i32 @close(i32 %1)
br label %8
8: ; preds = %3, %0, %6
%9 = phi i32 [ -1, %6 ], [ -1, %0 ], [ %1, %3 ]
ret i32 %9
}
/* Type definitions */
typedef int /*<<< orphan*/ wchar_t;

/* Variables and functions */
int towide_euc_impl(int /*<<< orphan*/ *, char const *, unsigned int,
                    int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/,
                    int /*<<< orphan*/);
int towide_euckr(wchar_t *wc, const char *mb, unsigned n) {
  return (towide_euc_impl(wc, mb, n, 0, 0, 0, 0));
}


x86 assembly (clang, -O0):
<towide_euckr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
xor    %r9d,%r9d
mov    %r9d,%ecx
mov    %r9d,%r8d
movl   $0x0,(%rsp)
call   1030 <towide_euc_impl@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<towide_euckr>:
push   %rax
movl   $0x0,(%rsp)
xor    %ecx,%ecx
xor    %r8d,%r8d
xor    %r9d,%r9d
call   1030 <towide_euc_impl@plt>
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @towide_euckr(i32* %0, i8* %1, i32 %2) {
%4 = tail call i32 @towide_euc_impl(i32* %0, i8* %1, i32 %2, i32 0, i32 0, i32 0, i32 0)
ret i32 %4
}
int makeHash(char *key) {
  int hash = 4226724;
  int pos = 0;
  while (*key != '\0') {
    hash ^= *key << pos;
    pos++;
    key++;
  }
  return hash >= 0 ? hash : ~hash;
}


x86 assembly (clang, -O0):
<makeHash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x407ea4,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1152 <makeHash+0x52>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
mov    -0x10(%rbp),%ecx
shl    %cl,%eax
xor    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1116 <makeHash+0x16>
cmpl   $0x0,-0xc(%rbp)
jl     1167 <makeHash+0x67>
mov    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
jmp    1170 <makeHash+0x70>
mov    -0xc(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<makeHash>:
mov    (%rdi),%al
mov    $0x407ea4,%edx
test   %al,%al
je     1124 <makeHash+0x24>
xor    %ecx,%ecx
nopl   (%rax)
movsbl %al,%eax
shl    %cl,%eax
xor    %eax,%edx
movzbl 0x1(%rdi,%rcx,1),%eax
add    $0x1,%rcx
test   %al,%al
jne    1110 <makeHash+0x10>
mov    %edx,%eax
sar    $0x1f,%eax
xor    %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @makeHash(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %16, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %14, %4 ], [ %2, %1 ]
%6 = phi i32 [ %12, %4 ], [ 0, %1 ]
%7 = phi i32 [ %11, %4 ], [ 4226724, %1 ]
%8 = phi i8* [ %13, %4 ], [ %0, %1 ]
%9 = sext i8 %5 to i32
%10 = shl i32 %9, %6
%11 = xor i32 %10, %7
%12 = add nuw nsw i32 %6, 1
%13 = getelementptr inbounds i8, i8* %8, i64 1
%14 = load i8, i8* %13
%15 = icmp eq i8 %14, 0
br i1 %15, label %16, label %4
16: ; preds = %4, %1
%17 = phi i32 [ 4226724, %1 ], [ %11, %4 ]
%18 = ashr i32 %17, 31
%19 = xor i32 %18, %17
ret i32 %19
}
const char *true_false_str(char val) {
  if (val)
    return "true";
  return "false";
}


x86 assembly (clang, -O0):
<true_false_str>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x9(%rbp)
cmpb   $0x0,-0x9(%rbp)
je     1124 <true_false_str+0x24>
lea    0xee5(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    112f <true_false_str+0x2f>
lea    0xeda(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<true_false_str>:
test   %dil,%dil
lea    0xefb(%rip),%rcx
lea    0xeef(%rip),%rax
cmove  %rcx,%rax
ret

LLVM IR (-O0):
@.str = [5 x i8] c"true\00"
@.str.1 = [6 x i8] c"false\00"
define i8* @true_false_str(i8 signext %0) {
%2 = alloca i8*
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = icmp ne i8 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %1
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8** %2
br label %8
7: ; preds = %1
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8** %2
br label %8
8: ; preds = %7, %6
%9 = load i8*, i8** %2
ret i8* %9
}

LLVM IR (-O2):
@.str = [5 x i8] c"true\00"
@.str.1 = [6 x i8] c"false\00"
define i8* @true_false_str(i8 signext %0) {
%2 = icmp eq i8 %0, 0
%3 = select i1 %2, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0)
ret i8* %3
}
/* Variables and functions */
scalar_t__ fork();
int /*<<< orphan*/ printf(char *);
void main() {
  if (fork())
    printf("PARENT\n");
  else
    printf("CHILD\n");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <fork@plt>
cmp    $0x0,%rax
je     1146 <main+0x26>
lea    0xec4(%rip),%rdi
call   1030 <printf@plt>
jmp    1152 <main+0x32>
lea    0xebb(%rip),%rdi
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <fork@plt>
test   %rax,%rax
lea    0xece(%rip),%rax
lea    0xecd(%rip),%rdi
cmove  %rax,%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"PARENT\0A\00"
@.str.1 = [7 x i8] c"CHILD\0A\00"
define void @main() {
%1 = call i64 (...) @fork()
%2 = icmp ne i64 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
br label %7
5: ; preds = %0
%6 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
br label %7
7: ; preds = %5, %3
ret void
}

LLVM IR (-O2):
@str = [6 x i8] c"CHILD\00"
@str.2 = [7 x i8] c"PARENT\00"
define void @main() {
%1 = tail call i64 (...) @fork()
%2 = icmp eq i64 %1, 0
%3 = select i1 %2, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @str.2, i64 0, i64 0)
%4 = tail call i32 @puts(i8* dereferenceable(1) %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void freer(void *data, void *context) {
  (void)context;
  free(data);
}


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

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

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

LLVM IR (-O2):
define void @freer(i8* nocapture %0, i8* nocapture readnone %1) {
%3 = tail call i32 @free(i8* %0)
ret void
}
void write_fence(void) { asm("" : : : "memory"); }


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

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

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

LLVM IR (-O2):
define void @write_fence() {
tail call void asm sideeffect "", "~{memory},~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int listen(int, int);
int /*<<< orphan*/ perror(char *);
void std_listen(int sockfd, int backlog) {
  if (listen(sockfd, backlog) == -1) {
    perror("listen");
    exit(1);
  }
}


x86 assembly (clang, -O0):
<std_listen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <listen@plt>
cmp    $0xffffffff,%eax
jne    1168 <std_listen+0x38>
lea    0xea7(%rip),%rdi
call   1040 <perror@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<std_listen>:
push   %rax
call   1030 <listen@plt>
cmp    $0xffffffff,%eax
je     113d <std_listen+0xd>
pop    %rax
ret
lea    0xebc(%rip),%rdi
call   1040 <perror@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

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

LLVM IR (-O2):
@.str = [7 x i8] c"listen\00"
define void @std_listen(i32 %0, i32 %1) {
%3 = tail call i32 @listen(i32 %0, i32 %1)
%4 = icmp eq i32 %3, -1
br i1 %4, label %5, label %8
5: ; preds = %2
%6 = tail call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%7 = tail call i32 @exit(i32 1)
unreachable
8: ; preds = %2
ret void
}
int confirmShutdown() {}


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

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

LLVM IR (-O0):
define i32 @confirmShutdown() {
%1 = alloca i32
%2 = load i32, i32* %1
ret i32 %2
}

LLVM IR (-O2):
define i32 @confirmShutdown() {
ret i32 undef
}
int mswin_minorver() { return (20); }


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

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

LLVM IR (-O0):
define i32 @mswin_minorver() {
ret i32 20
}

LLVM IR (-O2):
define i32 @mswin_minorver() {
ret i32 20
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char);
int /*<<< orphan*/ scanf(char *, char *);
int main() {
  char a, k;
  int m;
  m = 'a' + 'z';
  scanf("%c", &a);
  k = m - a;
  printf("%c\n", k);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xdb,-0xc(%rbp)
lea    0xec3(%rip),%rdi
lea    -0x5(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0xc(%rbp),%eax
movsbl -0x5(%rbp),%ecx
sub    %ecx,%eax
mov    %al,-0x6(%rbp)
lea    0xeaa(%rip),%rdi
movsbl -0x6(%rbp),%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0x7(%rsp),%rsi
call   1040 <scanf@plt>
mov    $0xdb,%al
sub    0x7(%rsp),%al
movsbl %al,%esi
lea    0xec1(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%c\00"
@.str.1 = [4 x i8] c"%c\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
%3 = alloca i8
%4 = alloca i32
store i32 0, i32* %1
store i32 219, i32* %4
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %2)
%6 = load i32, i32* %4
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = sub nsw i32 %6, %8
%10 = trunc i32 %9 to i8
store i8 %10, i8* %3
%11 = load i8, i8* %3
%12 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8 signext %11)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%c\00"
@.str.1 = [4 x i8] c"%c\0A\00"
define i32 @main() {
%1 = alloca i8
%2 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %1)
%3 = load i8, i8* %1
%4 = sub i8 -37, %3
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8 signext %4)
ret i32 0
}
int toupper(int chr) {
  return (int)((chr >= (int)'a' && chr <= (int)'z') ? (chr - 32) : (chr));
}


x86 assembly (clang, -O0):
<toupper>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x61,-0x4(%rbp)
jl     1129 <toupper+0x29>
cmpl   $0x7a,-0x4(%rbp)
jg     1129 <toupper+0x29>
mov    -0x4(%rbp),%eax
sub    $0x20,%eax
mov    %eax,-0x8(%rbp)
jmp    112f <toupper+0x2f>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<toupper>:
lea    -0x61(%rdi),%ecx
lea    -0x20(%rdi),%eax
cmp    $0x1a,%ecx
cmovae %edi,%eax
ret

LLVM IR (-O0):
define i32 @toupper(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 97
br i1 %4, label %5, label %11
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 122
br i1 %7, label %8, label %11
8: ; preds = %5
%9 = load i32, i32* %2
%10 = sub nsw i32 %9, 32
br label %13
11: ; preds = %5, %1
%12 = load i32, i32* %2
br label %13
13: ; preds = %11, %8
%14 = phi i32 [ %10, %8 ], [ %12, %11 ]
ret i32 %14
}

LLVM IR (-O2):
define i32 @toupper(i32 %0) {
%2 = add i32 %0, -97
%3 = icmp ult i32 %2, 26
%4 = add nsw i32 %0, -32
%5 = select i1 %3, i32 %4, i32 %0
ret i32 %5
}
/* Variables and functions */
int printf(char *, int, char, int, char);
int add(int x, int y) { return printf("%*c%*c", x, ' ', y, ' '); }


x86 assembly (clang, -O0):
<add>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%ecx
lea    0xed5(%rip),%rdi
mov    $0x20,%r8d
mov    %r8d,%edx
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<add>:
mov    %esi,%ecx
mov    %edi,%esi
lea    0xee5(%rip),%rdi
mov    $0x20,%edx
mov    $0x20,%r8d
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [7 x i8] c"%*c%*c\00"
define i32 @add(i32 %0, i32 %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %0, i8 signext 32, i32 %1, i8 signext 32)
ret i32 %3
}
/* Variables and functions */
int calculate(char *);
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char **argv) {
  printf("%d\n", calculate(argv[1]));
  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    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1040 <calculate@plt>
mov    %eax,%esi
lea    0xeb4(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x8(%rsi),%rdi
call   1040 <calculate@plt>
lea    0xecf(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\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 = load i8**, i8*** %5
%7 = getelementptr inbounds i8*, i8** %6, i64 1
%8 = load i8*, i8** %7
%9 = call i32 @calculate(i8* %8)
%10 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %9)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = load i8*, i8** %3
%5 = tail call i32 @calculate(i8* %4)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %5)
ret i32 0
}
void gfx_outd(unsigned short port, unsigned long data) {}


x86 assembly (clang, -O0):
<gfx_outd>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    %rsi,-0x10(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @gfx_outd(i16 zeroext %0, i64 %1) {
%3 = alloca i16
%4 = alloca i64
store i16 %0, i16* %3
store i64 %1, i64* %4
ret void
}

LLVM IR (-O2):
define void @gfx_outd(i16 zeroext %0, i64 %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ foo(int);
int /*<<< orphan*/ inlined(int /*<<< orphan*/);
void testInlined() {
  extern int coin();
  int cond = coin();
  if (!cond) {
    inlined(0);
    if (cond) {
      foo(5);
    }
  }
}


x86 assembly (clang, -O0):
<testInlined>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1050 <coin@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    116c <testInlined+0x3c>
xor    %edi,%edi
call   1030 <inlined@plt>
cmpl   $0x0,-0x4(%rbp)
je     1167 <testInlined+0x37>
mov    $0x5,%edi
call   1040 <foo@plt>
jmp    116c <testInlined+0x3c>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<testInlined>:
push   %rax
xor    %eax,%eax
call   1040 <coin@plt>
test   %eax,%eax
je     112e <testInlined+0xe>
pop    %rax
ret
xor    %edi,%edi
pop    %rax
jmp    1030 <inlined@plt>

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

LLVM IR (-O2):
define void @testInlined() {
%1 = tail call i32 (...) @coin()
%2 = icmp eq i32 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 @inlined(i32 0)
br label %5
5: ; preds = %3, %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ usage_noexit(char const *);
void usage(const char *progname) {
  usage_noexit(progname);
  exit(0);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <usage_noexit@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
call   1030 <usage_noexit@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @usage_noexit(i8* %3)
%5 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define void @usage(i8* %0) {
%2 = tail call i32 @usage_noexit(i8* %0)
%3 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
void prtusage(void) {
  printf("glord3: rearranges a certain line range of a specified input file "
         "from columnwise to rowwise and vice versa\n");
  printf("example usage: ./glord3 -i m3.txt -b 1 -u 6 -n 12\n");
  printf("this would go from the first line (-b 1) until the sixth line (-u 6) "
         "of file m3.txt and tranpsoe to rows with 12 columns per row.\n");
  exit(EXIT_FAILURE);
}


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

x86 assembly (clang, -O2):
<prtusage>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
lea    0xf38(%rip),%rdi
call   1030 <puts@plt>
lea    0xf5e(%rip),%rdi
call   1030 <puts@plt>
mov    0x2e94(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [109 x i8] c"glord3: rearranges a certain line range of a specified input file from columnwise to rowwise and vice versa\0A\00"
@.str.1 = [51 x i8] c"example usage: ./glord3 -i m3.txt -b 1 -u 6 -n 12\0A\00"
@.str.2 = [131 x i8] c"this would go from the first line (-b 1) until the sixth line (-u 6) of file m3.txt and tranpsoe to rows with 12 columns per row.\0A\00"
@EXIT_FAILURE = global i32 0
define void @prtusage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([109 x i8], [109 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([131 x i8], [131 x i8]* @.str.2, i64 0, i64 0))
%4 = load i32, i32* @EXIT_FAILURE
%5 = call i32 @exit(i32 %4)
unreachable
}

LLVM IR (-O2):
@EXIT_FAILURE = global i32 0
@str = [108 x i8] c"glord3: rearranges a certain line range of a specified input file from columnwise to rowwise and vice versa\00"
@str.3 = [50 x i8] c"example usage: ./glord3 -i m3.txt -b 1 -u 6 -n 12\00"
@str.4 = [130 x i8] c"this would go from the first line (-b 1) until the sixth line (-u 6) of file m3.txt and tranpsoe to rows with 12 columns per row.\00"
define void @prtusage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([108 x i8], [108 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([50 x i8], [50 x i8]* @str.3, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([130 x i8], [130 x i8]* @str.4, i64 0, i64 0))
%4 = load i32, i32* @EXIT_FAILURE
%5 = tail call i32 @exit(i32 %4)
unreachable
}
int main() {
  int p1, p2;
  int x1, y1;
  {
    if (p1)
      x1 = -10;
    else
      x1 = 20;
  };
  {
    if (p2)
      y1 = 0;
    else
      y1 = 23456789;
  };
  while (x1 < y1) {
    x1 = x1 << 4;
  }
  return x1;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1121 <main+0x21>
movl   $0xfffffff6,-0x10(%rbp)
jmp    1128 <main+0x28>
movl   $0x14,-0x10(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     113e <main+0x3e>
movl   $0x0,-0x14(%rbp)
jmp    1145 <main+0x45>
movl   $0x165ec15,-0x14(%rbp)
jmp    114a <main+0x4a>
mov    -0x10(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    1164 <main+0x64>
mov    -0x10(%rbp),%eax
shl    $0x4,%eax
mov    %eax,-0x10(%rbp)
jmp    114a <main+0x4a>
mov    -0x10(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 335544320
}
void RTCircBufSize(void) {}


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

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

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

LLVM IR (-O2):
define void @RTCircBufSize() {
ret void
}
double rate_H_cex(t)
double t;
{
  if (t == 0.0)
    return 0.0;
  return 7.5e-19 * exp(-118348.0 / t) / (1.0 + sqrt(t / 1e5));
}


x86 assembly (clang, -O0):
<rate_H_cex>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    1152 <rate_H_cex+0x32>
jp     1152 <rate_H_cex+0x32>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    11ab <rate_H_cex+0x8b>
movsd  0xebe(%rip),%xmm0
divsd  -0x10(%rbp),%xmm0
call   1030 <exp@plt>
movaps %xmm0,%xmm1
movsd  0xea1(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  0xe83(%rip),%xmm1
divsd  %xmm1,%xmm0
call   1040 <sqrt@plt>
movaps %xmm0,%xmm2
movsd  -0x18(%rbp),%xmm0
movsd  0xe62(%rip),%xmm1
addsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rate_H_cex>:
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    1131 <rate_H_cex+0x11>
jp     1131 <rate_H_cex+0x11>
movapd %xmm1,%xmm0
ret
push   %rax
movapd %xmm0,%xmm2
movsd  0xec2(%rip),%xmm0
divsd  %xmm2,%xmm0
movsd  %xmm2,(%rsp)
call   1030 <exp@plt>
movsd  (%rsp),%xmm2
movapd %xmm0,%xmm1
mulsd  0xeab(%rip),%xmm1
divsd  0xeab(%rip),%xmm2
xorpd  %xmm0,%xmm0
ucomisd %xmm0,%xmm2
jb     1178 <rate_H_cex+0x58>
xorps  %xmm0,%xmm0
sqrtsd %xmm2,%xmm0
jmp    118b <rate_H_cex+0x6b>
movapd %xmm2,%xmm0
movsd  %xmm1,(%rsp)
call   1040 <sqrt@plt>
movsd  (%rsp),%xmm1
addsd  0xe85(%rip),%xmm0
divsd  %xmm0,%xmm1
add    $0x8,%rsp
movapd %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @rate_H_cex(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %3
%4 = load double, double* %3
%5 = fcmp oeq double %4, 0.000000e+00
br i1 %5, label %6, label %7
6: ; preds = %1
store double 0.000000e+00, double* %2
br label %17
7: ; preds = %1
%8 = load double, double* %3
%9 = fdiv double -1.183480e+05, %8
%10 = call double @exp(double %9)
%11 = fmul double 0x3C2BAB8CBABB6581, %10
%12 = load double, double* %3
%13 = fdiv double %12, 1.000000e+05
%14 = call double @sqrt(double %13)
%15 = fadd double 1.000000e+00, %14
%16 = fdiv double %11, %15
store double %16, double* %2
br label %17
17: ; preds = %7, %6
%18 = load double, double* %2
ret double %18
}

LLVM IR (-O2):
define double @rate_H_cex(double %0) {
%2 = fcmp oeq double %0, 0.000000e+00
br i1 %2, label %11, label %3
3: ; preds = %1
%4 = fdiv double -1.183480e+05, %0
%5 = tail call double @exp(double %4)
%6 = fmul double %5, 0x3C2BAB8CBABB6581
%7 = fdiv double %0, 1.000000e+05
%8 = tail call double @sqrt(double %7)
%9 = fadd double %8, 1.000000e+00
%10 = fdiv double %6, %9
br label %11
11: ; preds = %1, %3
%12 = phi double [ %10, %3 ], [ 0.000000e+00, %1 ]
ret double %12
}
/* Variables and functions */
unsigned int __sw_hweight16(unsigned int w) {
  unsigned int res = w - ((w >> 1) & 0x5555);
  res = (res & 0x3333) + ((res >> 2) & 0x3333);
  res = (res + (res >> 4)) & 0x0F0F;
  return (res + (res >> 8)) & 0x00FF;
}


x86 assembly (clang, -O0):
<__sw_hweight16>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
shr    $0x1,%ecx
and    $0x5555,%ecx
sub    %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
and    $0x3333,%eax
mov    -0x8(%rbp),%ecx
shr    $0x2,%ecx
and    $0x3333,%ecx
add    %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    -0x8(%rbp),%ecx
shr    $0x4,%ecx
add    %ecx,%eax
and    $0xf0f,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    -0x8(%rbp),%ecx
shr    $0x8,%ecx
add    %ecx,%eax
and    $0xff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__sw_hweight16>:
mov    %edi,%eax
shr    %eax
and    $0x5555,%eax
sub    %eax,%edi
mov    %edi,%eax
and    $0x3333,%eax
shr    $0x2,%edi
and    $0x3333,%edi
add    %eax,%edi
mov    %edi,%eax
shr    $0x4,%eax
add    %edi,%eax
and    $0xf0f,%eax
mov    %eax,%ecx
shr    $0x8,%ecx
add    %eax,%ecx
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @__sw_hweight16(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = load i32, i32* %2
%6 = lshr i32 %5, 1
%7 = and i32 %6, 21845
%8 = sub i32 %4, %7
store i32 %8, i32* %3
%9 = load i32, i32* %3
%10 = and i32 %9, 13107
%11 = load i32, i32* %3
%12 = lshr i32 %11, 2
%13 = and i32 %12, 13107
%14 = add i32 %10, %13
store i32 %14, i32* %3
%15 = load i32, i32* %3
%16 = load i32, i32* %3
%17 = lshr i32 %16, 4
%18 = add i32 %15, %17
%19 = and i32 %18, 3855
store i32 %19, i32* %3
%20 = load i32, i32* %3
%21 = load i32, i32* %3
%22 = lshr i32 %21, 8
%23 = add i32 %20, %22
%24 = and i32 %23, 255
ret i32 %24
}

LLVM IR (-O2):
define i32 @__sw_hweight16(i32 %0) {
%2 = lshr i32 %0, 1
%3 = and i32 %2, 21845
%4 = sub i32 %0, %3
%5 = and i32 %4, 13107
%6 = lshr i32 %4, 2
%7 = and i32 %6, 13107
%8 = add nuw nsw i32 %7, %5
%9 = lshr i32 %8, 4
%10 = add nuw nsw i32 %9, %8
%11 = and i32 %10, 3855
%12 = lshr i32 %11, 8
%13 = add nuw nsw i32 %12, %11
%14 = and i32 %13, 31
ret i32 %14
}
/* Variables and functions */
int /*<<< orphan*/ test_graph();
int /*<<< orphan*/ test_hashtable();
int /*<<< orphan*/ test_json();
int /*<<< orphan*/ test_vstring();
void run_tests() {
  test_vstring();
  test_hashtable();
  test_graph();
  test_json();
}


x86 assembly (clang, -O0):
<run_tests>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1050 <test_vstring@plt>
mov    $0x0,%al
call   1030 <test_hashtable@plt>
mov    $0x0,%al
call   1040 <test_graph@plt>
mov    $0x0,%al
call   1060 <test_json@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<run_tests>:
push   %rax
xor    %eax,%eax
call   1050 <test_vstring@plt>
xor    %eax,%eax
call   1030 <test_hashtable@plt>
xor    %eax,%eax
call   1040 <test_graph@plt>
xor    %eax,%eax
pop    %rcx
jmp    1060 <test_json@plt>

LLVM IR (-O0):
define void @run_tests() {
%1 = call i32 (...) @test_vstring()
%2 = call i32 (...) @test_hashtable()
%3 = call i32 (...) @test_graph()
%4 = call i32 (...) @test_json()
ret void
}

LLVM IR (-O2):
define void @run_tests() {
%1 = tail call i32 (...) @test_vstring()
%2 = tail call i32 (...) @test_hashtable()
%3 = tail call i32 (...) @test_graph()
%4 = tail call i32 (...) @test_json()
ret void
}
/* Type definitions */
struct syntree {
  int dummy;
};
struct nfa {
  int dummy;
};

/* Variables and functions */
struct nfa *build_nfa_impl(struct syntree *);
struct nfa *concat_nfas(struct nfa *, struct nfa *);
struct nfa *concat_trees(struct syntree *t1, struct syntree *t2) {
  struct nfa *n1 = build_nfa_impl(t1);
  struct nfa *n2 = build_nfa_impl(t2);
  return concat_nfas(n1, n2);
}


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

x86 assembly (clang, -O2):
<concat_trees>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
call   1030 <build_nfa_impl@plt>
mov    %rax,%rbx
mov    %r14,%rdi
call   1030 <build_nfa_impl@plt>
mov    %rbx,%rdi
mov    %rax,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <concat_nfas@plt>

LLVM IR (-O0):
%struct.nfa = type { i32 }
%struct.syntree = type { i32 }
define %struct.nfa* @concat_trees(%struct.syntree* %0, %struct.syntree* %1) {
%3 = alloca %struct.syntree*
%4 = alloca %struct.syntree*
%5 = alloca %struct.nfa*
%6 = alloca %struct.nfa*
store %struct.syntree* %0, %struct.syntree** %3
store %struct.syntree* %1, %struct.syntree** %4
%7 = load %struct.syntree*, %struct.syntree** %3
%8 = call %struct.nfa* @build_nfa_impl(%struct.syntree* %7)
store %struct.nfa* %8, %struct.nfa** %5
%9 = load %struct.syntree*, %struct.syntree** %4
%10 = call %struct.nfa* @build_nfa_impl(%struct.syntree* %9)
store %struct.nfa* %10, %struct.nfa** %6
%11 = load %struct.nfa*, %struct.nfa** %5
%12 = load %struct.nfa*, %struct.nfa** %6
%13 = call %struct.nfa* @concat_nfas(%struct.nfa* %11, %struct.nfa* %12)
ret %struct.nfa* %13
}

LLVM IR (-O2):
%struct.nfa = type { i32 }
%struct.syntree = type { i32 }
define %struct.nfa* @concat_trees(%struct.syntree* %0, %struct.syntree* %1) {
%3 = tail call %struct.nfa* @build_nfa_impl(%struct.syntree* %0)
%4 = tail call %struct.nfa* @build_nfa_impl(%struct.syntree* %1)
%5 = tail call %struct.nfa* @concat_nfas(%struct.nfa* %3, %struct.nfa* %4)
ret %struct.nfa* %5
}
/* Type definitions */
struct Ptab {
  int dummy;
};

/* Variables and functions */
scalar_t__ allocPage();
struct Ptab *allocPtab() {
  return (struct Ptab *)allocPage();
}


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

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

LLVM IR (-O0):
%struct.Ptab = type { i32 }
define %struct.Ptab* @allocPtab() {
%1 = call i64 (...) @allocPage()
%2 = inttoptr i64 %1 to %struct.Ptab*
ret %struct.Ptab* %2
}

LLVM IR (-O2):
%struct.Ptab = type { i32 }
define %struct.Ptab* @allocPtab() {
%1 = tail call i64 (...) @allocPage()
%2 = inttoptr i64 %1 to %struct.Ptab*
ret %struct.Ptab* %2
}
/* Variables and functions */
scalar_t__ strcmp(char const *, char const *);
int isaction(const char *a, const char *b) { return (strcmp(a, b) == 0); }


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

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

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

LLVM IR (-O2):
define i32 @isaction(i8* %0, i8* %1) {
%3 = tail call i64 @strcmp(i8* %0, i8* %1)
%4 = icmp eq i64 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
void *malloc(size_t);
void *os_malloc(unsigned int size) { return malloc((size_t)size); }


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

x86 assembly (clang, -O2):
<os_malloc>:
mov    %edi,%edi
jmp    1030 <malloc@plt>

LLVM IR (-O0):
define i8* @os_malloc(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = zext i32 %3 to i64
%5 = call i8* @malloc(i64 %4)
ret i8* %5
}

LLVM IR (-O2):
define noalias i8* @os_malloc(i32 %0) {
%2 = zext i32 %0 to i64
%3 = tail call i8* @malloc(i64 %2)
ret i8* %3
}
int ft_isascii(int c) { return ((c >= 0 && c <= 127) ? 1 : 0); }


x86 assembly (clang, -O0):
<ft_isascii>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jl     1120 <ft_isascii+0x20>
cmpl   $0x7f,-0x4(%rbp)
setle  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%dl
xor    %eax,%eax
mov    $0x1,%ecx
test   $0x1,%dl
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_isascii>:
xor    %eax,%eax
cmp    $0x80,%edi
setb   %al
ret

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

LLVM IR (-O2):
define i32 @ft_isascii(i32 %0) {
%2 = icmp ult i32 %0, 128
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Type definitions */
struct flashrom_flashctx {
  int dummy;
};

/* Variables and functions */
int spi_simple_write_cmd(struct flashrom_flashctx *, int, int);
int spi_chip_erase_62(struct flashrom_flashctx *flash) {
  return spi_simple_write_cmd(flash, 0x62, 100 * 1000);
}


x86 assembly (clang, -O0):
<spi_chip_erase_62>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x62,%esi
mov    $0x186a0,%edx
call   1030 <spi_simple_write_cmd@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<spi_chip_erase_62>:
mov    $0x62,%esi
mov    $0x186a0,%edx
jmp    1030 <spi_simple_write_cmd@plt>

LLVM IR (-O0):
%struct.flashrom_flashctx = type { i32 }
define i32 @spi_chip_erase_62(%struct.flashrom_flashctx* %0) {
%2 = alloca %struct.flashrom_flashctx*
store %struct.flashrom_flashctx* %0, %struct.flashrom_flashctx** %2
%3 = load %struct.flashrom_flashctx*, %struct.flashrom_flashctx** %2
%4 = call i32 @spi_simple_write_cmd(%struct.flashrom_flashctx* %3, i32 98, i32 100000)
ret i32 %4
}

LLVM IR (-O2):
%struct.flashrom_flashctx = type { i32 }
define i32 @spi_chip_erase_62(%struct.flashrom_flashctx* %0) {
%2 = tail call i32 @spi_simple_write_cmd(%struct.flashrom_flashctx* %0, i32 98, i32 100000)
ret i32 %2
}
XUnionRegion() {}


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

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

LLVM IR (-O0):
define i32 @XUnionRegion() {
%1 = alloca i32
%2 = load i32, i32* %1
ret i32 %2
}

LLVM IR (-O2):
define i32 @XUnionRegion() {
ret i32 undef
}
double foo(double a, double b) {
  double c;
  if (0.0 < a)
    c = a;
  else if (b > 0.0)
    c = 0.0;
  else
    return 0;
  return 2.0 * (b - c);
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    112f <foo+0x2f>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
jmp    1160 <foo+0x60>
movsd  -0x18(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    114e <foo+0x4e>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x20(%rbp)
jmp    115b <foo+0x5b>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    117b <foo+0x7b>
jmp    1160 <foo+0x60>
movsd  -0x18(%rbp),%xmm1
subsd  -0x20(%rbp),%xmm1
movsd  0xe8e(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
movapd %xmm0,%xmm2
xorpd  %xmm0,%xmm0
ucomisd %xmm0,%xmm2
ja     1118 <foo+0x18>
ucomisd %xmm0,%xmm1
xorpd  %xmm2,%xmm2
jbe    1124 <foo+0x24>
subsd  %xmm2,%xmm1
addsd  %xmm1,%xmm1
movapd %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @foo(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %4
store double %1, double* %5
%7 = load double, double* %4
%8 = fcmp olt double 0.000000e+00, %7
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = load double, double* %4
store double %10, double* %6
br label %17
11: ; preds = %2
%12 = load double, double* %5
%13 = fcmp ogt double %12, 0.000000e+00
br i1 %13, label %14, label %15
14: ; preds = %11
store double 0.000000e+00, double* %6
br label %16
15: ; preds = %11
store double 0.000000e+00, double* %3
br label %22
16: ; preds = %14
br label %17
17: ; preds = %16, %9
%18 = load double, double* %5
%19 = load double, double* %6
%20 = fsub double %18, %19
%21 = fmul double 2.000000e+00, %20
store double %21, double* %3
br label %22
22: ; preds = %17, %15
%23 = load double, double* %3
ret double %23
}

LLVM IR (-O2):
define double @foo(double %0, double %1) {
%3 = fcmp ogt double %0, 0.000000e+00
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = fcmp ogt double %1, 0.000000e+00
br i1 %5, label %6, label %10
6: ; preds = %4, %2
%7 = phi double [ %0, %2 ], [ 0.000000e+00, %4 ]
%8 = fsub double %1, %7
%9 = fmul double %8, 2.000000e+00
br label %10
10: ; preds = %4, %6
%11 = phi double [ %9, %6 ], [ 0.000000e+00, %4 ]
ret double %11
}
int fork() { return (0); }


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

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

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

LLVM IR (-O2):
define i32 @fork() {
ret i32 0
}