xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isbdigit(int);
void t_isbdigit_0x1a() {
  Assert_real((isbdigit(26) == 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_isbdigit.c",
              135, ("isbdigit should be 0 for 0x1a"));
}


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

x86 assembly (clang, -O2):
<t_isbdigit_0x1a>:
push   %rax
mov    $0x1a,%edi
call   1040 <isbdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf67(%rip),%rcx
mov    $0x87,%edx
pop    %rax
jmp    1030 <Assert_real@plt>

LLVM IR (-O0):
@.str = [169 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_isbdigit.c\00"
@.str.1 = [30 x i8] c"isbdigit should be 0 for 0x1a\00"
define void @t_isbdigit_0x1a() {
%1 = call i64 @isbdigit(i32 26)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 135, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [169 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_isbdigit.c\00"
@.str.1 = [30 x i8] c"isbdigit should be 0 for 0x1a\00"
define void @t_isbdigit_0x1a() {
%1 = tail call i64 @isbdigit(i32 26)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 135, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}
long _denormalize_index(long normalized_index, long real_start, long step) {
  return real_start + (normalized_index * step);
}


x86 assembly (clang, -O0):
<_denormalize_index>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rcx
imul   -0x18(%rbp),%rcx
add    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_denormalize_index>:
imul   %rdx,%rdi
lea    (%rdi,%rsi,1),%rax
ret

LLVM IR (-O0):
define i64 @_denormalize_index(i64 %0, i64 %1, i64 %2) {
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
store i64 %0, i64* %4
store i64 %1, i64* %5
store i64 %2, i64* %6
%7 = load i64, i64* %5
%8 = load i64, i64* %4
%9 = load i64, i64* %6
%10 = mul nsw i64 %8, %9
%11 = add nsw i64 %7, %10
ret i64 %11
}

LLVM IR (-O2):
define i64 @_denormalize_index(i64 %0, i64 %1, i64 %2) {
%4 = mul nsw i64 %2, %0
%5 = add nsw i64 %4, %1
ret i64 %5
}
/* Forward declarations */
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  scalar_t__ length;
};
typedef TYPE_1__ ASN1_INTEGER;

/* Variables and functions */
int ASN1_INTEGER_valid(const ASN1_INTEGER *a) {
  return (a != NULL && a->length >= 0);
}


x86 assembly (clang, -O0):
<ASN1_INTEGER_valid>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
xor    %eax,%eax
cmpq   $0x0,-0x8(%rbp)
mov    %al,-0x9(%rbp)
je     1126 <ASN1_INTEGER_valid+0x26>
mov    -0x8(%rbp),%rax
cmpq   $0x0,(%rax)
setge  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ASN1_INTEGER_valid>:
test   %rdi,%rdi
je     1110 <ASN1_INTEGER_valid+0x10>
mov    (%rdi),%rax
shr    $0x3f,%rax
xor    $0x1,%eax
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
%struct.TYPE_3__ = type { i64 }
define i32 @ASN1_INTEGER_valid(%struct.TYPE_3__* %0) {
%2 = alloca %struct.TYPE_3__*
store %struct.TYPE_3__* %0, %struct.TYPE_3__** %2
%3 = load %struct.TYPE_3__*, %struct.TYPE_3__** %2
%4 = icmp ne %struct.TYPE_3__* %3, null
br i1 %4, label %5, label %10
5: ; preds = %1
%6 = load %struct.TYPE_3__*, %struct.TYPE_3__** %2
%7 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %6, i32 0, i32 0
%8 = load i64, i64* %7
%9 = icmp sge i64 %8, 0
br label %10
10: ; preds = %5, %1
%11 = phi i1 [ false, %1 ], [ %9, %5 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
%struct.TYPE_3__ = type { i64 }
define i32 @ASN1_INTEGER_valid(%struct.TYPE_3__* %0) {
%2 = icmp eq %struct.TYPE_3__* %0, null
br i1 %2, label %9, label %3
3: ; preds = %1
%4 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %0, i64 0, i32 0
%5 = load i64, i64* %4
%6 = lshr i64 %5, 63
%7 = trunc i64 %6 to i32
%8 = xor i32 %7, 1
br label %9
9: ; preds = %3, %1
%10 = phi i32 [ 0, %1 ], [ %8, %3 ]
ret i32 %10
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
void sha256_init(uint32_t *H) {
  H[0] = 0x6a09e667U;
  H[1] = 0xbb67ae85U;
  H[2] = 0x3c6ef372U;
  H[3] = 0xa54ff53aU;
  H[4] = 0x510e527fU;
  H[5] = 0x9b05688cU;
  H[6] = 0x1f83d9abU;
  H[7] = 0x5be0cd19U;
}


x86 assembly (clang, -O0):
<sha256_init>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movl   $0x6a09e667,(%rax)
mov    -0x8(%rbp),%rax
movl   $0xbb67ae85,0x4(%rax)
mov    -0x8(%rbp),%rax
movl   $0x3c6ef372,0x8(%rax)
mov    -0x8(%rbp),%rax
movl   $0xa54ff53a,0xc(%rax)
mov    -0x8(%rbp),%rax
movl   $0x510e527f,0x10(%rax)
mov    -0x8(%rbp),%rax
movl   $0x9b05688c,0x14(%rax)
mov    -0x8(%rbp),%rax
movl   $0x1f83d9ab,0x18(%rax)
mov    -0x8(%rbp),%rax
movl   $0x5be0cd19,0x1c(%rax)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @sha256_init(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 0
store i32 1779033703, i32* %4
%5 = load i32*, i32** %2
%6 = getelementptr inbounds i32, i32* %5, i64 1
store i32 -1150833019, i32* %6
%7 = load i32*, i32** %2
%8 = getelementptr inbounds i32, i32* %7, i64 2
store i32 1013904242, i32* %8
%9 = load i32*, i32** %2
%10 = getelementptr inbounds i32, i32* %9, i64 3
store i32 -1521486534, i32* %10
%11 = load i32*, i32** %2
%12 = getelementptr inbounds i32, i32* %11, i64 4
store i32 1359893119, i32* %12
%13 = load i32*, i32** %2
%14 = getelementptr inbounds i32, i32* %13, i64 5
store i32 -1694144372, i32* %14
%15 = load i32*, i32** %2
%16 = getelementptr inbounds i32, i32* %15, i64 6
store i32 528734635, i32* %16
%17 = load i32*, i32** %2
%18 = getelementptr inbounds i32, i32* %17, i64 7
store i32 1541459225, i32* %18
ret void
}

LLVM IR (-O2):
define void @sha256_init(i32* nocapture writeonly %0) {
%2 = bitcast i32* %0 to <4 x i32>*
store <4 x i32> <i32 1779033703, i32 -1150833019, i32 1013904242, i32 -1521486534>, <4 x i32>* %2
%3 = getelementptr inbounds i32, i32* %0, i64 4
%4 = bitcast i32* %3 to <4 x i32>*
store <4 x i32> <i32 1359893119, i32 -1694144372, i32 528734635, i32 1541459225>, <4 x i32>* %4
ret void
}
void sysReboot() {}


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

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

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

LLVM IR (-O2):
define void @sysReboot() {
ret void
}
/* Variables and functions */
scalar_t__ pow(double, int);
double sqrt(scalar_t__);
double distance(double x1, double y1, double x2, double y2) {
  return sqrt(pow(x2 - x1, 2) + pow(y2 - y1, 2));
}


x86 assembly (clang, -O0):
<distance>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  -0x18(%rbp),%xmm0
subsd  -0x8(%rbp),%xmm0
mov    $0x2,%edi
call   1030 <pow@plt>
mov    %rax,-0x28(%rbp)
movsd  -0x20(%rbp),%xmm0
subsd  -0x10(%rbp),%xmm0
mov    $0x2,%edi
call   1030 <pow@plt>
mov    -0x28(%rbp),%rdi
add    %rax,%rdi
call   1040 <sqrt@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<distance>:
push   %rbx
sub    $0x10,%rsp
movsd  %xmm3,0x8(%rsp)
movsd  %xmm1,(%rsp)
subsd  %xmm0,%xmm2
movapd %xmm2,%xmm0
mov    $0x2,%edi
call   1030 <pow@plt>
mov    %rax,%rbx
movsd  0x8(%rsp),%xmm0
subsd  (%rsp),%xmm0
mov    $0x2,%edi
call   1030 <pow@plt>
add    %rax,%rbx
mov    %rbx,%rdi
add    $0x10,%rsp
pop    %rbx
jmp    1040 <sqrt@plt>

LLVM IR (-O0):
define double @distance(double %0, double %1, double %2, double %3) {
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
store double %0, double* %5
store double %1, double* %6
store double %2, double* %7
store double %3, double* %8
%9 = load double, double* %7
%10 = load double, double* %5
%11 = fsub double %9, %10
%12 = call i64 @pow(double %11, i32 2)
%13 = load double, double* %8
%14 = load double, double* %6
%15 = fsub double %13, %14
%16 = call i64 @pow(double %15, i32 2)
%17 = add nsw i64 %12, %16
%18 = call double @sqrt(i64 %17)
ret double %18
}

LLVM IR (-O2):
define double @distance(double %0, double %1, double %2, double %3) {
%5 = fsub double %2, %0
%6 = tail call i64 @pow(double %5, i32 2)
%7 = fsub double %3, %1
%8 = tail call i64 @pow(double %7, i32 2)
%9 = add nsw i64 %8, %6
%10 = tail call double @sqrt(i64 %9)
ret double %10
}
/* Variables and functions */
int /*<<< orphan*/ mvaddstr(int /*<<< orphan*/, int /*<<< orphan*/, char *);
int /*<<< orphan*/ strlen(char *);
int /*<<< orphan*/ xcenter(int /*<<< orphan*/);
int /*<<< orphan*/ ycenter(int /*<<< orphan*/);
void print_centered_string(char *str) {
  mvaddstr(ycenter(0), xcenter(strlen(str)), str);
}


x86 assembly (clang, -O0):
<print_centered_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
xor    %edi,%edi
call   1060 <ycenter@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%edi
call   1040 <xcenter@plt>
mov    -0xc(%rbp),%edi
mov    %eax,%esi
mov    -0x8(%rbp),%rdx
call   1050 <mvaddstr@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_centered_string>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
xor    %edi,%edi
call   1060 <ycenter@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1030 <strlen@plt>
mov    %eax,%edi
call   1040 <xcenter@plt>
mov    %ebp,%edi
mov    %eax,%esi
mov    %rbx,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1050 <mvaddstr@plt>

LLVM IR (-O0):
define void @print_centered_string(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @ycenter(i32 0)
%4 = load i8*, i8** %2
%5 = call i32 @strlen(i8* %4)
%6 = call i32 @xcenter(i32 %5)
%7 = load i8*, i8** %2
%8 = call i32 @mvaddstr(i32 %3, i32 %6, i8* %7)
ret void
}

LLVM IR (-O2):
define void @print_centered_string(i8* %0) {
%2 = tail call i32 @ycenter(i32 0)
%3 = tail call i32 @strlen(i8* %0)
%4 = tail call i32 @xcenter(i32 %3)
%5 = tail call i32 @mvaddstr(i32 %2, i32 %4, i8* %0)
ret void
}
int ft_isprime(int nb) {
  int i;
  i = 3;
  if (nb % 2 == 0) {
    return (0);
  }
  while (i < (nb / 2 + 1)) {
    if (nb % i == 0) {
      return (0);
    } else {
      i = i + 2;
    }
  }
  return (1);
}


x86 assembly (clang, -O0):
<ft_isprime>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
movl   $0x3,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    112e <ft_isprime+0x2e>
movl   $0x0,-0x4(%rbp)
jmp    1185 <ft_isprime+0x85>
jmp    1133 <ft_isprime+0x33>
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
add    $0x1,%ecx
cmp    %ecx,%eax
jge    117e <ft_isprime+0x7e>
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
cmp    $0x0,%edx
jne    1170 <ft_isprime+0x70>
movl   $0x0,-0x4(%rbp)
jmp    1185 <ft_isprime+0x85>
mov    -0xc(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0xc(%rbp)
jmp    1133 <ft_isprime+0x33>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_isprime>:
xor    %r8d,%r8d
test   $0x1,%dil
jne    110d <ft_isprime+0xd>
mov    %r8d,%eax
ret
cmp    $0x6,%edi
jge    1118 <ft_isprime+0x18>
mov    $0x1,%eax
ret
mov    %edi,%esi
shr    $0x1f,%esi
add    %edi,%esi
sar    %esi
mov    $0x3,%ecx
cs nopw 0x0(%rax,%rax,1)
mov    %edi,%eax
cltd
idiv   %ecx
test   %edx,%edx
je     1109 <ft_isprime+0x9>
add    $0x2,%ecx
cmp    %esi,%ecx
jle    1130 <ft_isprime+0x30>
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @ft_isprime(i32 %0) {
%2 = and i32 %0, 1
%3 = icmp eq i32 %2, 0
br i1 %3, label %14, label %4
4: ; preds = %1
%5 = sdiv i32 %0, 2
%6 = icmp slt i32 %0, 6
br i1 %6, label %14, label %9
7: ; preds = %9
%8 = icmp sgt i32 %13, %5
br i1 %8, label %14, label %9
9: ; preds = %4, %7
%10 = phi i32 [ %13, %7 ], [ 3, %4 ]
%11 = srem i32 %0, %10
%12 = icmp eq i32 %11, 0
%13 = add nuw nsw i32 %10, 2
br i1 %12, label %14, label %7
14: ; preds = %9, %7, %4, %1
%15 = phi i32 [ 0, %1 ], [ 1, %4 ], [ 0, %9 ], [ 1, %7 ]
ret i32 %15
}
/* Variables and functions */
size_t strcspn(char *, char *);
void chomp(char *s) { s[strcspn(s, "\n")] = '\0'; }


x86 assembly (clang, -O0):
<chomp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xed1(%rip),%rsi
call   1030 <strcspn@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
movb   $0x0,(%rax,%rcx,1)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<chomp>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rsi
call   1030 <strcspn@plt>
movb   $0x0,(%rbx,%rax,1)
pop    %rbx
ret

LLVM IR (-O0):
@.str = [2 x i8] c"\0A\00"
define void @chomp(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @strcspn(i8* %4, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%6 = getelementptr inbounds i8, i8* %3, i64 %5
store i8 0, i8* %6
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c"\0A\00"
define void @chomp(i8* nocapture %0) {
%2 = tail call i64 @strcspn(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%3 = getelementptr inbounds i8, i8* %0, i64 %2
store i8 0, i8* %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ crc_generate_combine_tables();
int /*<<< orphan*/ crc_generate_main_tables();
void mycrc32_init(void) {
  crc_generate_main_tables();
  crc_generate_combine_tables();
}


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

x86 assembly (clang, -O2):
<mycrc32_init>:
push   %rax
xor    %eax,%eax
call   1040 <crc_generate_main_tables@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <crc_generate_combine_tables@plt>

LLVM IR (-O0):
define void @mycrc32_init() {
%1 = call i32 (...) @crc_generate_main_tables()
%2 = call i32 (...) @crc_generate_combine_tables()
ret void
}

LLVM IR (-O2):
define void @mycrc32_init() {
%1 = tail call i32 (...) @crc_generate_main_tables()
%2 = tail call i32 (...) @crc_generate_combine_tables()
ret void
}
void ScaleARGBFilterCols64_C() {}


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

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

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

LLVM IR (-O2):
define void @ScaleARGBFilterCols64_C() {
ret void
}
/* Variables and functions */
int *clone_ivector(int const *, int);
int /*<<< orphan*/ free(int *);
int imedian_ordered(int *, int);
int imedian(const int *v, int len) {
  int *v2 = clone_ivector(v, len);
  int median = imedian_ordered(v2, len);
  free(v2);
  return median;
}


x86 assembly (clang, -O0):
<imedian>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1050 <clone_ivector@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1040 <imedian_ordered@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
mov    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<imedian>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
call   1050 <clone_ivector@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %ebp,%esi
call   1040 <imedian_ordered@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1030 <free@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @imedian(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* %4
%9 = call i32* @clone_ivector(i32* %7, i32 %8)
store i32* %9, i32** %5
%10 = load i32*, i32** %5
%11 = load i32, i32* %4
%12 = call i32 @imedian_ordered(i32* %10, i32 %11)
store i32 %12, i32* %6
%13 = load i32*, i32** %5
%14 = call i32 @free(i32* %13)
%15 = load i32, i32* %6
ret i32 %15
}

LLVM IR (-O2):
define i32 @imedian(i32* %0, i32 %1) {
%3 = tail call i32* @clone_ivector(i32* %0, i32 %1)
%4 = tail call i32 @imedian_ordered(i32* %3, i32 %1)
%5 = tail call i32 @free(i32* %3)
ret i32 %4
}
int main() {
  long salary;
  long *salary_ptr;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int __ctype_isxdigit(int);
int isxdigit(int c) { return __ctype_isxdigit(c); }


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

x86 assembly (clang, -O2):
<isxdigit>:
jmp    1030 <__ctype_isxdigit@plt>

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

LLVM IR (-O2):
define i32 @isxdigit(i32 %0) {
%2 = tail call i32 @__ctype_isxdigit(i32 %0)
ret i32 %2
}
void rdu_rwlock_init(struct rdu *p) {}


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

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

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

LLVM IR (-O2):
%struct.rdu = type opaque
define void @rdu_rwlock_init(%struct.rdu* nocapture %0) {
ret void
}
/* Variables and functions */
int r_write(int, char *, int);
int d_write(int fd, char *buffer, int number) {
  return r_write(fd, buffer, number);
}


x86 assembly (clang, -O0):
<d_write>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <r_write@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<d_write>:
jmp    1030 <r_write@plt>

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

LLVM IR (-O2):
define i32 @d_write(i32 %0, i8* %1, i32 %2) {
%4 = tail call i32 @r_write(i32 %0, i8* %1, i32 %2)
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ USERNOTICE;
typedef int /*<<< orphan*/ ASN1_VALUE;

/* Variables and functions */
int ASN1_item_i2d(int /*<<< orphan*/ *, unsigned char **, int /*<<< orphan*/ *);
int /*<<< orphan*/ USERNOTICE_it;
int i2d_USERNOTICE(USERNOTICE *a, unsigned char **out) {
  return ASN1_item_i2d((ASN1_VALUE *)a, out, &USERNOTICE_it);
}


x86 assembly (clang, -O0):
<i2d_USERNOTICE>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    0x2eb1(%rip),%rdx
call   1030 <ASN1_item_i2d@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<i2d_USERNOTICE>:
mov    0x2ec9(%rip),%rdx
jmp    1030 <ASN1_item_i2d@plt>

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

LLVM IR (-O2):
@USERNOTICE_it = global i32 0
define i32 @i2d_USERNOTICE(i32* %0, i8** %1) {
%3 = tail call i32 @ASN1_item_i2d(i32* %0, i8** %1, i32* @USERNOTICE_it)
ret i32 %3
}
/* Variables and functions */
float _sinf_cosf_special(float, char *);
float _sinf_special(float x) { return _sinf_cosf_special(x, "sinf"); }


x86 assembly (clang, -O0):
<_sinf_special>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
lea    0xed7(%rip),%rdi
call   1030 <_sinf_cosf_special@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [5 x i8] c"sinf\00"
define float @_sinf_special(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call float @_sinf_cosf_special(float %3, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret float %4
}

LLVM IR (-O2):
@.str = [5 x i8] c"sinf\00"
define float @_sinf_special(float %0) {
%2 = tail call float @_sinf_cosf_special(float %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret float %2
}
/* Variables and functions */
int getpid();
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ syscall(int, int /*<<< orphan*/, int /*<<< orphan*/);
int kmode() {
  printf("kmode : enter Kmode via INT 80\n");
  printf("proc %d going K mode ....\n", getpid());
  syscall(3, 0, 0);
  printf("proc %d back from Kernel\n", getpid());
}


x86 assembly (clang, -O0):
<kmode>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0x0,%al
call   1030 <getpid@plt>
mov    %eax,%esi
lea    0xeca(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0x3,%edi
xor    %edx,%edx
mov    %edx,%esi
call   1050 <syscall@plt>
mov    $0x0,%al
call   1030 <getpid@plt>
mov    %eax,%esi
lea    0xec0(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<kmode>:
push   %rax
lea    0xeed(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1040 <getpid@plt>
lea    0xea5(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0x3,%edi
xor    %esi,%esi
xor    %edx,%edx
call   1060 <syscall@plt>
xor    %eax,%eax
call   1040 <getpid@plt>
lea    0xe9b(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
pop    %rcx
jmp    1050 <printf@plt>

LLVM IR (-O0):
@.str = [32 x i8] c"kmode : enter Kmode via INT 80\0A\00"
@.str.1 = [27 x i8] c"proc %d going K mode ....\0A\00"
@.str.2 = [26 x i8] c"proc %d back from Kernel\0A\00"
define i32 @kmode() {
%1 = alloca i32
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (...) @getpid()
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i32 %3)
%5 = call i32 @syscall(i32 3, i32 0, i32 0)
%6 = call i32 (...) @getpid()
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.2, i64 0, i64 0), i32 %6)
%8 = load i32, i32* %1
ret i32 %8
}

LLVM IR (-O2):
@.str.1 = [27 x i8] c"proc %d going K mode ....\0A\00"
@.str.2 = [26 x i8] c"proc %d back from Kernel\0A\00"
@str = [31 x i8] c"kmode : enter Kmode via INT 80\00"
define i32 @kmode() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (...) @getpid()
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i32 %2)
%4 = tail call i32 @syscall(i32 3, i32 0, i32 0)
%5 = tail call i32 (...) @getpid()
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str.2, i64 0, i64 0), i32 %5)
ret i32 undef
}
int msm_watchdog_enable(void) {}


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

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

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

LLVM IR (-O2):
define i32 @msm_watchdog_enable() {
ret i32 undef
}
int CHAIN_JUMP() { return -1; }


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

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

LLVM IR (-O0):
define i32 @CHAIN_JUMP() {
ret i32 -1
}

LLVM IR (-O2):
define i32 @CHAIN_JUMP() {
ret i32 -1
}
/* Type definitions */
typedef int uint16_t;
struct ByteStream {
  int dummy;
};

/* Variables and functions */
int ByteStream_read_byte(struct ByteStream *);
uint16_t ByteStream_read_u16(struct ByteStream *self) {
  return (ByteStream_read_byte(self) << 8) | ByteStream_read_byte(self);
}


x86 assembly (clang, -O0):
<ByteStream_read_u16>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <ByteStream_read_byte@plt>
shl    $0x8,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <ByteStream_read_byte@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
or     %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ByteStream_read_u16>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1030 <ByteStream_read_byte@plt>
mov    %eax,%ebp
shl    $0x8,%ebp
mov    %rbx,%rdi
call   1030 <ByteStream_read_byte@plt>
or     %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
%struct.ByteStream = type { i32 }
define i32 @ByteStream_read_u16(%struct.ByteStream* %0) {
%2 = alloca %struct.ByteStream*
store %struct.ByteStream* %0, %struct.ByteStream** %2
%3 = load %struct.ByteStream*, %struct.ByteStream** %2
%4 = call i32 @ByteStream_read_byte(%struct.ByteStream* %3)
%5 = shl i32 %4, 8
%6 = load %struct.ByteStream*, %struct.ByteStream** %2
%7 = call i32 @ByteStream_read_byte(%struct.ByteStream* %6)
%8 = or i32 %5, %7
ret i32 %8
}

LLVM IR (-O2):
%struct.ByteStream = type { i32 }
define i32 @ByteStream_read_u16(%struct.ByteStream* %0) {
%2 = tail call i32 @ByteStream_read_byte(%struct.ByteStream* %0)
%3 = shl i32 %2, 8
%4 = tail call i32 @ByteStream_read_byte(%struct.ByteStream* %0)
%5 = or i32 %3, %4
ret i32 %5
}
/* Variables and functions */
int f249(int *);
int f250(int *p) { return f249(p); }


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

x86 assembly (clang, -O2):
<f250>:
jmp    1030 <f249@plt>

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

LLVM IR (-O2):
define i32 @f250(i32* %0) {
%2 = tail call i32 @f249(i32* %0)
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ cblByteOrderSwap16(int /*<<< orphan*/);
uint16_t cblByteOrderSwap16HostToBig(uint16_t swap) {
  return cblByteOrderSwap16(swap);
}


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

x86 assembly (clang, -O2):
<cblByteOrderSwap16HostToBig>:
jmp    1030 <cblByteOrderSwap16@plt>

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

LLVM IR (-O2):
define i32 @cblByteOrderSwap16HostToBig(i32 %0) {
%2 = tail call i32 @cblByteOrderSwap16(i32 %0)
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
typedef scalar_t__ pid_t;

/* Variables and functions */
scalar_t__ getpid();
int /*<<< orphan*/ install_syscall_filter();
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
int main(int argc, char *argv[]) {
  pid_t id;
  time_t t;
  install_syscall_filter();
  time(&t);
  id = getpid();
  printf("%d\n", (int)id);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1060 <install_syscall_filter@plt>
lea    -0x1c(%rbp),%rdi
call   1050 <time@plt>
mov    $0x0,%al
call   1030 <getpid@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %eax,%esi
lea    0xe82(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1060 <install_syscall_filter@plt>
lea    0x4(%rsp),%rdi
call   1050 <time@plt>
xor    %eax,%eax
call   1030 <getpid@plt>
lea    0xea0(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i64
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = call i32 (...) @install_syscall_filter()
%9 = call i32 @time(i32* %7)
%10 = call i64 (...) @getpid()
store i64 %10, i64* %6
%11 = load i64, i64* %6
%12 = trunc i64 %11 to i32
%13 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %12)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = tail call i32 (...) @install_syscall_filter()
%6 = call i32 @time(i32* %3)
%7 = call i64 (...) @getpid()
%8 = trunc i64 %7 to i32
%9 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %8)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *freopen(char *, char *, int /*<<< orphan*/);
int /*<<< orphan*/ stdout;
int main(void) {
  FILE *fr = freopen("/dev/null", "w", stdout);
  if (fr != NULL)
    fclose(fr);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2eaa(%rip),%rax
mov    (%rax),%edx
lea    0xec1(%rip),%rdi
lea    0xec4(%rip),%rsi
call   1040 <freopen@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1163 <main+0x43>
mov    -0x10(%rbp),%rdi
call   1030 <fclose@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edx
lea    0xecf(%rip),%rdi
lea    0xed2(%rip),%rsi
call   1040 <freopen@plt>
test   %rax,%rax
je     114a <main+0x2a>
mov    %rax,%rdi
call   1030 <fclose@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [10 x i8] c"/dev/null\00"
@.str.1 = [2 x i8] c"w\00"
@stdout = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
store i32 0, i32* %1
%3 = load i32, i32* @stdout
%4 = call i32* @freopen(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i32 %3)
store i32* %4, i32** %2
%5 = load i32*, i32** %2
%6 = icmp ne i32* %5, null
br i1 %6, label %7, label %10
7: ; preds = %0
%8 = load i32*, i32** %2
%9 = call i32 @fclose(i32* %8)
br label %10
10: ; preds = %7, %0
ret i32 0
}

LLVM IR (-O2):
@.str = [10 x i8] c"/dev/null\00"
@.str.1 = [2 x i8] c"w\00"
@stdout = global i32 0
define i32 @main() {
%1 = load i32, i32* @stdout
%2 = tail call i32* @freopen(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i32 %1)
%3 = icmp eq i32* %2, null
br i1 %3, label %6, label %4
4: ; preds = %0
%5 = tail call i32 @fclose(i32* %2)
br label %6
6: ; preds = %4, %0
ret i32 0
}
float peso_ideal(float alt, char sexo) {
  float peso;
  if (sexo == 'H')
    peso = (72.7 * alt) - 58;
  else if (sexo == 'M')
    peso = (62.1 * alt) - 44.7;
  return peso;
}


x86 assembly (clang, -O0):
<peso_ideal>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
movss  %xmm0,-0x4(%rbp)
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x48,%eax
jne    114b <peso_ideal+0x4b>
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xee3(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xedf(%rip),%xmm1
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0xc(%rbp)
jmp    1187 <peso_ideal+0x87>
movsbl -0x5(%rbp),%eax
cmp    $0x4d,%eax
jne    1182 <peso_ideal+0x82>
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe97(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xe93(%rip),%xmm1
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0xc(%rbp)
jmp    1187 <peso_ideal+0x87>
movss  -0xc(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<peso_ideal>:
cmp    $0x4d,%dil
je     1122 <peso_ideal+0x22>
cmp    $0x48,%dil
jne    113d <peso_ideal+0x3d>
cvtss2sd %xmm0,%xmm0
mulsd  0xef8(%rip),%xmm0
addsd  0xef8(%rip),%xmm0
jmp    1136 <peso_ideal+0x36>
cvtss2sd %xmm0,%xmm0
mulsd  0xed2(%rip),%xmm0
addsd  0xed2(%rip),%xmm0
xorps  %xmm1,%xmm1
cvtsd2ss %xmm0,%xmm1
movaps %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @peso_ideal(float %0, i8 signext %1) {
%3 = alloca float
%4 = alloca i8
%5 = alloca float
store float %0, float* %3
store i8 %1, i8* %4
%6 = load i8, i8* %4
%7 = sext i8 %6 to i32
%8 = icmp eq i32 %7, 72
br i1 %8, label %9, label %14
9: ; preds = %2
%10 = load float, float* %3
%11 = fpext float %10 to double
%12 = call double @llvm.fmuladd.f64(double 7.270000e+01, double %11, double -5.800000e+01)
%13 = fptrunc double %12 to float
store float %13, float* %5
br label %24
14: ; preds = %2
%15 = load i8, i8* %4
%16 = sext i8 %15 to i32
%17 = icmp eq i32 %16, 77
br i1 %17, label %18, label %23
18: ; preds = %14
%19 = load float, float* %3
%20 = fpext float %19 to double
%21 = call double @llvm.fmuladd.f64(double 6.210000e+01, double %20, double -4.470000e+01)
%22 = fptrunc double %21 to float
store float %22, float* %5
br label %23
23: ; preds = %18, %14
br label %24
24: ; preds = %23, %9
%25 = load float, float* %5
ret float %25
}

LLVM IR (-O2):
define float @peso_ideal(float %0, i8 signext %1) {
switch i8 %1, label %11 [
i8 72, label %3
i8 77, label %7
]
3: ; preds = %2
%4 = fpext float %0 to double
%5 = tail call double @llvm.fmuladd.f64(double %4, double 7.270000e+01, double -5.800000e+01)
%6 = fptrunc double %5 to float
br label %11
7: ; preds = %2
%8 = fpext float %0 to double
%9 = tail call double @llvm.fmuladd.f64(double %8, double 6.210000e+01, double -4.470000e+01)
%10 = fptrunc double %9 to float
br label %11
11: ; preds = %2, %7, %3
%12 = phi float [ %6, %3 ], [ %10, %7 ], [ undef, %2 ]
ret float %12
}
/* Variables and functions */
int bdos(int, ...);
getchar() {
  register int c;
  if ((c = bdos(1)) == '\r') {
    bdos(2, '\n');
    c = '\n';
  } else if (c == 0x1a)
    c = -1;
  return c;
}


x86 assembly (clang, -O0):
<getchar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x1,%edi
mov    $0x0,%al
call   1030 <bdos@plt>
mov    %eax,-0x4(%rbp)
cmp    $0xd,%eax
jne    114d <getchar+0x3d>
mov    $0x2,%edi
mov    $0xa,%esi
mov    $0x0,%al
call   1030 <bdos@plt>
movl   $0xa,-0x4(%rbp)
jmp    1163 <getchar+0x53>
cmpl   $0x1a,-0x4(%rbp)
jne    115e <getchar+0x4e>
movl   $0xffffffff,-0x4(%rbp)
jmp    1163 <getchar+0x53>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getchar>:
push   %rbx
mov    $0x1,%edi
xor    %eax,%eax
call   1030 <bdos@plt>
cmp    $0xd,%eax
jne    113a <getchar+0x2a>
mov    $0xa,%ebx
mov    $0x2,%edi
mov    $0xa,%esi
xor    %eax,%eax
call   1030 <bdos@plt>
jmp    1145 <getchar+0x35>
cmp    $0x1a,%eax
mov    $0xffffffff,%ebx
cmovne %eax,%ebx
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @getchar() {
%1 = tail call i32 (i32, ...) @bdos(i32 1)
%2 = icmp eq i32 %1, 13
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 (i32, ...) @bdos(i32 2, i32 10)
br label %8
5: ; preds = %0
%6 = icmp eq i32 %1, 26
%7 = select i1 %6, i32 -1, i32 %1
br label %8
8: ; preds = %5, %3
%9 = phi i32 [ 10, %3 ], [ %7, %5 ]
ret i32 %9
}
/* Variables and functions */
int _ada_use_c2phc(int, int *, int *, double *);
int numbtrop_quaddobl_dimension(int *dim) {
  int fail, *b;
  double *c;
  fail = _ada_use_c2phc(731, dim, b, c);
  return fail;
}


x86 assembly (clang, -O0):
<numbtrop_quaddobl_dimension>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x2db,%edi
call   1030 <_ada_use_c2phc@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<numbtrop_quaddobl_dimension>:
mov    %rdi,%rsi
mov    $0x2db,%edi
jmp    1030 <_ada_use_c2phc@plt>

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

LLVM IR (-O2):
define i32 @numbtrop_quaddobl_dimension(i32* %0) {
%2 = tail call i32 @_ada_use_c2phc(i32 731, i32* %0, i32* undef, double* undef)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ scanf(char *, char *);
int main(void) {
  char buf[256];
  scanf("%s", buf);
  printf("buf = %s\n", buf);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x110,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x110(%rbp),%rsi
lea    0xec0(%rip),%rdi
call   1040 <scanf@plt>
lea    -0x110(%rbp),%rsi
lea    0xeb0(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x110,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x100,%rsp
lea    0xed1(%rip),%rdi
mov    %rsp,%rbx
mov    %rbx,%rsi
call   1040 <scanf@plt>
lea    0xec2(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x100,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
@.str.1 = [10 x i8] c"buf = %s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [256 x i8]
store i32 0, i32* %1
%3 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 0
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 0
%6 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8* %5)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
@.str.1 = [10 x i8] c"buf = %s\0A\00"
define i32 @main() {
%1 = alloca [256 x i8]
%2 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8* %2)
ret i32 0
}
double coco_max_double(const double a, const double b) {
  if (a >= b) {
    return a;
  } else {
    return b;
  }
}


x86 assembly (clang, -O0):
<coco_max_double>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
ucomisd -0x18(%rbp),%xmm0
jb     112d <coco_max_double+0x2d>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1137 <coco_max_double+0x37>
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<coco_max_double>:
movapd %xmm1,%xmm2
cmplesd %xmm0,%xmm2
andpd  %xmm2,%xmm0
andnpd %xmm1,%xmm2
orpd   %xmm2,%xmm0
ret

LLVM IR (-O0):
define double @coco_max_double(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
store double %0, double* %4
store double %1, double* %5
%6 = load double, double* %4
%7 = load double, double* %5
%8 = fcmp oge double %6, %7
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = load double, double* %4
store double %10, double* %3
br label %13
11: ; preds = %2
%12 = load double, double* %5
store double %12, double* %3
br label %13
13: ; preds = %11, %9
%14 = load double, double* %3
ret double %14
}

LLVM IR (-O2):
define double @coco_max_double(double %0, double %1) {
%3 = fcmp oge double %0, %1
%4 = select i1 %3, double %0, double %1
ret double %4
}
/* Variables and functions */
int /*<<< orphan*/ SetSize55(unsigned long, unsigned long);
void setsize(unsigned long w, unsigned long h) { SetSize55(w, h); }


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

x86 assembly (clang, -O2):
<setsize>:
jmp    1030 <SetSize55@plt>

LLVM IR (-O0):
define void @setsize(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 = call i32 @SetSize55(i64 %5, i64 %6)
ret void
}

LLVM IR (-O2):
define void @setsize(i64 %0, i64 %1) {
%3 = tail call i32 @SetSize55(i64 %0, i64 %1)
ret void
}
/* Type definitions */
typedef int ptr_arr;

/* Variables and functions */
long **malloc(int);
int main() {
  long a = 3;
  long b = 2;
  long **ptr_arr = malloc(sizeof(long *) * 3);
  ptr_arr[0] = &a;
  ptr_arr[1] = &b;
  ptr_arr[2] = &b;
  b = 5;
  return *(ptr_arr[0]) + *(ptr_arr[1]) + *(ptr_arr[2]);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0x3,-0x10(%rbp)
movq   $0x2,-0x18(%rbp)
mov    $0x18,%edi
call   1030 <malloc@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
lea    -0x10(%rbp),%rcx
mov    %rcx,(%rax)
mov    -0x20(%rbp),%rax
lea    -0x18(%rbp),%rcx
mov    %rcx,0x8(%rax)
mov    -0x20(%rbp),%rax
lea    -0x18(%rbp),%rcx
mov    %rcx,0x10(%rax)
movq   $0x5,-0x18(%rbp)
mov    -0x20(%rbp),%rax
mov    (%rax),%rax
mov    (%rax),%rax
mov    -0x20(%rbp),%rcx
mov    0x8(%rcx),%rcx
add    (%rcx),%rax
mov    -0x20(%rbp),%rcx
mov    0x10(%rcx),%rcx
add    (%rcx),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x18,%edi
call   1030 <malloc@plt>
mov    $0xd,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i64** @malloc(i32 24)
ret i32 13
}
int uabort() { return (0); }


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

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

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

LLVM IR (-O2):
define i32 @uabort() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ isspace(int);
int strisspace(const char *str) {
  while (*str)
    if (!isspace((int)*str++))
      return (0);
  return (1);
}


x86 assembly (clang, -O0):
<strisspace>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     115a <strisspace+0x4a>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movsbl (%rax),%edi
call   1030 <isspace@plt>
cmp    $0x0,%eax
jne    1155 <strisspace+0x45>
movl   $0x0,-0x4(%rbp)
jmp    1161 <strisspace+0x51>
jmp    111c <strisspace+0xc>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strisspace>:
push   %rbx
mov    %rdi,%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movsbl (%rbx),%edi
test   %edi,%edi
je     1138 <strisspace+0x28>
add    $0x1,%rbx
call   1030 <isspace@plt>
test   %eax,%eax
jne    1120 <strisspace+0x10>
xor    %eax,%eax
pop    %rbx
ret
mov    $0x1,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @strisspace(i8* nocapture %0) {
br label %2
2: ; preds = %6, %1
%3 = phi i8* [ %0, %1 ], [ %7, %6 ]
%4 = load i8, i8* %3
%5 = icmp eq i8 %4, 0
br i1 %5, label %11, label %6
6: ; preds = %2
%7 = getelementptr inbounds i8, i8* %3, i64 1
%8 = sext i8 %4 to i32
%9 = tail call i32 @isspace(i32 %8)
%10 = icmp eq i32 %9, 0
br i1 %10, label %11, label %2
11: ; preds = %2, %6
%12 = phi i32 [ 0, %6 ], [ 1, %2 ]
ret i32 %12
}