#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 */
unsigned int atoi(char *);
int ip_rthash4(int *);
int /*<<< orphan*/ printf(char *, int, int);
int main(int argc, char **argv) {
  uint8_t saddr[] = {10, 1, 200, 1};
  unsigned int i, j;
  unsigned int l3 = atoi(argv[1]), l4 = atoi(argv[2]);
  for (j = 1; j < l3; ++j) {
    saddr[2] = j;
    for (i = 1; i < l4; ++i) {
      saddr[3] = i;
      printf("%d %d\n", saddr[3], ip_rthash4(saddr));
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0xeb3(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xeb0(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1050 <atoi@plt>
mov    %eax,-0x2c(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
call   1050 <atoi@plt>
mov    %eax,-0x30(%rbp)
movl   $0x1,-0x28(%rbp)
mov    -0x28(%rbp),%eax
cmp    -0x2c(%rbp),%eax
jae    11ef <main+0xbf>
mov    -0x28(%rbp),%eax
mov    %eax,-0x18(%rbp)
movl   $0x1,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0x30(%rbp),%eax
jae    11dc <main+0xac>
mov    -0x24(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x34(%rbp)
lea    -0x20(%rbp),%rdi
call   1040 <ip_rthash4@plt>
mov    -0x34(%rbp),%esi
mov    %eax,%edx
lea    0xe47(%rip),%rdi
call   1030 <printf@plt>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    119c <main+0x6c>
jmp    11e1 <main+0xb1>
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    1183 <main+0x53>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %rsi,%rbx
movaps 0xeb8(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    0x8(%rsi),%rdi
call   1050 <atoi@plt>
mov    %eax,%r14d
mov    0x10(%rbx),%rdi
call   1050 <atoi@plt>
cmp    $0x2,%r14d
jb     11c1 <main+0x91>
mov    %eax,%ebp
mov    $0x1,%r13d
mov    %rsp,%r15
lea    0xe97(%rip),%r12
jmp    1189 <main+0x59>
nopl   0x0(%rax,%rax,1)
add    $0x1,%r13d
cmp    %r14d,%r13d
je     11c1 <main+0x91>
mov    %r13d,0x8(%rsp)
cmp    $0x2,%ebp
jb     1180 <main+0x50>
mov    $0x1,%ebx
nopl   0x0(%rax,%rax,1)
mov    %ebx,0xc(%rsp)
mov    %r15,%rdi
call   1040 <ip_rthash4@plt>
mov    %r12,%rdi
mov    %ebx,%esi
mov    %eax,%edx
call   1030 <printf@plt>
add    $0x1,%ebx
cmp    %ebx,%ebp
jne    11a0 <main+0x70>
jmp    1180 <main+0x50>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@__const.main.saddr = [4 x i32] [i32 10, i32 1, i32 200, i32 1]
@.str = [7 x i8] c"%d %d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [4 x i32]
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%11 = bitcast [4 x i32]* %6 to i8*
%12 = load i8**, i8*** %5
%13 = getelementptr inbounds i8*, i8** %12, i64 1
%14 = load i8*, i8** %13
%15 = call i32 @atoi(i8* %14)
store i32 %15, i32* %9
%16 = load i8**, i8*** %5
%17 = getelementptr inbounds i8*, i8** %16, i64 2
%18 = load i8*, i8** %17
%19 = call i32 @atoi(i8* %18)
store i32 %19, i32* %10
store i32 1, i32* %8
br label %20
20: ; preds = %43, %2
%21 = load i32, i32* %8
%22 = load i32, i32* %9
%23 = icmp ult i32 %21, %22
br i1 %23, label %24, label %46
24: ; preds = %20
%25 = load i32, i32* %8
%26 = getelementptr inbounds [4 x i32], [4 x i32]* %6, i64 0, i64 2
store i32 %25, i32* %26
store i32 1, i32* %7
br label %27
27: ; preds = %39, %24
%28 = load i32, i32* %7
%29 = load i32, i32* %10
%30 = icmp ult i32 %28, %29
br i1 %30, label %31, label %42
31: ; preds = %27
%32 = load i32, i32* %7
%33 = getelementptr inbounds [4 x i32], [4 x i32]* %6, i64 0, i64 3
store i32 %32, i32* %33
%34 = getelementptr inbounds [4 x i32], [4 x i32]* %6, i64 0, i64 3
%35 = load i32, i32* %34
%36 = getelementptr inbounds [4 x i32], [4 x i32]* %6, i64 0, i64 0
%37 = call i32 @ip_rthash4(i32* %36)
%38 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %35, i32 %37)
br label %39
39: ; preds = %31
%40 = load i32, i32* %7
%41 = add i32 %40, 1
store i32 %41, i32* %7
br label %27
42: ; preds = %27
br label %43
43: ; preds = %42
%44 = load i32, i32* %8
%45 = add i32 %44, 1
store i32 %45, i32* %8
br label %20
46: ; preds = %20
ret i32 0
}

LLVM IR (-O2):
@__const.main.saddr = [4 x i32] [i32 10, i32 1, i32 200, i32 1]
@.str = [7 x i8] c"%d %d\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [4 x i32]
%4 = bitcast [4 x i32]* %3 to i8*
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = tail call i32 @atoi(i8* %6)
%8 = getelementptr inbounds i8*, i8** %1, i64 2
%9 = load i8*, i8** %8
%10 = tail call i32 @atoi(i8* %9)
%11 = icmp ugt i32 %7, 1
br i1 %11, label %12, label %28
12: ; preds = %2
%13 = getelementptr inbounds [4 x i32], [4 x i32]* %3, i64 0, i64 2
%14 = icmp ugt i32 %10, 1
%15 = getelementptr inbounds [4 x i32], [4 x i32]* %3, i64 0, i64 3
%16 = getelementptr inbounds [4 x i32], [4 x i32]* %3, i64 0, i64 0
br label %17
17: ; preds = %12, %25
%18 = phi i32 [ 1, %12 ], [ %26, %25 ]
store i32 %18, i32* %13
br i1 %14, label %19, label %25
19: ; preds = %17, %19
%20 = phi i32 [ %23, %19 ], [ 1, %17 ]
store i32 %20, i32* %15
%21 = call i32 @ip_rthash4(i32* %16)
%22 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %20, i32 %21)
%23 = add nuw i32 %20, 1
%24 = icmp eq i32 %23, %10
br i1 %24, label %25, label %19
25: ; preds = %19, %17
%26 = add nuw i32 %18, 1
%27 = icmp eq i32 %26, %7
br i1 %27, label %28, label %17
28: ; preds = %25, %2
ret i32 0
}