xunge/DecIR huggingface dataset:
double read_sign(const char **const sptr) {
  double sign = 1.0;
  switch (**sptr) {
  case '-':
    sign = -1.0;
    ++(*sptr);
    break;
  case '+':
    ++(*sptr);
    break;
  default:
    break;
  }
  return sign;
}


x86 assembly (clang, -O0):
<read_sign>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movabs $0x3ff0000000000000,%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movsbl (%rax),%eax
mov    %eax,-0x14(%rbp)
sub    $0x2b,%eax
je     1162 <read_sign+0x62>
jmp    1131 <read_sign+0x31>
mov    -0x14(%rbp),%eax
sub    $0x2d,%eax
jne    1175 <read_sign+0x75>
jmp    1142 <read_sign+0x42>
movsd  0xeb6(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
add    $0x1,%rcx
mov    %rcx,(%rax)
jmp    117a <read_sign+0x7a>
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
add    $0x1,%rcx
mov    %rcx,(%rax)
jmp    117a <read_sign+0x7a>
jmp    117a <read_sign+0x7a>
movsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_sign>:
mov    (%rdi),%rax
movsbl (%rax),%ecx
cmp    $0x2d,%ecx
je     1119 <read_sign+0x19>
movsd  0xef5(%rip),%xmm0
cmp    $0x2b,%ecx
je     1121 <read_sign+0x21>
ret
movsd  0xedf(%rip),%xmm0
add    $0x1,%rax
mov    %rax,(%rdi)
ret

LLVM IR (-O0):
define double @read_sign(i8** %0) {
%2 = alloca i8**
%3 = alloca double
store i8** %0, i8*** %2
store double 1.000000e+00, double* %3
%4 = load i8**, i8*** %2
%5 = load i8*, i8** %4
%6 = load i8, i8* %5
%7 = sext i8 %6 to i32
switch i32 %7, label %16 [
i32 45, label %8
i32 43, label %12
]
8: ; preds = %1
store double -1.000000e+00, double* %3
%9 = load i8**, i8*** %2
%10 = load i8*, i8** %9
%11 = getelementptr inbounds i8, i8* %10, i32 1
store i8* %11, i8** %9
br label %17
12: ; preds = %1
%13 = load i8**, i8*** %2
%14 = load i8*, i8** %13
%15 = getelementptr inbounds i8, i8* %14, i32 1
store i8* %15, i8** %13
br label %17
16: ; preds = %1
br label %17
17: ; preds = %16, %12, %8
%18 = load double, double* %3
ret double %18
}

LLVM IR (-O2):
define double @read_sign(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
switch i32 %4, label %9 [
i32 45, label %6
i32 43, label %5
]
5: ; preds = %1
br label %6
6: ; preds = %1, %5
%7 = phi double [ 1.000000e+00, %5 ], [ -1.000000e+00, %1 ]
%8 = getelementptr inbounds i8, i8* %2, i64 1
store i8* %8, i8** %0
br label %9
9: ; preds = %6, %1
%10 = phi double [ 1.000000e+00, %1 ], [ %7, %6 ]
ret double %10
}
void gtk_progress_bar_get_pulse_step() {}


x86 assembly (clang, -O0):
<gtk_progress_bar_get_pulse_step>:
push   %rbp
mov    %rsp,%rbp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gtk_progress_bar_get_pulse_step>:
ret

LLVM IR (-O0):
define void @gtk_progress_bar_get_pulse_step() {
ret void
}

LLVM IR (-O2):
define void @gtk_progress_bar_get_pulse_step() {
ret void
}
int setTerritoryCode(const char *tcode) { return -1; }


x86 assembly (clang, -O0):
<setTerritoryCode>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<setTerritoryCode>:
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
define i32 @setTerritoryCode(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
ret i32 -1
}

LLVM IR (-O2):
define i32 @setTerritoryCode(i8* nocapture readnone %0) {
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
char *getprogname();
int /*<<< orphan*/ stderr;
void usage() {
  (void)fprintf(stderr, "Usage: %s [-o +-x/] [-r range]\n", getprogname());
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ea1(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1030 <getprogname@plt>
mov    -0x4(%rbp),%edi
mov    %rax,%rdx
lea    0xea8(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rbx
mov    0x2ea8(%rip),%rax
mov    (%rax),%ebx
xor    %eax,%eax
call   1030 <getprogname@plt>
lea    0xeb8(%rip),%rsi
mov    %ebx,%edi
mov    %rax,%rdx
call   1040 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [32 x i8] c"Usage: %s [-o +-x/] [-r range]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i8* (...) @getprogname()
%3 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [32 x i8] c"Usage: %s [-o +-x/] [-r range]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i8* (...) @getprogname()
%3 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
void *r3_mem__set_secure(void *, int, unsigned int);
void *r3_mem_set_secure(void *b, int c, unsigned int len) {
  return r3_mem__set_secure(b, c, len);
}


x86 assembly (clang, -O0):
<r3_mem_set_secure>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1030 <r3_mem__set_secure@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<r3_mem_set_secure>:
jmp    1030 <r3_mem__set_secure@plt>

LLVM IR (-O0):
define i8* @r3_mem_set_secure(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i8*, i8** %4
%8 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = call i8* @r3_mem__set_secure(i8* %7, i32 %8, i32 %9)
ret i8* %10
}

LLVM IR (-O2):
define i8* @r3_mem_set_secure(i8* %0, i32 %1, i32 %2) {
%4 = tail call i8* @r3_mem__set_secure(i8* %0, i32 %1, i32 %2)
ret i8* %4
}
void devm_ioport_unmap(struct device *dev, void *addr) {}


x86 assembly (clang, -O0):
<devm_ioport_unmap>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<devm_ioport_unmap>:
ret

LLVM IR (-O0):
%struct.device = type opaque
define void @devm_ioport_unmap(%struct.device* %0, i8* %1) {
%3 = alloca %struct.device*
%4 = alloca i8*
store %struct.device* %0, %struct.device** %3
store i8* %1, i8** %4
ret void
}

LLVM IR (-O2):
%struct.device = type opaque
define void @devm_ioport_unmap(%struct.device* nocapture %0, i8* nocapture %1) {
ret void
}
void ff_hevc_put_hevc_bi_w_epel_v48_10_sse4() {}


x86 assembly (clang, -O0):
<ff_hevc_put_hevc_bi_w_epel_v48_10_sse4>:
push   %rbp
mov    %rsp,%rbp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ff_hevc_put_hevc_bi_w_epel_v48_10_sse4>:
ret

LLVM IR (-O0):
define void @ff_hevc_put_hevc_bi_w_epel_v48_10_sse4() {
ret void
}

LLVM IR (-O2):
define void @ff_hevc_put_hevc_bi_w_epel_v48_10_sse4() {
ret void
}
int overloaded2() { return 1; }


x86 assembly (clang, -O0):
<overloaded2>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<overloaded2>:
mov    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @overloaded2() {
ret i32 1
}

LLVM IR (-O2):
define i32 @overloaded2() {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ send(int, char **, int, int /*<<< orphan*/);
void emission(int ma_socket, char message[256]) {
  send(ma_socket, &message, 256, 0);
}


x86 assembly (clang, -O0):
<emission>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x10(%rbp),%rsi
mov    $0x100,%edx
xor    %ecx,%ecx
call   1030 <send@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<emission>:
push   %rax
mov    %rsi,(%rsp)
mov    %rsp,%rsi
mov    $0x100,%edx
xor    %ecx,%ecx
call   1030 <send@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @emission(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i32, i32* %3
%6 = call i32 @send(i32 %5, i8** %4, i32 256, i32 0)
ret void
}

LLVM IR (-O2):
define void @emission(i32 %0, i8* %1) {
%3 = alloca i8*
store i8* %1, i8** %3
%4 = call i32 @send(i32 %0, i8** %3, i32 256, i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_wfd_cfg_noa_usage(void) {
  printf("Usage : wfd_cfg_noa <enable|disable> <index> [<counttype> <duration> "
         "<interval>]\n");
  printf("If NOA parameters are provided, 'set' is performed otherwise 'get' "
         "is performed.\n");
  return;
}


x86 assembly (clang, -O0):
<print_wfd_cfg_noa_usage>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
lea    0xf2b(%rip),%rdi
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_wfd_cfg_noa_usage>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xf2d(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [82 x i8] c"Usage : wfd_cfg_noa <enable|disable> <index> [<counttype> <duration> <interval>]\0A\00"
@.str.1 = [82 x i8] c"If NOA parameters are provided, 'set' is performed otherwise 'get' is performed.\0A\00"
define void @print_wfd_cfg_noa_usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([82 x i8], [82 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([82 x i8], [82 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [81 x i8] c"Usage : wfd_cfg_noa <enable|disable> <index> [<counttype> <duration> <interval>]\00"
@str.2 = [81 x i8] c"If NOA parameters are provided, 'set' is performed otherwise 'get' is performed.\00"
define void @print_wfd_cfg_noa_usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([81 x i8], [81 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([81 x i8], [81 x i8]* @str.2, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char, unsigned char);
int main(int argc, char **argv) {
  signed char c0 = -1;
  unsigned char c1 = 255;
  printf("bs0  = %d %d\n", c0, c1);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movb   $0xff,-0x11(%rbp)
movb   $0xff,-0x12(%rbp)
mov    -0x11(%rbp),%al
lea    0xec8(%rip),%rdi
movsbl %al,%esi
movzbl -0x12(%rbp),%edx
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
mov    $0xffffffff,%esi
mov    $0xff,%edx
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"bs0 = %d %d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8
%7 = alloca i8
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i8 -1, i8* %6
store i8 -1, i8* %7
%8 = load i8, i8* %6
%9 = load i8, i8* %7
%10 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8 signext %8, i8 zeroext %9)
ret i32 0
}

LLVM IR (-O2):
@.str = [14 x i8] c"bs0 = %d %d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8 signext -1, i8 zeroext -1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_help() {
  printf("  --sse3                     test sse3 instruction.\n"
         "  --ssse3                    test ssse3 instruction.\n"
         "  --sse4                     test sse4 instruction.\n"
         "  --sse4a                    test sse4a instruction.\n"
         "  --avx                      test avx instruction.\n"
         "  --aes                      test aes instruction.\n"
         "  --pclmul                   test carry less multiplication.\n"
         "  --rdrand                   test rdrand instruction.\n"
         "  --fma4                     test fma4 instruction.\n"
         "  --xop                     test fma4 instruction.\n"
         "  --stress n_cpus,avx,aes    start stress on n_cpus.and cpuflags\n");
}


x86 assembly (clang, -O0):
<print_help>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_help>:
lea    0xee9(%rip),%rdi
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [596 x i8] c" --sse3 test sse3 instruction.\0A --ssse3 test ssse3 instruction.\0A --sse4 test sse4 instruction.\0A --sse4a test sse4a instruction.\0A --avx test avx instruction.\0A --aes test aes instruction.\0A --pclmul test carry less multiplication.\0A --rdrand test rdrand instruction.\0A --fma4 test fma4 instruction.\0A --xop test fma4 instruction.\0A --stress n_cpus,avx,aes start stress on n_cpus.and cpuflags\0A\00"
define void @print_help() {
%1 = call i32 @printf(i8* getelementptr inbounds ([596 x i8], [596 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [595 x i8] c" --sse3 test sse3 instruction.\0A --ssse3 test ssse3 instruction.\0A --sse4 test sse4 instruction.\0A --sse4a test sse4a instruction.\0A --avx test avx instruction.\0A --aes test aes instruction.\0A --pclmul test carry less multiplication.\0A --rdrand test rdrand instruction.\0A --fma4 test fma4 instruction.\0A --xop test fma4 instruction.\0A --stress n_cpus,avx,aes start stress on n_cpus.and cpuflags\00"
define void @print_help() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([595 x i8], [595 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char, char);
int main() {
  char ch = '*';
  printf("%d -> %c\n", ch, ch);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movb   $0x2a,-0x5(%rbp)
mov    -0x5(%rbp),%al
lea    0xed3(%rip),%rdi
movsbl %al,%esi
movsbl -0x5(%rbp),%edx
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
mov    $0x2a,%esi
mov    $0x2a,%edx
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [10 x i8] c"%d -> %c\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
store i32 0, i32* %1
store i8 42, i8* %2
%3 = load i8, i8* %2
%4 = load i8, i8* %2
%5 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8 signext %3, i8 signext %4)
ret i32 0
}

LLVM IR (-O2):
@.str = [10 x i8] c"%d -> %c\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8 signext 42, i8 signext 42)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ rotate(char *, int);
int main(int argc, char *argv[]) {
  char str[10] = "abcdefghi";
  rotate(str, 3);
  printf("ROTATE: %s\n", str);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0xec3(%rip),%rax
mov    %rax,-0x1a(%rbp)
mov    0xec0(%rip),%ax
mov    %ax,-0x12(%rbp)
lea    -0x1a(%rbp),%rdi
mov    $0x3,%esi
call   1040 <rotate@plt>
lea    -0x1a(%rbp),%rsi
lea    0xea5(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
movabs $0x6867666564636261,%rax
66 67 68
mov    %rax,(%rsp)
movw   $0x69,0x8(%rsp)
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x3,%esi
call   1040 <rotate@plt>
lea    0xeb9(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.str = [10 x i8] c"abcdefghi\00"
@.str = [12 x i8] c"ROTATE: %s\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [10 x i8]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = bitcast [10 x i8]* %6 to i8*
%8 = getelementptr inbounds [10 x i8], [10 x i8]* %6, i64 0, i64 0
%9 = call i32 @rotate(i8* %8, i32 3)
%10 = getelementptr inbounds [10 x i8], [10 x i8]* %6, i64 0, i64 0
%11 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %10)
ret i32 0
}

LLVM IR (-O2):
@__const.main.str = [10 x i8] c"abcdefghi\00"
@.str = [12 x i8] c"ROTATE: %s\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [10 x i8]
%4 = getelementptr inbounds [10 x i8], [10 x i8]* %3, i64 0, i64 0
%5 = call i32 @rotate(i8* %4, i32 3)
%6 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %4)
ret i32 0
}
int fib(int n) {
  if (n == 0) {
    return 0;
  } else if (n == 1) {
    return 1;
  } else
    return (fib(n - 1) + fib(n - 2));
}


x86 assembly (clang, -O0):
<fib>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1131 <fib+0x21>
movl   $0x0,-0x4(%rbp)
jmp    116a <fib+0x5a>
cmpl   $0x1,-0x8(%rbp)
jne    1147 <fib+0x37>
movl   $0x1,-0x4(%rbp)
jmp    116a <fib+0x5a>
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
call   1030 <fib@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
sub    $0x2,%edi
call   1030 <fib@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fib>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
xor    %ebp,%ebp
cmp    $0x2,%ebx
jb     1132 <fib+0x22>
nopl   0x0(%rax)
lea    -0x1(%rbx),%edi
call   1030 <fib@plt>
add    %eax,%ebp
add    $0xfffffffe,%ebx
cmp    $0x2,%ebx
jae    1120 <fib+0x10>
add    %ebp,%ebx
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @fib(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %1
store i32 0, i32* %2
br label %19
7: ; preds = %1
%8 = load i32, i32* %3
%9 = icmp eq i32 %8, 1
br i1 %9, label %10, label %11
10: ; preds = %7
store i32 1, i32* %2
br label %19
11: ; preds = %7
%12 = load i32, i32* %3
%13 = sub nsw i32 %12, 1
%14 = call i32 @fib(i32 %13)
%15 = load i32, i32* %3
%16 = sub nsw i32 %15, 2
%17 = call i32 @fib(i32 %16)
%18 = add nsw i32 %14, %17
store i32 %18, i32* %2
br label %19
19: ; preds = %11, %10, %6
%20 = load i32, i32* %2
ret i32 %20
}

LLVM IR (-O2):
define i32 @fib(i32 %0) {
br label %2
2: ; preds = %6, %1
%3 = phi i32 [ 0, %1 ], [ %10, %6 ]
%4 = phi i32 [ %0, %1 ], [ %9, %6 ]
%5 = icmp ult i32 %4, 2
br i1 %5, label %11, label %6
6: ; preds = %2
%7 = add nsw i32 %4, -1
%8 = tail call i32 @fib(i32 %7)
%9 = add nsw i32 %4, -2
%10 = add nsw i32 %8, %3
br label %2
11: ; preds = %2
%12 = add nsw i32 %4, %3
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ I2C_Gets(int, int, int, unsigned char *);
char thermo_hex_to_temp(unsigned int);
char thermo_hi_threshold_get() {
  unsigned int val;
  char ret;
  I2C_Gets(0x90, 0x3, 2, (unsigned char *)&val);
  ret = thermo_hex_to_temp(val);
  if (ret == ((85) + 1))
    return (128);
  else
    return ret;
}


x86 assembly (clang, -O0):
<thermo_hi_threshold_get>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x8(%rbp),%rcx
mov    $0x90,%edi
mov    $0x3,%esi
mov    $0x2,%edx
call   1030 <I2C_Gets@plt>
mov    -0x8(%rbp),%edi
call   1040 <thermo_hex_to_temp@plt>
mov    %al,-0x9(%rbp)
movsbl -0x9(%rbp),%eax
cmp    $0x56,%eax
jne    1161 <thermo_hi_threshold_get+0x41>
movb   $0x80,-0x1(%rbp)
jmp    1167 <thermo_hi_threshold_get+0x47>
mov    -0x9(%rbp),%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<thermo_hi_threshold_get>:
push   %rax
lea    0x4(%rsp),%rcx
mov    $0x90,%edi
mov    $0x3,%esi
mov    $0x2,%edx
call   1030 <I2C_Gets@plt>
mov    0x4(%rsp),%edi
call   1040 <thermo_hex_to_temp@plt>
cmp    $0x56,%al
movzbl %al,%ecx
mov    $0x80,%eax
cmovne %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define signext i8 @thermo_hi_threshold_get() {
%1 = alloca i8
%2 = alloca i32
%3 = alloca i8
%4 = bitcast i32* %2 to i8*
%5 = call i32 @I2C_Gets(i32 144, i32 3, i32 2, i8* %4)
%6 = load i32, i32* %2
%7 = call signext i8 @thermo_hex_to_temp(i32 %6)
store i8 %7, i8* %3
%8 = load i8, i8* %3
%9 = sext i8 %8 to i32
%10 = icmp eq i32 %9, 86
br i1 %10, label %11, label %12
11: ; preds = %0
store i8 -128, i8* %1
br label %14
12: ; preds = %0
%13 = load i8, i8* %3
store i8 %13, i8* %1
br label %14
14: ; preds = %12, %11
%15 = load i8, i8* %1
ret i8 %15
}

LLVM IR (-O2):
define signext i8 @thermo_hi_threshold_get() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @I2C_Gets(i32 144, i32 3, i32 2, i8* %2)
%4 = load i32, i32* %1
%5 = call signext i8 @thermo_hex_to_temp(i32 %4)
%6 = icmp eq i8 %5, 86
%7 = select i1 %6, i8 -128, i8 %5
ret i8 %7
}
/* Variables and functions */
scalar_t__ calloc(size_t, int);
int /*<<< orphan*/ strncpy(char *, char const *, size_t);
char *my_strndup(const char *src, size_t n) {
  char *dst;
  dst = (char *)calloc(n + 1, sizeof(char));
  if (dst == NULL)
    return NULL;
  strncpy(dst, src, n);
  return dst;
}


x86 assembly (clang, -O0):
<my_strndup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
add    $0x1,%rdi
mov    $0x1,%esi
call   1040 <calloc@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    115e <my_strndup+0x3e>
movq   $0x0,-0x8(%rbp)
jmp    1177 <my_strndup+0x57>
mov    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <strncpy@plt>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_strndup>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%r15
lea    0x1(%rsi),%rdi
mov    $0x1,%esi
call   1040 <calloc@plt>
test   %rax,%rax
je     1151 <my_strndup+0x31>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r15,%rsi
mov    %r14,%rdx
call   1030 <strncpy@plt>
jmp    1153 <my_strndup+0x33>
xor    %ebx,%ebx
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @my_strndup(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i8*
store i8* %0, i8** %4
store i64 %1, i64* %5
%7 = load i64, i64* %5
%8 = add i64 %7, 1
%9 = call i64 @calloc(i64 %8, i32 1)
%10 = inttoptr i64 %9 to i8*
store i8* %10, i8** %6
%11 = load i8*, i8** %6
%12 = icmp eq i8* %11, null
br i1 %12, label %13, label %14
13: ; preds = %2
store i8* null, i8** %3
br label %20
14: ; preds = %2
%15 = load i8*, i8** %6
%16 = load i8*, i8** %4
%17 = load i64, i64* %5
%18 = call i32 @strncpy(i8* %15, i8* %16, i64 %17)
%19 = load i8*, i8** %6
store i8* %19, i8** %3
br label %20
20: ; preds = %14, %13
%21 = load i8*, i8** %3
ret i8* %21
}

LLVM IR (-O2):
define i8* @my_strndup(i8* %0, i64 %1) {
%3 = add i64 %1, 1
%4 = tail call i64 @calloc(i64 %3, i32 1)
%5 = inttoptr i64 %4 to i8*
%6 = icmp eq i64 %4, 0
br i1 %6, label %9, label %7
7: ; preds = %2
%8 = tail call i32 @strncpy(i8* %5, i8* %0, i64 %1)
br label %9
9: ; preds = %2, %7
%10 = phi i8* [ %5, %7 ], [ null, %2 ]
ret i8* %10
}
int getIndex(int n, int index) {
  int ret = 0;
  if (0 <= index) {
    ret = index % n;
  } else {
    ret = index % n + n;
  }
  return ret;
}


x86 assembly (clang, -O0):
<getIndex>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
xor    %eax,%eax
cmp    -0x8(%rbp),%eax
jg     112b <getIndex+0x2b>
mov    -0x8(%rbp),%eax
cltd
idivl  -0x4(%rbp)
mov    %edx,-0xc(%rbp)
jmp    1138 <getIndex+0x38>
mov    -0x8(%rbp),%eax
cltd
idivl  -0x4(%rbp)
add    -0x4(%rbp),%edx
mov    %edx,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getIndex>:
mov    %esi,%eax
cltd
idiv   %edi
sar    $0x1f,%esi
and    %edi,%esi
lea    (%rsi,%rdx,1),%eax
ret

LLVM IR (-O0):
define i32 @getIndex(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
store i32 0, i32* %5
%6 = load i32, i32* %4
%7 = icmp sle i32 0, %6
br i1 %7, label %8, label %12
8: ; preds = %2
%9 = load i32, i32* %4
%10 = load i32, i32* %3
%11 = srem i32 %9, %10
store i32 %11, i32* %5
br label %18
12: ; preds = %2
%13 = load i32, i32* %4
%14 = load i32, i32* %3
%15 = srem i32 %13, %14
%16 = load i32, i32* %3
%17 = add nsw i32 %15, %16
store i32 %17, i32* %5
br label %18
18: ; preds = %12, %8
%19 = load i32, i32* %5
ret i32 %19
}

LLVM IR (-O2):
define i32 @getIndex(i32 %0, i32 %1) {
%3 = srem i32 %1, %0
%4 = icmp slt i32 %1, 0
%5 = select i1 %4, i32 %0, i32 0
%6 = add nsw i32 %3, %5
ret i32 %6
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int fread(int *, int, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ fseek(int /*<<< orphan*/ *, int, int /*<<< orphan*/);
int getOffset(char *filename) {
  FILE *fp;
  int n, int_var, offset;
  fp = fopen(filename, "r");
  fseek(fp, 10, 0);
  n = fread(&int_var, sizeof(int), 1, fp);
  offset = int_var;
  fclose(fp);
  return offset;
}


x86 assembly (clang, -O0):
<getOffset>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xea9(%rip),%rsi
call   1060 <fopen@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0xa,%esi
xor    %edx,%edx
call   1050 <fseek@plt>
mov    -0x10(%rbp),%rcx
lea    -0x18(%rbp),%rdi
mov    $0x4,%esi
mov    $0x1,%edx
call   1030 <fread@plt>
mov    %eax,-0x14(%rbp)
mov    -0x18(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <fclose@plt>
mov    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getOffset>:
push   %rbp
push   %rbx
push   %rax
lea    0xeb6(%rip),%rsi
call   1060 <fopen@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    $0xa,%esi
xor    %edx,%edx
call   1050 <fseek@plt>
lea    0x4(%rsp),%rdi
mov    $0x4,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1030 <fread@plt>
mov    0x4(%rsp),%ebp
mov    %rbx,%rdi
call   1040 <fclose@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [2 x i8] c"r\00"
define i32 @getOffset(i8* %0) {
%2 = alloca i8*
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %2
%7 = load i8*, i8** %2
%8 = call i32* @fopen(i8* %7, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32* %8, i32** %3
%9 = load i32*, i32** %3
%10 = call i32 @fseek(i32* %9, i32 10, i32 0)
%11 = load i32*, i32** %3
%12 = call i32 @fread(i32* %5, i32 4, i32 1, i32* %11)
store i32 %12, i32* %4
%13 = load i32, i32* %5
store i32 %13, i32* %6
%14 = load i32*, i32** %3
%15 = call i32 @fclose(i32* %14)
%16 = load i32, i32* %6
ret i32 %16
}

LLVM IR (-O2):
@.str = [2 x i8] c"r\00"
define i32 @getOffset(i8* nocapture %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%5 = tail call i32 @fseek(i32* %4, i32 10, i32 0)
%6 = call i32 @fread(i32* %2, i32 4, i32 1, i32* %4)
%7 = load i32, i32* %2
%8 = tail call i32 @fclose(i32* %4)
ret i32 %7
}
/* Variables and functions */
int tino_memwild(void const *, size_t, void const *, size_t, char, char, char,
                 char);
int tino_memwildcmp(const void *s, size_t slen, const void *wild, size_t wlen) {
  return tino_memwild(s, slen, wild, wlen, '*', '?', '[', ']');
}


x86 assembly (clang, -O0):
<tino_memwildcmp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x2a,%r8d
mov    $0x3f,%r9d
movl   $0x5b,(%rsp)
movl   $0x5d,0x8(%rsp)
call   1030 <tino_memwild@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tino_memwildcmp>:
push   %rax
mov    $0x2a,%r8d
mov    $0x3f,%r9d
push   $0x5d
push   $0x5b
call   1030 <tino_memwild@plt>
add    $0x10,%rsp
pop    %rcx
ret

LLVM IR (-O0):
define i32 @tino_memwildcmp(i8* %0, i64 %1, i8* %2, i64 %3) {
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i8*
%8 = alloca i64
store i8* %0, i8** %5
store i64 %1, i64* %6
store i8* %2, i8** %7
store i64 %3, i64* %8
%9 = load i8*, i8** %5
%10 = load i64, i64* %6
%11 = load i8*, i8** %7
%12 = load i64, i64* %8
%13 = call i32 @tino_memwild(i8* %9, i64 %10, i8* %11, i64 %12, i8 signext 42, i8 signext 63, i8 signext 91, i8 signext 93)
ret i32 %13
}

LLVM IR (-O2):
define i32 @tino_memwildcmp(i8* %0, i64 %1, i8* %2, i64 %3) {
%5 = tail call i32 @tino_memwild(i8* %0, i64 %1, i8* %2, i64 %3, i8 signext 42, i8 signext 63, i8 signext 91, i8 signext 93)
ret i32 %5
}
void RPI_GpioInit(void) {}


x86 assembly (clang, -O0):
<RPI_GpioInit>:
push   %rbp
mov    %rsp,%rbp
pop    %rbp
ret

x86 assembly (clang, -O2):
<RPI_GpioInit>:
ret

LLVM IR (-O0):
define void @RPI_GpioInit() {
ret void
}

LLVM IR (-O2):
define void @RPI_GpioInit() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ putchar(int);
void cont(int ix, int iy) {
  putchar('n');
  {
    putchar(ix & 255);
    putchar((ix >> 8) & 255);
  };
  {
    putchar(iy & 255);
    putchar((iy >> 8) & 255);
  };
}


x86 assembly (clang, -O0):
<cont>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0x6e,%edi
call   1030 <putchar@plt>
mov    -0x4(%rbp),%edi
and    $0xff,%edi
call   1030 <putchar@plt>
mov    -0x4(%rbp),%edi
sar    $0x8,%edi
and    $0xff,%edi
call   1030 <putchar@plt>
mov    -0x8(%rbp),%edi
and    $0xff,%edi
call   1030 <putchar@plt>
mov    -0x8(%rbp),%edi
sar    $0x8,%edi
and    $0xff,%edi
call   1030 <putchar@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cont>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %edi,%ebx
mov    $0x6e,%edi
call   1030 <putchar@plt>
movzbl %bl,%edi
call   1030 <putchar@plt>
movzbl %bh,%edi
call   1030 <putchar@plt>
mov    %ebp,%ebx
movzbl %bl,%edi
call   1030 <putchar@plt>
movzbl %bh,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <putchar@plt>

LLVM IR (-O0):
define void @cont(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = call i32 @putchar(i32 110)
%6 = load i32, i32* %3
%7 = and i32 %6, 255
%8 = call i32 @putchar(i32 %7)
%9 = load i32, i32* %3
%10 = ashr i32 %9, 8
%11 = and i32 %10, 255
%12 = call i32 @putchar(i32 %11)
%13 = load i32, i32* %4
%14 = and i32 %13, 255
%15 = call i32 @putchar(i32 %14)
%16 = load i32, i32* %4
%17 = ashr i32 %16, 8
%18 = and i32 %17, 255
%19 = call i32 @putchar(i32 %18)
ret void
}

LLVM IR (-O2):
define void @cont(i32 %0, i32 %1) {
%3 = tail call i32 @putchar(i32 110)
%4 = and i32 %0, 255
%5 = tail call i32 @putchar(i32 %4)
%6 = lshr i32 %0, 8
%7 = and i32 %6, 255
%8 = tail call i32 @putchar(i32 %7)
%9 = and i32 %1, 255
%10 = tail call i32 @putchar(i32 %9)
%11 = lshr i32 %1, 8
%12 = and i32 %11, 255
%13 = tail call i32 @putchar(i32 %12)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
void intHandler(int sig) { exit(0); }


x86 assembly (clang, -O0):
<intHandler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
xor    %edi,%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<intHandler>:
push   %rax
xor    %edi,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
define void @intHandler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define void @intHandler(i32 %0) {
%2 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ SIG_UNBLOCK;
int /*<<< orphan*/ mced_debug(int, char *);
int /*<<< orphan*/ signals_handled();
int /*<<< orphan*/ sigprocmask(int /*<<< orphan*/, int /*<<< orphan*/,
                               int /*<<< orphan*/ *);
void unlock_rules(void) {
  mced_debug(4, "DBG: unblocking signals for rule lock\n");
  sigprocmask(SIG_UNBLOCK, signals_handled(), NULL);
}


x86 assembly (clang, -O0):
<unlock_rules>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x4,%edi
lea    0xebc(%rip),%rsi
call   1050 <mced_debug@plt>
mov    0x2e98(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1040 <signals_handled@plt>
mov    -0x4(%rbp),%edi
mov    %eax,%esi
xor    %eax,%eax
mov    %eax,%edx
call   1030 <sigprocmask@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<unlock_rules>:
push   %rbx
lea    0xec8(%rip),%rsi
mov    $0x4,%edi
call   1050 <mced_debug@plt>
mov    0x2e9f(%rip),%rax
mov    (%rax),%ebx
xor    %eax,%eax
call   1040 <signals_handled@plt>
mov    %ebx,%edi
mov    %eax,%esi
xor    %edx,%edx
pop    %rbx
jmp    1030 <sigprocmask@plt>

LLVM IR (-O0):
@.str = [39 x i8] c"DBG: unblocking signals for rule lock\0A\00"
@SIG_UNBLOCK = global i32 0
define void @unlock_rules() {
%1 = call i32 @mced_debug(i32 4, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0))
%2 = load i32, i32* @SIG_UNBLOCK
%3 = call i32 (...) @signals_handled()
%4 = call i32 @sigprocmask(i32 %2, i32 %3, i32* null)
ret void
}

LLVM IR (-O2):
@.str = [39 x i8] c"DBG: unblocking signals for rule lock\0A\00"
@SIG_UNBLOCK = global i32 0
define void @unlock_rules() {
%1 = tail call i32 @mced_debug(i32 4, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0))
%2 = load i32, i32* @SIG_UNBLOCK
%3 = tail call i32 (...) @signals_handled()
%4 = tail call i32 @sigprocmask(i32 %2, i32 %3, i32* null)
ret void
}
unsigned hash_name(const char *name) {
  unsigned n = 0;
  while (*name)
    n = (n << 1) ^ *name++;
  return n;
}


x86 assembly (clang, -O0):
<hash_name>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     113e <hash_name+0x3e>
mov    -0xc(%rbp),%eax
shl    $0x1,%eax
mov    -0x8(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
movsbl (%rcx),%ecx
xor    %ecx,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <hash_name+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash_name>:
mov    (%rdi),%cl
test   %cl,%cl
je     1123 <hash_name+0x23>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
add    %eax,%eax
movsbl %cl,%ecx
xor    %ecx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <hash_name+0x10>
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @hash_name(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %3
br label %4
4: ; preds = %8, %1
%5 = load i8*, i8** %2
%6 = load i8, i8* %5
%7 = icmp ne i8 %6, 0
br i1 %7, label %8, label %16
8: ; preds = %4
%9 = load i32, i32* %3
%10 = shl i32 %9, 1
%11 = load i8*, i8** %2
%12 = getelementptr inbounds i8, i8* %11, i32 1
store i8* %12, i8** %2
%13 = load i8, i8* %11
%14 = sext i8 %13 to i32
%15 = xor i32 %10, %14
store i32 %15, i32* %3
br label %4
16: ; preds = %4
%17 = load i32, i32* %3
ret i32 %17
}

LLVM IR (-O2):
define i32 @hash_name(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %14, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i32 [ %11, %4 ], [ 0, %1 ]
%7 = phi i8* [ %9, %4 ], [ %0, %1 ]
%8 = shl i32 %6, 1
%9 = getelementptr inbounds i8, i8* %7, i64 1
%10 = sext i8 %5 to i32
%11 = xor i32 %8, %10
%12 = load i8, i8* %9
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4, %1
%15 = phi i32 [ 0, %1 ], [ %11, %4 ]
ret i32 %15
}
int valid(int s, int pos) { return (s & 1 << pos) == 0; }


x86 assembly (clang, -O0):
<valid>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
and    %ecx,%eax
cmp    $0x0,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<valid>:
mov    %esi,%ecx
mov    %edi,%eax
not    %eax
shr    %cl,%eax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @valid(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = shl i32 1, %6
%8 = and i32 %5, %7
%9 = icmp eq i32 %8, 0
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @valid(i32 %0, i32 %1) {
%3 = xor i32 %0, -1
%4 = lshr i32 %3, %1
%5 = and i32 %4, 1
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ system(char *);
int login() {
  printf("WELCOME MR. FALK\n");
  system("/bin/sh");
  return 0;
}


x86 assembly (clang, -O0):
<login>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1040 <printf@plt>
lea    0xedb(%rip),%rdi
call   1030 <system@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<login>:
push   %rax
lea    0xee0(%rip),%rdi
call   1030 <puts@plt>
lea    0xecc(%rip),%rdi
call   1040 <system@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [18 x i8] c"WELCOME MR. FALK\0A\00"
@.str.1 = [8 x i8] c"/bin/sh\00"
define i32 @login() {
%1 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @system(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [8 x i8] c"/bin/sh\00"
@str = [17 x i8] c"WELCOME MR. FALK\00"
define i32 @login() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @system(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ VDP_drawText(char *, int, int);
int /*<<< orphan*/ VDP_init();
int /*<<< orphan*/ showBusAddressErrorDump(int);
void _buserror_callback() {
  VDP_init();
  VDP_drawText("BUS ERROR !", 10, 3);
  showBusAddressErrorDump(5);
  while (1)
    ;
}


x86 assembly (clang, -O0):
<_buserror_callback>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <VDP_init@plt>
lea    0xebe(%rip),%rdi
mov    $0xa,%esi
mov    $0x3,%edx
call   1040 <VDP_drawText@plt>
mov    $0x5,%edi
call   1050 <showBusAddressErrorDump@plt>
jmp    115b <_buserror_callback+0x2b>

x86 assembly (clang, -O2):
<_buserror_callback>:
push   %rax
xor    %eax,%eax
call   1030 <VDP_init@plt>
lea    0xec1(%rip),%rdi
mov    $0xa,%esi
mov    $0x3,%edx
call   1040 <VDP_drawText@plt>
mov    $0x5,%edi
call   1050 <showBusAddressErrorDump@plt>
nopl   0x0(%rax,%rax,1)
jmp    1160 <_buserror_callback+0x30>

LLVM IR (-O0):
@.str = [12 x i8] c"BUS ERROR !\00"
define void @_buserror_callback() {
%1 = call i32 (...) @VDP_init()
%2 = call i32 @VDP_drawText(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 10, i32 3)
%3 = call i32 @showBusAddressErrorDump(i32 5)
br label %4
4: ; preds = %0, %4
br label %4
}

LLVM IR (-O2):
@.str = [12 x i8] c"BUS ERROR !\00"
define void @_buserror_callback() {
%1 = tail call i32 (...) @VDP_init()
%2 = tail call i32 @VDP_drawText(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 10, i32 3)
%3 = tail call i32 @showBusAddressErrorDump(i32 5)
br label %4
4: ; preds = %0, %4
br label %4
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ STDOUT_FILENO;
char *read_ptr();
int /*<<< orphan*/ read_size();
int /*<<< orphan*/ write(int /*<<< orphan*/, char *, int /*<<< orphan*/);
void do_read() {
  char *addr = read_ptr();
  uint32_t size = read_size();
  write(STDOUT_FILENO, addr, size);
}


x86 assembly (clang, -O0):
<do_read>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1050 <read_ptr@plt>
mov    %rax,-0x8(%rbp)
mov    $0x0,%al
call   1030 <read_size@plt>
mov    %eax,-0xc(%rbp)
mov    0x2e9c(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
call   1040 <write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_read>:
push   %rbx
xor    %eax,%eax
call   1050 <read_ptr@plt>
mov    %rax,%rbx
xor    %eax,%eax
call   1030 <read_size@plt>
mov    0x2ea7(%rip),%rcx
mov    (%rcx),%edi
mov    %rbx,%rsi
mov    %eax,%edx
pop    %rbx
jmp    1040 <write@plt>

LLVM IR (-O0):
@STDOUT_FILENO = global i32 0
define void @do_read() {
%1 = alloca i8*
%2 = alloca i32
%3 = call i8* (...) @read_ptr()
store i8* %3, i8** %1
%4 = call i32 (...) @read_size()
store i32 %4, i32* %2
%5 = load i32, i32* @STDOUT_FILENO
%6 = load i8*, i8** %1
%7 = load i32, i32* %2
%8 = call i32 @write(i32 %5, i8* %6, i32 %7)
ret void
}

LLVM IR (-O2):
@STDOUT_FILENO = global i32 0
define void @do_read() {
%1 = tail call i8* (...) @read_ptr()
%2 = tail call i32 (...) @read_size()
%3 = load i32, i32* @STDOUT_FILENO
%4 = tail call i32 @write(i32 %3, i8* %1, i32 %2)
ret void
}
void RTStrToUInt64Full(void) {}


x86 assembly (clang, -O0):
<RTStrToUInt64Full>:
push   %rbp
mov    %rsp,%rbp
pop    %rbp
ret

x86 assembly (clang, -O2):
<RTStrToUInt64Full>:
ret

LLVM IR (-O0):
define void @RTStrToUInt64Full() {
ret void
}

LLVM IR (-O2):
define void @RTStrToUInt64Full() {
ret void
}
void InitSpi(void) {}


x86 assembly (clang, -O0):
<InitSpi>:
push   %rbp
mov    %rsp,%rbp
pop    %rbp
ret

x86 assembly (clang, -O2):
<InitSpi>:
ret

LLVM IR (-O0):
define void @InitSpi() {
ret void
}

LLVM IR (-O2):
define void @InitSpi() {
ret void
}
int nceil(int a, int b) {
  if (a % b > 0) {
    return (a / b + 1);
  } else {
    return (a / b);
  }
}


x86 assembly (clang, -O0):
<nceil>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
cmp    $0x0,%edx
jle    112c <nceil+0x2c>
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1136 <nceil+0x36>
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<nceil>:
mov    %edi,%eax
cltd
idiv   %esi
xor    %ecx,%ecx
test   %edx,%edx
setg   %cl
add    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @nceil(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = load i32, i32* %4
%7 = load i32, i32* %5
%8 = srem i32 %6, %7
%9 = icmp sgt i32 %8, 0
br i1 %9, label %10, label %15
10: ; preds = %2
%11 = load i32, i32* %4
%12 = load i32, i32* %5
%13 = sdiv i32 %11, %12
%14 = add nsw i32 %13, 1
store i32 %14, i32* %3
br label %19
15: ; preds = %2
%16 = load i32, i32* %4
%17 = load i32, i32* %5
%18 = sdiv i32 %16, %17
store i32 %18, i32* %3
br label %19
19: ; preds = %15, %10
%20 = load i32, i32* %3
ret i32 %20
}

LLVM IR (-O2):
define i32 @nceil(i32 %0, i32 %1) {
%3 = srem i32 %0, %1
%4 = icmp sgt i32 %3, 0
%5 = sdiv i32 %0, %1
%6 = zext i1 %4 to i32
%7 = add nsw i32 %5, %6
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ perror(char *);
void fatal_error(char *errmsg) {
  perror(errmsg);
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<fatal_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <perror@plt>
mov    0x2ea4(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<fatal_error>:
push   %rax
call   1030 <perror@plt>
mov    0x2eb3(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@EXIT_FAILURE = global i32 0
define void @fatal_error(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @perror(i8* %3)
%5 = load i32, i32* @EXIT_FAILURE
%6 = call i32 @exit(i32 %5)
unreachable
}

LLVM IR (-O2):
@EXIT_FAILURE = global i32 0
define void @fatal_error(i8* nocapture %0) {
%2 = tail call i32 @perror(i8* %0)
%3 = load i32, i32* @EXIT_FAILURE
%4 = tail call i32 @exit(i32 %3)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ AF_UNIX;
int /*<<< orphan*/ SOCK_STREAM;
int socket(int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/);
int ipc_socket(void) { return socket(AF_UNIX, SOCK_STREAM, 0); }


x86 assembly (clang, -O0):
<ipc_socket>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ecd(%rip),%rax
mov    (%rax),%edi
mov    0x2eb4(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1030 <socket@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<ipc_socket>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%edi
mov    0x2eb8(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
jmp    1030 <socket@plt>

LLVM IR (-O0):
@AF_UNIX = global i32 0
@SOCK_STREAM = global i32 0
define i32 @ipc_socket() {
%1 = load i32, i32* @AF_UNIX
%2 = load i32, i32* @SOCK_STREAM
%3 = call i32 @socket(i32 %1, i32 %2, i32 0)
ret i32 %3
}

LLVM IR (-O2):
@AF_UNIX = global i32 0
@SOCK_STREAM = global i32 0
define i32 @ipc_socket() {
%1 = load i32, i32* @AF_UNIX
%2 = load i32, i32* @SOCK_STREAM
%3 = tail call i32 @socket(i32 %1, i32 %2, i32 0)
ret i32 %3
}
char *transform(char action, char *letter, char *alphabet) {
  if (action == 'c')
    *letter = ((*letter + *alphabet) % 26) + 65;
  else
    *letter = ((*letter - *alphabet + 26) % 26) + 65;
  return letter;
}


x86 assembly (clang, -O0):
<transform>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x63,%eax
jne    1147 <transform+0x47>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
mov    -0x18(%rbp),%rcx
movsbl (%rcx),%ecx
add    %ecx,%eax
mov    $0x1a,%ecx
cltd
idiv   %ecx
add    $0x41,%edx
mov    %dl,%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
jmp    116d <transform+0x6d>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
mov    -0x18(%rbp),%rcx
movsbl (%rcx),%ecx
sub    %ecx,%eax
add    $0x1a,%eax
mov    $0x1a,%ecx
cltd
idiv   %ecx
add    $0x41,%edx
mov    %dl,%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<transform>:
mov    %rsi,%rax
movsbl (%rsi),%ecx
movsbl (%rdx),%edx
mov    %ecx,%esi
sub    %edx,%esi
add    $0x1a,%esi
add    %ecx,%edx
cmp    $0x63,%dil
cmovne %esi,%edx
movswl %dx,%ecx
imul   $0x4ec5,%ecx,%ecx
mov    %ecx,%esi
shr    $0x1f,%esi
shr    $0x13,%ecx
add    %esi,%ecx
lea    (%rcx,%rcx,4),%esi
lea    (%rsi,%rsi,4),%esi
add    %ecx,%esi
sub    %esi,%edx
add    $0x41,%dl
mov    %dl,(%rax)
ret

LLVM IR (-O0):
define i8* @transform(i8 signext %0, i8* %1, i8* %2) {
%4 = alloca i8
%5 = alloca i8*
%6 = alloca i8*
store i8 %0, i8* %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load i8, i8* %4
%8 = sext i8 %7 to i32
%9 = icmp eq i32 %8, 99
br i1 %9, label %10, label %22
10: ; preds = %3
%11 = load i8*, i8** %5
%12 = load i8, i8* %11
%13 = sext i8 %12 to i32
%14 = load i8*, i8** %6
%15 = load i8, i8* %14
%16 = sext i8 %15 to i32
%17 = add nsw i32 %13, %16
%18 = srem i32 %17, 26
%19 = add nsw i32 %18, 65
%20 = trunc i32 %19 to i8
%21 = load i8*, i8** %5
store i8 %20, i8* %21
br label %35
22: ; preds = %3
%23 = load i8*, i8** %5
%24 = load i8, i8* %23
%25 = sext i8 %24 to i32
%26 = load i8*, i8** %6
%27 = load i8, i8* %26
%28 = sext i8 %27 to i32
%29 = sub nsw i32 %25, %28
%30 = add nsw i32 %29, 26
%31 = srem i32 %30, 26
%32 = add nsw i32 %31, 65
%33 = trunc i32 %32 to i8
%34 = load i8*, i8** %5
store i8 %33, i8* %34
br label %35
35: ; preds = %22, %10
%36 = load i8*, i8** %5
ret i8* %36
}

LLVM IR (-O2):
define i8* @transform(i8 signext %0, i8* returned %1, i8* nocapture %2) {
%4 = icmp eq i8 %0, 99
%5 = load i8, i8* %1
%6 = sext i8 %5 to i16
%7 = load i8, i8* %2
%8 = sext i8 %7 to i16
%9 = add nsw i16 %6, 26
%10 = sub nsw i16 %9, %8
%11 = add nsw i16 %8, %6
%12 = select i1 %4, i16 %11, i16 %10
%13 = srem i16 %12, 26
%14 = trunc i16 %13 to i8
%15 = add nsw i8 %14, 65
store i8 %15, i8* %1
ret i8* %1
}
int imax(int a, int b) {
  if (a > b)
    return a;
  return b;
}


x86 assembly (clang, -O0):
<imax>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    1121 <imax+0x21>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1127 <imax+0x27>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<imax>:
mov    %esi,%eax
cmp    %esi,%edi
cmovg  %edi,%eax
ret

LLVM IR (-O0):
define i32 @imax(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = load i32, i32* %4
%7 = load i32, i32* %5
%8 = icmp sgt i32 %6, %7
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = load i32, i32* %4
store i32 %10, i32* %3
br label %13
11: ; preds = %2
%12 = load i32, i32* %5
store i32 %12, i32* %3
br label %13
13: ; preds = %11, %9
%14 = load i32, i32* %3
ret i32 %14
}

LLVM IR (-O2):
define i32 @imax(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}