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

/* Variables and functions */
int /*<<< orphan*/ fd_nrf8001_write_dynamic_data_complete();
int /*<<< orphan*/ fd_nrf8001_write_dynamic_data_continue();
int /*<<< orphan*/ fd_nrf8001_write_dynamic_data_error(int);
void fd_nrf8001_dispatch_write_dynamic_data_response(
    uint8_t status, uint8_t *response_data __attribute__((unused)),
    uint32_t response_data_length __attribute__((unused))) {
  switch (status) {
  case 0x01:
    fd_nrf8001_write_dynamic_data_continue();
    break;
  case 0x02:
    fd_nrf8001_write_dynamic_data_complete();
    break;
  default:
    fd_nrf8001_write_dynamic_data_error(status);
    break;
  }
}


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x18(%rbp)
sub    $0x1,%eax
je     1167 <fd_nrf8001_dispatch_write_dynamic_data_response+0x37>
jmp    1156 <fd_nrf8001_dispatch_write_dynamic_data_response+0x26>
mov    -0x18(%rbp),%eax
sub    $0x2,%eax
je     1173 <fd_nrf8001_dispatch_write_dynamic_data_response+0x43>
jmp    117f <fd_nrf8001_dispatch_write_dynamic_data_response+0x4f>
mov    $0x0,%al
call   1030 <fd_nrf8001_write_dynamic_data_continue@plt>
jmp    1187 <fd_nrf8001_dispatch_write_dynamic_data_response+0x57>
mov    $0x0,%al
call   1050 <fd_nrf8001_write_dynamic_data_complete@plt>
jmp    1187 <fd_nrf8001_dispatch_write_dynamic_data_response+0x57>
mov    -0x4(%rbp),%edi
call   1040 <fd_nrf8001_write_dynamic_data_error@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
cmp    $0x2,%edi
je     1141 <fd_nrf8001_dispatch_write_dynamic_data_response+0x11>
cmp    $0x1,%edi
jne    1148 <fd_nrf8001_dispatch_write_dynamic_data_response+0x18>
xor    %eax,%eax
jmp    1030 <fd_nrf8001_write_dynamic_data_continue@plt>
xor    %eax,%eax
jmp    1050 <fd_nrf8001_write_dynamic_data_complete@plt>
jmp    1040 <fd_nrf8001_write_dynamic_data_error@plt>

LLVM IR (-O0):
define void @fd_nrf8001_dispatch_write_dynamic_data_response(i32 %0, i32* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32*
%6 = alloca i32
store i32 %0, i32* %4
store i32* %1, i32** %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
switch i32 %7, label %12 [
i32 1, label %8
i32 2, label %10
]
8: ; preds = %3
%9 = call i32 (...) @fd_nrf8001_write_dynamic_data_continue()
br label %15
10: ; preds = %3
%11 = call i32 (...) @fd_nrf8001_write_dynamic_data_complete()
br label %15
12: ; preds = %3
%13 = load i32, i32* %4
%14 = call i32 @fd_nrf8001_write_dynamic_data_error(i32 %13)
br label %15
15: ; preds = %12, %10, %8
ret void
}

LLVM IR (-O2):
define void @fd_nrf8001_dispatch_write_dynamic_data_response(i32 %0, i32* nocapture readnone %1, i32 %2) {
switch i32 %0, label %8 [
i32 1, label %4
i32 2, label %6
]
4: ; preds = %3
%5 = tail call i32 (...) @fd_nrf8001_write_dynamic_data_continue()
br label %10
6: ; preds = %3
%7 = tail call i32 (...) @fd_nrf8001_write_dynamic_data_complete()
br label %10
8: ; preds = %3
%9 = tail call i32 @fd_nrf8001_write_dynamic_data_error(i32 %0)
br label %10
10: ; preds = %8, %6, %4
ret void
}