#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*/ protocol_mput(void *, int *, int, int *, int);
int protocol_mput_commit(void *);
int protocol_mput_int(void *p, int n, int *keys, int *values) {
  int i;
  for (i = 0; i < n; i++)
    protocol_mput(p, &keys[i], sizeof(int), &values[i], sizeof(int));
  return protocol_mput_commit(p);
}


x86 assembly (clang, -O0):
<protocol_mput_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
movl   $0x0,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1188 <protocol_mput_int+0x68>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
movslq -0x24(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rsi
mov    -0x20(%rbp),%rcx
movslq -0x24(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rcx
mov    $0x4,%r8d
mov    %r8d,%edx
call   1030 <protocol_mput@plt>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    113e <protocol_mput_int+0x1e>
mov    -0x8(%rbp),%rdi
call   1040 <protocol_mput_commit@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<protocol_mput_int>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rdi,%r15
test   %esi,%esi
jle    1167 <protocol_mput_int+0x47>
mov    %rcx,%r14
mov    %rdx,%rbx
mov    %esi,%r12d
nopl   0x0(%rax,%rax,1)
mov    %r15,%rdi
mov    %rbx,%rsi
mov    $0x4,%edx
mov    %r14,%rcx
mov    $0x4,%r8d
call   1030 <protocol_mput@plt>
add    $0x4,%r14
add    $0x4,%rbx
add    $0xffffffffffffffff,%r12
jne    1140 <protocol_mput_int+0x20>
mov    %r15,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1040 <protocol_mput_commit@plt>

LLVM IR (-O0):
define i32 @protocol_mput_int(i8* %0, i32 %1, i32* %2, i32* %3) {
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32*
%8 = alloca i32*
%9 = alloca i32
store i8* %0, i8** %5
store i32 %1, i32* %6
store i32* %2, i32** %7
store i32* %3, i32** %8
store i32 0, i32* %9
br label %10
10: ; preds = %25, %4
%11 = load i32, i32* %9
%12 = load i32, i32* %6
%13 = icmp slt i32 %11, %12
br i1 %13, label %14, label %28
14: ; preds = %10
%15 = load i8*, i8** %5
%16 = load i32*, i32** %7
%17 = load i32, i32* %9
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds i32, i32* %16, i64 %18
%20 = load i32*, i32** %8
%21 = load i32, i32* %9
%22 = sext i32 %21 to i64
%23 = getelementptr inbounds i32, i32* %20, i64 %22
%24 = call i32 @protocol_mput(i8* %15, i32* %19, i32 4, i32* %23, i32 4)
br label %25
25: ; preds = %14
%26 = load i32, i32* %9
%27 = add nsw i32 %26, 1
store i32 %27, i32* %9
br label %10
28: ; preds = %10
%29 = load i8*, i8** %5
%30 = call i32 @protocol_mput_commit(i8* %29)
ret i32 %30
}

LLVM IR (-O2):
define i32 @protocol_mput_int(i8* %0, i32 %1, i32* %2, i32* %3) {
%5 = icmp sgt i32 %1, 0
br i1 %5, label %6, label %15
6: ; preds = %4
%7 = zext i32 %1 to i64
br label %8
8: ; preds = %6, %8
%9 = phi i64 [ 0, %6 ], [ %13, %8 ]
%10 = getelementptr inbounds i32, i32* %2, i64 %9
%11 = getelementptr inbounds i32, i32* %3, i64 %9
%12 = tail call i32 @protocol_mput(i8* %0, i32* %10, i32 4, i32* %11, i32 4)
%13 = add nuw nsw i64 %9, 1
%14 = icmp eq i64 %13, %7
br i1 %14, label %15, label %8
15: ; preds = %8, %4
%16 = tail call i32 @protocol_mput_commit(i8* %0)
ret i32 %16
}