#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 int wchar_t;

/* Variables and functions */
int set_lengthmodifier2(wchar_t ch, int *plengthmodifier) {
  switch (ch) {
  case L'h':
    if (*plengthmodifier == (0x00010002)) {
      *plengthmodifier = (0x00010001);
      return 1;
    }
    return 0;
  case L'l':
    if (*plengthmodifier == (0x00010003)) {
      *plengthmodifier = (0x00010004);
      return 1;
    }
    return 0;
  default:
    return 0;
  }
}


x86 assembly (clang, -O0):
<set_lengthmodifier2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
sub    $0x68,%eax
je     1130 <set_lengthmodifier2+0x30>
jmp    111f <set_lengthmodifier2+0x1f>
mov    -0x14(%rbp),%eax
sub    $0x6c,%eax
je     1162 <set_lengthmodifier2+0x62>
jmp    1194 <set_lengthmodifier2+0x94>
mov    -0x10(%rbp),%rax
cmpl   $0x10002,(%rax)
jne    1156 <set_lengthmodifier2+0x56>
mov    -0x10(%rbp),%rax
movl   $0x10001,(%rax)
movl   $0x1,-0x4(%rbp)
jmp    119b <set_lengthmodifier2+0x9b>
movl   $0x0,-0x4(%rbp)
jmp    119b <set_lengthmodifier2+0x9b>
mov    -0x10(%rbp),%rax
cmpl   $0x10003,(%rax)
jne    1188 <set_lengthmodifier2+0x88>
mov    -0x10(%rbp),%rax
movl   $0x10004,(%rax)
movl   $0x1,-0x4(%rbp)
jmp    119b <set_lengthmodifier2+0x9b>
movl   $0x0,-0x4(%rbp)
jmp    119b <set_lengthmodifier2+0x9b>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_lengthmodifier2>:
xor    %eax,%eax
cmp    $0x6c,%edi
je     111b <set_lengthmodifier2+0x1b>
cmp    $0x68,%edi
jne    112f <set_lengthmodifier2+0x2f>
mov    $0x10001,%ecx
cmpl   $0x10002,(%rsi)
je     1128 <set_lengthmodifier2+0x28>
jmp    112f <set_lengthmodifier2+0x2f>
mov    $0x10004,%ecx
cmpl   $0x10003,(%rsi)
jne    112f <set_lengthmodifier2+0x2f>
mov    %ecx,(%rsi)
mov    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @set_lengthmodifier2(i32 %0, i32* %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32*
store i32 %0, i32* %4
store i32* %1, i32** %5
%6 = load i32, i32* %4
switch i32 %6, label %21 [
i32 104, label %7
i32 108, label %14
]
7: ; preds = %2
%8 = load i32*, i32** %5
%9 = load i32, i32* %8
%10 = icmp eq i32 %9, 65538
br i1 %10, label %11, label %13
11: ; preds = %7
%12 = load i32*, i32** %5
store i32 65537, i32* %12
store i32 1, i32* %3
br label %22
13: ; preds = %7
store i32 0, i32* %3
br label %22
14: ; preds = %2
%15 = load i32*, i32** %5
%16 = load i32, i32* %15
%17 = icmp eq i32 %16, 65539
br i1 %17, label %18, label %20
18: ; preds = %14
%19 = load i32*, i32** %5
store i32 65540, i32* %19
store i32 1, i32* %3
br label %22
20: ; preds = %14
store i32 0, i32* %3
br label %22
21: ; preds = %2
store i32 0, i32* %3
br label %22
22: ; preds = %21, %20, %18, %13, %11
%23 = load i32, i32* %3
ret i32 %23
}

LLVM IR (-O2):
define i32 @set_lengthmodifier2(i32 %0, i32* nocapture %1) {
switch i32 %0, label %11 [
i32 104, label %3
i32 108, label %6
]
3: ; preds = %2
%4 = load i32, i32* %1
%5 = icmp eq i32 %4, 65538
br i1 %5, label %9, label %11
6: ; preds = %2
%7 = load i32, i32* %1
%8 = icmp eq i32 %7, 65539
br i1 %8, label %9, label %11
9: ; preds = %6, %3
%10 = phi i32 [ 65537, %3 ], [ 65540, %6 ]
store i32 %10, i32* %1
br label %11
11: ; preds = %9, %2, %6, %3
%12 = phi i32 [ 0, %3 ], [ 0, %6 ], [ 0, %2 ], [ 1, %9 ]
ret i32 %12
}