#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 */
long __builtin_get_texasr();
long __builtin_get_texasru();
long __builtin_get_tfhar();
long __builtin_get_tfiar();
int /*<<< orphan*/ __builtin_set_texasr(long);
int /*<<< orphan*/ __builtin_set_texasru(long);
int /*<<< orphan*/ __builtin_set_tfhar(long);
int /*<<< orphan*/ __builtin_set_tfiar(long);
long __builtin_tabort(int);
long __builtin_tabortdc(int, long, long);
long __builtin_tabortdci(int, long, int);
long __builtin_tabortwc(int, long, long);
long __builtin_tabortwci(int, long, int);
long __builtin_tbegin(int);
long __builtin_tcheck();
long __builtin_tend(int /*<<< orphan*/);
long __builtin_tendall();
long __builtin_trechkpt();
long __builtin_treclaim(int /*<<< orphan*/);
long __builtin_tresume();
long __builtin_tsr(int /*<<< orphan*/);
long __builtin_tsuspend();
long __builtin_ttest();
void test1(long int *r, int code, long int *a, long int *b) {
  r[0] = __builtin_tbegin(0);
  r[1] = __builtin_tbegin(1);
  r[2] = __builtin_tend(0);
  r[3] = __builtin_tendall();
  r[4] = __builtin_tabort(code);
  r[5] = __builtin_tabort(0x1);
  r[6] = __builtin_tabortdc(0xf, a[0], b[0]);
  r[7] = __builtin_tabortdci(0xf, a[1], 0x1);
  r[8] = __builtin_tabortwc(0xf, a[2], b[2]);
  r[9] = __builtin_tabortwci(0xf, a[3], 0x1);
  r[10] = __builtin_tcheck();
  r[11] = __builtin_trechkpt();
  r[12] = __builtin_treclaim(0);
  r[13] = __builtin_tresume();
  r[14] = __builtin_tsuspend();
  r[15] = __builtin_tsr(0);
  r[16] = __builtin_ttest();
  r[17] = __builtin_get_texasr();
  r[18] = __builtin_get_texasru();
  r[19] = __builtin_get_tfhar();
  r[20] = __builtin_get_tfiar();
  __builtin_set_texasr(a[21]);
  __builtin_set_texasru(a[22]);
  __builtin_set_tfhar(a[23]);
  __builtin_set_tfiar(a[24]);
}


x86 assembly (clang, -O0):
<test1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
xor    %edi,%edi
call   10c0 <__builtin_tbegin@plt>
mov    %rax,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
mov    $0x1,%edi
call   10c0 <__builtin_tbegin@plt>
mov    %rax,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,0x8(%rax)
xor    %edi,%edi
call   1100 <__builtin_tend@plt>
mov    %rax,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,0x10(%rax)
mov    $0x0,%al
call   10b0 <__builtin_tendall@plt>
mov    %rax,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,0x18(%rax)
mov    -0xc(%rbp),%edi
call   1030 <__builtin_tabort@plt>
mov    %rax,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,0x20(%rax)
mov    $0x1,%edi
call   1030 <__builtin_tabort@plt>
mov    %rax,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,0x28(%rax)
mov    -0x18(%rbp),%rax
mov    (%rax),%rsi
mov    -0x20(%rbp),%rax
mov    (%rax),%rdx
mov    $0xf,%edi
call   1060 <__builtin_tabortdc@plt>
mov    %rax,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,0x30(%rax)
mov    -0x18(%rbp),%rax
mov    0x8(%rax),%rsi
mov    $0xf,%edi
mov    $0x1,%edx
call   1160 <__builtin_tabortdci@plt>
mov    %rax,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,0x38(%rax)
mov    -0x18(%rbp),%rax
mov    0x10(%rax),%rsi
mov    -0x20(%rbp),%rax
mov    0x10(%rax),%rdx
mov    $0xf,%edi
call   1080 <__builtin_tabortwc@plt>
mov    %rax,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,0x40(%rax)
mov    -0x18(%rbp),%rax
mov    0x18(%rax),%rsi
mov    $0xf,%edi
mov    $0x1,%edx
call   1130 <__builtin_tabortwci@plt>
mov    %rax,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,0x48(%rax)
mov    $0x0,%al
call   1140 <__builtin_tcheck@plt>
mov    %rax,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,0x50(%rax)
mov    $0x0,%al
call   10a0 <__builtin_trechkpt@plt>
mov    %rax,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,0x58(%rax)
xor    %edi,%edi
call   1120 <__builtin_treclaim@plt>
mov    %rax,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,0x60(%rax)
mov    $0x0,%al
call   1090 <__builtin_tresume@plt>
mov    %rax,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,0x68(%rax)
mov    $0x0,%al
call   1190 <__builtin_tsuspend@plt>
mov    %rax,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,0x70(%rax)
xor    %edi,%edi
call   1180 <__builtin_tsr@plt>
mov    %rax,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,0x78(%rax)
mov    $0x0,%al
call   1050 <__builtin_ttest@plt>
mov    %rax,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,0x80(%rax)
mov    $0x0,%al
call   1150 <__builtin_get_texasr@plt>
mov    %rax,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,0x88(%rax)
mov    $0x0,%al
call   1070 <__builtin_get_texasru@plt>
mov    %rax,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,0x90(%rax)
mov    $0x0,%al
call   1110 <__builtin_get_tfhar@plt>
mov    %rax,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,0x98(%rax)
mov    $0x0,%al
call   10e0 <__builtin_get_tfiar@plt>
mov    %rax,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,0xa0(%rax)
mov    -0x18(%rbp),%rax
mov    0xa8(%rax),%rdi
call   10d0 <__builtin_set_texasr@plt>
mov    -0x18(%rbp),%rax
mov    0xb0(%rax),%rdi
call   1040 <__builtin_set_texasru@plt>
mov    -0x18(%rbp),%rax
mov    0xb8(%rax),%rdi
call   10f0 <__builtin_set_tfhar@plt>
mov    -0x18(%rbp),%rax
mov    0xc0(%rax),%rdi
call   1170 <__builtin_set_tfiar@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test1>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rcx,%r15
mov    %rdx,%r14
mov    %esi,%ebp
mov    %rdi,%rbx
xor    %edi,%edi
call   10c0 <__builtin_tbegin@plt>
mov    %rax,(%rbx)
mov    $0x1,%edi
call   10c0 <__builtin_tbegin@plt>
mov    %rax,0x8(%rbx)
xor    %edi,%edi
call   1100 <__builtin_tend@plt>
mov    %rax,0x10(%rbx)
xor    %eax,%eax
call   10b0 <__builtin_tendall@plt>
mov    %rax,0x18(%rbx)
mov    %ebp,%edi
call   1030 <__builtin_tabort@plt>
mov    %rax,0x20(%rbx)
mov    $0x1,%edi
call   1030 <__builtin_tabort@plt>
mov    %rax,0x28(%rbx)
mov    (%r14),%rsi
mov    (%r15),%rdx
mov    $0xf,%edi
call   1060 <__builtin_tabortdc@plt>
mov    %rax,0x30(%rbx)
mov    0x8(%r14),%rsi
mov    $0xf,%edi
mov    $0x1,%edx
call   1160 <__builtin_tabortdci@plt>
mov    %rax,0x38(%rbx)
mov    0x10(%r14),%rsi
mov    0x10(%r15),%rdx
mov    $0xf,%edi
call   1080 <__builtin_tabortwc@plt>
mov    %rax,0x40(%rbx)
mov    0x18(%r14),%rsi
mov    $0xf,%edi
mov    $0x1,%edx
call   1130 <__builtin_tabortwci@plt>
mov    %rax,0x48(%rbx)
xor    %eax,%eax
call   1140 <__builtin_tcheck@plt>
mov    %rax,0x50(%rbx)
xor    %eax,%eax
call   10a0 <__builtin_trechkpt@plt>
mov    %rax,0x58(%rbx)
xor    %edi,%edi
call   1120 <__builtin_treclaim@plt>
mov    %rax,0x60(%rbx)
xor    %eax,%eax
call   1090 <__builtin_tresume@plt>
mov    %rax,0x68(%rbx)
xor    %eax,%eax
call   1190 <__builtin_tsuspend@plt>
mov    %rax,0x70(%rbx)
xor    %edi,%edi
call   1180 <__builtin_tsr@plt>
mov    %rax,0x78(%rbx)
xor    %eax,%eax
call   1050 <__builtin_ttest@plt>
mov    %rax,0x80(%rbx)
xor    %eax,%eax
call   1150 <__builtin_get_texasr@plt>
mov    %rax,0x88(%rbx)
xor    %eax,%eax
call   1070 <__builtin_get_texasru@plt>
mov    %rax,0x90(%rbx)
xor    %eax,%eax
call   1110 <__builtin_get_tfhar@plt>
mov    %rax,0x98(%rbx)
xor    %eax,%eax
call   10e0 <__builtin_get_tfiar@plt>
mov    %rax,0xa0(%rbx)
mov    0xa8(%r14),%rdi
call   10d0 <__builtin_set_texasr@plt>
mov    0xb0(%r14),%rdi
call   1040 <__builtin_set_texasru@plt>
mov    0xb8(%r14),%rdi
call   10f0 <__builtin_set_tfhar@plt>
mov    0xc0(%r14),%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1170 <__builtin_set_tfiar@plt>

LLVM IR (-O0):
define void @test1(i64* %0, i32 %1, i64* %2, i64* %3) {
%5 = alloca i64*
%6 = alloca i32
%7 = alloca i64*
%8 = alloca i64*
store i64* %0, i64** %5
store i32 %1, i32* %6
store i64* %2, i64** %7
store i64* %3, i64** %8
%9 = call i64 @__builtin_tbegin(i32 0)
%10 = load i64*, i64** %5
%11 = getelementptr inbounds i64, i64* %10, i64 0
store i64 %9, i64* %11
%12 = call i64 @__builtin_tbegin(i32 1)
%13 = load i64*, i64** %5
%14 = getelementptr inbounds i64, i64* %13, i64 1
store i64 %12, i64* %14
%15 = call i64 @__builtin_tend(i32 0)
%16 = load i64*, i64** %5
%17 = getelementptr inbounds i64, i64* %16, i64 2
store i64 %15, i64* %17
%18 = call i64 (...) @__builtin_tendall()
%19 = load i64*, i64** %5
%20 = getelementptr inbounds i64, i64* %19, i64 3
store i64 %18, i64* %20
%21 = load i32, i32* %6
%22 = call i64 @__builtin_tabort(i32 %21)
%23 = load i64*, i64** %5
%24 = getelementptr inbounds i64, i64* %23, i64 4
store i64 %22, i64* %24
%25 = call i64 @__builtin_tabort(i32 1)
%26 = load i64*, i64** %5
%27 = getelementptr inbounds i64, i64* %26, i64 5
store i64 %25, i64* %27
%28 = load i64*, i64** %7
%29 = getelementptr inbounds i64, i64* %28, i64 0
%30 = load i64, i64* %29
%31 = load i64*, i64** %8
%32 = getelementptr inbounds i64, i64* %31, i64 0
%33 = load i64, i64* %32
%34 = call i64 @__builtin_tabortdc(i32 15, i64 %30, i64 %33)
%35 = load i64*, i64** %5
%36 = getelementptr inbounds i64, i64* %35, i64 6
store i64 %34, i64* %36
%37 = load i64*, i64** %7
%38 = getelementptr inbounds i64, i64* %37, i64 1
%39 = load i64, i64* %38
%40 = call i64 @__builtin_tabortdci(i32 15, i64 %39, i32 1)
%41 = load i64*, i64** %5
%42 = getelementptr inbounds i64, i64* %41, i64 7
store i64 %40, i64* %42
%43 = load i64*, i64** %7
%44 = getelementptr inbounds i64, i64* %43, i64 2
%45 = load i64, i64* %44
%46 = load i64*, i64** %8
%47 = getelementptr inbounds i64, i64* %46, i64 2
%48 = load i64, i64* %47
%49 = call i64 @__builtin_tabortwc(i32 15, i64 %45, i64 %48)
%50 = load i64*, i64** %5
%51 = getelementptr inbounds i64, i64* %50, i64 8
store i64 %49, i64* %51
%52 = load i64*, i64** %7
%53 = getelementptr inbounds i64, i64* %52, i64 3
%54 = load i64, i64* %53
%55 = call i64 @__builtin_tabortwci(i32 15, i64 %54, i32 1)
%56 = load i64*, i64** %5
%57 = getelementptr inbounds i64, i64* %56, i64 9
store i64 %55, i64* %57
%58 = call i64 (...) @__builtin_tcheck()
%59 = load i64*, i64** %5
%60 = getelementptr inbounds i64, i64* %59, i64 10
store i64 %58, i64* %60
%61 = call i64 (...) @__builtin_trechkpt()
%62 = load i64*, i64** %5
%63 = getelementptr inbounds i64, i64* %62, i64 11
store i64 %61, i64* %63
%64 = call i64 @__builtin_treclaim(i32 0)
%65 = load i64*, i64** %5
%66 = getelementptr inbounds i64, i64* %65, i64 12
store i64 %64, i64* %66
%67 = call i64 (...) @__builtin_tresume()
%68 = load i64*, i64** %5
%69 = getelementptr inbounds i64, i64* %68, i64 13
store i64 %67, i64* %69
%70 = call i64 (...) @__builtin_tsuspend()
%71 = load i64*, i64** %5
%72 = getelementptr inbounds i64, i64* %71, i64 14
store i64 %70, i64* %72
%73 = call i64 @__builtin_tsr(i32 0)
%74 = load i64*, i64** %5
%75 = getelementptr inbounds i64, i64* %74, i64 15
store i64 %73, i64* %75
%76 = call i64 (...) @__builtin_ttest()
%77 = load i64*, i64** %5
%78 = getelementptr inbounds i64, i64* %77, i64 16
store i64 %76, i64* %78
%79 = call i64 (...) @__builtin_get_texasr()
%80 = load i64*, i64** %5
%81 = getelementptr inbounds i64, i64* %80, i64 17
store i64 %79, i64* %81
%82 = call i64 (...) @__builtin_get_texasru()
%83 = load i64*, i64** %5
%84 = getelementptr inbounds i64, i64* %83, i64 18
store i64 %82, i64* %84
%85 = call i64 (...) @__builtin_get_tfhar()
%86 = load i64*, i64** %5
%87 = getelementptr inbounds i64, i64* %86, i64 19
store i64 %85, i64* %87
%88 = call i64 (...) @__builtin_get_tfiar()
%89 = load i64*, i64** %5
%90 = getelementptr inbounds i64, i64* %89, i64 20
store i64 %88, i64* %90
%91 = load i64*, i64** %7
%92 = getelementptr inbounds i64, i64* %91, i64 21
%93 = load i64, i64* %92
%94 = call i32 @__builtin_set_texasr(i64 %93)
%95 = load i64*, i64** %7
%96 = getelementptr inbounds i64, i64* %95, i64 22
%97 = load i64, i64* %96
%98 = call i32 @__builtin_set_texasru(i64 %97)
%99 = load i64*, i64** %7
%100 = getelementptr inbounds i64, i64* %99, i64 23
%101 = load i64, i64* %100
%102 = call i32 @__builtin_set_tfhar(i64 %101)
%103 = load i64*, i64** %7
%104 = getelementptr inbounds i64, i64* %103, i64 24
%105 = load i64, i64* %104
%106 = call i32 @__builtin_set_tfiar(i64 %105)
ret void
}

LLVM IR (-O2):
define void @test1(i64* writeonly %0, i32 %1, i64* nocapture %2, i64* nocapture %3) {
%5 = tail call i64 @__builtin_tbegin(i32 0)
store i64 %5, i64* %0
%6 = tail call i64 @__builtin_tbegin(i32 1)
%7 = getelementptr inbounds i64, i64* %0, i64 1
store i64 %6, i64* %7
%8 = tail call i64 @__builtin_tend(i32 0)
%9 = getelementptr inbounds i64, i64* %0, i64 2
store i64 %8, i64* %9
%10 = tail call i64 (...) @__builtin_tendall()
%11 = getelementptr inbounds i64, i64* %0, i64 3
store i64 %10, i64* %11
%12 = tail call i64 @__builtin_tabort(i32 %1)
%13 = getelementptr inbounds i64, i64* %0, i64 4
store i64 %12, i64* %13
%14 = tail call i64 @__builtin_tabort(i32 1)
%15 = getelementptr inbounds i64, i64* %0, i64 5
store i64 %14, i64* %15
%16 = load i64, i64* %2
%17 = load i64, i64* %3
%18 = tail call i64 @__builtin_tabortdc(i32 15, i64 %16, i64 %17)
%19 = getelementptr inbounds i64, i64* %0, i64 6
store i64 %18, i64* %19
%20 = getelementptr inbounds i64, i64* %2, i64 1
%21 = load i64, i64* %20
%22 = tail call i64 @__builtin_tabortdci(i32 15, i64 %21, i32 1)
%23 = getelementptr inbounds i64, i64* %0, i64 7
store i64 %22, i64* %23
%24 = getelementptr inbounds i64, i64* %2, i64 2
%25 = load i64, i64* %24
%26 = getelementptr inbounds i64, i64* %3, i64 2
%27 = load i64, i64* %26
%28 = tail call i64 @__builtin_tabortwc(i32 15, i64 %25, i64 %27)
%29 = getelementptr inbounds i64, i64* %0, i64 8
store i64 %28, i64* %29
%30 = getelementptr inbounds i64, i64* %2, i64 3
%31 = load i64, i64* %30
%32 = tail call i64 @__builtin_tabortwci(i32 15, i64 %31, i32 1)
%33 = getelementptr inbounds i64, i64* %0, i64 9
store i64 %32, i64* %33
%34 = tail call i64 (...) @__builtin_tcheck()
%35 = getelementptr inbounds i64, i64* %0, i64 10
store i64 %34, i64* %35
%36 = tail call i64 (...) @__builtin_trechkpt()
%37 = getelementptr inbounds i64, i64* %0, i64 11
store i64 %36, i64* %37
%38 = tail call i64 @__builtin_treclaim(i32 0)
%39 = getelementptr inbounds i64, i64* %0, i64 12
store i64 %38, i64* %39
%40 = tail call i64 (...) @__builtin_tresume()
%41 = getelementptr inbounds i64, i64* %0, i64 13
store i64 %40, i64* %41
%42 = tail call i64 (...) @__builtin_tsuspend()
%43 = getelementptr inbounds i64, i64* %0, i64 14
store i64 %42, i64* %43
%44 = tail call i64 @__builtin_tsr(i32 0)
%45 = getelementptr inbounds i64, i64* %0, i64 15
store i64 %44, i64* %45
%46 = tail call i64 (...) @__builtin_ttest()
%47 = getelementptr inbounds i64, i64* %0, i64 16
store i64 %46, i64* %47
%48 = tail call i64 (...) @__builtin_get_texasr()
%49 = getelementptr inbounds i64, i64* %0, i64 17
store i64 %48, i64* %49
%50 = tail call i64 (...) @__builtin_get_texasru()
%51 = getelementptr inbounds i64, i64* %0, i64 18
store i64 %50, i64* %51
%52 = tail call i64 (...) @__builtin_get_tfhar()
%53 = getelementptr inbounds i64, i64* %0, i64 19
store i64 %52, i64* %53
%54 = tail call i64 (...) @__builtin_get_tfiar()
%55 = getelementptr inbounds i64, i64* %0, i64 20
store i64 %54, i64* %55
%56 = getelementptr inbounds i64, i64* %2, i64 21
%57 = load i64, i64* %56
%58 = tail call i32 @__builtin_set_texasr(i64 %57)
%59 = getelementptr inbounds i64, i64* %2, i64 22
%60 = load i64, i64* %59
%61 = tail call i32 @__builtin_set_texasru(i64 %60)
%62 = getelementptr inbounds i64, i64* %2, i64 23
%63 = load i64, i64* %62
%64 = tail call i32 @__builtin_set_tfhar(i64 %63)
%65 = getelementptr inbounds i64, i64* %2, i64 24
%66 = load i64, i64* %65
%67 = tail call i32 @__builtin_set_tfiar(i64 %66)
ret void
}