#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 *);
int /*<<< orphan*/ set_default_action_ipv4_lpm();
int /*<<< orphan*/ set_default_action_nexthops();
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;
  set_default_action_nexthops();
  set_default_action_ipv4_lpm();
  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    0xeb1(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0xeae(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    0xeab(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xea8(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0xea5(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xeaa(%rip),%rax
mov    %rax,-0x50(%rbp)
mov    0xea7(%rip),%rax
mov    %rax,-0x48(%rbp)
mov    0xea4(%rip),%rax
mov    %rax,-0x40(%rbp)
movl   $0xf,-0x54(%rbp)
movl   $0x0,-0x58(%rbp)
mov    $0x0,%al
call   1050 <set_default_action_nexthops@plt>
mov    $0x0,%al
call   1040 <set_default_action_ipv4_lpm@plt>
lea    -0x10(%rbp),%rdi
mov    -0x58(%rbp),%edx
mov    $0x10,%esi
call   1060 <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 0xeb5(%rip),%xmm0
movaps %xmm0,0x40(%rsp)
mov    0xec9(%rip),%rax
mov    %rax,0x30(%rsp)
movaps 0xead(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
mov    0xed1(%rip),%rax
mov    %rax,0x10(%rsp)
movaps 0xeb5(%rip),%xmm0
movaps %xmm0,(%rsp)
xor    %eax,%eax
call   1050 <set_default_action_nexthops@plt>
xor    %eax,%eax
call   1040 <set_default_action_ipv4_lpm@plt>
lea    0x40(%rsp),%rdi
mov    $0x10,%esi
xor    %edx,%edx
call   1060 <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 = call i32 (...) @set_default_action_nexthops()
%10 = call i32 (...) @set_default_action_ipv4_lpm()
%11 = getelementptr inbounds [4 x i32], [4 x i32]* %1, i64 0, i64 0
%12 = load i32, i32* %5
%13 = call i32 @fill_ipv4_lpm_table(i32* %11, i32 16, i32 %12)
%14 = load i32, i32* %5
%15 = load i32, i32* %4
%16 = getelementptr inbounds [6 x i32], [6 x i32]* %3, i64 0, i64 0
%17 = getelementptr inbounds [6 x i32], [6 x i32]* %2, i64 0, i64 0
%18 = call i32 @fill_nexthops_table(i32 %14, i32 %15, i32* %16, i32* %17)
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 = tail call i32 (...) @set_default_action_nexthops()
%8 = tail call i32 (...) @set_default_action_ipv4_lpm()
%9 = getelementptr inbounds [4 x i32], [4 x i32]* %1, i64 0, i64 0
%10 = call i32 @fill_ipv4_lpm_table(i32* %9, i32 16, i32 0)
%11 = getelementptr inbounds [6 x i32], [6 x i32]* %3, i64 0, i64 0
%12 = getelementptr inbounds [6 x i32], [6 x i32]* %2, i64 0, i64 0
%13 = call i32 @fill_nexthops_table(i32 0, i32 15, i32* %11, i32* %12)
ret void
}