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

/* Variables and functions */
char *__print_device(struct ipr_dev *, int /*<<< orphan*/ *,
                     int /*<<< orphan*/ *, int, int, int, int, int, int,
                     int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/,
                     int /*<<< orphan*/, int /*<<< orphan*/,
                     int /*<<< orphan*/);
int /*<<< orphan*/ free(char *);
int /*<<< orphan*/ printf(char *, char *);
void __printf_device(struct ipr_dev *dev, int sd, int sg, int vpd, int percent,
                     int indent, int res_path) {
  char *buf = __print_device(dev, NULL, NULL, sd, sg, vpd, percent, indent,
                             res_path, 0, 0, 0, 0, 0, 0);
  if (buf) {
    printf("%s", buf);
    free(buf);
  }
}


x86 assembly (clang, -O0):
<__printf_device>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
mov    0x10(%rbp),%eax
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8d,-0x18(%rbp)
mov    %r9d,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%ecx
mov    -0x10(%rbp),%r8d
mov    -0x14(%rbp),%r9d
mov    -0x18(%rbp),%r11d
mov    -0x1c(%rbp),%r10d
mov    0x10(%rbp),%eax
xor    %edx,%edx
xor    %esi,%esi
mov    %rdx,%rsi
mov    %r11d,(%rsp)
mov    %r10d,0x8(%rsp)
mov    %eax,0x10(%rsp)
movl   $0x0,0x18(%rsp)
movl   $0x0,0x20(%rsp)
movl   $0x0,0x28(%rsp)
movl   $0x0,0x30(%rsp)
movl   $0x0,0x38(%rsp)
movl   $0x0,0x40(%rsp)
call   1050 <__print_device@plt>
mov    %rax,-0x28(%rbp)
cmpq   $0x0,-0x28(%rbp)
je     11db <__printf_device+0xab>
mov    -0x28(%rbp),%rsi
lea    0xe33(%rip),%rdi
call   1040 <printf@plt>
mov    -0x28(%rbp),%rdi
call   1030 <free@plt>
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__printf_device>:
push   %rbx
mov    %r9d,%eax
mov    %r8d,%r10d
mov    %ecx,%r9d
mov    %edx,%r8d
mov    %esi,%ecx
mov    0x10(%rsp),%ebx
sub    $0x8,%rsp
xor    %esi,%esi
xor    %edx,%edx
push   $0x0
push   $0x0
push   $0x0
push   $0x0
push   $0x0
push   $0x0
push   %rbx
push   %rax
push   %r10
call   1050 <__print_device@plt>
add    $0x50,%rsp
test   %rax,%rax
je     1184 <__printf_device+0x54>
mov    %rax,%rbx
lea    0xe8d(%rip),%rdi
mov    %rax,%rsi
call   1040 <printf@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>
pop    %rbx
ret

LLVM IR (-O0):
%struct.ipr_dev = type { i32 }
@.str = [3 x i8] c"%s\00"
define void @__printf_device(%struct.ipr_dev* %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5, i32 %6) {
%8 = alloca %struct.ipr_dev*
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca i8*
store %struct.ipr_dev* %0, %struct.ipr_dev** %8
store i32 %1, i32* %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store i32 %4, i32* %12
store i32 %5, i32* %13
store i32 %6, i32* %14
%16 = load %struct.ipr_dev*, %struct.ipr_dev** %8
%17 = load i32, i32* %9
%18 = load i32, i32* %10
%19 = load i32, i32* %11
%20 = load i32, i32* %12
%21 = load i32, i32* %13
%22 = load i32, i32* %14
%23 = call i8* @__print_device(%struct.ipr_dev* %16, i32* null, i32* null, i32 %17, i32 %18, i32 %19, i32 %20, i32 %21, i32 %22, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0)
store i8* %23, i8** %15
%24 = load i8*, i8** %15
%25 = icmp ne i8* %24, null
br i1 %25, label %26, label %31
26: ; preds = %7
%27 = load i8*, i8** %15
%28 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %27)
%29 = load i8*, i8** %15
%30 = call i32 @free(i8* %29)
br label %31
31: ; preds = %26, %7
ret void
}

LLVM IR (-O2):
%struct.ipr_dev = type { i32 }
@.str = [3 x i8] c"%s\00"
define void @__printf_device(%struct.ipr_dev* %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5, i32 %6) {
%8 = tail call i8* @__print_device(%struct.ipr_dev* %0, i32* null, i32* null, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5, i32 %6, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0)
%9 = icmp eq i8* %8, null
br i1 %9, label %13, label %10
10: ; preds = %7
%11 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %8)
%12 = tail call i32 @free(i8* %8)
br label %13
13: ; preds = %10, %7
ret void
}