xunge/DecIR huggingface dataset:
void ft_ultimate_div_mod(int *a, int *b) {
  int div;
  int mod;
  div = *a / *b;
  mod = *a % *b;
  *a = div;
  *b = mod;
}


x86 assembly (clang, -O0):
<ft_ultimate_div_mod>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    -0x10(%rbp),%rcx
cltd
idivl  (%rcx)
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    -0x10(%rbp),%rcx
cltd
idivl  (%rcx)
mov    %edx,-0x18(%rbp)
mov    -0x14(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x18(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_ultimate_div_mod>:
mov    (%rdi),%eax
cltd
idivl  (%rsi)
mov    %eax,(%rdi)
mov    %edx,(%rsi)
ret

LLVM IR (-O0):
define void @ft_ultimate_div_mod(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
store i32* %0, i32** %3
store i32* %1, i32** %4
%7 = load i32*, i32** %3
%8 = load i32, i32* %7
%9 = load i32*, i32** %4
%10 = load i32, i32* %9
%11 = sdiv i32 %8, %10
store i32 %11, i32* %5
%12 = load i32*, i32** %3
%13 = load i32, i32* %12
%14 = load i32*, i32** %4
%15 = load i32, i32* %14
%16 = srem i32 %13, %15
store i32 %16, i32* %6
%17 = load i32, i32* %5
%18 = load i32*, i32** %3
store i32 %17, i32* %18
%19 = load i32, i32* %6
%20 = load i32*, i32** %4
store i32 %19, i32* %20
ret void
}

LLVM IR (-O2):
define void @ft_ultimate_div_mod(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %0
%4 = load i32, i32* %1
%5 = sdiv i32 %3, %4
%6 = srem i32 %3, %4
store i32 %5, i32* %0
store i32 %6, i32* %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isdigit(int);
void t_isdigit_0x22() {
  Assert_real((isdigit(34) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isdigit.c",
              175, ("isdigit should be 0 for 0x22"));
}


x86 assembly (clang, -O0):
<t_isdigit_0x22>:
push   %rbp
mov    %rsp,%rbp
mov    $0x22,%edi
call   1030 <isdigit@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0xaf,%edx
lea    0xf5b(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isdigit_0x22>:
push   %rax
mov    $0x22,%edi
call   1030 <isdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0xaf,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isdigit.c\00"
@.str.1 = [29 x i8] c"isdigit should be 0 for 0x22\00"
define void @t_isdigit_0x22() {
%1 = call i64 @isdigit(i32 34)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 175, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isdigit.c\00"
@.str.1 = [29 x i8] c"isdigit should be 0 for 0x22\00"
define void @t_isdigit_0x22() {
%1 = tail call i64 @isdigit(i32 34)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 175, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ sigset_t;

/* Variables and functions */
int /*<<< orphan*/ SIG_BLOCK;
int _sigprocmask(int /*<<< orphan*/, int /*<<< orphan*/ *,
                 int /*<<< orphan*/ *);
int _sigsuspend(int /*<<< orphan*/ *);
int __pause(void) {
  sigset_t oset;
  if (_sigprocmask(SIG_BLOCK, NULL, &oset) == -1)
    return (-1);
  return (_sigsuspend(&oset));
}


x86 assembly (clang, -O0):
<__pause>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2eb1(%rip),%rax
mov    (%rax),%edi
xor    %eax,%eax
mov    %eax,%esi
lea    -0x8(%rbp),%rdx
call   1030 <_sigprocmask@plt>
cmp    $0xffffffff,%eax
jne    1153 <__pause+0x33>
movl   $0xffffffff,-0x4(%rbp)
jmp    115f <__pause+0x3f>
lea    -0x8(%rbp),%rdi
call   1040 <_sigsuspend@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__pause>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0x4(%rsp),%rdx
xor    %esi,%esi
call   1030 <_sigprocmask@plt>
cmp    $0xffffffff,%eax
je     1147 <__pause+0x27>
lea    0x4(%rsp),%rdi
call   1040 <_sigsuspend@plt>
pop    %rcx
ret
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@SIG_BLOCK = global i32 0
define i32 @__pause() {
%1 = alloca i32
%2 = alloca i32
%3 = load i32, i32* @SIG_BLOCK
%4 = call i32 @_sigprocmask(i32 %3, i32* null, i32* %2)
%5 = icmp eq i32 %4, -1
br i1 %5, label %6, label %7
6: ; preds = %0
store i32 -1, i32* %1
br label %9
7: ; preds = %0
%8 = call i32 @_sigsuspend(i32* %2)
store i32 %8, i32* %1
br label %9
9: ; preds = %7, %6
%10 = load i32, i32* %1
ret i32 %10
}

LLVM IR (-O2):
@SIG_BLOCK = global i32 0
define i32 @__pause() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = load i32, i32* @SIG_BLOCK
%4 = call i32 @_sigprocmask(i32 %3, i32* null, i32* %1)
%5 = icmp eq i32 %4, -1
br i1 %5, label %8, label %6
6: ; preds = %0
%7 = call i32 @_sigsuspend(i32* %1)
br label %8
8: ; preds = %0, %6
%9 = phi i32 [ %7, %6 ], [ -1, %0 ]
ret i32 %9
}
/* Variables and functions */
void *malloc(unsigned int);
void *av_malloc(unsigned int size) {
  void *ptr;
  ptr = malloc(size);
  return ptr;
}


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

x86 assembly (clang, -O2):
<av_malloc>:
jmp    1030 <malloc@plt>

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

LLVM IR (-O2):
define noalias i8* @av_malloc(i32 %0) {
%2 = tail call i8* @malloc(i32 %0)
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(void) {
  printf("_POSIX_CPUTIME unsupported\n");
  return 4;
}


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

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

LLVM IR (-O0):
@.str = [28 x i8] c"_POSIX_CPUTIME unsupported\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
ret i32 4
}

LLVM IR (-O2):
@str = [27 x i8] c"_POSIX_CPUTIME unsupported\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str, i64 0, i64 0))
ret i32 4
}
/* Type definitions */
struct cri_mutex {
  int dummy;
};

/* Variables and functions */
int ENOTSUP;
int cri_mutex_init(struct cri_mutex *mutex) { return -ENOTSUP; }


x86 assembly (clang, -O0):
<cri_mutex_init>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
xor    %eax,%eax
mov    0x2ed7(%rip),%rcx
sub    (%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cri_mutex_init>:
mov    0x2ee1(%rip),%rcx
xor    %eax,%eax
sub    (%rcx),%eax
ret

LLVM IR (-O0):
%struct.cri_mutex = type { i32 }
@ENOTSUP = global i32 0
define i32 @cri_mutex_init(%struct.cri_mutex* %0) {
%2 = alloca %struct.cri_mutex*
store %struct.cri_mutex* %0, %struct.cri_mutex** %2
%3 = load i32, i32* @ENOTSUP
%4 = sub nsw i32 0, %3
ret i32 %4
}

LLVM IR (-O2):
%struct.cri_mutex = type { i32 }
@ENOTSUP = global i32 0
define i32 @cri_mutex_init(%struct.cri_mutex* nocapture readnone %0) {
%2 = load i32, i32* @ENOTSUP
%3 = sub nsw i32 0, %2
ret i32 %3
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ y;
};
typedef TYPE_1__ XTimeCoord;

/* Variables and functions */
short get_XTimeCoord_y(void *_p) { return (short)((XTimeCoord *)_p)->y; }


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

x86 assembly (clang, -O2):
<get_XTimeCoord_y>:
movzwl (%rdi),%eax
ret

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

LLVM IR (-O2):
define signext i16 @get_XTimeCoord_y(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i16
ret i16 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ aes_ecb_encrypt(int /*<<< orphan*/ *, int /*<<< orphan*/,
                                   int /*<<< orphan*/ *);
void AES_ECB_EncryptData(uint8_t *text, uint16_t textLen, uint8_t *aesKey) {
  aes_ecb_encrypt(text, textLen, aesKey);
}


x86 assembly (clang, -O0):
<AES_ECB_EncryptData>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
call   1030 <aes_ecb_encrypt@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<AES_ECB_EncryptData>:
jmp    1030 <aes_ecb_encrypt@plt>

LLVM IR (-O0):
define void @AES_ECB_EncryptData(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 = load i32*, i32** %6
%10 = call i32 @aes_ecb_encrypt(i32* %7, i32 %8, i32* %9)
ret void
}

LLVM IR (-O2):
define void @AES_ECB_EncryptData(i32* %0, i32 %1, i32* %2) {
%4 = tail call i32 @aes_ecb_encrypt(i32* %0, i32 %1, i32* %2)
ret void
}
void endgrent(void) { ; }


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

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

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

LLVM IR (-O2):
define void @endgrent() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ argument_count(char *);
int /*<<< orphan*/ printf(char *, int);
int sum(int /*<<< orphan*/, int, int, int, int, int);
int main(void) {
  printf("Sum(1, 1, 1, 1, 1)"
         " = [%d]\n",
         (sum(argument_count("1, 1, 1, 1, 1"), 1, 1, 1, 1, 1)));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xed5(%rip),%rdi
call   1040 <argument_count@plt>
mov    %eax,%edi
mov    $0x1,%r9d
mov    %r9d,%esi
mov    %r9d,%edx
mov    %r9d,%ecx
mov    %r9d,%r8d
call   1050 <sum@plt>
mov    %eax,%esi
lea    0xe93(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee3(%rip),%rdi
call   1040 <argument_count@plt>
mov    %eax,%edi
mov    $0x1,%esi
mov    $0x1,%edx
mov    $0x1,%ecx
mov    $0x1,%r8d
mov    $0x1,%r9d
call   1050 <sum@plt>
lea    0xe9a(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [27 x i8] c"Sum(1, 1, 1, 1, 1) = [%d]\0A\00"
@.str.1 = [14 x i8] c"1, 1, 1, 1, 1\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @argument_count(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @sum(i32 %2, i32 1, i32 1, i32 1, i32 1, i32 1)
%4 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 0
}

LLVM IR (-O2):
@.str = [27 x i8] c"Sum(1, 1, 1, 1, 1) = [%d]\0A\00"
@.str.1 = [14 x i8] c"1, 1, 1, 1, 1\00"
define i32 @main() {
%1 = tail call i32 @argument_count(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @sum(i32 %1, i32 1, i32 1, i32 1, i32 1, i32 1)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 %2)
ret i32 0
}
double d2(double d) { return __builtin_fabs(d); }


x86 assembly (clang, -O0):
<d2>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movaps 0xeeb(%rip),%xmm1
pand   %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<d2>:
andps  0xef9(%rip),%xmm0
ret

LLVM IR (-O0):
define double @d2(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call double @llvm.fabs.f64(double %3)
ret double %4
}

LLVM IR (-O2):
define double @d2(double %0) {
%2 = tail call double @llvm.fabs.f64(double %0)
ret double %2
}
int main() {
  int a = 5;
  if (a-- == ++a) {
    return 5;
  } else {
    return -1;
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x5,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x8(%rbp)
mov    -0x8(%rbp),%ecx
add    $0x1,%ecx
mov    %ecx,-0x8(%rbp)
cmp    %ecx,%eax
jne    113a <main+0x3a>
movl   $0x5,-0x4(%rbp)
jmp    1141 <main+0x41>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
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 = add nsw i32 %3, -1
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = add nsw i32 %5, 1
store i32 %6, i32* %2
%7 = icmp eq i32 %3, %6
br i1 %7, label %8, label %9
8: ; preds = %0
store i32 5, i32* %1
br label %10
9: ; preds = %0
store i32 -1, i32* %1
br label %10
10: ; preds = %9, %8
%11 = load i32, i32* %1
ret i32 %11
}

LLVM IR (-O2):
define i32 @main() {
ret i32 5
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ exit(int);
scalar_t__ i2c_smbus_write_byte_data(int, unsigned char, unsigned char);
void bmp180_write(int fd, unsigned char address, unsigned char value) {
  if (i2c_smbus_write_byte_data(fd, address, value) < 0) {
    close(fd);
    exit(1);
  }
}


x86 assembly (clang, -O0):
<bmp180_write>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dl,%al
mov    %sil,%cl
mov    %edi,-0x4(%rbp)
mov    %cl,-0x5(%rbp)
mov    %al,-0x6(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x5(%rbp),%al
movzbl %al,%esi
movzbl -0x6(%rbp),%edx
call   1040 <i2c_smbus_write_byte_data@plt>
cmp    $0x0,%rax
jge    1174 <bmp180_write+0x44>
mov    -0x4(%rbp),%edi
call   1030 <close@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bmp180_write>:
push   %rbx
mov    %edi,%ebx
call   1040 <i2c_smbus_write_byte_data@plt>
test   %rax,%rax
js     113f <bmp180_write+0xf>
pop    %rbx
ret
mov    %ebx,%edi
call   1030 <close@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
define void @bmp180_write(i32 %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i32
%5 = alloca i8
%6 = alloca i8
store i32 %0, i32* %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%7 = load i32, i32* %4
%8 = load i8, i8* %5
%9 = load i8, i8* %6
%10 = call i64 @i2c_smbus_write_byte_data(i32 %7, i8 zeroext %8, i8 zeroext %9)
%11 = icmp slt i64 %10, 0
br i1 %11, label %12, label %16
12: ; preds = %3
%13 = load i32, i32* %4
%14 = call i32 @close(i32 %13)
%15 = call i32 @exit(i32 1)
unreachable
16: ; preds = %3
ret void
}

LLVM IR (-O2):
define void @bmp180_write(i32 %0, i8 zeroext %1, i8 zeroext %2) {
%4 = tail call i64 @i2c_smbus_write_byte_data(i32 %0, i8 zeroext %1, i8 zeroext %2)
%5 = icmp slt i64 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %3
%7 = tail call i32 @close(i32 %0)
%8 = tail call i32 @exit(i32 1)
unreachable
9: ; preds = %3
ret void
}
/* Variables and functions */
scalar_t__ alien_pointer();
int /*<<< orphan*/ box_alien(void *);
void primitive_alien_cell(void) { box_alien(*(void **)alien_pointer()); }


x86 assembly (clang, -O0):
<primitive_alien_cell>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <alien_pointer@plt>
mov    (%rax),%rdi
call   1030 <box_alien@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<primitive_alien_cell>:
push   %rax
xor    %eax,%eax
call   1040 <alien_pointer@plt>
mov    (%rax),%rdi
pop    %rax
jmp    1030 <box_alien@plt>

LLVM IR (-O0):
define void @primitive_alien_cell() {
%1 = call i64 (...) @alien_pointer()
%2 = inttoptr i64 %1 to i8**
%3 = load i8*, i8** %2
%4 = call i32 @box_alien(i8* %3)
ret void
}

LLVM IR (-O2):
define void @primitive_alien_cell() {
%1 = tail call i64 (...) @alien_pointer()
%2 = inttoptr i64 %1 to i8**
%3 = load i8*, i8** %2
%4 = tail call i32 @box_alien(i8* %3)
ret void
}
int IL_re_match(bufp, string, size, pos, regs)
struct re_pattern_buffer *bufp;
const char *string;
int size, pos;
struct re_registers *regs;
{
  int result;
  result = byte_re_match_2_internal(bufp, (void *)0, 0, string, size, pos, regs,
                                    size);
  return result;
}


x86 assembly (clang, -O0):
<IL_re_match>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    %r8,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rcx
mov    -0x14(%rbp),%r8d
mov    -0x18(%rbp),%r9d
mov    -0x20(%rbp),%r10
mov    -0x14(%rbp),%eax
xor    %edx,%edx
mov    %edx,%esi
xor    %edx,%edx
mov    %r10,(%rsp)
mov    %eax,0x8(%rsp)
mov    $0x0,%al
call   1030 <byte_re_match_2_internal@plt>
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<IL_re_match>:
push   %rax
mov    %r8,%r10
mov    %ecx,%r9d
mov    %edx,%r8d
mov    %rsi,%rcx
xor    %esi,%esi
xor    %edx,%edx
xor    %eax,%eax
push   %r8
push   %r10
call   1030 <byte_re_match_2_internal@plt>
add    $0x10,%rsp
pop    %rcx
ret

LLVM IR (-O0):
%struct.re_pattern_buffer = type opaque
%struct.re_registers = type opaque
define i32 @IL_re_match(%struct.re_pattern_buffer* %0, i8* %1, i32 %2, i32 %3, %struct.re_registers* %4) {
%6 = alloca %struct.re_pattern_buffer*
%7 = alloca i8*
%8 = alloca i32
%9 = alloca i32
%10 = alloca %struct.re_registers*
%11 = alloca i32
store %struct.re_pattern_buffer* %0, %struct.re_pattern_buffer** %6
store i8* %1, i8** %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store %struct.re_registers* %4, %struct.re_registers** %10
%12 = load %struct.re_pattern_buffer*, %struct.re_pattern_buffer** %6
%13 = load i8*, i8** %7
%14 = load i32, i32* %8
%15 = load i32, i32* %9
%16 = load %struct.re_registers*, %struct.re_registers** %10
%17 = load i32, i32* %8
%18 = call i32 (%struct.re_pattern_buffer*, i8*, i32, i8*, i32, i32, %struct.re_registers*, i32, ...) bitcast (i32 (...)* @byte_re_match_2_internal to i32 (%struct.re_pattern_buffer*, i8*, i32, i8*, i32, i32, %struct.re_registers*, i32, ...)*)(%struct.re_pattern_buffer* %12, i8* null, i32 0, i8* %13, i32 %14, i32 %15, %struct.re_registers* %16, i32 %17)
store i32 %18, i32* %11
%19 = load i32, i32* %11
ret i32 %19
}

LLVM IR (-O2):
%struct.re_pattern_buffer = type opaque
%struct.re_registers = type opaque
define i32 @IL_re_match(%struct.re_pattern_buffer* %0, i8* %1, i32 %2, i32 %3, %struct.re_registers* %4) {
%6 = tail call i32 (%struct.re_pattern_buffer*, i8*, i32, i8*, i32, i32, %struct.re_registers*, i32, ...) bitcast (i32 (...)* @byte_re_match_2_internal to i32 (%struct.re_pattern_buffer*, i8*, i32, i8*, i32, i32, %struct.re_registers*, i32, ...)*)(%struct.re_pattern_buffer* %0, i8* null, i32 0, i8* %1, i32 %2, i32 %3, %struct.re_registers* %4, i32 %2)
ret i32 %6
}
int f8(int j) {
  int x = 1, y = x + 1;
  if (y)
    return x;
  return y;
}


x86 assembly (clang, -O0):
<f8>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
je     112c <f8+0x2c>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1132 <f8+0x32>
mov    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @f8(i32 %0) {
ret i32 1
}
void pmem_drain_pm_stores_fit(void) {}


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

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

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

LLVM IR (-O2):
define void @pmem_drain_pm_stores_fit() {
ret void
}
signed long int long_max(signed long int a, signed long int b) {
  return a > b ? a : b;
}


x86 assembly (clang, -O0):
<long_max>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
jle    1127 <long_max+0x27>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    112f <long_max+0x2f>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<long_max>:
mov    %rsi,%rax
cmp    %rsi,%rdi
cmovg  %rdi,%rax
ret

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

LLVM IR (-O2):
define i64 @long_max(i64 %0, i64 %1) {
%3 = icmp sgt i64 %0, %1
%4 = select i1 %3, i64 %0, i64 %1
ret i64 %4
}
/* Variables and functions */
char *strchr(char const *, int);
char *index(const char *s, int c) { return strchr(s, c); }


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

x86 assembly (clang, -O2):
<index>:
jmp    1030 <strchr@plt>

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

LLVM IR (-O2):
define i8* @index(i8* %0, i32 %1) {
%3 = tail call i8* @strchr(i8* dereferenceable(1) %0, i32 %1)
ret i8* %3
}
int *foo() {
  int local_x = 42;
  int *retval = &local_x;
  return retval;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
movl   $0x2a,-0x4(%rbp)
lea    -0x4(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32* @foo() {
%1 = alloca i32
%2 = alloca i32*
store i32 42, i32* %1
store i32* %1, i32** %2
%3 = load i32*, i32** %2
ret i32* %3
}

LLVM IR (-O2):
define noalias i32* @foo() {
%1 = alloca i32
ret i32* %1
}
/* Variables and functions */
int /*<<< orphan*/ save_first_info_screen();
int osa_printf_log_null(char *subsystem, char *sourcefile, int line, int offset,
                        const char *message, ...) {
  save_first_info_screen();
  return 0;
}


x86 assembly (clang, -O0):
<osa_printf_log_null>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    %r8,-0x20(%rbp)
xor    %eax,%eax
mov    %eax,-0x24(%rbp)
call   1030 <save_first_info_screen@plt>
mov    -0x24(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<osa_printf_log_null>:
push   %rax
xor    %eax,%eax
call   1030 <save_first_info_screen@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @osa_printf_log_null(i8* %0, i8* %1, i32 %2, i32 %3, i8* %4, ...) {
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i32
%9 = alloca i32
%10 = alloca i8*
store i8* %0, i8** %6
store i8* %1, i8** %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i8* %4, i8** %10
%11 = call i32 (...) @save_first_info_screen()
ret i32 0
}

LLVM IR (-O2):
define i32 @osa_printf_log_null(i8* nocapture readnone %0, i8* nocapture readnone %1, i32 %2, i32 %3, i8* nocapture readnone %4, ...) {
%6 = tail call i32 (...) @save_first_info_screen()
ret i32 0
}
void dwc3_debugfs_init(struct dwc3 *d) {}


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

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

LLVM IR (-O0):
%struct.dwc3 = type opaque
define void @dwc3_debugfs_init(%struct.dwc3* %0) {
%2 = alloca %struct.dwc3*
store %struct.dwc3* %0, %struct.dwc3** %2
ret void
}

LLVM IR (-O2):
%struct.dwc3 = type opaque
define void @dwc3_debugfs_init(%struct.dwc3* nocapture %0) {
ret void
}
int test_imm_38int32_mem(int *val) {
  return ((*val) & (0x38 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_38int32_mem(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* %3
%5 = and i32 %4, 56
%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_38int32_mem(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = and i32 %2, 56
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
extern short short_to_short(short x, int k) { return x + k; }


x86 assembly (clang, -O0):
<short_to_short>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    %esi,-0x8(%rbp)
movswl -0x2(%rbp),%eax
add    -0x8(%rbp),%eax
cwtl
pop    %rbp
ret

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

LLVM IR (-O0):
define signext i16 @short_to_short(i16 signext %0, i32 %1) {
%3 = alloca i16
%4 = alloca i32
store i16 %0, i16* %3
store i32 %1, i32* %4
%5 = load i16, i16* %3
%6 = sext i16 %5 to i32
%7 = load i32, i32* %4
%8 = add nsw i32 %6, %7
%9 = trunc i32 %8 to i16
ret i16 %9
}

LLVM IR (-O2):
define signext i16 @short_to_short(i16 signext %0, i32 %1) {
%3 = trunc i32 %1 to i16
%4 = add i16 %3, %0
ret i16 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ block128_f;
typedef int /*<<< orphan*/ CAMELLIA_KEY;

/* Variables and functions */
int /*<<< orphan*/ CRYPTO_ofb128_encrypt(unsigned char const *, unsigned char *,
                                         size_t, int /*<<< orphan*/ const *,
                                         unsigned char *, int *,
                                         int /*<<< orphan*/);
scalar_t__ Camellia_encrypt;
void Camellia_ofb128_encrypt(const unsigned char *in, unsigned char *out,
                             size_t length, const CAMELLIA_KEY *key,
                             unsigned char *ivec, int *num) {
  CRYPTO_ofb128_encrypt(in, out, length, key, ivec, num,
                        (block128_f)Camellia_encrypt);
}


x86 assembly (clang, -O0):
<Camellia_ofb128_encrypt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r8
mov    -0x30(%rbp),%r9
mov    0x2ea9(%rip),%rax
mov    (%rax),%rax
mov    %eax,(%rsp)
call   1030 <CRYPTO_ofb128_encrypt@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Camellia_ofb128_encrypt>:
push   %rax
mov    0x2ee0(%rip),%rax
mov    (%rax),%eax
mov    %eax,(%rsp)
call   1030 <CRYPTO_ofb128_encrypt@plt>
pop    %rax
ret

LLVM IR (-O0):
@Camellia_encrypt = global i64 0
define void @Camellia_ofb128_encrypt(i8* %0, i8* %1, i64 %2, i32* %3, i8* %4, i32* %5) {
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i64
%10 = alloca i32*
%11 = alloca i8*
%12 = alloca i32*
store i8* %0, i8** %7
store i8* %1, i8** %8
store i64 %2, i64* %9
store i32* %3, i32** %10
store i8* %4, i8** %11
store i32* %5, i32** %12
%13 = load i8*, i8** %7
%14 = load i8*, i8** %8
%15 = load i64, i64* %9
%16 = load i32*, i32** %10
%17 = load i8*, i8** %11
%18 = load i32*, i32** %12
%19 = load i64, i64* @Camellia_encrypt
%20 = trunc i64 %19 to i32
%21 = call i32 @CRYPTO_ofb128_encrypt(i8* %13, i8* %14, i64 %15, i32* %16, i8* %17, i32* %18, i32 %20)
ret void
}

LLVM IR (-O2):
@Camellia_encrypt = global i64 0
define void @Camellia_ofb128_encrypt(i8* %0, i8* %1, i64 %2, i32* %3, i8* %4, i32* %5) {
%7 = load i64, i64* @Camellia_encrypt
%8 = trunc i64 %7 to i32
%9 = tail call i32 @CRYPTO_ofb128_encrypt(i8* %0, i8* %1, i64 %2, i32* %3, i8* %4, i32* %5, i32 %8)
ret void
}
extern unsigned long ffz_b(unsigned long x) {
  unsigned long sum = 0;
  x = ~x & -~x;
  if (x & 0xF0)
    sum += 4;
  if (x & 0xCC)
    sum += 2;
  if (x & 0xAA)
    sum += 1;
  return sum;
}


x86 assembly (clang, -O0):
<ffz_b>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
xor    $0xffffffffffffffff,%rax
mov    -0x8(%rbp),%rdx
xor    $0xffffffffffffffff,%rdx
xor    %ecx,%ecx
sub    %rdx,%rcx
and    %rcx,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
and    $0xf0,%rax
cmp    $0x0,%rax
je     114c <ffz_b+0x4c>
mov    -0x10(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
and    $0xcc,%rax
cmp    $0x0,%rax
je     116c <ffz_b+0x6c>
mov    -0x10(%rbp),%rax
add    $0x2,%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
and    $0xaa,%rax
cmp    $0x0,%rax
je     118c <ffz_b+0x8c>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ffz_b>:
lea    0x1(%rdi),%rax
not    %rdi
and    %rax,%rdi
xor    %eax,%eax
test   $0xf0,%dil
setne  %al
lea    0x0(,%rax,4),%rcx
test   $0xcc,%dil
lea    0x2(,%rax,4),%rdx
cmove  %rcx,%rdx
xor    %eax,%eax
test   $0xaa,%dil
setne  %al
or     %rdx,%rax
ret

LLVM IR (-O0):
define i64 @ffz_b(i64 %0) {
%2 = alloca i64
%3 = alloca i64
store i64 %0, i64* %2
store i64 0, i64* %3
%4 = load i64, i64* %2
%5 = xor i64 %4, -1
%6 = load i64, i64* %2
%7 = xor i64 %6, -1
%8 = sub i64 0, %7
%9 = and i64 %5, %8
store i64 %9, i64* %2
%10 = load i64, i64* %2
%11 = and i64 %10, 240
%12 = icmp ne i64 %11, 0
br i1 %12, label %13, label %16
13: ; preds = %1
%14 = load i64, i64* %3
%15 = add i64 %14, 4
store i64 %15, i64* %3
br label %16
16: ; preds = %13, %1
%17 = load i64, i64* %2
%18 = and i64 %17, 204
%19 = icmp ne i64 %18, 0
br i1 %19, label %20, label %23
20: ; preds = %16
%21 = load i64, i64* %3
%22 = add i64 %21, 2
store i64 %22, i64* %3
br label %23
23: ; preds = %20, %16
%24 = load i64, i64* %2
%25 = and i64 %24, 170
%26 = icmp ne i64 %25, 0
br i1 %26, label %27, label %30
27: ; preds = %23
%28 = load i64, i64* %3
%29 = add i64 %28, 1
store i64 %29, i64* %3
br label %30
30: ; preds = %27, %23
%31 = load i64, i64* %3
ret i64 %31
}

LLVM IR (-O2):
define i64 @ffz_b(i64 %0) {
%2 = add i64 %0, 1
%3 = xor i64 %0, -1
%4 = and i64 %2, %3
%5 = and i64 %4, 240
%6 = icmp eq i64 %5, 0
%7 = select i1 %6, i64 0, i64 4
%8 = and i64 %4, 204
%9 = icmp eq i64 %8, 0
%10 = or i64 %7, 2
%11 = select i1 %9, i64 %7, i64 %10
%12 = and i64 %4, 170
%13 = icmp ne i64 %12, 0
%14 = zext i1 %13 to i64
%15 = or i64 %11, %14
ret i64 %15
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void printArray(char a[], int n) {
  int i;
  for (i = 0; i < n; i++)
    printf("%c", a[i]);
  printf("\n");
  return;
}


x86 assembly (clang, -O0):
<printArray>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    115a <printArray+0x4a>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%esi
lea    0xebb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <printArray+0x16>
lea    0xea2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printArray>:
push   %r15
push   %r14
push   %rbx
test   %esi,%esi
jle    1143 <printArray+0x33>
mov    %rdi,%r14
mov    %esi,%r15d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movsbl (%r14,%rbx,1),%edi
call   1030 <putchar@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <printArray+0x20>
mov    $0xa,%edi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
define void @printArray(i8* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %14
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %12, %6 ]
%8 = getelementptr inbounds i8, i8* %0, i64 %7
%9 = load i8, i8* %8
%10 = sext i8 %9 to i32
%11 = tail call i32 @putchar(i32 %10)
%12 = add nuw nsw i64 %7, 1
%13 = icmp eq i64 %12, %5
br i1 %13, label %14, label %6
14: ; preds = %6, %2
%15 = tail call i32 @putchar(i32 10)
ret void
}
/* Variables and functions */
int stack_count_impl();
int stack_count() { return stack_count_impl(); }


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

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

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

LLVM IR (-O2):
define i32 @stack_count() {
%1 = tail call i32 (...) @stack_count_impl()
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ Nokia5110_Init();
void Output_Init(void) { Nokia5110_Init(); }


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

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

LLVM IR (-O0):
define void @Output_Init() {
%1 = call i32 (...) @Nokia5110_Init()
ret void
}

LLVM IR (-O2):
define void @Output_Init() {
%1 = tail call i32 (...) @Nokia5110_Init()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _stp_warn(char *);
int stap_start_task_finder(void) {
  _stp_warn("process-tracking is not available in this kernel"
            " [man error::process-tracking]");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [79 x i8] c"process-tracking is not available in this kernel [man error::process-tracking]\00"
define i32 @stap_start_task_finder() {
%1 = call i32 @_stp_warn(i8* getelementptr inbounds ([79 x i8], [79 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [79 x i8] c"process-tracking is not available in this kernel [man error::process-tracking]\00"
define i32 @stap_start_task_finder() {
%1 = tail call i32 @_stp_warn(i8* getelementptr inbounds ([79 x i8], [79 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
unsigned long int hashit(char *str) {
  unsigned long int hash = 0;
  int c;
  while ((c = *str++))
    hash = c + (hash << 6) + (hash << 16) - hash;
  return hash;
}


x86 assembly (clang, -O0):
<hashit>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%eax
mov    %eax,-0x14(%rbp)
cmp    $0x0,%eax
je     1155 <hashit+0x55>
movslq -0x14(%rbp),%rax
mov    -0x10(%rbp),%rcx
shl    $0x6,%rcx
add    %rcx,%rax
mov    -0x10(%rbp),%rcx
shl    $0x10,%rcx
add    %rcx,%rax
sub    -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <hashit+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hashit>:
mov    (%rdi),%cl
test   %cl,%cl
je     112a <hashit+0x2a>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
movsbq %cl,%rcx
imul   $0x1003f,%rax,%rax
add    %rcx,%rax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <hashit+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i64 @hashit(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %14, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = phi i64 [ %11, %4 ], [ 0, %1 ]
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = sext i8 %5 to i64
%10 = mul i64 %7, 65599
%11 = add i64 %10, %9
%12 = load i8, i8* %8
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4, %1
%15 = phi i64 [ 0, %1 ], [ %11, %4 ]
ret i64 %15
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int test_yajl_start_array(void *ctx) {
  printf("array open '['\n");
  return 1;
}


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

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

LLVM IR (-O0):
@.str = [16 x i8] c"array open '['\0A\00"
define i32 @test_yajl_start_array(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
ret i32 1
}

LLVM IR (-O2):
@str = [15 x i8] c"array open '['\00"
define i32 @test_yajl_start_array(i8* nocapture readnone %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str, i64 0, i64 0))
ret i32 1
}
int test_imm_53int16_reg(short val) {
  return ((val) & (0x53 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_53int16_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, 83
%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_53int16_reg(i16 signext %0) {
%2 = and i16 %0, 83
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, void *);
int /*<<< orphan*/ stderr;
void rtpp_server_get_seq_fin(void *pub) {
  fprintf(stderr,
          "Method rtpp_server@%p::get_seq (rtpp_server_get_seq) is invoked "
          "after destruction\x0a",
          pub);
  abort();
}


x86 assembly (clang, -O0):
<rtpp_server_get_seq_fin>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<rtpp_server_get_seq_fin>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1040 <fprintf@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [83 x i8] c"Method rtpp_server@%p::get_seq (rtpp_server_get_seq) is invoked after destruction\0A\00"
define void @rtpp_server_get_seq_fin(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([83 x i8], [83 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [83 x i8] c"Method rtpp_server@%p::get_seq (rtpp_server_get_seq) is invoked after destruction\0A\00"
define void @rtpp_server_get_seq_fin(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([83 x i8], [83 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 (...) @abort()
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ C67_asm(char *, int, int, int);
void C67_MPYSP(int r, int v) { C67_asm("MPYSP.M", v, r, v); }


x86 assembly (clang, -O0):
<C67_MPYSP>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%esi
mov    -0x4(%rbp),%edx
mov    -0x8(%rbp),%ecx
lea    0xed2(%rip),%rdi
call   1030 <C67_asm@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<C67_MPYSP>:
mov    %edi,%edx
lea    0xee7(%rip),%rdi
mov    %esi,%ecx
jmp    1030 <C67_asm@plt>

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

LLVM IR (-O2):
@.str = [8 x i8] c"MPYSP.M\00"
define void @C67_MPYSP(i32 %0, i32 %1) {
%3 = tail call i32 @C67_asm(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %1, i32 %0, i32 %1)
ret void
}
/* Variables and functions */
double tanh(double);
double DTANH_DX(double x) {
  double y = tanh(x);
  return 1.0 - y * y;
}


x86 assembly (clang, -O0):
<DTANH_DX>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <tanh@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm1,%xmm0
movsd  0xea7(%rip),%xmm1
addsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<DTANH_DX>:
push   %rax
call   1030 <tanh@plt>
mulsd  %xmm0,%xmm0
movsd  0xede(%rip),%xmm1
subsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @DTANH_DX(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %2
%4 = load double, double* %2
%5 = call double @tanh(double %4)
store double %5, double* %3
%6 = load double, double* %3
%7 = load double, double* %3
%8 = fneg double %6
%9 = call double @llvm.fmuladd.f64(double %8, double %7, double 1.000000e+00)
ret double %9
}

LLVM IR (-O2):
define double @DTANH_DX(double %0) {
%2 = tail call double @tanh(double %0)
%3 = fneg double %2
%4 = tail call double @llvm.fmuladd.f64(double %3, double %2, double 1.000000e+00)
ret double %4
}
void SYS_Interrupt_Shell() {}


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

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

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

LLVM IR (-O2):
define void @SYS_Interrupt_Shell() {
ret void
}
/* Variables and functions */
int write(int, char *, int);
void write_msg_id(int socket, char msg_id) {
  if (write(socket, &msg_id, 1) != 1)
    return;
}


x86 assembly (clang, -O0):
<write_msg_id>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %edi,-0x4(%rbp)
mov    %al,-0x5(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x5(%rbp),%rsi
mov    $0x1,%edx
call   1030 <write@plt>
cmp    $0x1,%eax
je     1140 <write_msg_id+0x30>
jmp    1140 <write_msg_id+0x30>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_msg_id>:
push   %rax
mov    %sil,0x7(%rsp)
lea    0x7(%rsp),%rsi
mov    $0x1,%edx
call   1030 <write@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @write_msg_id(i32 %0, i8 signext %1) {
%3 = alloca i32
%4 = alloca i8
store i32 %0, i32* %3
store i8 %1, i8* %4
%5 = load i32, i32* %3
%6 = call i32 @write(i32 %5, i8* %4, i32 1)
%7 = icmp ne i32 %6, 1
br i1 %7, label %8, label %9
8: ; preds = %2
br label %9
9: ; preds = %8, %2
ret void
}

LLVM IR (-O2):
define void @write_msg_id(i32 %0, i8 signext %1) {
%3 = alloca i8
store i8 %1, i8* %3
%4 = call i32 @write(i32 %0, i8* %3, i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
void end_test_skip_file_and_function(void) { abort(); }


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

x86 assembly (clang, -O2):
<end_test_skip_file_and_function>:
push   %rax
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define void @end_test_skip_file_and_function() {
%1 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
define void @end_test_skip_file_and_function() {
%1 = tail call i32 (...) @abort()
unreachable
}