xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ pdlacpy_(char *, int *, int *, double *, int *, int *, int *,
                            double *, int *, int *, int *);
void p_matcopy(double *a, int *desca, double *b, int *descb) {
  char uplo = 'A';
  int n = desca[2];
  int ij = 1;
  pdlacpy_(&uplo, &n, &n, a, &ij, &ij, desca, b, &ij, &ij, descb);
}


x86 assembly (clang, -O0):
<p_matcopy>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
sub    $0x58,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
movb   $0x41,-0x29(%rbp)
mov    -0x18(%rbp),%rax
mov    0x8(%rax),%eax
mov    %eax,-0x30(%rbp)
movl   $0x1,-0x34(%rbp)
mov    -0x10(%rbp),%rcx
mov    -0x18(%rbp),%rbx
mov    -0x20(%rbp),%r11
mov    -0x28(%rbp),%rax
lea    -0x29(%rbp),%rdi
lea    -0x30(%rbp),%rdx
lea    -0x34(%rbp),%r10
mov    %rdx,%rsi
mov    %r10,%r8
mov    %r10,%r9
mov    %rbx,(%rsp)
mov    %r11,0x8(%rsp)
mov    %r10,0x10(%rsp)
mov    %r10,0x18(%rsp)
mov    %rax,0x20(%rsp)
call   1030 <pdlacpy_@plt>
add    $0x58,%rsp
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<p_matcopy>:
sub    $0x18,%rsp
mov    %rcx,%r11
mov    %rdx,%r10
mov    %rsi,%rax
mov    %rdi,%rcx
movb   $0x41,0xf(%rsp)
mov    0x8(%rsi),%edx
mov    %edx,0x14(%rsp)
movl   $0x1,0x10(%rsp)
sub    $0x8,%rsp
lea    0x18(%rsp),%r8
lea    0x17(%rsp),%rdi
lea    0x1c(%rsp),%rdx
mov    %rdx,%rsi
mov    %r8,%r9
push   %r11
push   %r8
push   %r8
push   %r10
push   %rax
call   1030 <pdlacpy_@plt>
add    $0x48,%rsp
ret

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

LLVM IR (-O2):
define void @p_matcopy(double* %0, i32* %1, double* %2, i32* %3) {
%5 = alloca i8
%6 = alloca i32
%7 = alloca i32
store i8 65, i8* %5
%8 = bitcast i32* %6 to i8*
%9 = getelementptr inbounds i32, i32* %1, i64 2
%10 = load i32, i32* %9
store i32 %10, i32* %6
%11 = bitcast i32* %7 to i8*
store i32 1, i32* %7
%12 = call i32 @pdlacpy_(i8* %5, i32* %6, i32* %6, double* %0, i32* %7, i32* %7, i32* %1, double* %2, i32* %7, i32* %7, i32* %3)
ret void
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  scalar_t__ send_event;
};
struct TYPE_4__ {
  TYPE_1__ xgravity;
};
typedef TYPE_2__ XEvent;

/* Variables and functions */
int get_XEvent_xgravity_send_event(void *_p) {
  return (int)((XEvent *)_p)->xgravity.send_event;
}


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

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

LLVM IR (-O0):
%struct.TYPE_4__ = type { %struct.TYPE_3__ }
%struct.TYPE_3__ = type { i64 }
define i32 @get_XEvent_xgravity_send_event(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.TYPE_4__*
%5 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %4, i32 0, i32 0
%6 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %5, i32 0, i32 0
%7 = load i64, i64* %6
%8 = trunc i64 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @get_XEvent_xgravity_send_event(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
ret i32 %4
}
long create_random(long seed) { return seed; }


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

x86 assembly (clang, -O2):
<create_random>:
mov    %rdi,%rax
ret

LLVM IR (-O0):
define i64 @create_random(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
ret i64 %3
}

LLVM IR (-O2):
define i64 @create_random(i64 returned %0) {
ret i64 %0
}
/* Variables and functions */
char *getenv(char *);
const char *path_clsync() {
  char *clsync_path;
  clsync_path = getenv("CLSYNC_PATH");
  if (clsync_path == NULL)
    clsync_path = "clsync";
  return clsync_path;
}


x86 assembly (clang, -O0):
<path_clsync>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
call   1030 <getenv@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    113e <path_clsync+0x2e>
lea    0xed2(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<path_clsync>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <getenv@plt>
test   %rax,%rax
lea    0xee5(%rip),%rcx
cmove  %rcx,%rax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [12 x i8] c"CLSYNC_PATH\00"
@.str.1 = [7 x i8] c"clsync\00"
define i8* @path_clsync() {
%1 = tail call i8* @getenv(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%2 = icmp eq i8* %1, null
%3 = select i1 %2, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* %1
ret i8* %3
}
/* Variables and functions */
scalar_t__ floor(double);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, unsigned long);
int /*<<< orphan*/ stderr;
int main(void) {
  double d = 2591024700;
  unsigned long l = (unsigned)floor(d + .5) + .5;
  fprintf(stderr, "%lu\n", l);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movabs $0x41e34dfcc7800000,%rax
4d e3 41
mov    %rax,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  0xeb6(%rip),%xmm1
movsd  %xmm1,-0x20(%rbp)
addsd  %xmm1,%xmm0
call   1040 <floor@plt>
movsd  -0x20(%rbp),%xmm1
mov    %eax,%eax
cvtsi2sd %rax,%xmm0
addsd  %xmm1,%xmm0
movaps %xmm0,%xmm1
cvttsd2si %xmm1,%rax
mov    %rax,%rdx
sar    $0x3f,%rdx
movsd  0xe89(%rip),%xmm1
subsd  %xmm1,%xmm0
cvttsd2si %xmm0,%rcx
and    %rdx,%rcx
or     %rcx,%rax
mov    %rax,-0x18(%rbp)
mov    0x2e47(%rip),%rax
mov    (%rax),%edi
mov    -0x18(%rbp),%rdx
lea    0xe6a(%rip),%rsi
call   1030 <fprintf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movsd  0xed7(%rip),%xmm0
call   1040 <floor@plt>
mov    %eax,%eax
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
addsd  0xec8(%rip),%xmm0
cvttsd2si %xmm0,%rax
mov    %rax,%rcx
sar    $0x3f,%rcx
subsd  0xebc(%rip),%xmm0
cvttsd2si %xmm0,%rdx
and    %rcx,%rdx
or     %rax,%rdx
mov    0x2e7a(%rip),%rax
mov    (%rax),%edi
lea    0xea9(%rip),%rsi
call   1030 <fprintf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [5 x i8] c"%lu\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
%3 = alloca i64
store i32 0, i32* %1
store double 0x41E34DFCC7800000, double* %2
%4 = load double, double* %2
%5 = fadd double %4, 5.000000e-01
%6 = call i64 @floor(double %5)
%7 = trunc i64 %6 to i32
%8 = uitofp i32 %7 to double
%9 = fadd double %8, 5.000000e-01
%10 = fptoui double %9 to i64
store i64 %10, i64* %3
%11 = load i32, i32* @stderr
%12 = load i64, i64* %3
%13 = call i32 @fprintf(i32 %11, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64 %12)
ret i32 0
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [5 x i8] c"%lu\0A\00"
define i32 @main() {
%1 = tail call i64 @floor(double 0x41E34DFCC7900000)
%2 = trunc i64 %1 to i32
%3 = uitofp i32 %2 to double
%4 = fadd double %3, 5.000000e-01
%5 = fptoui double %4 to i64
%6 = load i32, i32* @stderr
%7 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64 %5)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ fatal(char *, char *, int);
void *malloc(size_t);
void *emalloc(size_t n) {
  void *rv;
  if ((rv = malloc(n)) == NULL) {
    fatal("out of memory", "", 1);
  }
  return rv;
}


x86 assembly (clang, -O0):
<emalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
jne    115b <emalloc+0x3b>
lea    0xeb6(%rip),%rdi
lea    0xebc(%rip),%rsi
mov    $0x1,%edx
call   1040 <fatal@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<emalloc>:
push   %rbx
call   1030 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1146 <emalloc+0x26>
lea    0xecb(%rip),%rdi
lea    0xed1(%rip),%rsi
mov    $0x1,%edx
call   1040 <fatal@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"out of memory\00"
@.str.1 = [1 x i8] zeroinitializer
define i8* @emalloc(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 = icmp eq i8* %5, null
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = call i32 @fatal(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), i32 1)
br label %9
9: ; preds = %7, %1
%10 = load i8*, i8** %3
ret i8* %10
}

LLVM IR (-O2):
@.str = [14 x i8] c"out of memory\00"
@.str.1 = [1 x i8] zeroinitializer
define noalias i8* @emalloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @fatal(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), i32 1)
br label %6
6: ; preds = %4, %1
ret i8* %2
}
/* Variables and functions */
scalar_t__ islower(char);
char toupper(unsigned char);
void convert_to_uppercase(char *str) {
  while (*str != '\0') {
    if (islower(*str))
      *str = toupper((unsigned char)*str);
    ++str;
  }
}


x86 assembly (clang, -O0):
<convert_to_uppercase>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1177 <convert_to_uppercase+0x57>
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <islower@plt>
cmp    $0x0,%rax
je     1166 <convert_to_uppercase+0x46>
mov    -0x8(%rbp),%rax
movzbl (%rax),%edi
call   1040 <toupper@plt>
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    112c <convert_to_uppercase+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<convert_to_uppercase>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1155 <convert_to_uppercase+0x35>
mov    %rdi,%rbx
jmp    113c <convert_to_uppercase+0x1c>
nopl   0x0(%rax)
movzbl 0x1(%rbx),%eax
add    $0x1,%rbx
test   %al,%al
je     1155 <convert_to_uppercase+0x35>
movsbl %al,%edi
call   1030 <islower@plt>
test   %rax,%rax
je     1130 <convert_to_uppercase+0x10>
movzbl (%rbx),%edi
call   1040 <toupper@plt>
mov    %al,(%rbx)
jmp    1130 <convert_to_uppercase+0x10>
pop    %rbx
ret

LLVM IR (-O0):
define void @convert_to_uppercase(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %18, %1
%4 = load i8*, i8** %2
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %21
8: ; preds = %3
%9 = load i8*, i8** %2
%10 = load i8, i8* %9
%11 = call i64 @islower(i8 signext %10)
%12 = icmp ne i64 %11, 0
br i1 %12, label %13, label %18
13: ; preds = %8
%14 = load i8*, i8** %2
%15 = load i8, i8* %14
%16 = call signext i8 @toupper(i8 zeroext %15)
%17 = load i8*, i8** %2
store i8 %16, i8* %17
br label %18
18: ; preds = %13, %8
%19 = load i8*, i8** %2
%20 = getelementptr inbounds i8, i8* %19, i32 1
store i8* %20, i8** %2
br label %3
21: ; preds = %3
ret void
}

LLVM IR (-O2):
define void @convert_to_uppercase(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %16, label %4
4: ; preds = %1, %12
%5 = phi i8 [ %14, %12 ], [ %2, %1 ]
%6 = phi i8* [ %13, %12 ], [ %0, %1 ]
%7 = tail call i64 @islower(i8 signext %5)
%8 = icmp eq i64 %7, 0
br i1 %8, label %12, label %9
9: ; preds = %4
%10 = load i8, i8* %6
%11 = tail call signext i8 @toupper(i8 zeroext %10)
store i8 %11, i8* %6
br label %12
12: ; preds = %9, %4
%13 = getelementptr inbounds i8, i8* %6, i64 1
%14 = load i8, i8* %13
%15 = icmp eq i8 %14, 0
br i1 %15, label %16, label %4
16: ; preds = %12, %1
ret void
}
void rop3_16_1_1(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  stk2 = *D | S;
  stk2 = ~stk2;
  stk1 = T & stk2;
  *D = (stk1 & (~S) & (~T)) | (*D & S) | (*D & T);
}


x86 assembly (clang, -O0):
<rop3_16_1_1>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
movzbl -0x9(%rbp),%ecx
or     %ecx,%eax
mov    %al,-0xc(%rbp)
movzbl -0xc(%rbp),%eax
xor    $0xffffffff,%eax
mov    %al,-0xc(%rbp)
movzbl -0xa(%rbp),%eax
movzbl -0xc(%rbp),%ecx
and    %ecx,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
movzbl -0x9(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
movzbl -0xa(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
movzbl -0x9(%rbp),%edx
and    %edx,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
movzbl -0xa(%rbp),%edx
and    %edx,%ecx
or     %ecx,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rop3_16_1_1>:
or     %edx,%esi
and    %sil,(%rdi)
ret

LLVM IR (-O0):
define void @rop3_16_1_1(i8* %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
store i8* %0, i8** %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%9 = load i8*, i8** %4
%10 = load i8, i8* %9
%11 = zext i8 %10 to i32
%12 = load i8, i8* %5
%13 = zext i8 %12 to i32
%14 = or i32 %11, %13
%15 = trunc i32 %14 to i8
store i8 %15, i8* %8
%16 = load i8, i8* %8
%17 = zext i8 %16 to i32
%18 = xor i32 %17, -1
%19 = trunc i32 %18 to i8
store i8 %19, i8* %8
%20 = load i8, i8* %6
%21 = zext i8 %20 to i32
%22 = load i8, i8* %8
%23 = zext i8 %22 to i32
%24 = and i32 %21, %23
%25 = trunc i32 %24 to i8
store i8 %25, i8* %7
%26 = load i8, i8* %7
%27 = zext i8 %26 to i32
%28 = load i8, i8* %5
%29 = zext i8 %28 to i32
%30 = xor i32 %29, -1
%31 = and i32 %27, %30
%32 = load i8, i8* %6
%33 = zext i8 %32 to i32
%34 = xor i32 %33, -1
%35 = and i32 %31, %34
%36 = load i8*, i8** %4
%37 = load i8, i8* %36
%38 = zext i8 %37 to i32
%39 = load i8, i8* %5
%40 = zext i8 %39 to i32
%41 = and i32 %38, %40
%42 = or i32 %35, %41
%43 = load i8*, i8** %4
%44 = load i8, i8* %43
%45 = zext i8 %44 to i32
%46 = load i8, i8* %6
%47 = zext i8 %46 to i32
%48 = and i32 %45, %47
%49 = or i32 %42, %48
%50 = trunc i32 %49 to i8
%51 = load i8*, i8** %4
store i8 %50, i8* %51
ret void
}

LLVM IR (-O2):
define void @rop3_16_1_1(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = load i8, i8* %0
%5 = or i8 %2, %1
%6 = and i8 %4, %5
store i8 %6, i8* %0
ret void
}
/* Variables and functions */
int _ada_use_c2phc(int, int *, int *, double *);
int initialize_quaddobl_solution(int k) {
  int fail, *b;
  double *c;
  fail = _ada_use_c2phc(505, &k, b, c);
  return fail;
}


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

x86 assembly (clang, -O2):
<initialize_quaddobl_solution>:
push   %rax
mov    %edi,0x4(%rsp)
lea    0x4(%rsp),%rsi
mov    $0x1f9,%edi
call   1030 <_ada_use_c2phc@plt>
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @initialize_quaddobl_solution(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @_ada_use_c2phc(i32 505, i32* %2, i32* undef, double* undef)
ret i32 %3
}
/* Type definitions */
struct timespec {
  scalar_t__ tv_nsec;
  scalar_t__ tv_sec;
};

/* Variables and functions */
float tp_to_sec(struct timespec *tp) {
  float result = (float)(tp->tv_sec);
  result += (float)(tp->tv_nsec) * 1E-9f;
  return result;
}


x86 assembly (clang, -O0):
<tp_to_sec>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cvtsi2ssq 0x8(%rax),%xmm0
movss  %xmm0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
cvtsi2ssq (%rax),%xmm0
movss  -0xc(%rbp),%xmm1
movss  0xed3(%rip),%xmm2
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<tp_to_sec>:
cvtsi2ssq 0x8(%rdi),%xmm1
cvtsi2ssq (%rdi),%xmm0
mulss  0xeed(%rip),%xmm0
addss  %xmm1,%xmm0
ret

LLVM IR (-O0):
%struct.timespec = type { i64, i64 }
define float @tp_to_sec(%struct.timespec* %0) {
%2 = alloca %struct.timespec*
%3 = alloca float
store %struct.timespec* %0, %struct.timespec** %2
%4 = load %struct.timespec*, %struct.timespec** %2
%5 = getelementptr inbounds %struct.timespec, %struct.timespec* %4, i32 0, i32 1
%6 = load i64, i64* %5
%7 = sitofp i64 %6 to float
store float %7, float* %3
%8 = load %struct.timespec*, %struct.timespec** %2
%9 = getelementptr inbounds %struct.timespec, %struct.timespec* %8, i32 0, i32 0
%10 = load i64, i64* %9
%11 = sitofp i64 %10 to float
%12 = load float, float* %3
%13 = call float @llvm.fmuladd.f32(float %11, float 0x3E112E0BE0000000, float %12)
store float %13, float* %3
%14 = load float, float* %3
ret float %14
}

LLVM IR (-O2):
%struct.timespec = type { i64, i64 }
define float @tp_to_sec(%struct.timespec* nocapture %0) {
%2 = getelementptr inbounds %struct.timespec, %struct.timespec* %0, i64 0, i32 1
%3 = load i64, i64* %2
%4 = sitofp i64 %3 to float
%5 = getelementptr inbounds %struct.timespec, %struct.timespec* %0, i64 0, i32 0
%6 = load i64, i64* %5
%7 = sitofp i64 %6 to float
%8 = tail call float @llvm.fmuladd.f32(float %7, float 0x3E112E0BE0000000, float %4)
ret float %8
}
int foo(unsigned long long aLL) {
  switch (aLL) {
  case 1000000000000000000ULL ... 9999999999999999999ULL:
    return 19;
  default:
    return 20;
  };
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    1121 <foo+0x21>
movl   $0x13,-0x4(%rbp)
jmp    114c <foo+0x4c>
mov    -0x18(%rbp),%rax
movabs $0xde0b6b3a7640000,%rcx
b6 e0 0d
sub    %rcx,%rax
movabs $0x7ce66c50e283ffff,%rcx
6c e6 7c
cmp    %rcx,%rax
jbe    1115 <foo+0x15>
movl   $0x14,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
movabs $0xf21f494c589c0000,%rax
49 1f f2
add    %rdi,%rax
movabs $0x7ce66c50e2840000,%rcx
6c e6 7c
cmp    %rcx,%rax
mov    $0x14,%eax
sbb    $0x0,%eax
ret

LLVM IR (-O0):
define i32 @foo(i64 %0) {
%2 = alloca i32
%3 = alloca i64
store i64 %0, i64* %3
%4 = load i64, i64* %3
switch i64 %4, label %6 [
]
5: ; preds = %6
store i32 19, i32* %2
br label %10
6: ; preds = %1
%7 = sub i64 %4, 1000000000000000000
%8 = icmp ule i64 %7, 8999999999999999999
br i1 %8, label %5, label %9
9: ; preds = %6
store i32 20, i32* %2
br label %10
10: ; preds = %9, %5
%11 = load i32, i32* %2
ret i32 %11
}

LLVM IR (-O2):
define i32 @foo(i64 %0) {
%2 = add i64 %0, -1000000000000000000
%3 = icmp ult i64 %2, 9000000000000000000
%4 = select i1 %3, i32 19, i32 20
ret i32 %4
}
/* Type definitions */
struct net_device {
  int dummy;
};

/* Variables and functions */
scalar_t__ netif_running(struct net_device *);
int /*<<< orphan*/ spider_net_open(struct net_device *);
int /*<<< orphan*/ spider_net_stop(struct net_device *);
int spider_net_ethtool_nway_reset(struct net_device *netdev) {
  if (netif_running(netdev)) {
    spider_net_stop(netdev);
    spider_net_open(netdev);
  }
  return 0;
}


x86 assembly (clang, -O0):
<spider_net_ethtool_nway_reset>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <netif_running@plt>
cmp    $0x0,%rax
je     1161 <spider_net_ethtool_nway_reset+0x31>
mov    -0x8(%rbp),%rdi
call   1040 <spider_net_stop@plt>
mov    -0x8(%rbp),%rdi
call   1030 <spider_net_open@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<spider_net_ethtool_nway_reset>:
push   %rbx
mov    %rdi,%rbx
call   1050 <netif_running@plt>
test   %rax,%rax
je     114e <spider_net_ethtool_nway_reset+0x1e>
mov    %rbx,%rdi
call   1040 <spider_net_stop@plt>
mov    %rbx,%rdi
call   1030 <spider_net_open@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.net_device = type { i32 }
define i32 @spider_net_ethtool_nway_reset(%struct.net_device* %0) {
%2 = alloca %struct.net_device*
store %struct.net_device* %0, %struct.net_device** %2
%3 = load %struct.net_device*, %struct.net_device** %2
%4 = call i64 @netif_running(%struct.net_device* %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %11
6: ; preds = %1
%7 = load %struct.net_device*, %struct.net_device** %2
%8 = call i32 @spider_net_stop(%struct.net_device* %7)
%9 = load %struct.net_device*, %struct.net_device** %2
%10 = call i32 @spider_net_open(%struct.net_device* %9)
br label %11
11: ; preds = %6, %1
ret i32 0
}

LLVM IR (-O2):
%struct.net_device = type { i32 }
define i32 @spider_net_ethtool_nway_reset(%struct.net_device* %0) {
%2 = tail call i64 @netif_running(%struct.net_device* %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %7, label %4
4: ; preds = %1
%5 = tail call i32 @spider_net_stop(%struct.net_device* %0)
%6 = tail call i32 @spider_net_open(%struct.net_device* %0)
br label %7
7: ; preds = %4, %1
ret i32 0
}
int compareDescendUL(const void *pKeyOld, const void *pKeyNew) {
  const unsigned long *ulOld = pKeyOld, *ulNew = pKeyNew;
  if ((*ulOld) < (*ulNew))
    return (1);
  if ((*ulOld) > (*ulNew))
    return (-1);
  return (0);
}


x86 assembly (clang, -O0):
<compareDescendUL>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rax
mov    (%rax),%rax
mov    -0x28(%rbp),%rcx
cmp    (%rcx),%rax
jae    113c <compareDescendUL+0x3c>
movl   $0x1,-0x4(%rbp)
jmp    1163 <compareDescendUL+0x63>
mov    -0x20(%rbp),%rax
mov    (%rax),%rax
mov    -0x28(%rbp),%rcx
cmp    (%rcx),%rax
jbe    115c <compareDescendUL+0x5c>
movl   $0xffffffff,-0x4(%rbp)
jmp    1163 <compareDescendUL+0x63>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<compareDescendUL>:
mov    (%rdi),%rax
mov    (%rsi),%rcx
xor    %edx,%edx
cmp    %rcx,%rax
seta   %dl
neg    %edx
cmp    %rcx,%rax
mov    $0x1,%eax
cmovae %edx,%eax
ret

LLVM IR (-O0):
define i32 @compareDescendUL(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64*
%7 = alloca i64*
store i8* %0, i8** %4
store i8* %1, i8** %5
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i64*
store i64* %9, i64** %6
%10 = load i8*, i8** %5
%11 = bitcast i8* %10 to i64*
store i64* %11, i64** %7
%12 = load i64*, i64** %6
%13 = load i64, i64* %12
%14 = load i64*, i64** %7
%15 = load i64, i64* %14
%16 = icmp ult i64 %13, %15
br i1 %16, label %17, label %18
17: ; preds = %2
store i32 1, i32* %3
br label %26
18: ; preds = %2
%19 = load i64*, i64** %6
%20 = load i64, i64* %19
%21 = load i64*, i64** %7
%22 = load i64, i64* %21
%23 = icmp ugt i64 %20, %22
br i1 %23, label %24, label %25
24: ; preds = %18
store i32 -1, i32* %3
br label %26
25: ; preds = %18
store i32 0, i32* %3
br label %26
26: ; preds = %25, %24, %17
%27 = load i32, i32* %3
ret i32 %27
}

LLVM IR (-O2):
define i32 @compareDescendUL(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i64*
%4 = bitcast i8* %1 to i64*
%5 = load i64, i64* %3
%6 = load i64, i64* %4
%7 = icmp ult i64 %5, %6
%8 = icmp ugt i64 %5, %6
%9 = sext i1 %8 to i32
%10 = select i1 %7, i32 1, i32 %9
ret i32 %10
}
long getMaxLong() { return ((unsigned long)-1) >> 1; }


x86 assembly (clang, -O0):
<getMaxLong>:
push   %rbp
mov    %rsp,%rbp
movabs $0x7fffffffffffffff,%rax
ff ff 7f
pop    %rbp
ret

x86 assembly (clang, -O2):
<getMaxLong>:
movabs $0x7fffffffffffffff,%rax
ff ff 7f
ret

LLVM IR (-O0):
define i64 @getMaxLong() {
ret i64 9223372036854775807
}

LLVM IR (-O2):
define i64 @getMaxLong() {
ret i64 9223372036854775807
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128i;

/* Variables and functions */
int /*<<< orphan*/ _mm_avg_epu8(int /*<<< orphan*/, int /*<<< orphan*/);
__m128i test_mm_avg_epu8(__m128i A, __m128i B) { return _mm_avg_epu8(A, B); }


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

x86 assembly (clang, -O2):
<test_mm_avg_epu8>:
jmp    1030 <_mm_avg_epu8@plt>

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

LLVM IR (-O2):
define i32 @test_mm_avg_epu8(i32 %0, i32 %1) {
%3 = tail call i32 @_mm_avg_epu8(i32 %0, i32 %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, char *);
int main(int argc, char **argv) {
  for (int i = 0; i < argc; i++) {
    printf("argv[%d]: %s\n", i, argv[i]);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1162 <main+0x52>
mov    -0x14(%rbp),%esi
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdx
lea    0xeb1(%rip),%rdi
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    112d <main+0x1d>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

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

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


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

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

LLVM IR (-O0):
define i32 @num_processors() {
%1 = call i32 (...) @get_nprocs()
ret i32 %1
}

LLVM IR (-O2):
define i32 @num_processors() {
%1 = tail call i32 (...) @get_nprocs()
ret i32 %1
}
int Byteregtodwordreg(int bytereg) {
  if (bytereg < 0 || bytereg >= 8)
    return (-1);
  if (bytereg >= 4)
    return bytereg - 4;
  return bytereg;
}


x86 assembly (clang, -O0):
<Byteregtodwordreg>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jl     111b <Byteregtodwordreg+0x1b>
cmpl   $0x8,-0x8(%rbp)
jl     1127 <Byteregtodwordreg+0x27>
movl   $0xffffffff,-0x4(%rbp)
jmp    1145 <Byteregtodwordreg+0x45>
cmpl   $0x4,-0x8(%rbp)
jl     113f <Byteregtodwordreg+0x3f>
mov    -0x8(%rbp),%eax
sub    $0x4,%eax
mov    %eax,-0x4(%rbp)
jmp    1145 <Byteregtodwordreg+0x45>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Byteregtodwordreg>:
lea    -0x4(%rdi),%ecx
cmp    $0x4,%edi
cmovl  %edi,%ecx
cmp    $0x8,%edi
mov    $0xffffffff,%eax
cmovb  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @Byteregtodwordreg(i32 %0) {
%2 = icmp ugt i32 %0, 7
%3 = icmp sgt i32 %0, 3
%4 = add nsw i32 %0, -4
%5 = select i1 %3, i32 %4, i32 %0
%6 = select i1 %2, i32 -1, i32 %5
ret i32 %6
}
int _read(int fd, char *buf, int len) { return 0; }


x86 assembly (clang, -O0):
<_read>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @_read(i32 %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
store i32 %0, i32* %4
store i8* %1, i8** %5
store i32 %2, i32* %6
ret i32 0
}

LLVM IR (-O2):
define i32 @_read(i32 %0, i8* nocapture readnone %1, i32 %2) {
ret i32 0
}
int ByteWidth(long value) {
  if (value <= 0xFF)
    return 1;
  if (value <= 0xFFFF)
    return 2;
  return 4;
}


x86 assembly (clang, -O0):
<ByteWidth>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
cmpq   $0xff,-0x10(%rbp)
jg     1122 <ByteWidth+0x22>
movl   $0x1,-0x4(%rbp)
jmp    1143 <ByteWidth+0x43>
cmpq   $0xffff,-0x10(%rbp)
jg     113c <ByteWidth+0x3c>
movl   $0x2,-0x4(%rbp)
jmp    1143 <ByteWidth+0x43>
movl   $0x4,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ByteWidth>:
xor    %eax,%eax
cmp    $0x10000,%rdi
setge  %al
cmp    $0x100,%rdi
lea    0x2(%rax,%rax,1),%ecx
mov    $0x1,%eax
cmovge %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @ByteWidth(i64 %0) {
%2 = icmp slt i64 %0, 256
%3 = icmp slt i64 %0, 65536
%4 = select i1 %3, i32 2, i32 4
%5 = select i1 %2, i32 1, i32 %4
ret i32 %5
}
/* Variables and functions */
void main() {
  int x = 42;
  int y = x / 0;
  char *p;
  *p = 0;
  int *k = NULL;
  int q = *k;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x2a,-0x4(%rbp)
mov    -0x4(%rbp),%eax
xor    %ecx,%ecx
cltd
idiv   %ecx
mov    %eax,-0x8(%rbp)
mov    -0x10(%rbp),%rax
movb   $0x0,(%rax)
movq   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x1c(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
LLVM IR (-O0):
define void @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i32*
%5 = alloca i32
store i32 42, i32* %1
%6 = load i32, i32* %1
%7 = sdiv i32 %6, 0
store i32 %7, i32* %2
%8 = load i8*, i8** %3
store i8 0, i8* %8
store i32* null, i32** %4
%9 = load i32*, i32** %4
%10 = load i32, i32* %9
store i32 %10, i32* %5
ret void
}

LLVM IR (-O2):
int first(char *x) {
  asm("first_label: .globl first_label");
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @first(i8* nocapture readnone %0) {
tail call void asm sideeffect "first_label: .globl first_label", "~{dirflag},~{fpsr},~{flags}"()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ gsc_styled_string(int /*<<< orphan*/, char const *);
void gsc_normal_string(const char *message) { gsc_styled_string((0), message); }


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

x86 assembly (clang, -O2):
<gsc_normal_string>:
mov    %rdi,%rsi
xor    %edi,%edi
jmp    1030 <gsc_styled_string@plt>

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

LLVM IR (-O2):
define void @gsc_normal_string(i8* %0) {
%2 = tail call i32 @gsc_styled_string(i32 0, i8* %0)
ret void
}
/* Type definitions */
struct task {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct task *);
void task_free(struct task *t) { free(t); }


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

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

LLVM IR (-O0):
%struct.task = type { i32 }
define void @task_free(%struct.task* %0) {
%2 = alloca %struct.task*
store %struct.task* %0, %struct.task** %2
%3 = load %struct.task*, %struct.task** %2
%4 = call i32 @free(%struct.task* %3)
ret void
}

LLVM IR (-O2):
%struct.task = type { i32 }
define void @task_free(%struct.task* nocapture %0) {
%2 = tail call i32 @free(%struct.task* %0)
ret void
}
/* Variables and functions */
int THAtomicAdd(int volatile *, int);
int THAtomicDecrementRef(int volatile *a) { return (THAtomicAdd(a, -1) == 1); }


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

x86 assembly (clang, -O2):
<THAtomicDecrementRef>:
push   %rax
mov    $0xffffffff,%esi
call   1030 <THAtomicAdd@plt>
xor    %ecx,%ecx
cmp    $0x1,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @THAtomicDecrementRef(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @THAtomicAdd(i32* %3, i32 -1)
%5 = icmp eq i32 %4, 1
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @THAtomicDecrementRef(i32* %0) {
%2 = tail call i32 @THAtomicAdd(i32* %0, i32 -1)
%3 = icmp eq i32 %2, 1
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int myfunction(int, int);
int main() {
  int a = myfunction(2, 3);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x2,%edi
mov    $0x3,%esi
call   1030 <myfunction@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @myfunction(i32 2, i32 3)
store i32 %3, i32* %2
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @myfunction(i32 2, i32 3)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printc(int /*<<< orphan*/);
void prints(char *s) {
  while (*s)
    printc(*s++);
}


x86 assembly (clang, -O0):
<prints>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1145 <prints+0x35>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%edi
call   1030 <printc@plt>
jmp    111c <prints+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<prints>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1133 <prints+0x23>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movsbl %al,%edi
call   1030 <printc@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <prints+0x10>
pop    %rbx
ret

LLVM IR (-O0):
define void @prints(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %7, %1
%4 = load i8*, i8** %2
%5 = load i8, i8* %4
%6 = icmp ne i8 %5, 0
br i1 %6, label %7, label %13
7: ; preds = %3
%8 = load i8*, i8** %2
%9 = getelementptr inbounds i8, i8* %8, i32 1
store i8* %9, i8** %2
%10 = load i8, i8* %8
%11 = sext i8 %10 to i32
%12 = call i32 @printc(i32 %11)
br label %3
13: ; preds = %3
ret void
}

LLVM IR (-O2):
define void @prints(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %12, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %10, %4 ], [ %2, %1 ]
%6 = phi i8* [ %7, %4 ], [ %0, %1 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = sext i8 %5 to i32
%9 = tail call i32 @printc(i32 %8)
%10 = load i8, i8* %7
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %4
12: ; preds = %4, %1
ret void
}
int resize_thin_subvol(struct mosaic *m, struct volume *v,
                       unsigned long size_in_blocks, int resize_flags) {
  return -1;
}


x86 assembly (clang, -O0):
<resize_thin_subvol>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    $0xffffffff,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.mosaic = type opaque
%struct.volume = type opaque
define i32 @resize_thin_subvol(%struct.mosaic* %0, %struct.volume* %1, i64 %2, i32 %3) {
%5 = alloca %struct.mosaic*
%6 = alloca %struct.volume*
%7 = alloca i64
%8 = alloca i32
store %struct.mosaic* %0, %struct.mosaic** %5
store %struct.volume* %1, %struct.volume** %6
store i64 %2, i64* %7
store i32 %3, i32* %8
ret i32 -1
}

LLVM IR (-O2):
%struct.mosaic = type opaque
%struct.volume = type opaque
define i32 @resize_thin_subvol(%struct.mosaic* nocapture readnone %0, %struct.volume* nocapture readnone %1, i64 %2, i32 %3) {
ret i32 -1
}
/* Variables and functions */
int bgetw();
int /*<<< orphan*/ brseek(int, long);
int brtell();
int CheckMarker() {
  static char RoutineName[] = "CheckMarker";
  int Length;
  int v1;
  Length = brtell();
  v1 = bgetw();
  if (v1 >= 0xffc0) {
    brseek(Length, 0L);
    return (v1 & 0xff);
  }
  brseek(Length, 0L);
  return (0);
}


x86 assembly (clang, -O0):
<CheckMarker>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <brtell@plt>
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1040 <bgetw@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0xffc0,-0xc(%rbp)
jl     1175 <CheckMarker+0x45>
mov    -0x8(%rbp),%edi
xor    %eax,%eax
mov    %eax,%esi
call   1050 <brseek@plt>
mov    -0xc(%rbp),%eax
and    $0xff,%eax
mov    %eax,-0x4(%rbp)
jmp    1188 <CheckMarker+0x58>
mov    -0x8(%rbp),%edi
xor    %eax,%eax
mov    %eax,%esi
call   1050 <brseek@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CheckMarker>:
push   %rbp
push   %r14
push   %rbx
xor    %r14d,%r14d
xor    %eax,%eax
call   1030 <brtell@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1040 <bgetw@plt>
mov    %eax,%ebp
mov    %ebx,%edi
xor    %esi,%esi
call   1050 <brseek@plt>
cmp    $0xffc0,%ebp
movzbl %bpl,%eax
cmovl  %r14d,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@CheckMarker.RoutineName = internal global [12 x i8] c"CheckMarker\00"
define i32 @CheckMarker() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = call i32 (...) @brtell()
store i32 %4, i32* %2
%5 = call i32 (...) @bgetw()
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = icmp sge i32 %6, 65472
br i1 %7, label %8, label %13
8: ; preds = %0
%9 = load i32, i32* %2
%10 = call i32 @brseek(i32 %9, i64 0)
%11 = load i32, i32* %3
%12 = and i32 %11, 255
store i32 %12, i32* %1
br label %16
13: ; preds = %0
%14 = load i32, i32* %2
%15 = call i32 @brseek(i32 %14, i64 0)
store i32 0, i32* %1
br label %16
16: ; preds = %13, %8
%17 = load i32, i32* %1
ret i32 %17
}

LLVM IR (-O2):
define i32 @CheckMarker() {
%1 = tail call i32 (...) @brtell()
%2 = tail call i32 (...) @bgetw()
%3 = icmp sgt i32 %2, 65471
%4 = tail call i32 @brseek(i32 %1, i64 0)
%5 = and i32 %2, 255
%6 = select i1 %3, i32 %5, i32 0
ret i32 %6
}
/* Variables and functions */
int strcmp(char const *const, char const *const);
int mystrstrcmp(const void *vp1, const void *vp2) {
  const char *const *a = vp1;
  const char *const *b = vp2;
  return strcmp(*a, *b);
}


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

x86 assembly (clang, -O2):
<mystrstrcmp>:
mov    (%rdi),%rdi
mov    (%rsi),%rsi
jmp    1030 <strcmp@plt>

LLVM IR (-O0):
define i32 @mystrstrcmp(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8**
%6 = alloca i8**
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = bitcast i8* %7 to i8**
store i8** %8, i8*** %5
%9 = load i8*, i8** %4
%10 = bitcast i8* %9 to i8**
store i8** %10, i8*** %6
%11 = load i8**, i8*** %5
%12 = load i8*, i8** %11
%13 = load i8**, i8*** %6
%14 = load i8*, i8** %13
%15 = call i32 @strcmp(i8* %12, i8* %14)
ret i32 %15
}

LLVM IR (-O2):
define i32 @mystrstrcmp(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i8**
%4 = bitcast i8* %1 to i8**
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = tail call i32 @strcmp(i8* dereferenceable(1) %5, i8* dereferenceable(1) %6)
ret i32 %7
}
void INT_Excep_ICU_GROUP0(void) {}


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

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

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

LLVM IR (-O2):
define void @INT_Excep_ICU_GROUP0() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
int shutdown(int, int);
int sock_close(int fd) {
  int err;
  err = shutdown(fd, 2);
  if (!err)
    close(fd);
  return err;
}


x86 assembly (clang, -O0):
<sock_close>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x2,%esi
call   1030 <shutdown@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    114d <sock_close+0x2d>
mov    -0x4(%rbp),%edi
call   1040 <close@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sock_close>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
mov    $0x2,%esi
call   1030 <shutdown@plt>
mov    %eax,%ebp
test   %eax,%eax
jne    113c <sock_close+0x1c>
mov    %ebx,%edi
call   1040 <close@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @sock_close(i32 %0) {
%2 = tail call i32 @shutdown(i32 %0, i32 2)
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @close(i32 %0)
br label %6
6: ; preds = %4, %1
ret i32 %2
}
int gcd(int m, int n) {
  int r;
  while (n > 0) {
    r = m % n;
    m = n;
    n = r;
  }
  return m;
}


x86 assembly (clang, -O0):
<gcd>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jle    112f <gcd+0x2f>
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    110a <gcd+0xa>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<gcd>:
mov    %edi,%eax
test   %esi,%esi
jle    111d <gcd+0x1d>
mov    %esi,%edx
nopl   0x0(%rax,%rax,1)
mov    %edx,%ecx
cltd
idiv   %ecx
mov    %ecx,%eax
test   %edx,%edx
jg     1110 <gcd+0x10>
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @gcd(i32 %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %9
4: ; preds = %2, %4
%5 = phi i32 [ %6, %4 ], [ %0, %2 ]
%6 = phi i32 [ %7, %4 ], [ %1, %2 ]
%7 = srem i32 %5, %6
%8 = icmp sgt i32 %7, 0
br i1 %8, label %4, label %9
9: ; preds = %4, %2
%10 = phi i32 [ %0, %2 ], [ %6, %4 ]
ret i32 %10
}
/* Type definitions */
struct lldp_port {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ txInitializeLLDP(struct lldp_port *);
void tx_do_tx_lldp_initialize(struct lldp_port *lldp_port) {
  txInitializeLLDP(lldp_port);
}


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

x86 assembly (clang, -O2):
<tx_do_tx_lldp_initialize>:
jmp    1030 <txInitializeLLDP@plt>

LLVM IR (-O0):
%struct.lldp_port = type { i32 }
define void @tx_do_tx_lldp_initialize(%struct.lldp_port* %0) {
%2 = alloca %struct.lldp_port*
store %struct.lldp_port* %0, %struct.lldp_port** %2
%3 = load %struct.lldp_port*, %struct.lldp_port** %2
%4 = call i32 @txInitializeLLDP(%struct.lldp_port* %3)
ret void
}

LLVM IR (-O2):
%struct.lldp_port = type { i32 }
define void @tx_do_tx_lldp_initialize(%struct.lldp_port* %0) {
%2 = tail call i32 @txInitializeLLDP(%struct.lldp_port* %0)
ret void
}
void foo_2_1_2_1_1_1_1_2_1() {}


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

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

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

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