#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 ipr_get_saved_attr(struct ipr_ioa *, char *, char *, char *);
int /*<<< orphan*/ sprintf(char *, char *, char *, int);
int ipr_get_saved_bus_attr(struct ipr_ioa *ioa, int bus, char *field,
                           char *value) {
  char category[16];
  sprintf(category, "[%s %d]", "Bus", bus);
  return ipr_get_saved_attr(ioa, category, field, value);
}


x86 assembly (clang, -O0):
<ipr_get_saved_bus_attr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
lea    -0x30(%rbp),%rdi
mov    -0xc(%rbp),%ecx
lea    0xebb(%rip),%rsi
lea    0xebc(%rip),%rdx
call   1040 <sprintf@plt>
mov    -0x8(%rbp),%rdi
lea    -0x30(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
call   1030 <ipr_get_saved_attr@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ipr_get_saved_bus_attr>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %rcx,%r14
mov    %rdx,%r15
mov    %esi,%ecx
mov    %rdi,%rbx
lea    0xec3(%rip),%rsi
lea    0xec4(%rip),%rdx
mov    %rsp,%r12
mov    %r12,%rdi
call   1040 <sprintf@plt>
mov    %rbx,%rdi
mov    %r12,%rsi
mov    %r15,%rdx
mov    %r14,%rcx
call   1030 <ipr_get_saved_attr@plt>
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
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 i32 @ipr_get_saved_bus_attr(%struct.ipr_ioa* %0, i32 %1, i8* %2, i8* %3) {
%5 = alloca %struct.ipr_ioa*
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca [16 x i8]
store %struct.ipr_ioa* %0, %struct.ipr_ioa** %5
store i32 %1, i32* %6
store i8* %2, i8** %7
store i8* %3, i8** %8
%10 = getelementptr inbounds [16 x i8], [16 x i8]* %9, i64 0, i64 0
%11 = load i32, i32* %6
%12 = call i32 @sprintf(i8* %10, 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 %11)
%13 = load %struct.ipr_ioa*, %struct.ipr_ioa** %5
%14 = getelementptr inbounds [16 x i8], [16 x i8]* %9, i64 0, i64 0
%15 = load i8*, i8** %7
%16 = load i8*, i8** %8
%17 = call i32 @ipr_get_saved_attr(%struct.ipr_ioa* %13, i8* %14, i8* %15, i8* %16)
ret i32 %17
}

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 i32 @ipr_get_saved_bus_attr(%struct.ipr_ioa* %0, i32 %1, i8* %2, i8* %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 ([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)
%8 = call i32 @ipr_get_saved_attr(%struct.ipr_ioa* %0, i8* %6, i8* %2, i8* %3)
ret i32 %8
}