#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 */
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ __aosc_split_and_32(int *, int *);
char *__aosc_encode_and_32(char *dst) {
  uint32_t dword1, dword2;
  __aosc_split_and_32(&dword1, &dword2);
  dst[0] = 0x25;
  do {
    (&dst[1])[3] = (dword1) >> 24;
    (&dst[1])[2] = (dword1) >> 16;
    (&dst[1])[1] = (dword1) >> 8;
    (&dst[1])[0] = (dword1);
  } while (0);
  dst[5] = 0x25;
  do {
    (&dst[6])[3] = (dword2) >> 24;
    (&dst[6])[2] = (dword2) >> 16;
    (&dst[6])[1] = (dword2) >> 8;
    (&dst[6])[0] = (dword2);
  } while (0);
  dst[10] = 0;
  return dst;
}


x86 assembly (clang, -O0):
<__aosc_encode_and_32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0xc(%rbp),%rdi
lea    -0x10(%rbp),%rsi
call   1030 <__aosc_split_and_32@plt>
mov    -0x8(%rbp),%rax
movb   $0x25,(%rax)
mov    -0xc(%rbp),%eax
sar    $0x18,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x4(%rax)
mov    -0xc(%rbp),%eax
sar    $0x10,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x3(%rax)
mov    -0xc(%rbp),%eax
sar    $0x8,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x2(%rax)
mov    -0xc(%rbp),%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x1(%rax)
mov    -0x8(%rbp),%rax
movb   $0x25,0x5(%rax)
mov    -0x10(%rbp),%eax
sar    $0x18,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x9(%rax)
mov    -0x10(%rbp),%eax
sar    $0x10,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x8(%rax)
mov    -0x10(%rbp),%eax
sar    $0x8,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x7(%rax)
mov    -0x10(%rbp),%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x6(%rax)
mov    -0x8(%rbp),%rax
movb   $0x0,0xa(%rax)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__aosc_encode_and_32>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
lea    0xc(%rsp),%rdi
lea    0x8(%rsp),%rsi
call   1030 <__aosc_split_and_32@plt>
movb   $0x25,(%rbx)
mov    0xc(%rsp),%eax
mov    %eax,%ecx
shr    $0x18,%ecx
mov    %cl,0x4(%rbx)
mov    %eax,%ecx
shr    $0x10,%ecx
mov    %cl,0x3(%rbx)
mov    %ah,0x2(%rbx)
mov    %al,0x1(%rbx)
movb   $0x25,0x5(%rbx)
mov    0x8(%rsp),%eax
mov    %eax,%ecx
shr    $0x18,%ecx
mov    %cl,0x9(%rbx)
mov    %eax,%ecx
shr    $0x10,%ecx
mov    %cl,0x8(%rbx)
mov    %ah,0x7(%rbx)
mov    %al,0x6(%rbx)
movb   $0x0,0xa(%rbx)
mov    %rbx,%rax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i8* @__aosc_encode_and_32(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i32
store i8* %0, i8** %2
%5 = call i32 @__aosc_split_and_32(i32* %3, i32* %4)
%6 = load i8*, i8** %2
%7 = getelementptr inbounds i8, i8* %6, i64 0
store i8 37, i8* %7
br label %8
8: ; preds = %1
%9 = load i32, i32* %3
%10 = ashr i32 %9, 24
%11 = trunc i32 %10 to i8
%12 = load i8*, i8** %2
%13 = getelementptr inbounds i8, i8* %12, i64 1
%14 = getelementptr inbounds i8, i8* %13, i64 3
store i8 %11, i8* %14
%15 = load i32, i32* %3
%16 = ashr i32 %15, 16
%17 = trunc i32 %16 to i8
%18 = load i8*, i8** %2
%19 = getelementptr inbounds i8, i8* %18, i64 1
%20 = getelementptr inbounds i8, i8* %19, i64 2
store i8 %17, i8* %20
%21 = load i32, i32* %3
%22 = ashr i32 %21, 8
%23 = trunc i32 %22 to i8
%24 = load i8*, i8** %2
%25 = getelementptr inbounds i8, i8* %24, i64 1
%26 = getelementptr inbounds i8, i8* %25, i64 1
store i8 %23, i8* %26
%27 = load i32, i32* %3
%28 = trunc i32 %27 to i8
%29 = load i8*, i8** %2
%30 = getelementptr inbounds i8, i8* %29, i64 1
%31 = getelementptr inbounds i8, i8* %30, i64 0
store i8 %28, i8* %31
br label %32
32: ; preds = %8
%33 = load i8*, i8** %2
%34 = getelementptr inbounds i8, i8* %33, i64 5
store i8 37, i8* %34
br label %35
35: ; preds = %32
%36 = load i32, i32* %4
%37 = ashr i32 %36, 24
%38 = trunc i32 %37 to i8
%39 = load i8*, i8** %2
%40 = getelementptr inbounds i8, i8* %39, i64 6
%41 = getelementptr inbounds i8, i8* %40, i64 3
store i8 %38, i8* %41
%42 = load i32, i32* %4
%43 = ashr i32 %42, 16
%44 = trunc i32 %43 to i8
%45 = load i8*, i8** %2
%46 = getelementptr inbounds i8, i8* %45, i64 6
%47 = getelementptr inbounds i8, i8* %46, i64 2
store i8 %44, i8* %47
%48 = load i32, i32* %4
%49 = ashr i32 %48, 8
%50 = trunc i32 %49 to i8
%51 = load i8*, i8** %2
%52 = getelementptr inbounds i8, i8* %51, i64 6
%53 = getelementptr inbounds i8, i8* %52, i64 1
store i8 %50, i8* %53
%54 = load i32, i32* %4
%55 = trunc i32 %54 to i8
%56 = load i8*, i8** %2
%57 = getelementptr inbounds i8, i8* %56, i64 6
%58 = getelementptr inbounds i8, i8* %57, i64 0
store i8 %55, i8* %58
br label %59
59: ; preds = %35
%60 = load i8*, i8** %2
%61 = getelementptr inbounds i8, i8* %60, i64 10
store i8 0, i8* %61
%62 = load i8*, i8** %2
ret i8* %62
}

LLVM IR (-O2):
define i8* @__aosc_encode_and_32(i8* returned writeonly %0) {
%2 = alloca i32
%3 = alloca i32
%4 = bitcast i32* %2 to i8*
%5 = bitcast i32* %3 to i8*
%6 = call i32 @__aosc_split_and_32(i32* %2, i32* %3)
store i8 37, i8* %0
%7 = load i32, i32* %2
%8 = lshr i32 %7, 24
%9 = trunc i32 %8 to i8
%10 = getelementptr inbounds i8, i8* %0, i64 1
%11 = getelementptr inbounds i8, i8* %0, i64 4
store i8 %9, i8* %11
%12 = lshr i32 %7, 16
%13 = trunc i32 %12 to i8
%14 = getelementptr inbounds i8, i8* %0, i64 3
store i8 %13, i8* %14
%15 = lshr i32 %7, 8
%16 = trunc i32 %15 to i8
%17 = getelementptr inbounds i8, i8* %0, i64 2
store i8 %16, i8* %17
%18 = trunc i32 %7 to i8
store i8 %18, i8* %10
%19 = getelementptr inbounds i8, i8* %0, i64 5
store i8 37, i8* %19
%20 = load i32, i32* %3
%21 = lshr i32 %20, 24
%22 = trunc i32 %21 to i8
%23 = getelementptr inbounds i8, i8* %0, i64 6
%24 = getelementptr inbounds i8, i8* %0, i64 9
store i8 %22, i8* %24
%25 = lshr i32 %20, 16
%26 = trunc i32 %25 to i8
%27 = getelementptr inbounds i8, i8* %0, i64 8
store i8 %26, i8* %27
%28 = lshr i32 %20, 8
%29 = trunc i32 %28 to i8
%30 = getelementptr inbounds i8, i8* %0, i64 7
store i8 %29, i8* %30
%31 = trunc i32 %20 to i8
store i8 %31, i8* %23
%32 = getelementptr inbounds i8, i8* %0, i64 10
store i8 0, i8* %32
ret i8* %0
}