#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 */
typedef scalar_t__ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ warning_message(char *, char const *);
void process_wbadj(const char *argv0, const char chr, uint32_t adj,
                   uint32_t *wbadj_mg, uint32_t *wbadj_ba) {
  if (chr == 'M') {
    *wbadj_mg = 7 - adj;
  } else if (chr == 'G') {
    *wbadj_mg = 7 + adj;
  } else if (chr == 'B') {
    *wbadj_ba = 7 - adj;
  } else if (chr == 'A') {
    *wbadj_ba = 7 + adj;
  } else {
    warning_message("%s: Invalid white_balance_adjustment\n", argv0);
  }
}


x86 assembly (clang, -O0):
<process_wbadj>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
movsbl -0x9(%rbp),%eax
cmp    $0x4d,%eax
jne    1150 <process_wbadj+0x40>
mov    $0x7,%ecx
sub    -0x18(%rbp),%rcx
mov    -0x20(%rbp),%rax
mov    %rcx,(%rax)
jmp    11d3 <process_wbadj+0xc3>
movsbl -0x9(%rbp),%eax
cmp    $0x47,%eax
jne    1171 <process_wbadj+0x61>
mov    -0x18(%rbp),%rcx
add    $0x7,%rcx
mov    -0x20(%rbp),%rax
mov    %rcx,(%rax)
jmp    11ce <process_wbadj+0xbe>
movsbl -0x9(%rbp),%eax
cmp    $0x42,%eax
jne    1193 <process_wbadj+0x83>
mov    $0x7,%ecx
sub    -0x18(%rbp),%rcx
mov    -0x28(%rbp),%rax
mov    %rcx,(%rax)
jmp    11c9 <process_wbadj+0xb9>
movsbl -0x9(%rbp),%eax
cmp    $0x41,%eax
jne    11b4 <process_wbadj+0xa4>
mov    -0x18(%rbp),%rcx
add    $0x7,%rcx
mov    -0x28(%rbp),%rax
mov    %rcx,(%rax)
jmp    11c4 <process_wbadj+0xb4>
mov    -0x8(%rbp),%rsi
lea    0xe41(%rip),%rdi
call   1030 <warning_message@plt>
jmp    11c9 <process_wbadj+0xb9>
jmp    11ce <process_wbadj+0xbe>
jmp    11d3 <process_wbadj+0xc3>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<process_wbadj>:
mov    %rdi,%rax
add    $0xbf,%sil
cmp    $0xc,%sil
ja     1145 <process_wbadj+0x35>
movzbl %sil,%esi
lea    0xed8(%rip),%rdi
movslq (%rdi,%rsi,4),%rsi
add    %rdi,%rsi
jmp    *%rsi
add    $0x7,%rdx
mov    %rdx,(%r8)
ret
mov    $0x7,%eax
sub    %rdx,%rax
mov    %rax,(%r8)
ret
lea    0xee8(%rip),%rdi
mov    %rax,%rsi
jmp    1030 <warning_message@plt>
add    $0x7,%rdx
mov    %rdx,(%rcx)
ret
mov    $0x7,%eax
sub    %rdx,%rax
mov    %rax,(%rcx)
ret

LLVM IR (-O0):
@.str = [38 x i8] c"%s: Invalid white_balance_adjustment\0A\00"
define void @process_wbadj(i8* %0, i8 signext %1, i64 %2, i64* %3, i64* %4) {
%6 = alloca i8*
%7 = alloca i8
%8 = alloca i64
%9 = alloca i64*
%10 = alloca i64*
store i8* %0, i8** %6
store i8 %1, i8* %7
store i64 %2, i64* %8
store i64* %3, i64** %9
store i64* %4, i64** %10
%11 = load i8, i8* %7
%12 = sext i8 %11 to i32
%13 = icmp eq i32 %12, 77
br i1 %13, label %14, label %18
14: ; preds = %5
%15 = load i64, i64* %8
%16 = sub nsw i64 7, %15
%17 = load i64*, i64** %9
store i64 %16, i64* %17
br label %48
18: ; preds = %5
%19 = load i8, i8* %7
%20 = sext i8 %19 to i32
%21 = icmp eq i32 %20, 71
br i1 %21, label %22, label %26
22: ; preds = %18
%23 = load i64, i64* %8
%24 = add nsw i64 7, %23
%25 = load i64*, i64** %9
store i64 %24, i64* %25
br label %47
26: ; preds = %18
%27 = load i8, i8* %7
%28 = sext i8 %27 to i32
%29 = icmp eq i32 %28, 66
br i1 %29, label %30, label %34
30: ; preds = %26
%31 = load i64, i64* %8
%32 = sub nsw i64 7, %31
%33 = load i64*, i64** %10
store i64 %32, i64* %33
br label %46
34: ; preds = %26
%35 = load i8, i8* %7
%36 = sext i8 %35 to i32
%37 = icmp eq i32 %36, 65
br i1 %37, label %38, label %42
38: ; preds = %34
%39 = load i64, i64* %8
%40 = add nsw i64 7, %39
%41 = load i64*, i64** %10
store i64 %40, i64* %41
br label %45
42: ; preds = %34
%43 = load i8*, i8** %6
%44 = call i32 @warning_message(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), i8* %43)
br label %45
45: ; preds = %42, %38
br label %46
46: ; preds = %45, %30
br label %47
47: ; preds = %46, %22
br label %48
48: ; preds = %47, %14
ret void
}

LLVM IR (-O2):
@.str = [38 x i8] c"%s: Invalid white_balance_adjustment\0A\00"
define void @process_wbadj(i8* %0, i8 signext %1, i64 %2, i64* nocapture writeonly %3, i64* nocapture writeonly %4) {
switch i8 %1, label %14 [
i8 77, label %6
i8 71, label %8
i8 66, label %10
i8 65, label %12
]
6: ; preds = %5
%7 = sub nsw i64 7, %2
store i64 %7, i64* %3
br label %16
8: ; preds = %5
%9 = add nsw i64 %2, 7
store i64 %9, i64* %3
br label %16
10: ; preds = %5
%11 = sub nsw i64 7, %2
store i64 %11, i64* %4
br label %16
12: ; preds = %5
%13 = add nsw i64 %2, 7
store i64 %13, i64* %4
br label %16
14: ; preds = %5
%15 = tail call i32 @warning_message(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), i8* %0)
br label %16
16: ; preds = %8, %12, %14, %10, %6
ret void
}