#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 EXIT_SUCCESS;
scalar_t__ fscanf(int /*<<< orphan*/, char *, int *, int *);
int /*<<< orphan*/ printf(char *, int, int);
int /*<<< orphan*/ stdin;
int /*<<< orphan*/ swap_numbers(int *, int *);
int main(void) {
  int a, b;
  while (fscanf(stdin, "%d %d", &a, &b) > 0) {
    swap_numbers(&a, &b);
    printf("%d %d\n", a, b);
  }
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2ea2(%rip),%rax
mov    (%rax),%edi
lea    0xeb1(%rip),%rsi
lea    -0x8(%rbp),%rdx
lea    -0xc(%rbp),%rcx
call   1050 <fscanf@plt>
cmp    $0x0,%rax
jle    118a <main+0x5a>
lea    -0x8(%rbp),%rdi
lea    -0xc(%rbp),%rsi
call   1040 <swap_numbers@plt>
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    0xe86(%rip),%rdi
call   1030 <printf@plt>
jmp    113f <main+0xf>
mov    0x2e47(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x10,%rsp
mov    0x2ea4(%rip),%r13
mov    0x0(%r13),%edi
lea    0xeb1(%rip),%rsi
lea    0xc(%rsp),%rdx
lea    0x8(%rsp),%rcx
call   1050 <fscanf@plt>
test   %rax,%rax
jle    11b2 <main+0x82>
lea    0xc(%rsp),%r14
lea    0x8(%rsp),%rbx
lea    0xe92(%rip),%r15
lea    0xe85(%rip),%r12
nopl   0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <swap_numbers@plt>
mov    0xc(%rsp),%esi
mov    0x8(%rsp),%edx
mov    %r15,%rdi
call   1030 <printf@plt>
mov    0x0(%r13),%edi
mov    %r12,%rsi
mov    %r14,%rdx
mov    %rbx,%rcx
call   1050 <fscanf@plt>
test   %rax,%rax
jg     1180 <main+0x50>
mov    0x2e1f(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@stdin = global i32 0
@.str = [6 x i8] c"%d %d\00"
@.str.1 = [7 x i8] c"%d %d\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
br label %4
4: ; preds = %8, %0
%5 = load i32, i32* @stdin
%6 = call i64 @fscanf(i32 %5, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %2, i32* %3)
%7 = icmp sgt i64 %6, 0
br i1 %7, label %8, label %13
8: ; preds = %4
%9 = call i32 @swap_numbers(i32* %2, i32* %3)
%10 = load i32, i32* %2
%11 = load i32, i32* %3
%12 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 %10, i32 %11)
br label %4
13: ; preds = %4
%14 = load i32, i32* @EXIT_SUCCESS
ret i32 %14
}

LLVM IR (-O2):
@stdin = global i32 0
@.str = [6 x i8] c"%d %d\00"
@.str.1 = [7 x i8] c"%d %d\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = load i32, i32* @stdin
%6 = call i64 @fscanf(i32 %5, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2)
%7 = icmp sgt i64 %6, 0
br i1 %7, label %8, label %16
8: ; preds = %0, %8
%9 = call i32 @swap_numbers(i32* %1, i32* %2)
%10 = load i32, i32* %1
%11 = load i32, i32* %2
%12 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 %10, i32 %11)
%13 = load i32, i32* @stdin
%14 = call i64 @fscanf(i32 %13, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2)
%15 = icmp sgt i64 %14, 0
br i1 %15, label %8, label %16
16: ; preds = %8, %0
%17 = load i32, i32* @EXIT_SUCCESS
ret i32 %17
}