#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*/ fill_ipv4_lpm_table(int *, int, int /*<<< orphan*/);
int /*<<< orphan*/ fill_nexthops_table(int /*<<< orphan*/, int, int *, int *);
void init_simple() {
  uint8_t ip[4] = {10, 0, 99, 99};
  uint8_t mac[6] = {0xd2, 0x69, 0x0f, 0xa8, 0x39, 0x9c};
  uint8_t smac[6] = {0xd2, 0x69, 0x0f, 0x00, 0x00, 0x9c};
  uint8_t port = 15;
  uint32_t nhgrp = 0;
  fill_ipv4_lpm_table(ip, 16, nhgrp);
  fill_nexthops_table(nhgrp, port, smac, mac);
}


x86 assembly (clang, -O0):
<init_simple>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    0xed1(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0xece(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    0xecb(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xec8(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0xec5(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0x50(%rbp)
mov    0xec7(%rip),%rax
mov    %rax,-0x48(%rbp)
mov    0xec4(%rip),%rax
mov    %rax,-0x40(%rbp)
movl   $0xf,-0x54(%rbp)
movl   $0x0,-0x58(%rbp)
lea    -0x10(%rbp),%rdi
mov    -0x58(%rbp),%edx
mov    $0x10,%esi
call   1040 <fill_ipv4_lpm_table@plt>
mov    -0x58(%rbp),%edi
mov    -0x54(%rbp),%esi
lea    -0x50(%rbp),%rdx
lea    -0x30(%rbp),%rcx
call   1030 <fill_nexthops_table@plt>
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_simple>:
sub    $0x58,%rsp
movaps 0xed5(%rip),%xmm0
movaps %xmm0,0x40(%rsp)
mov    0xee9(%rip),%rax
mov    %rax,0x30(%rsp)
movaps 0xecd(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
mov    0xef1(%rip),%rax
mov    %rax,0x10(%rsp)
movaps 0xed5(%rip),%xmm0
movaps %xmm0,(%rsp)
lea    0x40(%rsp),%rdi
mov    $0x10,%esi
xor    %edx,%edx
call   1040 <fill_ipv4_lpm_table@plt>
mov    %rsp,%rdx
lea    0x20(%rsp),%rcx
xor    %edi,%edi
mov    $0xf,%esi
call   1030 <fill_nexthops_table@plt>
add    $0x58,%rsp
ret

LLVM IR (-O0):
@__const.init_simple.ip = [4 x i32] [i32 10, i32 0, i32 99, i32 99]
@__const.init_simple.mac = [6 x i32] [i32 210, i32 105, i32 15, i32 168, i32 57, i32 156]
@__const.init_simple.smac = [6 x i32] [i32 210, i32 105, i32 15, i32 0, i32 0, i32 156]
define void @init_simple() {
%1 = alloca [4 x i32]
%2 = alloca [6 x i32]
%3 = alloca [6 x i32]
%4 = alloca i32
%5 = alloca i32
%6 = bitcast [4 x i32]* %1 to i8*
%7 = bitcast [6 x i32]* %2 to i8*
%8 = bitcast [6 x i32]* %3 to i8*
store i32 15, i32* %4
store i32 0, i32* %5
%9 = getelementptr inbounds [4 x i32], [4 x i32]* %1, i64 0, i64 0
%10 = load i32, i32* %5
%11 = call i32 @fill_ipv4_lpm_table(i32* %9, i32 16, i32 %10)
%12 = load i32, i32* %5
%13 = load i32, i32* %4
%14 = getelementptr inbounds [6 x i32], [6 x i32]* %3, i64 0, i64 0
%15 = getelementptr inbounds [6 x i32], [6 x i32]* %2, i64 0, i64 0
%16 = call i32 @fill_nexthops_table(i32 %12, i32 %13, i32* %14, i32* %15)
ret void
}

LLVM IR (-O2):
@__const.init_simple.ip = [4 x i32] [i32 10, i32 0, i32 99, i32 99]
@__const.init_simple.mac = [6 x i32] [i32 210, i32 105, i32 15, i32 168, i32 57, i32 156]
@__const.init_simple.smac = [6 x i32] [i32 210, i32 105, i32 15, i32 0, i32 0, i32 156]
define void @init_simple() {
%1 = alloca [4 x i32]
%2 = alloca [6 x i32]
%3 = alloca [6 x i32]
%4 = bitcast [4 x i32]* %1 to i8*
%5 = bitcast [6 x i32]* %2 to i8*
%6 = bitcast [6 x i32]* %3 to i8*
%7 = getelementptr inbounds [4 x i32], [4 x i32]* %1, i64 0, i64 0
%8 = call i32 @fill_ipv4_lpm_table(i32* %7, i32 16, i32 0)
%9 = getelementptr inbounds [6 x i32], [6 x i32]* %3, i64 0, i64 0
%10 = getelementptr inbounds [6 x i32], [6 x i32]* %2, i64 0, i64 0
%11 = call i32 @fill_nexthops_table(i32 0, i32 15, i32* %9, i32* %10)
ret void
}