#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;

/* Variables and functions */
int /*<<< orphan*/ htonl(int);
int /*<<< orphan*/ htons(int);
int /*<<< orphan*/ memset(int *, int /*<<< orphan*/, int);
int /*<<< orphan*/ setfield16(int *, int /*<<< orphan*/);
int /*<<< orphan*/ setfield32(int *, int /*<<< orphan*/);
uint8_t *fill_bootp_request(uint8_t *dhcp_message) {
  dhcp_message[0] = 1;
  dhcp_message[1] = 1;
  dhcp_message[2] = 6;
  dhcp_message[3] = 0;
  setfield16(&dhcp_message[8], 0);
  setfield16(&dhcp_message[10], htons(0x8000));
  setfield32(&dhcp_message[16], 0);
  setfield32(&dhcp_message[20], 0);
  setfield32(&dhcp_message[24], 0);
  memset(&dhcp_message[28 + 6], 0, (16 - 6) + 64 + 128);
  setfield32(&dhcp_message[236], htonl(0x63825363));
  return &dhcp_message[236 + 4];
}


x86 assembly (clang, -O0):
<fill_bootp_request>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movl   $0x1,(%rax)
mov    -0x8(%rbp),%rax
movl   $0x1,0x4(%rax)
mov    -0x8(%rbp),%rax
movl   $0x6,0x8(%rax)
mov    -0x8(%rbp),%rax
movl   $0x0,0xc(%rax)
mov    -0x8(%rbp),%rdi
add    $0x20,%rdi
xor    %esi,%esi
call   1030 <setfield16@plt>
mov    -0x8(%rbp),%rax
add    $0x28,%rax
mov    %rax,-0x18(%rbp)
mov    $0x8000,%edi
call   1040 <htons@plt>
mov    -0x18(%rbp),%rdi
mov    %eax,%esi
call   1030 <setfield16@plt>
mov    -0x8(%rbp),%rdi
add    $0x40,%rdi
xor    %esi,%esi
call   1050 <setfield32@plt>
mov    -0x8(%rbp),%rdi
add    $0x50,%rdi
xor    %esi,%esi
call   1050 <setfield32@plt>
mov    -0x8(%rbp),%rdi
add    $0x60,%rdi
xor    %esi,%esi
call   1050 <setfield32@plt>
mov    -0x8(%rbp),%rdi
add    $0x88,%rdi
xor    %esi,%esi
mov    $0xca,%edx
call   1070 <memset@plt>
mov    -0x8(%rbp),%rax
add    $0x3b0,%rax
mov    %rax,-0x10(%rbp)
mov    $0x63825363,%edi
call   1060 <htonl@plt>
mov    -0x10(%rbp),%rdi
mov    %eax,%esi
call   1050 <setfield32@plt>
mov    -0x8(%rbp),%rax
add    $0x3c0,%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fill_bootp_request>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
movaps 0xea2(%rip),%xmm0
movups %xmm0,(%rdi)
add    $0x20,%rdi
xor    %esi,%esi
call   1030 <setfield16@plt>
lea    0x28(%rbx),%r14
mov    $0x8000,%edi
call   1040 <htons@plt>
mov    %r14,%rdi
mov    %eax,%esi
call   1030 <setfield16@plt>
lea    0x40(%rbx),%rdi
xor    %esi,%esi
call   1050 <setfield32@plt>
lea    0x50(%rbx),%rdi
xor    %esi,%esi
call   1050 <setfield32@plt>
lea    0x60(%rbx),%rdi
xor    %esi,%esi
call   1050 <setfield32@plt>
lea    0x88(%rbx),%rdi
xor    %esi,%esi
mov    $0xca,%edx
call   1070 <memset@plt>
lea    0x3b0(%rbx),%r14
mov    $0x63825363,%edi
call   1060 <htonl@plt>
mov    %r14,%rdi
mov    %eax,%esi
call   1050 <setfield32@plt>
add    $0x3c0,%rbx
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32* @fill_bootp_request(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 0
store i32 1, i32* %4
%5 = load i32*, i32** %2
%6 = getelementptr inbounds i32, i32* %5, i64 1
store i32 1, i32* %6
%7 = load i32*, i32** %2
%8 = getelementptr inbounds i32, i32* %7, i64 2
store i32 6, i32* %8
%9 = load i32*, i32** %2
%10 = getelementptr inbounds i32, i32* %9, i64 3
store i32 0, i32* %10
%11 = load i32*, i32** %2
%12 = getelementptr inbounds i32, i32* %11, i64 8
%13 = call i32 @setfield16(i32* %12, i32 0)
%14 = load i32*, i32** %2
%15 = getelementptr inbounds i32, i32* %14, i64 10
%16 = call i32 @htons(i32 32768)
%17 = call i32 @setfield16(i32* %15, i32 %16)
%18 = load i32*, i32** %2
%19 = getelementptr inbounds i32, i32* %18, i64 16
%20 = call i32 @setfield32(i32* %19, i32 0)
%21 = load i32*, i32** %2
%22 = getelementptr inbounds i32, i32* %21, i64 20
%23 = call i32 @setfield32(i32* %22, i32 0)
%24 = load i32*, i32** %2
%25 = getelementptr inbounds i32, i32* %24, i64 24
%26 = call i32 @setfield32(i32* %25, i32 0)
%27 = load i32*, i32** %2
%28 = getelementptr inbounds i32, i32* %27, i64 34
%29 = call i32 @memset(i32* %28, i32 0, i32 202)
%30 = load i32*, i32** %2
%31 = getelementptr inbounds i32, i32* %30, i64 236
%32 = call i32 @htonl(i32 1669485411)
%33 = call i32 @setfield32(i32* %31, i32 %32)
%34 = load i32*, i32** %2
%35 = getelementptr inbounds i32, i32* %34, i64 240
ret i32* %35
}

LLVM IR (-O2):
define i32* @fill_bootp_request(i32* %0) {
%2 = bitcast i32* %0 to <4 x i32>*
store <4 x i32> <i32 1, i32 1, i32 6, i32 0>, <4 x i32>* %2
%3 = getelementptr inbounds i32, i32* %0, i64 8
%4 = tail call i32 @setfield16(i32* %3, i32 0)
%5 = getelementptr inbounds i32, i32* %0, i64 10
%6 = tail call i32 @htons(i32 32768)
%7 = tail call i32 @setfield16(i32* %5, i32 %6)
%8 = getelementptr inbounds i32, i32* %0, i64 16
%9 = tail call i32 @setfield32(i32* %8, i32 0)
%10 = getelementptr inbounds i32, i32* %0, i64 20
%11 = tail call i32 @setfield32(i32* %10, i32 0)
%12 = getelementptr inbounds i32, i32* %0, i64 24
%13 = tail call i32 @setfield32(i32* %12, i32 0)
%14 = getelementptr inbounds i32, i32* %0, i64 34
%15 = tail call i32 @memset(i32* %14, i32 0, i32 202)
%16 = getelementptr inbounds i32, i32* %0, i64 236
%17 = tail call i32 @htonl(i32 1669485411)
%18 = tail call i32 @setfield32(i32* %16, i32 %17)
%19 = getelementptr inbounds i32, i32* %0, i64 240
ret i32* %19
}