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

/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
double tuner_get_volume(struct tuner const *);
scalar_t__ tuner_has_volume_control(struct tuner const *);
void print_volume(const struct tuner *tuner) {
  if (tuner_has_volume_control(tuner))
    printf(" at %.2f%% volume", tuner_get_volume(tuner));
  else
    printf(" (radio does not support volume control)");
}


x86 assembly (clang, -O0):
<print_volume>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <tuner_has_volume_control@plt>
cmp    $0x0,%rax
je     116b <print_volume+0x3b>
mov    -0x8(%rbp),%rdi
call   1040 <tuner_get_volume@plt>
lea    0xea1(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
jmp    1179 <print_volume+0x49>
lea    0xea0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_volume>:
push   %rbx
mov    %rdi,%rbx
call   1050 <tuner_has_volume_control@plt>
test   %rax,%rax
je     1155 <print_volume+0x25>
mov    %rbx,%rdi
call   1040 <tuner_get_volume@plt>
lea    0xeb3(%rip),%rdi
mov    $0x1,%al
pop    %rbx
jmp    1030 <printf@plt>
lea    0xeb6(%rip),%rdi
xor    %eax,%eax
pop    %rbx
jmp    1030 <printf@plt>

LLVM IR (-O0):
%struct.tuner = type { i32 }
@.str = [18 x i8] c" at %.2f%% volume\00"
@.str.1 = [41 x i8] c" (radio does not support volume control)\00"
define void @print_volume(%struct.tuner* %0) {
%2 = alloca %struct.tuner*
store %struct.tuner* %0, %struct.tuner** %2
%3 = load %struct.tuner*, %struct.tuner** %2
%4 = call i64 @tuner_has_volume_control(%struct.tuner* %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load %struct.tuner*, %struct.tuner** %2
%8 = call double @tuner_get_volume(%struct.tuner* %7)
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), double %8)
br label %12
10: ; preds = %1
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.1, i64 0, i64 0))
br label %12
12: ; preds = %10, %6
ret void
}

LLVM IR (-O2):
%struct.tuner = type { i32 }
@.str = [18 x i8] c" at %.2f%% volume\00"
@.str.1 = [41 x i8] c" (radio does not support volume control)\00"
define void @print_volume(%struct.tuner* %0) {
%2 = tail call i64 @tuner_has_volume_control(%struct.tuner* %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %7, label %4
4: ; preds = %1
%5 = tail call double @tuner_get_volume(%struct.tuner* %0)
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), double %5)
br label %9
7: ; preds = %1
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @.str.1, i64 0, i64 0))
br label %9
9: ; preds = %7, %4
ret void
}