#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
int /*<<< orphan*/ printf(char *, struct free_block *, struct free_block *,
                          int);
int main(void) {
  struct free_block {
    char *addr;
    long size;
  };
  struct free_block *s, *e;
  long s1 = 0x8040a0a0;
  long s2 = s1 + 9 * sizeof(struct free_block);
  s = (struct free_block *)s1;
  e = (struct free_block *)s2;
  printf("e: %p, s: %p, e-s: %d\n", e, s, e - s);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x8040a0a0,%eax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
add    $0x90,%rax
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x28(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rax
mov    -0x10(%rbp),%rcx
sub    %rcx,%rax
sar    $0x4,%rax
mov    %eax,%ecx
lea    0xe9a(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x8040a0a0,%eax
lea    0x90(%rax),%rsi
lea    0xedc(%rip),%rdi
mov    $0x8040a0a0,%edx
mov    $0x9,%ecx
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.free_block = type { i8*, i64 }
%struct.free_block.0 = type opaque
@.str = [23 x i8] c"e: %p, s: %p, e-s: %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca %struct.free_block*
%3 = alloca %struct.free_block*
%4 = alloca i64
%5 = alloca i64
store i32 0, i32* %1
store i64 2151719072, i64* %4
%6 = load i64, i64* %4
%7 = add i64 %6, 144
store i64 %7, i64* %5
%8 = load i64, i64* %4
%9 = inttoptr i64 %8 to %struct.free_block*
store %struct.free_block* %9, %struct.free_block** %2
%10 = load i64, i64* %5
%11 = inttoptr i64 %10 to %struct.free_block*
store %struct.free_block* %11, %struct.free_block** %3
%12 = load %struct.free_block*, %struct.free_block** %3
%13 = bitcast %struct.free_block* %12 to %struct.free_block.0*
%14 = load %struct.free_block*, %struct.free_block** %2
%15 = bitcast %struct.free_block* %14 to %struct.free_block.0*
%16 = load %struct.free_block*, %struct.free_block** %3
%17 = load %struct.free_block*, %struct.free_block** %2
%18 = ptrtoint %struct.free_block* %16 to i64
%19 = ptrtoint %struct.free_block* %17 to i64
%20 = sub i64 %18, %19
%21 = sdiv exact i64 %20, 16
%22 = trunc i64 %21 to i32
%23 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), %struct.free_block.0* %13, %struct.free_block.0* %15, i32 %22)
ret i32 0
}

LLVM IR (-O2):
%struct.free_block = type { i8*, i64 }
%struct.free_block.0 = type opaque
@.str = [23 x i8] c"e: %p, s: %p, e-s: %d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), %struct.free_block.0* inttoptr (i64 2151719216 to %struct.free_block.0*), %struct.free_block.0* inttoptr (i64 2151719072 to %struct.free_block.0*), i32 9)
ret i32 0
}