#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 */
typedef int uint8_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ fat_uint24(int *, int);
int /*<<< orphan*/ fat_uint32(int *, int /*<<< orphan*/);
void fat_partition(uint8_t *entry, uint32_t first_sector, uint32_t size) {
  entry[0] = 0x00;
  fat_uint24(entry + 1, 0x000101);
  entry[4] = 0x0b;
  fat_uint24(entry + 5, 0xfffffe);
  fat_uint32(entry + 8, first_sector);
  fat_uint32(entry + 12, size);
}


x86 assembly (clang, -O0):
<fat_partition>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movl   $0x0,(%rax)
mov    -0x8(%rbp),%rdi
add    $0x4,%rdi
mov    $0x101,%esi
call   1030 <fat_uint24@plt>
mov    -0x8(%rbp),%rax
movl   $0xb,0x10(%rax)
mov    -0x8(%rbp),%rdi
add    $0x14,%rdi
mov    $0xfffffe,%esi
call   1030 <fat_uint24@plt>
mov    -0x8(%rbp),%rdi
add    $0x20,%rdi
mov    -0xc(%rbp),%esi
call   1040 <fat_uint32@plt>
mov    -0x8(%rbp),%rdi
add    $0x30,%rdi
mov    -0x10(%rbp),%esi
call   1040 <fat_uint32@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fat_partition>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%r14d
mov    %esi,%ebp
mov    %rdi,%rbx
movl   $0x0,(%rdi)
add    $0x4,%rdi
mov    $0x101,%esi
call   1030 <fat_uint24@plt>
movl   $0xb,0x10(%rbx)
lea    0x14(%rbx),%rdi
mov    $0xfffffe,%esi
call   1030 <fat_uint24@plt>
lea    0x20(%rbx),%rdi
mov    %ebp,%esi
call   1040 <fat_uint32@plt>
add    $0x30,%rbx
mov    %rbx,%rdi
mov    %r14d,%esi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <fat_uint32@plt>

LLVM IR (-O0):
define void @fat_partition(i32* %0, i32 %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
store i32* %0, i32** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32*, i32** %4
%8 = getelementptr inbounds i32, i32* %7, i64 0
store i32 0, i32* %8
%9 = load i32*, i32** %4
%10 = getelementptr inbounds i32, i32* %9, i64 1
%11 = call i32 @fat_uint24(i32* %10, i32 257)
%12 = load i32*, i32** %4
%13 = getelementptr inbounds i32, i32* %12, i64 4
store i32 11, i32* %13
%14 = load i32*, i32** %4
%15 = getelementptr inbounds i32, i32* %14, i64 5
%16 = call i32 @fat_uint24(i32* %15, i32 16777214)
%17 = load i32*, i32** %4
%18 = getelementptr inbounds i32, i32* %17, i64 8
%19 = load i32, i32* %5
%20 = call i32 @fat_uint32(i32* %18, i32 %19)
%21 = load i32*, i32** %4
%22 = getelementptr inbounds i32, i32* %21, i64 12
%23 = load i32, i32* %6
%24 = call i32 @fat_uint32(i32* %22, i32 %23)
ret void
}

LLVM IR (-O2):
define void @fat_partition(i32* %0, i32 %1, i32 %2) {
store i32 0, i32* %0
%4 = getelementptr inbounds i32, i32* %0, i64 1
%5 = tail call i32 @fat_uint24(i32* %4, i32 257)
%6 = getelementptr inbounds i32, i32* %0, i64 4
store i32 11, i32* %6
%7 = getelementptr inbounds i32, i32* %0, i64 5
%8 = tail call i32 @fat_uint24(i32* %7, i32 16777214)
%9 = getelementptr inbounds i32, i32* %0, i64 8
%10 = tail call i32 @fat_uint32(i32* %9, i32 %1)
%11 = getelementptr inbounds i32, i32* %0, i64 12
%12 = tail call i32 @fat_uint32(i32* %11, i32 %2)
ret void
}