xunge/DecIR huggingface dataset:
int Int__PLUS_(int x, int y) { return x + y; }


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

x86 assembly (clang, -O2):
<Int__PLUS_>:
lea    (%rdi,%rsi,1),%eax
ret

LLVM IR (-O0):
define i32 @Int__PLUS_(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 = add nsw i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @Int__PLUS_(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
ret i32 %3
}
/* Variables and functions */
void error(char *format, ...) {}


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

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

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

LLVM IR (-O2):
define void @error(i8* nocapture %0, ...) {
ret void
}
IR0RX1(r0, r1, x0, x1, p0, p1) short r0, r1;
short *p0, *p1;
{ (*p0) = (p1[x1]); }


x86 assembly (clang, -O0):
<IR0RX1>:
push   %rbp
mov    %rsp,%rbp
mov    %esi,%eax
mov    %di,%si
mov    %si,-0x6(%rbp)
mov    %ax,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8,-0x18(%rbp)
mov    %r9,-0x20(%rbp)
mov    -0x20(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,2),%cx
mov    -0x18(%rbp),%rax
mov    %cx,(%rax)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<IR0RX1>:
movslq %ecx,%rax
movzwl (%r9,%rax,2),%eax
mov    %ax,(%r8)
ret

LLVM IR (-O0):
define i32 @IR0RX1(i32 %0, i32 %1, i32 %2, i32 %3, i16* %4, i16* %5) {
%7 = alloca i32
%8 = alloca i16
%9 = alloca i16
%10 = alloca i32
%11 = alloca i32
%12 = alloca i16*
%13 = alloca i16*
%14 = trunc i32 %0 to i16
%15 = trunc i32 %1 to i16
store i16 %14, i16* %8
store i16 %15, i16* %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store i16* %4, i16** %12
store i16* %5, i16** %13
%16 = load i16*, i16** %13
%17 = load i32, i32* %11
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds i16, i16* %16, i64 %18
%20 = load i16, i16* %19
%21 = load i16*, i16** %12
store i16 %20, i16* %21
%22 = load i32, i32* %7
ret i32 %22
}

LLVM IR (-O2):
define i32 @IR0RX1(i32 %0, i32 %1, i32 %2, i32 %3, i16* nocapture writeonly %4, i16* nocapture %5) {
%7 = sext i32 %3 to i64
%8 = getelementptr inbounds i16, i16* %5, i64 %7
%9 = load i16, i16* %8
store i16 %9, i16* %4
ret i32 undef
}
int has_unplaced_box_on(char ch) { return ch == '$'; }


x86 assembly (clang, -O0):
<has_unplaced_box_on>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x24,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<has_unplaced_box_on>:
xor    %eax,%eax
cmp    $0x24,%dil
sete   %al
ret

LLVM IR (-O0):
define i32 @has_unplaced_box_on(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp eq i32 %4, 36
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @has_unplaced_box_on(i8 signext %0) {
%2 = icmp eq i8 %0, 36
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Type definitions */
typedef int uint_fast16_t;

/* Variables and functions */
__attribute__((unused)) void cop_st_ule16(void *buf, uint_fast16_t val) {
  unsigned char *b = buf;
  b[0] = val & 0xFFu;
  b[1] = (val >> 8) & 0xFFu;
}


x86 assembly (clang, -O0):
<cop_st_ule16>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x18(%rbp),%rax
mov    %cl,(%rax)
mov    -0xc(%rbp),%eax
sar    $0x8,%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x18(%rbp),%rax
mov    %cl,0x1(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<cop_st_ule16>:
mov    %si,(%rdi)
ret

LLVM IR (-O0):
define void @cop_st_ule16(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i8*
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i8*, i8** %3
store i8* %6, i8** %5
%7 = load i32, i32* %4
%8 = and i32 %7, 255
%9 = trunc i32 %8 to i8
%10 = load i8*, i8** %5
%11 = getelementptr inbounds i8, i8* %10, i64 0
store i8 %9, i8* %11
%12 = load i32, i32* %4
%13 = ashr i32 %12, 8
%14 = and i32 %13, 255
%15 = trunc i32 %14 to i8
%16 = load i8*, i8** %5
%17 = getelementptr inbounds i8, i8* %16, i64 1
store i8 %15, i8* %17
ret void
}

LLVM IR (-O2):
define void @cop_st_ule16(i8* nocapture writeonly %0, i32 %1) {
%3 = trunc i32 %1 to i8
store i8 %3, i8* %0
%4 = lshr i32 %1, 8
%5 = trunc i32 %4 to i8
%6 = getelementptr inbounds i8, i8* %0, i64 1
store i8 %5, i8* %6
ret void
}
unsigned ht_string_hash(const char *s) {
  unsigned h;
  const unsigned char *cp = (const unsigned char *)s;
  h = *cp << 7;
  while (*cp) {
    h = (1000003 * h) ^ *cp++;
  }
  h ^= (unsigned)(cp - (const unsigned char *)s);
  return h;
}


x86 assembly (clang, -O0):
<ht_string_hash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movzbl (%rax),%eax
shl    $0x7,%eax
mov    %eax,-0xc(%rbp)
mov    -0x18(%rbp),%rax
cmpb   $0x0,(%rax)
je     114d <ht_string_hash+0x4d>
imul   $0xf4243,-0xc(%rbp),%eax
mov    -0x18(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x18(%rbp)
movzbl (%rcx),%ecx
xor    %ecx,%eax
mov    %eax,-0xc(%rbp)
jmp    111d <ht_string_hash+0x1d>
mov    -0x18(%rbp),%rax
mov    -0x8(%rbp),%rcx
sub    %rcx,%rax
xor    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ht_string_hash>:
movzbl (%rdi),%edx
mov    %edx,%ecx
shl    $0x7,%ecx
mov    %rdi,%rax
test   %edx,%edx
je     1127 <ht_string_hash+0x27>
nop
imul   $0xf4243,%ecx,%esi
movzbl %dl,%ecx
xor    %esi,%ecx
movzbl 0x1(%rax),%edx
add    $0x1,%rax
test   %dl,%dl
jne    1110 <ht_string_hash+0x10>
sub    %edi,%eax
xor    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @ht_string_hash(i8* %0) {
%2 = load i8, i8* %0
%3 = zext i8 %2 to i32
%4 = shl nuw nsw i32 %3, 7
%5 = icmp eq i8 %2, 0
br i1 %5, label %16, label %6
6: ; preds = %1, %6
%7 = phi i8* [ %11, %6 ], [ %0, %1 ]
%8 = phi i32 [ %13, %6 ], [ %4, %1 ]
%9 = phi i8 [ %14, %6 ], [ %2, %1 ]
%10 = mul i32 %8, 1000003
%11 = getelementptr inbounds i8, i8* %7, i64 1
%12 = zext i8 %9 to i32
%13 = xor i32 %10, %12
%14 = load i8, i8* %11
%15 = icmp eq i8 %14, 0
br i1 %15, label %16, label %6
16: ; preds = %6, %1
%17 = phi i32 [ %4, %1 ], [ %13, %6 ]
%18 = phi i8* [ %0, %1 ], [ %11, %6 ]
%19 = ptrtoint i8* %18 to i64
%20 = ptrtoint i8* %0 to i64
%21 = sub i64 %19, %20
%22 = trunc i64 %21 to i32
%23 = xor i32 %17, %22
ret i32 %23
}
/* Variables and functions */
int /*<<< orphan*/ PutLitStr(char *);
int /*<<< orphan*/ emitBookmark();
void ReadBookmarkStart(void) {
  PutLitStr("\\label{");
  emitBookmark();
  PutLitStr("}");
}


x86 assembly (clang, -O0):
<ReadBookmarkStart>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <PutLitStr@plt>
mov    $0x0,%al
call   1040 <emitBookmark@plt>
lea    0xeca(%rip),%rdi
call   1030 <PutLitStr@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<ReadBookmarkStart>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <PutLitStr@plt>
xor    %eax,%eax
call   1040 <emitBookmark@plt>
lea    0xecd(%rip),%rdi
pop    %rax
jmp    1030 <PutLitStr@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"\\label{\00"
@.str.1 = [2 x i8] c"}\00"
define void @ReadBookmarkStart() {
%1 = call i32 @PutLitStr(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (...) @emitBookmark()
%3 = call i32 @PutLitStr(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"\\label{\00"
@.str.1 = [2 x i8] c"}\00"
define void @ReadBookmarkStart() {
%1 = tail call i32 @PutLitStr(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (...) @emitBookmark()
%3 = tail call i32 @PutLitStr(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int execlp(char *, char *, char *);
int my_wc(void) {
  if ((execlp("wc", "wc", (char *)NULL)) == -1)
    return 0;
  return 1;
}


x86 assembly (clang, -O0):
<my_wc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rsi
xor    %eax,%eax
mov    %eax,%edx
mov    %rsi,%rdi
call   1030 <execlp@plt>
cmp    $0xffffffff,%eax
jne    1140 <my_wc+0x30>
movl   $0x0,-0x4(%rbp)
jmp    1147 <my_wc+0x37>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_wc>:
push   %rax
lea    0xee8(%rip),%rdi
mov    %rdi,%rsi
xor    %edx,%edx
call   1030 <execlp@plt>
xor    %ecx,%ecx
cmp    $0xffffffff,%eax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"wc\00"
define i32 @my_wc() {
%1 = alloca i32
%2 = call i32 @execlp(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* null)
%3 = icmp eq i32 %2, -1
br i1 %3, label %4, label %5
4: ; preds = %0
store i32 0, i32* %1
br label %6
5: ; preds = %0
store i32 1, i32* %1
br label %6
6: ; preds = %5, %4
%7 = load i32, i32* %1
ret i32 %7
}

LLVM IR (-O2):
@.str = [3 x i8] c"wc\00"
define i32 @my_wc() {
%1 = tail call i32 @execlp(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* null)
%2 = icmp ne i32 %1, -1
%3 = zext i1 %2 to i32
ret i32 %3
}
char *GetTypeFromMode(mode)
int mode;
{
  if (0) {
    return "file";
  } else if (0) {
    return "directory";
  } else if (0) {
    return "characterSpecial";
  } else if (0) {
    return "blockSpecial";
  } else if (0) {
    return "fifo";
  } else if (0) {
    return "link";
  } else if (0) {
    return "socket";
  }
  return "unknown";
}


x86 assembly (clang, -O0):
<GetTypeFromMode>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
lea    0xef2(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<GetTypeFromMode>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [8 x i8] c"unknown\00"
define i8* @GetTypeFromMode(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
ret i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [8 x i8] c"unknown\00"
define i8* @GetTypeFromMode(i32 %0) {
ret i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0)
}
int ClipDouble(double *v, double upper, double lower) {
  if (*v < lower) {
    *v = lower;
    return (1);
  }
  if (*v > upper) {
    *v = upper;
    return (1);
  }
  return (0);
}


x86 assembly (clang, -O0):
<ClipDouble>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
movsd  %xmm0,-0x18(%rbp)
movsd  %xmm1,-0x20(%rbp)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm1
movsd  -0x20(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    1142 <ClipDouble+0x42>
movsd  -0x20(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,(%rax)
movl   $0x1,-0x4(%rbp)
jmp    1175 <ClipDouble+0x75>
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
ucomisd -0x18(%rbp),%xmm0
jbe    116e <ClipDouble+0x6e>
movsd  -0x18(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,(%rax)
movl   $0x1,-0x4(%rbp)
jmp    1175 <ClipDouble+0x75>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ClipDouble>:
movsd  (%rdi),%xmm2
ucomisd %xmm2,%xmm1
ja     1116 <ClipDouble+0x16>
xor    %eax,%eax
ucomisd %xmm0,%xmm2
movapd %xmm0,%xmm1
jbe    111f <ClipDouble+0x1f>
movsd  %xmm1,(%rdi)
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @ClipDouble(double* nocapture %0, double %1, double %2) {
%4 = load double, double* %0
%5 = fcmp olt double %4, %2
br i1 %5, label %8, label %6
6: ; preds = %3
%7 = fcmp ogt double %4, %1
br i1 %7, label %8, label %10
8: ; preds = %6, %3
%9 = phi double [ %2, %3 ], [ %1, %6 ]
store double %9, double* %0
br label %10
10: ; preds = %8, %6
%11 = phi i32 [ 0, %6 ], [ 1, %8 ]
ret i32 %11
}
int isascii(int c) { return c >= 0 && c <= 0177; }


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

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

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

LLVM IR (-O2):
define i32 @isascii(i32 %0) {
%2 = icmp ult i32 %0, 128
%3 = zext i1 %2 to i32
ret i32 %3
}
label(n) {
  xwrite('l');
  number(n);
  xwrite('=.');
  xwrite('\n');
}


x86 assembly (clang, -O0):
<label>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    $0x6c,%edi
mov    $0x0,%al
call   1030 <xwrite@plt>
mov    -0x8(%rbp),%edi
mov    $0x0,%al
call   1040 <number@plt>
mov    $0x3d2e,%edi
mov    $0x0,%al
call   1030 <xwrite@plt>
mov    $0xa,%edi
mov    $0x0,%al
call   1030 <xwrite@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<label>:
push   %rbx
mov    %edi,%ebx
mov    $0x6c,%edi
xor    %eax,%eax
call   1030 <xwrite@plt>
mov    %ebx,%edi
xor    %eax,%eax
call   1040 <number@plt>
mov    $0x3d2e,%edi
xor    %eax,%eax
call   1030 <xwrite@plt>
mov    $0xa,%edi
xor    %eax,%eax
pop    %rbx
jmp    1030 <xwrite@plt>

LLVM IR (-O0):
define i32 @label(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = call i32 (i32, ...) bitcast (i32 (...)* @xwrite to i32 (i32, ...)*)(i32 108)
%5 = load i32, i32* %3
%6 = call i32 (i32, ...) bitcast (i32 (...)* @number to i32 (i32, ...)*)(i32 %5)
%7 = call i32 (i32, ...) bitcast (i32 (...)* @xwrite to i32 (i32, ...)*)(i32 15662)
%8 = call i32 (i32, ...) bitcast (i32 (...)* @xwrite to i32 (i32, ...)*)(i32 10)
%9 = load i32, i32* %2
ret i32 %9
}

LLVM IR (-O2):
define i32 @label(i32 %0) {
%2 = tail call i32 (i32, ...) bitcast (i32 (...)* @xwrite to i32 (i32, ...)*)(i32 108)
%3 = tail call i32 (i32, ...) bitcast (i32 (...)* @number to i32 (i32, ...)*)(i32 %0)
%4 = tail call i32 (i32, ...) bitcast (i32 (...)* @xwrite to i32 (i32, ...)*)(i32 15662)
%5 = tail call i32 (i32, ...) bitcast (i32 (...)* @xwrite to i32 (i32, ...)*)(i32 10)
ret i32 undef
}
void avcodec_align_dimensions2() {}


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

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

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

LLVM IR (-O2):
define void @avcodec_align_dimensions2() {
ret void
}
void AVCDecodeArithmetic() {}


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

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

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

LLVM IR (-O2):
define void @AVCDecodeArithmetic() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ F_GETFL;
int /*<<< orphan*/ F_SETFL;
int O_NONBLOCK;
int fcntl(int, int /*<<< orphan*/, int);
void make_socket_nonblocking(int skt) {
  int flag;
  flag = fcntl(skt, F_GETFL, 0);
  fcntl(skt, F_SETFL, flag | O_NONBLOCK);
}


x86 assembly (clang, -O0):
<make_socket_nonblocking>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2eab(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1030 <fcntl@plt>
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2e9d(%rip),%rax
mov    (%rax),%esi
mov    -0x8(%rbp),%edx
mov    0x2ea1(%rip),%rax
or     (%rax),%edx
call   1030 <fcntl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<make_socket_nonblocking>:
push   %rbx
mov    %edi,%ebx
mov    0x2eb6(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1030 <fcntl@plt>
mov    0x2eae(%rip),%rcx
mov    (%rcx),%esi
mov    0x2eb5(%rip),%rcx
or     (%rcx),%eax
mov    %ebx,%edi
mov    %eax,%edx
pop    %rbx
jmp    1030 <fcntl@plt>

LLVM IR (-O0):
@F_GETFL = global i32 0
@F_SETFL = global i32 0
@O_NONBLOCK = global i32 0
define void @make_socket_nonblocking(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = load i32, i32* @F_GETFL
%6 = call i32 @fcntl(i32 %4, i32 %5, i32 0)
store i32 %6, i32* %3
%7 = load i32, i32* %2
%8 = load i32, i32* @F_SETFL
%9 = load i32, i32* %3
%10 = load i32, i32* @O_NONBLOCK
%11 = or i32 %9, %10
%12 = call i32 @fcntl(i32 %7, i32 %8, i32 %11)
ret void
}

LLVM IR (-O2):
@F_GETFL = global i32 0
@F_SETFL = global i32 0
@O_NONBLOCK = global i32 0
define void @make_socket_nonblocking(i32 %0) {
%2 = load i32, i32* @F_GETFL
%3 = tail call i32 @fcntl(i32 %0, i32 %2, i32 0)
%4 = load i32, i32* @F_SETFL
%5 = load i32, i32* @O_NONBLOCK
%6 = or i32 %5, %3
%7 = tail call i32 @fcntl(i32 %0, i32 %4, i32 %6)
ret void
}
char *memchr(sp, c, n)
register char *sp, c;
register int n;
{
  while (--n >= 0)
    if (*sp++ == c)
      return (--sp);
  return (0);
}


x86 assembly (clang, -O0):
<memchr>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x10(%rbp)
mov    %al,-0x11(%rbp)
mov    %edx,-0x18(%rbp)
mov    -0x18(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x18(%rbp)
cmp    $0x0,%eax
jl     115b <memchr+0x5b>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movsbl (%rax),%eax
movsbl -0x11(%rbp),%ecx
cmp    %ecx,%eax
jne    1156 <memchr+0x56>
mov    -0x10(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x10(%rbp)
mov    %rax,-0x8(%rbp)
jmp    1163 <memchr+0x63>
jmp    1111 <memchr+0x11>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<memchr>:
mov    %rdi,%rax
movsbl %sil,%ecx
add    $0xffffffffffffffff,%rax
nopl   0x0(%rax,%rax,1)
test   %edx,%edx
jle    1124 <memchr+0x24>
add    $0xffffffff,%edx
movsbl 0x1(%rax),%esi
add    $0x1,%rax
cmp    %esi,%ecx
jne    1110 <memchr+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i8* @memchr(i8* %0, i32 %1, i32 %2) {
%4 = shl i32 %1, 24
%5 = ashr exact i32 %4, 24
br label %6
6: ; preds = %10, %3
%7 = phi i8* [ %0, %3 ], [ %12, %10 ]
%8 = phi i32 [ %2, %3 ], [ %11, %10 ]
%9 = icmp sgt i32 %8, 0
br i1 %9, label %10, label %16
10: ; preds = %6
%11 = add nsw i32 %8, -1
%12 = getelementptr inbounds i8, i8* %7, i64 1
%13 = load i8, i8* %7
%14 = sext i8 %13 to i32
%15 = icmp eq i32 %5, %14
br i1 %15, label %16, label %6
16: ; preds = %6, %10
%17 = phi i8* [ %7, %10 ], [ null, %6 ]
ret i8* %17
}
/* Type definitions */
struct cmd {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ strdup(char *);
int /*<<< orphan*/ submod_setres(int /*<<< orphan*/, int /*<<< orphan*/);
void fail_test(struct cmd *command, void *workspace) {
  submod_setres(0, strdup("fail()"));
}


x86 assembly (clang, -O0):
<fail_test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xec9(%rip),%rdi
call   1040 <strdup@plt>
mov    %eax,%esi
xor    %edi,%edi
call   1030 <submod_setres@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fail_test>:
push   %rax
lea    0xed8(%rip),%rdi
call   1040 <strdup@plt>
xor    %edi,%edi
mov    %eax,%esi
pop    %rax
jmp    1030 <submod_setres@plt>

LLVM IR (-O0):
%struct.cmd = type { i32 }
@.str = [7 x i8] c"fail()\00"
define void @fail_test(%struct.cmd* %0, i8* %1) {
%3 = alloca %struct.cmd*
%4 = alloca i8*
store %struct.cmd* %0, %struct.cmd** %3
store i8* %1, i8** %4
%5 = call i32 @strdup(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @submod_setres(i32 0, i32 %5)
ret void
}

LLVM IR (-O2):
%struct.cmd = type { i32 }
@.str = [7 x i8] c"fail()\00"
define void @fail_test(%struct.cmd* nocapture readnone %0, i8* nocapture readnone %1) {
%3 = tail call i32 @strdup(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @submod_setres(i32 0, i32 %3)
ret void
}
char btp_parse_digit(char **input) {
  char digit = **input;
  if (digit < '0' || digit > '9')
    return '\0';
  ++*input;
  return digit;
}


x86 assembly (clang, -O0):
<btp_parse_digit>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    (%rax),%al
mov    %al,-0x11(%rbp)
movsbl -0x11(%rbp),%eax
cmp    $0x30,%eax
jl     112e <btp_parse_digit+0x2e>
movsbl -0x11(%rbp),%eax
cmp    $0x39,%eax
jle    1137 <btp_parse_digit+0x37>
movb   $0x0,-0x1(%rbp)
jmp    114b <btp_parse_digit+0x4b>
mov    -0x10(%rbp),%rax
mov    (%rax),%rcx
add    $0x1,%rcx
mov    %rcx,(%rax)
mov    -0x11(%rbp),%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<btp_parse_digit>:
mov    (%rdi),%rcx
mov    (%rcx),%al
lea    -0x3a(%rax),%edx
cmp    $0xf6,%dl
jae    1110 <btp_parse_digit+0x10>
xor    %eax,%eax
ret
add    $0x1,%rcx
mov    %rcx,(%rdi)
ret

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

LLVM IR (-O2):
define signext i8 @btp_parse_digit(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = load i8, i8* %2
%4 = add i8 %3, -58
%5 = icmp ult i8 %4, -10
br i1 %5, label %8, label %6
6: ; preds = %1
%7 = getelementptr inbounds i8, i8* %2, i64 1
store i8* %7, i8** %0
br label %8
8: ; preds = %1, %6
%9 = phi i8 [ %3, %6 ], [ 0, %1 ]
ret i8 %9
}
/* Variables and functions */
double swe_degnorm(double);
double swe_difdegn(double p1, double p2) { return (swe_degnorm(p1 - p2)); }


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

x86 assembly (clang, -O2):
<swe_difdegn>:
subsd  %xmm1,%xmm0
jmp    1030 <swe_degnorm@plt>

LLVM IR (-O0):
define double @swe_difdegn(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 = load double, double* %4
%7 = fsub double %5, %6
%8 = call double @swe_degnorm(double %7)
ret double %8
}

LLVM IR (-O2):
define double @swe_difdegn(double %0, double %1) {
%3 = fsub double %0, %1
%4 = tail call double @swe_degnorm(double %3)
ret double %4
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int, int);
int /*<<< orphan*/ stdout;
void t_gotoxy(int x, int y) { fprintf(stdout, "\033[%d;%dH", x, y); }


x86 assembly (clang, -O0):
<t_gotoxy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    0x2ebb(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%edx
mov    -0x8(%rbp),%ecx
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_gotoxy>:
mov    %esi,%ecx
mov    %edi,%edx
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stdout = global i32 0
@.str = [9 x i8] c"\1B[%d;%dH\00"
define void @t_gotoxy(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* @stdout
%6 = load i32, i32* %3
%7 = load i32, i32* %4
%8 = call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %6, i32 %7)
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [9 x i8] c"\1B[%d;%dH\00"
define void @t_gotoxy(i32 %0, i32 %1) {
%3 = load i32, i32* @stdout
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1)
ret void
}
double ProjY(double trs[3][3], double x, double y, double z, double f) {
  return (((trs)[1][0] * (x) + (trs)[1][1] * (y) + (trs)[1][2] * (f)) / (z));
}


x86 assembly (clang, -O0):
<ProjY>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  %xmm2,-0x20(%rbp)
movsd  %xmm3,-0x28(%rbp)
mov    -0x8(%rbp),%rax
movsd  0x18(%rax),%xmm1
movsd  -0x10(%rbp),%xmm2
mov    -0x8(%rbp),%rax
movsd  0x20(%rax),%xmm0
mulsd  -0x18(%rbp),%xmm0
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
mov    -0x8(%rbp),%rax
movsd  0x28(%rax),%xmm0
movsd  -0x28(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
divsd  -0x20(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<ProjY>:
mulsd  0x20(%rdi),%xmm1
mulsd  0x18(%rdi),%xmm0
addsd  %xmm1,%xmm0
mulsd  0x28(%rdi),%xmm3
addsd  %xmm3,%xmm0
divsd  %xmm2,%xmm0
ret

LLVM IR (-O0):
define double @ProjY([3 x double]* %0, double %1, double %2, double %3, double %4) {
%6 = alloca [3 x double]*
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = alloca double
store [3 x double]* %0, [3 x double]** %6
store double %1, double* %7
store double %2, double* %8
store double %3, double* %9
store double %4, double* %10
%11 = load [3 x double]*, [3 x double]** %6
%12 = getelementptr inbounds [3 x double], [3 x double]* %11, i64 1
%13 = getelementptr inbounds [3 x double], [3 x double]* %12, i64 0, i64 0
%14 = load double, double* %13
%15 = load double, double* %7
%16 = load [3 x double]*, [3 x double]** %6
%17 = getelementptr inbounds [3 x double], [3 x double]* %16, i64 1
%18 = getelementptr inbounds [3 x double], [3 x double]* %17, i64 0, i64 1
%19 = load double, double* %18
%20 = load double, double* %8
%21 = fmul double %19, %20
%22 = call double @llvm.fmuladd.f64(double %14, double %15, double %21)
%23 = load [3 x double]*, [3 x double]** %6
%24 = getelementptr inbounds [3 x double], [3 x double]* %23, i64 1
%25 = getelementptr inbounds [3 x double], [3 x double]* %24, i64 0, i64 2
%26 = load double, double* %25
%27 = load double, double* %10
%28 = call double @llvm.fmuladd.f64(double %26, double %27, double %22)
%29 = load double, double* %9
%30 = fdiv double %28, %29
ret double %30
}

LLVM IR (-O2):
define double @ProjY([3 x double]* nocapture %0, double %1, double %2, double %3, double %4) {
%6 = getelementptr inbounds [3 x double], [3 x double]* %0, i64 1, i64 0
%7 = load double, double* %6
%8 = getelementptr inbounds [3 x double], [3 x double]* %0, i64 1, i64 1
%9 = load double, double* %8
%10 = fmul double %9, %2
%11 = tail call double @llvm.fmuladd.f64(double %7, double %1, double %10)
%12 = getelementptr inbounds [3 x double], [3 x double]* %0, i64 1, i64 2
%13 = load double, double* %12
%14 = tail call double @llvm.fmuladd.f64(double %13, double %4, double %11)
%15 = fdiv double %14, %3
ret double %15
}
unsigned int sample_rate(struct device *d) { return 48000; }


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

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

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

LLVM IR (-O2):
%struct.device = type opaque
define i32 @sample_rate(%struct.device* nocapture readnone %0) {
ret i32 48000
}
void noop(int sig) {}


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

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

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

LLVM IR (-O2):
define void @noop(i32 %0) {
ret void
}
/* Variables and functions */
scalar_t__ atan2f(float, float);
int /*<<< orphan*/ link_failure_atan2f();
void test_atan2f(float f1, float f2) {
  if (atan2f(f1, f2) != atan2f(f1, f2))
    link_failure_atan2f();
}


x86 assembly (clang, -O0):
<test_atan2f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
call   1040 <atan2f@plt>
mov    %rax,-0x10(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
call   1040 <atan2f@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
cmp    %rcx,%rax
je     116b <test_atan2f+0x4b>
mov    $0x0,%al
call   1030 <link_failure_atan2f@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_atan2f>:
push   %rbx
sub    $0x10,%rsp
movss  %xmm1,0xc(%rsp)
movss  %xmm0,0x8(%rsp)
call   1040 <atan2f@plt>
mov    %rax,%rbx
movss  0x8(%rsp),%xmm0
movss  0xc(%rsp),%xmm1
call   1040 <atan2f@plt>
cmp    %rax,%rbx
jne    1155 <test_atan2f+0x35>
add    $0x10,%rsp
pop    %rbx
ret
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
jmp    1030 <link_failure_atan2f@plt>

LLVM IR (-O0):
define void @test_atan2f(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = load float, float* %4
%7 = call i64 @atan2f(float %5, float %6)
%8 = load float, float* %3
%9 = load float, float* %4
%10 = call i64 @atan2f(float %8, float %9)
%11 = icmp ne i64 %7, %10
br i1 %11, label %12, label %14
12: ; preds = %2
%13 = call i32 (...) @link_failure_atan2f()
br label %14
14: ; preds = %12, %2
ret void
}

LLVM IR (-O2):
define void @test_atan2f(float %0, float %1) {
%3 = tail call i64 @atan2f(float %0, float %1)
%4 = tail call i64 @atan2f(float %0, float %1)
%5 = icmp eq i64 %3, %4
br i1 %5, label %8, label %6
6: ; preds = %2
%7 = tail call i32 (...) @link_failure_atan2f()
br label %8
8: ; preds = %6, %2
ret void
}
/* Type definitions */
struct ship {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ Write(int, struct ship *, long, long, long, long);
void send_dbp(struct ship *ship, long a, long b, long c, long d) {
  Write(5, ship, a, b, c, d);
}


x86 assembly (clang, -O0):
<send_dbp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    -0x20(%rbp),%r8
mov    -0x28(%rbp),%r9
mov    $0x5,%edi
call   1030 <Write@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<send_dbp>:
mov    %r8,%r9
mov    %rcx,%r8
mov    %rdx,%rcx
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    $0x5,%edi
jmp    1030 <Write@plt>

LLVM IR (-O0):
%struct.ship = type { i32 }
define void @send_dbp(%struct.ship* %0, i64 %1, i64 %2, i64 %3, i64 %4) {
%6 = alloca %struct.ship*
%7 = alloca i64
%8 = alloca i64
%9 = alloca i64
%10 = alloca i64
store %struct.ship* %0, %struct.ship** %6
store i64 %1, i64* %7
store i64 %2, i64* %8
store i64 %3, i64* %9
store i64 %4, i64* %10
%11 = load %struct.ship*, %struct.ship** %6
%12 = load i64, i64* %7
%13 = load i64, i64* %8
%14 = load i64, i64* %9
%15 = load i64, i64* %10
%16 = call i32 @Write(i32 5, %struct.ship* %11, i64 %12, i64 %13, i64 %14, i64 %15)
ret void
}

LLVM IR (-O2):
%struct.ship = type { i32 }
define void @send_dbp(%struct.ship* %0, i64 %1, i64 %2, i64 %3, i64 %4) {
%6 = tail call i32 @Write(i32 5, %struct.ship* %0, i64 %1, i64 %2, i64 %3, i64 %4)
ret void
}
char *hash_plugin_summary(void) {
  return ("mssql-2012 \tMicrosoft SQL Server 2012 plugin");
}


x86 assembly (clang, -O0):
<hash_plugin_summary>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash_plugin_summary>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [45 x i8] c"mssql-2012 \09Microsoft SQL Server 2012 plugin\00"
define i8* @hash_plugin_summary() {
ret i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [45 x i8] c"mssql-2012 \09Microsoft SQL Server 2012 plugin\00"
define i8* @hash_plugin_summary() {
ret i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
scalar_t__ errno;
scalar_t__ posix_memalign(void **, int, size_t);
void *malloc16(size_t size) {
  void *mem;
  errno = posix_memalign(&mem, 16, size);
  if (errno == 0)
    return mem;
  return NULL;
}


x86 assembly (clang, -O0):
<malloc16>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdx
lea    -0x18(%rbp),%rdi
mov    $0x10,%esi
call   1030 <posix_memalign@plt>
mov    %rax,%rcx
mov    0x2ea8(%rip),%rax
mov    %rcx,(%rax)
mov    0x2e9e(%rip),%rax
cmpq   $0x0,(%rax)
jne    1159 <malloc16+0x49>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1161 <malloc16+0x51>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<malloc16>:
push   %rax
mov    %rdi,%rdx
mov    %rsp,%rdi
mov    $0x10,%esi
call   1030 <posix_memalign@plt>
mov    0x2eb8(%rip),%rcx
mov    %rax,(%rcx)
test   %rax,%rax
jne    1136 <malloc16+0x26>
mov    (%rsp),%rax
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@errno = global i64 0
define i8* @malloc16(i64 %0) {
%2 = alloca i8*
%3 = alloca i64
%4 = alloca i8*
store i64 %0, i64* %3
%5 = load i64, i64* %3
%6 = call i64 @posix_memalign(i8** %4, i32 16, i64 %5)
store i64 %6, i64* @errno
%7 = load i64, i64* @errno
%8 = icmp eq i64 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %1
%10 = load i8*, i8** %4
store i8* %10, i8** %2
br label %12
11: ; preds = %1
store i8* null, i8** %2
br label %12
12: ; preds = %11, %9
%13 = load i8*, i8** %2
ret i8* %13
}

LLVM IR (-O2):
@errno = global i64 0
define i8* @malloc16(i64 %0) {
%2 = alloca i8*
%3 = bitcast i8** %2 to i8*
%4 = call i64 @posix_memalign(i8** %2, i32 16, i64 %0)
store i64 %4, i64* @errno
%5 = icmp eq i64 %4, 0
%6 = load i8*, i8** %2
%7 = select i1 %5, i8* %6, i8* null
ret i8* %7
}
int test_imm_B4uint8_reg(unsigned char val) {
  return ((val) & (0xB4 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_B4uint8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%edx
and    $0xb4,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_B4uint8_reg>:
test   $0xb4,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_B4uint8_reg(i8 zeroext %0) {
%2 = and i8 %0, -76
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
int char_to_int(signed char c) { return c; }


x86 assembly (clang, -O0):
<char_to_int>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @char_to_int(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
ret i32 %4
}

LLVM IR (-O2):
define i32 @char_to_int(i8 signext %0) {
%2 = sext i8 %0 to i32
ret i32 %2
}
double jd2mjd(double jd) { return jd - 2400000.5; }


x86 assembly (clang, -O0):
<jd2mjd>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xeea(%rip),%xmm1
subsd  %xmm1,%xmm0
pop    %rbp
ret

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

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

LLVM IR (-O2):
define double @jd2mjd(double %0) {
%2 = fadd double %0, 0xC1424F8040000000
ret double %2
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
int strlen(char *);
int write(int, char *, int);
int setLed(int filedesc, char *buf) {
  int len = strlen(buf);
  int bytes_writed;
  if ((bytes_writed = write(filedesc, buf, len)) < 0) {
    puts("Can not write to file!\n");
    return -1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<setLed>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <strlen@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1040 <write@plt>
mov    %eax,-0x18(%rbp)
cmp    $0x0,%eax
jge    117e <setLed+0x4e>
lea    0xe93(%rip),%rdi
call   1030 <puts@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1185 <setLed+0x55>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<setLed>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
mov    %rsi,%rdi
call   1050 <strlen@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %eax,%edx
call   1040 <write@plt>
mov    %eax,%ecx
xor    %eax,%eax
test   %ecx,%ecx
jns    1165 <setLed+0x35>
lea    0xea5(%rip),%rdi
call   1030 <puts@plt>
mov    $0xffffffff,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [24 x i8] c"Can not write to file!\0A\00"
define i32 @setLed(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %4
store i8* %1, i8** %5
%8 = load i8*, i8** %5
%9 = call i32 @strlen(i8* %8)
store i32 %9, i32* %6
%10 = load i32, i32* %4
%11 = load i8*, i8** %5
%12 = load i32, i32* %6
%13 = call i32 @write(i32 %10, i8* %11, i32 %12)
store i32 %13, i32* %7
%14 = icmp slt i32 %13, 0
br i1 %14, label %15, label %17
15: ; preds = %2
%16 = call i32 @puts(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
store i32 -1, i32* %3
br label %18
17: ; preds = %2
store i32 0, i32* %3
br label %18
18: ; preds = %17, %15
%19 = load i32, i32* %3
ret i32 %19
}

LLVM IR (-O2):
@.str = [24 x i8] c"Can not write to file!\0A\00"
define i32 @setLed(i32 %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %1)
%4 = tail call i32 @write(i32 %0, i8* %1, i32 %3)
%5 = icmp slt i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %2
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %2, %6
%9 = phi i32 [ -1, %6 ], [ 0, %2 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void main() {
  int a, b;
  a = 0xFF;
  b = a ^ 0xFF;
  printf("\40:The a ^ b is %d\n", b);
  b = b ^ 0xFF;
  printf("\40:The b ^ 0xFF is %x\n", b);
}


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

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

LLVM IR (-O0):
@.str = [19 x i8] c" :The a ^ b is %d\0A\00"
@.str.1 = [22 x i8] c" :The b ^ 0xFF is %x\0A\00"
define void @main() {
%1 = alloca i32
%2 = alloca i32
store i32 255, i32* %1
%3 = load i32, i32* %1
%4 = xor i32 %3, 255
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = load i32, i32* %2
%8 = xor i32 %7, 255
store i32 %8, i32* %2
%9 = load i32, i32* %2
%10 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i32 %9)
ret void
}

LLVM IR (-O2):
@.str = [19 x i8] c" :The a ^ b is %d\0A\00"
@.str.1 = [22 x i8] c" :The b ^ 0xFF is %x\0A\00"
define void @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 0)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i32 255)
ret void
}
/* Variables and functions */
double ECHF(int, double);
double HDIAGF(int i, double x) { return ECHF(i - (16 / 2), x); }


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

x86 assembly (clang, -O2):
<HDIAGF>:
add    $0xfffffff8,%edi
jmp    1030 <ECHF@plt>

LLVM IR (-O0):
define double @HDIAGF(i32 %0, double %1) {
%3 = alloca i32
%4 = alloca double
store i32 %0, i32* %3
store double %1, double* %4
%5 = load i32, i32* %3
%6 = sub nsw i32 %5, 8
%7 = load double, double* %4
%8 = call double @ECHF(i32 %6, double %7)
ret double %8
}

LLVM IR (-O2):
define double @HDIAGF(i32 %0, double %1) {
%3 = add nsw i32 %0, -8
%4 = tail call double @ECHF(i32 %3, double %1)
ret double %4
}
/* Variables and functions */
int _ada_use_c2phc4c(int, int *, int *, double *, int /*<<< orphan*/);
int syscon_add_quaddobl_Laurent_term(int i, int n, int *exp, double *c) {
  int a[2], fail;
  a[0] = n;
  a[1] = i;
  fail = _ada_use_c2phc4c(566, a, exp, c, 0);
  return fail;
}


x86 assembly (clang, -O0):
<syscon_add_quaddobl_Laurent_term>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x1c(%rbp)
lea    -0x20(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    $0x236,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<syscon_add_quaddobl_Laurent_term>:
push   %rax
mov    %esi,(%rsp)
mov    %edi,0x4(%rsp)
mov    %rsp,%rsi
mov    $0x236,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @syscon_add_quaddobl_Laurent_term(i32 %0, i32 %1, i32* %2, double* %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32*
%8 = alloca double*
%9 = alloca [2 x i32]
%10 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32* %2, i32** %7
store double* %3, double** %8
%11 = load i32, i32* %6
%12 = getelementptr inbounds [2 x i32], [2 x i32]* %9, i64 0, i64 0
store i32 %11, i32* %12
%13 = load i32, i32* %5
%14 = getelementptr inbounds [2 x i32], [2 x i32]* %9, i64 0, i64 1
store i32 %13, i32* %14
%15 = getelementptr inbounds [2 x i32], [2 x i32]* %9, i64 0, i64 0
%16 = load i32*, i32** %7
%17 = load double*, double** %8
%18 = call i32 @_ada_use_c2phc4c(i32 566, i32* %15, i32* %16, double* %17, i32 0)
store i32 %18, i32* %10
%19 = load i32, i32* %10
ret i32 %19
}

LLVM IR (-O2):
define i32 @syscon_add_quaddobl_Laurent_term(i32 %0, i32 %1, i32* %2, double* %3) {
%5 = alloca [2 x i32]
%6 = bitcast [2 x i32]* %5 to i8*
%7 = getelementptr inbounds [2 x i32], [2 x i32]* %5, i64 0, i64 0
store i32 %1, i32* %7
%8 = getelementptr inbounds [2 x i32], [2 x i32]* %5, i64 0, i64 1
store i32 %0, i32* %8
%9 = call i32 @_ada_use_c2phc4c(i32 566, i32* %7, i32* %2, double* %3, i32 0)
ret i32 %9
}