xunge/DecIR huggingface dataset:
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  unsigned short blue;
};
typedef TYPE_1__ XColor;

/* Variables and functions */
void set_XColor_blue(void *_p, unsigned short _v) {
  ((XColor *)_p)->blue = (unsigned short)_v;
}


x86 assembly (clang, -O0):
<set_XColor_blue>:
push   %rbp
mov    %rsp,%rbp
mov    %si,%ax
mov    %rdi,-0x8(%rbp)
mov    %ax,-0xa(%rbp)
mov    -0xa(%rbp),%cx
mov    -0x8(%rbp),%rax
mov    %cx,(%rax)
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.TYPE_2__ = type { i16 }
define void @set_XColor_blue(i8* %0, i16 zeroext %1) {
%3 = alloca i8*
%4 = alloca i16
store i8* %0, i8** %3
store i16 %1, i16* %4
%5 = load i16, i16* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to %struct.TYPE_2__*
%8 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %7, i32 0, i32 0
store i16 %5, i16* %8
ret void
}

LLVM IR (-O2):
define void @set_XColor_blue(i8* nocapture writeonly %0, i16 zeroext %1) {
%3 = bitcast i8* %0 to i16*
store i16 %1, i16* %3
ret void
}
/* Variables and functions */
int close(int);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ perror(char *);
void cerrarFifo(int fd) {
  if (close(fd) == -1) {
    perror("Error al cerrar fifo");
    exit(-1);
  }
}


x86 assembly (clang, -O0):
<cerrarFifo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <close@plt>
cmp    $0xffffffff,%eax
jne    1162 <cerrarFifo+0x32>
lea    0xead(%rip),%rdi
call   1040 <perror@plt>
mov    $0xffffffff,%edi
call   1050 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [21 x i8] c"Error al cerrar fifo\00"
define void @cerrarFifo(i32 %0) {
%2 = tail call i32 @close(i32 %0)
%3 = icmp eq i32 %2, -1
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = tail call i32 @perror(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%6 = tail call i32 @exit(i32 -1)
unreachable
7: ; preds = %1
ret void
}
int i(int x, float y) { return 0; }


x86 assembly (clang, -O0):
<i>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movss  %xmm0,-0x8(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @i(i32 %0, float %1) {
%3 = alloca i32
%4 = alloca float
store i32 %0, i32* %3
store float %1, float* %4
ret i32 0
}

LLVM IR (-O2):
define i32 @i(i32 %0, float %1) {
ret i32 0
}
/* Variables and functions */
int bbm_read(void *, unsigned short, unsigned char *);
int fc8080_bb_read(void *handle, unsigned short addr, unsigned char *data) {
  int res;
  res = bbm_read(handle, addr, data);
  return res;
}


x86 assembly (clang, -O0):
<fc8080_bb_read>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %si,%ax
mov    %rdi,-0x8(%rbp)
mov    %ax,-0xa(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xa(%rbp),%ax
mov    -0x18(%rbp),%rdx
movzwl %ax,%esi
call   1030 <bbm_read@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fc8080_bb_read>:
jmp    1030 <bbm_read@plt>

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

LLVM IR (-O2):
define i32 @fc8080_bb_read(i8* %0, i16 zeroext %1, i8* %2) {
%4 = tail call i32 @bbm_read(i8* %0, i16 zeroext %1, i8* %2)
ret i32 %4
}
const char *vde_chain_nm7_name_in(int i) {
  switch (i) {
  case 0:
    return "i0";
  case 1:
    return "i1";
  case 2:
    return "i2";
  case 3:
    return "i3";
  default:
    return 0;
  }
}


x86 assembly (clang, -O0):
<vde_chain_nm7_name_in>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %rax,-0x18(%rbp)
sub    $0x3,%rax
ja     116c <vde_chain_nm7_name_in+0x6c>
mov    -0x18(%rbp),%rax
lea    0xedd(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0xedd(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1174 <vde_chain_nm7_name_in+0x74>
lea    0xed0(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1174 <vde_chain_nm7_name_in+0x74>
lea    0xec3(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1174 <vde_chain_nm7_name_in+0x74>
lea    0xeb6(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1174 <vde_chain_nm7_name_in+0x74>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<vde_chain_nm7_name_in>:
cmp    $0x3,%edi
ja     1117 <vde_chain_nm7_name_in+0x17>
movslq %edi,%rax
lea    0xefd(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
@.str = [3 x i8] c"i0\00"
@.str.1 = [3 x i8] c"i1\00"
@.str.2 = [3 x i8] c"i2\00"
@.str.3 = [3 x i8] c"i3\00"
define i8* @vde_chain_nm7_name_in(i32 %0) {
%2 = alloca i8*
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %9 [
i32 0, label %5
i32 1, label %6
i32 2, label %7
i32 3, label %8
]
5: ; preds = %1
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8** %2
br label %10
6: ; preds = %1
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8** %2
br label %10
7: ; preds = %1
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8** %2
br label %10
8: ; preds = %1
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i8** %2
br label %10
9: ; preds = %1
store i8* null, i8** %2
br label %10
10: ; preds = %9, %8, %7, %6, %5
%11 = load i8*, i8** %2
ret i8* %11
}

LLVM IR (-O2):
@.str = [3 x i8] c"i0\00"
@.str.1 = [3 x i8] c"i1\00"
@.str.2 = [3 x i8] c"i2\00"
@.str.3 = [3 x i8] c"i3\00"
@reltable.vde_chain_nm7_name_in = [4 x i32] [i32 trunc (i64 sub (i64 ptrtoint ([3 x i8]* @.str to i64), i64 ptrtoint ([4 x i32]* @reltable.vde_chain_nm7_name_in to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([3 x i8]* @.str.1 to i64), i64 ptrtoint ([4 x i32]* @reltable.vde_chain_nm7_name_in to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([3 x i8]* @.str.2 to i64), i64 ptrtoint ([4 x i32]* @reltable.vde_chain_nm7_name_in to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([3 x i8]* @.str.3 to i64), i64 ptrtoint ([4 x i32]* @reltable.vde_chain_nm7_name_in to i64)) to i32)]
define i8* @vde_chain_nm7_name_in(i32 %0) {
%2 = icmp ult i32 %0, 4
br i1 %2, label %3, label %7
3: ; preds = %1
%4 = sext i32 %0 to i64
%5 = shl i64 %4, 2
%6 = call i8* @llvm.load.relative.i64(i8* bitcast ([4 x i32]* @reltable.vde_chain_nm7_name_in to i8*), i64 %5)
br label %7
7: ; preds = %1, %3
%8 = phi i8* [ %6, %3 ], [ null, %1 ]
ret i8* %8
}
int getMax(int a[3]) {
  int t = a[0], i;
  for (i = 0; i < 3; i++) {
    if (t < a[i])
      t = a[i];
  }
  return t;
}


x86 assembly (clang, -O0):
<getMax>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
cmpl   $0x3,-0x10(%rbp)
jge    1157 <getMax+0x57>
mov    -0xc(%rbp),%eax
mov    -0x8(%rbp),%rcx
movslq -0x10(%rbp),%rdx
cmp    (%rcx,%rdx,4),%eax
jge    1144 <getMax+0x44>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0xc(%rbp)
jmp    1149 <getMax+0x49>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1118 <getMax+0x18>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getMax>:
mov    (%rdi),%eax
mov    0x4(%rdi),%ecx
cmp    %ecx,%eax
cmovl  %ecx,%eax
mov    0x8(%rdi),%ecx
cmp    %ecx,%eax
cmovl  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @getMax(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = getelementptr inbounds i32, i32* %0, i64 1
%4 = load i32, i32* %3
%5 = icmp slt i32 %2, %4
%6 = select i1 %5, i32 %4, i32 %2
%7 = getelementptr inbounds i32, i32* %0, i64 2
%8 = load i32, i32* %7
%9 = icmp slt i32 %6, %8
%10 = select i1 %9, i32 %8, i32 %6
ret i32 %10
}
int strcomp(char *s1, char *s2, unsigned int size) {
  for (int i = 0; i < size; i++) {
    if (s1[i] != s2[i])
      return 0;
  }
  return 1;
}


x86 assembly (clang, -O0):
<strcomp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
movl   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jae    1161 <strcomp+0x61>
mov    -0x10(%rbp),%rax
movslq -0x20(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
mov    -0x18(%rbp),%rcx
movslq -0x20(%rbp),%rdx
movsbl (%rcx,%rdx,1),%ecx
cmp    %ecx,%eax
je     114e <strcomp+0x4e>
movl   $0x0,-0x4(%rbp)
jmp    1168 <strcomp+0x68>
jmp    1153 <strcomp+0x53>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    1116 <strcomp+0x16>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcomp>:
test   %edx,%edx
je     113e <strcomp+0x3e>
mov    (%rdi),%cl
xor    %eax,%eax
cmp    (%rsi),%cl
jne    113d <strcomp+0x3d>
mov    %edx,%r8d
mov    $0x1,%eax
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %rax,%rdx
cmp    %rax,%r8
je     1135 <strcomp+0x35>
movzbl (%rdi,%rdx,1),%ecx
lea    0x1(%rdx),%rax
cmp    (%rsi,%rdx,1),%cl
je     1120 <strcomp+0x20>
xor    %eax,%eax
cmp    %r8,%rdx
setae  %al
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @strcomp(i8* nocapture %0, i8* nocapture %1, i32 %2) {
%4 = icmp eq i32 %2, 0
br i1 %4, label %23, label %5
5: ; preds = %3
%6 = zext i32 %2 to i64
%7 = load i8, i8* %0
%8 = load i8, i8* %1
%9 = icmp eq i8 %7, %8
br i1 %9, label %10, label %23
10: ; preds = %5, %13
%11 = phi i64 [ %19, %13 ], [ 1, %5 ]
%12 = icmp eq i64 %11, %6
br i1 %12, label %20, label %13
13: ; preds = %10
%14 = getelementptr inbounds i8, i8* %0, i64 %11
%15 = load i8, i8* %14
%16 = getelementptr inbounds i8, i8* %1, i64 %11
%17 = load i8, i8* %16
%18 = icmp eq i8 %15, %17
%19 = add nuw nsw i64 %11, 1
br i1 %18, label %10, label %20
20: ; preds = %10, %13
%21 = icmp uge i64 %11, %6
%22 = zext i1 %21 to i32
br label %23
23: ; preds = %20, %5, %3
%24 = phi i32 [ 1, %3 ], [ 0, %5 ], [ %22, %20 ]
ret i32 %24
}
/* Variables and functions */
double modf(double, double *);
double Double_modf(double x, double *integer) { return modf(x, integer); }


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

x86 assembly (clang, -O2):
<Double_modf>:
jmp    1030 <modf@plt>

LLVM IR (-O0):
define double @Double_modf(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 = call double @modf(double %5, double* %6)
ret double %7
}

LLVM IR (-O2):
define double @Double_modf(double %0, double* nocapture %1) {
%3 = tail call double @modf(double %0, double* %1)
ret double %3
}
/* Variables and functions */
int getpary(int /*<<< orphan*/);
int /*<<< orphan*/ stdscr;
int t_getpary() { return getpary(stdscr); }


x86 assembly (clang, -O0):
<t_getpary>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ecd(%rip),%rax
mov    (%rax),%edi
call   1030 <getpary@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_getpary>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%edi
jmp    1030 <getpary@plt>

LLVM IR (-O0):
@stdscr = global i32 0
define i32 @t_getpary() {
%1 = load i32, i32* @stdscr
%2 = call i32 @getpary(i32 %1)
ret i32 %2
}

LLVM IR (-O2):
@stdscr = global i32 0
define i32 @t_getpary() {
%1 = load i32, i32* @stdscr
%2 = tail call i32 @getpary(i32 %1)
ret i32 %2
}
int FourtyTwo() { return 42; }


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

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

LLVM IR (-O0):
define i32 @FourtyTwo() {
ret i32 42
}

LLVM IR (-O2):
define i32 @FourtyTwo() {
ret i32 42
}
/* Variables and functions */
int /*<<< orphan*/ atan(double);
double errcheck(int /*<<< orphan*/, char *);
double Atan2(double *args) { return errcheck(atan(*args / *++args), "atan2"); }


x86 assembly (clang, -O0):
<Atan2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x8(%rbp)
divsd  0x8(%rax),%xmm0
call   1040 <atan@plt>
mov    %eax,%edi
lea    0xeaa(%rip),%rsi
call   1030 <errcheck@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Atan2>:
push   %rax
movsd  (%rdi),%xmm0
divsd  0x8(%rdi),%xmm0
call   1040 <atan@plt>
lea    0xeca(%rip),%rsi
mov    %eax,%edi
pop    %rax
jmp    1030 <errcheck@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"atan2\00"
define double @Atan2(double* %0) {
%2 = alloca double*
store double* %0, double** %2
%3 = load double*, double** %2
%4 = load double, double* %3
%5 = load double*, double** %2
%6 = getelementptr inbounds double, double* %5, i32 1
store double* %6, double** %2
%7 = load double, double* %6
%8 = fdiv double %4, %7
%9 = call i32 @atan(double %8)
%10 = call double @errcheck(i32 %9, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret double %10
}

LLVM IR (-O2):
@.str = [6 x i8] c"atan2\00"
define double @Atan2(double* nocapture %0) {
%2 = load double, double* %0
%3 = getelementptr inbounds double, double* %0, i64 1
%4 = load double, double* %3
%5 = fdiv double %2, %4
%6 = tail call i32 @atan(double %5)
%7 = tail call double @errcheck(i32 %6, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret double %7
}
/* Type definitions */
typedef int /*<<< orphan*/ uint;

/* Variables and functions */
int /*<<< orphan*/ _ultoa_internal(unsigned long, char *, int /*<<< orphan*/);
char *_ltoa_internal(long value, char *str, uint base) {
  char *ptr = str;
  int i = 0;
  if (value < 0) {
    ptr[i++] = '-';
    value = -value;
  }
  _ultoa_internal((unsigned long)value, str + i, base);
  return str;
}


x86 assembly (clang, -O0):
<_ltoa_internal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
movl   $0x0,-0x24(%rbp)
cmpq   $0x0,-0x8(%rbp)
jge    115d <_ltoa_internal+0x4d>
mov    -0x20(%rbp),%rax
mov    -0x24(%rbp),%ecx
mov    %ecx,%edx
add    $0x1,%edx
mov    %edx,-0x24(%rbp)
movslq %ecx,%rcx
movb   $0x2d,(%rax,%rcx,1)
xor    %eax,%eax
sub    -0x8(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
movslq -0x24(%rbp),%rax
add    %rax,%rsi
mov    -0x14(%rbp),%edx
call   1030 <_ultoa_internal@plt>
mov    -0x10(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_ltoa_internal>:
push   %rbx
mov    %rsi,%rbx
test   %rdi,%rdi
js     111d <_ltoa_internal+0xd>
xor    %esi,%esi
jmp    1128 <_ltoa_internal+0x18>
movb   $0x2d,(%rbx)
neg    %rdi
mov    $0x1,%esi
add    %rbx,%rsi
call   1030 <_ultoa_internal@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @_ltoa_internal(i64 %0, i8* returned %1, i32 %2) {
%4 = icmp slt i64 %0, 0
br i1 %4, label %5, label %7
5: ; preds = %3
store i8 45, i8* %1
%6 = sub nsw i64 0, %0
br label %7
7: ; preds = %5, %3
%8 = phi i64 [ %6, %5 ], [ %0, %3 ]
%9 = phi i64 [ 1, %5 ], [ 0, %3 ]
%10 = getelementptr inbounds i8, i8* %1, i64 %9
%11 = tail call i32 @_ultoa_internal(i64 %8, i8* %10, i32 %2)
ret i8* %1
}
int execute_ioprio_get() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @execute_ioprio_get() {
ret i32 0
}
void initArray(int x, double XYZ[3]) {
  if (x <= 0)
    return;
  XYZ[0] = 1;
  XYZ[1] = 1;
  XYZ[2] = 1;
}


x86 assembly (clang, -O0):
<initArray>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x0,-0x4(%rbp)
jg     111a <initArray+0x1a>
jmp    114c <initArray+0x4c>
mov    -0x10(%rbp),%rax
movsd  0xeda(%rip),%xmm0
movsd  %xmm0,(%rax)
mov    -0x10(%rbp),%rax
movsd  0xeca(%rip),%xmm0
movsd  %xmm0,0x8(%rax)
mov    -0x10(%rbp),%rax
movsd  0xeb9(%rip),%xmm0
movsd  %xmm0,0x10(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<initArray>:
test   %edi,%edi
jle    111c <initArray+0x1c>
movaps 0xef5(%rip),%xmm0
movups %xmm0,(%rsi)
movabs $0x3ff0000000000000,%rax
mov    %rax,0x10(%rsi)
ret

LLVM IR (-O0):
define void @initArray(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 = icmp sle i32 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %2
br label %15
8: ; preds = %2
%9 = load double*, double** %4
%10 = getelementptr inbounds double, double* %9, i64 0
store double 1.000000e+00, double* %10
%11 = load double*, double** %4
%12 = getelementptr inbounds double, double* %11, i64 1
store double 1.000000e+00, double* %12
%13 = load double*, double** %4
%14 = getelementptr inbounds double, double* %13, i64 2
store double 1.000000e+00, double* %14
br label %15
15: ; preds = %8, %7
ret void
}

LLVM IR (-O2):
define void @initArray(i32 %0, double* nocapture writeonly %1) {
%3 = icmp slt i32 %0, 1
br i1 %3, label %7, label %4
4: ; preds = %2
%5 = bitcast double* %1 to <2 x double>*
store <2 x double> <double 1.000000e+00, double 1.000000e+00>, <2 x double>* %5
%6 = getelementptr inbounds double, double* %1, i64 2
store double 1.000000e+00, double* %6
br label %7
7: ; preds = %2, %4
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_format_info_to_sample_spec_fake() {
  printf("NOT IMPLEMENTED:"
         "pa_format_info_to_sample_spec_fake"
         "\n");
}


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

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

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

LLVM IR (-O2):
@str = [51 x i8] c"NOT IMPLEMENTED:pa_format_info_to_sample_spec_fake\00"
define i32 @pa_format_info_to_sample_spec_fake() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([51 x i8], [51 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
scalar_t__ malloc(int);
int *allocate() {
  int *p = NULL;
  do {
    p = (int *)malloc(sizeof(int));
  } while (p == NULL);
  return p;
}


x86 assembly (clang, -O0):
<allocate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movq   $0x0,-0x8(%rbp)
mov    $0x4,%edi
call   1030 <malloc@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1120 <allocate+0x10>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<allocate>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    $0x4,%edi
call   1030 <malloc@plt>
test   %rax,%rax
je     1120 <allocate+0x10>
pop    %rcx
ret

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

LLVM IR (-O2):
define i32* @allocate() {
br label %1
1: ; preds = %1, %0
%2 = tail call i64 @malloc(i32 4)
%3 = icmp eq i64 %2, 0
br i1 %3, label %1, label %4
4: ; preds = %1
%5 = inttoptr i64 %2 to i32*
ret i32* %5
}
int foo(int i1, int i2, int i3, int i4, int i5, int i6, int i7) { return i7; }


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    0x10(%rbp),%eax
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8d,-0x14(%rbp)
mov    %r9d,-0x18(%rbp)
mov    0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
mov    0x8(%rsp),%eax
ret

LLVM IR (-O0):
define i32 @foo(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5, i32 %6) {
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
store i32 %0, i32* %8
store i32 %1, i32* %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store i32 %4, i32* %12
store i32 %5, i32* %13
store i32 %6, i32* %14
%15 = load i32, i32* %14
ret i32 %15
}

LLVM IR (-O2):
define i32 @foo(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5, i32 returned %6) {
ret i32 %6
}
void xfrm_state_lookup(void) { nsc_assert(0, __func__); }


x86 assembly (clang, -O0):
<xfrm_state_lookup>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
lea    0xee3(%rip),%rsi
mov    $0x0,%al
call   1030 <nsc_assert@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<xfrm_state_lookup>:
lea    0xee9(%rip),%rsi
xor    %edi,%edi
xor    %eax,%eax
jmp    1030 <nsc_assert@plt>

LLVM IR (-O0):
@__func__.xfrm_state_lookup = [18 x i8] c"xfrm_state_lookup\00"
define void @xfrm_state_lookup() {
%1 = call i32 (i32, i8*, ...) bitcast (i32 (...)* @nsc_assert to i32 (i32, i8*, ...)*)(i32 0, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @__func__.xfrm_state_lookup, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@__func__.xfrm_state_lookup = [18 x i8] c"xfrm_state_lookup\00"
define void @xfrm_state_lookup() {
%1 = tail call i32 (i32, i8*, ...) bitcast (i32 (...)* @nsc_assert to i32 (i32, i8*, ...)*)(i32 0, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @__func__.xfrm_state_lookup, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ expr();
int /*<<< orphan*/ get_lexval();
int yyselect();
parameters() {
  switch (yyselect()) {
  case 65: {
    expr();
  } break;
  case 66: {
    expr();
    get_lexval();
    parameters();
  } break;
  }
}


x86 assembly (clang, -O0):
<parameters>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xor    %eax,%eax
call   1030 <yyselect@plt>
mov    %eax,%ecx
mov    %ecx,-0x8(%rbp)
sub    $0x41,%eax
je     1173 <parameters+0x33>
jmp    1162 <parameters+0x22>
mov    -0x8(%rbp),%eax
sub    $0x42,%eax
je     117f <parameters+0x3f>
jmp    1192 <parameters+0x52>
mov    $0x0,%al
call   1060 <expr@plt>
jmp    1192 <parameters+0x52>
mov    $0x0,%al
call   1060 <expr@plt>
mov    $0x0,%al
call   1040 <get_lexval@plt>
call   1050 <parameters@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parameters>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <yyselect@plt>
cmp    $0x42,%eax
jne    115c <parameters+0x2c>
xor    %eax,%eax
call   1050 <expr@plt>
xor    %eax,%eax
call   1040 <get_lexval@plt>
jmp    1140 <parameters+0x10>
cmp    $0x41,%eax
jne    1168 <parameters+0x38>
xor    %eax,%eax
call   1050 <expr@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @parameters() {
%1 = alloca i32
%2 = call i32 (...) @yyselect()
switch i32 %2, label %9 [
i32 65, label %3
i32 66, label %5
]
3: ; preds = %0
%4 = call i32 (...) @expr()
br label %9
5: ; preds = %0
%6 = call i32 (...) @expr()
%7 = call i32 (...) @get_lexval()
%8 = call i32 @parameters()
br label %9
9: ; preds = %0, %5, %3
%10 = load i32, i32* %1
ret i32 %10
}

LLVM IR (-O2):
define i32 @parameters() {
br label %1
1: ; preds = %5, %0
%2 = tail call i32 (...) @yyselect()
switch i32 %2, label %8 [
i32 65, label %3
i32 66, label %5
]
3: ; preds = %1
%4 = tail call i32 (...) @expr()
br label %8
5: ; preds = %1
%6 = tail call i32 (...) @expr()
%7 = tail call i32 (...) @get_lexval()
br label %1
8: ; preds = %1, %3
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ test_htable();
int main() {
  test_htable();
  return 1;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <test_htable@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <test_htable@plt>
mov    $0x1,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @test_htable()
ret i32 1
}
void g_date_set_month() {}


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

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

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

LLVM IR (-O2):
define void @g_date_set_month() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ sigset_t;

/* Variables and functions */
int _NSIG;
int __rt_sigpending(int /*<<< orphan*/ *, int);
int sigpending(sigset_t *set) { return __rt_sigpending(set, _NSIG / 8); }


x86 assembly (clang, -O0):
<sigpending>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2ec9(%rip),%rax
mov    (%rax),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
mov    %eax,%esi
call   1030 <__rt_sigpending@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sigpending>:
mov    0x2ed9(%rip),%rax
mov    (%rax),%eax
lea    0x7(%rax),%esi
test   %eax,%eax
cmovns %eax,%esi
sar    $0x3,%esi
jmp    1030 <__rt_sigpending@plt>

LLVM IR (-O0):
@_NSIG = global i32 0
define i32 @sigpending(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* @_NSIG
%5 = sdiv i32 %4, 8
%6 = call i32 @__rt_sigpending(i32* %3, i32 %5)
ret i32 %6
}

LLVM IR (-O2):
@_NSIG = global i32 0
define i32 @sigpending(i32* %0) {
%2 = load i32, i32* @_NSIG
%3 = sdiv i32 %2, 8
%4 = tail call i32 @__rt_sigpending(i32* %0, i32 %3)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ getchar();
int /*<<< orphan*/ printf(char *, ...);
int main(void) {
  int a = 1, b = 1;
  int a_post, pre_b;
  a_post = a++;
  pre_b = ++b;
  printf("a a_post b pre_b\n");
  printf("%ld %5d %5d %5d \n", a, a_post, b, pre_b);
  getchar();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0x8(%rbp)
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    %eax,-0x14(%rbp)
lea    0xea2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0xc(%rbp),%ecx
mov    -0x14(%rbp),%r8d
lea    0xe99(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xeda(%rip),%rdi
call   1030 <puts@plt>
lea    0xebc(%rip),%rdi
mov    $0x2,%esi
mov    $0x1,%edx
mov    $0x2,%ecx
mov    $0x2,%r8d
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
call   1050 <getchar@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [18 x i8] c"a a_post b pre_b\0A\00"
@.str.1 = [18 x i8] c"%ld %5d %5d %5d \0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %1
store i32 1, i32* %2
store i32 1, i32* %3
%6 = load i32, i32* %2
%7 = add nsw i32 %6, 1
store i32 %7, i32* %2
store i32 %6, i32* %4
%8 = load i32, i32* %3
%9 = add nsw i32 %8, 1
store i32 %9, i32* %3
store i32 %9, i32* %5
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%11 = load i32, i32* %2
%12 = load i32, i32* %4
%13 = load i32, i32* %3
%14 = load i32, i32* %5
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i32 %11, i32 %12, i32 %13, i32 %14)
%16 = call i32 (...) @getchar()
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [18 x i8] c"%ld %5d %5d %5d \0A\00"
@str = [17 x i8] c"a a_post b pre_b\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i32 2, i32 1, i32 2, i32 2)
%3 = tail call i32 (...) @getchar()
ret i32 0
}
int baz(void *x) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @baz(i8* nocapture readnone %0) {
ret i32 0
}
int test_imm_05int16_reg(short val) {
  return ((val) & (-0x05 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_05int16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%edx
and    $0xfffffffb,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_05int16_reg>:
test   $0xfffb,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_05int16_reg(i16 signext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = sext i16 %3 to i32
%5 = and i32 %4, -5
%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_05int16_reg(i16 signext %0) {
%2 = and i16 %0, -5
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
int brk(int base) {
  long __res;
  __asm__ volatile("int $0x80" : "=a"(__res) : "0"(45), "b"((long)(base)));
  do {
    if ((unsigned long)(__res) >= (unsigned long)(-125)) {
      __res = -1;
    }
    return (int)(__res);
  } while (0);
}


x86 assembly (clang, -O0):
<brk>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
mov    %edi,-0xc(%rbp)
movslq -0xc(%rbp),%rbx
mov    $0x2d,%eax
int    $0x80
mov    %rax,-0x18(%rbp)
cmpq   $0xffffffffffffff83,-0x18(%rbp)
jb     112a <brk+0x2a>
movq   $0xffffffffffffffff,-0x18(%rbp)
ff
mov    -0x18(%rbp),%rax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<brk>:
push   %rbx
movslq %edi,%rbx
mov    $0x2d,%eax
int    $0x80
cmp    $0xffffffffffffff83,%rax
mov    $0xffffffff,%ecx
cmovae %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @brk(i32 %0) {
%2 = alloca i32
%3 = alloca i64
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = sext i32 %4 to i64
%6 = call i64 asm sideeffect "int $$0x80", "={ax},0,{bx},~{dirflag},~{fpsr},~{flags}"(i64 45, i64 %5)
store i64 %6, i64* %3
br label %7
7: ; preds = %1
%8 = load i64, i64* %3
%9 = icmp uge i64 %8, -125
br i1 %9, label %10, label %11
10: ; preds = %7
store i64 -1, i64* %3
br label %11
11: ; preds = %10, %7
%12 = load i64, i64* %3
%13 = trunc i64 %12 to i32
br label %14
14: ; preds = %11
ret i32 %13
}

LLVM IR (-O2):
define i32 @brk(i32 %0) {
%2 = sext i32 %0 to i64
%3 = tail call i64 asm sideeffect "int $$0x80", "={ax},0,{bx},~{dirflag},~{fpsr},~{flags}"(i64 45, i64 %2)
%4 = icmp ugt i64 %3, -126
%5 = trunc i64 %3 to i32
%6 = select i1 %4, i32 -1, i32 %5
ret i32 %6
}
void cleanup_before_uboot(void) {}


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

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

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

LLVM IR (-O2):
define void @cleanup_before_uboot() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ nop();
void never_loops_bad() {
  while (0) {
    nop();
  }
}


x86 assembly (clang, -O0):
<never_loops_bad>:
push   %rbp
mov    %rsp,%rbp
jmp    1119 <never_loops_bad+0x9>
xor    %eax,%eax
test   $0x1,%al
jne    1128 <never_loops_bad+0x18>
jmp    1134 <never_loops_bad+0x24>
mov    $0x0,%al
call   1030 <nop@plt>
jmp    1119 <never_loops_bad+0x9>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @never_loops_bad() {
br label %1
1: ; preds = %2, %0
br i1 false, label %2, label %4
2: ; preds = %1
%3 = call i32 (...) @nop()
br label %1
4: ; preds = %1
ret void
}

LLVM IR (-O2):
define void @never_loops_bad() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ s_catlen(char **, int *, char const *, int /*<<< orphan*/);
int /*<<< orphan*/ strlen(char const *);
void s_cat(char **pstr, int *plen, const char *s) {
  s_catlen(pstr, plen, s, strlen(s));
}


x86 assembly (clang, -O0):
<s_cat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x30(%rbp),%rdi
mov    -0x28(%rbp),%rsi
mov    -0x20(%rbp),%rdx
mov    %eax,%ecx
call   1040 <s_catlen@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<s_cat>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%rbx
mov    %rsi,%r14
mov    %rdi,%r15
mov    %rdx,%rdi
call   1030 <strlen@plt>
mov    %r15,%rdi
mov    %r14,%rsi
mov    %rbx,%rdx
mov    %eax,%ecx
pop    %rbx
pop    %r14
pop    %r15
jmp    1040 <s_catlen@plt>

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

LLVM IR (-O2):
define void @s_cat(i8** %0, i32* %1, i8* %2) {
%4 = tail call i32 @strlen(i8* %2)
%5 = tail call i32 @s_catlen(i8** %0, i32* %1, i8* %2, i32 %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(char *);
unsigned int logic_byte_is_negative(unsigned char to_compare, char *p_result) {
  assert(p_result);
  unsigned int err_code = 0;
  if (!p_result) {
    err_code = 2;
    goto end;
  }
  *p_result = (to_compare < 0);
end:
  return err_code;
}


x86 assembly (clang, -O0):
<logic_byte_is_negative>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <assert@plt>
movl   $0x0,-0x14(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1149 <logic_byte_is_negative+0x39>
movl   $0x2,-0x14(%rbp)
jmp    1160 <logic_byte_is_negative+0x50>
movzbl -0x1(%rbp),%eax
cmp    $0x0,%eax
setl   %al
and    $0x1,%al
movzbl %al,%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<logic_byte_is_negative>:
push   %rbx
mov    %rsi,%rbx
mov    %rsi,%rdi
call   1030 <assert@plt>
test   %rbx,%rbx
je     1128 <logic_byte_is_negative+0x18>
movb   $0x0,(%rbx)
xor    %eax,%eax
pop    %rbx
ret
mov    $0x2,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @logic_byte_is_negative(i8 zeroext %0, i8* %1) {
%3 = alloca i8
%4 = alloca i8*
%5 = alloca i32
store i8 %0, i8* %3
store i8* %1, i8** %4
%6 = load i8*, i8** %4
%7 = call i32 @assert(i8* %6)
store i32 0, i32* %5
%8 = load i8*, i8** %4
%9 = icmp ne i8* %8, null
br i1 %9, label %11, label %10
10: ; preds = %2
store i32 2, i32* %5
br label %18
11: ; preds = %2
%12 = load i8, i8* %3
%13 = zext i8 %12 to i32
%14 = icmp slt i32 %13, 0
%15 = zext i1 %14 to i32
%16 = trunc i32 %15 to i8
%17 = load i8*, i8** %4
store i8 %16, i8* %17
br label %18
18: ; preds = %11, %10
%19 = load i32, i32* %5
ret i32 %19
}

LLVM IR (-O2):
define i32 @logic_byte_is_negative(i8 zeroext %0, i8* %1) {
%3 = tail call i32 @assert(i8* %1)
%4 = icmp eq i8* %1, null
br i1 %4, label %6, label %5
5: ; preds = %2
store i8 0, i8* %1
br label %6
6: ; preds = %2, %5
%7 = phi i32 [ 0, %5 ], [ 2, %2 ]
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ opt_number(void *);
int optinvoked_n(int /*<<< orphan*/);
int optinvoked(void *v) { return optinvoked_n(opt_number(v)); }


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

x86 assembly (clang, -O2):
<optinvoked>:
push   %rax
call   1030 <opt_number@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <optinvoked_n@plt>

LLVM IR (-O0):
define i32 @optinvoked(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @opt_number(i8* %3)
%5 = call i32 @optinvoked_n(i32 %4)
ret i32 %5
}

LLVM IR (-O2):
define i32 @optinvoked(i8* %0) {
%2 = tail call i32 @opt_number(i8* %0)
%3 = tail call i32 @optinvoked_n(i32 %2)
ret i32 %3
}
void TEST_StopEnter() {
  printf("<<%s>> \r\n", __FUNCTION__);
  return;
}


x86 assembly (clang, -O0):
<TEST_StopEnter>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
lea    0xee8(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<TEST_StopEnter>:
lea    0xee9(%rip),%rdi
lea    0xeec(%rip),%rsi
xor    %eax,%eax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"<<%s>> \0D\0A\00"
@__FUNCTION__.TEST_StopEnter = [15 x i8] c"TEST_StopEnter\00"
define void @TEST_StopEnter() {
%1 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @__FUNCTION__.TEST_StopEnter, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"<<%s>> \0D\0A\00"
@__FUNCTION__.TEST_StopEnter = [15 x i8] c"TEST_StopEnter\00"
define void @TEST_StopEnter() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @__FUNCTION__.TEST_StopEnter, i64 0, i64 0))
ret void
}
double ddoublelog(double x, double r) {
  double d;
  d = x * x;
  return (r * ((2.0 * x) - (6.0 * d) + (4.0 * x * d)));
}


x86 assembly (clang, -O0):
<ddoublelog>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm2
movsd  0xed9(%rip),%xmm1
mulsd  -0x18(%rbp),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
addsd  %xmm2,%xmm2
addsd  %xmm1,%xmm2
movsd  0xea5(%rip),%xmm1
mulsd  -0x8(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm3
mulsd  %xmm3,%xmm1
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<ddoublelog>:
movapd %xmm0,%xmm2
mulsd  %xmm0,%xmm2
movsd  0xef0(%rip),%xmm3
mulsd  %xmm2,%xmm3
movapd %xmm0,%xmm4
addsd  %xmm0,%xmm4
mulsd  0xee4(%rip),%xmm0
addsd  %xmm3,%xmm4
mulsd  %xmm2,%xmm0
addsd  %xmm4,%xmm0
mulsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @ddoublelog(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
store double %0, double* %3
store double %1, double* %4
%6 = load double, double* %3
%7 = load double, double* %3
%8 = fmul double %6, %7
store double %8, double* %5
%9 = load double, double* %4
%10 = load double, double* %3
%11 = load double, double* %5
%12 = fmul double 6.000000e+00, %11
%13 = fneg double %12
%14 = call double @llvm.fmuladd.f64(double 2.000000e+00, double %10, double %13)
%15 = load double, double* %3
%16 = fmul double 4.000000e+00, %15
%17 = load double, double* %5
%18 = call double @llvm.fmuladd.f64(double %16, double %17, double %14)
%19 = fmul double %9, %18
ret double %19
}

LLVM IR (-O2):
define double @ddoublelog(double %0, double %1) {
%3 = fmul double %0, %0
%4 = fmul double %3, -6.000000e+00
%5 = tail call double @llvm.fmuladd.f64(double %0, double 2.000000e+00, double %4)
%6 = fmul double %0, 4.000000e+00
%7 = tail call double @llvm.fmuladd.f64(double %6, double %3, double %5)
%8 = fmul double %7, %1
ret double %8
}
int q_sortByR(const void *pp, const void *qp) {
  return (*(unsigned int *)pp & 0x00FF0000) -
         (*(unsigned int *)qp & 0x00FF0000);
}


x86 assembly (clang, -O0):
<q_sortByR>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
and    $0xff0000,%eax
mov    -0x10(%rbp),%rcx
mov    (%rcx),%ecx
and    $0xff0000,%ecx
sub    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<q_sortByR>:
movzbl 0x2(%rdi),%eax
shl    $0x10,%eax
movzbl 0x2(%rsi),%ecx
shl    $0x10,%ecx
sub    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @q_sortByR(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = and i32 %4, 16711680
%6 = bitcast i8* %1 to i32*
%7 = load i32, i32* %6
%8 = and i32 %7, 16711680
%9 = sub nsw i32 %5, %8
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ OS_TaskRegister();
void task_4(void) {
  OS_TaskRegister();
  while (1)
    ;
  return;
}


x86 assembly (clang, -O0):
<task_4>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <OS_TaskRegister@plt>
jmp    111b <task_4+0xb>

x86 assembly (clang, -O2):
<task_4>:
push   %rax
xor    %eax,%eax
call   1030 <OS_TaskRegister@plt>
nopl   0x0(%rax,%rax,1)
jmp    1120 <task_4+0x10>

LLVM IR (-O0):
define void @task_4() {
%1 = call i32 (...) @OS_TaskRegister()
br label %2
2: ; preds = %0, %2
br label %2
}

LLVM IR (-O2):
define void @task_4() {
%1 = tail call i32 (...) @OS_TaskRegister()
br label %2
2: ; preds = %0, %2
br label %2
}
/* Variables and functions */
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
int _basename_usage(void) {
  fputs("Usage: "
        "basename"
        " string [suffix]\n",
        stderr);
  return 1;
}


x86 assembly (clang, -O0):
<_basename_usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%esi
lea    0xedc(%rip),%rdi
call   1030 <fputs@plt>
mov    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_basename_usage>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%esi
lea    0xedf(%rip),%rdi
call   1030 <fputs@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [33 x i8] c"Usage: basename string [suffix]\0A\00"
@stderr = global i32 0
define i32 @_basename_usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fputs(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 1
}

LLVM IR (-O2):
@.str = [33 x i8] c"Usage: basename string [suffix]\0A\00"
@stderr = global i32 0
define i32 @_basename_usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fputs(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 1
}
/* Variables and functions */
int gethostname(char *, int);
int GetHN(char host[]) { return gethostname(host, 64); }


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

x86 assembly (clang, -O2):
<GetHN>:
mov    $0x40,%esi
jmp    1030 <gethostname@plt>

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

LLVM IR (-O2):
define i32 @GetHN(i8* %0) {
%2 = tail call i32 @gethostname(i8* %0, i32 64)
ret i32 %2
}