#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(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int, ...);
int ntohl(int);
int /*<<< orphan*/ stderr;
void traps(void) {
  static char test[] __attribute__((aligned(sizeof(int)))) = "CONF";
  int *p = (int *)test;
  if (*p != ntohl(0x434f4e46)) {
    fprintf(stderr, "fixdep: sizeof(int) : %lu\n", (unsigned long)sizeof(int));
    fprintf(stderr,
            "fixdep: sizeof(int) != 4 or wrong endianness? %#x"
            " vs %#x\n",
            *p, ntohl(0x434f4e46));
    exit(2);
  }
}


x86 assembly (clang, -O0):
<traps>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    0x2ef9(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    $0x434f4e46,%edi
call   1050 <ntohl@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
cmp    %ecx,%eax
je     11be <traps+0x8e>
mov    0x2e76(%rip),%rax
mov    (%rax),%edi
lea    0xe8d(%rip),%rsi
mov    $0x4,%edx
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2e5a(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x10(%rbp)
mov    $0x434f4e46,%edi
call   1050 <ntohl@plt>
mov    -0x14(%rbp),%edi
mov    -0x10(%rbp),%edx
mov    %eax,%ecx
lea    0xe6e(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    $0x2,%edi
call   1040 <exit@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<traps>:
push   %r14
push   %rbx
push   %rax
mov    $0x434f4e46,%edi
call   1050 <ntohl@plt>
cmp    $0x464e4f43,%eax
jne    114d <traps+0x1d>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret
mov    %eax,%ebx
mov    0x2e8a(%rip),%r14
mov    (%r14),%edi
lea    0xea0(%rip),%rsi
mov    $0x4,%edx
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%r14),%edi
lea    0xea5(%rip),%rsi
mov    $0x464e4f43,%edx
mov    %ebx,%ecx
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    $0x2,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@traps.test = internal global [5 x i8] c"CONF\00"
@stderr = global i32 0
@.str = [27 x i8] c"fixdep: sizeof(int) : %lu\0A\00"
@.str.1 = [58 x i8] c"fixdep: sizeof(int) != 4 or wrong endianness? %#x vs %#x\0A\00"
define void @traps() {
%1 = alloca i32*
store i32* bitcast ([5 x i8]* @traps.test to i32*), i32** %1
%2 = load i32*, i32** %1
%3 = load i32, i32* %2
%4 = call i32 @ntohl(i32 1129270854)
%5 = icmp ne i32 %3, %4
br i1 %5, label %6, label %15
6: ; preds = %0
%7 = load i32, i32* @stderr
%8 = call i32 (i32, i8*, i32, ...) @fprintf(i32 %7, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 4)
%9 = load i32, i32* @stderr
%10 = load i32*, i32** %1
%11 = load i32, i32* %10
%12 = call i32 @ntohl(i32 1129270854)
%13 = call i32 (i32, i8*, i32, ...) @fprintf(i32 %9, i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str.1, i64 0, i64 0), i32 %11, i32 %12)
%14 = call i32 @exit(i32 2)
unreachable
15: ; preds = %0
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [27 x i8] c"fixdep: sizeof(int) : %lu\0A\00"
@.str.1 = [58 x i8] c"fixdep: sizeof(int) != 4 or wrong endianness? %#x vs %#x\0A\00"
define void @traps() {
%1 = tail call i32 @ntohl(i32 1129270854)
%2 = icmp eq i32 %1, 1179537219
br i1 %2, label %9, label %3
3: ; preds = %0
%4 = load i32, i32* @stderr
%5 = tail call i32 (i32, i8*, i32, ...) @fprintf(i32 %4, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 4)
%6 = load i32, i32* @stderr
%7 = tail call i32 (i32, i8*, i32, ...) @fprintf(i32 %6, i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str.1, i64 0, i64 0), i32 1179537219, i32 %1)
%8 = tail call i32 @exit(i32 2)
unreachable
9: ; preds = %0
ret void
}