LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O0/0x3f00[P]PhotonCpp/./PhotonLayer.h
// Function: PhotonLayer::packLayerImage[abi:cxx11]()
std::string packLayerImage() {
		std::stringstream baos;

		{
            for (int y = 0; y < height_; y++) {
                if (pixels[y] == 0) {
                    add(baos, PhotonDot::OFF, width_);
                } else {
                    char current = PhotonDot::OFF;
                    int length = 0;
                    for (int x = 0; x < width_; x++) {
						char next = iArray[y][x];
                        if (next != current) {
                            if (length > 0) {
                                add(baos, current, length);
                            }
                            current = next;
                            length = 1;
                        } else {
                            length++;
                        }
                    }
                    if (length > 0) {
                        add(baos, current, length);
                    }
                }
            }

			return baos.str();
        }
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x1e0, %rsp            # imm = 0x1E0
movq %rdi, -0x1d8(%rbp)
movq %rdi, %rax
movq %rax, -0x1d0(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x1c8(%rbp)
leaq -0x198(%rbp), %rdi
callq 0x3210
movl $0x0, -0x19c(%rbp)
movq -0x1c8(%rbp), %rcx
movl -0x19c(%rbp), %eax
cmpl 0x4(%rcx), %eax
jge 0x190b7
movq -0x1c8(%rbp), %rdi
addq $0x28, %rdi
movslq -0x19c(%rbp), %rsi
callq 0x11770
cmpl $0x0, (%rax)
jne 0x18f98
movq -0x1c8(%rbp), %rdi
leaq -0x188(%rbp), %rsi
movl (%rdi), %ecx
xorl %edx, %edx
callq 0x194a0
jmp 0x18f70
jmp 0x190a1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x1a8(%rbp)
movl %eax, -0x1ac(%rbp)
leaq -0x198(%rbp), %rdi
callq 0x3230
jmp 0x190e8
movb $0x0, -0x1ad(%rbp)
movl $0x0, -0x1b4(%rbp)
movl $0x0, -0x1b8(%rbp)
movq -0x1c8(%rbp), %rcx
movl -0x1b8(%rbp), %eax
cmpl (%rcx), %eax
jge 0x19072
movq -0x1c8(%rbp), %rdi
addq $0x10, %rdi
movslq -0x19c(%rbp), %rsi
callq 0xe060
movq %rax, %rdi
movslq -0x1b8(%rbp), %rsi
callq 0x11750
movb (%rax), %al
movb %al, -0x1b9(%rbp)
movsbl -0x1b9(%rbp), %eax
movsbl -0x1ad(%rbp), %ecx
cmpl %ecx, %eax
je 0x1904d
cmpl $0x0, -0x1b4(%rbp)
jle 0x19035
movq -0x1c8(%rbp), %rdi
leaq -0x188(%rbp), %rsi
movsbl -0x1ad(%rbp), %edx
movl -0x1b4(%rbp), %ecx
callq 0x194a0
jmp 0x19033
jmp 0x19035
movb -0x1b9(%rbp), %al
movb %al, -0x1ad(%rbp)
movl $0x1, -0x1b4(%rbp)
jmp 0x1905c
movl -0x1b4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1b4(%rbp)
jmp 0x1905e
movl -0x1b8(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1b8(%rbp)
jmp 0x18fb3
cmpl $0x0, -0x1b4(%rbp)
jle 0x1909f
movq -0x1c8(%rbp), %rdi
leaq -0x188(%rbp), %rsi
movsbl -0x1ad(%rbp), %edx
movl -0x1b4(%rbp), %ecx
callq 0x194a0
jmp 0x1909d
jmp 0x1909f
jmp 0x190a1
jmp 0x190a3
movl -0x19c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x19c(%rbp)
jmp 0x18f25
movq -0x1d8(%rbp), %rdi
leaq -0x198(%rbp), %rsi
callq 0x32d0
jmp 0x190cc
leaq -0x198(%rbp), %rdi
callq 0x3230
movq -0x1d0(%rbp), %rax
addq $0x1e0, %rsp            # imm = 0x1E0
popq %rbp
retq
movq -0x1a8(%rbp), %rdi
callq 0x3570
nopw %cs:(%rax,%rax)
nop
// File: /workspace/github_c_makefile_star2_O0/0x3f00[P]PhotonCpp/./PhotonLayer.h
// Function: PhotonLayer::setIslands(std::vector<std::vector<bool, std::allocator<bool>>, std::allocator<std::vector<bool, std::allocator<bool>>>>&)
int setIslands(std::vector<photoncpp::BitSet> & islandRows) {
        int islands = 0;
        for (int y = 0; y < height_; y++) {
			photoncpp::BitSet bitSet;
            if (rowIslands[y] > 0) {
                for (int x = 0; x < width_; x++) {
                    if (iArray[y][x] == PhotonDot::ISLAND) {
						bitSet[x] = true;
                    }
                }
            }
            islandRows.push_back(bitSet);
            islands += rowIslands[y];
        }
        return islands;
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x80, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x70(%rbp)
movl $0x0, -0x14(%rbp)
movl $0x0, -0x18(%rbp)
movq -0x70(%rbp), %rcx
movl -0x18(%rbp), %eax
cmpl 0x4(%rcx), %eax
jge 0x19486
leaq -0x40(%rbp), %rdi
callq 0x19a80
movq -0x70(%rbp), %rdi
addq $0x40, %rdi
movslq -0x18(%rbp), %rsi
callq 0x11770
cmpl $0x0, (%rax)
jle 0x19447
movl $0x0, -0x44(%rbp)
movq -0x70(%rbp), %rcx
movl -0x44(%rbp), %eax
cmpl (%rcx), %eax
jge 0x19445
movq -0x70(%rbp), %rdi
addq $0x10, %rdi
movslq -0x18(%rbp), %rsi
callq 0xe060
movq %rax, %rdi
movslq -0x44(%rbp), %rsi
callq 0x11750
movsbl (%rax), %eax
cmpl $0x2, %eax
jne 0x19435
movslq -0x44(%rbp), %rsi
leaq -0x40(%rbp), %rdi
callq 0x19aa0
movq %rdx, -0x80(%rbp)
movq %rax, -0x78(%rbp)
jmp 0x193fe
movq -0x80(%rbp), %rax
movq -0x78(%rbp), %rcx
movq %rcx, -0x58(%rbp)
movq %rax, -0x50(%rbp)
leaq -0x58(%rbp), %rdi
movl $0x1, %esi
callq 0x152f0
jmp 0x19435
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0x40(%rbp), %rdi
callq 0x134b0
jmp 0x19492
jmp 0x19437
movl -0x44(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x44(%rbp)
jmp 0x193b3
jmp 0x19447
movq -0x10(%rbp), %rdi
leaq -0x40(%rbp), %rsi
callq 0x19b00
jmp 0x19456
movq -0x70(%rbp), %rdi
addq $0x40, %rdi
movslq -0x18(%rbp), %rsi
callq 0x11770
movl (%rax), %eax
addl -0x14(%rbp), %eax
movl %eax, -0x14(%rbp)
leaq -0x40(%rbp), %rdi
callq 0x134b0
movl -0x18(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x18(%rbp)
jmp 0x19379
movl -0x14(%rbp), %eax
addq $0x80, %rsp
popq %rbp
retq
movq -0x60(%rbp), %rdi
callq 0x3570
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/0x3f00[P]PhotonCpp/./PhotonLayer.h
// Function: PhotonLayer::add(std::ostream&, char, int)
void add(std::ostream & baos, char current, int length) {
        if (length < 32) {
			std::vector<char> data(1, 0);
            data[0] = (char) ((current << 5) | (length & 0x1f));
            baos.write(data.data(), data.size());
        } else {
			std::vector<char> data(2, 0);
            data[0] = (char) (0x80 | (current << 5) | (length >> 8 & 0x00FF));
            data[1] = (char) (length & 0x00FF);
            baos.write(data.data(), data.size());
        }
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xc0, %rsp
movb %dl, %al
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movb %al, -0x11(%rbp)
movl %ecx, -0x18(%rbp)
cmpl $0x20, -0x18(%rbp)
jge 0x195a0
movb $0x0, -0x31(%rbp)
leaq -0x32(%rbp), %rdi
movq %rdi, -0x70(%rbp)
callq 0x3580
movq -0x70(%rbp), %rcx
leaq -0x30(%rbp), %rdi
movl $0x1, %esi
leaq -0x31(%rbp), %rdx
callq 0x196c0
jmp 0x194ee
leaq -0x32(%rbp), %rdi
callq 0x3330
movzbl -0x11(%rbp), %eax
shll $0x5, %eax
movl -0x18(%rbp), %ecx
andl $0x1f, %ecx
orl %ecx, %eax
movb %al, -0x89(%rbp)
xorl %eax, %eax
movl %eax, %esi
leaq -0x30(%rbp), %rdi
movq %rdi, -0x88(%rbp)
callq 0x11750
movb -0x89(%rbp), %cl
movq -0x88(%rbp), %rdi
movb %cl, (%rax)
movq -0x10(%rbp), %rax
movq %rax, -0x80(%rbp)
callq 0x19740
movq -0x88(%rbp), %rdi
movq %rax, -0x78(%rbp)
callq 0xeff0
movq -0x80(%rbp), %rdi
movq -0x78(%rbp), %rsi
movq %rax, %rdx
callq 0x33d0
jmp 0x1955e
leaq -0x30(%rbp), %rdi
callq 0xe000
jmp 0x196a8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x32(%rbp), %rdi
callq 0x3330
jmp 0x196b1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x30(%rbp), %rdi
callq 0xe000
jmp 0x196b1
movb $0x0, -0x61(%rbp)
leaq -0x62(%rbp), %rdi
movq %rdi, -0x98(%rbp)
callq 0x3580
movq -0x98(%rbp), %rcx
leaq -0x60(%rbp), %rdi
movl $0x2, %esi
leaq -0x61(%rbp), %rdx
callq 0x196c0
jmp 0x195cf
leaq -0x62(%rbp), %rdi
callq 0x3330
movzbl -0x11(%rbp), %eax
shll $0x5, %eax
movl -0x18(%rbp), %ecx
shrl $0x8, %ecx
orl %ecx, %eax
orb $-0x80, %al
movb %al, -0xb2(%rbp)
xorl %eax, %eax
movl %eax, %esi
leaq -0x60(%rbp), %rdi
movq %rdi, -0xb0(%rbp)
callq 0x11750
movb -0xb2(%rbp), %cl
movq -0xb0(%rbp), %rdi
movb %cl, (%rax)
movb -0x18(%rbp), %al
movb %al, -0xb1(%rbp)
movl $0x1, %esi
callq 0x11750
movb -0xb1(%rbp), %cl
movq -0xb0(%rbp), %rdi
movb %cl, (%rax)
movq -0x10(%rbp), %rax
movq %rax, -0xa8(%rbp)
callq 0x19740
movq -0xb0(%rbp), %rdi
movq %rax, -0xa0(%rbp)
callq 0xeff0
movq -0xa8(%rbp), %rdi
movq -0xa0(%rbp), %rsi
movq %rax, %rdx
callq 0x33d0
jmp 0x1966f
leaq -0x60(%rbp), %rdi
callq 0xe000
jmp 0x196a8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x62(%rbp), %rdi
callq 0x3330
jmp 0x196b1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x60(%rbp), %rdi
callq 0xe000
jmp 0x196b1
addq $0xc0, %rsp
popq %rbp
retq
movq -0x40(%rbp), %rdi
callq 0x3570
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/0x3f00[P]PhotonCpp/./PhotonLayer.h
// Function: PhotonLayer::addPhotonRLE(std::ostream&, bool, int)
void addPhotonRLE(std::ostream & baos, bool off, int length) {
		std::vector<char> data({ 0 });
        while (length>0) {
            int lineLength = std::min(length, 125); // max storage length of 0x7D (125) ?? Why not 127?
            data[0] = (char) ((off ? 0x00: 0x80) | (lineLength & 0x7f));
            baos.write(data.data(), data.size());
            length -= lineLength;
        }
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x90, %rsp
movb %dl, %al
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
andb $0x1, %al
movb %al, -0x11(%rbp)
movl %ecx, -0x18(%rbp)
movb $0x0, -0x41(%rbp)
leaq -0x41(%rbp), %rax
movq %rax, -0x40(%rbp)
movq $0x1, -0x38(%rbp)
leaq -0x42(%rbp), %rdi
movq %rdi, -0x68(%rbp)
callq 0x3580
movq -0x68(%rbp), %rcx
movq -0x40(%rbp), %rsi
movq -0x38(%rbp), %rdx
leaq -0x30(%rbp), %rdi
callq 0x11ad0
jmp 0x198c5
leaq -0x42(%rbp), %rdi
callq 0x3330
cmpl $0x0, -0x18(%rbp)
jle 0x199a4
movl $0x7d, -0x5c(%rbp)
leaq -0x18(%rbp), %rdi
leaq -0x5c(%rbp), %rsi
callq 0x199c0
movq %rax, -0x70(%rbp)
jmp 0x198f2
movq -0x70(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x58(%rbp)
movb -0x11(%rbp), %al
notb %al
movzbl %al, %eax
shll $0x7, %eax
movl -0x58(%rbp), %ecx
andl $0x7f, %ecx
orl %ecx, %eax
movb %al, -0x89(%rbp)
xorl %eax, %eax
movl %eax, %esi
leaq -0x30(%rbp), %rdi
movq %rdi, -0x88(%rbp)
callq 0x11750
movb -0x89(%rbp), %cl
movq -0x88(%rbp), %rdi
movb %cl, (%rax)
movq -0x10(%rbp), %rax
movq %rax, -0x80(%rbp)
callq 0x19740
movq -0x88(%rbp), %rdi
movq %rax, -0x78(%rbp)
callq 0xeff0
movq -0x80(%rbp), %rdi
movq -0x78(%rbp), %rsi
movq %rax, %rdx
callq 0x33d0
jmp 0x19966
movl -0x58(%rbp), %ecx
movl -0x18(%rbp), %eax
subl %ecx, %eax
movl %eax, -0x18(%rbp)
jmp 0x198ce
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0x42(%rbp), %rdi
callq 0x3330
jmp 0x199b6
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0x30(%rbp), %rdi
callq 0xe000
jmp 0x199b6
leaq -0x30(%rbp), %rdi
callq 0xe000
addq $0x90, %rsp
popq %rbp
retq
movq -0x50(%rbp), %rdi
callq 0x3570
nop
// File: /workspace/github_c_makefile_star2_O0/0x3f00[P]PhotonCpp/./PhotonOutputStream.h
// Function: PhotonOutputStream::writeInt(int)
void writeInt(int v) {
		outputStream_.put(0xFF & v);
		outputStream_.put(0xFF & (v >> 8));
		outputStream_.put(0xFF & (v >> 16));
		outputStream_.put(0xFF & (v >> 24));
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x18(%rbp)
movq (%rax), %rdi
movl -0xc(%rbp), %eax
andl $0xff, %eax
movsbl %al, %esi
callq 0x3060
movq -0x18(%rbp), %rax
movq (%rax), %rdi
movl -0xc(%rbp), %eax
sarl $0x8, %eax
andl $0xff, %eax
movsbl %al, %esi
callq 0x3060
movq -0x18(%rbp), %rax
movq (%rax), %rdi
movl -0xc(%rbp), %eax
sarl $0x10, %eax
andl $0xff, %eax
movsbl %al, %esi
callq 0x3060
movq -0x18(%rbp), %rax
movq (%rax), %rdi
movl -0xc(%rbp), %eax
sarl $0x18, %eax
andl $0xff, %eax
movsbl %al, %esi
callq 0x3060
addq $0x20, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/chatziko-k08[P]lecture-code/tests/ADTList_test.c
// Function: test_create
void test_create(void) {
	// Δημιουργούμε μια κενή λίστα με NULL δείκτη συνάρτησης delete_value
	List list = list_create(NULL);
	list_set_destroy_value(list, NULL);

	// Ελέγχουμε ότι δεν απέτυχε η malloc στην λίστα, και ότι
	// αρχικοποιείται με μέγεθος 0 (δηλαδή χωρίς κόμβους)
	TEST_ASSERT(list != NULL);
	TEST_ASSERT(list_size(list) == 0);

	list_destroy(list);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
xorl %eax, %eax
movl %eax, %edi
callq 0x56c0
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x5960
cmpq $0x0, -0x8(%rbp)
setne %al
andb $0x1, %al
movzbl %al, %edi
leaq 0x1f1b(%rip), %rsi      # 0x62e1
movl $0x14, %edx
leaq 0x2196(%rip), %rcx      # 0x6568
leaq 0x1f17(%rip), %r8       # 0x62f0
movb $0x0, %al
callq 0x2360
cmpl $0x0, %eax
jne 0x43ea
callq 0x2e40
jmp 0x43ec
jmp 0x43ee
movq -0x8(%rbp), %rdi
callq 0x5730
cmpl $0x0, %eax
sete %al
andb $0x1, %al
movzbl %al, %edi
leaq 0x1ed8(%rip), %rsi      # 0x62e1
movl $0x15, %edx
leaq 0x2153(%rip), %rcx      # 0x6568
leaq 0x1ee1(%rip), %r8       # 0x62fd
movb $0x0, %al
callq 0x2360
cmpl $0x0, %eax
jne 0x442d
callq 0x2e40
jmp 0x442f
movq -0x8(%rbp), %rdi
callq 0x5990
addq $0x10, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/chatziko-k08[P]lecture-code/tests/ADTList_test.c
// Function: test_find
void test_find(void) {
	List list = list_create(NULL);
	int N = 1000;
	int* array = malloc(N * sizeof(*array));					

	// Εισάγουμε δοκιμαστικές τιμές στον πίνακα, για να ελέγξουμε την test_find
	for (int i = 0; i < N; i++) {
		array[i] = i;
		list_insert_next(list, LIST_BOF, &array[i]);
	}

	// Εύρεση όλων των στοιχείων
	for (int i = 0; i < N; i++) {
		int* value = list_find(list, &i, compare_ints); 
		TEST_ASSERT(value == &array[i]);
	}

	// Δοκιμάζουμε, για μια τυχαία τιμή που δεν μπορεί πιθανώς να υπάρχει στην λίστα,
	// αν η list_find γυρνάει σωστά NULL pointer
	int not_exists = -1;
	TEST_ASSERT(list_find(list, &not_exists, compare_ints) == NULL);

	list_destroy(list);
	free(array);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
xorl %eax, %eax
movl %eax, %edi
callq 0x56c0
movq %rax, -0x8(%rbp)
movl $0x3e8, -0xc(%rbp)      # imm = 0x3E8
movslq -0xc(%rbp), %rdi
shlq $0x2, %rdi
callq 0x2180
movq %rax, -0x18(%rbp)
movl $0x0, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
cmpl -0xc(%rbp), %eax
jge 0x4951
movl -0x1c(%rbp), %edx
movq -0x18(%rbp), %rax
movslq -0x1c(%rbp), %rcx
movl %edx, (%rax,%rcx,4)
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rdx
movslq -0x1c(%rbp), %rax
shlq $0x2, %rax
addq %rax, %rdx
xorl %eax, %eax
movl %eax, %esi
callq 0x5750
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x4914
movl $0x0, -0x20(%rbp)
movl -0x20(%rbp), %eax
cmpl -0xc(%rbp), %eax
jge 0x49d0
movq -0x8(%rbp), %rdi
leaq -0x20(%rbp), %rsi
leaq -0xaf(%rip), %rdx       # 0x48c0
callq 0x58a0
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
movq -0x18(%rbp), %rcx
movslq -0x20(%rbp), %rdx
shlq $0x2, %rdx
addq %rdx, %rcx
cmpq %rcx, %rax
sete %al
andb $0x1, %al
movzbl %al, %edi
leaq 0x1944(%rip), %rsi      # 0x62e1
movl $0x7d, %edx
leaq 0x1bbf(%rip), %rcx      # 0x6568
leaq 0x1a78(%rip), %r8       # 0x6428
movb $0x0, %al
callq 0x2360
cmpl $0x0, %eax
jne 0x49c1
callq 0x2e40
jmp 0x49c3
jmp 0x49c5
movl -0x20(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x20(%rbp)
jmp 0x4958
movl $0xffffffff, -0x2c(%rbp) # imm = 0xFFFFFFFF
movq -0x8(%rbp), %rdi
leaq -0x2c(%rbp), %rsi
leaq -0x126(%rip), %rdx      # 0x48c0
callq 0x58a0
cmpq $0x0, %rax
sete %al
andb $0x1, %al
movzbl %al, %edi
leaq 0x18e3(%rip), %rsi      # 0x62e1
movl $0x83, %edx
leaq 0x1b5e(%rip), %rcx      # 0x6568
leaq 0x1a2a(%rip), %r8       # 0x643b
movb $0x0, %al
callq 0x2360
cmpl $0x0, %eax
jne 0x4a22
callq 0x2e40
jmp 0x4a24
movq -0x8(%rbp), %rdi
callq 0x5990
movq -0x18(%rbp), %rdi
callq 0x2260
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/chatziko-k08[P]lecture-code/tests/ADTList_test.c
// Function: test_find_node
void test_find_node(void) {
	List list = list_create(NULL);

	// Εισαγωγή τιμών στον πίνακα
	int N = 1000;
	int* array = malloc(N * sizeof(*array));					

	for (int i = 0; i < N; i++) {
		array[i] = i;
		list_insert_next(list, LIST_BOF, &array[i]);
	}

	// Ξεκινάμε από την αρχή της λίστας
	ListNode node = list_first(list);

	for (int i = N - 1; i >= 0; i--) {
		// Ελέγχουμε ότι η list_find_node βρίσκει σωστά τον πρώτο κόμβο με value τον δείκτη &array[i].
		// Σε αυτή την λίστα, δοκιμάζουμε ότι ο πρώτος κόμβος περιέχει τον δείκτη &array[N - 1], 
		// o δεύτερος τον &array[998] κοκ
		ListNode found_node = list_find_node(list, &i, compare_ints); 
		TEST_ASSERT(found_node == node);
		TEST_ASSERT(list_node_value(list, found_node) == &array[i]);

		// Προχωράμε στον επόμενο κόμβο για να προσπελάσουμε όλη την λίστα
		node = list_next(list, node);
	}

	list_destroy(list);
	free(array);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
xorl %eax, %eax
movl %eax, %edi
callq 0x56c0
movq %rax, -0x8(%rbp)
movl $0x3e8, -0xc(%rbp)      # imm = 0x3E8
movslq -0xc(%rbp), %rdi
shlq $0x2, %rdi
callq 0x2180
movq %rax, -0x18(%rbp)
movl $0x0, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
cmpl -0xc(%rbp), %eax
jge 0x4ab1
movl -0x1c(%rbp), %edx
movq -0x18(%rbp), %rax
movslq -0x1c(%rbp), %rcx
movl %edx, (%rax,%rcx,4)
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rdx
movslq -0x1c(%rbp), %rax
shlq $0x2, %rax
addq %rax, %rdx
xorl %eax, %eax
movl %eax, %esi
callq 0x5750
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x4a74
movq -0x8(%rbp), %rdi
callq 0x5a10
movq %rax, -0x28(%rbp)
movl -0xc(%rbp), %eax
subl $0x1, %eax
movl %eax, -0x2c(%rbp)
cmpl $0x0, -0x2c(%rbp)
jl 0x4b9b
movq -0x8(%rbp), %rdi
leaq -0x2c(%rbp), %rsi
leaq -0x220(%rip), %rdx      # 0x48c0
callq 0x58f0
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rax
cmpq -0x28(%rbp), %rax
sete %al
andb $0x1, %al
movzbl %al, %edi
leaq 0x17e1(%rip), %rsi      # 0x62e1
movl $0x9e, %edx
leaq 0x1a5c(%rip), %rcx      # 0x6568
leaq 0x195b(%rip), %r8       # 0x646e
movb $0x0, %al
callq 0x2360
cmpl $0x0, %eax
jne 0x4b24
callq 0x2e40
jmp 0x4b26
jmp 0x4b28
movq -0x8(%rbp), %rdi
movq -0x38(%rbp), %rsi
callq 0x5ac0
movq -0x18(%rbp), %rcx
movslq -0x2c(%rbp), %rdx
shlq $0x2, %rdx
addq %rdx, %rcx
cmpq %rcx, %rax
sete %al
andb $0x1, %al
movzbl %al, %edi
leaq 0x178b(%rip), %rsi      # 0x62e1
movl $0x9f, %edx
leaq 0x1a06(%rip), %rcx      # 0x6568
leaq 0x1918(%rip), %r8       # 0x6481
movb $0x0, %al
callq 0x2360
cmpl $0x0, %eax
jne 0x4b7a
callq 0x2e40
jmp 0x4b7c
movq -0x8(%rbp), %rdi
movq -0x28(%rbp), %rsi
callq 0x5a70
movq %rax, -0x28(%rbp)
movl -0x2c(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0x4ac7
movq -0x8(%rbp), %rdi
callq 0x5990
movq -0x18(%rbp), %rdi
callq 0x2260
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/meaning-matters[P]Except/Test.c
// Function: recurse
void recurse(int x)
{
    printf("recurse(%d)\n", x);

    try
    {
        if (x == 0)
            *((int *)0) = 0;
        recurse(x - 1);
    }
    finally
        printf("%d, ", x);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movl %edi, -0x4(%rbp)
movl -0x4(%rbp), %esi
leaq 0x84d7(%rip), %rdi      # 0xe47c
movb $0x0, %al
callq 0x1060
leaq 0xb2ad(%rip), %rax      # 0x11260
movq (%rax), %rdi
leaq 0x84a3(%rip), %rsi      # 0xe460
movl $0x2cd, %edx            # imm = 0x2CD
callq 0x1610
leaq 0xb292(%rip), %rax      # 0x11260
movq (%rax), %rdi
callq 0x12a0
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rdi
leaq 0xb31b(%rip), %rsi      # 0x11308
leaq 0x846c(%rip), %rdx      # 0xe460
movl $0x2cd, %ecx            # imm = 0x2CD
callq 0x1f60
cmpl $0x0, %eax
je 0x6059
movq -0x18(%rbp), %rax
movq (%rax), %rax
cmpl $0x0, 0x1b4(%rax)
je 0x6059
movq -0x18(%rbp), %rax
movq (%rax), %rdi
addq $0x8, %rdi
movl $0x1, %esi
callq 0x1110
cmpl $0x0, %eax
jne 0x6059
movq -0x18(%rbp), %rax
movq (%rax), %rax
movl $0x1, 0x1b8(%rax)
cmpl $0x0, -0x4(%rbp)
jne 0x604c
xorl %eax, %eax
movl $0x0, (%rax)
movl -0x4(%rbp), %edi
subl $0x1, %edi
callq 0x5f90
jmp 0x6059
cmpl $0x0, 0xb2a8(%rip)      # 0x11308
jne 0x6067
jmp 0x5fc7
movq -0x18(%rbp), %rax
movq (%rax), %rax
cmpl $0x0, 0x1b4(%rax)
jne 0x60a7
movq -0x18(%rbp), %rax
movq (%rax), %rdi
addq $0xd0, %rdi
movl $0x1, %esi
callq 0x1110
cmpl $0x0, %eax
jne 0x60a7
movq -0x18(%rbp), %rax
movq (%rax), %rax
movl $0x1, 0x1b4(%rax)
jmp 0x60a9
jmp 0x60ae
jmp 0x5fc7
leaq 0xb1ab(%rip), %rax      # 0x11260
movq (%rax), %rdi
callq 0x12a0
movq (%rax), %rax
movl $0x3, 0x1b8(%rax)
leaq 0xb18f(%rip), %rax      # 0x11260
movq (%rax), %rdi
callq 0x12a0
movq (%rax), %rcx
movb $0x1, %al
cmpl $0x0, 0x1b4(%rcx)
movb %al, -0x19(%rbp)
jg 0x6102
leaq 0xb16f(%rip), %rax      # 0x11260
movq (%rax), %rdi
callq 0x1c60
cmpl $0x0, %eax
setne %al
movb %al, -0x19(%rbp)
movb -0x19(%rbp), %al
testb $0x1, %al
jne 0x610b
jmp 0x614a
jmp 0x610d
leaq 0xb14c(%rip), %rax      # 0x11260
movq (%rax), %rdi
callq 0x12a0
movq (%rax), %rcx
movl 0x1b4(%rcx), %eax
movl %eax, %edx
addl $-0x1, %edx
movl %edx, 0x1b4(%rcx)
cmpl $0x0, %eax
jle 0x6148
movl -0x4(%rbp), %esi
leaq 0x834a(%rip), %rdi      # 0xe489
movb $0x0, %al
callq 0x1060
jmp 0x610d
jmp 0x60ca
addq $0x20, %rsp
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O0/meaning-matters[P]Except/Test.c
// Function: TestValidate
static void TestValidate(void)
{
    printf("\nVALIDATE TESTS ----------------------------------------\n\n");

    printf("-->%2d: Returns 27?\n", testNum++);
    printf("Returned %d\n", t9());
    printf("\n");
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0x673d(%rip), %rdi      # 0xe868
movb $0x0, %al
callq 0x1060
movl 0x9118(%rip), %esi      # 0x11250
movl %esi, %eax
addl $0x1, %eax
movl %eax, 0x910d(%rip)      # 0x11250
leaq 0x6759(%rip), %rdi      # 0xe8a3
movb $0x0, %al
callq 0x1060
callq 0xd0c0
movl %eax, %esi
leaq 0x6759(%rip), %rdi      # 0xe8b8
movb $0x0, %al
callq 0x1060
leaq 0x68ad(%rip), %rdi      # 0xea1a
movb $0x0, %al
callq 0x1060
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/aap[P]rx-0/ww1/mach.c
// Function: deposit
void
deposit(Addr a, Word w)
{
	WWI *ww = &ww1;
	if(MS_SELECT(a))
		ww->core[a] = w;
	else if(IS_FF(a))
		ww->ffs[a & 037] = w;
	else
		ww->tss[a & 037] = w;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movw %di, %ax
movw %ax, -0x2(%rbp)
movl %esi, -0x8(%rbp)
leaq 0xcc1b(%rip), %rax      # 0x11600
movq %rax, -0x10(%rbp)
movzwl -0x2(%rbp), %eax
andl $0xffe0, %eax           # imm = 0xFFE0
cmpl $0x0, %eax
je 0x4a0f
movl -0x8(%rbp), %eax
movw %ax, %dx
movq -0x10(%rbp), %rax
movzwl -0x2(%rbp), %ecx
movw %dx, 0x9c(%rax,%rcx,2)
jmp 0x4a5d
movq -0x10(%rbp), %rax
movl 0x18(%rax), %eax
movzwl -0x2(%rbp), %ecx
andl $0x1f, %ecx
shrl %cl, %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x4a42
movl -0x8(%rbp), %eax
movw %ax, %dx
movq -0x10(%rbp), %rax
movzwl -0x2(%rbp), %ecx
andl $0x1f, %ecx
movslq %ecx, %rcx
movw %dx, 0x1c(%rax,%rcx,2)
jmp 0x4a5b
movl -0x8(%rbp), %eax
movw %ax, %dx
movq -0x10(%rbp), %rax
movzwl -0x2(%rbp), %ecx
andl $0x1f, %ecx
movslq %ecx, %rcx
movw %dx, 0x5c(%rax,%rcx,2)
jmp 0x4a5d
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/aap[P]rx-0/ww1/mach.c
// Function: examine
Word
examine(Addr a)
{
	WWI *ww = &ww1;
	if(MS_SELECT(a))
		return ww->core[a];
	else if(IS_FF(a))
		return ww->ffs[a & 037];
	else
		return ww->tss[a & 037];
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movw %di, %ax
movw %ax, -0x6(%rbp)
leaq 0xcb8e(%rip), %rax      # 0x11600
movq %rax, -0x10(%rbp)
movzwl -0x6(%rbp), %eax
andl $0xffe0, %eax           # imm = 0xFFE0
cmpl $0x0, %eax
je 0x4a99
movq -0x10(%rbp), %rax
movzwl -0x6(%rbp), %ecx
movzwl 0x9c(%rax,%rcx,2), %eax
movl %eax, -0x4(%rbp)
jmp 0x4adf
movq -0x10(%rbp), %rax
movl 0x18(%rax), %eax
movzwl -0x6(%rbp), %ecx
andl $0x1f, %ecx
shrl %cl, %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x4ac9
movq -0x10(%rbp), %rax
movzwl -0x6(%rbp), %ecx
andl $0x1f, %ecx
movslq %ecx, %rcx
movzwl 0x1c(%rax,%rcx,2), %eax
movl %eax, -0x4(%rbp)
jmp 0x4adf
movq -0x10(%rbp), %rax
movzwl -0x6(%rbp), %ecx
andl $0x1f, %ecx
movslq %ecx, %rcx
movzwl 0x5c(%rax,%rcx,2), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/aap[P]rx-0/ww1/mach.c
// Function: depositreg
void
depositreg(int a, Word w)
{
	switch(a){
	case REG_PC: ww1.pc = w & ADDRMASK; break;
	case REG_AC: ww1.ac = w & WORDMASK; break;
	case REG_A: ww1.ar = w & WORDMASK; break;
	case REG_B: ww1.br = w & WORDMASK; break;
	case REG_SAM:
		ww1.ac0_carry = ww1.sam = 0;
		if(w == 1)
			ww1.ac0_carry = 1;
		else if(w == 0177776)
			ww1.sam = 1;
		break;
	default:
		// Set toggle switch storage
		if(a < 32)
			ww1.tss[a] = w;
		break;
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movl %edi, -0x4(%rbp)
movl %esi, -0x8(%rbp)
movl -0x4(%rbp), %eax
addl $-0x20, %eax
movl %eax, %ecx
movq %rcx, -0x10(%rbp)
subl $0x4, %eax
ja 0x4ba3
movq -0x10(%rbp), %rax
leaq 0x47fe(%rip), %rcx      # 0x9318
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movl -0x8(%rbp), %eax
andl $0x7ff, %eax            # imm = 0x7FF
movw %ax, 0xcade(%rip)       # 0x11610
jmp 0x4bc1
movl -0x8(%rbp), %eax
andl $0xffff, %eax           # imm = 0xFFFF
movw %ax, 0xdb62(%rip)       # 0x126a8
jmp 0x4bc1
movl -0x8(%rbp), %eax
andl $0xffff, %eax           # imm = 0xFFFF
movw %ax, 0xdb49(%rip)       # 0x126a0
jmp 0x4bc1
movl -0x8(%rbp), %eax
andl $0xffff, %eax           # imm = 0xFFFF
movw %ax, 0xdb44(%rip)       # 0x126ac
jmp 0x4bc1
movw $0x0, 0xdb3d(%rip)      # 0x126b0
movw $0x0, 0xdb32(%rip)      # 0x126ae
cmpl $0x1, -0x8(%rbp)
jne 0x4b8d
movw $0x1, 0xdb23(%rip)      # 0x126ae
jmp 0x4ba1
cmpl $0xfffe, -0x8(%rbp)     # imm = 0xFFFE
jne 0x4b9f
movw $0x1, 0xdb11(%rip)      # 0x126b0
jmp 0x4ba1
jmp 0x4bc1
cmpl $0x20, -0x4(%rbp)
jge 0x4bbf
movl -0x8(%rbp), %eax
movw %ax, %dx
movslq -0x4(%rbp), %rcx
leaq 0xca46(%rip), %rax      # 0x11600
movw %dx, 0x5c(%rax,%rcx,2)
jmp 0x4bc1
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/aap[P]rx-0/ww1/mach.c
// Function: examinereg
Word
examinereg(int a)
{
	word w;
	switch(a){
	case REG_PC: return ww1.pc;
	case REG_AC: return ww1.ac;
	case REG_A: return ww1.ar;
	case REG_B: return ww1.br;
	case REG_SAM:
		w = 0;
		if(ww1.ac0_carry) w |= 1;
		if(ww1.sam) w |= 0177776;
		return w;
	default:
		// Read toggle switch storage
		if(a < 32)
			return ww1.tss[a];
		break;
	}
	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movl %edi, -0x8(%rbp)
movl -0x8(%rbp), %eax
addl $-0x20, %eax
movl %eax, %ecx
movq %rcx, -0x18(%rbp)
subl $0x4, %eax
ja 0x4c6e
movq -0x18(%rbp), %rax
leaq 0x4735(%rip), %rcx      # 0x932c
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movzwl 0xca09(%rip), %eax      # 0x11610
movl %eax, -0x4(%rbp)
jmp 0x4c92
movzwl 0xda92(%rip), %eax      # 0x126a8
movl %eax, -0x4(%rbp)
jmp 0x4c92
movzwl 0xda7e(%rip), %eax      # 0x126a0
movl %eax, -0x4(%rbp)
jmp 0x4c92
movzwl 0xda7e(%rip), %eax      # 0x126ac
movl %eax, -0x4(%rbp)
jmp 0x4c92
movw $0x0, -0xa(%rbp)
cmpw $0x0, 0xda6d(%rip)      # 0x126ae
je 0x4c4e
movzwl -0xa(%rbp), %eax
orl $0x1, %eax
movw %ax, -0xa(%rbp)
cmpw $0x0, 0xda5a(%rip)      # 0x126b0
je 0x4c65
movzwl -0xa(%rbp), %eax
orl $0xfffe, %eax           # imm = 0xFFFE
movw %ax, -0xa(%rbp)
movzwl -0xa(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x4c92
cmpl $0x20, -0x8(%rbp)
jge 0x4c89
movslq -0x8(%rbp), %rcx
leaq 0xc981(%rip), %rax      # 0x11600
movzwl 0x5c(%rax,%rcx,2), %eax
movl %eax, -0x4(%rbp)
jmp 0x4c92
jmp 0x4c8b
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/aap[P]rx-0/ww1/mach.c
// Function: scope_record
void
scope_record(WWI *ww, ExUnit *eu)
{
	Scope *s = (Scope*)eu;
	if(s->fd >= 0){
		u32 cmd = 0;
		int x = ww->hdefl;
		int y = ww->vdefl;
		// Convert [-1.0,+1.0] to [0,1023]
		if(x & 02000) x++;
		if(y & 02000) y++;
		x += 02000;
		y += 02000;
		x &= 03777;
		y &= 03777;
		x >>= 1;
		y >>= 1;
		cmd = x;
		cmd |= y<<10;
		cmd |= 7<<20;
		if(write(s->fd, &cmd, 4) < 4)
			s->fd = -1;
usleep(100);
	}
	ww->interlock = 0;
	eu->active = 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
cmpl $0x0, 0x28(%rax)
jl 0x514c
movl $0x0, -0x1c(%rbp)
movq -0x8(%rbp), %rax
movl 0x10d8(%rax), %eax
movl %eax, -0x20(%rbp)
movq -0x8(%rbp), %rax
movl 0x10dc(%rax), %eax
movl %eax, -0x24(%rbp)
movl -0x20(%rbp), %eax
andl $0x400, %eax            # imm = 0x400
cmpl $0x0, %eax
je 0x50ad
movl -0x20(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x20(%rbp)
movl -0x24(%rbp), %eax
andl $0x400, %eax            # imm = 0x400
cmpl $0x0, %eax
je 0x50c3
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
movl -0x20(%rbp), %eax
addl $0x400, %eax            # imm = 0x400
movl %eax, -0x20(%rbp)
movl -0x24(%rbp), %eax
addl $0x400, %eax            # imm = 0x400
movl %eax, -0x24(%rbp)
movl -0x20(%rbp), %eax
andl $0x7ff, %eax            # imm = 0x7FF
movl %eax, -0x20(%rbp)
movl -0x24(%rbp), %eax
andl $0x7ff, %eax            # imm = 0x7FF
movl %eax, -0x24(%rbp)
movl -0x20(%rbp), %eax
sarl %eax
movl %eax, -0x20(%rbp)
movl -0x24(%rbp), %eax
sarl %eax
movl %eax, -0x24(%rbp)
movl -0x20(%rbp), %eax
movl %eax, -0x1c(%rbp)
movl -0x24(%rbp), %eax
shll $0xa, %eax
orl -0x1c(%rbp), %eax
movl %eax, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
orl $0x700000, %eax         # imm = 0x700000
movl %eax, -0x1c(%rbp)
movq -0x18(%rbp), %rax
movl 0x28(%rax), %edi
leaq -0x1c(%rbp), %rsi
movl $0x4, %edx
callq 0x20b0
cmpq $0x4, %rax
jge 0x5142
movq -0x18(%rbp), %rax
movl $0xffffffff, 0x28(%rax) # imm = 0xFFFFFFFF
movl $0x64, %edi
callq 0x2420
movq -0x8(%rbp), %rax
movl $0x0, 0x10c4(%rax)
movq -0x10(%rbp), %rax
movl $0x0, (%rax)
addq $0x30, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/aap[P]rx-0/ww1/mach.c
// Function: ptape_init
void
ptape_init(WWI *ww, ExUnit *eu)
{
	Papertape *pt = (Papertape*)eu;
	pt->wbyw = !!(ww->ios & 2);
	pt->p7 = !(ww->ios & 1);

	ww->ioc_counter = pt->wbyw ? 015 : 017;
	pt->dly = 1000;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x18(%rbp)
movq -0x8(%rbp), %rax
movl 0x10c8(%rax), %eax
andl $0x2, %eax
cmpl $0x0, %eax
setne %al
xorb $-0x1, %al
xorb $-0x1, %al
andb $0x1, %al
movzbl %al, %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0x48(%rax)
movq -0x8(%rbp), %rax
movl 0x10c8(%rax), %eax
andl $0x1, %eax
cmpl $0x0, %eax
setne %al
xorb $-0x1, %al
andb $0x1, %al
movzbl %al, %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0x4c(%rax)
movq -0x18(%rbp), %rax
movl 0x48(%rax), %edx
movl $0xf, %ecx
movl $0xd, %eax
cmpl $0x0, %edx
cmovnel %eax, %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x10c0(%rax)
movq -0x18(%rbp), %rax
movl $0x3e8, 0x50(%rax)      # imm = 0x3E8
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/aap[P]rx-0/ww1/mach.c
// Function: ptape_record
void
ptape_record(WWI *ww, ExUnit *eu)
{
	Papertape *pt = (Papertape*)eu;
	if(pt->dly){
		pt->dly--;
		return;
	}

	int u = (ww->ios>>3) & 3;
	u8 c = ww->ior>>10 & 077;
	if(pt->p7) c |= 0100;
	write(pt->out_fd[u], &c, 1);

	if(pt->wbyw) ww->ior <<= 5;
	if(ww->ioc_counter++ == 017){
		ww->interlock = 0;
		eu->active = 0;
	}

	pt->dly = 1000;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
cmpl $0x0, 0x50(%rax)
je 0x5264
movq -0x18(%rbp), %rax
movl 0x50(%rax), %ecx
addl $-0x1, %ecx
movl %ecx, 0x50(%rax)
jmp 0x5315
movq -0x8(%rbp), %rax
movl 0x10c8(%rax), %eax
sarl $0x3, %eax
andl $0x3, %eax
movl %eax, -0x1c(%rbp)
movq -0x8(%rbp), %rax
movzwl 0x10b8(%rax), %eax
sarl $0xa, %eax
andl $0x3f, %eax
movb %al, -0x1d(%rbp)
movq -0x18(%rbp), %rax
cmpl $0x0, 0x4c(%rax)
je 0x529f
movzbl -0x1d(%rbp), %eax
orl $0x40, %eax
movb %al, -0x1d(%rbp)
movq -0x18(%rbp), %rax
movslq -0x1c(%rbp), %rcx
movl 0x28(%rax,%rcx,4), %edi
leaq -0x1d(%rbp), %rsi
movl $0x1, %edx
callq 0x20b0
movq -0x18(%rbp), %rax
cmpl $0x0, 0x48(%rax)
je 0x52d8
movq -0x8(%rbp), %rax
movzwl 0x10b8(%rax), %ecx
shll $0x5, %ecx
movw %cx, 0x10b8(%rax)
movq -0x8(%rbp), %rcx
movl 0x10c0(%rcx), %eax
movl %eax, %edx
addl $0x1, %edx
movl %edx, 0x10c0(%rcx)
cmpl $0xf, %eax
jne 0x530a
movq -0x8(%rbp), %rax
movl $0x0, 0x10c4(%rax)
movq -0x10(%rbp), %rax
movl $0x0, (%rax)
movq -0x18(%rbp), %rax
movl $0x3e8, 0x50(%rax)      # imm = 0x3E8
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/aap[P]rx-0/ww1/mach.c
// Function: ptape_read
void
ptape_read(WWI *ww, ExUnit *eu)
{
	Papertape *pt = (Papertape*)eu;
	if(pt->dly){
		pt->dly--;
		return;
	}
	int u = (ww->ios>>3) & 3;
	if(eu->active && hasinput(pt->in_fd[u])){
		u8 c;
		read(pt->in_fd[u], &c, 1);
		if(pt->wbyw) ww->ior <<= 5;
		ww->ior |= c & 077;

		if(ww->ioc_counter++ == 017){
			ww->interlock = 0;
			eu->active = 0;
		}

		pt->dly = 1000;
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
cmpl $0x0, 0x50(%rax)
je 0x5354
movq -0x18(%rbp), %rax
movl 0x50(%rax), %ecx
addl $-0x1, %ecx
movl %ecx, 0x50(%rax)
jmp 0x541f
movq -0x8(%rbp), %rax
movl 0x10c8(%rax), %eax
sarl $0x3, %eax
andl $0x3, %eax
movl %eax, -0x1c(%rbp)
movq -0x10(%rbp), %rax
cmpl $0x0, (%rax)
je 0x541f
movq -0x18(%rbp), %rax
movslq -0x1c(%rbp), %rcx
movl 0x38(%rax,%rcx,4), %edi
callq 0x3970
cmpl $0x0, %eax
je 0x541f
movq -0x18(%rbp), %rax
movslq -0x1c(%rbp), %rcx
movl 0x38(%rax,%rcx,4), %edi
leaq -0x1d(%rbp), %rsi
movl $0x1, %edx
callq 0x2180
movq -0x18(%rbp), %rax
cmpl $0x0, 0x48(%rax)
je 0x53c7
movq -0x8(%rbp), %rax
movzwl 0x10b8(%rax), %ecx
shll $0x5, %ecx
movw %cx, 0x10b8(%rax)
movzbl -0x1d(%rbp), %edx
andl $0x3f, %edx
movq -0x8(%rbp), %rax
movzwl 0x10b8(%rax), %ecx
orl %edx, %ecx
movw %cx, 0x10b8(%rax)
movq -0x8(%rbp), %rcx
movl 0x10c0(%rcx), %eax
movl %eax, %edx
addl $0x1, %edx
movl %edx, 0x10c0(%rcx)
cmpl $0xf, %eax
jne 0x5414
movq -0x8(%rbp), %rax
movl $0x0, 0x10c4(%rax)
movq -0x10(%rbp), %rax
movl $0x0, (%rax)
movq -0x18(%rbp), %rax
movl $0x3e8, 0x50(%rax)      # imm = 0x3E8
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/aap[P]rx-0/ww1/mach.c
// Function: si_misc
void
si_misc(WWI *ww)
{
	if(ww->ios == 0)
		ww->run = 0;
	else if(ww->ios == 1)
		ww->run = 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
cmpl $0x0, 0x10c8(%rax)
jne 0x5452
movq -0x8(%rbp), %rax
movl $0x0, 0x8(%rax)
jmp 0x546c
movq -0x8(%rbp), %rax
cmpl $0x1, 0x10c8(%rax)
jne 0x546a
movq -0x8(%rbp), %rax
movl $0x0, 0x8(%rax)
jmp 0x546c
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/aap[P]rx-0/ww1/mach.c
// Function: readmem
void
readmem(WWI *ww, FILE *f)
{
	char buf[100], *s;
	word a, w;

	a = 0;
	while(s = fgets(buf, 100, f)){
		while(*s){
			if(*s == ';')
				break;
			else if('0' <= *s && *s <= '7'){
				w = strtol(s, &s, 8);
				if(*s == ':'){
					a = w;
					s++;
				}else if(a < 04000)
					ww->core[a++] = w;
			}else
				s++;
		}
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x90, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movw $0x0, -0x8a(%rbp)
leaq -0x80(%rbp), %rdi
movq -0x10(%rbp), %rdx
movl $0x64, %esi
callq 0x2190
movq %rax, -0x88(%rbp)
cmpq $0x0, %rax
je 0x567a
jmp 0x5581
movq -0x88(%rbp), %rax
cmpb $0x0, (%rax)
je 0x5675
movq -0x88(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x3b, %eax
jne 0x55a5
jmp 0x5675
movq -0x88(%rbp), %rax
movsbl (%rax), %ecx
movl $0x30, %eax
cmpl %ecx, %eax
jg 0x565c
movq -0x88(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x37, %eax
jg 0x565c
movq -0x88(%rbp), %rdi
leaq -0x88(%rbp), %rsi
movl $0x8, %edx
callq 0x21e0
movw %ax, -0x8c(%rbp)
movq -0x88(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x3a, %eax
jne 0x561f
movw -0x8c(%rbp), %ax
movw %ax, -0x8a(%rbp)
movq -0x88(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x88(%rbp)
jmp 0x565a
movzwl -0x8a(%rbp), %eax
cmpl $0x800, %eax            # imm = 0x800
jge 0x5658
movw -0x8c(%rbp), %dx
movq -0x8(%rbp), %rax
movw -0x8a(%rbp), %cx
movw %cx, %si
addw $0x1, %si
movw %si, -0x8a(%rbp)
movzwl %cx, %ecx
movw %dx, 0x9c(%rax,%rcx,2)
jmp 0x565a
jmp 0x566e
movq -0x88(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x88(%rbp)
jmp 0x5670
jmp 0x5581
jmp 0x555c
addq $0x90, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/aap[P]rx-0/ww1/mach.c
// Function: printmem
void
printmem(WWI *ww)
{
	word a;
	for(a = 0; a < 04000; a++)
		if(ww->core[a])
			printf("%04o/%06o\n", a, ww->core[a]);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movw $0x0, -0xa(%rbp)
movzwl -0xa(%rbp), %eax
cmpl $0x800, %eax            # imm = 0x800
jge 0x57d2
movq -0x8(%rbp), %rax
movzwl -0xa(%rbp), %ecx
cmpw $0x0, 0x9c(%rax,%rcx,2)
je 0x57c2
movzwl -0xa(%rbp), %esi
movq -0x8(%rbp), %rax
movzwl -0xa(%rbp), %ecx
movzwl 0x9c(%rax,%rcx,2), %edx
leaq 0x3d17(%rip), %rdi      # 0x94d2
movb $0x0, %al
callq 0x2100
jmp 0x57c4
movw -0xa(%rbp), %ax
addw $0x1, %ax
movw %ax, -0xa(%rbp)
jmp 0x5782
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/aap[P]rx-0/ww1/mach.c
// Function: handlemsg
void
handlemsg(WWI *ww, Msg msg)
{
	switch(msg.cmd){
	case CMD_NONE:
		break;
	case CMD_SET_PC:
		ww->pc_sw = msg.arg & ADDRMASK;
		ww->pc = ww->pc_sw;
		break;
	case CMD_STEP:
		ww->order_by_order = 1;
		ww->run = 1;
		break;
	case CMD_RUN:
		ww->order_by_order = 0;
		ww->run = 1;
		break;
	case CMD_STOP:
		ww->run = 0;
		break;
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rsi, -0x8(%rbp)
movq %rdi, -0x10(%rbp)
movl -0x8(%rbp), %eax
movq %rax, -0x18(%rbp)
subq $0x4, %rax
ja 0x586d
movq -0x18(%rbp), %rax
leaq 0x3bbc(%rip), %rcx      # 0x93c0
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
jmp 0x586d
movl -0x4(%rbp), %eax
andl $0x7ff, %eax            # imm = 0x7FF
movw %ax, %cx
movq -0x10(%rbp), %rax
movw %cx, (%rax)
movq -0x10(%rbp), %rax
movw (%rax), %cx
movq -0x10(%rbp), %rax
movw %cx, 0x10(%rax)
jmp 0x586d
movq -0x10(%rbp), %rax
movl $0x1, 0x4(%rax)
movq -0x10(%rbp), %rax
movl $0x1, 0x8(%rax)
jmp 0x586d
movq -0x10(%rbp), %rax
movl $0x0, 0x4(%rax)
movq -0x10(%rbp), %rax
movl $0x1, 0x8(%rax)
jmp 0x586d
movq -0x10(%rbp), %rax
movl $0x0, 0x8(%rax)
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/aap[P]rx-0/ww1/mach.c
// Function: simthread
void*
simthread(void *arg)
{
	WWI *ww = (WWI*)arg;
	Msg msg;
	for(;;){
		switch(channbrecv(cmdchan, &msg)){
		case -1:	// channel closed
			return nil;
		case 0:	break;	// nothing
		case 1:
			handlemsg(ww, msg);
			break;
		}

		if(ww->run){
			step(ww);
			if(ww->order_by_order)
				ww->run = 0;
		}else
			usleep(1000);

		handleio(ww);
	}
	return nil;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x10(%rbp)
movq 0xccdd(%rip), %rdi      # 0x12768
leaq -0x18(%rbp), %rsi
callq 0x4910
movl %eax, %ecx
movl %ecx, -0x1c(%rbp)
subl $-0x1, %eax
je 0x5ab3
jmp 0x5aa0
movl -0x1c(%rbp), %eax
testl %eax, %eax
je 0x5abb
jmp 0x5aa9
movl -0x1c(%rbp), %eax
subl $0x1, %eax
je 0x5abd
jmp 0x5aca
xorl %eax, %eax
addq $0x20, %rsp
popq %rbp
retq
jmp 0x5aca
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x57e0
movq -0x10(%rbp), %rax
cmpl $0x0, 0x8(%rax)
je 0x5af4
movq -0x10(%rbp), %rdi
callq 0x5b10
movq -0x10(%rbp), %rax
cmpl $0x0, 0x4(%rax)
je 0x5af2
movq -0x10(%rbp), %rax
movl $0x0, 0x8(%rax)
jmp 0x5afe
movl $0x3e8, %edi            # imm = 0x3E8
callq 0x2420
movq -0x10(%rbp), %rdi
callq 0x5870
jmp 0x5a84
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/aap[P]rx-0/ww1/mach.c
// Function: consthread
void*
consthread(void *arg)
{
	WWI *ww = (WWI*)arg;
	FILE *f;
	f = fdopen(ww->console_fd, "w");

	for(;;){
		fprintf(f, "\033[1J\033[H");	// clear
		fprintf(f, "CS/%02o\n", ww->cs);
		fprintf(f, "PC/%04o\n", ww->pc);
		fprintf(f, "PR/%06o\n", ww->par);
		fprintf(f, "AC/%06o\n", ww->ac);
		fprintf(f, "AR/%06o\n", ww->ar);
		fprintf(f, "BR/%06o\n", ww->br);
		usleep(50000);
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rax
movl 0x10f0(%rax), %edi
leaq 0x22d8(%rip), %rsi      # 0x94dd
callq 0x2280
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rdi
leaq 0x22c6(%rip), %rsi      # 0x94df
movb $0x0, %al
callq 0x21d0
movq -0x18(%rbp), %rdi
movq -0x10(%rbp), %rax
movzwl 0x14(%rax), %edx
leaq 0x22b4(%rip), %rsi      # 0x94e7
movb $0x0, %al
callq 0x21d0
movq -0x18(%rbp), %rdi
movq -0x10(%rbp), %rax
movzwl 0x10(%rax), %edx
leaq 0x22a3(%rip), %rsi      # 0x94f0
movb $0x0, %al
callq 0x21d0
movq -0x18(%rbp), %rdi
movq -0x10(%rbp), %rax
movzwl 0x109c(%rax), %edx
leaq 0x228f(%rip), %rsi      # 0x94f9
movb $0x0, %al
callq 0x21d0
movq -0x18(%rbp), %rdi
movq -0x10(%rbp), %rax
movzwl 0x10a8(%rax), %edx
leaq 0x227b(%rip), %rsi      # 0x9502
movb $0x0, %al
callq 0x21d0
movq -0x18(%rbp), %rdi
movq -0x10(%rbp), %rax
movzwl 0x10a0(%rax), %edx
leaq 0x2267(%rip), %rsi      # 0x950b
movb $0x0, %al
callq 0x21d0
movq -0x18(%rbp), %rdi
movq -0x10(%rbp), %rax
movzwl 0x10ac(%rax), %edx
leaq 0x2253(%rip), %rsi      # 0x9514
movb $0x0, %al
callq 0x21d0
movl $0xc350, %edi           # imm = 0xC350
callq 0x2420
jmp 0x720e
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/aap[P]rx-0/ww1/mach.c
// Function: cpu_start
void
cpu_start(Addr a)
{
	Msg msg;
	msg.cmd = CMD_SET_PC;
	msg.arg = a;
	chansend(cmdchan, &msg);
	msg.cmd = CMD_RUN;
	chansend(cmdchan, &msg);
	chansend(cmdchan, &msg_none);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movw %di, %ax
movw %ax, -0x2(%rbp)
movl $0x1, -0xc(%rbp)
movzwl -0x2(%rbp), %eax
movl %eax, -0x8(%rbp)
movq 0xb464(%rip), %rdi      # 0x12768
leaq -0xc(%rbp), %rsi
callq 0x4560
movl $0x3, -0xc(%rbp)
movq 0xb44d(%rip), %rdi      # 0x12768
leaq -0xc(%rbp), %rsi
callq 0x4560
movq 0xb43d(%rip), %rdi      # 0x12768
leaq 0xb43e(%rip), %rsi      # 0x12770
callq 0x4560
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/aap[P]rx-0/ww1/mach.c
// Function: cpu_setpc
void
cpu_setpc(Addr pc)
{
	Msg msg;
	msg.cmd = CMD_SET_PC;
	msg.arg = pc;
	chansend(cmdchan, &msg);
	chansend(cmdchan, &msg_none);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movw %di, %ax
movw %ax, -0x2(%rbp)
movl $0x1, -0xc(%rbp)
movzwl -0x2(%rbp), %eax
movl %eax, -0x8(%rbp)
movq 0xb404(%rip), %rdi      # 0x12768
leaq -0xc(%rbp), %rsi
callq 0x4560
movq 0xb3f4(%rip), %rdi      # 0x12768
leaq 0xb3f5(%rip), %rsi      # 0x12770
callq 0x4560
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/aap[P]rx-0/ww1/mach.c
// Function: readstore
static word
readstore(WWI *ww)
{
	if(MS_SELECT(ww->ss))
		return ww->par;
	else if(IS_FF(ww->ss))
		return ww->ffs[ww->ss & 037];
	else
		return ww->tss[ww->ss & 037];
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movzwl 0x16(%rax), %eax
andl $0xffe0, %eax           # imm = 0xFFE0
cmpl $0x0, %eax
je 0x76eb
movq -0x10(%rbp), %rax
movw 0x109c(%rax), %ax
movw %ax, -0x2(%rbp)
jmp 0x773f
movq -0x10(%rbp), %rax
movl 0x18(%rax), %eax
movq -0x10(%rbp), %rcx
movzwl 0x16(%rcx), %ecx
andl $0x1f, %ecx
shrl %cl, %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x7724
movq -0x10(%rbp), %rax
movq -0x10(%rbp), %rcx
movzwl 0x16(%rcx), %ecx
andl $0x1f, %ecx
movslq %ecx, %rcx
movw 0x1c(%rax,%rcx,2), %ax
movw %ax, -0x2(%rbp)
jmp 0x773f
movq -0x10(%rbp), %rax
movq -0x10(%rbp), %rcx
movzwl 0x16(%rcx), %ecx
andl $0x1f, %ecx
movslq %ecx, %rcx
movw 0x5c(%rax,%rcx,2), %ax
movw %ax, -0x2(%rbp)
movw -0x2(%rbp), %ax
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/aap[P]rx-0/ww1/mach.c
// Function: decode_ios
static void
decode_ios(WWI *ww)
{
	ww->ioc_out = 1;	// or 0?
	ww->active_unit = nil;
	switch(ww->ios>>6 & 7){
	case 0: si_misc(ww); break;
	case 1: si_mt(ww); break;
	case 2: si_pt(ww); break;
	case 3: si_int_regs(ww); break;
	case 4: si_mite(ww); break;
	case 5: si_ind_lights(ww); break;	// earlier camera
	case 6: si_scope(ww); break;
	case 7: si_drum(ww); break;
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movl $0x1, 0x10bc(%rax)
movq -0x8(%rbp), %rax
movq $0x0, 0x10d0(%rax)
movq -0x8(%rbp), %rax
movl 0x10c8(%rax), %eax
shrl $0x6, %eax
andl $0x7, %eax
movl %eax, %ecx
movq %rcx, -0x10(%rbp)
subl $0x7, %eax
ja 0x77fe
movq -0x10(%rbp), %rax
leaq 0x1cb5(%rip), %rcx      # 0x9454
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq -0x8(%rbp), %rdi
callq 0x5430
jmp 0x77fe
movq -0x8(%rbp), %rdi
callq 0x5470
jmp 0x77fe
movq -0x8(%rbp), %rdi
callq 0x5480
jmp 0x77fe
movq -0x8(%rbp), %rdi
callq 0x54d0
jmp 0x77fe
movq -0x8(%rbp), %rdi
callq 0x54e0
jmp 0x77fe
movq -0x8(%rbp), %rdi
callq 0x54f0
jmp 0x77fe
movq -0x8(%rbp), %rdi
callq 0x5500
jmp 0x77fe
movq -0x8(%rbp), %rdi
callq 0x5530
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/aap[P]rx-0/ww1/mach.c
// Function: special_carry
static void
special_carry(WWI *ww)
{
	if(ww->ac0_carry) ww->ac |= 1;
	if(ww->sam) ww->ac |= ~1;
	ww->ac0_carry = 0;
	ww->sam = 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
cmpw $0x0, 0x10ae(%rax)
je 0x78db
movq -0x8(%rbp), %rax
movzwl 0x10a8(%rax), %ecx
orl $0x1, %ecx
movw %cx, 0x10a8(%rax)
movq -0x8(%rbp), %rax
cmpw $0x0, 0x10b0(%rax)
je 0x78fe
movq -0x8(%rbp), %rax
movzwl 0x10a8(%rax), %ecx
orl $-0x2, %ecx
movw %cx, 0x10a8(%rax)
movq -0x8(%rbp), %rax
movw $0x0, 0x10ae(%rax)
movq -0x8(%rbp), %rax
movw $0x0, 0x10b0(%rax)
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/aap[P]rx-0/ww1/mach.c
// Function: carry
static void
carry(WWI *ww)
{
	int s = ww->ac + (ww->cry<<1);
	if(s & 0200000)
		s++;
	// overflow
	ww->ac0_carry = SGN(~ww->ac) && SGN(s^ww->cry);
	ww->ac = s;
	ww->cry = 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movzwl 0x10a8(%rax), %eax
movq -0x8(%rbp), %rcx
movzwl 0x10aa(%rcx), %ecx
shll %ecx
addl %ecx, %eax
movl %eax, -0xc(%rbp)
movl -0xc(%rbp), %eax
andl $0x10000, %eax          # imm = 0x10000
cmpl $0x0, %eax
je 0x795b
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
movq -0x8(%rbp), %rax
movzwl 0x10a8(%rax), %ecx
xorl $-0x1, %ecx
andl $0x8000, %ecx           # imm = 0x8000
xorl %eax, %eax
cmpl $0x0, %ecx
movb %al, -0xd(%rbp)
je 0x7997
movl -0xc(%rbp), %eax
movq -0x8(%rbp), %rcx
movzwl 0x10aa(%rcx), %ecx
xorl %ecx, %eax
andl $0x8000, %eax           # imm = 0x8000
cmpl $0x0, %eax
setne %al
movb %al, -0xd(%rbp)
movb -0xd(%rbp), %al
andb $0x1, %al
movzbl %al, %eax
movw %ax, %cx
movq -0x8(%rbp), %rax
movw %cx, 0x10ae(%rax)
movl -0xc(%rbp), %eax
movw %ax, %cx
movq -0x8(%rbp), %rax
movw %cx, 0x10a8(%rax)
movq -0x8(%rbp), %rax
movw $0x0, 0x10aa(%rax)
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/aap[P]rx-0/ww1/mach.c
// Function: shift_carry
static void
shift_carry(WWI *ww)
{
	// Apply carry once and shift AR:BR right
	ww->br = ww->ac<<15 | ww->br>>1;
	ww->ac >>= 1;
	ww->ac ^= ww->cry;
	ww->cry &= ww->ac ^ ww->cry;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movzwl 0x10a8(%rax), %eax
shll $0xf, %eax
movq -0x8(%rbp), %rcx
movzwl 0x10ac(%rcx), %ecx
sarl %ecx
orl %ecx, %eax
movw %ax, %cx
movq -0x8(%rbp), %rax
movw %cx, 0x10ac(%rax)
movq -0x8(%rbp), %rax
movzwl 0x10a8(%rax), %ecx
sarl %ecx
movw %cx, 0x10a8(%rax)
movq -0x8(%rbp), %rax
movzwl 0x10aa(%rax), %edx
movq -0x8(%rbp), %rax
movzwl 0x10a8(%rax), %ecx
xorl %edx, %ecx
movw %cx, 0x10a8(%rax)
movq -0x8(%rbp), %rax
movzwl 0x10a8(%rax), %edx
movq -0x8(%rbp), %rax
movzwl 0x10aa(%rax), %eax
xorl %eax, %edx
movq -0x8(%rbp), %rax
movzwl 0x10aa(%rax), %ecx
andl %edx, %ecx
movw %cx, 0x10aa(%rax)
popq %rbp
retq
nopw %cs:(%rax,%rax)