#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*/ EXIT_FAILURE;
int /*<<< orphan*/ debug_printf(char *, char const *, size_t, ...);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
void check_size_(size_t real_size, size_t intended_size, const char *name) {
  if (real_size != intended_size) {
    debug_printf("sizeof(%s) is %zi; expected %zi\n", name, real_size,
                 intended_size);
    exit(EXIT_FAILURE);
  } else {
    debug_printf("sizeof(%s) = %zi; OK\n", name, real_size);
  }
}


x86 assembly (clang, -O0):
<check_size_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
je     116a <check_size_+0x4a>
mov    -0x18(%rbp),%rsi
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
lea    0xeab(%rip),%rdi
mov    $0x0,%al
call   1030 <debug_printf@plt>
mov    0x2e7d(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>
mov    -0x18(%rbp),%rsi
mov    -0x8(%rbp),%rdx
lea    0xea8(%rip),%rdi
mov    $0x0,%al
call   1030 <debug_printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_size_>:
mov    %rdi,%rax
cmp    %rsi,%rdi
jne    113c <check_size_+0x1c>
lea    0xef2(%rip),%rdi
mov    %rdx,%rsi
mov    %rax,%rdx
xor    %eax,%eax
jmp    1030 <debug_printf@plt>
push   %rax
mov    %rsi,%rcx
lea    0xeb9(%rip),%rdi
mov    %rdx,%rsi
mov    %rax,%rdx
xor    %eax,%eax
call   1030 <debug_printf@plt>
mov    0x2e85(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [33 x i8] c"sizeof(%s) is %zi; expected %zi\0A\00"
@EXIT_FAILURE = global i32 0
@.str.1 = [22 x i8] c"sizeof(%s) = %zi; OK\0A\00"
define void @check_size_(i64 %0, i64 %1, i8* %2) {
%4 = alloca i64
%5 = alloca i64
%6 = alloca i8*
store i64 %0, i64* %4
store i64 %1, i64* %5
store i8* %2, i8** %6
%7 = load i64, i64* %4
%8 = load i64, i64* %5
%9 = icmp ne i64 %7, %8
br i1 %9, label %10, label %17
10: ; preds = %3
%11 = load i8*, i8** %6
%12 = load i64, i64* %4
%13 = load i64, i64* %5
%14 = call i32 (i8*, i8*, i64, ...) @debug_printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i8* %11, i64 %12, i64 %13)
%15 = load i32, i32* @EXIT_FAILURE
%16 = call i32 @exit(i32 %15)
unreachable
17: ; preds = %3
%18 = load i8*, i8** %6
%19 = load i64, i64* %4
%20 = call i32 (i8*, i8*, i64, ...) @debug_printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i8* %18, i64 %19)
br label %21
21: ; preds = %17
ret void
}

LLVM IR (-O2):
@.str = [33 x i8] c"sizeof(%s) is %zi; expected %zi\0A\00"
@EXIT_FAILURE = global i32 0
@.str.1 = [22 x i8] c"sizeof(%s) = %zi; OK\0A\00"
define void @check_size_(i64 %0, i64 %1, i8* %2) {
%4 = icmp eq i64 %0, %1
br i1 %4, label %9, label %5
5: ; preds = %3
%6 = tail call i32 (i8*, i8*, i64, ...) @debug_printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i8* %2, i64 %0, i64 %1)
%7 = load i32, i32* @EXIT_FAILURE
%8 = tail call i32 @exit(i32 %7)
unreachable
9: ; preds = %3
%10 = tail call i32 (i8*, i8*, i64, ...) @debug_printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i8* %2, i64 %0)
ret void
}