#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 /*<<< orphan*/ value;
typedef int /*<<< orphan*/ key;

/* Variables and functions */
int /*<<< orphan*/ BPF_ANY;
int /*<<< orphan*/ BPF_EXIST;
int /*<<< orphan*/ BPF_MAP_TYPE_ARRAY;
int /*<<< orphan*/ BPF_NOEXIST;
scalar_t__ E2BIG;
scalar_t__ EEXIST;
scalar_t__ EINVAL;
scalar_t__ ENOENT;
int /*<<< orphan*/ assert(int);
int bpf_create_map(int /*<<< orphan*/, int, int, int, int /*<<< orphan*/);
int bpf_delete_elem(int, int *);
int bpf_get_next_key(int, int *, int *);
int bpf_lookup_elem(int, int *, long long *);
int bpf_update_elem(int, int *, long long *, int /*<<< orphan*/);
int /*<<< orphan*/ close(int);
scalar_t__ errno;
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, char *);
char *strerror(scalar_t__);
void test_arraymap_sanity(int i, void *data) {
  int key, next_key, map_fd;
  long long value;
  map_fd = bpf_create_map(BPF_MAP_TYPE_ARRAY, sizeof(key), sizeof(value), 2, 0);
  if (map_fd < 0) {
    printf("failed to create arraymap '%s'\n", strerror(errno));
    exit(1);
  }
  key = 1;
  value = 1234;
  assert(bpf_update_elem(map_fd, &key, &value, BPF_ANY) == 0);
  value = 0;
  assert(bpf_update_elem(map_fd, &key, &value, BPF_NOEXIST) == -1 &&
         errno == EEXIST);
  assert(bpf_lookup_elem(map_fd, &key, &value) == 0 && value == 1234);
  key = 0;
  assert(bpf_lookup_elem(map_fd, &key, &value) == 0 && value == 0);
  key = 2;
  assert(bpf_update_elem(map_fd, &key, &value, BPF_EXIST) == -1 &&
         errno == E2BIG);
  assert(bpf_lookup_elem(map_fd, &key, &value) == -1 && errno == ENOENT);
  assert(bpf_get_next_key(map_fd, &key, &next_key) == 0 && next_key == 0);
  assert(bpf_get_next_key(map_fd, &next_key, &next_key) == 0 && next_key == 1);
  assert(bpf_get_next_key(map_fd, &next_key, &next_key) == -1 &&
         errno == ENOENT);
  key = 1;
  assert(bpf_delete_elem(map_fd, &key) == -1 && errno == EINVAL);
  close(map_fd);
}


x86 assembly (clang, -O0):
<test_arraymap_sanity>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2e12(%rip),%rax
mov    (%rax),%edi
mov    $0x4,%esi
mov    $0x8,%edx
mov    $0x2,%ecx
xor    %r8d,%r8d
call   1060 <bpf_create_map@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
jge    1204 <test_arraymap_sanity+0x64>
mov    0x2dd5(%rip),%rax
mov    (%rax),%rdi
call   10b0 <strerror@plt>
mov    %rax,%rsi
lea    0xe0b(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1090 <exit@plt>
movl   $0x1,-0x14(%rbp)
movq   $0x4d2,-0x28(%rbp)
mov    -0x1c(%rbp),%edi
mov    0x2dbb(%rip),%rax
mov    (%rax),%ecx
lea    -0x14(%rbp),%rsi
lea    -0x28(%rbp),%rdx
call   1070 <bpf_update_elem@plt>
cmp    $0x0,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
movq   $0x0,-0x28(%rbp)
mov    -0x1c(%rbp),%edi
mov    0x2d72(%rip),%rax
mov    (%rax),%ecx
lea    -0x14(%rbp),%rsi
lea    -0x28(%rbp),%rdx
call   1070 <bpf_update_elem@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0xffffffff,%ecx
mov    %al,-0x29(%rbp)
jne    1287 <test_arraymap_sanity+0xe7>
mov    0x2d44(%rip),%rax
mov    (%rax),%rax
mov    0x2d52(%rip),%rcx
cmp    (%rcx),%rax
sete   %al
mov    %al,-0x29(%rbp)
mov    -0x29(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
mov    -0x1c(%rbp),%edi
lea    -0x14(%rbp),%rsi
lea    -0x28(%rbp),%rdx
call   1080 <bpf_lookup_elem@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x2a(%rbp)
jne    12c2 <test_arraymap_sanity+0x122>
cmpq   $0x4d2,-0x28(%rbp)
sete   %al
mov    %al,-0x2a(%rbp)
mov    -0x2a(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
movl   $0x0,-0x14(%rbp)
mov    -0x1c(%rbp),%edi
lea    -0x14(%rbp),%rsi
lea    -0x28(%rbp),%rdx
call   1080 <bpf_lookup_elem@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x2b(%rbp)
jne    1301 <test_arraymap_sanity+0x161>
cmpq   $0x0,-0x28(%rbp)
sete   %al
mov    %al,-0x2b(%rbp)
mov    -0x2b(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
movl   $0x2,-0x14(%rbp)
mov    -0x1c(%rbp),%edi
mov    0x2c91(%rip),%rax
mov    (%rax),%ecx
lea    -0x14(%rbp),%rsi
lea    -0x28(%rbp),%rdx
call   1070 <bpf_update_elem@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0xffffffff,%ecx
mov    %al,-0x2c(%rbp)
jne    1358 <test_arraymap_sanity+0x1b8>
mov    0x2c73(%rip),%rax
mov    (%rax),%rax
mov    0x2c99(%rip),%rcx
cmp    (%rcx),%rax
sete   %al
mov    %al,-0x2c(%rbp)
mov    -0x2c(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
mov    -0x1c(%rbp),%edi
lea    -0x14(%rbp),%rsi
lea    -0x28(%rbp),%rdx
call   1080 <bpf_lookup_elem@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0xffffffff,%ecx
mov    %al,-0x2d(%rbp)
jne    139f <test_arraymap_sanity+0x1ff>
mov    0x2c2c(%rip),%rax
mov    (%rax),%rax
mov    0x2c02(%rip),%rcx
cmp    (%rcx),%rax
sete   %al
mov    %al,-0x2d(%rbp)
mov    -0x2d(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
mov    -0x1c(%rbp),%edi
lea    -0x14(%rbp),%rsi
lea    -0x18(%rbp),%rdx
call   10c0 <bpf_get_next_key@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x2e(%rbp)
jne    13d6 <test_arraymap_sanity+0x236>
cmpl   $0x0,-0x18(%rbp)
sete   %al
mov    %al,-0x2e(%rbp)
mov    -0x2e(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
mov    -0x1c(%rbp),%edi
lea    -0x18(%rbp),%rdx
mov    %rdx,%rsi
call   10c0 <bpf_get_next_key@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x2f(%rbp)
jne    140c <test_arraymap_sanity+0x26c>
cmpl   $0x1,-0x18(%rbp)
sete   %al
mov    %al,-0x2f(%rbp)
mov    -0x2f(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
mov    -0x1c(%rbp),%edi
lea    -0x18(%rbp),%rdx
mov    %rdx,%rsi
call   10c0 <bpf_get_next_key@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0xffffffff,%ecx
mov    %al,-0x30(%rbp)
jne    1452 <test_arraymap_sanity+0x2b2>
mov    0x2b79(%rip),%rax
mov    (%rax),%rax
mov    0x2b4f(%rip),%rcx
cmp    (%rcx),%rax
sete   %al
mov    %al,-0x30(%rbp)
mov    -0x30(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
movl   $0x1,-0x14(%rbp)
mov    -0x1c(%rbp),%edi
lea    -0x14(%rbp),%rsi
call   10a0 <bpf_delete_elem@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0xffffffff,%ecx
mov    %al,-0x31(%rbp)
jne    149c <test_arraymap_sanity+0x2fc>
mov    0x2b2f(%rip),%rax
mov    (%rax),%rax
mov    0x2b15(%rip),%rcx
cmp    (%rcx),%rax
sete   %al
mov    %al,-0x31(%rbp)
mov    -0x31(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
mov    -0x1c(%rbp),%edi
call   1040 <close@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_arraymap_sanity>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x10,%rsp
mov    0x2e14(%rip),%rax
mov    (%rax),%edi
mov    $0x4,%esi
mov    $0x8,%edx
mov    $0x2,%ecx
xor    %r8d,%r8d
call   1060 <bpf_create_map@plt>
test   %eax,%eax
js     13cb <test_arraymap_sanity+0x22b>
mov    %eax,%ebx
movl   $0x1,(%rsp)
movq   $0x4d2,0x8(%rsp)
mov    0x2dea(%rip),%rax
mov    (%rax),%ecx
mov    %rsp,%r14
lea    0x8(%rsp),%r15
mov    %ebx,%edi
mov    %r14,%rsi
mov    %r15,%rdx
call   1070 <bpf_update_elem@plt>
xor    %edi,%edi
test   %eax,%eax
sete   %dil
call   1050 <assert@plt>
movq   $0x0,0x8(%rsp)
mov    0x2d9e(%rip),%rax
mov    (%rax),%ecx
mov    %ebx,%edi
mov    %r14,%rsi
mov    %r15,%rdx
call   1070 <bpf_update_elem@plt>
cmp    $0xffffffff,%eax
sete   %al
mov    0x2d7a(%rip),%r12
mov    (%r12),%rcx
mov    0x2d87(%rip),%rdx
cmp    (%rdx),%rcx
sete   %cl
and    %al,%cl
movzbl %cl,%edi
call   1050 <assert@plt>
mov    %ebx,%edi
mov    %r14,%rsi
mov    %r15,%rdx
call   1080 <bpf_lookup_elem@plt>
test   %eax,%eax
sete   %al
cmpq   $0x4d2,0x8(%rsp)
sete   %cl
and    %al,%cl
movzbl %cl,%edi
call   1050 <assert@plt>
movl   $0x0,(%rsp)
mov    %ebx,%edi
mov    %r14,%rsi
mov    %r15,%rdx
call   1080 <bpf_lookup_elem@plt>
test   %eax,%eax
sete   %al
cmpq   $0x0,0x8(%rsp)
sete   %cl
and    %al,%cl
movzbl %cl,%edi
call   1050 <assert@plt>
movl   $0x2,(%rsp)
mov    0x2cf5(%rip),%rax
mov    (%rax),%ecx
mov    %ebx,%edi
mov    %r14,%rsi
mov    %r15,%rdx
call   1070 <bpf_update_elem@plt>
cmp    $0xffffffff,%eax
sete   %al
mov    (%r12),%rcx
mov    0x2d0d(%rip),%rdx
cmp    (%rdx),%rcx
sete   %cl
and    %al,%cl
movzbl %cl,%edi
call   1050 <assert@plt>
mov    %ebx,%edi
mov    %r14,%rsi
mov    %r15,%rdx
call   1080 <bpf_lookup_elem@plt>
cmp    $0xffffffff,%eax
sete   %al
mov    (%r12),%rcx
mov    0x2c8f(%rip),%r13
cmp    0x0(%r13),%rcx
sete   %cl
and    %al,%cl
movzbl %cl,%edi
call   1050 <assert@plt>
lea    0x4(%rsp),%r15
mov    %ebx,%edi
mov    %r14,%rsi
mov    %r15,%rdx
call   10c0 <bpf_get_next_key@plt>
xor    %edi,%edi
or     0x4(%rsp),%eax
sete   %dil
call   1050 <assert@plt>
mov    %ebx,%edi
mov    %r15,%rsi
mov    %r15,%rdx
call   10c0 <bpf_get_next_key@plt>
mov    0x4(%rsp),%ecx
xor    $0x1,%ecx
xor    %edi,%edi
or     %eax,%ecx
sete   %dil
call   1050 <assert@plt>
mov    %ebx,%edi
mov    %r15,%rsi
mov    %r15,%rdx
call   10c0 <bpf_get_next_key@plt>
cmp    $0xffffffff,%eax
sete   %al
mov    (%r12),%rcx
cmp    0x0(%r13),%rcx
sete   %cl
and    %al,%cl
movzbl %cl,%edi
call   1050 <assert@plt>
movl   $0x1,(%rsp)
mov    %ebx,%edi
mov    %r14,%rsi
call   10a0 <bpf_delete_elem@plt>
cmp    $0xffffffff,%eax
sete   %al
mov    (%r12),%rcx
mov    0x2c02(%rip),%rdx
cmp    (%rdx),%rcx
sete   %cl
and    %al,%cl
movzbl %cl,%edi
call   1050 <assert@plt>
mov    %ebx,%edi
call   1040 <close@plt>
add    $0x10,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret
mov    0x2be6(%rip),%rax
mov    (%rax),%rdi
call   10b0 <strerror@plt>
lea    0xc1f(%rip),%rdi
mov    %rax,%rsi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1090 <exit@plt>

LLVM IR (-O0):
@BPF_MAP_TYPE_ARRAY = global i32 0
@.str = [32 x i8] c"failed to create arraymap '%s'\0A\00"
@errno = global i64 0
@BPF_ANY = global i32 0
@BPF_NOEXIST = global i32 0
@EEXIST = global i64 0
@BPF_EXIST = global i32 0
@E2BIG = global i64 0
@ENOENT = global i64 0
@EINVAL = global i64 0
define void @test_arraymap_sanity(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i64
store i32 %0, i32* %3
store i8* %1, i8** %4
%9 = load i32, i32* @BPF_MAP_TYPE_ARRAY
%10 = call i32 @bpf_create_map(i32 %9, i32 4, i32 8, i32 2, i32 0)
store i32 %10, i32* %7
%11 = load i32, i32* %7
%12 = icmp slt i32 %11, 0
br i1 %12, label %13, label %18
13: ; preds = %2
%14 = load i64, i64* @errno
%15 = call i8* @strerror(i64 %14)
%16 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i8* %15)
%17 = call i32 @exit(i32 1)
unreachable
18: ; preds = %2
store i32 1, i32* %5
store i64 1234, i64* %8
%19 = load i32, i32* %7
%20 = load i32, i32* @BPF_ANY
%21 = call i32 @bpf_update_elem(i32 %19, i32* %5, i64* %8, i32 %20)
%22 = icmp eq i32 %21, 0
%23 = zext i1 %22 to i32
%24 = call i32 @assert(i32 %23)
store i64 0, i64* %8
%25 = load i32, i32* %7
%26 = load i32, i32* @BPF_NOEXIST
%27 = call i32 @bpf_update_elem(i32 %25, i32* %5, i64* %8, i32 %26)
%28 = icmp eq i32 %27, -1
br i1 %28, label %29, label %33
29: ; preds = %18
%30 = load i64, i64* @errno
%31 = load i64, i64* @EEXIST
%32 = icmp eq i64 %30, %31
br label %33
33: ; preds = %29, %18
%34 = phi i1 [ false, %18 ], [ %32, %29 ]
%35 = zext i1 %34 to i32
%36 = call i32 @assert(i32 %35)
%37 = load i32, i32* %7
%38 = call i32 @bpf_lookup_elem(i32 %37, i32* %5, i64* %8)
%39 = icmp eq i32 %38, 0
br i1 %39, label %40, label %43
40: ; preds = %33
%41 = load i64, i64* %8
%42 = icmp eq i64 %41, 1234
br label %43
43: ; preds = %40, %33
%44 = phi i1 [ false, %33 ], [ %42, %40 ]
%45 = zext i1 %44 to i32
%46 = call i32 @assert(i32 %45)
store i32 0, i32* %5
%47 = load i32, i32* %7
%48 = call i32 @bpf_lookup_elem(i32 %47, i32* %5, i64* %8)
%49 = icmp eq i32 %48, 0
br i1 %49, label %50, label %53
50: ; preds = %43
%51 = load i64, i64* %8
%52 = icmp eq i64 %51, 0
br label %53
53: ; preds = %50, %43
%54 = phi i1 [ false, %43 ], [ %52, %50 ]
%55 = zext i1 %54 to i32
%56 = call i32 @assert(i32 %55)
store i32 2, i32* %5
%57 = load i32, i32* %7
%58 = load i32, i32* @BPF_EXIST
%59 = call i32 @bpf_update_elem(i32 %57, i32* %5, i64* %8, i32 %58)
%60 = icmp eq i32 %59, -1
br i1 %60, label %61, label %65
61: ; preds = %53
%62 = load i64, i64* @errno
%63 = load i64, i64* @E2BIG
%64 = icmp eq i64 %62, %63
br label %65
65: ; preds = %61, %53
%66 = phi i1 [ false, %53 ], [ %64, %61 ]
%67 = zext i1 %66 to i32
%68 = call i32 @assert(i32 %67)
%69 = load i32, i32* %7
%70 = call i32 @bpf_lookup_elem(i32 %69, i32* %5, i64* %8)
%71 = icmp eq i32 %70, -1
br i1 %71, label %72, label %76
72: ; preds = %65
%73 = load i64, i64* @errno
%74 = load i64, i64* @ENOENT
%75 = icmp eq i64 %73, %74
br label %76
76: ; preds = %72, %65
%77 = phi i1 [ false, %65 ], [ %75, %72 ]
%78 = zext i1 %77 to i32
%79 = call i32 @assert(i32 %78)
%80 = load i32, i32* %7
%81 = call i32 @bpf_get_next_key(i32 %80, i32* %5, i32* %6)
%82 = icmp eq i32 %81, 0
br i1 %82, label %83, label %86
83: ; preds = %76
%84 = load i32, i32* %6
%85 = icmp eq i32 %84, 0
br label %86
86: ; preds = %83, %76
%87 = phi i1 [ false, %76 ], [ %85, %83 ]
%88 = zext i1 %87 to i32
%89 = call i32 @assert(i32 %88)
%90 = load i32, i32* %7
%91 = call i32 @bpf_get_next_key(i32 %90, i32* %6, i32* %6)
%92 = icmp eq i32 %91, 0
br i1 %92, label %93, label %96
93: ; preds = %86
%94 = load i32, i32* %6
%95 = icmp eq i32 %94, 1
br label %96
96: ; preds = %93, %86
%97 = phi i1 [ false, %86 ], [ %95, %93 ]
%98 = zext i1 %97 to i32
%99 = call i32 @assert(i32 %98)
%100 = load i32, i32* %7
%101 = call i32 @bpf_get_next_key(i32 %100, i32* %6, i32* %6)
%102 = icmp eq i32 %101, -1
br i1 %102, label %103, label %107
103: ; preds = %96
%104 = load i64, i64* @errno
%105 = load i64, i64* @ENOENT
%106 = icmp eq i64 %104, %105
br label %107
107: ; preds = %103, %96
%108 = phi i1 [ false, %96 ], [ %106, %103 ]
%109 = zext i1 %108 to i32
%110 = call i32 @assert(i32 %109)
store i32 1, i32* %5
%111 = load i32, i32* %7
%112 = call i32 @bpf_delete_elem(i32 %111, i32* %5)
%113 = icmp eq i32 %112, -1
br i1 %113, label %114, label %118
114: ; preds = %107
%115 = load i64, i64* @errno
%116 = load i64, i64* @EINVAL
%117 = icmp eq i64 %115, %116
br label %118
118: ; preds = %114, %107
%119 = phi i1 [ false, %107 ], [ %117, %114 ]
%120 = zext i1 %119 to i32
%121 = call i32 @assert(i32 %120)
%122 = load i32, i32* %7
%123 = call i32 @close(i32 %122)
ret void
}

LLVM IR (-O2):
@BPF_MAP_TYPE_ARRAY = global i32 0
@.str = [32 x i8] c"failed to create arraymap '%s'\0A\00"
@errno = global i64 0
@BPF_ANY = global i32 0
@BPF_NOEXIST = global i32 0
@EEXIST = global i64 0
@BPF_EXIST = global i32 0
@E2BIG = global i64 0
@ENOENT = global i64 0
@EINVAL = global i64 0
define void @test_arraymap_sanity(i32 %0, i8* nocapture readnone %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i64
%6 = bitcast i32* %3 to i8*
%7 = bitcast i32* %4 to i8*
%8 = bitcast i64* %5 to i8*
%9 = load i32, i32* @BPF_MAP_TYPE_ARRAY
%10 = tail call i32 @bpf_create_map(i32 %9, i32 4, i32 8, i32 2, i32 0)
%11 = icmp slt i32 %10, 0
br i1 %11, label %12, label %17
12: ; preds = %2
%13 = load i64, i64* @errno
%14 = tail call i8* @strerror(i64 %13)
%15 = tail call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i8* %14)
%16 = tail call i32 @exit(i32 1)
unreachable
17: ; preds = %2
store i32 1, i32* %3
store i64 1234, i64* %5
%18 = load i32, i32* @BPF_ANY
%19 = call i32 @bpf_update_elem(i32 %10, i32* %3, i64* %5, i32 %18)
%20 = icmp eq i32 %19, 0
%21 = zext i1 %20 to i32
%22 = call i32 @assert(i32 %21)
store i64 0, i64* %5
%23 = load i32, i32* @BPF_NOEXIST
%24 = call i32 @bpf_update_elem(i32 %10, i32* %3, i64* %5, i32 %23)
%25 = icmp eq i32 %24, -1
%26 = load i64, i64* @errno
%27 = load i64, i64* @EEXIST
%28 = icmp eq i64 %26, %27
%29 = select i1 %25, i1 %28, i1 false
%30 = zext i1 %29 to i32
%31 = call i32 @assert(i32 %30)
%32 = call i32 @bpf_lookup_elem(i32 %10, i32* %3, i64* %5)
%33 = icmp eq i32 %32, 0
%34 = load i64, i64* %5
%35 = icmp eq i64 %34, 1234
%36 = select i1 %33, i1 %35, i1 false
%37 = zext i1 %36 to i32
%38 = call i32 @assert(i32 %37)
store i32 0, i32* %3
%39 = call i32 @bpf_lookup_elem(i32 %10, i32* %3, i64* %5)
%40 = icmp eq i32 %39, 0
%41 = load i64, i64* %5
%42 = icmp eq i64 %41, 0
%43 = select i1 %40, i1 %42, i1 false
%44 = zext i1 %43 to i32
%45 = call i32 @assert(i32 %44)
store i32 2, i32* %3
%46 = load i32, i32* @BPF_EXIST
%47 = call i32 @bpf_update_elem(i32 %10, i32* %3, i64* %5, i32 %46)
%48 = icmp eq i32 %47, -1
%49 = load i64, i64* @errno
%50 = load i64, i64* @E2BIG
%51 = icmp eq i64 %49, %50
%52 = select i1 %48, i1 %51, i1 false
%53 = zext i1 %52 to i32
%54 = call i32 @assert(i32 %53)
%55 = call i32 @bpf_lookup_elem(i32 %10, i32* %3, i64* %5)
%56 = icmp eq i32 %55, -1
%57 = load i64, i64* @errno
%58 = load i64, i64* @ENOENT
%59 = icmp eq i64 %57, %58
%60 = select i1 %56, i1 %59, i1 false
%61 = zext i1 %60 to i32
%62 = call i32 @assert(i32 %61)
%63 = call i32 @bpf_get_next_key(i32 %10, i32* %3, i32* %4)
%64 = icmp eq i32 %63, 0
%65 = load i32, i32* %4
%66 = icmp eq i32 %65, 0
%67 = select i1 %64, i1 %66, i1 false
%68 = zext i1 %67 to i32
%69 = call i32 @assert(i32 %68)
%70 = call i32 @bpf_get_next_key(i32 %10, i32* %4, i32* %4)
%71 = icmp eq i32 %70, 0
%72 = load i32, i32* %4
%73 = icmp eq i32 %72, 1
%74 = select i1 %71, i1 %73, i1 false
%75 = zext i1 %74 to i32
%76 = call i32 @assert(i32 %75)
%77 = call i32 @bpf_get_next_key(i32 %10, i32* %4, i32* %4)
%78 = icmp eq i32 %77, -1
%79 = load i64, i64* @errno
%80 = load i64, i64* @ENOENT
%81 = icmp eq i64 %79, %80
%82 = select i1 %78, i1 %81, i1 false
%83 = zext i1 %82 to i32
%84 = call i32 @assert(i32 %83)
store i32 1, i32* %3
%85 = call i32 @bpf_delete_elem(i32 %10, i32* %3)
%86 = icmp eq i32 %85, -1
%87 = load i64, i64* @errno
%88 = load i64, i64* @EINVAL
%89 = icmp eq i64 %87, %88
%90 = select i1 %86, i1 %89, i1 false
%91 = zext i1 %90 to i32
%92 = call i32 @assert(i32 %91)
%93 = call i32 @close(i32 %10)
ret void
}