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

/* Variables and functions */
int /*<<< orphan*/ tpl_addVar(struct templatevars *, int /*<<< orphan*/, char *,
                              char *);
int /*<<< orphan*/ tpl_printf(struct templatevars *, int /*<<< orphan*/, char *,
                              char *, double);
void set_status_info_var(struct templatevars *vars, char *varname, int no_data,
                         char *fmt, double value) {
  if (no_data)
    tpl_addVar(vars, 0, varname, "N/A");
  else
    tpl_printf(vars, 0, varname, fmt, value);
}


x86 assembly (clang, -O0):
<set_status_info_var>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
movsd  %xmm0,-0x28(%rbp)
cmpl   $0x0,-0x14(%rbp)
je     1161 <set_status_info_var+0x41>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
xor    %esi,%esi
lea    0xea9(%rip),%rcx
call   1030 <tpl_addVar@plt>
jmp    1179 <set_status_info_var+0x59>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    -0x20(%rbp),%rcx
movsd  -0x28(%rbp),%xmm0
xor    %esi,%esi
call   1040 <tpl_printf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_status_info_var>:
mov    %edx,%eax
mov    %rsi,%rdx
test   %eax,%eax
je     1137 <set_status_info_var+0x17>
lea    0xed0(%rip),%rcx
xor    %esi,%esi
jmp    1030 <tpl_addVar@plt>
xor    %esi,%esi
jmp    1040 <tpl_printf@plt>

LLVM IR (-O0):
%struct.templatevars = type { i32 }
@.str = [4 x i8] c"N/A\00"
define void @set_status_info_var(%struct.templatevars* %0, i8* %1, i32 %2, i8* %3, double %4) {
%6 = alloca %struct.templatevars*
%7 = alloca i8*
%8 = alloca i32
%9 = alloca i8*
%10 = alloca double
store %struct.templatevars* %0, %struct.templatevars** %6
store i8* %1, i8** %7
store i32 %2, i32* %8
store i8* %3, i8** %9
store double %4, double* %10
%11 = load i32, i32* %8
%12 = icmp ne i32 %11, 0
br i1 %12, label %13, label %17
13: ; preds = %5
%14 = load %struct.templatevars*, %struct.templatevars** %6
%15 = load i8*, i8** %7
%16 = call i32 @tpl_addVar(%struct.templatevars* %14, i32 0, i8* %15, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
br label %23
17: ; preds = %5
%18 = load %struct.templatevars*, %struct.templatevars** %6
%19 = load i8*, i8** %7
%20 = load i8*, i8** %9
%21 = load double, double* %10
%22 = call i32 @tpl_printf(%struct.templatevars* %18, i32 0, i8* %19, i8* %20, double %21)
br label %23
23: ; preds = %17, %13
ret void
}

LLVM IR (-O2):
%struct.templatevars = type { i32 }
@.str = [4 x i8] c"N/A\00"
define void @set_status_info_var(%struct.templatevars* %0, i8* %1, i32 %2, i8* %3, double %4) {
%6 = icmp eq i32 %2, 0
br i1 %6, label %9, label %7
7: ; preds = %5
%8 = tail call i32 @tpl_addVar(%struct.templatevars* %0, i32 0, i8* %1, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
br label %11
9: ; preds = %5
%10 = tail call i32 @tpl_printf(%struct.templatevars* %0, i32 0, i8* %1, i8* %3, double %4)
br label %11
11: ; preds = %9, %7
ret void
}