#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*/ atoi(char *);
int /*<<< orphan*/ generateUdpPacket(char *, char *, char *, int /*<<< orphan*/,
                                     int /*<<< orphan*/, char *);
int /*<<< orphan*/ printf(char *);
int main(int argc, char *argv[]) {
  if (argc < 6) {
    printf("Usage: ./generator interface srcIPv4Address destIPv4Address "
           "srcPort destPort");
  }
  char interface[20], srcIPv4Address[20], destIPv4Address[20];
  generateUdpPacket(argv[1], argv[2], argv[3], atoi(argv[4]), atoi(argv[5]),
                    "TestMessage");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x6,-0x8(%rbp)
jge    115f <main+0x2f>
lea    0xea6(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x90(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rax
mov    %rax,-0x88(%rbp)
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rax
mov    %rax,-0x80(%rbp)
mov    -0x10(%rbp),%rax
mov    0x20(%rax),%rdi
call   1050 <atoi@plt>
mov    %eax,-0x74(%rbp)
mov    -0x10(%rbp),%rax
mov    0x28(%rax),%rdi
call   1050 <atoi@plt>
mov    -0x90(%rbp),%rdi
mov    -0x88(%rbp),%rsi
mov    -0x80(%rbp),%rdx
mov    -0x74(%rbp),%ecx
mov    %eax,%r8d
lea    0xe88(%rip),%r9
call   1040 <generateUdpPacket@plt>
mov    -0x4(%rbp),%eax
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %rsi,%rbx
cmp    $0x5,%edi
jg     114c <main+0x1c>
lea    0xeb9(%rip),%rdi
call   1030 <printf@plt>
mov    0x8(%rbx),%r14
mov    0x10(%rbx),%r15
mov    0x18(%rbx),%r12
mov    0x20(%rbx),%rdi
call   1050 <atoi@plt>
mov    %eax,%ebp
mov    0x28(%rbx),%rdi
call   1050 <atoi@plt>
lea    0xeda(%rip),%r9
mov    %r14,%rdi
mov    %r15,%rsi
mov    %r12,%rdx
mov    %ebp,%ecx
mov    %eax,%r8d
call   1040 <generateUdpPacket@plt>
xor    %eax,%eax
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [77 x i8] c"Usage: ./generator interface srcIPv4Address destIPv4Address srcPort destPort\00"
@.str.1 = [12 x i8] c"TestMessage\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [20 x i8]
%7 = alloca [20 x i8]
%8 = alloca [20 x i8]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%9 = load i32, i32* %4
%10 = icmp slt i32 %9, 6
br i1 %10, label %11, label %13
11: ; preds = %2
%12 = call i32 @printf(i8* getelementptr inbounds ([77 x i8], [77 x i8]* @.str, i64 0, i64 0))
br label %13
13: ; preds = %11, %2
%14 = load i8**, i8*** %5
%15 = getelementptr inbounds i8*, i8** %14, i64 1
%16 = load i8*, i8** %15
%17 = load i8**, i8*** %5
%18 = getelementptr inbounds i8*, i8** %17, i64 2
%19 = load i8*, i8** %18
%20 = load i8**, i8*** %5
%21 = getelementptr inbounds i8*, i8** %20, i64 3
%22 = load i8*, i8** %21
%23 = load i8**, i8*** %5
%24 = getelementptr inbounds i8*, i8** %23, i64 4
%25 = load i8*, i8** %24
%26 = call i32 @atoi(i8* %25)
%27 = load i8**, i8*** %5
%28 = getelementptr inbounds i8*, i8** %27, i64 5
%29 = load i8*, i8** %28
%30 = call i32 @atoi(i8* %29)
%31 = call i32 @generateUdpPacket(i8* %16, i8* %19, i8* %22, i32 %26, i32 %30, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
%32 = load i32, i32* %3
ret i32 %32
}

LLVM IR (-O2):
@.str = [77 x i8] c"Usage: ./generator interface srcIPv4Address destIPv4Address srcPort destPort\00"
@.str.1 = [12 x i8] c"TestMessage\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp slt i32 %0, 6
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([77 x i8], [77 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %2
%7 = getelementptr inbounds i8*, i8** %1, i64 1
%8 = load i8*, i8** %7
%9 = getelementptr inbounds i8*, i8** %1, i64 2
%10 = load i8*, i8** %9
%11 = getelementptr inbounds i8*, i8** %1, i64 3
%12 = load i8*, i8** %11
%13 = getelementptr inbounds i8*, i8** %1, i64 4
%14 = load i8*, i8** %13
%15 = tail call i32 @atoi(i8* %14)
%16 = getelementptr inbounds i8*, i8** %1, i64 5
%17 = load i8*, i8** %16
%18 = tail call i32 @atoi(i8* %17)
%19 = tail call i32 @generateUdpPacket(i8* %8, i8* %10, i8* %12, i32 %15, i32 %18, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}