#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*/ write_byte(unsigned char);
void locate_32k(void) {
  int i;
  unsigned char locate32[31] = {0xCD, 0x38, 0x01, 0x0F, 0x0F, 0xE6, 0x03, 0x4F,
                                0x21, 0xC1, 0xFC, 0x85, 0x6F, 0x7E, 0xE6, 0x80,
                                0xB1, 0x4F, 0x2C, 0x2C, 0x2C, 0x2C, 0x7E, 0xE6,
                                0x0C, 0xB1, 0x26, 0x80, 0xCD, 0x24, 0x00};
  for (i = 0; i < 31; i++)
    write_byte(locate32[i]);
}


x86 assembly (clang, -O0):
<locate_32k>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    0xee1(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xede(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0xedb(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xed9(%rip),%eax
mov    %eax,-0x18(%rbp)
mov    0xed3(%rip),%ax
mov    %ax,-0x14(%rbp)
mov    0xecb(%rip),%al
mov    %al,-0x12(%rbp)
movl   $0x0,-0x4(%rbp)
cmpl   $0x1f,-0x4(%rbp)
jge    1183 <locate_32k+0x73>
movslq -0x4(%rbp),%rax
movzbl -0x30(%rbp,%rax,1),%edi
call   1030 <write_byte@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    115d <locate_32k+0x4d>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<locate_32k>:
push   %rax
mov    $0xcd,%edi
call   1030 <write_byte@plt>
mov    $0x38,%edi
call   1030 <write_byte@plt>
mov    $0x1,%edi
call   1030 <write_byte@plt>
mov    $0xf,%edi
call   1030 <write_byte@plt>
mov    $0xf,%edi
call   1030 <write_byte@plt>
mov    $0xe6,%edi
call   1030 <write_byte@plt>
mov    $0x3,%edi
call   1030 <write_byte@plt>
mov    $0x4f,%edi
call   1030 <write_byte@plt>
mov    $0x21,%edi
call   1030 <write_byte@plt>
mov    $0xc1,%edi
call   1030 <write_byte@plt>
mov    $0xfc,%edi
call   1030 <write_byte@plt>
mov    $0x85,%edi
call   1030 <write_byte@plt>
mov    $0x6f,%edi
call   1030 <write_byte@plt>
mov    $0x7e,%edi
call   1030 <write_byte@plt>
mov    $0xe6,%edi
call   1030 <write_byte@plt>
mov    $0x80,%edi
call   1030 <write_byte@plt>
mov    $0xb1,%edi
call   1030 <write_byte@plt>
mov    $0x4f,%edi
call   1030 <write_byte@plt>
mov    $0x2c,%edi
call   1030 <write_byte@plt>
mov    $0x2c,%edi
call   1030 <write_byte@plt>
mov    $0x2c,%edi
call   1030 <write_byte@plt>
mov    $0x2c,%edi
call   1030 <write_byte@plt>
mov    $0x7e,%edi
call   1030 <write_byte@plt>
mov    $0xe6,%edi
call   1030 <write_byte@plt>
mov    $0xc,%edi
call   1030 <write_byte@plt>
mov    $0xb1,%edi
call   1030 <write_byte@plt>
mov    $0x26,%edi
call   1030 <write_byte@plt>
mov    $0x80,%edi
call   1030 <write_byte@plt>
mov    $0xcd,%edi
call   1030 <write_byte@plt>
mov    $0x24,%edi
call   1030 <write_byte@plt>
xor    %edi,%edi
pop    %rax
jmp    1030 <write_byte@plt>

LLVM IR (-O0):
@__const.locate_32k.locate32 = [31 x i8] c"\CD8\01\0F\0F\E6\03O!\C1\FC\85o~\E6\80\B1O,,,,~\E6\0C\B1&\80\CD$\00"
define void @locate_32k() {
%1 = alloca i32
%2 = alloca [31 x i8]
%3 = bitcast [31 x i8]* %2 to i8*
store i32 0, i32* %1
br label %4
4: ; preds = %13, %0
%5 = load i32, i32* %1
%6 = icmp slt i32 %5, 31
br i1 %6, label %7, label %16
7: ; preds = %4
%8 = load i32, i32* %1
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds [31 x i8], [31 x i8]* %2, i64 0, i64 %9
%11 = load i8, i8* %10
%12 = call i32 @write_byte(i8 zeroext %11)
br label %13
13: ; preds = %7
%14 = load i32, i32* %1
%15 = add nsw i32 %14, 1
store i32 %15, i32* %1
br label %4
16: ; preds = %4
ret void
}

LLVM IR (-O2):
define void @locate_32k() {
%1 = tail call i32 @write_byte(i8 zeroext -51)
%2 = tail call i32 @write_byte(i8 zeroext 56)
%3 = tail call i32 @write_byte(i8 zeroext 1)
%4 = tail call i32 @write_byte(i8 zeroext 15)
%5 = tail call i32 @write_byte(i8 zeroext 15)
%6 = tail call i32 @write_byte(i8 zeroext -26)
%7 = tail call i32 @write_byte(i8 zeroext 3)
%8 = tail call i32 @write_byte(i8 zeroext 79)
%9 = tail call i32 @write_byte(i8 zeroext 33)
%10 = tail call i32 @write_byte(i8 zeroext -63)
%11 = tail call i32 @write_byte(i8 zeroext -4)
%12 = tail call i32 @write_byte(i8 zeroext -123)
%13 = tail call i32 @write_byte(i8 zeroext 111)
%14 = tail call i32 @write_byte(i8 zeroext 126)
%15 = tail call i32 @write_byte(i8 zeroext -26)
%16 = tail call i32 @write_byte(i8 zeroext -128)
%17 = tail call i32 @write_byte(i8 zeroext -79)
%18 = tail call i32 @write_byte(i8 zeroext 79)
%19 = tail call i32 @write_byte(i8 zeroext 44)
%20 = tail call i32 @write_byte(i8 zeroext 44)
%21 = tail call i32 @write_byte(i8 zeroext 44)
%22 = tail call i32 @write_byte(i8 zeroext 44)
%23 = tail call i32 @write_byte(i8 zeroext 126)
%24 = tail call i32 @write_byte(i8 zeroext -26)
%25 = tail call i32 @write_byte(i8 zeroext 12)
%26 = tail call i32 @write_byte(i8 zeroext -79)
%27 = tail call i32 @write_byte(i8 zeroext 38)
%28 = tail call i32 @write_byte(i8 zeroext -128)
%29 = tail call i32 @write_byte(i8 zeroext -51)
%30 = tail call i32 @write_byte(i8 zeroext 36)
%31 = tail call i32 @write_byte(i8 zeroext 0)
ret void
}