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

/* Variables and functions */
int /*<<< orphan*/ char_to_string(int);
int chr_to_jst(int);
int /*<<< orphan*/ format_region(struct rng *, int, int);
int /*<<< orphan*/ io_error_msg(char *, int /*<<< orphan*/);
void set_region_alignment(struct rng *rng, int align) {
  int fun = chr_to_jst(align);
  if (fun != -1)
    format_region(rng, -1, fun);
  else
    io_error_msg("Unknown Justify '%s'", char_to_string(align));
}


x86 assembly (clang, -O0):
<set_region_alignment>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%edi
call   1050 <chr_to_jst@plt>
mov    %eax,-0x10(%rbp)
cmpl   $0xffffffff,-0x10(%rbp)
je     117a <set_region_alignment+0x3a>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%edx
mov    $0xffffffff,%esi
call   1030 <format_region@plt>
jmp    1190 <set_region_alignment+0x50>
mov    -0xc(%rbp),%edi
call   1060 <char_to_string@plt>
mov    %eax,%esi
lea    0xe75(%rip),%rdi
call   1040 <io_error_msg@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_region_alignment>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
mov    %esi,%edi
call   1050 <chr_to_jst@plt>
cmp    $0xffffffff,%eax
je     1169 <set_region_alignment+0x29>
mov    %rbx,%rdi
mov    $0xffffffff,%esi
mov    %eax,%edx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <format_region@plt>
mov    %ebp,%edi
call   1060 <char_to_string@plt>
lea    0xe89(%rip),%rdi
mov    %eax,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <io_error_msg@plt>

LLVM IR (-O0):
%struct.rng = type { i32 }
@.str = [21 x i8] c"Unknown Justify '%s'\00"
define void @set_region_alignment(%struct.rng* %0, i32 %1) {
%3 = alloca %struct.rng*
%4 = alloca i32
%5 = alloca i32
store %struct.rng* %0, %struct.rng** %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
%7 = call i32 @chr_to_jst(i32 %6)
store i32 %7, i32* %5
%8 = load i32, i32* %5
%9 = icmp ne i32 %8, -1
br i1 %9, label %10, label %14
10: ; preds = %2
%11 = load %struct.rng*, %struct.rng** %3
%12 = load i32, i32* %5
%13 = call i32 @format_region(%struct.rng* %11, i32 -1, i32 %12)
br label %18
14: ; preds = %2
%15 = load i32, i32* %4
%16 = call i32 @char_to_string(i32 %15)
%17 = call i32 @io_error_msg(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 %16)
br label %18
18: ; preds = %14, %10
ret void
}

LLVM IR (-O2):
%struct.rng = type { i32 }
@.str = [21 x i8] c"Unknown Justify '%s'\00"
define void @set_region_alignment(%struct.rng* %0, i32 %1) {
%3 = tail call i32 @chr_to_jst(i32 %1)
%4 = icmp eq i32 %3, -1
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 @format_region(%struct.rng* %0, i32 -1, i32 %3)
br label %10
7: ; preds = %2
%8 = tail call i32 @char_to_string(i32 %1)
%9 = tail call i32 @io_error_msg(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 %8)
br label %10
10: ; preds = %7, %5
ret void
}