#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*/ AF_PACKET;
int /*<<< orphan*/ ETH_P_ARP;
int /*<<< orphan*/ SOCK_DGRAM;
int /*<<< orphan*/ htons(int /*<<< orphan*/);
int /*<<< orphan*/ socket(int /*<<< orphan*/, int /*<<< orphan*/,
                          int /*<<< orphan*/);
void timer_kmalloc_pad() {
  int i;
  for (i = 0; i < 4; i++) {
    socket(AF_PACKET, SOCK_DGRAM, htons(ETH_P_ARP));
  }
}


x86 assembly (clang, -O0):
<timer_kmalloc_pad>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
cmpl   $0x4,-0x4(%rbp)
jge    117a <timer_kmalloc_pad+0x5a>
mov    0x2e98(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    0x2e9c(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x8(%rbp)
mov    0x2e78(%rip),%rax
mov    (%rax),%edi
call   1030 <htons@plt>
mov    -0xc(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    %eax,%edx
call   1040 <socket@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    112f <timer_kmalloc_pad+0xf>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<timer_kmalloc_pad>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    0x2ea9(%rip),%r14
mov    (%r14),%ebx
mov    0x2eaf(%rip),%r15
mov    (%r15),%ebp
mov    0x2e8d(%rip),%r12
mov    (%r12),%edi
call   1030 <htons@plt>
mov    %ebx,%edi
mov    %ebp,%esi
mov    %eax,%edx
call   1040 <socket@plt>
mov    (%r14),%ebx
mov    (%r15),%ebp
mov    (%r12),%edi
call   1030 <htons@plt>
mov    %ebx,%edi
mov    %ebp,%esi
mov    %eax,%edx
call   1040 <socket@plt>
mov    (%r14),%ebx
mov    (%r15),%ebp
mov    (%r12),%edi
call   1030 <htons@plt>
mov    %ebx,%edi
mov    %ebp,%esi
mov    %eax,%edx
call   1040 <socket@plt>
mov    (%r14),%ebx
mov    (%r15),%ebp
mov    (%r12),%edi
call   1030 <htons@plt>
mov    %ebx,%edi
mov    %ebp,%esi
mov    %eax,%edx
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <socket@plt>

LLVM IR (-O0):
@AF_PACKET = global i32 0
@SOCK_DGRAM = global i32 0
@ETH_P_ARP = global i32 0
define void @timer_kmalloc_pad() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %11, %0
%3 = load i32, i32* %1
%4 = icmp slt i32 %3, 4
br i1 %4, label %5, label %14
5: ; preds = %2
%6 = load i32, i32* @AF_PACKET
%7 = load i32, i32* @SOCK_DGRAM
%8 = load i32, i32* @ETH_P_ARP
%9 = call i32 @htons(i32 %8)
%10 = call i32 @socket(i32 %6, i32 %7, i32 %9)
br label %11
11: ; preds = %5
%12 = load i32, i32* %1
%13 = add nsw i32 %12, 1
store i32 %13, i32* %1
br label %2
14: ; preds = %2
ret void
}

LLVM IR (-O2):
@AF_PACKET = global i32 0
@SOCK_DGRAM = global i32 0
@ETH_P_ARP = global i32 0
define void @timer_kmalloc_pad() {
%1 = load i32, i32* @AF_PACKET
%2 = load i32, i32* @SOCK_DGRAM
%3 = load i32, i32* @ETH_P_ARP
%4 = tail call i32 @htons(i32 %3)
%5 = tail call i32 @socket(i32 %1, i32 %2, i32 %4)
%6 = load i32, i32* @AF_PACKET
%7 = load i32, i32* @SOCK_DGRAM
%8 = load i32, i32* @ETH_P_ARP
%9 = tail call i32 @htons(i32 %8)
%10 = tail call i32 @socket(i32 %6, i32 %7, i32 %9)
%11 = load i32, i32* @AF_PACKET
%12 = load i32, i32* @SOCK_DGRAM
%13 = load i32, i32* @ETH_P_ARP
%14 = tail call i32 @htons(i32 %13)
%15 = tail call i32 @socket(i32 %11, i32 %12, i32 %14)
%16 = load i32, i32* @AF_PACKET
%17 = load i32, i32* @SOCK_DGRAM
%18 = load i32, i32* @ETH_P_ARP
%19 = tail call i32 @htons(i32 %18)
%20 = tail call i32 @socket(i32 %16, i32 %17, i32 %19)
ret void
}