xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ SIG_DFL;
int /*<<< orphan*/ raise(int);
int /*<<< orphan*/ release_all_locks();
int /*<<< orphan*/ signal(int, int /*<<< orphan*/);
void sig_remove_from_list(int signo) {
  release_all_locks();
  signal(signo, SIG_DFL);
  raise(signo);
}


x86 assembly (clang, -O0):
<sig_remove_from_list>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1050 <release_all_locks@plt>
mov    -0x4(%rbp),%edi
mov    0x2e94(%rip),%rax
mov    (%rax),%esi
call   1040 <signal@plt>
mov    -0x4(%rbp),%edi
call   1030 <raise@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sig_remove_from_list>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1050 <release_all_locks@plt>
mov    0x2e9f(%rip),%rax
mov    (%rax),%esi
mov    %ebx,%edi
call   1040 <signal@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1030 <raise@plt>

LLVM IR (-O0):
@SIG_DFL = global i32 0
define void @sig_remove_from_list(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @release_all_locks()
%4 = load i32, i32* %2
%5 = load i32, i32* @SIG_DFL
%6 = call i32 @signal(i32 %4, i32 %5)
%7 = load i32, i32* %2
%8 = call i32 @raise(i32 %7)
ret void
}

LLVM IR (-O2):
@SIG_DFL = global i32 0
define void @sig_remove_from_list(i32 %0) {
%2 = tail call i32 (...) @release_all_locks()
%3 = load i32, i32* @SIG_DFL
%4 = tail call i32 @signal(i32 %0, i32 %3)
%5 = tail call i32 @raise(i32 %0)
ret void
}
/* Variables and functions */
double scs_tan_rz(double);
double tan_rz(double x) { return scs_tan_rz(x); }


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

x86 assembly (clang, -O2):
<tan_rz>:
jmp    1030 <scs_tan_rz@plt>

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

LLVM IR (-O2):
define double @tan_rz(double %0) {
%2 = tail call double @scs_tan_rz(double %0)
ret double %2
}
/* Type definitions */
typedef int u_int16_t;
typedef int u_char;

/* Variables and functions */
void put_u16(void *vp, u_int16_t v) {
  u_char *p = (u_char *)vp;
  p[0] = (u_char)(v >> 8) & 0xff;
  p[1] = (u_char)v & 0xff;
}


x86 assembly (clang, -O0):
<put_u16>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%ecx
sar    $0x8,%ecx
and    $0xff,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    -0xc(%rbp),%ecx
and    $0xff,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,0x4(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<put_u16>:
mov    %esi,%eax
movzbl %ah,%ecx
mov    %ecx,(%rdi)
movzbl %al,%eax
mov    %eax,0x4(%rdi)
ret

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

LLVM IR (-O2):
define void @put_u16(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
%4 = lshr i32 %1, 8
%5 = and i32 %4, 255
store i32 %5, i32* %3
%6 = and i32 %1, 255
%7 = getelementptr inbounds i8, i8* %0, i64 4
%8 = bitcast i8* %7 to i32*
store i32 %6, i32* %8
ret void
}
int test_imm_8Cuint64_highword_mem(unsigned long long *val) {
  return ((*val >> 32) & (0x8C << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_8Cuint64_highword_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdx
shr    $0x20,%rdx
and    $0x8c,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_8Cuint64_highword_mem>:
testb  $0x8c,0x4(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_8Cuint64_highword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 601295421440
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ fexpect(char *, int, int, int);
void t1() {
  int a = 61;
  int *b = &a;
  fexpect("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
          "2022-01-22/02-19-57/repos/8l/8cc/refs/heads/master/test/input/8cc/"
          "pointer.c",
          8, 61, *b);
  ;
}


x86 assembly (clang, -O0):
<t1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x3d,-0x4(%rbp)
lea    -0x4(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
lea    0xecc(%rip),%rdi
mov    $0x8,%esi
mov    $0x3d,%edx
call   1030 <fexpect@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<t1>:
lea    0xee9(%rip),%rdi
mov    $0x8,%esi
mov    $0x3d,%edx
mov    $0x3d,%ecx
jmp    1030 <fexpect@plt>

LLVM IR (-O0):
@.str = [140 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/8l/8cc/refs/heads/master/test/input/8cc/pointer.c\00"
define void @t1() {
%1 = alloca i32
%2 = alloca i32*
store i32 61, i32* %1
store i32* %1, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* %3
%5 = call i32 @fexpect(i8* getelementptr inbounds ([140 x i8], [140 x i8]* @.str, i64 0, i64 0), i32 8, i32 61, i32 %4)
ret void
}

LLVM IR (-O2):
@.str = [140 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/8l/8cc/refs/heads/master/test/input/8cc/pointer.c\00"
define void @t1() {
%1 = tail call i32 @fexpect(i8* getelementptr inbounds ([140 x i8], [140 x i8]* @.str, i64 0, i64 0), i32 8, i32 61, i32 61)
ret void
}
/* Type definitions */
typedef scalar_t__ uint8_t;
typedef int uint16_t;
typedef int /*<<< orphan*/ p;

/* Variables and functions */
uint16_t compat_le16dec(const void *pp) {
  const uint8_t *p = (uint8_t const *)pp;
  return ((uint16_t)(p[0]) + ((uint16_t)(p[1]) << 8));
}


x86 assembly (clang, -O0):
<compat_le16dec>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    -0x10(%rbp),%rcx
mov    0x8(%rcx),%rcx
shl    $0x8,%ecx
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<compat_le16dec>:
mov    0x8(%rdi),%eax
shl    $0x8,%eax
add    (%rdi),%eax
ret

LLVM IR (-O0):
define i32 @compat_le16dec(i8* %0) {
%2 = alloca i8*
%3 = alloca i64*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = bitcast i8* %4 to i64*
store i64* %5, i64** %3
%6 = load i64*, i64** %3
%7 = getelementptr inbounds i64, i64* %6, i64 0
%8 = load i64, i64* %7
%9 = trunc i64 %8 to i32
%10 = load i64*, i64** %3
%11 = getelementptr inbounds i64, i64* %10, i64 1
%12 = load i64, i64* %11
%13 = trunc i64 %12 to i32
%14 = shl i32 %13, 8
%15 = add nsw i32 %9, %14
ret i32 %15
}

LLVM IR (-O2):
define i32 @compat_le16dec(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
%5 = getelementptr inbounds i8, i8* %0, i64 8
%6 = bitcast i8* %5 to i64*
%7 = load i64, i64* %6
%8 = trunc i64 %7 to i32
%9 = shl i32 %8, 8
%10 = add nsw i32 %9, %4
ret i32 %10
}
void fv(void) {}


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

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

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

LLVM IR (-O2):
define void @fv() {
ret void
}
const char *dummyaudio_VolumeGetString(void) { return "disabled"; }


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

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

LLVM IR (-O0):
@.str = [9 x i8] c"disabled\00"
define i8* @dummyaudio_VolumeGetString() {
ret i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [9 x i8] c"disabled\00"
define i8* @dummyaudio_VolumeGetString() {
ret i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int countSetBitsMethod1(int);
int /*<<< orphan*/ printf(char *, int, int);
int main() {
  int i = 5;
  printf("Number of 1s in %d are %d", i, countSetBitsMethod1(i));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x5,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
call   1040 <countSetBitsMethod1@plt>
mov    -0xc(%rbp),%esi
mov    %eax,%edx
lea    0xeb0(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x5,%edi
call   1040 <countSetBitsMethod1@plt>
lea    0xece(%rip),%rdi
mov    $0x5,%esi
mov    %eax,%edx
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [26 x i8] c"Number of 1s in %d are %d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 5, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @countSetBitsMethod1(i32 %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 %3, i32 %5)
ret i32 0
}

LLVM IR (-O2):
@.str = [26 x i8] c"Number of 1s in %d are %d\00"
define i32 @main() {
%1 = tail call i32 @countSetBitsMethod1(i32 5)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 5, i32 %1)
ret i32 0
}
int retder(int *liste) {
  int i = 0, j;
  while (liste[i] != 0)
    i++;
  j = *(liste + i - 1);
  *(liste + i - 1) = 0;
  return j;
}


x86 assembly (clang, -O0):
<retder>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
cmpl   $0x0,(%rax,%rcx,4)
je     112f <retder+0x2f>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <retder+0xf>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    -0x4(%rax,%rcx,4),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movl   $0x0,-0x4(%rax,%rcx,4)
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<retder>:
mov    $0xffffffffffffffff,%rax
nopw   0x0(%rax,%rax,1)
cmpl   $0x0,0x4(%rdi,%rax,4)
lea    0x1(%rax),%rax
jne    1110 <retder+0x10>
mov    %eax,%ecx
mov    -0x4(%rdi,%rcx,4),%eax
movl   $0x0,-0x4(%rdi,%rcx,4)
ret

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

LLVM IR (-O2):
define i32 @retder(i32* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ %7, %2 ], [ 0, %1 ]
%4 = getelementptr inbounds i32, i32* %0, i64 %3
%5 = load i32, i32* %4
%6 = icmp eq i32 %5, 0
%7 = add nuw i64 %3, 1
br i1 %6, label %8, label %2
8: ; preds = %2
%9 = and i64 %3, 4294967295
%10 = getelementptr inbounds i32, i32* %0, i64 %9
%11 = getelementptr inbounds i32, i32* %10, i64 -1
%12 = load i32, i32* %11
store i32 0, i32* %11
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ err(int, int /*<<< orphan*/ *);
char *strdup(char const *);
char *sort_strdup(const char *str) {
  char *dup;
  if ((dup = strdup(str)) == NULL)
    err(2, NULL);
  return (dup);
}


x86 assembly (clang, -O0):
<sort_strdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strdup@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
jne    1151 <sort_strdup+0x31>
mov    $0x2,%edi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <err@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sort_strdup>:
push   %rbx
call   1040 <strdup@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    113a <sort_strdup+0x1a>
mov    $0x2,%edi
xor    %esi,%esi
call   1030 <err@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @sort_strdup(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i8* @strdup(i8* %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 @err(i32 2, i32* null)
br label %9
9: ; preds = %7, %1
%10 = load i8*, i8** %3
ret i8* %10
}

LLVM IR (-O2):
define noalias i8* @sort_strdup(i8* nocapture %0) {
%2 = tail call i8* @strdup(i8* %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @err(i32 2, i32* null)
br label %6
6: ; preds = %4, %1
ret i8* %2
}
/* Variables and functions */
scalar_t__ isspace(unsigned char);
__attribute__((nonnull(1))) const char *skipspaces(const char *s) {
  while (isspace((unsigned char)*s))
    s++;
  return s;
}


x86 assembly (clang, -O0):
<skipspaces>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%edi
call   1030 <isspace@plt>
cmp    $0x0,%rax
je     1143 <skipspaces+0x33>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    111c <skipspaces+0xc>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<skipspaces>:
push   %rbx
mov    %rdi,%rbx
add    $0xffffffffffffffff,%rbx
nopl   0x0(%rax,%rax,1)
movzbl 0x1(%rbx),%edi
add    $0x1,%rbx
call   1030 <isspace@plt>
test   %rax,%rax
jne    1120 <skipspaces+0x10>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @skipspaces(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %7, %2 ]
%4 = load i8, i8* %3
%5 = tail call i64 @isspace(i8 zeroext %4)
%6 = icmp eq i64 %5, 0
%7 = getelementptr inbounds i8, i8* %3, i64 1
br i1 %6, label %8, label %2
8: ; preds = %2
ret i8* %3
}
unsigned int getbits(unsigned int x, int p, int n) {
  return (x >> (p + 1 - n)) & ~(~0 << n);
}


x86 assembly (clang, -O0):
<getbits>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
add    $0x1,%ecx
sub    -0xc(%rbp),%ecx
shr    %cl,%eax
mov    -0xc(%rbp),%ecx
mov    $0xffffffff,%edx
shl    %cl,%edx
mov    %edx,%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getbits>:
sub    %edx,%esi
lea    0x1(%rsi),%ecx
shr    %cl,%edi
mov    $0xffffffff,%eax
mov    %edx,%ecx
shl    %cl,%eax
not    %eax
and    %edi,%eax
ret

LLVM IR (-O0):
define i32 @getbits(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load i32, i32* %5
%9 = add nsw i32 %8, 1
%10 = load i32, i32* %6
%11 = sub nsw i32 %9, %10
%12 = lshr i32 %7, %11
%13 = load i32, i32* %6
%14 = shl i32 -1, %13
%15 = xor i32 %14, -1
%16 = and i32 %12, %15
ret i32 %16
}

LLVM IR (-O2):
define i32 @getbits(i32 %0, i32 %1, i32 %2) {
%4 = add nsw i32 %1, 1
%5 = sub i32 %4, %2
%6 = lshr i32 %0, %5
%7 = shl nsw i32 -1, %2
%8 = xor i32 %7, -1
%9 = and i32 %6, %8
ret i32 %9
}
/* Variables and functions */
int noop(const void *l __attribute__((unused)),
         const void *r __attribute__((unused)),
         size_t length __attribute__((unused))) {
  return 0;
}


x86 assembly (clang, -O0):
<noop>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @noop(i8* nocapture readnone %0, i8* nocapture readnone %1, i64 %2) {
ret i32 0
}
/* Variables and functions */
double strcmp(char *, char *);
double tintoi(char *);
double tincmp(char *left, char *right) {
  switch (left[0]) {
  case '"':
    return strcmp(left, right);
  default:
    return tintoi(left) - tintoi(right);
  }
}


x86 assembly (clang, -O0):
<tincmp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%al
sub    $0x22,%al
jne    115a <tincmp+0x3a>
jmp    1143 <tincmp+0x23>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <strcmp@plt>
movsd  %xmm0,-0x8(%rbp)
jmp    1182 <tincmp+0x62>
mov    -0x10(%rbp),%rdi
call   1030 <tintoi@plt>
movsd  %xmm0,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <tintoi@plt>
movaps %xmm0,%xmm1
movsd  -0x20(%rbp),%xmm0
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tincmp>:
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%rbx
cmpb   $0x22,(%rdi)
jne    113a <tincmp+0x1a>
mov    %rbx,%rsi
add    $0x10,%rsp
pop    %rbx
jmp    1040 <strcmp@plt>
call   1030 <tintoi@plt>
movsd  %xmm0,0x8(%rsp)
mov    %rbx,%rdi
call   1030 <tintoi@plt>
movsd  0x8(%rsp),%xmm1
subsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define double @tincmp(i8* %0, i8* %1) {
%3 = alloca double
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
%6 = load i8*, i8** %4
%7 = getelementptr inbounds i8, i8* %6, i64 0
%8 = load i8, i8* %7
%9 = sext i8 %8 to i32
switch i32 %9, label %14 [
i32 34, label %10
]
10: ; preds = %2
%11 = load i8*, i8** %4
%12 = load i8*, i8** %5
%13 = call double @strcmp(i8* %11, i8* %12)
store double %13, double* %3
br label %20
14: ; preds = %2
%15 = load i8*, i8** %4
%16 = call double @tintoi(i8* %15)
%17 = load i8*, i8** %5
%18 = call double @tintoi(i8* %17)
%19 = fsub double %16, %18
store double %19, double* %3
br label %20
20: ; preds = %14, %10
%21 = load double, double* %3
ret double %21
}

LLVM IR (-O2):
define double @tincmp(i8* %0, i8* %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 34
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call double @strcmp(i8* %0, i8* %1)
br label %11
7: ; preds = %2
%8 = tail call double @tintoi(i8* %0)
%9 = tail call double @tintoi(i8* %1)
%10 = fsub double %8, %9
br label %11
11: ; preds = %7, %5
%12 = phi double [ %6, %5 ], [ %10, %7 ]
ret double %12
}
/* Variables and functions */
double rand01();
double sqrt(int);
double randtriangle(void) {
  double randnum = rand01();
  if (randnum > 0.5)
    return (1 - sqrt(2 * (randnum - 0.5)));
  else
    return (sqrt(2 * randnum) - 1);
}


x86 assembly (clang, -O0):
<randtriangle>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <rand01@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  0xebf(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    118a <randtriangle+0x6a>
movsd  -0x10(%rbp),%xmm1
movsd  0xea8(%rip),%xmm0
subsd  %xmm0,%xmm1
movsd  0xeac(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
call   1040 <sqrt@plt>
movaps %xmm0,%xmm1
movsd  0xe8c(%rip),%xmm0
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    11b1 <randtriangle+0x91>
movsd  0xe7e(%rip),%xmm0
mulsd  -0x10(%rbp),%xmm0
cvttsd2si %xmm0,%edi
call   1040 <sqrt@plt>
movsd  0xe60(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<randtriangle>:
push   %rax
xor    %eax,%eax
call   1030 <rand01@plt>
ucomisd 0xed0(%rip),%xmm0
jbe    1159 <randtriangle+0x39>
addsd  0xed6(%rip),%xmm0
addsd  %xmm0,%xmm0
cvttsd2si %xmm0,%edi
call   1040 <sqrt@plt>
movapd %xmm0,%xmm1
movsd  0xec5(%rip),%xmm0
subsd  %xmm1,%xmm0
pop    %rax
ret
addsd  %xmm0,%xmm0
cvttsd2si %xmm0,%edi
call   1040 <sqrt@plt>
addsd  0xe9a(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @randtriangle() {
%1 = alloca double
%2 = alloca double
%3 = call double (...) @rand01()
store double %3, double* %2
%4 = load double, double* %2
%5 = fcmp ogt double %4, 5.000000e-01
br i1 %5, label %6, label %13
6: ; preds = %0
%7 = load double, double* %2
%8 = fsub double %7, 5.000000e-01
%9 = fmul double 2.000000e+00, %8
%10 = fptosi double %9 to i32
%11 = call double @sqrt(i32 %10)
%12 = fsub double 1.000000e+00, %11
store double %12, double* %1
br label %19
13: ; preds = %0
%14 = load double, double* %2
%15 = fmul double 2.000000e+00, %14
%16 = fptosi double %15 to i32
%17 = call double @sqrt(i32 %16)
%18 = fsub double %17, 1.000000e+00
store double %18, double* %1
br label %19
19: ; preds = %13, %6
%20 = load double, double* %1
ret double %20
}

LLVM IR (-O2):
define double @randtriangle() {
%1 = tail call double (...) @rand01()
%2 = fcmp ogt double %1, 5.000000e-01
br i1 %2, label %3, label %9
3: ; preds = %0
%4 = fadd double %1, -5.000000e-01
%5 = fmul double %4, 2.000000e+00
%6 = fptosi double %5 to i32
%7 = tail call double @sqrt(i32 %6)
%8 = fsub double 1.000000e+00, %7
br label %14
9: ; preds = %0
%10 = fmul double %1, 2.000000e+00
%11 = fptosi double %10 to i32
%12 = tail call double @sqrt(i32 %11)
%13 = fadd double %12, -1.000000e+00
br label %14
14: ; preds = %9, %3
%15 = phi double [ %8, %3 ], [ %13, %9 ]
ret double %15
}
void inicializaArray(float data[]) {
  data[0] = 0.;
  data[1] = 0.;
  data[2] = 1.;
  data[3] = 0.;
  data[4] = 2.;
  data[5] = 0.;
  data[6] = 3.;
  data[7] = 0.;
}


x86 assembly (clang, -O0):
<inicializaArray>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
xorps  %xmm0,%xmm0
movss  %xmm0,(%rax)
mov    -0x8(%rbp),%rax
xorps  %xmm0,%xmm0
movss  %xmm0,0x4(%rax)
mov    -0x8(%rbp),%rax
movss  0xedd(%rip),%xmm0
movss  %xmm0,0x8(%rax)
mov    -0x8(%rbp),%rax
xorps  %xmm0,%xmm0
movss  %xmm0,0xc(%rax)
mov    -0x8(%rbp),%rax
movss  0xebc(%rip),%xmm0
movss  %xmm0,0x10(%rax)
mov    -0x8(%rbp),%rax
xorps  %xmm0,%xmm0
movss  %xmm0,0x14(%rax)
mov    -0x8(%rbp),%rax
movss  0xe9b(%rip),%xmm0
movss  %xmm0,0x18(%rax)
mov    -0x8(%rbp),%rax
xorps  %xmm0,%xmm0
movss  %xmm0,0x1c(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<inicializaArray>:
movaps 0xef9(%rip),%xmm0
movups %xmm0,(%rdi)
movaps 0xeff(%rip),%xmm0
movups %xmm0,0x10(%rdi)
ret

LLVM IR (-O0):
define void @inicializaArray(float* %0) {
%2 = alloca float*
store float* %0, float** %2
%3 = load float*, float** %2
%4 = getelementptr inbounds float, float* %3, i64 0
store float 0.000000e+00, float* %4
%5 = load float*, float** %2
%6 = getelementptr inbounds float, float* %5, i64 1
store float 0.000000e+00, float* %6
%7 = load float*, float** %2
%8 = getelementptr inbounds float, float* %7, i64 2
store float 1.000000e+00, float* %8
%9 = load float*, float** %2
%10 = getelementptr inbounds float, float* %9, i64 3
store float 0.000000e+00, float* %10
%11 = load float*, float** %2
%12 = getelementptr inbounds float, float* %11, i64 4
store float 2.000000e+00, float* %12
%13 = load float*, float** %2
%14 = getelementptr inbounds float, float* %13, i64 5
store float 0.000000e+00, float* %14
%15 = load float*, float** %2
%16 = getelementptr inbounds float, float* %15, i64 6
store float 3.000000e+00, float* %16
%17 = load float*, float** %2
%18 = getelementptr inbounds float, float* %17, i64 7
store float 0.000000e+00, float* %18
ret void
}

LLVM IR (-O2):
define void @inicializaArray(float* nocapture writeonly %0) {
%2 = bitcast float* %0 to <4 x float>*
store <4 x float> <float 0.000000e+00, float 0.000000e+00, float 1.000000e+00, float 0.000000e+00>, <4 x float>* %2
%3 = getelementptr inbounds float, float* %0, i64 4
%4 = bitcast float* %3 to <4 x float>*
store <4 x float> <float 2.000000e+00, float 0.000000e+00, float 3.000000e+00, float 0.000000e+00>, <4 x float>* %4
ret void
}
/* Variables and functions */
char *strchr(char *, char);
char *replace_strchr(char *str, char schr, char rchr) {
  char *ptr = strchr(str, schr);
  if (ptr) {
    *ptr = rchr;
  }
  return str;
}


x86 assembly (clang, -O0):
<replace_strchr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
mov    -0x8(%rbp),%rdi
movsbl -0x9(%rbp),%esi
call   1030 <strchr@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     114c <replace_strchr+0x3c>
mov    -0xa(%rbp),%cl
mov    -0x18(%rbp),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<replace_strchr>:
push   %rbp
push   %rbx
push   %rax
mov    %edx,%ebp
mov    %rdi,%rbx
call   1030 <strchr@plt>
test   %rax,%rax
je     1125 <replace_strchr+0x15>
mov    %bpl,(%rax)
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i8* @replace_strchr(i8* %0, i8 signext %1, i8 signext %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8*
store i8* %0, i8** %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%8 = load i8*, i8** %4
%9 = load i8, i8* %5
%10 = call i8* @strchr(i8* %8, i8 signext %9)
store i8* %10, i8** %7
%11 = load i8*, i8** %7
%12 = icmp ne i8* %11, null
br i1 %12, label %13, label %16
13: ; preds = %3
%14 = load i8, i8* %6
%15 = load i8*, i8** %7
store i8 %14, i8* %15
br label %16
16: ; preds = %13, %3
%17 = load i8*, i8** %4
ret i8* %17
}

LLVM IR (-O2):
define i8* @replace_strchr(i8* returned %0, i8 signext %1, i8 signext %2) {
%4 = tail call i8* @strchr(i8* dereferenceable(1) %0, i8 signext %1)
%5 = icmp eq i8* %4, null
br i1 %5, label %7, label %6
6: ; preds = %3
store i8 %2, i8* %4
br label %7
7: ; preds = %6, %3
ret i8* %0
}
int GetSizeFromModifierChar(char c) {
  int n = 1;
  switch (c) {
  case 'b':
  case 'B':
    n = 1;
    break;
  case 'k':
  case 'K':
    n = 1024;
    break;
  case 'm':
  case 'M':
    n = 1024 * 1024;
    break;
  case 'g':
  case 'G':
    n = 1024 * 1024 * 1024;
    break;
  default:
    n = 1;
    break;
  }
  return n;
}


x86 assembly (clang, -O0):
<GetSizeFromModifierChar>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movl   $0x1,-0x8(%rbp)
movsbl -0x1(%rbp),%eax
add    $0xffffffbe,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0x2b,%eax
ja     116b <GetSizeFromModifierChar+0x6b>
mov    -0x10(%rbp),%rax
lea    0xece(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movl   $0x1,-0x8(%rbp)
jmp    1172 <GetSizeFromModifierChar+0x72>
movl   $0x400,-0x8(%rbp)
jmp    1172 <GetSizeFromModifierChar+0x72>
movl   $0x100000,-0x8(%rbp)
jmp    1172 <GetSizeFromModifierChar+0x72>
movl   $0x40000000,-0x8(%rbp)
jmp    1172 <GetSizeFromModifierChar+0x72>
movl   $0x1,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<GetSizeFromModifierChar>:
mov    $0x1,%eax
add    $0xffffffb9,%edi
cmp    $0x26,%edi
ja     1148 <GetSizeFromModifierChar+0x48>
movabs $0x100000001,%rcx
bt     %rdi,%rcx
jb     1143 <GetSizeFromModifierChar+0x43>
movabs $0x1000000010,%rcx
bt     %rdi,%rcx
jb     1149 <GetSizeFromModifierChar+0x49>
movabs $0x4000000040,%rcx
bt     %rdi,%rcx
jae    1148 <GetSizeFromModifierChar+0x48>
mov    $0x100000,%eax
ret
mov    $0x40000000,%eax
ret
mov    $0x400,%eax
ret

LLVM IR (-O0):
define i32 @GetSizeFromModifierChar(i8 signext %0) {
%2 = alloca i8
%3 = alloca i32
store i8 %0, i8* %2
store i32 1, i32* %3
%4 = load i8, i8* %2
%5 = sext i8 %4 to i32
switch i32 %5, label %10 [
i32 98, label %6
i32 66, label %6
i32 107, label %7
i32 75, label %7
i32 109, label %8
i32 77, label %8
i32 103, label %9
i32 71, label %9
]
6: ; preds = %1, %1
store i32 1, i32* %3
br label %11
7: ; preds = %1, %1
store i32 1024, i32* %3
br label %11
8: ; preds = %1, %1
store i32 1048576, i32* %3
br label %11
9: ; preds = %1, %1
store i32 1073741824, i32* %3
br label %11
10: ; preds = %1
store i32 1, i32* %3
br label %11
11: ; preds = %10, %9, %8, %7, %6
%12 = load i32, i32* %3
ret i32 %12
}

LLVM IR (-O2):
define i32 @GetSizeFromModifierChar(i8 signext %0) {
%2 = sext i8 %0 to i32
switch i32 %2, label %6 [
i32 71, label %5
i32 103, label %5
i32 107, label %3
i32 75, label %3
i32 109, label %4
i32 77, label %4
]
3: ; preds = %1, %1
br label %6
4: ; preds = %1, %1
br label %6
5: ; preds = %1, %1
br label %6
6: ; preds = %1, %5, %4, %3
%7 = phi i32 [ 1073741824, %5 ], [ 1048576, %4 ], [ 1024, %3 ], [ 1, %1 ]
ret i32 %7
}
int __attribute__((visibility("default"))) func() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @func() {
ret i32 0
}
int test_imm_DFuint64_lowword_reg(unsigned long long val) {
  return ((val) & (0xDF << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_DFuint64_lowword_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
and    $0xdf,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_DFuint64_lowword_reg(i64 %0) {
%2 = and i64 %0, 223
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void amaret_local_A1_clear__E() { printf("Pin.clear\n"); }


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

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

LLVM IR (-O0):
@.str = [11 x i8] c"Pin.clear\0A\00"
define void @amaret_local_A1_clear__E() {
%1 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [10 x i8] c"Pin.clear\00"
define void @amaret_local_A1_clear__E() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @str, i64 0, i64 0))
ret void
}
long Long_bit_MINUS_or(long x, long y) { return x | y; }


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

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

LLVM IR (-O0):
define i64 @Long_bit_MINUS_or(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = load i64, i64* %4
%7 = or i64 %5, %6
ret i64 %7
}

LLVM IR (-O2):
define i64 @Long_bit_MINUS_or(i64 %0, i64 %1) {
%3 = or i64 %1, %0
ret i64 %3
}
void testfunc_00(const short *ap, short *bp) {
  bp[0] = ap[15];
  bp[2] = ap[5];
  bp[9] = ap[7];
  bp[0] = ap[25];
}


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    0x1e(%rax),%cx
mov    -0x10(%rbp),%rax
mov    %cx,(%rax)
mov    -0x8(%rbp),%rax
mov    0xa(%rax),%cx
mov    -0x10(%rbp),%rax
mov    %cx,0x4(%rax)
mov    -0x8(%rbp),%rax
mov    0xe(%rax),%cx
mov    -0x10(%rbp),%rax
mov    %cx,0x12(%rax)
mov    -0x8(%rbp),%rax
mov    0x32(%rax),%cx
mov    -0x10(%rbp),%rax
mov    %cx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
movzwl 0x1e(%rdi),%eax
mov    %ax,(%rsi)
movzwl 0xa(%rdi),%eax
mov    %ax,0x4(%rsi)
movzwl 0xe(%rdi),%eax
mov    %ax,0x12(%rsi)
movzwl 0x32(%rdi),%eax
mov    %ax,(%rsi)
ret

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

LLVM IR (-O2):
define void @testfunc_00(i16* nocapture %0, i16* nocapture writeonly %1) {
%3 = getelementptr inbounds i16, i16* %0, i64 15
%4 = load i16, i16* %3
store i16 %4, i16* %1
%5 = getelementptr inbounds i16, i16* %0, i64 5
%6 = load i16, i16* %5
%7 = getelementptr inbounds i16, i16* %1, i64 2
store i16 %6, i16* %7
%8 = getelementptr inbounds i16, i16* %0, i64 7
%9 = load i16, i16* %8
%10 = getelementptr inbounds i16, i16* %1, i64 9
store i16 %9, i16* %10
%11 = getelementptr inbounds i16, i16* %0, i64 25
%12 = load i16, i16* %11
store i16 %12, i16* %1
ret void
}
void abort(void) {
  while (1) {
  }
}


x86 assembly (clang, -O0):
<abort>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <abort+0x9>
jmp    1109 <abort+0x9>

x86 assembly (clang, -O2):
<abort>:
jmp    1100 <abort>

LLVM IR (-O0):
define void @abort() {
br label %1
1: ; preds = %0, %1
br label %1
}

LLVM IR (-O2):
define void @abort() {
br label %1
1: ; preds = %0, %1
br label %1
}
/* Variables and functions */
char *mu_badv_if_hwaddr(char *, int /*<<< orphan*/ *);
int /*<<< orphan*/ printf(char *, ...);
int main(void) {
  char *mac_addr = mu_badv_if_hwaddr("not_default", NULL);
  if (mac_addr) {
    printf("%s", mac_addr);
  } else {
    printf("ERROR");
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1040 <mu_badv_if_hwaddr@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1165 <main+0x45>
mov    -0x10(%rbp),%rsi
lea    0xeb3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1173 <main+0x53>
lea    0xea3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
xor    %esi,%esi
call   1040 <mu_badv_if_hwaddr@plt>
test   %rax,%rax
je     1147 <main+0x27>
lea    0xed1(%rip),%rdi
mov    %rax,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
jmp    1155 <main+0x35>
lea    0xec1(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [12 x i8] c"not_default\00"
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [6 x i8] c"ERROR\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
store i32 0, i32* %1
%3 = call i8* @mu_badv_if_hwaddr(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32* null)
store i8* %3, i8** %2
%4 = load i8*, i8** %2
%5 = icmp ne i8* %4, null
br i1 %5, label %6, label %9
6: ; preds = %0
%7 = load i8*, i8** %2
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %7)
br label %11
9: ; preds = %0
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
br label %11
11: ; preds = %9, %6
%12 = load i32, i32* %1
ret i32 %12
}

LLVM IR (-O2):
@.str = [12 x i8] c"not_default\00"
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [6 x i8] c"ERROR\00"
define i32 @main() {
%1 = tail call i8* @mu_badv_if_hwaddr(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32* null)
%2 = icmp eq i8* %1, null
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %1)
br label %7
5: ; preds = %0
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
br label %7
7: ; preds = %5, %3
ret i32 0
}
void ff_hevc_put_hevc_bi_pel_pixels24_12_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_bi_pel_pixels24_12_sse4() {
ret void
}
/* Variables and functions */
int strerror_r(int, char *, size_t);
int _mycpp_strerror_r(int errnum, char *buf, size_t buflen) {
  return strerror_r(errnum, buf, buflen);
}


x86 assembly (clang, -O0):
<_mycpp_strerror_r>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <strerror_r@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_mycpp_strerror_r>:
jmp    1030 <strerror_r@plt>

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

LLVM IR (-O2):
define i32 @_mycpp_strerror_r(i32 %0, i8* %1, i64 %2) {
%4 = tail call i32 @strerror_r(i32 %0, i8* %1, i64 %2)
ret i32 %4
}
/* Type definitions */
struct stat {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ stat(char *, struct stat *);
int FileExists(char *filename) {
  struct stat buf;
  return !stat(filename, &buf);
}


x86 assembly (clang, -O0):
<FileExists>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x10(%rbp),%rsi
call   1030 <stat@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.stat = type { i32 }
define i32 @FileExists(i8* %0) {
%2 = alloca i8*
%3 = alloca %struct.stat
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @stat(i8* %4, %struct.stat* %3)
%6 = icmp ne i32 %5, 0
%7 = xor i1 %6, true
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @FileExists(i8* nocapture %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i32 @stat(i8* %0, %struct.stat* %2)
%5 = icmp eq i32 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}
void *f3(int *i) {
  int a;
  return &a ?: i;
}


x86 assembly (clang, -O0):
<f3>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
lea    -0xc(%rbp),%rax
cmp    $0x0,%rax
je     1123 <f3+0x23>
lea    -0xc(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    112b <f3+0x2b>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f3>:
lea    -0x4(%rsp),%rax
ret

LLVM IR (-O0):
define i8* @f3(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
%4 = icmp ne i32* %3, null
br i1 %4, label %5, label %6
5: ; preds = %1
br label %8
6: ; preds = %1
%7 = load i32*, i32** %2
br label %8
8: ; preds = %6, %5
%9 = phi i32* [ %3, %5 ], [ %7, %6 ]
%10 = bitcast i32* %9 to i8*
ret i8* %10
}

LLVM IR (-O2):
define noalias i8* @f3(i32* nocapture readnone %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
ret i8* %3
}
void ERR_get_error_line_data(void) {}


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

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

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

LLVM IR (-O2):
define void @ERR_get_error_line_data() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
int main(int argc, char *argv[]) {
  puts("Hello world");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xed3(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [12 x i8] c"Hello world\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @puts(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [12 x i8] c"Hello world\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, float);
void __attribute__((no)) printNeg(float f) { printf("#%g", -f); }


x86 assembly (clang, -O0):
<printNeg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
lea    0xeca(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printNeg>:
xorps  0xee9(%rip),%xmm0
lea    0xef2(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"#%g\00"
define void @printNeg(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fneg float %3
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), float %4)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"#%g\00"
define void @printNeg(float %0) {
%2 = fneg float %0
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), float %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_SUCCESS;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ print_pending_sigs(int /*<<< orphan*/ *);
int /*<<< orphan*/ print_sigmask(int /*<<< orphan*/ *);
int /*<<< orphan*/ print_signals();
int main(int argc, char *argv[]) {
  print_signals();
  print_pending_sigs(NULL);
  print_sigmask(NULL);
  exit(EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <print_signals@plt>
xor    %eax,%eax
mov    %eax,%edi
call   1040 <print_pending_sigs@plt>
xor    %eax,%eax
mov    %eax,%edi
call   1060 <print_sigmask@plt>
mov    0x2e6a(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <print_signals@plt>
xor    %edi,%edi
call   1040 <print_pending_sigs@plt>
xor    %edi,%edi
call   1060 <print_sigmask@plt>
mov    0x2e83(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 (...) @print_signals()
%7 = call i32 @print_pending_sigs(i32* null)
%8 = call i32 @print_sigmask(i32* null)
%9 = load i32, i32* @EXIT_SUCCESS
%10 = call i32 @exit(i32 %9)
unreachable
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @print_signals()
%4 = tail call i32 @print_pending_sigs(i32* null)
%5 = tail call i32 @print_sigmask(i32* null)
%6 = load i32, i32* @EXIT_SUCCESS
%7 = tail call i32 @exit(i32 %6)
unreachable
}
/* Variables and functions */
int kth_element(int *, int /*<<< orphan*/, int, int);
int /*<<< orphan*/ printf(char *, int, int);
int main() {
  int a[10] = {2, 3, 4, 8, 1, 5, 6, 7, 0, 9};
  int k = 6;
  printf("the %dth min number is :%d\n", k, kth_element(a, 0, 9, k));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x30(%rbp),%rdi
lea    0xeb6(%rip),%rsi
mov    $0x28,%edx
call   1050 <memcpy@plt>
movl   $0x6,-0x34(%rbp)
mov    -0x34(%rbp),%eax
mov    %eax,-0x38(%rbp)
lea    -0x30(%rbp),%rdi
mov    -0x34(%rbp),%ecx
xor    %esi,%esi
mov    $0x9,%edx
call   1030 <kth_element@plt>
mov    -0x38(%rbp),%esi
mov    %eax,%edx
lea    0xea8(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
mov    0xef5(%rip),%rax
mov    %rax,0x20(%rsp)
movaps 0xed9(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xebd(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
xor    %esi,%esi
mov    $0x9,%edx
mov    $0x6,%ecx
call   1030 <kth_element@plt>
lea    0xec6(%rip),%rdi
mov    $0x6,%esi
mov    %eax,%edx
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
@__const.main.a = [10 x i32] [i32 2, i32 3, i32 4, i32 8, i32 1, i32 5, i32 6, i32 7, i32 0, i32 9]
@.str = [28 x i8] c"the %dth min number is :%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [10 x i32]
%3 = alloca i32
store i32 0, i32* %1
%4 = bitcast [10 x i32]* %2 to i8*
store i32 6, i32* %3
%5 = load i32, i32* %3
%6 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 0
%7 = load i32, i32* %3
%8 = call i32 @kth_element(i32* %6, i32 0, i32 9, i32 %7)
%9 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i32 %5, i32 %8)
ret i32 0
}

LLVM IR (-O2):
@__const.main.a = [10 x i32] [i32 2, i32 3, i32 4, i32 8, i32 1, i32 5, i32 6, i32 7, i32 0, i32 9]
@.str = [28 x i8] c"the %dth min number is :%d\0A\00"
define i32 @main() {
%1 = alloca [10 x i32]
%2 = bitcast [10 x i32]* %1 to i8*
%3 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
%4 = call i32 @kth_element(i32* %3, i32 0, i32 9, i32 6)
%5 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i32 6, i32 %4)
ret i32 0
}