#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 Ext_Euclid_Gcd(int, int, int *, int *);
int /*<<< orphan*/ printf(char *, int, int, int, int, ...);
int main() {
  int x, y;
  int a = 400, b = 577;
  printf("贝祖等式 %dx + %dy = gcd(%d, %d)\n", a, b, a, b);
  printf("gcd(%d,%d)=%d,\tx=%d, y=%d", a, b, Ext_Euclid_Gcd(a, b, &x, &y), x,
         y);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x190,-0xc(%rbp)
movl   $0x241,-0x10(%rbp)
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0xc(%rbp),%ecx
mov    -0x10(%rbp),%r8d
lea    0xeb6(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0xc(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0xc(%rbp),%edi
mov    -0x10(%rbp),%esi
lea    -0x4(%rbp),%rdx
lea    -0x8(%rbp),%rcx
call   1030 <Ext_Euclid_Gcd@plt>
mov    -0x18(%rbp),%esi
mov    -0x14(%rbp),%edx
mov    %eax,%ecx
mov    -0x4(%rbp),%r8d
mov    -0x8(%rbp),%r9d
lea    0xe9f(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
mov    $0x190,%esi
mov    $0x241,%edx
mov    $0x190,%ecx
mov    $0x241,%r8d
xor    %eax,%eax
call   1040 <printf@plt>
lea    0x4(%rsp),%rdx
mov    %rsp,%rcx
mov    $0x190,%edi
mov    $0x241,%esi
call   1030 <Ext_Euclid_Gcd@plt>
mov    0x4(%rsp),%r8d
mov    (%rsp),%r9d
lea    0xebb(%rip),%rdi
mov    $0x190,%esi
mov    $0x241,%edx
mov    %eax,%ecx
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [38 x i8] c"\E8\B4\9D\E7\A5\96\E7\AD\89\E5\BC\8F %dx + %dy = gcd(%d, %d)\0A\00"
@.str.1 = [26 x i8] c"gcd(%d,%d)=%d,\09x=%d, y=%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 400, i32* %3
store i32 577, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = load i32, i32* %3
%8 = load i32, i32* %4
%9 = call i32 (i8*, i32, i32, i32, i32, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), i32 %5, i32 %6, i32 %7, i32 %8)
%10 = load i32, i32* %3
%11 = load i32, i32* %4
%12 = load i32, i32* %3
%13 = load i32, i32* %4
%14 = call i32 @Ext_Euclid_Gcd(i32 %12, i32 %13, i32* %1, i32* %2)
%15 = load i32, i32* %1
%16 = load i32, i32* %2
%17 = call i32 (i8*, i32, i32, i32, i32, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0), i32 %10, i32 %11, i32 %14, i32 %15, i32 %16)
ret i32 0
}

LLVM IR (-O2):
@.str = [38 x i8] c"\E8\B4\9D\E7\A5\96\E7\AD\89\E5\BC\8F %dx + %dy = gcd(%d, %d)\0A\00"
@.str.1 = [26 x i8] c"gcd(%d,%d)=%d,\09x=%d, y=%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = tail call i32 (i8*, i32, i32, i32, i32, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), i32 400, i32 577, i32 400, i32 577)
%6 = call i32 @Ext_Euclid_Gcd(i32 400, i32 577, i32* %1, i32* %2)
%7 = load i32, i32* %1
%8 = load i32, i32* %2
%9 = call i32 (i8*, i32, i32, i32, i32, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0), i32 400, i32 577, i32 %6, i32 %7, i32 %8)
ret i32 0
}