#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*/ gdt_set_entry(int, int /*<<< orphan*/, int, int, int);
void gdt_initialize() {
  gdt_set_entry(0, 0, 0, 0, 0);
  gdt_set_entry(1, 0, 0xFFFFFFFF, 0x80 | 0x00 | 0x10 | 0x08 | 0x02,
                0x08 | 0x04);
  gdt_set_entry(2, 0, 0xFFFFFFFF, 0x80 | 0x00 | 0x10 | 0x08 | 0x02,
                0x08 | 0x02);
  gdt_set_entry(3, 0, 0xFFFFFFFF, 0x80 | 0x00 | 0x10 | 0x02 | 0x00,
                0x08 | 0x04);
  gdt_set_entry(4, 0, 0xFFFFFFFF, 0x80 | 0x60 | 0x10 | 0x08 | 0x02,
                0x08 | 0x02);
  gdt_set_entry(5, 0, 0xFFFFFFFF, 0x80 | 0x60 | 0x10 | 0x02 | 0x00,
                0x08 | 0x04);
}


x86 assembly (clang, -O0):
<gdt_initialize>:
push   %rbp
mov    %rsp,%rbp
xor    %r8d,%r8d
mov    %r8d,%edi
mov    %r8d,%esi
mov    %r8d,%edx
mov    %r8d,%ecx
call   1030 <gdt_set_entry@plt>
mov    $0x1,%edi
xor    %esi,%esi
mov    $0xffffffff,%edx
mov    $0x9a,%ecx
mov    $0xc,%r8d
call   1030 <gdt_set_entry@plt>
mov    $0x2,%edi
xor    %esi,%esi
mov    $0xffffffff,%edx
mov    $0x9a,%ecx
mov    $0xa,%r8d
call   1030 <gdt_set_entry@plt>
mov    $0x3,%edi
xor    %esi,%esi
mov    $0xffffffff,%edx
mov    $0x92,%ecx
mov    $0xc,%r8d
call   1030 <gdt_set_entry@plt>
mov    $0x4,%edi
xor    %esi,%esi
mov    $0xffffffff,%edx
mov    $0xfa,%ecx
mov    $0xa,%r8d
call   1030 <gdt_set_entry@plt>
mov    $0x5,%edi
xor    %esi,%esi
mov    $0xffffffff,%edx
mov    $0xf2,%ecx
mov    $0xc,%r8d
call   1030 <gdt_set_entry@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<gdt_initialize>:
push   %rax
xor    %edi,%edi
xor    %esi,%esi
xor    %edx,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
call   1030 <gdt_set_entry@plt>
mov    $0x1,%edi
xor    %esi,%esi
mov    $0xffffffff,%edx
mov    $0x9a,%ecx
mov    $0xc,%r8d
call   1030 <gdt_set_entry@plt>
mov    $0x2,%edi
xor    %esi,%esi
mov    $0xffffffff,%edx
mov    $0x9a,%ecx
mov    $0xa,%r8d
call   1030 <gdt_set_entry@plt>
mov    $0x3,%edi
xor    %esi,%esi
mov    $0xffffffff,%edx
mov    $0x92,%ecx
mov    $0xc,%r8d
call   1030 <gdt_set_entry@plt>
mov    $0x4,%edi
xor    %esi,%esi
mov    $0xffffffff,%edx
mov    $0xfa,%ecx
mov    $0xa,%r8d
call   1030 <gdt_set_entry@plt>
mov    $0x5,%edi
xor    %esi,%esi
mov    $0xffffffff,%edx
mov    $0xf2,%ecx
mov    $0xc,%r8d
pop    %rax
jmp    1030 <gdt_set_entry@plt>

LLVM IR (-O0):
define void @gdt_initialize() {
%1 = call i32 @gdt_set_entry(i32 0, i32 0, i32 0, i32 0, i32 0)
%2 = call i32 @gdt_set_entry(i32 1, i32 0, i32 -1, i32 154, i32 12)
%3 = call i32 @gdt_set_entry(i32 2, i32 0, i32 -1, i32 154, i32 10)
%4 = call i32 @gdt_set_entry(i32 3, i32 0, i32 -1, i32 146, i32 12)
%5 = call i32 @gdt_set_entry(i32 4, i32 0, i32 -1, i32 250, i32 10)
%6 = call i32 @gdt_set_entry(i32 5, i32 0, i32 -1, i32 242, i32 12)
ret void
}

LLVM IR (-O2):
define void @gdt_initialize() {
%1 = tail call i32 @gdt_set_entry(i32 0, i32 0, i32 0, i32 0, i32 0)
%2 = tail call i32 @gdt_set_entry(i32 1, i32 0, i32 -1, i32 154, i32 12)
%3 = tail call i32 @gdt_set_entry(i32 2, i32 0, i32 -1, i32 154, i32 10)
%4 = tail call i32 @gdt_set_entry(i32 3, i32 0, i32 -1, i32 146, i32 12)
%5 = tail call i32 @gdt_set_entry(i32 4, i32 0, i32 -1, i32 250, i32 10)
%6 = tail call i32 @gdt_set_entry(i32 5, i32 0, i32 -1, i32 242, i32 12)
ret void
}