#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 ascii_tolower(int);
char const *strchr(char const *, int);
int strict_rfc1459_tolower(int c) {
  const char *punc = "[]\\";
  return strchr(punc, c) ? "{}|"[strchr(punc, c) - punc] : ascii_tolower(c);
}


x86 assembly (clang, -O0):
<strict_rfc1459_tolower>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
lea    0xece(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x4(%rbp),%esi
call   1030 <strchr@plt>
cmp    $0x0,%rax
je     1175 <strict_rfc1459_tolower+0x55>
mov    -0x10(%rbp),%rdi
mov    -0x4(%rbp),%esi
call   1030 <strchr@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
sub    %rax,%rcx
lea    0xe9b(%rip),%rax
movsbl (%rax,%rcx,1),%eax
mov    %eax,-0x14(%rbp)
jmp    1180 <strict_rfc1459_tolower+0x60>
mov    -0x4(%rbp),%edi
call   1040 <ascii_tolower@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strict_rfc1459_tolower>:
push   %r14
push   %rbx
push   %rax
mov    %edi,%ebx
lea    0xed3(%rip),%r14
mov    $0x4,%edx
mov    %r14,%rdi
mov    %ebx,%esi
call   1030 <memchr@plt>
test   %rax,%rax
je     1157 <strict_rfc1459_tolower+0x37>
sub    %r14,%rax
lea    0xeb9(%rip),%rcx
movsbl (%rax,%rcx,1),%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret
mov    %ebx,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <ascii_tolower@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"[]\\\00"
@.str.1 = [4 x i8] c"{}|\00"
define i32 @strict_rfc1459_tolower(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8** %3
%4 = load i8*, i8** %3
%5 = load i32, i32* %2
%6 = call i8* @strchr(i8* %4, i32 %5)
%7 = icmp ne i8* %6, null
br i1 %7, label %8, label %19
8: ; preds = %1
%9 = load i8*, i8** %3
%10 = load i32, i32* %2
%11 = call i8* @strchr(i8* %9, i32 %10)
%12 = load i8*, i8** %3
%13 = ptrtoint i8* %11 to i64
%14 = ptrtoint i8* %12 to i64
%15 = sub i64 %13, %14
%16 = getelementptr inbounds [4 x i8], [4 x i8]* @.str.1, i64 0, i64 %15
%17 = load i8, i8* %16
%18 = sext i8 %17 to i32
br label %22
19: ; preds = %1
%20 = load i32, i32* %2
%21 = call i32 @ascii_tolower(i32 %20)
br label %22
22: ; preds = %19, %8
%23 = phi i32 [ %18, %8 ], [ %21, %19 ]
ret i32 %23
}

LLVM IR (-O2):
@.str = [4 x i8] c"[]\\\00"
@.str.1 = [4 x i8] c"{}|\00"
define i32 @strict_rfc1459_tolower(i32 %0) {
%2 = tail call i8* @memchr(i8* dereferenceable(4) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %0, i64 4)
%3 = icmp eq i8* %2, null
br i1 %3, label %10, label %4
4: ; preds = %1
%5 = ptrtoint i8* %2 to i64
%6 = sub i64 %5, ptrtoint ([4 x i8]* @.str to i64)
%7 = getelementptr inbounds [4 x i8], [4 x i8]* @.str.1, i64 0, i64 %6
%8 = load i8, i8* %7
%9 = sext i8 %8 to i32
br label %12
10: ; preds = %1
%11 = tail call i32 @ascii_tolower(i32 %0)
br label %12
12: ; preds = %10, %4
%13 = phi i32 [ %9, %4 ], [ %11, %10 ]
ret i32 %13
}