#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 */
struct snd_kcontrol {
  int dummy;
};
struct snd_ctl_elem_id {
  scalar_t__ numid;
};

/* Variables and functions */
unsigned int snd_ctl_get_ioffidx(struct snd_kcontrol *,
                                 struct snd_ctl_elem_id *);
unsigned int snd_ctl_get_ioffnum(struct snd_kcontrol *,
                                 struct snd_ctl_elem_id *);
unsigned int snd_ctl_get_ioff(struct snd_kcontrol *kctl,
                              struct snd_ctl_elem_id *id) {
  if (id->numid) {
    return snd_ctl_get_ioffnum(kctl, id);
  } else {
    return snd_ctl_get_ioffidx(kctl, id);
  }
}


x86 assembly (clang, -O0):
<snd_ctl_get_ioff>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmpq   $0x0,(%rax)
je     1153 <snd_ctl_get_ioff+0x33>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <snd_ctl_get_ioffnum@plt>
mov    %eax,-0x4(%rbp)
jmp    1163 <snd_ctl_get_ioff+0x43>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <snd_ctl_get_ioffidx@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<snd_ctl_get_ioff>:
cmpq   $0x0,(%rsi)
je     112b <snd_ctl_get_ioff+0xb>
jmp    1040 <snd_ctl_get_ioffnum@plt>
jmp    1030 <snd_ctl_get_ioffidx@plt>

LLVM IR (-O0):
%struct.snd_kcontrol = type { i32 }
%struct.snd_ctl_elem_id = type { i64 }
define i32 @snd_ctl_get_ioff(%struct.snd_kcontrol* %0, %struct.snd_ctl_elem_id* %1) {
%3 = alloca i32
%4 = alloca %struct.snd_kcontrol*
%5 = alloca %struct.snd_ctl_elem_id*
store %struct.snd_kcontrol* %0, %struct.snd_kcontrol** %4
store %struct.snd_ctl_elem_id* %1, %struct.snd_ctl_elem_id** %5
%6 = load %struct.snd_ctl_elem_id*, %struct.snd_ctl_elem_id** %5
%7 = getelementptr inbounds %struct.snd_ctl_elem_id, %struct.snd_ctl_elem_id* %6, i32 0, i32 0
%8 = load i64, i64* %7
%9 = icmp ne i64 %8, 0
br i1 %9, label %10, label %14
10: ; preds = %2
%11 = load %struct.snd_kcontrol*, %struct.snd_kcontrol** %4
%12 = load %struct.snd_ctl_elem_id*, %struct.snd_ctl_elem_id** %5
%13 = call i32 @snd_ctl_get_ioffnum(%struct.snd_kcontrol* %11, %struct.snd_ctl_elem_id* %12)
store i32 %13, i32* %3
br label %18
14: ; preds = %2
%15 = load %struct.snd_kcontrol*, %struct.snd_kcontrol** %4
%16 = load %struct.snd_ctl_elem_id*, %struct.snd_ctl_elem_id** %5
%17 = call i32 @snd_ctl_get_ioffidx(%struct.snd_kcontrol* %15, %struct.snd_ctl_elem_id* %16)
store i32 %17, i32* %3
br label %18
18: ; preds = %14, %10
%19 = load i32, i32* %3
ret i32 %19
}

LLVM IR (-O2):
%struct.snd_kcontrol = type { i32 }
%struct.snd_ctl_elem_id = type { i64 }
define i32 @snd_ctl_get_ioff(%struct.snd_kcontrol* %0, %struct.snd_ctl_elem_id* %1) {
%3 = getelementptr inbounds %struct.snd_ctl_elem_id, %struct.snd_ctl_elem_id* %1, i64 0, i32 0
%4 = load i64, i64* %3
%5 = icmp eq i64 %4, 0
br i1 %5, label %8, label %6
6: ; preds = %2
%7 = tail call i32 @snd_ctl_get_ioffnum(%struct.snd_kcontrol* %0, %struct.snd_ctl_elem_id* %1)
br label %10
8: ; preds = %2
%9 = tail call i32 @snd_ctl_get_ioffidx(%struct.snd_kcontrol* %0, %struct.snd_ctl_elem_id* %1)
br label %10
10: ; preds = %8, %6
%11 = phi i32 [ %7, %6 ], [ %9, %8 ]
ret i32 %11
}