#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*/ usb_handle_data_int(int, int);
int /*<<< orphan*/ usb_handle_setup_rx();
int /*<<< orphan*/ usb_setup(int);
void usb_handle_int(int i) {
  if (i >= 10)
    usb_handle_data_int((i - 10) / 2, i % 2);
  else {
    switch (i) {
    case 0:;
      usb_setup(1);
      break;
    case 8:;
      usb_handle_setup_rx();
      break;
    }
  }
}


x86 assembly (clang, -O0):
<usb_handle_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0xa,-0x4(%rbp)
jl     116c <usb_handle_int+0x3c>
mov    -0x4(%rbp),%eax
sub    $0xa,%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%edi
mov    -0x4(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %edx,%esi
call   1030 <usb_handle_data_int@plt>
jmp    11ab <usb_handle_int+0x7b>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
test   %eax,%eax
je     1190 <usb_handle_int+0x60>
jmp    117f <usb_handle_int+0x4f>
mov    -0x8(%rbp),%eax
sub    $0x8,%eax
je     119f <usb_handle_int+0x6f>
jmp    11a6 <usb_handle_int+0x76>
mov    $0x1,%edi
call   1050 <usb_setup@plt>
jmp    11a6 <usb_handle_int+0x76>
mov    $0x0,%al
call   1040 <usb_handle_setup_rx@plt>
jmp    11ab <usb_handle_int+0x7b>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usb_handle_int>:
mov    %edi,%esi
cmp    $0xa,%edi
jl     1144 <usb_handle_int+0x14>
lea    -0xa(%rsi),%edi
shr    %edi
and    $0x1,%esi
jmp    1030 <usb_handle_data_int@plt>
cmp    $0x8,%esi
je     1157 <usb_handle_int+0x27>
test   %esi,%esi
jne    115e <usb_handle_int+0x2e>
mov    $0x1,%edi
jmp    1050 <usb_setup@plt>
xor    %eax,%eax
jmp    1040 <usb_handle_setup_rx@plt>
ret

LLVM IR (-O0):
define void @usb_handle_int(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 10
br i1 %4, label %5, label %12
5: ; preds = %1
%6 = load i32, i32* %2
%7 = sub nsw i32 %6, 10
%8 = sdiv i32 %7, 2
%9 = load i32, i32* %2
%10 = srem i32 %9, 2
%11 = call i32 @usb_handle_data_int(i32 %8, i32 %10)
br label %19
12: ; preds = %1
%13 = load i32, i32* %2
switch i32 %13, label %18 [
i32 0, label %14
i32 8, label %16
]
14: ; preds = %12
%15 = call i32 @usb_setup(i32 1)
br label %18
16: ; preds = %12
%17 = call i32 (...) @usb_handle_setup_rx()
br label %18
18: ; preds = %12, %16, %14
br label %19
19: ; preds = %18, %5
ret void
}

LLVM IR (-O2):
define void @usb_handle_int(i32 %0) {
%2 = icmp sgt i32 %0, 9
br i1 %2, label %3, label %8
3: ; preds = %1
%4 = add nsw i32 %0, -10
%5 = lshr i32 %4, 1
%6 = and i32 %0, 1
%7 = tail call i32 @usb_handle_data_int(i32 %5, i32 %6)
br label %13
8: ; preds = %1
switch i32 %0, label %13 [
i32 0, label %9
i32 8, label %11
]
9: ; preds = %8
%10 = tail call i32 @usb_setup(i32 1)
br label %13
11: ; preds = %8
%12 = tail call i32 (...) @usb_handle_setup_rx()
br label %13
13: ; preds = %9, %11, %8, %3
ret void
}