#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*/ print_buffer(long *, size_t);
int /*<<< orphan*/ put_differences(long *, long *, size_t);
void differences_loop(long int *primary, long int *secondary, size_t size) {
  size_t i;
  for (i = 0; i < 5 / 2; i++) {
    put_differences(secondary, primary, size);
    print_buffer(secondary, size);
    put_differences(primary, secondary, size);
    print_buffer(primary, size);
  }
  if (5 % 2 == 1) {
    put_differences(secondary, primary, size);
    print_buffer(secondary, size);
  }
}


x86 assembly (clang, -O0):
<differences_loop>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
cmpq   $0x2,-0x20(%rbp)
jae    1194 <differences_loop+0x74>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <put_differences@plt>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <print_buffer@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <put_differences@plt>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <print_buffer@plt>
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    113c <differences_loop+0x1c>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <put_differences@plt>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <print_buffer@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<differences_loop>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%rbx
mov    %rsi,%r14
mov    %rdi,%r15
mov    %rsi,%rdi
mov    %r15,%rsi
call   1030 <put_differences@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <print_buffer@plt>
mov    %r15,%rdi
mov    %r14,%rsi
mov    %rbx,%rdx
call   1030 <put_differences@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
call   1040 <print_buffer@plt>
mov    %r14,%rdi
mov    %r15,%rsi
mov    %rbx,%rdx
call   1030 <put_differences@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <print_buffer@plt>
mov    %r15,%rdi
mov    %r14,%rsi
mov    %rbx,%rdx
call   1030 <put_differences@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
call   1040 <print_buffer@plt>
mov    %r14,%rdi
mov    %r15,%rsi
mov    %rbx,%rdx
call   1030 <put_differences@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
pop    %rbx
pop    %r14
pop    %r15
jmp    1040 <print_buffer@plt>

LLVM IR (-O0):
define void @differences_loop(i64* %0, i64* %1, i64 %2) {
%4 = alloca i64*
%5 = alloca i64*
%6 = alloca i64
%7 = alloca i64
store i64* %0, i64** %4
store i64* %1, i64** %5
store i64 %2, i64* %6
store i64 0, i64* %7
br label %8
8: ; preds = %26, %3
%9 = load i64, i64* %7
%10 = icmp ult i64 %9, 2
br i1 %10, label %11, label %29
11: ; preds = %8
%12 = load i64*, i64** %5
%13 = load i64*, i64** %4
%14 = load i64, i64* %6
%15 = call i32 @put_differences(i64* %12, i64* %13, i64 %14)
%16 = load i64*, i64** %5
%17 = load i64, i64* %6
%18 = call i32 @print_buffer(i64* %16, i64 %17)
%19 = load i64*, i64** %4
%20 = load i64*, i64** %5
%21 = load i64, i64* %6
%22 = call i32 @put_differences(i64* %19, i64* %20, i64 %21)
%23 = load i64*, i64** %4
%24 = load i64, i64* %6
%25 = call i32 @print_buffer(i64* %23, i64 %24)
br label %26
26: ; preds = %11
%27 = load i64, i64* %7
%28 = add i64 %27, 1
store i64 %28, i64* %7
br label %8
29: ; preds = %8
%30 = load i64*, i64** %5
%31 = load i64*, i64** %4
%32 = load i64, i64* %6
%33 = call i32 @put_differences(i64* %30, i64* %31, i64 %32)
%34 = load i64*, i64** %5
%35 = load i64, i64* %6
%36 = call i32 @print_buffer(i64* %34, i64 %35)
ret void
}

LLVM IR (-O2):
define void @differences_loop(i64* %0, i64* %1, i64 %2) {
%4 = tail call i32 @put_differences(i64* %1, i64* %0, i64 %2)
%5 = tail call i32 @print_buffer(i64* %1, i64 %2)
%6 = tail call i32 @put_differences(i64* %0, i64* %1, i64 %2)
%7 = tail call i32 @print_buffer(i64* %0, i64 %2)
%8 = tail call i32 @put_differences(i64* %1, i64* %0, i64 %2)
%9 = tail call i32 @print_buffer(i64* %1, i64 %2)
%10 = tail call i32 @put_differences(i64* %0, i64* %1, i64 %2)
%11 = tail call i32 @print_buffer(i64* %0, i64 %2)
%12 = tail call i32 @put_differences(i64* %1, i64* %0, i64 %2)
%13 = tail call i32 @print_buffer(i64* %1, i64 %2)
ret void
}