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

/* Variables and functions */
int /*<<< orphan*/ fits_add_keyword(struct ccd_frame *, char *, char *);
int /*<<< orphan*/ snprintf(char *, int, char *, float);
int dcraw_set_exposure(struct ccd_frame *frame, float exposure) {
  char strbuf[64];
  if (exposure != 0.0) {
    snprintf(strbuf, 64, "%10.4f", exposure);
    fits_add_keyword(frame, "EXPTIME", strbuf);
  }
  return 0;
}


x86 assembly (clang, -O0):
<dcraw_set_exposure>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    1152 <dcraw_set_exposure+0x32>
jp     1152 <dcraw_set_exposure+0x32>
jmp    1180 <dcraw_set_exposure+0x60>
lea    -0x50(%rbp),%rdi
movss  -0xc(%rbp),%xmm0
mov    $0x40,%esi
lea    0xe99(%rip),%rdx
call   1030 <snprintf@plt>
mov    -0x8(%rbp),%rdi
lea    -0x50(%rbp),%rdx
lea    0xe8c(%rip),%rsi
call   1040 <fits_add_keyword@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dcraw_set_exposure>:
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jne    112a <dcraw_set_exposure+0xa>
jnp    1164 <dcraw_set_exposure+0x44>
push   %r14
push   %rbx
sub    $0x48,%rsp
mov    %rdi,%rbx
lea    0xec5(%rip),%rdx
mov    %rsp,%r14
mov    %r14,%rdi
mov    $0x40,%esi
call   1030 <snprintf@plt>
lea    0xeb5(%rip),%rsi
mov    %rbx,%rdi
mov    %r14,%rdx
call   1040 <fits_add_keyword@plt>
add    $0x48,%rsp
pop    %rbx
pop    %r14
xor    %eax,%eax
ret

LLVM IR (-O0):
%struct.ccd_frame = type { i32 }
@.str = [7 x i8] c"%10.4f\00"
@.str.1 = [8 x i8] c"EXPTIME\00"
define i32 @dcraw_set_exposure(%struct.ccd_frame* %0, float %1) {
%3 = alloca %struct.ccd_frame*
%4 = alloca float
%5 = alloca [64 x i8]
store %struct.ccd_frame* %0, %struct.ccd_frame** %3
store float %1, float* %4
%6 = load float, float* %4
%7 = fpext float %6 to double
%8 = fcmp une double %7, 0.000000e+00
br i1 %8, label %9, label %16
9: ; preds = %2
%10 = getelementptr inbounds [64 x i8], [64 x i8]* %5, i64 0, i64 0
%11 = load float, float* %4
%12 = call i32 @snprintf(i8* %10, i32 64, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), float %11)
%13 = load %struct.ccd_frame*, %struct.ccd_frame** %3
%14 = getelementptr inbounds [64 x i8], [64 x i8]* %5, i64 0, i64 0
%15 = call i32 @fits_add_keyword(%struct.ccd_frame* %13, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* %14)
br label %16
16: ; preds = %9, %2
ret i32 0
}

LLVM IR (-O2):
%struct.ccd_frame = type { i32 }
@.str = [7 x i8] c"%10.4f\00"
@.str.1 = [8 x i8] c"EXPTIME\00"
define i32 @dcraw_set_exposure(%struct.ccd_frame* %0, float %1) {
%3 = alloca [64 x i8]
%4 = getelementptr inbounds [64 x i8], [64 x i8]* %3, i64 0, i64 0
%5 = fcmp une float %1, 0.000000e+00
br i1 %5, label %6, label %9
6: ; preds = %2
%7 = call i32 @snprintf(i8* %4, i32 64, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), float %1)
%8 = call i32 @fits_add_keyword(%struct.ccd_frame* %0, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* %4)
br label %9
9: ; preds = %6, %2
ret i32 0
}