#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*/ assert(int);
int /*<<< orphan*/ normalize_assembly_format(char *, char *);
scalar_t__ strcmp(char *, char *);
void test_normalize_assembly_format() {
  char buffer[100];
  normalize_assembly_format("4210     tst     r0,r2", buffer);
  assert(strcmp(buffer, "4210\ttst\tr0, r2") == 0);
  normalize_assembly_format("6808     ldr     r0,[r1]", buffer);
  assert(strcmp(buffer, "6808\tldr\tr0, [r1]") == 0);
  normalize_assembly_format("d0fc     beq     2000000c", buffer);
  assert(strcmp(buffer, "d0fc\tbeq\t2000000c") == 0);
  normalize_assembly_format("d0fc     ldr     r1,[pc,#360]", buffer);
  assert(strcmp(buffer, "d0fc\tldr\tr1, [pc, #360]") == 0);
}


x86 assembly (clang, -O0):
<test_normalize_assembly_format>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
lea    -0x70(%rbp),%rsi
lea    0xebd(%rip),%rdi
call   1050 <normalize_assembly_format@plt>
lea    -0x70(%rbp),%rdi
lea    0xec4(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
lea    -0x70(%rbp),%rsi
lea    0xeb3(%rip),%rdi
call   1050 <normalize_assembly_format@plt>
lea    -0x70(%rbp),%rdi
lea    0xebc(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
lea    -0x70(%rbp),%rsi
lea    0xead(%rip),%rdi
call   1050 <normalize_assembly_format@plt>
lea    -0x70(%rbp),%rdi
lea    0xeb7(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
lea    -0x70(%rbp),%rsi
lea    0xea8(%rip),%rdi
call   1050 <normalize_assembly_format@plt>
lea    -0x70(%rbp),%rdi
lea    0xeb6(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_normalize_assembly_format>:
push   %rbx
sub    $0x70,%rsp
lea    0xec4(%rip),%rdi
mov    %rsp,%rbx
mov    %rbx,%rsi
call   1050 <normalize_assembly_format@plt>
lea    0xec9(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
call   1040 <assert@plt>
lea    0xebc(%rip),%rdi
mov    %rbx,%rsi
call   1050 <normalize_assembly_format@plt>
lea    0xec6(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
call   1040 <assert@plt>
lea    0xebb(%rip),%rdi
mov    %rbx,%rsi
call   1050 <normalize_assembly_format@plt>
lea    0xec6(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
call   1040 <assert@plt>
lea    0xebb(%rip),%rdi
mov    %rbx,%rsi
call   1050 <normalize_assembly_format@plt>
lea    0xeca(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
call   1040 <assert@plt>
add    $0x70,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [23 x i8] c"4210 tst r0,r2\00"
@.str.1 = [16 x i8] c"4210\09tst\09r0, r2\00"
@.str.2 = [25 x i8] c"6808 ldr r0,[r1]\00"
@.str.3 = [18 x i8] c"6808\09ldr\09r0, [r1]\00"
@.str.4 = [26 x i8] c"d0fc beq 2000000c\00"
@.str.5 = [18 x i8] c"d0fc\09beq\092000000c\00"
@.str.6 = [30 x i8] c"d0fc ldr r1,[pc,]\00"
@.str.7 = [24 x i8] c"d0fc\09ldr\09r1, [pc,]\00"
define void @test_normalize_assembly_format() {
%1 = alloca [100 x i8]
%2 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%3 = call i32 @normalize_assembly_format(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%5 = call i64 @strcmp(i8* %4, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
%6 = icmp eq i64 %5, 0
%7 = zext i1 %6 to i32
%8 = call i32 @assert(i32 %7)
%9 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%10 = call i32 @normalize_assembly_format(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0), i8* %9)
%11 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%12 = call i64 @strcmp(i8* %11, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.3, i64 0, i64 0))
%13 = icmp eq i64 %12, 0
%14 = zext i1 %13 to i32
%15 = call i32 @assert(i32 %14)
%16 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%17 = call i32 @normalize_assembly_format(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.4, i64 0, i64 0), i8* %16)
%18 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%19 = call i64 @strcmp(i8* %18, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.5, i64 0, i64 0))
%20 = icmp eq i64 %19, 0
%21 = zext i1 %20 to i32
%22 = call i32 @assert(i32 %21)
%23 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%24 = call i32 @normalize_assembly_format(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.6, i64 0, i64 0), i8* %23)
%25 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%26 = call i64 @strcmp(i8* %25, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.7, i64 0, i64 0))
%27 = icmp eq i64 %26, 0
%28 = zext i1 %27 to i32
%29 = call i32 @assert(i32 %28)
ret void
}

LLVM IR (-O2):
@.str = [23 x i8] c"4210 tst r0,r2\00"
@.str.1 = [16 x i8] c"4210\09tst\09r0, r2\00"
@.str.2 = [25 x i8] c"6808 ldr r0,[r1]\00"
@.str.3 = [18 x i8] c"6808\09ldr\09r0, [r1]\00"
@.str.4 = [26 x i8] c"d0fc beq 2000000c\00"
@.str.5 = [18 x i8] c"d0fc\09beq\092000000c\00"
@.str.6 = [30 x i8] c"d0fc ldr r1,[pc,]\00"
@.str.7 = [24 x i8] c"d0fc\09ldr\09r1, [pc,]\00"
define void @test_normalize_assembly_format() {
%1 = alloca [100 x i8]
%2 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%3 = call i32 @normalize_assembly_format(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = call i64 @strcmp(i8* %2, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
%5 = icmp eq i64 %4, 0
%6 = zext i1 %5 to i32
%7 = call i32 @assert(i32 %6)
%8 = call i32 @normalize_assembly_format(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0), i8* %2)
%9 = call i64 @strcmp(i8* %2, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.3, i64 0, i64 0))
%10 = icmp eq i64 %9, 0
%11 = zext i1 %10 to i32
%12 = call i32 @assert(i32 %11)
%13 = call i32 @normalize_assembly_format(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.4, i64 0, i64 0), i8* %2)
%14 = call i64 @strcmp(i8* %2, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.5, i64 0, i64 0))
%15 = icmp eq i64 %14, 0
%16 = zext i1 %15 to i32
%17 = call i32 @assert(i32 %16)
%18 = call i32 @normalize_assembly_format(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.6, i64 0, i64 0), i8* %2)
%19 = call i64 @strcmp(i8* %2, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.7, i64 0, i64 0))
%20 = icmp eq i64 %19, 0
%21 = zext i1 %20 to i32
%22 = call i32 @assert(i32 %21)
ret void
}