#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 __VERIFIER_nondet_int();
int /*<<< orphan*/ process_req();
int /*<<< orphan*/ queue_req();
int /*<<< orphan*/ rdma_addr_cancel();
int /*<<< orphan*/ rdma_addr_unregister_client(int);
int /*<<< orphan*/ rdma_resolve_ip();
void *thr1(void *arg) {
  while (1)
    switch (__VERIFIER_nondet_int()) {
    case 0:
      rdma_addr_unregister_client(__VERIFIER_nondet_int());
      break;
    case 1:
      queue_req();
      break;
    case 2:
      process_req();
      break;
    case 3:
      rdma_resolve_ip();
      break;
    case 4:
      rdma_addr_cancel();
      break;
    }
  return 0;
}


x86 assembly (clang, -O0):
<thr1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
xor    %eax,%eax
call   1070 <__VERIFIER_nondet_int@plt>
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0x4,%eax
ja     11d4 <thr1+0x74>
mov    -0x10(%rbp),%rax
lea    0xe73(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    $0x0,%al
call   1070 <__VERIFIER_nondet_int@plt>
mov    %eax,%edi
call   1030 <rdma_addr_unregister_client@plt>
jmp    11d4 <thr1+0x74>
mov    $0x0,%al
call   1040 <queue_req@plt>
jmp    11d4 <thr1+0x74>
mov    $0x0,%al
call   1050 <process_req@plt>
jmp    11d4 <thr1+0x74>
mov    $0x0,%al
call   1060 <rdma_resolve_ip@plt>
jmp    11d4 <thr1+0x74>
mov    $0x0,%al
call   1080 <rdma_addr_cancel@plt>
jmp    116c <thr1+0xc>

x86 assembly (clang, -O2):
<thr1>:
push   %rbx
lea    0xe98(%rip),%rbx
jmp    1180 <thr1+0x20>
xor    %eax,%eax
call   1080 <rdma_addr_cancel@plt>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1070 <__VERIFIER_nondet_int@plt>
cmp    $0x4,%eax
ja     1180 <thr1+0x20>
mov    %eax,%eax
movslq (%rbx,%rax,4),%rax
add    %rbx,%rax
jmp    *%rax
xor    %eax,%eax
call   1070 <__VERIFIER_nondet_int@plt>
mov    %eax,%edi
call   1030 <rdma_addr_unregister_client@plt>
jmp    1180 <thr1+0x20>
xor    %eax,%eax
call   1040 <queue_req@plt>
jmp    1180 <thr1+0x20>
xor    %eax,%eax
call   1050 <process_req@plt>
jmp    1180 <thr1+0x20>
xor    %eax,%eax
call   1060 <rdma_resolve_ip@plt>
jmp    1180 <thr1+0x20>

LLVM IR (-O0):
define i8* @thr1(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %1, %16
%4 = call i32 (...) @__VERIFIER_nondet_int()
switch i32 %4, label %16 [
i32 0, label %5
i32 1, label %8
i32 2, label %10
i32 3, label %12
i32 4, label %14
]
5: ; preds = %3
%6 = call i32 (...) @__VERIFIER_nondet_int()
%7 = call i32 @rdma_addr_unregister_client(i32 %6)
br label %16
8: ; preds = %3
%9 = call i32 (...) @queue_req()
br label %16
10: ; preds = %3
%11 = call i32 (...) @process_req()
br label %16
12: ; preds = %3
%13 = call i32 (...) @rdma_resolve_ip()
br label %16
14: ; preds = %3
%15 = call i32 (...) @rdma_addr_cancel()
br label %16
16: ; preds = %3, %14, %12, %10, %8, %5
br label %3
}

LLVM IR (-O2):
define noalias i8* @thr1(i8* nocapture readnone %0) {
br label %2
2: ; preds = %4, %1
%3 = tail call i32 (...) @__VERIFIER_nondet_int()
switch i32 %3, label %4 [
i32 0, label %5
i32 1, label %8
i32 2, label %10
i32 3, label %12
i32 4, label %14
]
4: ; preds = %2, %14, %12, %10, %8, %5
br label %2
5: ; preds = %2
%6 = tail call i32 (...) @__VERIFIER_nondet_int()
%7 = tail call i32 @rdma_addr_unregister_client(i32 %6)
br label %4
8: ; preds = %2
%9 = tail call i32 (...) @queue_req()
br label %4
10: ; preds = %2
%11 = tail call i32 (...) @process_req()
br label %4
12: ; preds = %2
%13 = tail call i32 (...) @rdma_resolve_ip()
br label %4
14: ; preds = %2
%15 = tail call i32 (...) @rdma_addr_cancel()
br label %4
}