#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 /*<<< orphan*/ isalpha(unsigned char);
int /*<<< orphan*/ strncpy(char *, char *, int);
char toupper(unsigned char);
void fix_units(char *s, int n) {
  char tmp[n + 2], *p;
  tmp[0] = '+';
  strncpy(tmp + 1, s, n);
  p = tmp + 1;
  *s = 0;
  while (*p) {
    if (toupper((unsigned char)*p) == 'C' && !isalpha((unsigned char)p[1]) &&
        !isalpha((unsigned char)p[-1])) {
      *s++ = 'C';
      *s++ = 'e';
      *s++ = 'l';
      *s++ = 's';
      *s++ = 'i';
      *s++ = 'u';
      *s++ = 's';
      p++;
    } else if (toupper((unsigned char)*p) == 'G' &&
               !isalpha((unsigned char)p[1]) &&
               !isalpha((unsigned char)p[-1])) {
      *s++ = 'g';
      *s++ = 'r';
      *s++ = 'a';
      *s++ = 'm';
      p++;
    } else if (toupper((unsigned char)*p) == '%') {
      *s++ = 'p';
      *s++ = 'e';
      *s++ = 'r';
      *s++ = 'c';
      *s++ = 'e';
      *s++ = 'n';
      *s++ = 't';
      p++;
    } else if (toupper((unsigned char)*p) == 'P' &&
               toupper((unsigned char)p[1]) == 'R' &&
               toupper((unsigned char)p[2]) == 'O' &&
               toupper((unsigned char)p[3]) == 'B') {
      *s++ = '1';
      p += 4;
    } else if (toupper((unsigned char)*p) == 'G' &&
               toupper((unsigned char)p[1]) == 'P' &&
               toupper((unsigned char)p[2]) == 'M' &&
               !isalpha((unsigned char)p[-1]) &&
               !isalpha((unsigned char)p[3])) {
      *s++ = 'm';
      p += 3;
    } else {
      *s++ = *p++;
    }
  }
  *s = 0;
}


x86 assembly (clang, -O0):
<fix_units>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x2,%eax
mov    %rsp,%rcx
mov    %rcx,-0x18(%rbp)
mov    %rax,%rcx
add    $0xf,%rcx
and    $0xfffffffffffffff0,%rcx
mov    %rsp,%rdi
sub    %rcx,%rdi
mov    %rdi,-0x30(%rbp)
mov    %rdi,%rsp
mov    %rax,-0x20(%rbp)
movb   $0x2b,(%rdi)
add    $0x1,%rdi
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
call   1030 <strncpy@plt>
mov    -0x30(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x28(%rbp)
mov    -0x8(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x28(%rbp),%rax
cmpb   $0x0,(%rax)
je     150c <fix_units+0x3dc>
mov    -0x28(%rbp),%rax
movzbl (%rax),%edi
call   1040 <toupper@plt>
movsbl %al,%eax
cmp    $0x43,%eax
jne    126e <fix_units+0x13e>
mov    -0x28(%rbp),%rax
movzbl 0x1(%rax),%edi
call   1050 <isalpha@plt>
cmp    $0x0,%eax
jne    126e <fix_units+0x13e>
mov    -0x28(%rbp),%rax
movzbl -0x1(%rax),%edi
call   1050 <isalpha@plt>
cmp    $0x0,%eax
jne    126e <fix_units+0x13e>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movb   $0x43,(%rax)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movb   $0x65,(%rax)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movb   $0x6c,(%rax)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movb   $0x73,(%rax)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movb   $0x69,(%rax)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movb   $0x75,(%rax)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movb   $0x73,(%rax)
mov    -0x28(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x28(%rbp)
jmp    1507 <fix_units+0x3d7>
mov    -0x28(%rbp),%rax
movzbl (%rax),%edi
call   1040 <toupper@plt>
movsbl %al,%eax
cmp    $0x47,%eax
jne    130b <fix_units+0x1db>
mov    -0x28(%rbp),%rax
movzbl 0x1(%rax),%edi
call   1050 <isalpha@plt>
cmp    $0x0,%eax
jne    130b <fix_units+0x1db>
mov    -0x28(%rbp),%rax
movzbl -0x1(%rax),%edi
call   1050 <isalpha@plt>
cmp    $0x0,%eax
jne    130b <fix_units+0x1db>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movb   $0x67,(%rax)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movb   $0x72,(%rax)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movb   $0x61,(%rax)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movb   $0x6d,(%rax)
mov    -0x28(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x28(%rbp)
jmp    1502 <fix_units+0x3d2>
mov    -0x28(%rbp),%rax
movzbl (%rax),%edi
call   1040 <toupper@plt>
movsbl %al,%eax
cmp    $0x25,%eax
jne    13b2 <fix_units+0x282>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movb   $0x70,(%rax)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movb   $0x65,(%rax)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movb   $0x72,(%rax)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movb   $0x63,(%rax)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movb   $0x65,(%rax)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movb   $0x6e,(%rax)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movb   $0x74,(%rax)
mov    -0x28(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x28(%rbp)
jmp    14fd <fix_units+0x3cd>
mov    -0x28(%rbp),%rax
movzbl (%rax),%edi
call   1040 <toupper@plt>
movsbl %al,%eax
cmp    $0x50,%eax
jne    1438 <fix_units+0x308>
mov    -0x28(%rbp),%rax
movzbl 0x1(%rax),%edi
call   1040 <toupper@plt>
movsbl %al,%eax
cmp    $0x52,%eax
jne    1438 <fix_units+0x308>
mov    -0x28(%rbp),%rax
movzbl 0x2(%rax),%edi
call   1040 <toupper@plt>
movsbl %al,%eax
cmp    $0x4f,%eax
jne    1438 <fix_units+0x308>
mov    -0x28(%rbp),%rax
movzbl 0x3(%rax),%edi
call   1040 <toupper@plt>
movsbl %al,%eax
cmp    $0x42,%eax
jne    1438 <fix_units+0x308>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movb   $0x31,(%rax)
mov    -0x28(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x28(%rbp)
jmp    14f8 <fix_units+0x3c8>
mov    -0x28(%rbp),%rax
movzbl (%rax),%edi
call   1040 <toupper@plt>
movsbl %al,%eax
cmp    $0x47,%eax
jne    14d1 <fix_units+0x3a1>
mov    -0x28(%rbp),%rax
movzbl 0x1(%rax),%edi
call   1040 <toupper@plt>
movsbl %al,%eax
cmp    $0x50,%eax
jne    14d1 <fix_units+0x3a1>
mov    -0x28(%rbp),%rax
movzbl 0x2(%rax),%edi
call   1040 <toupper@plt>
movsbl %al,%eax
cmp    $0x4d,%eax
jne    14d1 <fix_units+0x3a1>
mov    -0x28(%rbp),%rax
movzbl -0x1(%rax),%edi
call   1050 <isalpha@plt>
cmp    $0x0,%eax
jne    14d1 <fix_units+0x3a1>
mov    -0x28(%rbp),%rax
movzbl 0x3(%rax),%edi
call   1050 <isalpha@plt>
cmp    $0x0,%eax
jne    14d1 <fix_units+0x3a1>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movb   $0x6d,(%rax)
mov    -0x28(%rbp),%rax
add    $0x3,%rax
mov    %rax,-0x28(%rbp)
jmp    14f3 <fix_units+0x3c3>
mov    -0x28(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x28(%rbp)
mov    (%rax),%cl
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %cl,(%rax)
jmp    14f8 <fix_units+0x3c8>
jmp    14fd <fix_units+0x3cd>
jmp    1502 <fix_units+0x3d2>
jmp    1507 <fix_units+0x3d7>
jmp    118e <fix_units+0x5e>
mov    -0x8(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x18(%rbp),%rax
mov    %rax,%rsp
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fix_units>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %esi,%edx
mov    %rdi,%r14
lea    0x2(%rdx),%r15d
mov    %rsp,%r12
add    $0xf,%r15
and    $0xfffffffffffffff0,%r15
mov    %r12,%rbx
sub    %r15,%rbx
mov    %rbx,%rsp
movb   $0x2b,(%rbx)
add    $0x1,%rbx
neg    %r15
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <strncpy@plt>
movb   $0x0,(%r14)
mov    0x1(%r12,%r15,1),%al
jmp    119e <fix_units+0x6e>
nopl   0x0(%rax,%rax,1)
movl   $0x63726570,(%r14)
movw   $0x6e65,0x4(%r14)
movb   $0x74,0x6(%r14)
add    $0x7,%r14
add    $0x1,%rbx
movzbl (%rbx),%eax
test   %al,%al
je     12fa <fix_units+0x1ca>
movzbl %al,%edi
call   1040 <toupper@plt>
cmp    $0x43,%al
jne    11d0 <fix_units+0xa0>
movzbl 0x1(%rbx),%edi
call   1050 <isalpha@plt>
test   %eax,%eax
jne    11d0 <fix_units+0xa0>
movzbl -0x1(%rbx),%edi
call   1050 <isalpha@plt>
test   %eax,%eax
je     12b6 <fix_units+0x186>
movzbl (%rbx),%edi
call   1040 <toupper@plt>
cmp    $0x47,%al
jne    1200 <fix_units+0xd0>
movzbl 0x1(%rbx),%edi
call   1050 <isalpha@plt>
test   %eax,%eax
jne    1200 <fix_units+0xd0>
movzbl -0x1(%rbx),%edi
call   1050 <isalpha@plt>
test   %eax,%eax
je     12d9 <fix_units+0x1a9>
nopw   0x0(%rax,%rax,1)
movzbl (%rbx),%edi
call   1040 <toupper@plt>
cmp    $0x25,%al
je     1180 <fix_units+0x50>
movzbl (%rbx),%edi
call   1040 <toupper@plt>
cmp    $0x50,%al
jne    1260 <fix_units+0x130>
movzbl 0x1(%rbx),%edi
call   1040 <toupper@plt>
cmp    $0x52,%al
jne    1260 <fix_units+0x130>
movzbl 0x2(%rbx),%edi
call   1040 <toupper@plt>
cmp    $0x4f,%al
jne    1260 <fix_units+0x130>
movzbl 0x3(%rbx),%edi
call   1040 <toupper@plt>
cmp    $0x42,%al
jne    1260 <fix_units+0x130>
movb   $0x31,(%r14)
add    $0x1,%r14
add    $0x4,%rbx
movzbl (%rbx),%eax
jmp    119e <fix_units+0x6e>
nopw   0x0(%rax,%rax,1)
movzbl (%rbx),%edi
call   1040 <toupper@plt>
cmp    $0x47,%al
jne    12a0 <fix_units+0x170>
movzbl 0x1(%rbx),%edi
call   1040 <toupper@plt>
cmp    $0x50,%al
jne    12a0 <fix_units+0x170>
movzbl 0x2(%rbx),%edi
call   1040 <toupper@plt>
cmp    $0x4d,%al
jne    12a0 <fix_units+0x170>
movzbl -0x1(%rbx),%edi
call   1050 <isalpha@plt>
test   %eax,%eax
jne    12a0 <fix_units+0x170>
movzbl 0x3(%rbx),%edi
call   1050 <isalpha@plt>
test   %eax,%eax
je     12f0 <fix_units+0x1c0>
movzbl (%rbx),%eax
add    $0x1,%rbx
mov    %al,(%r14)
add    $0x1,%r14
movzbl (%rbx),%eax
jmp    119e <fix_units+0x6e>
add    $0x1,%rbx
movl   $0x736c6543,(%r14)
movw   $0x7569,0x4(%r14)
movb   $0x73,0x6(%r14)
add    $0x7,%r14
movzbl (%rbx),%eax
jmp    119e <fix_units+0x6e>
add    $0x1,%rbx
movl   $0x6d617267,(%r14)
add    $0x4,%r14
movzbl (%rbx),%eax
jmp    119e <fix_units+0x6e>
add    $0x3,%rbx
movb   $0x6d,(%r14)
jmp    12aa <fix_units+0x17a>
movb   $0x0,(%r14)
lea    -0x20(%rbp),%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @fix_units(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i8*
store i8* %0, i8** %3
store i32 %1, i32* %4
%8 = load i32, i32* %4
%9 = add nsw i32 %8, 2
%10 = zext i32 %9 to i64
%11 = call i8* @llvm.stacksave()
store i8* %11, i8** %5
%12 = alloca i8, i64 %10
store i64 %10, i64* %6
%13 = getelementptr inbounds i8, i8* %12, i64 0
store i8 43, i8* %13
%14 = getelementptr inbounds i8, i8* %12, i64 1
%15 = load i8*, i8** %3
%16 = load i32, i32* %4
%17 = call i32 @strncpy(i8* %14, i8* %15, i32 %16)
%18 = getelementptr inbounds i8, i8* %12, i64 1
store i8* %18, i8** %7
%19 = load i8*, i8** %3
store i8 0, i8* %19
br label %20
20: ; preds = %190, %2
%21 = load i8*, i8** %7
%22 = load i8, i8* %21
%23 = icmp ne i8 %22, 0
br i1 %23, label %24, label %191
24: ; preds = %20
%25 = load i8*, i8** %7
%26 = load i8, i8* %25
%27 = call signext i8 @toupper(i8 zeroext %26)
%28 = sext i8 %27 to i32
%29 = icmp eq i32 %28, 67
br i1 %29, label %30, label %59
30: ; preds = %24
%31 = load i8*, i8** %7
%32 = getelementptr inbounds i8, i8* %31, i64 1
%33 = load i8, i8* %32
%34 = call i32 @isalpha(i8 zeroext %33)
%35 = icmp ne i32 %34, 0
br i1 %35, label %59, label %36
36: ; preds = %30
%37 = load i8*, i8** %7
%38 = getelementptr inbounds i8, i8* %37, i64 -1
%39 = load i8, i8* %38
%40 = call i32 @isalpha(i8 zeroext %39)
%41 = icmp ne i32 %40, 0
br i1 %41, label %59, label %42
42: ; preds = %36
%43 = load i8*, i8** %3
%44 = getelementptr inbounds i8, i8* %43, i32 1
store i8* %44, i8** %3
store i8 67, i8* %43
%45 = load i8*, i8** %3
%46 = getelementptr inbounds i8, i8* %45, i32 1
store i8* %46, i8** %3
store i8 101, i8* %45
%47 = load i8*, i8** %3
%48 = getelementptr inbounds i8, i8* %47, i32 1
store i8* %48, i8** %3
store i8 108, i8* %47
%49 = load i8*, i8** %3
%50 = getelementptr inbounds i8, i8* %49, i32 1
store i8* %50, i8** %3
store i8 115, i8* %49
%51 = load i8*, i8** %3
%52 = getelementptr inbounds i8, i8* %51, i32 1
store i8* %52, i8** %3
store i8 105, i8* %51
%53 = load i8*, i8** %3
%54 = getelementptr inbounds i8, i8* %53, i32 1
store i8* %54, i8** %3
store i8 117, i8* %53
%55 = load i8*, i8** %3
%56 = getelementptr inbounds i8, i8* %55, i32 1
store i8* %56, i8** %3
store i8 115, i8* %55
%57 = load i8*, i8** %7
%58 = getelementptr inbounds i8, i8* %57, i32 1
store i8* %58, i8** %7
br label %190
59: ; preds = %36, %30, %24
%60 = load i8*, i8** %7
%61 = load i8, i8* %60
%62 = call signext i8 @toupper(i8 zeroext %61)
%63 = sext i8 %62 to i32
%64 = icmp eq i32 %63, 71
br i1 %64, label %65, label %88
65: ; preds = %59
%66 = load i8*, i8** %7
%67 = getelementptr inbounds i8, i8* %66, i64 1
%68 = load i8, i8* %67
%69 = call i32 @isalpha(i8 zeroext %68)
%70 = icmp ne i32 %69, 0
br i1 %70, label %88, label %71
71: ; preds = %65
%72 = load i8*, i8** %7
%73 = getelementptr inbounds i8, i8* %72, i64 -1
%74 = load i8, i8* %73
%75 = call i32 @isalpha(i8 zeroext %74)
%76 = icmp ne i32 %75, 0
br i1 %76, label %88, label %77
77: ; preds = %71
%78 = load i8*, i8** %3
%79 = getelementptr inbounds i8, i8* %78, i32 1
store i8* %79, i8** %3
store i8 103, i8* %78
%80 = load i8*, i8** %3
%81 = getelementptr inbounds i8, i8* %80, i32 1
store i8* %81, i8** %3
store i8 114, i8* %80
%82 = load i8*, i8** %3
%83 = getelementptr inbounds i8, i8* %82, i32 1
store i8* %83, i8** %3
store i8 97, i8* %82
%84 = load i8*, i8** %3
%85 = getelementptr inbounds i8, i8* %84, i32 1
store i8* %85, i8** %3
store i8 109, i8* %84
%86 = load i8*, i8** %7
%87 = getelementptr inbounds i8, i8* %86, i32 1
store i8* %87, i8** %7
br label %189
88: ; preds = %71, %65, %59
%89 = load i8*, i8** %7
%90 = load i8, i8* %89
%91 = call signext i8 @toupper(i8 zeroext %90)
%92 = sext i8 %91 to i32
%93 = icmp eq i32 %92, 37
br i1 %93, label %94, label %111
94: ; preds = %88
%95 = load i8*, i8** %3
%96 = getelementptr inbounds i8, i8* %95, i32 1
store i8* %96, i8** %3
store i8 112, i8* %95
%97 = load i8*, i8** %3
%98 = getelementptr inbounds i8, i8* %97, i32 1
store i8* %98, i8** %3
store i8 101, i8* %97
%99 = load i8*, i8** %3
%100 = getelementptr inbounds i8, i8* %99, i32 1
store i8* %100, i8** %3
store i8 114, i8* %99
%101 = load i8*, i8** %3
%102 = getelementptr inbounds i8, i8* %101, i32 1
store i8* %102, i8** %3
store i8 99, i8* %101
%103 = load i8*, i8** %3
%104 = getelementptr inbounds i8, i8* %103, i32 1
store i8* %104, i8** %3
store i8 101, i8* %103
%105 = load i8*, i8** %3
%106 = getelementptr inbounds i8, i8* %105, i32 1
store i8* %106, i8** %3
store i8 110, i8* %105
%107 = load i8*, i8** %3
%108 = getelementptr inbounds i8, i8* %107, i32 1
store i8* %108, i8** %3
store i8 116, i8* %107
%109 = load i8*, i8** %7
%110 = getelementptr inbounds i8, i8* %109, i32 1
store i8* %110, i8** %7
br label %188
111: ; preds = %88
%112 = load i8*, i8** %7
%113 = load i8, i8* %112
%114 = call signext i8 @toupper(i8 zeroext %113)
%115 = sext i8 %114 to i32
%116 = icmp eq i32 %115, 80
br i1 %116, label %117, label %143
117: ; preds = %111
%118 = load i8*, i8** %7
%119 = getelementptr inbounds i8, i8* %118, i64 1
%120 = load i8, i8* %119
%121 = call signext i8 @toupper(i8 zeroext %120)
%122 = sext i8 %121 to i32
%123 = icmp eq i32 %122, 82
br i1 %123, label %124, label %143
124: ; preds = %117
%125 = load i8*, i8** %7
%126 = getelementptr inbounds i8, i8* %125, i64 2
%127 = load i8, i8* %126
%128 = call signext i8 @toupper(i8 zeroext %127)
%129 = sext i8 %128 to i32
%130 = icmp eq i32 %129, 79
br i1 %130, label %131, label %143
131: ; preds = %124
%132 = load i8*, i8** %7
%133 = getelementptr inbounds i8, i8* %132, i64 3
%134 = load i8, i8* %133
%135 = call signext i8 @toupper(i8 zeroext %134)
%136 = sext i8 %135 to i32
%137 = icmp eq i32 %136, 66
br i1 %137, label %138, label %143
138: ; preds = %131
%139 = load i8*, i8** %3
%140 = getelementptr inbounds i8, i8* %139, i32 1
store i8* %140, i8** %3
store i8 49, i8* %139
%141 = load i8*, i8** %7
%142 = getelementptr inbounds i8, i8* %141, i64 4
store i8* %142, i8** %7
br label %187
143: ; preds = %131, %124, %117, %111
%144 = load i8*, i8** %7
%145 = load i8, i8* %144
%146 = call signext i8 @toupper(i8 zeroext %145)
%147 = sext i8 %146 to i32
%148 = icmp eq i32 %147, 71
br i1 %148, label %149, label %180
149: ; preds = %143
%150 = load i8*, i8** %7
%151 = getelementptr inbounds i8, i8* %150, i64 1
%152 = load i8, i8* %151
%153 = call signext i8 @toupper(i8 zeroext %152)
%154 = sext i8 %153 to i32
%155 = icmp eq i32 %154, 80
br i1 %155, label %156, label %180
156: ; preds = %149
%157 = load i8*, i8** %7
%158 = getelementptr inbounds i8, i8* %157, i64 2
%159 = load i8, i8* %158
%160 = call signext i8 @toupper(i8 zeroext %159)
%161 = sext i8 %160 to i32
%162 = icmp eq i32 %161, 77
br i1 %162, label %163, label %180
163: ; preds = %156
%164 = load i8*, i8** %7
%165 = getelementptr inbounds i8, i8* %164, i64 -1
%166 = load i8, i8* %165
%167 = call i32 @isalpha(i8 zeroext %166)
%168 = icmp ne i32 %167, 0
br i1 %168, label %180, label %169
169: ; preds = %163
%170 = load i8*, i8** %7
%171 = getelementptr inbounds i8, i8* %170, i64 3
%172 = load i8, i8* %171
%173 = call i32 @isalpha(i8 zeroext %172)
%174 = icmp ne i32 %173, 0
br i1 %174, label %180, label %175
175: ; preds = %169
%176 = load i8*, i8** %3
%177 = getelementptr inbounds i8, i8* %176, i32 1
store i8* %177, i8** %3
store i8 109, i8* %176
%178 = load i8*, i8** %7
%179 = getelementptr inbounds i8, i8* %178, i64 3
store i8* %179, i8** %7
br label %186
180: ; preds = %169, %163, %156, %149, %143
%181 = load i8*, i8** %7
%182 = getelementptr inbounds i8, i8* %181, i32 1
store i8* %182, i8** %7
%183 = load i8, i8* %181
%184 = load i8*, i8** %3
%185 = getelementptr inbounds i8, i8* %184, i32 1
store i8* %185, i8** %3
store i8 %183, i8* %184
br label %186
186: ; preds = %180, %175
br label %187
187: ; preds = %186, %138
br label %188
188: ; preds = %187, %94
br label %189
189: ; preds = %188, %77
br label %190
190: ; preds = %189, %42
br label %20
191: ; preds = %20
%192 = load i8*, i8** %3
store i8 0, i8* %192
%193 = load i8*, i8** %5
ret void
}

LLVM IR (-O2):
define void @fix_units(i8* %0, i32 %1) {
%3 = add nsw i32 %1, 2
%4 = zext i32 %3 to i64
%5 = alloca i8, i64 %4
store i8 43, i8* %5
%6 = getelementptr inbounds i8, i8* %5, i64 1
%7 = call i32 @strncpy(i8* %6, i8* %0, i32 %1)
store i8 0, i8* %0
%8 = load i8, i8* %6
%9 = icmp eq i8 %8, 0
br i1 %9, label %123, label %10
10: ; preds = %2, %118
%11 = phi i8 [ %121, %118 ], [ %8, %2 ]
%12 = phi i8* [ %120, %118 ], [ %6, %2 ]
%13 = phi i8* [ %119, %118 ], [ %0, %2 ]
%14 = call signext i8 @toupper(i8 zeroext %11)
%15 = icmp eq i8 %14, 67
br i1 %15, label %16, label %34
16: ; preds = %10
%17 = getelementptr inbounds i8, i8* %12, i64 1
%18 = load i8, i8* %17
%19 = call i32 @isalpha(i8 zeroext %18)
%20 = icmp eq i32 %19, 0
br i1 %20, label %21, label %34
21: ; preds = %16
%22 = getelementptr inbounds i8, i8* %12, i64 -1
%23 = load i8, i8* %22
%24 = call i32 @isalpha(i8 zeroext %23)
%25 = icmp eq i32 %24, 0
br i1 %25, label %26, label %34
26: ; preds = %21
%27 = getelementptr inbounds i8, i8* %13, i64 1
store i8 67, i8* %13
%28 = getelementptr inbounds i8, i8* %13, i64 2
store i8 101, i8* %27
%29 = getelementptr inbounds i8, i8* %13, i64 3
store i8 108, i8* %28
%30 = getelementptr inbounds i8, i8* %13, i64 4
store i8 115, i8* %29
%31 = getelementptr inbounds i8, i8* %13, i64 5
store i8 105, i8* %30
%32 = getelementptr inbounds i8, i8* %13, i64 6
store i8 117, i8* %31
%33 = getelementptr inbounds i8, i8* %13, i64 7
store i8 115, i8* %32
br label %118
34: ; preds = %21, %16, %10
%35 = load i8, i8* %12
%36 = call signext i8 @toupper(i8 zeroext %35)
%37 = icmp eq i8 %36, 71
br i1 %37, label %38, label %53
38: ; preds = %34
%39 = getelementptr inbounds i8, i8* %12, i64 1
%40 = load i8, i8* %39
%41 = call i32 @isalpha(i8 zeroext %40)
%42 = icmp eq i32 %41, 0
br i1 %42, label %43, label %53
43: ; preds = %38
%44 = getelementptr inbounds i8, i8* %12, i64 -1
%45 = load i8, i8* %44
%46 = call i32 @isalpha(i8 zeroext %45)
%47 = icmp eq i32 %46, 0
br i1 %47, label %48, label %53
48: ; preds = %43
%49 = getelementptr inbounds i8, i8* %13, i64 1
store i8 103, i8* %13
%50 = getelementptr inbounds i8, i8* %13, i64 2
store i8 114, i8* %49
%51 = getelementptr inbounds i8, i8* %13, i64 3
store i8 97, i8* %50
%52 = getelementptr inbounds i8, i8* %13, i64 4
store i8 109, i8* %51
br label %118
53: ; preds = %43, %38, %34
%54 = load i8, i8* %12
%55 = call signext i8 @toupper(i8 zeroext %54)
%56 = icmp eq i8 %55, 37
br i1 %56, label %57, label %66
57: ; preds = %53
%58 = getelementptr inbounds i8, i8* %13, i64 1
store i8 112, i8* %13
%59 = getelementptr inbounds i8, i8* %13, i64 2
store i8 101, i8* %58
%60 = getelementptr inbounds i8, i8* %13, i64 3
store i8 114, i8* %59
%61 = getelementptr inbounds i8, i8* %13, i64 4
store i8 99, i8* %60
%62 = getelementptr inbounds i8, i8* %13, i64 5
store i8 101, i8* %61
%63 = getelementptr inbounds i8, i8* %13, i64 6
store i8 110, i8* %62
%64 = getelementptr inbounds i8, i8* %13, i64 7
store i8 116, i8* %63
%65 = getelementptr inbounds i8, i8* %12, i64 1
br label %118
66: ; preds = %53
%67 = load i8, i8* %12
%68 = call signext i8 @toupper(i8 zeroext %67)
%69 = icmp eq i8 %68, 80
br i1 %69, label %70, label %88
70: ; preds = %66
%71 = getelementptr inbounds i8, i8* %12, i64 1
%72 = load i8, i8* %71
%73 = call signext i8 @toupper(i8 zeroext %72)
%74 = icmp eq i8 %73, 82
br i1 %74, label %75, label %88
75: ; preds = %70
%76 = getelementptr inbounds i8, i8* %12, i64 2
%77 = load i8, i8* %76
%78 = call signext i8 @toupper(i8 zeroext %77)
%79 = icmp eq i8 %78, 79
br i1 %79, label %80, label %88
80: ; preds = %75
%81 = getelementptr inbounds i8, i8* %12, i64 3
%82 = load i8, i8* %81
%83 = call signext i8 @toupper(i8 zeroext %82)
%84 = icmp eq i8 %83, 66
br i1 %84, label %85, label %88
85: ; preds = %80
%86 = getelementptr inbounds i8, i8* %13, i64 1
store i8 49, i8* %13
%87 = getelementptr inbounds i8, i8* %12, i64 4
br label %118
88: ; preds = %80, %75, %70, %66
%89 = load i8, i8* %12
%90 = call signext i8 @toupper(i8 zeroext %89)
%91 = icmp eq i8 %90, 71
br i1 %91, label %92, label %114
92: ; preds = %88
%93 = getelementptr inbounds i8, i8* %12, i64 1
%94 = load i8, i8* %93
%95 = call signext i8 @toupper(i8 zeroext %94)
%96 = icmp eq i8 %95, 80
br i1 %96, label %97, label %114
97: ; preds = %92
%98 = getelementptr inbounds i8, i8* %12, i64 2
%99 = load i8, i8* %98
%100 = call signext i8 @toupper(i8 zeroext %99)
%101 = icmp eq i8 %100, 77
br i1 %101, label %102, label %114
102: ; preds = %97
%103 = getelementptr inbounds i8, i8* %12, i64 -1
%104 = load i8, i8* %103
%105 = call i32 @isalpha(i8 zeroext %104)
%106 = icmp eq i32 %105, 0
br i1 %106, label %107, label %114
107: ; preds = %102
%108 = getelementptr inbounds i8, i8* %12, i64 3
%109 = load i8, i8* %108
%110 = call i32 @isalpha(i8 zeroext %109)
%111 = icmp eq i32 %110, 0
br i1 %111, label %112, label %114
112: ; preds = %107
%113 = getelementptr inbounds i8, i8* %13, i64 1
store i8 109, i8* %13
br label %118
114: ; preds = %107, %102, %97, %92, %88
%115 = getelementptr inbounds i8, i8* %12, i64 1
%116 = load i8, i8* %12
%117 = getelementptr inbounds i8, i8* %13, i64 1
store i8 %116, i8* %13
br label %118
118: ; preds = %48, %85, %114, %112, %57, %26
%119 = phi i8* [ %64, %57 ], [ %86, %85 ], [ %117, %114 ], [ %113, %112 ], [ %52, %48 ], [ %33, %26 ]
%120 = phi i8* [ %65, %57 ], [ %87, %85 ], [ %115, %114 ], [ %108, %112 ], [ %39, %48 ], [ %17, %26 ]
%121 = load i8, i8* %120
%122 = icmp eq i8 %121, 0
br i1 %122, label %123, label %10
123: ; preds = %118, %2
%124 = phi i8* [ %0, %2 ], [ %119, %118 ]
store i8 0, i8* %124
ret void
}