#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 /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, char *);
void assemble_M(char a[], FILE *f) {
  char b, o[8];
  int i = 4, j = 0;
  while (i < 12) {
    o[j] = a[i];
    j++;
    i++;
  }
  o[j + 1] = '\0';
  fprintf(f, "%s\n", o);
}


x86 assembly (clang, -O0):
<assemble_M>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x4,-0x20(%rbp)
movl   $0x0,-0x24(%rbp)
cmpl   $0xc,-0x20(%rbp)
jge    1162 <assemble_M+0x52>
mov    -0x8(%rbp),%rax
movslq -0x20(%rbp),%rcx
mov    (%rax,%rcx,1),%cl
movslq -0x24(%rbp),%rax
mov    %cl,-0x19(%rbp,%rax,1)
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    112e <assemble_M+0x1e>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
cltq
movb   $0x0,-0x19(%rbp,%rax,1)
mov    -0x10(%rbp),%rdi
lea    -0x19(%rbp),%rdx
lea    0xe82(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<assemble_M>:
push   %rax
mov    %rsi,%rax
mov    0x4(%rdi),%rcx
mov    %rcx,(%rsp)
movb   $0x0,0x9(%rsp)
lea    0xed8(%rip),%rsi
mov    %rsp,%rdx
mov    %rax,%rdi
call   1030 <fprintf@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%s\0A\00"
define void @assemble_M(i8* %0, i32* %1) {
%3 = alloca i8*
%4 = alloca i32*
%5 = alloca i8
%6 = alloca [8 x i8]
%7 = alloca i32
%8 = alloca i32
store i8* %0, i8** %3
store i32* %1, i32** %4
store i32 4, i32* %7
store i32 0, i32* %8
br label %9
9: ; preds = %12, %2
%10 = load i32, i32* %7
%11 = icmp slt i32 %10, 12
br i1 %11, label %12, label %25
12: ; preds = %9
%13 = load i8*, i8** %3
%14 = load i32, i32* %7
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i8, i8* %13, i64 %15
%17 = load i8, i8* %16
%18 = load i32, i32* %8
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds [8 x i8], [8 x i8]* %6, i64 0, i64 %19
store i8 %17, i8* %20
%21 = load i32, i32* %8
%22 = add nsw i32 %21, 1
store i32 %22, i32* %8
%23 = load i32, i32* %7
%24 = add nsw i32 %23, 1
store i32 %24, i32* %7
br label %9
25: ; preds = %9
%26 = load i32, i32* %8
%27 = add nsw i32 %26, 1
%28 = sext i32 %27 to i64
%29 = getelementptr inbounds [8 x i8], [8 x i8]* %6, i64 0, i64 %28
store i8 0, i8* %29
%30 = load i32*, i32** %4
%31 = getelementptr inbounds [8 x i8], [8 x i8]* %6, i64 0, i64 0
%32 = call i32 @fprintf(i32* %30, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %31)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define void @assemble_M(i8* nocapture %0, i32* nocapture %1) {
%3 = alloca i64
%4 = bitcast i64* %3 to [8 x i8]*
%5 = bitcast i64* %3 to i8*
%6 = getelementptr i8, i8* %0, i64 4
%7 = bitcast i8* %6 to i64*
%8 = load i64, i64* %7
store i64 %8, i64* %3
%9 = getelementptr inbounds [8 x i8], [8 x i8]* %4, i64 0, i64 9
store i8 0, i8* %9
%10 = call i32 @fprintf(i32* %1, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %5)
ret void
}