#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 Platform_Halt(int);
void vt100_Reverse0(unsigned char *str, long long str__len, int start,
                    int end) {
  unsigned char h;
  while (start < end) {
    h = str[(((unsigned long long)(start) < (unsigned long long)(str__len))
                 ? start
                 : (Platform_Halt(-2), 0))];
    str[(((unsigned long long)(start) < (unsigned long long)(str__len))
             ? start
             : (Platform_Halt(-2), 0))] =
        str[(((unsigned long long)(end) < (unsigned long long)(str__len))
                 ? end
                 : (Platform_Halt(-2), 0))];
    str[(((unsigned long long)(end) < (unsigned long long)(str__len))
             ? end
             : (Platform_Halt(-2), 0))] = h;
    start += 1;
    end -= 1;
  }
}


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x18(%rbp),%eax
jge    124f <vt100_Reverse0+0x13f>
mov    -0x8(%rbp),%rax
mov    %rax,-0x28(%rbp)
movslq -0x14(%rbp),%rax
cmp    -0x10(%rbp),%rax
jae    1153 <vt100_Reverse0+0x43>
mov    -0x14(%rbp),%eax
mov    %eax,-0x2c(%rbp)
jmp    1162 <vt100_Reverse0+0x52>
mov    $0xfffffffe,%edi
call   1030 <Platform_Halt@plt>
xor    %eax,%eax
mov    %eax,-0x2c(%rbp)
mov    -0x28(%rbp),%rax
mov    -0x2c(%rbp),%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,1),%al
mov    %al,-0x19(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x38(%rbp)
movslq -0x18(%rbp),%rax
cmp    -0x10(%rbp),%rax
jae    1193 <vt100_Reverse0+0x83>
mov    -0x18(%rbp),%eax
mov    %eax,-0x3c(%rbp)
jmp    11a2 <vt100_Reverse0+0x92>
mov    $0xfffffffe,%edi
call   1030 <Platform_Halt@plt>
xor    %eax,%eax
mov    %eax,-0x3c(%rbp)
mov    -0x38(%rbp),%rax
mov    -0x3c(%rbp),%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,1),%al
mov    %al,-0x49(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x48(%rbp)
movslq -0x14(%rbp),%rax
cmp    -0x10(%rbp),%rax
jae    11d3 <vt100_Reverse0+0xc3>
mov    -0x14(%rbp),%eax
mov    %eax,-0x50(%rbp)
jmp    11e2 <vt100_Reverse0+0xd2>
mov    $0xfffffffe,%edi
call   1030 <Platform_Halt@plt>
xor    %eax,%eax
mov    %eax,-0x50(%rbp)
mov    -0x48(%rbp),%rax
mov    -0x49(%rbp),%dl
mov    -0x50(%rbp),%ecx
movslq %ecx,%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x19(%rbp),%al
mov    %al,-0x59(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x58(%rbp)
movslq -0x18(%rbp),%rax
cmp    -0x10(%rbp),%rax
jae    1219 <vt100_Reverse0+0x109>
mov    -0x18(%rbp),%eax
mov    %eax,-0x60(%rbp)
jmp    1228 <vt100_Reverse0+0x118>
mov    $0xfffffffe,%edi
call   1030 <Platform_Halt@plt>
xor    %eax,%eax
mov    %eax,-0x60(%rbp)
mov    -0x58(%rbp),%rax
mov    -0x59(%rbp),%dl
mov    -0x60(%rbp),%ecx
movslq %ecx,%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x18(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1126 <vt100_Reverse0+0x16>
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
cmp    %ecx,%edx
jge    11b9 <vt100_Reverse0+0xa9>
mov    %rsi,%r14
mov    %rdi,%r15
movslq %edx,%r12
movslq %ecx,%rbx
jmp    1153 <vt100_Reverse0+0x43>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
cltq
mov    %bpl,(%r15,%rax,1)
add    $0x1,%r12
add    $0xffffffffffffffff,%rbx
cmp    %rbx,%r12
jge    11b9 <vt100_Reverse0+0xa9>
mov    %r12,%rax
cmp    %r14,%r12
jb     1167 <vt100_Reverse0+0x57>
mov    $0xfffffffe,%edi
call   1030 <Platform_Halt@plt>
xor    %eax,%eax
cltq
movzbl (%r15,%rax,1),%ebp
mov    %rbx,%rax
cmp    %r14,%rbx
jb     1182 <vt100_Reverse0+0x72>
mov    $0xfffffffe,%edi
call   1030 <Platform_Halt@plt>
xor    %eax,%eax
cltq
movzbl (%r15,%rax,1),%r13d
mov    %r12,%rax
cmp    %r14,%r12
jb     119d <vt100_Reverse0+0x8d>
mov    $0xfffffffe,%edi
call   1030 <Platform_Halt@plt>
xor    %eax,%eax
cltq
mov    %r13b,(%r15,%rax,1)
mov    %rbx,%rax
cmp    %r14,%rbx
jb     1140 <vt100_Reverse0+0x30>
mov    $0xfffffffe,%edi
call   1030 <Platform_Halt@plt>
xor    %eax,%eax
jmp    1140 <vt100_Reverse0+0x30>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @vt100_Reverse0(i8* %0, i64 %1, i32 %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i32
%8 = alloca i32
%9 = alloca i8
store i8* %0, i8** %5
store i64 %1, i64* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
br label %10
10: ; preds = %66, %4
%11 = load i32, i32* %7
%12 = load i32, i32* %8
%13 = icmp slt i32 %11, %12
br i1 %13, label %14, label %74
14: ; preds = %10
%15 = load i8*, i8** %5
%16 = load i32, i32* %7
%17 = sext i32 %16 to i64
%18 = load i64, i64* %6
%19 = icmp ult i64 %17, %18
br i1 %19, label %20, label %22
20: ; preds = %14
%21 = load i32, i32* %7
br label %24
22: ; preds = %14
%23 = call i32 @Platform_Halt(i32 -2)
br label %24
24: ; preds = %22, %20
%25 = phi i32 [ %21, %20 ], [ 0, %22 ]
%26 = sext i32 %25 to i64
%27 = getelementptr inbounds i8, i8* %15, i64 %26
%28 = load i8, i8* %27
store i8 %28, i8* %9
%29 = load i8*, i8** %5
%30 = load i32, i32* %8
%31 = sext i32 %30 to i64
%32 = load i64, i64* %6
%33 = icmp ult i64 %31, %32
br i1 %33, label %34, label %36
34: ; preds = %24
%35 = load i32, i32* %8
br label %38
36: ; preds = %24
%37 = call i32 @Platform_Halt(i32 -2)
br label %38
38: ; preds = %36, %34
%39 = phi i32 [ %35, %34 ], [ 0, %36 ]
%40 = sext i32 %39 to i64
%41 = getelementptr inbounds i8, i8* %29, i64 %40
%42 = load i8, i8* %41
%43 = load i8*, i8** %5
%44 = load i32, i32* %7
%45 = sext i32 %44 to i64
%46 = load i64, i64* %6
%47 = icmp ult i64 %45, %46
br i1 %47, label %48, label %50
48: ; preds = %38
%49 = load i32, i32* %7
br label %52
50: ; preds = %38
%51 = call i32 @Platform_Halt(i32 -2)
br label %52
52: ; preds = %50, %48
%53 = phi i32 [ %49, %48 ], [ 0, %50 ]
%54 = sext i32 %53 to i64
%55 = getelementptr inbounds i8, i8* %43, i64 %54
store i8 %42, i8* %55
%56 = load i8, i8* %9
%57 = load i8*, i8** %5
%58 = load i32, i32* %8
%59 = sext i32 %58 to i64
%60 = load i64, i64* %6
%61 = icmp ult i64 %59, %60
br i1 %61, label %62, label %64
62: ; preds = %52
%63 = load i32, i32* %8
br label %66
64: ; preds = %52
%65 = call i32 @Platform_Halt(i32 -2)
br label %66
66: ; preds = %64, %62
%67 = phi i32 [ %63, %62 ], [ 0, %64 ]
%68 = sext i32 %67 to i64
%69 = getelementptr inbounds i8, i8* %57, i64 %68
store i8 %56, i8* %69
%70 = load i32, i32* %7
%71 = add nsw i32 %70, 1
store i32 %71, i32* %7
%72 = load i32, i32* %8
%73 = sub nsw i32 %72, 1
store i32 %73, i32* %8
br label %10
74: ; preds = %10
ret void
}

LLVM IR (-O2):
define void @vt100_Reverse0(i8* nocapture %0, i64 %1, i32 %2, i32 %3) {
%5 = icmp slt i32 %2, %3
br i1 %5, label %6, label %47
6: ; preds = %4
%7 = sext i32 %2 to i64
%8 = sext i32 %3 to i64
br label %9
9: ; preds = %6, %39
%10 = phi i64 [ %8, %6 ], [ %45, %39 ]
%11 = phi i64 [ %7, %6 ], [ %44, %39 ]
%12 = icmp ult i64 %11, %1
br i1 %12, label %15, label %13
13: ; preds = %9
%14 = tail call i32 @Platform_Halt(i32 -2)
br label %15
15: ; preds = %9, %13
%16 = phi i64 [ 0, %13 ], [ %11, %9 ]
%17 = shl i64 %16, 32
%18 = ashr exact i64 %17, 32
%19 = getelementptr inbounds i8, i8* %0, i64 %18
%20 = load i8, i8* %19
%21 = icmp ult i64 %10, %1
br i1 %21, label %24, label %22
22: ; preds = %15
%23 = tail call i32 @Platform_Halt(i32 -2)
br label %24
24: ; preds = %15, %22
%25 = phi i64 [ 0, %22 ], [ %10, %15 ]
%26 = shl i64 %25, 32
%27 = ashr exact i64 %26, 32
%28 = getelementptr inbounds i8, i8* %0, i64 %27
%29 = load i8, i8* %28
br i1 %12, label %32, label %30
30: ; preds = %24
%31 = tail call i32 @Platform_Halt(i32 -2)
br label %32
32: ; preds = %24, %30
%33 = phi i64 [ 0, %30 ], [ %11, %24 ]
%34 = shl i64 %33, 32
%35 = ashr exact i64 %34, 32
%36 = getelementptr inbounds i8, i8* %0, i64 %35
store i8 %29, i8* %36
br i1 %21, label %39, label %37
37: ; preds = %32
%38 = tail call i32 @Platform_Halt(i32 -2)
br label %39
39: ; preds = %32, %37
%40 = phi i64 [ 0, %37 ], [ %10, %32 ]
%41 = shl i64 %40, 32
%42 = ashr exact i64 %41, 32
%43 = getelementptr inbounds i8, i8* %0, i64 %42
store i8 %20, i8* %43
%44 = add nsw i64 %11, 1
%45 = add nsw i64 %10, -1
%46 = icmp slt i64 %44, %45
br i1 %46, label %9, label %47
47: ; preds = %39, %4
ret void
}