#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 */
char tolower(unsigned char);
void irclower(char *str) {
  char *itr;
  for (itr = str; *itr != '\0'; ++itr) {
    if (*itr == '[')
      *itr = '{';
    else if (*itr == ']')
      *itr = '}';
    else if (*itr == '\\')
      *itr = '|';
    else if (*itr == '~')
      *itr = '^';
    else
      *itr = tolower((unsigned char)(*itr));
  }
}


x86 assembly (clang, -O0):
<irclower>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     11dd <irclower+0xcd>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x5b,%eax
jne    1150 <irclower+0x40>
mov    -0x10(%rbp),%rax
movb   $0x7b,(%rax)
jmp    11c7 <irclower+0xb7>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x5d,%eax
jne    116c <irclower+0x5c>
mov    -0x10(%rbp),%rax
movb   $0x7d,(%rax)
jmp    11c2 <irclower+0xb2>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x5c,%eax
jne    1188 <irclower+0x78>
mov    -0x10(%rbp),%rax
movb   $0x7c,(%rax)
jmp    11bd <irclower+0xad>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x7e,%eax
jne    11a4 <irclower+0x94>
mov    -0x10(%rbp),%rax
movb   $0x5e,(%rax)
jmp    11b8 <irclower+0xa8>
mov    -0x10(%rbp),%rax
movzbl (%rax),%edi
call   1030 <tolower@plt>
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
jmp    11bd <irclower+0xad>
jmp    11c2 <irclower+0xb2>
jmp    11c7 <irclower+0xb7>
jmp    11cc <irclower+0xbc>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1124 <irclower+0x14>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<irclower>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
lea    0xee2(%rip),%r14
jmp    1136 <irclower+0x26>
mov    $0x5e,%al
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %al,(%rbx)
add    $0x1,%rbx
movzbl (%rbx),%ecx
lea    -0x5b(%rcx),%edx
cmp    $0x23,%dl
ja     1157 <irclower+0x47>
mov    $0x7b,%al
movzbl %dl,%edx
movslq (%r14,%rdx,4),%rdx
add    %r14,%rdx
jmp    *%rdx
mov    $0x7c,%al
jmp    1130 <irclower+0x20>
mov    $0x7d,%al
jmp    1130 <irclower+0x20>
test   %cl,%cl
je     1165 <irclower+0x55>
movzbl %cl,%edi
call   1030 <tolower@plt>
jmp    1130 <irclower+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @irclower(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
store i8* %4, i8** %3
br label %5
5: ; preds = %47, %1
%6 = load i8*, i8** %3
%7 = load i8, i8* %6
%8 = sext i8 %7 to i32
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %50
10: ; preds = %5
%11 = load i8*, i8** %3
%12 = load i8, i8* %11
%13 = sext i8 %12 to i32
%14 = icmp eq i32 %13, 91
br i1 %14, label %15, label %17
15: ; preds = %10
%16 = load i8*, i8** %3
store i8 123, i8* %16
br label %46
17: ; preds = %10
%18 = load i8*, i8** %3
%19 = load i8, i8* %18
%20 = sext i8 %19 to i32
%21 = icmp eq i32 %20, 93
br i1 %21, label %22, label %24
22: ; preds = %17
%23 = load i8*, i8** %3
store i8 125, i8* %23
br label %45
24: ; preds = %17
%25 = load i8*, i8** %3
%26 = load i8, i8* %25
%27 = sext i8 %26 to i32
%28 = icmp eq i32 %27, 92
br i1 %28, label %29, label %31
29: ; preds = %24
%30 = load i8*, i8** %3
store i8 124, i8* %30
br label %44
31: ; preds = %24
%32 = load i8*, i8** %3
%33 = load i8, i8* %32
%34 = sext i8 %33 to i32
%35 = icmp eq i32 %34, 126
br i1 %35, label %36, label %38
36: ; preds = %31
%37 = load i8*, i8** %3
store i8 94, i8* %37
br label %43
38: ; preds = %31
%39 = load i8*, i8** %3
%40 = load i8, i8* %39
%41 = call signext i8 @tolower(i8 zeroext %40)
%42 = load i8*, i8** %3
store i8 %41, i8* %42
br label %43
43: ; preds = %38, %36
br label %44
44: ; preds = %43, %29
br label %45
45: ; preds = %44, %22
br label %46
46: ; preds = %45, %15
br label %47
47: ; preds = %46
%48 = load i8*, i8** %3
%49 = getelementptr inbounds i8, i8* %48, i32 1
store i8* %49, i8** %3
br label %5
50: ; preds = %5
ret void
}

LLVM IR (-O2):
define void @irclower(i8* nocapture %0) {
br label %2
2: ; preds = %10, %1
%3 = phi i8* [ %0, %1 ], [ %12, %10 ]
%4 = load i8, i8* %3
switch i8 %4, label %8 [
i8 0, label %13
i8 91, label %10
i8 93, label %5
i8 92, label %6
i8 126, label %7
]
5: ; preds = %2
br label %10
6: ; preds = %2
br label %10
7: ; preds = %2
br label %10
8: ; preds = %2
%9 = tail call signext i8 @tolower(i8 zeroext %4)
br label %10
10: ; preds = %2, %6, %8, %7, %5
%11 = phi i8 [ 124, %6 ], [ %9, %8 ], [ 94, %7 ], [ 125, %5 ], [ 123, %2 ]
store i8 %11, i8* %3
%12 = getelementptr inbounds i8, i8* %3, i64 1
br label %2
13: ; preds = %2
ret void
}