#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 USPS4CB(char *, char *, char *);
int /*<<< orphan*/ gets(char *);
int /*<<< orphan*/ printf(char *, ...);
int main() {
  char IMBcode[65];
  char RoutingCode[11];
  char TrackingCode[20];
  int ReturnCode;
  float version = 1.2;
  printf("USPS IMB encoder version: %f\n", version);
  printf("Enter Routing code:\n");
  printf("> ");
  gets(RoutingCode);
  printf("Enter Tracking code:\n");
  printf("> ");
  gets(TrackingCode);
  ReturnCode = USPS4CB(TrackingCode, RoutingCode, IMBcode);
  printf("Return Code: %d\n", ReturnCode);
  printf("IMB code:\n");
  printf(IMBcode);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
movss  0xebd(%rip),%xmm0
movss  %xmm0,-0x78(%rbp)
movss  -0x78(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xeac(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
lea    0xebc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xec3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x5b(%rbp),%rdi
call   1050 <gets@plt>
lea    0xeaf(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe9e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x70(%rbp),%rdi
call   1050 <gets@plt>
lea    -0x70(%rbp),%rdi
lea    -0x5b(%rbp),%rsi
lea    -0x50(%rbp),%rdx
call   1040 <USPS4CB@plt>
mov    %eax,-0x74(%rbp)
mov    -0x74(%rbp),%esi
lea    0xe89(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe8c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x50(%rbp),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x80,%rsp
lea    0xeb5(%rip),%rdi
movsd  0xea5(%rip),%xmm0
mov    $0x1,%al
call   1040 <printf@plt>
lea    0xed1(%rip),%rdi
call   1030 <puts@plt>
lea    0xeb1(%rip),%rbx
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0x5(%rsp),%r14
mov    %r14,%rdi
call   1060 <gets@plt>
lea    0xebb(%rip),%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0x10(%rsp),%rbx
mov    %rbx,%rdi
call   1060 <gets@plt>
lea    0x30(%rsp),%r15
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
call   1050 <USPS4CB@plt>
lea    0xe60(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xe8a(%rip),%rdi
call   1030 <puts@plt>
mov    %r15,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x80,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [30 x i8] c"USPS IMB encoder version: %f\0A\00"
@.str.1 = [21 x i8] c"Enter Routing code:\0A\00"
@.str.2 = [3 x i8] c"> \00"
@.str.3 = [22 x i8] c"Enter Tracking code:\0A\00"
@.str.4 = [17 x i8] c"Return Code: %d\0A\00"
@.str.5 = [11 x i8] c"IMB code:\0A\00"
define i32 @main() {
%1 = alloca [65 x i8]
%2 = alloca [11 x i8]
%3 = alloca [20 x i8]
%4 = alloca i32
%5 = alloca float
store float 0x3FF3333340000000, float* %5
%6 = load float, float* %5
%7 = fpext float %6 to double
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), double %7)
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0))
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%11 = getelementptr inbounds [11 x i8], [11 x i8]* %2, i64 0, i64 0
%12 = call i32 @gets(i8* %11)
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.3, i64 0, i64 0))
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%15 = getelementptr inbounds [20 x i8], [20 x i8]* %3, i64 0, i64 0
%16 = call i32 @gets(i8* %15)
%17 = getelementptr inbounds [20 x i8], [20 x i8]* %3, i64 0, i64 0
%18 = getelementptr inbounds [11 x i8], [11 x i8]* %2, i64 0, i64 0
%19 = getelementptr inbounds [65 x i8], [65 x i8]* %1, i64 0, i64 0
%20 = call i32 @USPS4CB(i8* %17, i8* %18, i8* %19)
store i32 %20, i32* %4
%21 = load i32, i32* %4
%22 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.4, i64 0, i64 0), i32 %21)
%23 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.5, i64 0, i64 0))
%24 = getelementptr inbounds [65 x i8], [65 x i8]* %1, i64 0, i64 0
%25 = call i32 (i8*, ...) @printf(i8* %24)
ret i32 0
}

LLVM IR (-O2):
@.str = [30 x i8] c"USPS IMB encoder version: %f\0A\00"
@.str.2 = [3 x i8] c"> \00"
@.str.4 = [17 x i8] c"Return Code: %d\0A\00"
@str = [20 x i8] c"Enter Routing code:\00"
@str.6 = [21 x i8] c"Enter Tracking code:\00"
@str.7 = [10 x i8] c"IMB code:\00"
define i32 @main() {
%1 = alloca [65 x i8]
%2 = alloca [11 x i8]
%3 = alloca [20 x i8]
%4 = getelementptr inbounds [65 x i8], [65 x i8]* %1, i64 0, i64 0
%5 = getelementptr inbounds [11 x i8], [11 x i8]* %2, i64 0, i64 0
%6 = getelementptr inbounds [20 x i8], [20 x i8]* %3, i64 0, i64 0
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), double 0x3FF3333340000000)
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
%9 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%10 = call i32 @gets(i8* %5)
%11 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str.6, i64 0, i64 0))
%12 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%13 = call i32 @gets(i8* %6)
%14 = call i32 @USPS4CB(i8* %6, i8* %5, i8* %4)
%15 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.4, i64 0, i64 0), i32 %14)
%16 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @str.7, i64 0, i64 0))
%17 = call i32 (i8*, ...) @printf(i8* %4)
ret i32 0
}