#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*/ asma(unsigned char *, unsigned char *, unsigned char *);
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
scalar_t__ memcmp(unsigned char *, unsigned char *, int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ ref_asma(unsigned char *, unsigned char *, unsigned char *);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ stdout;
int main() {
  unsigned char s[16] = {2, 3, 4, 5, 6, 7};
  unsigned char t[16] = {7, 6, 5, 4, 3, 2};
  unsigned char u[16] = {0};
  unsigned char refu[16] = {0};
  ref_asma(s, t, refu);
  asma(s, t, u);
  if (memcmp(u, refu, 16 * sizeof(unsigned char)) != 0) {
    int i;
    (void)fprintf(stderr, "test failed!\n");
    for (i = 0; i < 16; ++i) {
      (void)printf("(%u,%u), ", (unsigned)u[i], (unsigned)refu[i]);
    }
    (void)printf("\n");
    fflush(stdout);
    return 1;
  } else
    return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xe7a(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xe77(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xe74(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xe71(%rip),%rax
mov    %rax,-0x28(%rbp)
lea    -0x40(%rbp),%rdi
xor    %esi,%esi
mov    $0x10,%edx
call   1050 <memset@plt>
lea    -0x50(%rbp),%rdi
xor    %esi,%esi
mov    $0x10,%edx
call   1050 <memset@plt>
lea    -0x20(%rbp),%rdi
lea    -0x30(%rbp),%rsi
lea    -0x50(%rbp),%rdx
call   1030 <ref_asma@plt>
lea    -0x20(%rbp),%rdi
lea    -0x30(%rbp),%rsi
lea    -0x40(%rbp),%rdx
call   1080 <asma@plt>
lea    -0x40(%rbp),%rdi
lea    -0x50(%rbp),%rsi
mov    $0x10,%edx
call   1060 <memcmp@plt>
cmp    $0x0,%rax
je     1285 <main+0x115>
mov    0x2dd0(%rip),%rax
mov    (%rax),%edi
lea    0xe07(%rip),%rsi
call   1070 <fprintf@plt>
movl   $0x0,-0x54(%rbp)
cmpl   $0x10,-0x54(%rbp)
jge    125d <main+0xed>
movslq -0x54(%rbp),%rax
movzbl -0x40(%rbp,%rax,1),%esi
movslq -0x54(%rbp),%rax
movzbl -0x50(%rbp,%rax,1),%edx
lea    0xde6(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x54(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x54(%rbp)
jmp    1225 <main+0xb5>
lea    0xdc8(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    0x2d66(%rip),%rax
mov    (%rax),%edi
call   1090 <fflush@plt>
movl   $0x1,-0x4(%rbp)
jmp    128c <main+0x11c>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x48,%rsp
movaps 0xe7e(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
movaps 0xe82(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
xorps  %xmm0,%xmm0
movaps %xmm0,0x10(%rsp)
movaps %xmm0,(%rsp)
lea    0x30(%rsp),%r12
lea    0x20(%rsp),%r14
mov    %rsp,%r15
mov    %r12,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
call   1040 <ref_asma@plt>
lea    0x10(%rsp),%rbx
mov    %r12,%rdi
mov    %r14,%rsi
mov    %rbx,%rdx
call   1080 <asma@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
mov    $0x10,%edx
call   1060 <memcmp@plt>
test   %rax,%rax
je     1360 <main+0x1f0>
mov    0x2df3(%rip),%rax
mov    (%rax),%edi
lea    0xe2a(%rip),%rsi
call   1070 <fprintf@plt>
movzbl 0x10(%rsp),%esi
movzbl (%rsp),%edx
lea    0xe23(%rip),%rbx
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
movzbl 0x11(%rsp),%esi
movzbl 0x1(%rsp),%edx
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
movzbl 0x12(%rsp),%esi
movzbl 0x2(%rsp),%edx
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
movzbl 0x13(%rsp),%esi
movzbl 0x3(%rsp),%edx
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
movzbl 0x14(%rsp),%esi
movzbl 0x4(%rsp),%edx
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
movzbl 0x15(%rsp),%esi
movzbl 0x5(%rsp),%edx
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
movzbl 0x16(%rsp),%esi
movzbl 0x6(%rsp),%edx
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
movzbl 0x17(%rsp),%esi
movzbl 0x7(%rsp),%edx
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
movzbl 0x18(%rsp),%esi
movzbl 0x8(%rsp),%edx
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
movzbl 0x19(%rsp),%esi
movzbl 0x9(%rsp),%edx
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
movzbl 0x1a(%rsp),%esi
movzbl 0xa(%rsp),%edx
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
movzbl 0x1b(%rsp),%esi
movzbl 0xb(%rsp),%edx
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
movzbl 0x1c(%rsp),%esi
movzbl 0xc(%rsp),%edx
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
movzbl 0x1d(%rsp),%esi
movzbl 0xd(%rsp),%edx
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
movzbl 0x1e(%rsp),%esi
movzbl 0xe(%rsp),%edx
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
movzbl 0x1f(%rsp),%esi
movzbl 0xf(%rsp),%edx
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    0x2c86(%rip),%rax
mov    (%rax),%edi
call   1090 <fflush@plt>
mov    $0x1,%eax
jmp    1362 <main+0x1f2>
xor    %eax,%eax
add    $0x48,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@__const.main.s = <{ i8, i8, i8, i8, i8, i8, [10 x i8] }> <{ i8 2, i8 3, i8 4, i8 5, i8 6, i8 7, [10 x i8] zeroinitializer }>
@__const.main.t = <{ i8, i8, i8, i8, i8, i8, [10 x i8] }> <{ i8 7, i8 6, i8 5, i8 4, i8 3, i8 2, [10 x i8] zeroinitializer }>
@stderr = global i32 0
@.str = [14 x i8] c"test failed!\0A\00"
@.str.1 = [10 x i8] c"(%u,%u), \00"
@.str.2 = [2 x i8] c"\0A\00"
@stdout = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca [16 x i8]
%3 = alloca [16 x i8]
%4 = alloca [16 x i8]
%5 = alloca [16 x i8]
%6 = alloca i32
store i32 0, i32* %1
%7 = bitcast [16 x i8]* %2 to i8*
%8 = bitcast [16 x i8]* %3 to i8*
%9 = bitcast [16 x i8]* %4 to i8*
%10 = bitcast [16 x i8]* %5 to i8*
%11 = getelementptr inbounds [16 x i8], [16 x i8]* %2, i64 0, i64 0
%12 = getelementptr inbounds [16 x i8], [16 x i8]* %3, i64 0, i64 0
%13 = getelementptr inbounds [16 x i8], [16 x i8]* %5, i64 0, i64 0
%14 = call i32 @ref_asma(i8* %11, i8* %12, i8* %13)
%15 = getelementptr inbounds [16 x i8], [16 x i8]* %2, i64 0, i64 0
%16 = getelementptr inbounds [16 x i8], [16 x i8]* %3, i64 0, i64 0
%17 = getelementptr inbounds [16 x i8], [16 x i8]* %4, i64 0, i64 0
%18 = call i32 @asma(i8* %15, i8* %16, i8* %17)
%19 = getelementptr inbounds [16 x i8], [16 x i8]* %4, i64 0, i64 0
%20 = getelementptr inbounds [16 x i8], [16 x i8]* %5, i64 0, i64 0
%21 = call i64 @memcmp(i8* %19, i8* %20, i32 16)
%22 = icmp ne i64 %21, 0
br i1 %22, label %23, label %48
23: ; preds = %0
%24 = load i32, i32* @stderr
%25 = call i32 @fprintf(i32 %24, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %6
br label %26
26: ; preds = %41, %23
%27 = load i32, i32* %6
%28 = icmp slt i32 %27, 16
br i1 %28, label %29, label %44
29: ; preds = %26
%30 = load i32, i32* %6
%31 = sext i32 %30 to i64
%32 = getelementptr inbounds [16 x i8], [16 x i8]* %4, i64 0, i64 %31
%33 = load i8, i8* %32
%34 = zext i8 %33 to i32
%35 = load i32, i32* %6
%36 = sext i32 %35 to i64
%37 = getelementptr inbounds [16 x i8], [16 x i8]* %5, i64 0, i64 %36
%38 = load i8, i8* %37
%39 = zext i8 %38 to i32
%40 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i32 %34, i32 %39)
br label %41
41: ; preds = %29
%42 = load i32, i32* %6
%43 = add nsw i32 %42, 1
store i32 %43, i32* %6
br label %26
44: ; preds = %26
%45 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%46 = load i32, i32* @stdout
%47 = call i32 @fflush(i32 %46)
store i32 1, i32* %1
br label %49
48: ; preds = %0
store i32 0, i32* %1
br label %49
49: ; preds = %48, %44
%50 = load i32, i32* %1
ret i32 %50
}

LLVM IR (-O2):
@__const.main.s = <{ i8, i8, i8, i8, i8, i8, [10 x i8] }> <{ i8 2, i8 3, i8 4, i8 5, i8 6, i8 7, [10 x i8] zeroinitializer }>
@__const.main.t = <{ i8, i8, i8, i8, i8, i8, [10 x i8] }> <{ i8 7, i8 6, i8 5, i8 4, i8 3, i8 2, [10 x i8] zeroinitializer }>
@stderr = global i32 0
@.str = [14 x i8] c"test failed!\0A\00"
@.str.1 = [10 x i8] c"(%u,%u), \00"
@stdout = global i32 0
define i32 @main() {
%1 = alloca [16 x i8]
%2 = alloca [16 x i8]
%3 = alloca [16 x i8]
%4 = alloca [16 x i8]
%5 = getelementptr inbounds [16 x i8], [16 x i8]* %1, i64 0, i64 0
%6 = getelementptr inbounds [16 x i8], [16 x i8]* %2, i64 0, i64 0
%7 = getelementptr inbounds [16 x i8], [16 x i8]* %3, i64 0, i64 0
%8 = getelementptr inbounds [16 x i8], [16 x i8]* %4, i64 0, i64 0
%9 = call i32 @ref_asma(i8* %5, i8* %6, i8* %8)
%10 = call i32 @asma(i8* %5, i8* %6, i8* %7)
%11 = call i64 @memcmp(i8* %7, i8* %8, i32 16)
%12 = icmp eq i64 %11, 0
br i1 %12, label %129, label %13
13: ; preds = %0
%14 = load i32, i32* @stderr
%15 = call i32 @fprintf(i32 %14, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%16 = load i8, i8* %7
%17 = zext i8 %16 to i32
%18 = load i8, i8* %8
%19 = zext i8 %18 to i32
%20 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i32 %17, i32 %19)
%21 = getelementptr inbounds [16 x i8], [16 x i8]* %3, i64 0, i64 1
%22 = load i8, i8* %21
%23 = zext i8 %22 to i32
%24 = getelementptr inbounds [16 x i8], [16 x i8]* %4, i64 0, i64 1
%25 = load i8, i8* %24
%26 = zext i8 %25 to i32
%27 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i32 %23, i32 %26)
%28 = getelementptr inbounds [16 x i8], [16 x i8]* %3, i64 0, i64 2
%29 = load i8, i8* %28
%30 = zext i8 %29 to i32
%31 = getelementptr inbounds [16 x i8], [16 x i8]* %4, i64 0, i64 2
%32 = load i8, i8* %31
%33 = zext i8 %32 to i32
%34 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i32 %30, i32 %33)
%35 = getelementptr inbounds [16 x i8], [16 x i8]* %3, i64 0, i64 3
%36 = load i8, i8* %35
%37 = zext i8 %36 to i32
%38 = getelementptr inbounds [16 x i8], [16 x i8]* %4, i64 0, i64 3
%39 = load i8, i8* %38
%40 = zext i8 %39 to i32
%41 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i32 %37, i32 %40)
%42 = getelementptr inbounds [16 x i8], [16 x i8]* %3, i64 0, i64 4
%43 = load i8, i8* %42
%44 = zext i8 %43 to i32
%45 = getelementptr inbounds [16 x i8], [16 x i8]* %4, i64 0, i64 4
%46 = load i8, i8* %45
%47 = zext i8 %46 to i32
%48 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i32 %44, i32 %47)
%49 = getelementptr inbounds [16 x i8], [16 x i8]* %3, i64 0, i64 5
%50 = load i8, i8* %49
%51 = zext i8 %50 to i32
%52 = getelementptr inbounds [16 x i8], [16 x i8]* %4, i64 0, i64 5
%53 = load i8, i8* %52
%54 = zext i8 %53 to i32
%55 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i32 %51, i32 %54)
%56 = getelementptr inbounds [16 x i8], [16 x i8]* %3, i64 0, i64 6
%57 = load i8, i8* %56
%58 = zext i8 %57 to i32
%59 = getelementptr inbounds [16 x i8], [16 x i8]* %4, i64 0, i64 6
%60 = load i8, i8* %59
%61 = zext i8 %60 to i32
%62 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i32 %58, i32 %61)
%63 = getelementptr inbounds [16 x i8], [16 x i8]* %3, i64 0, i64 7
%64 = load i8, i8* %63
%65 = zext i8 %64 to i32
%66 = getelementptr inbounds [16 x i8], [16 x i8]* %4, i64 0, i64 7
%67 = load i8, i8* %66
%68 = zext i8 %67 to i32
%69 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i32 %65, i32 %68)
%70 = getelementptr inbounds [16 x i8], [16 x i8]* %3, i64 0, i64 8
%71 = load i8, i8* %70
%72 = zext i8 %71 to i32
%73 = getelementptr inbounds [16 x i8], [16 x i8]* %4, i64 0, i64 8
%74 = load i8, i8* %73
%75 = zext i8 %74 to i32
%76 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i32 %72, i32 %75)
%77 = getelementptr inbounds [16 x i8], [16 x i8]* %3, i64 0, i64 9
%78 = load i8, i8* %77
%79 = zext i8 %78 to i32
%80 = getelementptr inbounds [16 x i8], [16 x i8]* %4, i64 0, i64 9
%81 = load i8, i8* %80
%82 = zext i8 %81 to i32
%83 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i32 %79, i32 %82)
%84 = getelementptr inbounds [16 x i8], [16 x i8]* %3, i64 0, i64 10
%85 = load i8, i8* %84
%86 = zext i8 %85 to i32
%87 = getelementptr inbounds [16 x i8], [16 x i8]* %4, i64 0, i64 10
%88 = load i8, i8* %87
%89 = zext i8 %88 to i32
%90 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i32 %86, i32 %89)
%91 = getelementptr inbounds [16 x i8], [16 x i8]* %3, i64 0, i64 11
%92 = load i8, i8* %91
%93 = zext i8 %92 to i32
%94 = getelementptr inbounds [16 x i8], [16 x i8]* %4, i64 0, i64 11
%95 = load i8, i8* %94
%96 = zext i8 %95 to i32
%97 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i32 %93, i32 %96)
%98 = getelementptr inbounds [16 x i8], [16 x i8]* %3, i64 0, i64 12
%99 = load i8, i8* %98
%100 = zext i8 %99 to i32
%101 = getelementptr inbounds [16 x i8], [16 x i8]* %4, i64 0, i64 12
%102 = load i8, i8* %101
%103 = zext i8 %102 to i32
%104 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i32 %100, i32 %103)
%105 = getelementptr inbounds [16 x i8], [16 x i8]* %3, i64 0, i64 13
%106 = load i8, i8* %105
%107 = zext i8 %106 to i32
%108 = getelementptr inbounds [16 x i8], [16 x i8]* %4, i64 0, i64 13
%109 = load i8, i8* %108
%110 = zext i8 %109 to i32
%111 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i32 %107, i32 %110)
%112 = getelementptr inbounds [16 x i8], [16 x i8]* %3, i64 0, i64 14
%113 = load i8, i8* %112
%114 = zext i8 %113 to i32
%115 = getelementptr inbounds [16 x i8], [16 x i8]* %4, i64 0, i64 14
%116 = load i8, i8* %115
%117 = zext i8 %116 to i32
%118 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i32 %114, i32 %117)
%119 = getelementptr inbounds [16 x i8], [16 x i8]* %3, i64 0, i64 15
%120 = load i8, i8* %119
%121 = zext i8 %120 to i32
%122 = getelementptr inbounds [16 x i8], [16 x i8]* %4, i64 0, i64 15
%123 = load i8, i8* %122
%124 = zext i8 %123 to i32
%125 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i32 %121, i32 %124)
%126 = call i32 @putchar(i32 10)
%127 = load i32, i32* @stdout
%128 = call i32 @fflush(i32 %127)
br label %129
129: ; preds = %0, %13
%130 = phi i32 [ 1, %13 ], [ 0, %0 ]
ret i32 %130
}