#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_ac97 {
  int dummy;
};

/* Variables and functions */
scalar_t__ is_shared_clfeout(struct snd_ac97 *);
scalar_t__ is_shared_surrout(struct snd_ac97 *);
int /*<<< orphan*/ snd_ac97_update_bits(struct snd_ac97 *, int, int, int);
void it2646_update_jacks(struct snd_ac97 *ac97) {
  snd_ac97_update_bits(ac97, 0x76, 1 << 9,
                       is_shared_surrout(ac97) ? (1 << 9) : 0);
  snd_ac97_update_bits(ac97, 0x76, 1 << 10,
                       is_shared_clfeout(ac97) ? (1 << 10) : 0);
}


x86 assembly (clang, -O0):
<it2646_update_jacks>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <is_shared_surrout@plt>
mov    -0x18(%rbp),%rdi
mov    %rax,%rdx
xor    %ecx,%ecx
mov    $0x200,%eax
cmp    $0x0,%rdx
cmovne %eax,%ecx
mov    $0x76,%esi
mov    $0x200,%edx
call   1030 <snd_ac97_update_bits@plt>
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <is_shared_clfeout@plt>
mov    -0x10(%rbp),%rdi
mov    %rax,%rdx
xor    %ecx,%ecx
mov    $0x400,%eax
cmp    $0x0,%rdx
cmovne %eax,%ecx
mov    $0x76,%esi
mov    $0x400,%edx
call   1030 <snd_ac97_update_bits@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<it2646_update_jacks>:
push   %rbx
mov    %rdi,%rbx
call   1050 <is_shared_surrout@plt>
xor    %ecx,%ecx
test   %rax,%rax
setne  %cl
shl    $0x9,%ecx
mov    %rbx,%rdi
mov    $0x76,%esi
mov    $0x200,%edx
call   1030 <snd_ac97_update_bits@plt>
mov    %rbx,%rdi
call   1040 <is_shared_clfeout@plt>
xor    %ecx,%ecx
test   %rax,%rax
setne  %cl
shl    $0xa,%ecx
mov    %rbx,%rdi
mov    $0x76,%esi
mov    $0x400,%edx
pop    %rbx
jmp    1030 <snd_ac97_update_bits@plt>

LLVM IR (-O0):
%struct.snd_ac97 = type { i32 }
define void @it2646_update_jacks(%struct.snd_ac97* %0) {
%2 = alloca %struct.snd_ac97*
store %struct.snd_ac97* %0, %struct.snd_ac97** %2
%3 = load %struct.snd_ac97*, %struct.snd_ac97** %2
%4 = load %struct.snd_ac97*, %struct.snd_ac97** %2
%5 = call i64 @is_shared_surrout(%struct.snd_ac97* %4)
%6 = icmp ne i64 %5, 0
%7 = zext i1 %6 to i64
%8 = select i1 %6, i32 512, i32 0
%9 = call i32 @snd_ac97_update_bits(%struct.snd_ac97* %3, i32 118, i32 512, i32 %8)
%10 = load %struct.snd_ac97*, %struct.snd_ac97** %2
%11 = load %struct.snd_ac97*, %struct.snd_ac97** %2
%12 = call i64 @is_shared_clfeout(%struct.snd_ac97* %11)
%13 = icmp ne i64 %12, 0
%14 = zext i1 %13 to i64
%15 = select i1 %13, i32 1024, i32 0
%16 = call i32 @snd_ac97_update_bits(%struct.snd_ac97* %10, i32 118, i32 1024, i32 %15)
ret void
}

LLVM IR (-O2):
%struct.snd_ac97 = type { i32 }
define void @it2646_update_jacks(%struct.snd_ac97* %0) {
%2 = tail call i64 @is_shared_surrout(%struct.snd_ac97* %0)
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 0, i32 512
%5 = tail call i32 @snd_ac97_update_bits(%struct.snd_ac97* %0, i32 118, i32 512, i32 %4)
%6 = tail call i64 @is_shared_clfeout(%struct.snd_ac97* %0)
%7 = icmp eq i64 %6, 0
%8 = select i1 %7, i32 0, i32 1024
%9 = tail call i32 @snd_ac97_update_bits(%struct.snd_ac97* %0, i32 118, i32 1024, i32 %8)
ret void
}