#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*/ fprintf(int /*<<< orphan*/, char *, char const *, int,
                           char const *);
int /*<<< orphan*/ stderr;
void print_help(const char *self) {
  fprintf(
      stderr,
      "  Userspace I2C utility for: Maxim DS1307 RTC\n  (C) Chi Zhang "
      "(dword1511) <zhangchi866@gmail.com>\n  \n  Usage:\n    %s -b <bus "
      "number> [list of operations]\n  \n  Operations will be carried out in "
      "argument list order.\n  Bus number and address can be overrided in the "
      "middle of the list.\n  \n  List of operations:\n    -1      : set "
      "12-hour format.\n    -2      : set 24-hour format.\n    -a <int>: "
      "override device address (default: 0x%02x, in range 0x03 to 0x7f).\n     "
      "         NOTE: this value will NOT be reset to default after "
      "switching\n                    bus.\n              WARN: use this "
      "option only when you know what you are doing!\n    -b <int>: set bus "
      "number (must be set prior to any operations).\n              NOTE: you "
      "can use `i2cdetect -l' to list I2C buses present in the\n               "
      "     system.\n    -c      : chip sanity check.\n    -d      : dump "
      "on-chip NV SRAM.\n              NOTE: it is normal for some bits to be "
      "1 after power-on-reset.\n    -D      : dump all registers, for "
      "debugging.\n    -g      : get current square wave output settings.\n    "
      "-h      : clear halt bit (start the clock).\n    -H      : set halt bit "
      "(pause the clock).\n    -p      : print current date and time in the "
      "device.\n    -s <int>: set square wave output settings:\n               "
      " 0 = constantly low;\n                1 = constantly high;\n            "
      "    2 =     1Hz;\n                3 =  4096Hz;\n                4 =  "
      "8192Hz;\n                5 = 32768Hz.\n    -S      : synchronize chip "
      "time to system time.\n              NOTE: 12/24-hour mode and halting "
      "will be perserved.\n    -t      : test on-chip NV SRAM.\n              "
      "NOTE: The chip may go offline during the process, you will need\n       "
      "             to reset the chip manually. Suggest halting the clock\n    "
      "                before checking to avoid possible hardware bugs.\n  \n  "
      "Example:\n    Print date and time in the DS1307 on i2c-1:\n      %s -b "
      "1 -h -p\n  \n",
      self, (0x68), self);
}


x86 assembly (clang, -O0):
<print_help>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
mov    -0x8(%rbp),%r8
lea    0xecc(%rip),%rsi
mov    $0x68,%ecx
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_help>:
mov    %rdi,%rdx
mov    0x2ec6(%rip),%rax
mov    (%rax),%edi
lea    0xedd(%rip),%rsi
mov    $0x68,%ecx
mov    %rdx,%r8
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [1907 x i8] c" Userspace I2C utility for: Maxim DS1307 RTC\0A (C) Chi Zhang (dword1511) <zhangchi866@gmail.com>\0A \0A Usage:\0A %s -b <bus number> [list of operations]\0A \0A Operations will be carried out in argument list order.\0A Bus number and address can be overrided in the middle of the list.\0A \0A List of operations:\0A -1 : set 12-hour format.\0A -2 : set 24-hour format.\0A -a <int>: override device address (default: 0x%02x, in range 0x03 to 0x7f).\0A NOTE: this value will NOT be reset to default after switching\0A bus.\0A WARN: use this option only when you know what you are doing!\0A -b <int>: set bus number (must be set prior to any operations).\0A NOTE: you can use `i2cdetect -l' to list I2C buses present in the\0A system.\0A -c : chip sanity check.\0A -d : dump on-chip NV SRAM.\0A NOTE: it is normal for some bits to be 1 after power-on-reset.\0A -D : dump all registers, for debugging.\0A -g : get current square wave output settings.\0A -h : clear halt bit (start the clock).\0A -H : set halt bit (pause the clock).\0A -p : print current date and time in the device.\0A -s <int>: set square wave output settings:\0A 0 = constantly low;\0A 1 = constantly high;\0A 2 = 1Hz;\0A 3 = 4096Hz;\0A 4 = 8192Hz;\0A 5 = 32768Hz.\0A -S : synchronize chip time to system time.\0A NOTE: 12/24-hour mode and halting will be perserved.\0A -t : test on-chip NV SRAM.\0A NOTE: The chip may go offline during the process, you will need\0A to reset the chip manually. Suggest halting the clock\0A before checking to avoid possible hardware bugs.\0A \0A Example:\0A Print date and time in the DS1307 on i2c-1:\0A %s -b 1 -h -p\0A \0A\00"
define void @print_help(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = load i8*, i8** %2
%6 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([1907 x i8], [1907 x i8]* @.str, i64 0, i64 0), i8* %4, i32 104, i8* %5)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [1907 x i8] c" Userspace I2C utility for: Maxim DS1307 RTC\0A (C) Chi Zhang (dword1511) <zhangchi866@gmail.com>\0A \0A Usage:\0A %s -b <bus number> [list of operations]\0A \0A Operations will be carried out in argument list order.\0A Bus number and address can be overrided in the middle of the list.\0A \0A List of operations:\0A -1 : set 12-hour format.\0A -2 : set 24-hour format.\0A -a <int>: override device address (default: 0x%02x, in range 0x03 to 0x7f).\0A NOTE: this value will NOT be reset to default after switching\0A bus.\0A WARN: use this option only when you know what you are doing!\0A -b <int>: set bus number (must be set prior to any operations).\0A NOTE: you can use `i2cdetect -l' to list I2C buses present in the\0A system.\0A -c : chip sanity check.\0A -d : dump on-chip NV SRAM.\0A NOTE: it is normal for some bits to be 1 after power-on-reset.\0A -D : dump all registers, for debugging.\0A -g : get current square wave output settings.\0A -h : clear halt bit (start the clock).\0A -H : set halt bit (pause the clock).\0A -p : print current date and time in the device.\0A -s <int>: set square wave output settings:\0A 0 = constantly low;\0A 1 = constantly high;\0A 2 = 1Hz;\0A 3 = 4096Hz;\0A 4 = 8192Hz;\0A 5 = 32768Hz.\0A -S : synchronize chip time to system time.\0A NOTE: 12/24-hour mode and halting will be perserved.\0A -t : test on-chip NV SRAM.\0A NOTE: The chip may go offline during the process, you will need\0A to reset the chip manually. Suggest halting the clock\0A before checking to avoid possible hardware bugs.\0A \0A Example:\0A Print date and time in the DS1307 on i2c-1:\0A %s -b 1 -h -p\0A \0A\00"
define void @print_help(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([1907 x i8], [1907 x i8]* @.str, i64 0, i64 0), i8* %0, i32 104, i8* %0)
ret void
}