#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_WMRCREATEBRUSHINDIRECT_get(char const *, char const **);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ region_print(char const *);
void U_WMRCREATEREGION_print(const char *contents) {
  const char *region;
  int size = U_WMRCREATEBRUSHINDIRECT_get(contents, &region);
  if (size > 0) {
    printf("   Brush:");
    printf("   Region: ");
    region_print(region);
    printf("\n");
  }
}


x86 assembly (clang, -O0):
<U_WMRCREATEREGION_print>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <U_WMRCREATEBRUSHINDIRECT_get@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jle    1183 <U_WMRCREATEREGION_print+0x53>
lea    0xea3(%rip),%rdi
call   1030 <printf@plt>
lea    0xea1(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%rdi
call   1050 <region_print@plt>
lea    0xe98(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<U_WMRCREATEREGION_print>:
push   %rax
mov    %rsp,%rsi
call   1050 <U_WMRCREATEBRUSHINDIRECT_get@plt>
test   %eax,%eax
jle    1178 <U_WMRCREATEREGION_print+0x38>
lea    0xeac(%rip),%rdi
call   1040 <printf@plt>
lea    0xeaa(%rip),%rdi
call   1040 <printf@plt>
mov    (%rsp),%rdi
call   1060 <region_print@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [10 x i8] c" Brush:\00"
@.str.1 = [12 x i8] c" Region: \00"
@.str.2 = [2 x i8] c"\0A\00"
define void @U_WMRCREATEREGION_print(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i32 @U_WMRCREATEBRUSHINDIRECT_get(i8* %5, i8** %3)
store i32 %6, i32* %4
%7 = load i32, i32* %4
%8 = icmp sgt i32 %7, 0
br i1 %8, label %9, label %15
9: ; preds = %1
%10 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%11 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
%12 = load i8*, i8** %3
%13 = call i32 @region_print(i8* %12)
%14 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
br label %15
15: ; preds = %9, %1
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c" Brush:\00"
@.str.1 = [12 x i8] c" Region: \00"
define void @U_WMRCREATEREGION_print(i8* %0) {
%2 = alloca i8*
%3 = bitcast i8** %2 to i8*
%4 = call i32 @U_WMRCREATEBRUSHINDIRECT_get(i8* %0, i8** %2)
%5 = icmp sgt i32 %4, 0
br i1 %5, label %6, label %12
6: ; preds = %1
%7 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
%9 = load i8*, i8** %2
%10 = call i32 @region_print(i8* %9)
%11 = call i32 @putchar(i32 10)
br label %12
12: ; preds = %6, %1
ret void
}