xunge/DecIR huggingface dataset:
/* Variables and functions */
int spawn(int, char **);
int main(int argc, char *argv[]) {
  argv[0] = "/bin/df";
  return (spawn(argc, argv));
}


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
lea    0xecf(%rip),%rcx
mov    %rcx,(%rax)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <spawn@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
lea    0xee9(%rip),%rax
mov    %rax,(%rsi)
jmp    1030 <spawn@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"/bin/df\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 0
store i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8** %7
%8 = load i32, i32* %4
%9 = load i8**, i8*** %5
%10 = call i32 @spawn(i32 %8, i8** %9)
ret i32 %10
}

LLVM IR (-O2):
@.str = [8 x i8] c"/bin/df\00"
define i32 @main(i32 %0, i8** %1) {
store i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8** %1
%3 = tail call i32 @spawn(i32 %0, i8** %1)
ret i32 %3
}
/* Type definitions */
typedef int int64_t;
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int32_t hash(int64_t x0) {
  int64_t x = x0;
  x = ((x >> 16) ^ x) * 0x45d9f3b;
  x = ((x >> 16) ^ x) * 0x45d9f3b;
  x = (x >> 16) ^ x;
  return (int32_t)x;
}


x86 assembly (clang, -O0):
<hash>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
sar    $0x10,%eax
xor    -0x8(%rbp),%eax
imul   $0x45d9f3b,%eax,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
sar    $0x10,%eax
xor    -0x8(%rbp),%eax
imul   $0x45d9f3b,%eax,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
sar    $0x10,%eax
xor    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash>:
mov    %edi,%eax
sar    $0x10,%eax
xor    %edi,%eax
imul   $0x45d9f3b,%eax,%eax
mov    %eax,%ecx
sar    $0x10,%ecx
xor    %eax,%ecx
imul   $0x45d9f3b,%ecx,%ecx
mov    %ecx,%eax
sar    $0x10,%eax
xor    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @hash(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
store i32 %4, i32* %3
%5 = load i32, i32* %3
%6 = ashr i32 %5, 16
%7 = load i32, i32* %3
%8 = xor i32 %6, %7
%9 = mul nsw i32 %8, 73244475
store i32 %9, i32* %3
%10 = load i32, i32* %3
%11 = ashr i32 %10, 16
%12 = load i32, i32* %3
%13 = xor i32 %11, %12
%14 = mul nsw i32 %13, 73244475
store i32 %14, i32* %3
%15 = load i32, i32* %3
%16 = ashr i32 %15, 16
%17 = load i32, i32* %3
%18 = xor i32 %16, %17
store i32 %18, i32* %3
%19 = load i32, i32* %3
ret i32 %19
}

LLVM IR (-O2):
define i32 @hash(i32 %0) {
%2 = ashr i32 %0, 16
%3 = xor i32 %2, %0
%4 = mul nsw i32 %3, 73244475
%5 = ashr i32 %4, 16
%6 = xor i32 %5, %4
%7 = mul nsw i32 %6, 73244475
%8 = ashr i32 %7, 16
%9 = xor i32 %8, %7
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ strncpy(char *, char *, int);
void requestAuth(char *HTTPOutputBuffer, int size) {
  strncpy(
      HTTPOutputBuffer,
      "HTTP/1.0 401 Unauthorized\n"
      "Connection: close\r\n"
      "Content-Type: text/html\r\n"
      "Server: NetEye Safed\r\n"
      "WWW-Authenticate: Basic realm=\"NetEye Safed\"\r\n\r\n"
      "<HTML><HEAD>\r\n<TITLE>401 Authorization Required</TITLE>\r\n"
      "</HEAD><BODY>\r\n<CENTER><H2>Authorization "
      "Required</H2></CENTER>\r\n<CENTER>NetEye Safed could not "
      "verify that You are authorized to access the remote control facility. "
      "You may have supplied the wrong credentials</CENTER><P>\r\n<HR>\r\n",
      size);
}


x86 assembly (clang, -O0):
<requestAuth>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
lea    0xed3(%rip),%rsi
call   1030 <strncpy@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<requestAuth>:
mov    %esi,%edx
lea    0xee7(%rip),%rsi
jmp    1030 <strncpy@plt>

LLVM IR (-O0):
@.str = [427 x i8] c"HTTP/1.0 401 Unauthorized\0AConnection: close\0D\0AContent-Type: text/html\0D\0AServer: NetEye Safed\0D\0AWWW-Authenticate: Basic realm=\22NetEye Safed\22\0D\0A\0D\0A<HTML><HEAD>\0D\0A<TITLE>401 Authorization Required</TITLE>\0D\0A</HEAD><BODY>\0D\0A<CENTER><H2>Authorization Required</H2></CENTER>\0D\0A<CENTER>NetEye Safed could not verify that You are authorized to access the remote control facility. You may have supplied the wrong credentials</CENTER><P>\0D\0A<HR>\0D\0A\00"
define void @requestAuth(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = load i32, i32* %4
%7 = call i32 @strncpy(i8* %5, i8* getelementptr inbounds ([427 x i8], [427 x i8]* @.str, i64 0, i64 0), i32 %6)
ret void
}

LLVM IR (-O2):
@.str = [427 x i8] c"HTTP/1.0 401 Unauthorized\0AConnection: close\0D\0AContent-Type: text/html\0D\0AServer: NetEye Safed\0D\0AWWW-Authenticate: Basic realm=\22NetEye Safed\22\0D\0A\0D\0A<HTML><HEAD>\0D\0A<TITLE>401 Authorization Required</TITLE>\0D\0A</HEAD><BODY>\0D\0A<CENTER><H2>Authorization Required</H2></CENTER>\0D\0A<CENTER>NetEye Safed could not verify that You are authorized to access the remote control facility. You may have supplied the wrong credentials</CENTER><P>\0D\0A<HR>\0D\0A\00"
define void @requestAuth(i8* %0, i32 %1) {
%3 = tail call i32 @strncpy(i8* %0, i8* getelementptr inbounds ([427 x i8], [427 x i8]* @.str, i64 0, i64 0), i32 %1)
ret void
}
float tan_56s(float x) {
  static const float c1 = -3.16783027;
  static const float c2 = 0.134516124;
  static const float c3 = -4.033321984;
  float x2;
  x2 = x * x;
  return (x * (c1 + c2 * x2) / (c3 + x2));
}


x86 assembly (clang, -O0):
<tan_56s>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
mulss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
movss  0xeda(%rip),%xmm2
mulss  %xmm2,%xmm1
movss  0xed2(%rip),%xmm2
addss  %xmm2,%xmm1
mulss  %xmm1,%xmm0
movss  0xeba(%rip),%xmm1
addss  -0x8(%rbp),%xmm1
divss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<tan_56s>:
movaps %xmm0,%xmm1
mulss  %xmm0,%xmm1
movss  0xef1(%rip),%xmm2
mulss  %xmm1,%xmm2
addss  0xee9(%rip),%xmm2
mulss  %xmm2,%xmm0
addss  0xee1(%rip),%xmm1
divss  %xmm1,%xmm0
ret

LLVM IR (-O0):
@tan_56s.c1 = internal constant float 0xC00957B760000000
@tan_56s.c2 = internal constant float 0x3FC137D300000000
@tan_56s.c3 = internal constant float 0xC010221F20000000
define float @tan_56s(float %0) {
%2 = alloca float
%3 = alloca float
store float %0, float* %2
%4 = load float, float* %2
%5 = load float, float* %2
%6 = fmul float %4, %5
store float %6, float* %3
%7 = load float, float* %2
%8 = load float, float* %3
%9 = call float @llvm.fmuladd.f32(float 0x3FC137D300000000, float %8, float 0xC00957B760000000)
%10 = fmul float %7, %9
%11 = load float, float* %3
%12 = fadd float 0xC010221F20000000, %11
%13 = fdiv float %10, %12
ret float %13
}

LLVM IR (-O2):
define float @tan_56s(float %0) {
%2 = fmul float %0, %0
%3 = tail call float @llvm.fmuladd.f32(float %2, float 0x3FC137D300000000, float 0xC00957B760000000)
%4 = fmul float %3, %0
%5 = fadd float %2, 0xC010221F20000000
%6 = fdiv float %4, %5
ret float %6
}
void SXNETID_new(void) {}


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

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

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

LLVM IR (-O2):
define void @SXNETID_new() {
ret void
}
double kmToInches(double km) { return km * 39370.1; }


x86 assembly (clang, -O0):
<kmToInches>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  0xeef(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<kmToInches>:
mulsd  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define double @kmToInches(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fmul double %3, 3.937010e+04
ret double %4
}

LLVM IR (-O2):
define double @kmToInches(double %0) {
%2 = fmul double %0, 3.937010e+04
ret double %2
}
/* Type definitions */
struct statvfs {
  scalar_t__ f_bsize;
};

/* Variables and functions */
int /*<<< orphan*/ perror(char *);
scalar_t__ statvfs(char *, struct statvfs *);
unsigned long int get_block_size(char *path) {
  struct statvfs st;
  if (statvfs(path, &st) < 0) {
    perror("statvfs");
    return -1;
  }
  return (unsigned long int)st.f_bsize;
}


x86 assembly (clang, -O0):
<get_block_size>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1030 <statvfs@plt>
cmp    $0x0,%rax
jge    115c <get_block_size+0x3c>
lea    0xeb6(%rip),%rdi
call   1040 <perror@plt>
movq   $0xffffffffffffffff,-0x8(%rbp)
ff
jmp    1164 <get_block_size+0x44>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_block_size>:
push   %rax
mov    %rsp,%rsi
call   1030 <statvfs@plt>
test   %rax,%rax
js     1134 <get_block_size+0x14>
mov    (%rsp),%rax
pop    %rcx
ret
lea    0xec5(%rip),%rdi
call   1040 <perror@plt>
mov    $0xffffffffffffffff,%rax
pop    %rcx
ret

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

LLVM IR (-O2):
%struct.statvfs = type { i64 }
@.str = [8 x i8] c"statvfs\00"
define i64 @get_block_size(i8* %0) {
%2 = alloca %struct.statvfs
%3 = bitcast %struct.statvfs* %2 to i8*
%4 = call i64 @statvfs(i8* %0, %struct.statvfs* %2)
%5 = icmp slt i64 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = call i32 @perror(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
br label %11
8: ; preds = %1
%9 = getelementptr inbounds %struct.statvfs, %struct.statvfs* %2, i64 0, i32 0
%10 = load i64, i64* %9
br label %11
11: ; preds = %8, %6
%12 = phi i64 [ -1, %6 ], [ %10, %8 ]
ret i64 %12
}
/* Variables and functions */
bool nth_position(int num, int position) { return ((num >> position) & 1); }


x86 assembly (clang, -O0):
<nth_position>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
sar    %cl,%eax
and    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<nth_position>:
mov    %esi,%ecx
mov    %edi,%eax
shr    %cl,%eax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @nth_position(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 = ashr i32 %5, %6
%8 = and i32 %7, 1
ret i32 %8
}

LLVM IR (-O2):
define i32 @nth_position(i32 %0, i32 %1) {
%3 = lshr i32 %0, %1
%4 = and i32 %3, 1
ret i32 %4
}
/* Variables and functions */
double sqrt(double);
double stdDev(double x) { return sqrt(x); }


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

x86 assembly (clang, -O2):
<stdDev>:
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     111f <stdDev+0xf>
sqrtsd %xmm0,%xmm0
ret
jmp    1030 <sqrt@plt>

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

LLVM IR (-O2):
define double @stdDev(double %0) {
%2 = tail call double @sqrt(double %0)
ret double %2
}
/* Variables and functions */
int /*<<< orphan*/ buffer_delete(int /*<<< orphan*/);
void _ensure_buffer_delete_copes_with_null_buffer(void) { buffer_delete(0); }


x86 assembly (clang, -O0):
<_ensure_buffer_delete_copes_with_null_buffer>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <buffer_delete@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<_ensure_buffer_delete_copes_with_null_buffer>:
xor    %edi,%edi
jmp    1030 <buffer_delete@plt>

LLVM IR (-O0):
define void @_ensure_buffer_delete_copes_with_null_buffer() {
%1 = call i32 @buffer_delete(i32 0)
ret void
}

LLVM IR (-O2):
define void @_ensure_buffer_delete_copes_with_null_buffer() {
%1 = tail call i32 @buffer_delete(i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ norm2(long double, long double, long double, long double);
long double sqrt(int /*<<< orphan*/);
long double norm(long double x1, long double y1, long double x2,
                 long double y2) {
  return sqrt(norm2(x1, y1, x2, y2));
}


x86 assembly (clang, -O0):
<norm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
fldt   0x40(%rbp)
fldt   0x30(%rbp)
fldt   0x20(%rbp)
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fstpt  -0x20(%rbp)
fstpt  -0x30(%rbp)
fstpt  -0x40(%rbp)
fldt   -0x10(%rbp)
fldt   -0x20(%rbp)
fldt   -0x30(%rbp)
fldt   -0x40(%rbp)
mov    %rsp,%rax
fstpt  0x30(%rax)
fstpt  0x20(%rax)
fstpt  0x10(%rax)
fstpt  (%rax)
call   1030 <norm2@plt>
mov    %eax,%edi
call   1040 <sqrt@plt>
fld    %st(0)
fstp   %st(0)
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<norm>:
sub    $0x48,%rsp
fldt   0x50(%rsp)
fldt   0x60(%rsp)
fldt   0x70(%rsp)
fldt   0x80(%rsp)
fstpt  0x30(%rsp)
fstpt  0x20(%rsp)
fstpt  0x10(%rsp)
fstpt  (%rsp)
call   1030 <norm2@plt>
mov    %eax,%edi
add    $0x48,%rsp
jmp    1040 <sqrt@plt>

LLVM IR (-O0):
define x86_fp80 @norm(x86_fp80 %0, x86_fp80 %1, x86_fp80 %2, x86_fp80 %3) {
%5 = alloca x86_fp80
%6 = alloca x86_fp80
%7 = alloca x86_fp80
%8 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %5
store x86_fp80 %1, x86_fp80* %6
store x86_fp80 %2, x86_fp80* %7
store x86_fp80 %3, x86_fp80* %8
%9 = load x86_fp80, x86_fp80* %5
%10 = load x86_fp80, x86_fp80* %6
%11 = load x86_fp80, x86_fp80* %7
%12 = load x86_fp80, x86_fp80* %8
%13 = call i32 @norm2(x86_fp80 %9, x86_fp80 %10, x86_fp80 %11, x86_fp80 %12)
%14 = call x86_fp80 @sqrt(i32 %13)
ret x86_fp80 %14
}

LLVM IR (-O2):
define x86_fp80 @norm(x86_fp80 %0, x86_fp80 %1, x86_fp80 %2, x86_fp80 %3) {
%5 = tail call i32 @norm2(x86_fp80 %0, x86_fp80 %1, x86_fp80 %2, x86_fp80 %3)
%6 = tail call x86_fp80 @sqrt(i32 %5)
ret x86_fp80 %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ wait(int);
void wrerror(char *fname) {
  printf("\n\nERROR - Cannot write to %s\n\n", fname);
  wait(3);
}


x86 assembly (clang, -O0):
<wrerror>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
mov    $0x3,%edi
call   1040 <wait@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wrerror>:
push   %rax
mov    %rdi,%rsi
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x3,%edi
pop    %rax
jmp    1040 <wait@plt>

LLVM IR (-O0):
@.str = [31 x i8] c"\0A\0AERROR - Cannot write to %s\0A\0A\00"
define void @wrerror(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = call i32 @wait(i32 3)
ret void
}

LLVM IR (-O2):
@.str = [31 x i8] c"\0A\0AERROR - Cannot write to %s\0A\0A\00"
define void @wrerror(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @wait(i32 3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ errno;
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ log_msg(int, char *, int /*<<< orphan*/);
void *malloc(size_t);
int /*<<< orphan*/ strerror(int /*<<< orphan*/);
void *xalloc(size_t size) {
  void *result = malloc(size);
  if (!result) {
    log_msg(1, "malloc failed: %s", strerror(errno));
    exit(1);
  }
  return result;
}


x86 assembly (clang, -O0):
<xalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    118f <xalloc+0x4f>
mov    0x2e75(%rip),%rax
mov    (%rax),%edi
call   1060 <strerror@plt>
mov    %eax,%edx
mov    $0x1,%edi
lea    0xe80(%rip),%rsi
call   1040 <log_msg@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xalloc>:
push   %rax
call   1030 <malloc@plt>
test   %rax,%rax
je     114d <xalloc+0xd>
pop    %rcx
ret
mov    0x2e8c(%rip),%rax
mov    (%rax),%edi
call   1060 <strerror@plt>
lea    0xe9e(%rip),%rsi
mov    $0x1,%edi
mov    %eax,%edx
call   1040 <log_msg@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [18 x i8] c"malloc failed: %s\00"
@errno = global i32 0
define i8* @xalloc(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 ne i8* %6, null
br i1 %7, label %13, label %8
8: ; preds = %1
%9 = load i32, i32* @errno
%10 = call i32 @strerror(i32 %9)
%11 = call i32 @log_msg(i32 1, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %10)
%12 = call i32 @exit(i32 1)
unreachable
13: ; preds = %1
%14 = load i8*, i8** %3
ret i8* %14
}

LLVM IR (-O2):
@.str = [18 x i8] c"malloc failed: %s\00"
@errno = global i32 0
define noalias i8* @xalloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %9
4: ; preds = %1
%5 = load i32, i32* @errno
%6 = tail call i32 @strerror(i32 %5)
%7 = tail call i32 @log_msg(i32 1, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %6)
%8 = tail call i32 @exit(i32 1)
unreachable
9: ; preds = %1
ret i8* %2
}
void avpriv_align_put_bits() {}


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

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

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

LLVM IR (-O2):
define void @avpriv_align_put_bits() {
ret void
}
int func1(void) { return 23; }


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

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

LLVM IR (-O0):
define i32 @func1() {
ret i32 23
}

LLVM IR (-O2):
define i32 @func1() {
ret i32 23
}
/* Variables and functions */
int /*<<< orphan*/ ring2xyf(long, long, int *, int *, int *);
long xyf2nest(long, int, int, int);
long ring2nest_(long nside, long ipring) {
  int ix, iy, face_num;
  if ((nside & (nside - 1)) != 0) {
    return -1;
  }
  ring2xyf(nside, ipring, &ix, &iy, &face_num);
  return xyf2nest(nside, ix, iy, face_num);
}


x86 assembly (clang, -O0):
<ring2nest_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x10(%rbp),%rcx
sub    $0x1,%rcx
and    %rcx,%rax
cmp    $0x0,%rax
je     1156 <ring2nest_+0x36>
movq   $0xffffffffffffffff,-0x8(%rbp)
ff
jmp    1185 <ring2nest_+0x65>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
lea    -0x1c(%rbp),%rdx
lea    -0x20(%rbp),%rcx
lea    -0x24(%rbp),%r8
call   1030 <ring2xyf@plt>
mov    -0x10(%rbp),%rdi
mov    -0x1c(%rbp),%esi
mov    -0x20(%rbp),%edx
mov    -0x24(%rbp),%ecx
call   1040 <xyf2nest@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ring2nest_>:
lea    -0x1(%rdi),%rcx
mov    $0xffffffffffffffff,%rax
test   %rcx,%rdi
jne    1165 <ring2nest_+0x45>
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
lea    0xc(%rsp),%rdx
lea    0x8(%rsp),%rcx
lea    0x4(%rsp),%r8
call   1030 <ring2xyf@plt>
mov    0xc(%rsp),%esi
mov    0x8(%rsp),%edx
mov    0x4(%rsp),%ecx
mov    %rbx,%rdi
call   1040 <xyf2nest@plt>
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
define i64 @ring2nest_(i64 %0, i64 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = bitcast i32* %3 to i8*
%7 = bitcast i32* %4 to i8*
%8 = bitcast i32* %5 to i8*
%9 = tail call i64 @llvm.ctpop.i64(i64 %0)
%10 = icmp ult i64 %9, 2
br i1 %10, label %11, label %17
11: ; preds = %2
%12 = call i32 @ring2xyf(i64 %0, i64 %1, i32* %3, i32* %4, i32* %5)
%13 = load i32, i32* %3
%14 = load i32, i32* %4
%15 = load i32, i32* %5
%16 = call i64 @xyf2nest(i64 %0, i32 %13, i32 %14, i32 %15)
br label %17
17: ; preds = %2, %11
%18 = phi i64 [ %16, %11 ], [ -1, %2 ]
ret i64 %18
}
/* Variables and functions */
int clock();
int randomXOR(int id) {
  int randomNumber;
  randomNumber = clock() + clock() * id;
  randomNumber = randomNumber ^ (randomNumber << 21);
  randomNumber = randomNumber ^ (randomNumber << 4);
  if (randomNumber < 0)
    randomNumber = -randomNumber;
  return randomNumber;
}


x86 assembly (clang, -O0):
<randomXOR>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <clock@plt>
mov    %eax,-0xc(%rbp)
mov    $0x0,%al
call   1030 <clock@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
imul   -0x4(%rbp),%ecx
add    %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    -0x8(%rbp),%ecx
shl    $0x15,%ecx
xor    %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    -0x8(%rbp),%ecx
shl    $0x4,%ecx
xor    %ecx,%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    1168 <randomXOR+0x58>
xor    %eax,%eax
sub    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<randomXOR>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <clock@plt>
mov    %eax,%ebp
xor    %eax,%eax
call   1030 <clock@plt>
imul   %ebx,%eax
add    %ebp,%eax
mov    %eax,%ecx
shl    $0x15,%ecx
xor    %ecx,%eax
mov    %eax,%ecx
shl    $0x4,%ecx
xor    %ecx,%eax
mov    %eax,%ecx
neg    %ecx
cmovns %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @randomXOR(i32 %0) {
%2 = tail call i32 (...) @clock()
%3 = tail call i32 (...) @clock()
%4 = mul nsw i32 %3, %0
%5 = add nsw i32 %4, %2
%6 = shl i32 %5, 21
%7 = xor i32 %6, %5
%8 = shl i32 %7, 4
%9 = xor i32 %8, %7
%10 = tail call i32 @llvm.abs.i32(i32 %9, i1 true)
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ setmode(char *);
void setascii(int argc, char *argv[]) {
  (void)argc;
  (void)argv;
  setmode("netascii");
}


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

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

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

LLVM IR (-O2):
@.str = [9 x i8] c"netascii\00"
define void @setascii(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @setmode(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
ret void
}
int test_imm_CAint8_mem(signed char *val) {
  return ((*val) & (-0xCA << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_CAint8_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%edx
and    $0xffffff36,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_CAint8_mem>:
movsbl (%rdi),%eax
test   $0xffffff36,%eax
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_CAint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = sext i8 %2 to i32
%4 = and i32 %3, -202
%5 = icmp eq i32 %4, 0
%6 = select i1 %5, i32 -40, i32 -20
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ ENOTSUP;
int /*<<< orphan*/ errno;
int tcpsetacceptfilter(int sock) {
  (void)sock;
  errno = ENOTSUP;
  return -1;
}


x86 assembly (clang, -O0):
<tcpsetacceptfilter>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    0x2eda(%rip),%rax
mov    (%rax),%ecx
mov    0x2ec1(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<tcpsetacceptfilter>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%eax
mov    0x2ec8(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
@ENOTSUP = global i32 0
@errno = global i32 0
define i32 @tcpsetacceptfilter(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* @ENOTSUP
store i32 %4, i32* @errno
ret i32 -1
}

LLVM IR (-O2):
@ENOTSUP = global i32 0
@errno = global i32 0
define i32 @tcpsetacceptfilter(i32 %0) {
%2 = load i32, i32* @ENOTSUP
store i32 %2, i32* @errno
ret i32 -1
}
/* Variables and functions */
int CHAR_BIT;
unsigned long bitmap_bit__(size_t offset) {
  return 1UL << (offset % (sizeof(unsigned long) * CHAR_BIT));
}


x86 assembly (clang, -O0):
<bitmap_bit__>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x2ecd(%rip),%rcx
movslq (%rcx),%rcx
shl    $0x3,%rcx
xor    %edx,%edx
div    %rcx
mov    %rdx,%rcx
mov    $0x1,%eax
shl    %cl,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bitmap_bit__>:
mov    %rdi,%rax
mov    0x2ed6(%rip),%rcx
movslq (%rcx),%rcx
shl    $0x3,%rcx
mov    %rdi,%rdx
or     %rcx,%rdx
shr    $0x20,%rdx
je     1127 <bitmap_bit__+0x27>
xor    %edx,%edx
div    %rcx
mov    %rdx,%rcx
jmp    112d <bitmap_bit__+0x2d>
xor    %edx,%edx
div    %ecx
mov    %edx,%ecx
mov    $0x1,%eax
shl    %cl,%rax
ret

LLVM IR (-O0):
@CHAR_BIT = global i32 0
define i64 @bitmap_bit__(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = load i32, i32* @CHAR_BIT
%5 = sext i32 %4 to i64
%6 = mul i64 8, %5
%7 = urem i64 %3, %6
%8 = shl i64 1, %7
ret i64 %8
}

LLVM IR (-O2):
@CHAR_BIT = global i32 0
define i64 @bitmap_bit__(i64 %0) {
%2 = load i32, i32* @CHAR_BIT
%3 = sext i32 %2 to i64
%4 = shl nsw i64 %3, 3
%5 = urem i64 %0, %4
%6 = shl nuw i64 1, %5
ret i64 %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int, int);
main() {
  int x, y, z;
  x = 0xe2345678;
  y = ((((int)x) << 2) + 2);
  z = (((int)(y)) >> 2);
  printf("%x %x %x\n", x, y, z);
}


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

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

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

LLVM IR (-O2):
@.str = [10 x i8] c"%x %x %x\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 -499886472, i32 -1999545886, i32 -499886472)
ret i32 0
}
int Min(int x, int y) { return (x < y) ? x : y; }


x86 assembly (clang, -O0):
<Min>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1121 <Min+0x21>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1127 <Min+0x27>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Min>:
mov    %esi,%eax
cmp    %esi,%edi
cmovl  %edi,%eax
ret

LLVM IR (-O0):
define i32 @Min(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 = icmp slt i32 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i32, i32* %3
br label %12
10: ; preds = %2
%11 = load i32, i32* %4
br label %12
12: ; preds = %10, %8
%13 = phi i32 [ %9, %8 ], [ %11, %10 ]
ret i32 %13
}

LLVM IR (-O2):
define i32 @Min(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
int seq_utils_enc_val_to_change(int val) {
  if (val >= 0x01 && val <= 0x3f) {
    return val;
  } else if (val >= 0x40 && val <= 0x7f) {
    return -(0x80 - val);
  }
  return 0;
}


x86 assembly (clang, -O0):
<seq_utils_enc_val_to_change>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
jl     1126 <seq_utils_enc_val_to_change+0x26>
cmpl   $0x3f,-0x8(%rbp)
jg     1126 <seq_utils_enc_val_to_change+0x26>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    115a <seq_utils_enc_val_to_change+0x5a>
cmpl   $0x40,-0x8(%rbp)
jl     114e <seq_utils_enc_val_to_change+0x4e>
cmpl   $0x7f,-0x8(%rbp)
jg     114e <seq_utils_enc_val_to_change+0x4e>
mov    $0x80,%ecx
sub    -0x8(%rbp),%ecx
xor    %eax,%eax
sub    %ecx,%eax
mov    %eax,-0x4(%rbp)
jmp    115a <seq_utils_enc_val_to_change+0x5a>
jmp    1153 <seq_utils_enc_val_to_change+0x53>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<seq_utils_enc_val_to_change>:
mov    %edi,%ecx
and    $0xffffffc0,%ecx
lea    -0x80(%rdi),%edx
xor    %eax,%eax
cmp    $0x40,%ecx
cmove  %edx,%eax
lea    -0x1(%rdi),%ecx
cmp    $0x3f,%ecx
cmovb  %edi,%eax
ret

LLVM IR (-O0):
define i32 @seq_utils_enc_val_to_change(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp sge i32 %4, 1
br i1 %5, label %6, label %11
6: ; preds = %1
%7 = load i32, i32* %3
%8 = icmp sle i32 %7, 63
br i1 %8, label %9, label %11
9: ; preds = %6
%10 = load i32, i32* %3
store i32 %10, i32* %2
br label %23
11: ; preds = %6, %1
%12 = load i32, i32* %3
%13 = icmp sge i32 %12, 64
br i1 %13, label %14, label %21
14: ; preds = %11
%15 = load i32, i32* %3
%16 = icmp sle i32 %15, 127
br i1 %16, label %17, label %21
17: ; preds = %14
%18 = load i32, i32* %3
%19 = sub nsw i32 128, %18
%20 = sub nsw i32 0, %19
store i32 %20, i32* %2
br label %23
21: ; preds = %14, %11
br label %22
22: ; preds = %21
store i32 0, i32* %2
br label %23
23: ; preds = %22, %17, %9
%24 = load i32, i32* %2
ret i32 %24
}

LLVM IR (-O2):
define i32 @seq_utils_enc_val_to_change(i32 %0) {
%2 = add i32 %0, -1
%3 = icmp ult i32 %2, 63
%4 = and i32 %0, -64
%5 = icmp eq i32 %4, 64
%6 = add i32 %0, -128
%7 = select i1 %5, i32 %6, i32 0
%8 = select i1 %3, i32 %0, i32 %7
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ ULLONG_MAX;
unsigned long long parse_ull_bounds(char const *, int /*<<< orphan*/,
                                    int /*<<< orphan*/, int *);
unsigned long long parse_ull(const char *sval, int *out_status) {
  return parse_ull_bounds(sval, 0, ULLONG_MAX, out_status);
}


x86 assembly (clang, -O0):
<parse_ull>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2ebd(%rip),%rax
mov    (%rax),%edx
mov    -0x10(%rbp),%rcx
xor    %esi,%esi
call   1030 <parse_ull_bounds@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parse_ull>:
mov    %rsi,%rcx
mov    0x2ece(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
jmp    1030 <parse_ull_bounds@plt>

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

LLVM IR (-O2):
@ULLONG_MAX = global i32 0
define i64 @parse_ull(i8* %0, i32* %1) {
%3 = load i32, i32* @ULLONG_MAX
%4 = tail call i64 @parse_ull_bounds(i8* %0, i32 0, i32 %3, i32* %1)
ret i64 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ u_int8_t;
struct constant_map {
  int dummy;
};

/* Variables and functions */
char *raw2hex(int /*<<< orphan*/ *, size_t);
char *field_debug_raw(u_int8_t *buf, size_t len, struct constant_map **maps) {
  return raw2hex(buf, len);
}


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

x86 assembly (clang, -O2):
<field_debug_raw>:
jmp    1030 <raw2hex@plt>

LLVM IR (-O0):
%struct.constant_map = type { i32 }
define i8* @field_debug_raw(i32* %0, i64 %1, %struct.constant_map** %2) {
%4 = alloca i32*
%5 = alloca i64
%6 = alloca %struct.constant_map**
store i32* %0, i32** %4
store i64 %1, i64* %5
store %struct.constant_map** %2, %struct.constant_map*** %6
%7 = load i32*, i32** %4
%8 = load i64, i64* %5
%9 = call i8* @raw2hex(i32* %7, i64 %8)
ret i8* %9
}

LLVM IR (-O2):
%struct.constant_map = type { i32 }
define i8* @field_debug_raw(i32* %0, i64 %1, %struct.constant_map** nocapture readnone %2) {
%4 = tail call i8* @raw2hex(i32* %0, i64 %1)
ret i8* %4
}
/* Variables and functions */
char *host_ntoa(int type, const void *arg, char *buffer, int *portptr) {
  type = type;
  arg = arg;
  buffer = buffer;
  portptr = portptr;
  return NULL;
}


x86 assembly (clang, -O0):
<host_ntoa>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x20(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define noalias i8* @host_ntoa(i32 %0, i8* nocapture readnone %1, i8* nocapture readnone %2, i32* nocapture readnone %3) {
ret i8* null
}
int absolute(int in) {
  if (in >= 0) {
    return in;
  } else {
    return -in;
  }
}


x86 assembly (clang, -O0):
<absolute>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jl     111c <absolute+0x1c>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1124 <absolute+0x24>
xor    %eax,%eax
sub    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @absolute(i32 %0) {
%2 = tail call i32 @llvm.abs.i32(i32 %0, i1 true)
ret i32 %2
}
/* Variables and functions */
int master();
void *pt_spawn_master(void *retval) {
  int *ret = retval;
  *ret = master();
  return retval;
}


x86 assembly (clang, -O0):
<pt_spawn_master>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    $0x0,%al
call   1030 <master@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pt_spawn_master>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <master@plt>
mov    %eax,(%rbx)
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @pt_spawn_master(i8* returned writeonly %0) {
%2 = bitcast i8* %0 to i32*
%3 = tail call i32 (...) @master()
store i32 %3, i32* %2
ret i8* %0
}
void radius_server_eap_pending_cb(struct radius_server_data *data, void *ctx) {}


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

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

LLVM IR (-O0):
%struct.radius_server_data = type opaque
define void @radius_server_eap_pending_cb(%struct.radius_server_data* %0, i8* %1) {
%3 = alloca %struct.radius_server_data*
%4 = alloca i8*
store %struct.radius_server_data* %0, %struct.radius_server_data** %3
store i8* %1, i8** %4
ret void
}

LLVM IR (-O2):
%struct.radius_server_data = type opaque
define void @radius_server_eap_pending_cb(%struct.radius_server_data* nocapture %0, i8* nocapture %1) {
ret void
}
void pcie_no_aspm(void) {}


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

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

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

LLVM IR (-O2):
define void @pcie_no_aspm() {
ret void
}
/* Variables and functions */
scalar_t__ malloc(int);
int /*<<< orphan*/ strcpy(char *, char const *);
int strlen(char const *);
char *stralloc(const char *in) {
  char *out;
  if (!in)
    return NULL;
  out = (char *)malloc(sizeof(char) * (strlen(in) + 1));
  if (out != NULL)
    strcpy(out, in);
  return out;
}


x86 assembly (clang, -O0):
<stralloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1154 <stralloc+0x24>
movq   $0x0,-0x8(%rbp)
jmp    1191 <stralloc+0x61>
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
add    $0x1,%eax
cltq
shl    $0x0,%rax
mov    %eax,%edi
call   1050 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1189 <stralloc+0x59>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stralloc>:
push   %r14
push   %rbx
push   %rax
test   %rdi,%rdi
je     115e <stralloc+0x2e>
mov    %rdi,%r14
call   1040 <strlen@plt>
lea    0x1(%rax),%edi
call   1050 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
je     1160 <stralloc+0x30>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
jmp    1160 <stralloc+0x30>
xor    %ebx,%ebx
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @stralloc(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = icmp ne i8* %5, null
br i1 %6, label %8, label %7
7: ; preds = %1
store i8* null, i8** %2
br label %25
8: ; preds = %1
%9 = load i8*, i8** %3
%10 = call i32 @strlen(i8* %9)
%11 = add nsw i32 %10, 1
%12 = sext i32 %11 to i64
%13 = mul i64 1, %12
%14 = trunc i64 %13 to i32
%15 = call i64 @malloc(i32 %14)
%16 = inttoptr i64 %15 to i8*
store i8* %16, i8** %4
%17 = load i8*, i8** %4
%18 = icmp ne i8* %17, null
br i1 %18, label %19, label %23
19: ; preds = %8
%20 = load i8*, i8** %4
%21 = load i8*, i8** %3
%22 = call i32 @strcpy(i8* %20, i8* %21)
br label %23
23: ; preds = %19, %8
%24 = load i8*, i8** %4
store i8* %24, i8** %2
br label %25
25: ; preds = %23, %7
%26 = load i8*, i8** %2
ret i8* %26
}

LLVM IR (-O2):
define i8* @stralloc(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %11, label %3
3: ; preds = %1
%4 = tail call i32 @strlen(i8* %0)
%5 = add nsw i32 %4, 1
%6 = tail call i64 @malloc(i32 %5)
%7 = inttoptr i64 %6 to i8*
%8 = icmp eq i64 %6, 0
br i1 %8, label %11, label %9
9: ; preds = %3
%10 = tail call i32 @strcpy(i8* %7, i8* %0)
br label %11
11: ; preds = %3, %9, %1
%12 = phi i8* [ null, %1 ], [ %7, %9 ], [ %7, %3 ]
ret i8* %12
}
int choose_strategy(int l_c_total) { return l_c_total > 225; }


x86 assembly (clang, -O0):
<choose_strategy>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0xe1,-0x4(%rbp)
setg   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<choose_strategy>:
xor    %eax,%eax
cmp    $0xe2,%edi
setge  %al
ret

LLVM IR (-O0):
define i32 @choose_strategy(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sgt i32 %3, 225
%5 = zext i1 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @choose_strategy(i32 %0) {
%2 = icmp sgt i32 %0, 225
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t jec_year_is_leap(uint32_t year) {
  if (((year % 4) == 0) && (((year % 100) != 0) || ((year % 400) == 0))) {
    return (1);
  } else {
    return (0);
  }
}


x86 assembly (clang, -O0):
<jec_year_is_leap>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    114f <jec_year_is_leap+0x4f>
mov    -0x8(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1143 <jec_year_is_leap+0x43>
mov    -0x8(%rbp),%eax
mov    $0x190,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    114f <jec_year_is_leap+0x4f>
movl   $0x1,-0x4(%rbp)
jmp    1156 <jec_year_is_leap+0x56>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<jec_year_is_leap>:
test   $0x3,%dil
jne    1143 <jec_year_is_leap+0x43>
imul   $0xc28f5c29,%edi,%ecx
add    $0x51eb850,%ecx
ror    $0x2,%ecx
mov    $0x1,%eax
cmp    $0x28f5c28,%ecx
ja     1145 <jec_year_is_leap+0x45>
movslq %edi,%rcx
imul   $0x51eb851f,%rcx,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x27,%rcx
add    %edx,%ecx
imul   $0x190,%ecx,%ecx
sub    %ecx,%edi
je     1145 <jec_year_is_leap+0x45>
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @jec_year_is_leap(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = srem i32 %4, 4
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %16
7: ; preds = %1
%8 = load i32, i32* %3
%9 = srem i32 %8, 100
%10 = icmp ne i32 %9, 0
br i1 %10, label %15, label %11
11: ; preds = %7
%12 = load i32, i32* %3
%13 = srem i32 %12, 400
%14 = icmp eq i32 %13, 0
br i1 %14, label %15, label %16
15: ; preds = %11, %7
store i32 1, i32* %2
br label %17
16: ; preds = %11, %1
store i32 0, i32* %2
br label %17
17: ; preds = %16, %15
%18 = load i32, i32* %2
ret i32 %18
}

LLVM IR (-O2):
define i32 @jec_year_is_leap(i32 %0) {
%2 = and i32 %0, 3
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %10
4: ; preds = %1
%5 = srem i32 %0, 100
%6 = icmp ne i32 %5, 0
%7 = srem i32 %0, 400
%8 = icmp eq i32 %7, 0
%9 = or i1 %6, %8
br i1 %9, label %11, label %10
10: ; preds = %4, %1
br label %11
11: ; preds = %4, %10
%12 = phi i32 [ 0, %10 ], [ 1, %4 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ printf(char *, char *);
char *shortestPalindrome(char *);
int /*<<< orphan*/ stderr;
int main(int argc, char **argv) {
  if (argc != 2) {
    fprintf(stderr, "Usage: ./test string\n");
    exit(-1);
  }
  printf("%s\n", shortestPalindrome(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)
cmpl   $0x2,-0x8(%rbp)
je     117f <main+0x3f>
mov    0x2e79(%rip),%rax
mov    (%rax),%edi
lea    0xe90(%rip),%rsi
call   1050 <fprintf@plt>
mov    $0xffffffff,%edi
call   1060 <exit@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1040 <shortestPalindrome@plt>
mov    %rax,%rsi
lea    0xe80(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
cmp    $0x2,%edi
jne    1162 <main+0x22>
mov    0x8(%rsi),%rdi
call   1040 <shortestPalindrome@plt>
lea    0xec0(%rip),%rdi
mov    %rax,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret
mov    0x2e77(%rip),%rax
mov    (%rax),%edi
lea    0xe8e(%rip),%rsi
call   1050 <fprintf@plt>
mov    $0xffffffff,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [22 x i8] c"Usage: ./test string\0A\00"
@.str.1 = [4 x i8] c"%s\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 i32, i32* %4
%7 = icmp ne i32 %6, 2
br i1 %7, label %8, label %12
8: ; preds = %2
%9 = load i32, i32* @stderr
%10 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%11 = call i32 @exit(i32 -1)
unreachable
12: ; preds = %2
%13 = load i8**, i8*** %5
%14 = getelementptr inbounds i8*, i8** %13, i64 1
%15 = load i8*, i8** %14
%16 = call i8* @shortestPalindrome(i8* %15)
%17 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %16)
ret i32 0
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [22 x i8] c"Usage: ./test string\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 2
br i1 %3, label %8, label %4
4: ; preds = %2
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%7 = tail call i32 @exit(i32 -1)
unreachable
8: ; preds = %2
%9 = getelementptr inbounds i8*, i8** %1, i64 1
%10 = load i8*, i8** %9
%11 = tail call i8* @shortestPalindrome(i8* %10)
%12 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %11)
ret i32 0
}