#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 */
int /*<<< orphan*/ sprintf(char *, char *, char *, char *, int, ...);
char *benthic_spss_get_sampling_point_key(char *collection_name, char *location,
                                          int site_number, int sweep_number,
                                          char sum_sweeps_yn) {
  static char key[256];
  if (sum_sweeps_yn != 'y') {
    sprintf(key, "%s|%s|%d|%d", collection_name, location, site_number,
            sweep_number);
  } else {
    sprintf(key, "%s|%s|%d", collection_name, location, site_number);
  }
  return key;
}


x86 assembly (clang, -O0):
<benthic_spss_get_sampling_point_key>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %r8b,%al
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    %al,-0x19(%rbp)
movsbl -0x19(%rbp),%eax
cmp    $0x79,%eax
je     1163 <benthic_spss_get_sampling_point_key+0x53>
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
mov    -0x14(%rbp),%r8d
mov    -0x18(%rbp),%r9d
lea    0x2ef0(%rip),%rdi
lea    0xea9(%rip),%rsi
mov    $0x0,%al
call   1030 <sprintf@plt>
jmp    1184 <benthic_spss_get_sampling_point_key+0x74>
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
mov    -0x14(%rbp),%r8d
lea    0x2eca(%rip),%rdi
lea    0xe8f(%rip),%rsi
mov    $0x0,%al
call   1030 <sprintf@plt>
lea    0x2eb5(%rip),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<benthic_spss_get_sampling_point_key>:
push   %rax
mov    %ecx,%r9d
mov    %edx,%eax
mov    %rsi,%rcx
mov    %rdi,%rdx
lea    0x2f1d(%rip),%rdi
cmp    $0x79,%r8b
jne    113c <benthic_spss_get_sampling_point_key+0x2c>
lea    0xedc(%rip),%rsi
mov    %eax,%r8d
xor    %eax,%eax
call   1030 <sprintf@plt>
jmp    114d <benthic_spss_get_sampling_point_key+0x3d>
lea    0xebd(%rip),%rsi
mov    %eax,%r8d
xor    %eax,%eax
call   1030 <sprintf@plt>
lea    0x2eec(%rip),%rax
pop    %rcx
ret

LLVM IR (-O0):
@benthic_spss_get_sampling_point_key.key = internal global [256 x i8] zeroinitializer
@.str = [12 x i8] c"%s|%s|%d|%d\00"
@.str.1 = [9 x i8] c"%s|%s|%d\00"
define i8* @benthic_spss_get_sampling_point_key(i8* %0, i8* %1, i32 %2, i32 %3, i8 signext %4) {
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i32
%9 = alloca i32
%10 = alloca i8
store i8* %0, i8** %6
store i8* %1, i8** %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i8 %4, i8* %10
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
%13 = icmp ne i32 %12, 121
br i1 %13, label %14, label %20
14: ; preds = %5
%15 = load i8*, i8** %6
%16 = load i8*, i8** %7
%17 = load i32, i32* %8
%18 = load i32, i32* %9
%19 = call i32 (i8*, i8*, i8*, i8*, i32, ...) @sprintf(i8* getelementptr inbounds ([256 x i8], [256 x i8]* @benthic_spss_get_sampling_point_key.key, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %15, i8* %16, i32 %17, i32 %18)
br label %25
20: ; preds = %5
%21 = load i8*, i8** %6
%22 = load i8*, i8** %7
%23 = load i32, i32* %8
%24 = call i32 (i8*, i8*, i8*, i8*, i32, ...) @sprintf(i8* getelementptr inbounds ([256 x i8], [256 x i8]* @benthic_spss_get_sampling_point_key.key, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i8* %21, i8* %22, i32 %23)
br label %25
25: ; preds = %20, %14
ret i8* getelementptr inbounds ([256 x i8], [256 x i8]* @benthic_spss_get_sampling_point_key.key, i64 0, i64 0)
}

LLVM IR (-O2):
@benthic_spss_get_sampling_point_key.key = internal global [256 x i8] zeroinitializer
@.str = [12 x i8] c"%s|%s|%d|%d\00"
@.str.1 = [9 x i8] c"%s|%s|%d\00"
define i8* @benthic_spss_get_sampling_point_key(i8* %0, i8* %1, i32 %2, i32 %3, i8 signext %4) {
%6 = icmp eq i8 %4, 121
br i1 %6, label %9, label %7
7: ; preds = %5
%8 = tail call i32 (i8*, i8*, i8*, i8*, i32, ...) @sprintf(i8* dereferenceable(1) getelementptr inbounds ([256 x i8], [256 x i8]* @benthic_spss_get_sampling_point_key.key, i64 0, i64 0), i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1, i32 %2, i32 %3)
br label %11
9: ; preds = %5
%10 = tail call i32 (i8*, i8*, i8*, i8*, i32, ...) @sprintf(i8* dereferenceable(1) getelementptr inbounds ([256 x i8], [256 x i8]* @benthic_spss_get_sampling_point_key.key, i64 0, i64 0), i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i8* %0, i8* %1, i32 %2)
br label %11
11: ; preds = %9, %7
ret i8* getelementptr inbounds ([256 x i8], [256 x i8]* @benthic_spss_get_sampling_point_key.key, i64 0, i64 0)
}