#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 */

/* Variables and functions */
scalar_t__ code_table_4_4_location(unsigned char **);
int forecast_time_in_units(unsigned char **);
int /*<<< orphan*/ sprintf(char *, char *, int);
int f_pds_fcst_time(int mode, unsigned char **sec, float *data,
                    unsigned int ndata, char *inv_out, void **local) {
  int p;
  if (mode >= 0 && code_table_4_4_location(sec)) {
    p = forecast_time_in_units(sec);
    sprintf(inv_out, "pds_fcst_time1=%d", p);
  }
  return 0;
}


x86 assembly (clang, -O0):
<f_pds_fcst_time>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
cmpl   $0x0,-0x4(%rbp)
jl     118a <f_pds_fcst_time+0x5a>
mov    -0x10(%rbp),%rdi
call   1050 <code_table_4_4_location@plt>
cmp    $0x0,%rax
je     118a <f_pds_fcst_time+0x5a>
mov    -0x10(%rbp),%rdi
call   1030 <forecast_time_in_units@plt>
mov    %eax,-0x34(%rbp)
mov    -0x28(%rbp),%rdi
mov    -0x34(%rbp),%edx
lea    0xe7b(%rip),%rsi
call   1040 <sprintf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f_pds_fcst_time>:
push   %r14
push   %rbx
push   %rax
test   %edi,%edi
js     1164 <f_pds_fcst_time+0x34>
mov    %r8,%r14
mov    %rsi,%rbx
mov    %rsi,%rdi
call   1050 <code_table_4_4_location@plt>
test   %rax,%rax
je     1164 <f_pds_fcst_time+0x34>
mov    %rbx,%rdi
call   1030 <forecast_time_in_units@plt>
lea    0xea6(%rip),%rsi
mov    %r14,%rdi
mov    %eax,%edx
call   1040 <sprintf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [18 x i8] c"pds_fcst_time1=%d\00"
define i32 @f_pds_fcst_time(i32 %0, i8** %1, float* %2, i32 %3, i8* %4, i8** %5) {
%7 = alloca i32
%8 = alloca i8**
%9 = alloca float*
%10 = alloca i32
%11 = alloca i8*
%12 = alloca i8**
%13 = alloca i32
store i32 %0, i32* %7
store i8** %1, i8*** %8
store float* %2, float** %9
store i32 %3, i32* %10
store i8* %4, i8** %11
store i8** %5, i8*** %12
%14 = load i32, i32* %7
%15 = icmp sge i32 %14, 0
br i1 %15, label %16, label %26
16: ; preds = %6
%17 = load i8**, i8*** %8
%18 = call i64 @code_table_4_4_location(i8** %17)
%19 = icmp ne i64 %18, 0
br i1 %19, label %20, label %26
20: ; preds = %16
%21 = load i8**, i8*** %8
%22 = call i32 @forecast_time_in_units(i8** %21)
store i32 %22, i32* %13
%23 = load i8*, i8** %11
%24 = load i32, i32* %13
%25 = call i32 @sprintf(i8* %23, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %24)
br label %26
26: ; preds = %20, %16, %6
ret i32 0
}

LLVM IR (-O2):
@.str = [18 x i8] c"pds_fcst_time1=%d\00"
define i32 @f_pds_fcst_time(i32 %0, i8** %1, float* nocapture readnone %2, i32 %3, i8* nocapture writeonly %4, i8** nocapture readnone %5) {
%7 = icmp sgt i32 %0, -1
br i1 %7, label %8, label %14
8: ; preds = %6
%9 = tail call i64 @code_table_4_4_location(i8** %1)
%10 = icmp eq i64 %9, 0
br i1 %10, label %14, label %11
11: ; preds = %8
%12 = tail call i32 @forecast_time_in_units(i8** %1)
%13 = tail call i32 @sprintf(i8* dereferenceable(1) %4, i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %12)
br label %14
14: ; preds = %11, %8, %6
ret i32 0
}