#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 U_PMR_SETCOMPOSITINGQUALITY_get(char const *, int /*<<< orphan*/ *, int *);
int /*<<< orphan*/ printf(char *, ...);
int U_PMR_SETCOMPOSITINGQUALITY_print(const char *contents) {
  int CQenum;
  int status = U_PMR_SETCOMPOSITINGQUALITY_get(contents, NULL, &CQenum);
  if (status) {
    printf("   +  CQenum:%d\n", CQenum);
  } else {
    printf("   corrupt record\n");
  }
  return (status);
}


x86 assembly (clang, -O0):
<U_PMR_SETCOMPOSITINGQUALITY_print>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
lea    -0xc(%rbp),%rdx
call   1040 <U_PMR_SETCOMPOSITINGQUALITY_get@plt>
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
je     1160 <U_PMR_SETCOMPOSITINGQUALITY_print+0x40>
mov    -0xc(%rbp),%esi
lea    0xeac(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    116e <U_PMR_SETCOMPOSITINGQUALITY_print+0x4e>
lea    0xeaa(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<U_PMR_SETCOMPOSITINGQUALITY_print>:
push   %rbx
sub    $0x10,%rsp
lea    0xc(%rsp),%rdx
xor    %esi,%esi
call   1050 <U_PMR_SETCOMPOSITINGQUALITY_get@plt>
mov    %eax,%ebx
test   %eax,%eax
je     115b <U_PMR_SETCOMPOSITINGQUALITY_print+0x2b>
mov    0xc(%rsp),%esi
lea    0xeae(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
jmp    1167 <U_PMR_SETCOMPOSITINGQUALITY_print+0x37>
lea    0xeaf(%rip),%rdi
call   1030 <puts@plt>
mov    %ebx,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [17 x i8] c" + CQenum:%d\0A\00"
@.str.1 = [19 x i8] c" corrupt record\0A\00"
define i32 @U_PMR_SETCOMPOSITINGQUALITY_print(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i32
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i32 @U_PMR_SETCOMPOSITINGQUALITY_get(i8* %5, i32* null, i32* %3)
store i32 %6, i32* %4
%7 = load i32, i32* %4
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %12
9: ; preds = %1
%10 = load i32, i32* %3
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %10)
br label %14
12: ; preds = %1
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0))
br label %14
14: ; preds = %12, %9
%15 = load i32, i32* %4
ret i32 %15
}

LLVM IR (-O2):
@.str = [17 x i8] c" + CQenum:%d\0A\00"
@str = [18 x i8] c" corrupt record\00"
define i32 @U_PMR_SETCOMPOSITINGQUALITY_print(i8* %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = call i32 @U_PMR_SETCOMPOSITINGQUALITY_get(i8* %0, i32* null, i32* %2)
%5 = icmp eq i32 %4, 0
br i1 %5, label %9, label %6
6: ; preds = %1
%7 = load i32, i32* %2
%8 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %7)
br label %11
9: ; preds = %1
%10 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str, i64 0, i64 0))
br label %11
11: ; preds = %9, %6
ret i32 %4
}