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

/* Variables and functions */
int /*<<< orphan*/ ipr_save_attr(struct ipr_ioa *, char *, char *, char *, int);
int /*<<< orphan*/ sprintf(char *, char *, char *);
void ipr_save_ioa_attr(struct ipr_ioa *ioa, char *field, char *value,
                       int update) {
  char category[16];
  sprintf(category, "[%s]", "Adapter");
  ipr_save_attr(ioa, category, field, value, update);
}


x86 assembly (clang, -O0):
<ipr_save_ioa_attr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
lea    -0x30(%rbp),%rdi
lea    0xebe(%rip),%rsi
lea    0xebc(%rip),%rdx
call   1040 <sprintf@plt>
mov    -0x8(%rbp),%rdi
lea    -0x30(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    -0x1c(%rbp),%r8d
call   1030 <ipr_save_attr@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ipr_save_ioa_attr>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x10,%rsp
mov    %ecx,%r14d
mov    %rdx,%r15
mov    %rsi,%rbp
mov    %rdi,%rbx
lea    0xec1(%rip),%rsi
lea    0xebf(%rip),%rdx
mov    %rsp,%r12
mov    %r12,%rdi
call   1040 <sprintf@plt>
mov    %rbx,%rdi
mov    %r12,%rsi
mov    %rbp,%rdx
mov    %r15,%rcx
mov    %r14d,%r8d
call   1030 <ipr_save_attr@plt>
add    $0x10,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
%struct.ipr_ioa = type { i32 }
@.str = [5 x i8] c"[%s]\00"
@.str.1 = [8 x i8] c"Adapter\00"
define void @ipr_save_ioa_attr(%struct.ipr_ioa* %0, i8* %1, i8* %2, i32 %3) {
%5 = alloca %struct.ipr_ioa*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i32
%9 = alloca [16 x i8]
store %struct.ipr_ioa* %0, %struct.ipr_ioa** %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store i32 %3, i32* %8
%10 = getelementptr inbounds [16 x i8], [16 x i8]* %9, i64 0, i64 0
%11 = call i32 @sprintf(i8* %10, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%12 = load %struct.ipr_ioa*, %struct.ipr_ioa** %5
%13 = getelementptr inbounds [16 x i8], [16 x i8]* %9, i64 0, i64 0
%14 = load i8*, i8** %6
%15 = load i8*, i8** %7
%16 = load i32, i32* %8
%17 = call i32 @ipr_save_attr(%struct.ipr_ioa* %12, i8* %13, i8* %14, i8* %15, i32 %16)
ret void
}

LLVM IR (-O2):
%struct.ipr_ioa = type { i32 }
@.str = [5 x i8] c"[%s]\00"
@.str.1 = [8 x i8] c"Adapter\00"
define void @ipr_save_ioa_attr(%struct.ipr_ioa* %0, i8* %1, i8* %2, i32 %3) {
%5 = alloca [16 x i8]
%6 = getelementptr inbounds [16 x i8], [16 x i8]* %5, i64 0, i64 0
%7 = call i32 @sprintf(i8* %6, i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%8 = call i32 @ipr_save_attr(%struct.ipr_ioa* %0, i8* %6, i8* %1, i8* %2, i32 %3)
ret void
}