#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 ssds_get_gen_name(int, char *, char *, char *, char *, int);
int ssds_set_field_type(int pcfd, char *class_def, char *type_def, char *res,
                        int len) {
  char stmp[128];
  sprintf(stmp, "%s:type:%s", class_def, type_def);
  return ssds_get_gen_name(pcfd, stmp, "sf", "f_type", res, len);
}


x86 assembly (clang, -O0):
<ssds_set_field_type>:
push   %rbp
mov    %rsp,%rbp
sub    $0xb0,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
lea    -0xb0(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
lea    0xeac(%rip),%rsi
call   1040 <sprintf@plt>
mov    -0x4(%rbp),%edi
lea    -0xb0(%rbp),%rsi
mov    -0x20(%rbp),%r8
mov    -0x24(%rbp),%r9d
lea    0xe99(%rip),%rdx
lea    0xe95(%rip),%rcx
call   1030 <ssds_get_gen_name@plt>
add    $0xb0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ssds_set_field_type>:
push   %rbp
push   %r15
push   %r14
push   %rbx
sub    $0x88,%rsp
mov    %r8d,%r14d
mov    %rcx,%rbx
mov    %rdx,%rcx
mov    %rsi,%rdx
mov    %edi,%ebp
lea    0xebe(%rip),%rsi
mov    %rsp,%r15
mov    %r15,%rdi
call   1040 <sprintf@plt>
lea    0xeb7(%rip),%rdx
lea    0xeb3(%rip),%rcx
mov    %ebp,%edi
mov    %r15,%rsi
mov    %rbx,%r8
mov    %r14d,%r9d
call   1030 <ssds_get_gen_name@plt>
add    $0x88,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [11 x i8] c"%s:type:%s\00"
@.str.1 = [3 x i8] c"sf\00"
@.str.2 = [7 x i8] c"f_type\00"
define i32 @ssds_set_field_type(i32 %0, i8* %1, i8* %2, i8* %3, i32 %4) {
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca i32
%11 = alloca [128 x i8]
store i32 %0, i32* %6
store i8* %1, i8** %7
store i8* %2, i8** %8
store i8* %3, i8** %9
store i32 %4, i32* %10
%12 = getelementptr inbounds [128 x i8], [128 x i8]* %11, i64 0, i64 0
%13 = load i8*, i8** %7
%14 = load i8*, i8** %8
%15 = call i32 @sprintf(i8* %12, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %13, i8* %14)
%16 = load i32, i32* %6
%17 = getelementptr inbounds [128 x i8], [128 x i8]* %11, i64 0, i64 0
%18 = load i8*, i8** %9
%19 = load i32, i32* %10
%20 = call i32 @ssds_get_gen_name(i32 %16, i8* %17, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i8* %18, i32 %19)
ret i32 %20
}

LLVM IR (-O2):
@.str = [11 x i8] c"%s:type:%s\00"
@.str.1 = [3 x i8] c"sf\00"
@.str.2 = [7 x i8] c"f_type\00"
define i32 @ssds_set_field_type(i32 %0, i8* %1, i8* %2, i8* %3, i32 %4) {
%6 = alloca [128 x i8]
%7 = getelementptr inbounds [128 x i8], [128 x i8]* %6, i64 0, i64 0
%8 = call i32 @sprintf(i8* %7, i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %1, i8* %2)
%9 = call i32 @ssds_get_gen_name(i32 %0, i8* %7, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i8* %3, i32 %4)
ret i32 %9
}