#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 *, int);
void ipr_save_bus_attr(struct ipr_ioa *ioa, int bus, char *field, char *value,
                       int update) {
  char category[16];
  sprintf(category, "[%s %d]", "Bus", bus);
  ipr_save_attr(ioa, category, field, value, update);
}


x86 assembly (clang, -O0):
<ipr_save_bus_attr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
lea    -0x40(%rbp),%rdi
mov    -0xc(%rbp),%ecx
lea    0xeb7(%rip),%rsi
lea    0xeb8(%rip),%rdx
call   1040 <sprintf@plt>
mov    -0x8(%rbp),%rdi
lea    -0x40(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x24(%rbp),%r8d
call   1030 <ipr_save_attr@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ipr_save_bus_attr>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x10,%rsp
mov    %r8d,%r14d
mov    %rcx,%r15
mov    %rdx,%rbp
mov    %esi,%ecx
mov    %rdi,%rbx
lea    0xebf(%rip),%rsi
lea    0xec0(%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 = [8 x i8] c"[%s %d]\00"
@.str.1 = [4 x i8] c"Bus\00"
define void @ipr_save_bus_attr(%struct.ipr_ioa* %0, i32 %1, i8* %2, i8* %3, i32 %4) {
%6 = alloca %struct.ipr_ioa*
%7 = alloca i32
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca i32
%11 = alloca [16 x i8]
store %struct.ipr_ioa* %0, %struct.ipr_ioa** %6
store i32 %1, i32* %7
store i8* %2, i8** %8
store i8* %3, i8** %9
store i32 %4, i32* %10
%12 = getelementptr inbounds [16 x i8], [16 x i8]* %11, i64 0, i64 0
%13 = load i32, i32* %7
%14 = call i32 @sprintf(i8* %12, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %13)
%15 = load %struct.ipr_ioa*, %struct.ipr_ioa** %6
%16 = getelementptr inbounds [16 x i8], [16 x i8]* %11, i64 0, i64 0
%17 = load i8*, i8** %8
%18 = load i8*, i8** %9
%19 = load i32, i32* %10
%20 = call i32 @ipr_save_attr(%struct.ipr_ioa* %15, i8* %16, i8* %17, i8* %18, i32 %19)
ret void
}

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