#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 */
typedef int /*<<< orphan*/ jmp_buf;

/* Variables and functions */
double diva(double, double);
int /*<<< orphan*/ longjmp(int /*<<< orphan*/, int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, double *);
int setjmp(int /*<<< orphan*/);
int main() {
  double a, b, result;
  printf("请输入第一个数字：");
  scanf("%lf", &a);
  printf("请输入第二个数字：");
  scanf("%lf", &b);
  do {
    jmp_buf ex_buf__;
    switch (setjmp(ex_buf__)) {
    case 0:
      while (1) {
        {
          if (0 == b)
            longjmp(ex_buf__, 1);
        }
        break;
      case 1: {
        printf("被除数不可为0");
      } break;
      }
    }
  } while (0);
  result = diva(a, b);
  printf("相除的结果是: %.2lf\n", result);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xe9a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xea8(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1060 <scanf@plt>
lea    0xe9c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe8a(%rip),%rdi
lea    -0x18(%rbp),%rsi
call   1060 <scanf@plt>
mov    -0x24(%rbp),%edi
call   1050 <setjmp@plt>
mov    %eax,%ecx
mov    %ecx,-0x28(%rbp)
test   %eax,%eax
je     11c6 <main+0x76>
jmp    11b5 <main+0x65>
mov    -0x28(%rbp),%eax
sub    $0x1,%eax
je     11f1 <main+0xa1>
jmp    1204 <main+0xb4>
jmp    11cb <main+0x7b>
xorps  %xmm0,%xmm0
ucomisd -0x18(%rbp),%xmm0
jne    11ec <main+0x9c>
jp     11ec <main+0x9c>
mov    -0x24(%rbp),%edi
mov    $0x1,%esi
call   1070 <longjmp@plt>
jmp    11ff <main+0xaf>
lea    0xe44(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1204 <main+0xb4>
jmp    1209 <main+0xb9>
movsd  -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
call   1040 <diva@plt>
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
lea    0xe27(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x18,%rsp
lea    0xea2(%rip),%rdi
xor    %eax,%eax
mov    %eax,%ebx
call   1030 <printf@plt>
lea    0xeae(%rip),%r14
lea    0x10(%rsp),%rsi
mov    %r14,%rdi
call   1060 <scanf@plt>
lea    0xe9e(%rip),%rdi
mov    %ebx,%eax
call   1030 <printf@plt>
lea    0x8(%rsp),%rsi
mov    %r14,%rdi
call   1060 <scanf@plt>
call   1050 <setjmp@plt>
cmp    $0x1,%eax
je     11c0 <main+0x70>
test   %eax,%eax
jne    11ce <main+0x7e>
movsd  0x8(%rsp),%xmm0
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    11ce <main+0x7e>
jp     11ce <main+0x7e>
mov    $0x1,%esi
call   1070 <longjmp@plt>
lea    0xe75(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
movsd  0x10(%rsp),%xmm0
movsd  0x8(%rsp),%xmm1
call   1040 <diva@plt>
lea    0xe6a(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [28 x i8] c"\E8\AF\B7\E8\BE\93\E5\85\A5\E7\AC\AC\E4\B8\80\E4\B8\AA\E6\95\B0\E5\AD\97\EF\BC\9A\00"
@.str.1 = [4 x i8] c"%lf\00"
@.str.2 = [28 x i8] c"\E8\AF\B7\E8\BE\93\E5\85\A5\E7\AC\AC\E4\BA\8C\E4\B8\AA\E6\95\B0\E5\AD\97\EF\BC\9A\00"
@.str.3 = [20 x i8] c"\E8\A2\AB\E9\99\A4\E6\95\B0\E4\B8\8D\E5\8F\AF\E4\B8\BA0\00"
@.str.4 = [27 x i8] c"\E7\9B\B8\E9\99\A4\E7\9A\84\E7\BB\93\E6\9E\9C\E6\98\AF: %.2lf\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
%3 = alloca double
%4 = alloca double
%5 = alloca i32
store i32 0, i32* %1
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %2)
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.2, i64 0, i64 0))
%9 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %3)
br label %10
10: ; preds = %0
%11 = load i32, i32* %5
%12 = call i32 @setjmp(i32 %11)
switch i32 %12, label %24 [
i32 0, label %13
i32 1, label %21
]
13: ; preds = %10
br label %14
14: ; preds = %13
%15 = load double, double* %3
%16 = fcmp oeq double 0.000000e+00, %15
br i1 %16, label %17, label %20
17: ; preds = %14
%18 = load i32, i32* %5
%19 = call i32 @longjmp(i32 %18, i32 1)
unreachable
20: ; preds = %14
br label %23
21: ; preds = %10
%22 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.3, i64 0, i64 0))
br label %23
23: ; preds = %21, %20
br label %24
24: ; preds = %23, %10
br label %25
25: ; preds = %24
%26 = load double, double* %2
%27 = load double, double* %3
%28 = call double @diva(double %26, double %27)
store double %28, double* %4
%29 = load double, double* %4
%30 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.4, i64 0, i64 0), double %29)
ret i32 0
}

LLVM IR (-O2):
@.str = [28 x i8] c"\E8\AF\B7\E8\BE\93\E5\85\A5\E7\AC\AC\E4\B8\80\E4\B8\AA\E6\95\B0\E5\AD\97\EF\BC\9A\00"
@.str.1 = [4 x i8] c"%lf\00"
@.str.2 = [28 x i8] c"\E8\AF\B7\E8\BE\93\E5\85\A5\E7\AC\AC\E4\BA\8C\E4\B8\AA\E6\95\B0\E5\AD\97\EF\BC\9A\00"
@.str.3 = [20 x i8] c"\E8\A2\AB\E9\99\A4\E6\95\B0\E4\B8\8D\E5\8F\AF\E4\B8\BA0\00"
@.str.4 = [27 x i8] c"\E7\9B\B8\E9\99\A4\E7\9A\84\E7\BB\93\E6\9E\9C\E6\98\AF: %.2lf\0A\00"
define i32 @main() {
%1 = alloca double
%2 = alloca double
%3 = bitcast double* %1 to i8*
%4 = bitcast double* %2 to i8*
%5 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %1)
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str.2, i64 0, i64 0))
%8 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %2)
%9 = call i32 @setjmp(i32 undef)
switch i32 %9, label %17 [
i32 0, label %10
i32 1, label %15
]
10: ; preds = %0
%11 = load double, double* %2
%12 = fcmp oeq double %11, 0.000000e+00
br i1 %12, label %13, label %17
13: ; preds = %10
%14 = call i32 @longjmp(i32 undef, i32 1)
unreachable
15: ; preds = %0
%16 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.3, i64 0, i64 0))
br label %17
17: ; preds = %15, %10, %0
%18 = load double, double* %1
%19 = load double, double* %2
%20 = call double @diva(double %18, double %19)
%21 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.4, i64 0, i64 0), double %20)
ret i32 0
}