xunge/DecIR huggingface dataset:
char *strcat(char *s, const char *t) {
  char *r = s;
  while (*s)
    ++s;
  while (*s = *t)
    ++s, ++t;
  return r;
}


x86 assembly (clang, -O0):
<strcat>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1132 <strcat+0x32>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1114 <strcat+0x14>
jmp    1137 <strcat+0x37>
mov    -0x10(%rbp),%rax
mov    (%rax),%al
mov    -0x8(%rbp),%rcx
mov    %al,(%rcx)
cmp    $0x0,%al
je     1168 <strcat+0x68>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1137 <strcat+0x37>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcat>:
mov    %rdi,%rax
mov    %rdi,%rcx
cs nopw 0x0(%rax,%rax,1)
cmpb   $0x0,(%rcx)
lea    0x1(%rcx),%rcx
jne    1110 <strcat+0x10>
mov    (%rsi),%dl
mov    %dl,-0x1(%rcx)
test   %dl,%dl
je     1142 <strcat+0x42>
xor    %edx,%edx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movzbl 0x1(%rsi,%rdx,1),%edi
mov    %dil,(%rcx,%rdx,1)
add    $0x1,%rdx
test   %dil,%dil
jne    1130 <strcat+0x30>
ret

LLVM IR (-O0):
define i8* @strcat(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
store i8* %6, i8** %5
br label %7
7: ; preds = %11, %2
%8 = load i8*, i8** %3
%9 = load i8, i8* %8
%10 = icmp ne i8 %9, 0
br i1 %10, label %11, label %14
11: ; preds = %7
%12 = load i8*, i8** %3
%13 = getelementptr inbounds i8, i8* %12, i32 1
store i8* %13, i8** %3
br label %7
14: ; preds = %7
br label %15
15: ; preds = %20, %14
%16 = load i8*, i8** %4
%17 = load i8, i8* %16
%18 = load i8*, i8** %3
store i8 %17, i8* %18
%19 = icmp ne i8 %17, 0
br i1 %19, label %20, label %25
20: ; preds = %15
%21 = load i8*, i8** %3
%22 = getelementptr inbounds i8, i8* %21, i32 1
store i8* %22, i8** %3
%23 = load i8*, i8** %4
%24 = getelementptr inbounds i8, i8* %23, i32 1
store i8* %24, i8** %4
br label %15
25: ; preds = %15
%26 = load i8*, i8** %5
ret i8* %26
}

LLVM IR (-O2):
define i8* @strcat(i8* returned %0, i8* nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %0, %2 ], [ %7, %3 ]
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = getelementptr inbounds i8, i8* %4, i64 1
br i1 %6, label %8, label %3
8: ; preds = %3
%9 = load i8, i8* %1
store i8 %9, i8* %4
%10 = icmp eq i8 %9, 0
br i1 %10, label %18, label %11
11: ; preds = %8, %11
%12 = phi i8* [ %14, %11 ], [ %4, %8 ]
%13 = phi i8* [ %15, %11 ], [ %1, %8 ]
%14 = getelementptr inbounds i8, i8* %12, i64 1
%15 = getelementptr inbounds i8, i8* %13, i64 1
%16 = load i8, i8* %15
store i8 %16, i8* %14
%17 = icmp eq i8 %16, 0
br i1 %17, label %18, label %11
18: ; preds = %11, %8
ret i8* %0
}
long int cast_char_long_fast(char x) { return (long int)x; }


x86 assembly (clang, -O0):
<cast_char_long_fast>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbq -0x1(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cast_char_long_fast>:
movslq %edi,%rax
ret

LLVM IR (-O0):
define i64 @cast_char_long_fast(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i64
ret i64 %4
}

LLVM IR (-O2):
define i64 @cast_char_long_fast(i8 signext %0) {
%2 = sext i8 %0 to i64
ret i64 %2
}
int test_imm_9Cint64_lowword_mem(long long *val) {
  return ((*val) & (0x9C << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_9Cint64_lowword_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdx
and    $0x9c,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_9Cint64_lowword_mem>:
testb  $0x9c,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_9Cint64_lowword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = and i64 %4, 156
%6 = icmp ne i64 %5, 0
%7 = zext i1 %6 to i64
%8 = select i1 %6, i32 -20, i32 -40
ret i32 %8
}

LLVM IR (-O2):
define i32 @test_imm_9Cint64_lowword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 156
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ fortchartoc(char *);
int /*<<< orphan*/ gmvwrite_nodev_fromfile(int /*<<< orphan*/, long);
void fgmvwrite_nodev_fromfile_(char filnam[], long nndes) {
  gmvwrite_nodev_fromfile(fortchartoc(filnam), nndes);
}


x86 assembly (clang, -O0):
<fgmvwrite_nodev_fromfile_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <fortchartoc@plt>
mov    %eax,%edi
mov    -0x10(%rbp),%rsi
call   1040 <gmvwrite_nodev_fromfile@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fgmvwrite_nodev_fromfile_>:
push   %rbx
mov    %rsi,%rbx
call   1030 <fortchartoc@plt>
mov    %eax,%edi
mov    %rbx,%rsi
pop    %rbx
jmp    1040 <gmvwrite_nodev_fromfile@plt>

LLVM IR (-O0):
define void @fgmvwrite_nodev_fromfile_(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i8*, i8** %3
%6 = call i32 @fortchartoc(i8* %5)
%7 = load i64, i64* %4
%8 = call i32 @gmvwrite_nodev_fromfile(i32 %6, i64 %7)
ret void
}

LLVM IR (-O2):
define void @fgmvwrite_nodev_fromfile_(i8* %0, i64 %1) {
%3 = tail call i32 @fortchartoc(i8* %0)
%4 = tail call i32 @gmvwrite_nodev_fromfile(i32 %3, i64 %1)
ret void
}
int test_imm_43uint16_reg(unsigned short val) {
  return ((val) & (0x43 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_43uint16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%edx
and    $0x43,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_43uint16_reg>:
test   $0x43,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_43uint16_reg(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = zext i16 %3 to i32
%5 = and i32 %4, 67
%6 = icmp ne i32 %5, 0
%7 = zext i1 %6 to i64
%8 = select i1 %6, i32 -20, i32 -40
ret i32 %8
}

LLVM IR (-O2):
define i32 @test_imm_43uint16_reg(i16 zeroext %0) {
%2 = and i16 %0, 67
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
void XrmPermStringToQuark() {}


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

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

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

LLVM IR (-O2):
define void @XrmPermStringToQuark() {
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t base2number(char base) {
  switch (base) {
  case 'A':
  case 'a':
    return (1);
  case 'C':
  case 'c':
    return (2);
  case 'G':
  case 'g':
    return (4);
  case 'T':
  case 't':
    return (8);
  default:
    return (16);
  }
}


x86 assembly (clang, -O0):
<base2number>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
add    $0xffffffbf,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0x33,%eax
ja     1164 <base2number+0x64>
mov    -0x10(%rbp),%rax
lea    0xed5(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movl   $0x1,-0x4(%rbp)
jmp    116b <base2number+0x6b>
movl   $0x2,-0x4(%rbp)
jmp    116b <base2number+0x6b>
movl   $0x4,-0x4(%rbp)
jmp    116b <base2number+0x6b>
movl   $0x8,-0x4(%rbp)
jmp    116b <base2number+0x6b>
movl   $0x10,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<base2number>:
add    $0xffffffbf,%edi
cmp    $0x33,%edi
ja     112f <base2number+0x2f>
mov    $0x1,%eax
lea    0xeec(%rip),%rcx
movslq (%rcx,%rdi,4),%rdx
add    %rcx,%rdx
jmp    *%rdx
mov    $0x2,%eax
ret
mov    $0x4,%eax
ret
mov    $0x8,%eax
ret
mov    $0x10,%eax
ret

LLVM IR (-O0):
define i32 @base2number(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
switch i32 %5, label %10 [
i32 65, label %6
i32 97, label %6
i32 67, label %7
i32 99, label %7
i32 71, label %8
i32 103, label %8
i32 84, label %9
i32 116, label %9
]
6: ; preds = %1, %1
store i32 1, i32* %2
br label %11
7: ; preds = %1, %1
store i32 2, i32* %2
br label %11
8: ; preds = %1, %1
store i32 4, i32* %2
br label %11
9: ; preds = %1, %1
store i32 8, i32* %2
br label %11
10: ; preds = %1
store i32 16, i32* %2
br label %11
11: ; preds = %10, %9, %8, %7, %6
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
define i32 @base2number(i8 signext %0) {
%2 = sext i8 %0 to i32
switch i32 %2, label %6 [
i32 65, label %7
i32 97, label %7
i32 67, label %3
i32 99, label %3
i32 71, label %4
i32 103, label %4
i32 84, label %5
i32 116, label %5
]
3: ; preds = %1, %1
br label %7
4: ; preds = %1, %1
br label %7
5: ; preds = %1, %1
br label %7
6: ; preds = %1
br label %7
7: ; preds = %1, %1, %6, %5, %4, %3
%8 = phi i32 [ 16, %6 ], [ 8, %5 ], [ 4, %4 ], [ 2, %3 ], [ 1, %1 ], [ 1, %1 ]
ret i32 %8
}
void test_isblank_macro(void) {
  int i, j;
  for (i = -127; i < 256;)
    j = i, printf("%s: %d -> %d\n", __FUNCTION__, j, isblank(i++) ? 1 : 0);
}


x86 assembly (clang, -O0):
<test_isblank_macro>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0xffffff81,-0x4(%rbp)
cmpl   $0x100,-0x4(%rbp)
jge    1184 <test_isblank_macro+0x64>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    %edi,%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
call   1040 <isblank@plt>
mov    -0xc(%rbp),%edx
mov    %eax,%esi
xor    %ecx,%ecx
mov    $0x1,%eax
cmp    $0x0,%esi
cmovne %eax,%ecx
lea    0xe8f(%rip),%rdi
lea    0xe96(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    112f <test_isblank_macro+0xf>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_isblank_macro>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    $0xffffff81,%ebx
lea    0xecd(%rip),%r14
lea    0xed4(%rip),%r15
nopw   0x0(%rax,%rax,1)
lea    0x1(%rbx),%ebp
mov    %ebx,%edi
call   1040 <isblank@plt>
xor    %ecx,%ecx
test   %eax,%eax
setne  %cl
mov    %r14,%rdi
mov    %r15,%rsi
mov    %ebx,%edx
xor    %eax,%eax
call   1030 <printf@plt>
mov    %ebp,%ebx
cmp    $0x100,%ebp
jne    1140 <test_isblank_macro+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [14 x i8] c"%s: %d -> %d\0A\00"
@__FUNCTION__.test_isblank_macro = [19 x i8] c"test_isblank_macro\00"
define void @test_isblank_macro() {
%1 = alloca i32
%2 = alloca i32
store i32 -127, i32* %1
br label %3
3: ; preds = %6, %0
%4 = load i32, i32* %1
%5 = icmp slt i32 %4, 256
br i1 %5, label %6, label %16
6: ; preds = %3
%7 = load i32, i32* %1
store i32 %7, i32* %2
%8 = load i32, i32* %2
%9 = load i32, i32* %1
%10 = add nsw i32 %9, 1
store i32 %10, i32* %1
%11 = call i32 @isblank(i32 %9)
%12 = icmp ne i32 %11, 0
%13 = zext i1 %12 to i64
%14 = select i1 %12, i32 1, i32 0
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([19 x i8], [19 x i8]* @__FUNCTION__.test_isblank_macro, i64 0, i64 0), i32 %8, i32 %14)
br label %3
16: ; preds = %3
ret void
}

LLVM IR (-O2):
@.str = [14 x i8] c"%s: %d -> %d\0A\00"
@__FUNCTION__.test_isblank_macro = [19 x i8] c"test_isblank_macro\00"
define void @test_isblank_macro() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ -127, %0 ], [ %3, %1 ]
%3 = add nsw i32 %2, 1
%4 = tail call i32 @isblank(i32 %2)
%5 = icmp ne i32 %4, 0
%6 = zext i1 %5 to i32
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([19 x i8], [19 x i8]* @__FUNCTION__.test_isblank_macro, i64 0, i64 0), i32 %2, i32 %6)
%8 = icmp eq i32 %3, 256
br i1 %8, label %9, label %1
9: ; preds = %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ createRandomTrees();
int main() {
  createRandomTrees();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <createRandomTrees@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <createRandomTrees@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @createRandomTrees()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @createRandomTrees()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ footer();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stdout;
void usage() {
  fprintf(stdout,
          "\n\n-----------------------    USAGE    "
          "-----------------------\n\nBenchmark your code using amdahl's law, "
          "this program is managed by using defines, you only have to include "
          "your .c application (which contains functions definitions), and "
          "specify functions and parameters required.\n\n");
  footer();
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x0,%al
call   1040 <footer@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <footer@plt>

LLVM IR (-O0):
@stdout = global i32 0
@.str = [279 x i8] c"\0A\0A----------------------- USAGE -----------------------\0A\0ABenchmark your code using amdahl's law, this program is managed by using defines, you only have to include your .c application (which contains functions definitions), and specify functions and parameters required.\0A\0A\00"
define void @usage() {
%1 = load i32, i32* @stdout
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([279 x i8], [279 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (...) @footer()
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [279 x i8] c"\0A\0A----------------------- USAGE -----------------------\0A\0ABenchmark your code using amdahl's law, this program is managed by using defines, you only have to include your .c application (which contains functions definitions), and specify functions and parameters required.\0A\0A\00"
define void @usage() {
%1 = load i32, i32* @stdout
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([279 x i8], [279 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (...) @footer()
ret void
}
void SCB_InvalidateICache(void) {}


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

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

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

LLVM IR (-O2):
define void @SCB_InvalidateICache() {
ret void
}
/* Type definitions */
struct item {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ abort_crypto_lib(char *);
int /*<<< orphan*/ is_pair(struct item *);
void check_is_pair(struct item *item) {
  if (!is_pair(item))
    abort_crypto_lib("Presented item is not a pair item");
}


x86 assembly (clang, -O0):
<check_is_pair>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <is_pair@plt>
cmp    $0x0,%eax
jne    114a <check_is_pair+0x2a>
lea    0xebb(%rip),%rdi
call   1040 <abort_crypto_lib@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_is_pair>:
push   %rax
call   1030 <is_pair@plt>
test   %eax,%eax
je     112c <check_is_pair+0xc>
pop    %rax
ret
lea    0xecd(%rip),%rdi
pop    %rax
jmp    1040 <abort_crypto_lib@plt>

LLVM IR (-O0):
%struct.item = type { i32 }
@.str = [34 x i8] c"Presented item is not a pair item\00"
define void @check_is_pair(%struct.item* %0) {
%2 = alloca %struct.item*
store %struct.item* %0, %struct.item** %2
%3 = load %struct.item*, %struct.item** %2
%4 = call i32 @is_pair(%struct.item* %3)
%5 = icmp ne i32 %4, 0
br i1 %5, label %8, label %6
6: ; preds = %1
%7 = call i32 @abort_crypto_lib(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %1
ret void
}

LLVM IR (-O2):
%struct.item = type { i32 }
@.str = [34 x i8] c"Presented item is not a pair item\00"
define void @check_is_pair(%struct.item* %0) {
%2 = tail call i32 @is_pair(%struct.item* %0)
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @abort_crypto_lib(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %1
ret void
}
/* Variables and functions */
int strlen(char *);
int getPinNumber(char *arg) {
  if (strlen(arg) != 1)
    return -1;
  if (*arg >= '0' && *arg <= '7')
    return *arg - '0';
  return -1;
}


x86 assembly (clang, -O0):
<getPinNumber>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
cmp    $0x1,%eax
je     113a <getPinNumber+0x2a>
movl   $0xffffffff,-0x4(%rbp)
jmp    1173 <getPinNumber+0x63>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x30,%eax
jl     116c <getPinNumber+0x5c>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x37,%eax
jg     116c <getPinNumber+0x5c>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
sub    $0x30,%eax
mov    %eax,-0x4(%rbp)
jmp    1173 <getPinNumber+0x63>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getPinNumber>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    $0xffffffff,%eax
cmp    $0x1,%ecx
jne    1137 <getPinNumber+0x27>
movzbl (%rbx),%ecx
mov    %ecx,%edx
and    $0xf8,%dl
cmp    $0x30,%dl
jne    1137 <getPinNumber+0x27>
add    $0xffffffd0,%ecx
mov    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @getPinNumber(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = call i32 @strlen(i8* %4)
%6 = icmp ne i32 %5, 1
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 -1, i32* %2
br label %24
8: ; preds = %1
%9 = load i8*, i8** %3
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
%12 = icmp sge i32 %11, 48
br i1 %12, label %13, label %23
13: ; preds = %8
%14 = load i8*, i8** %3
%15 = load i8, i8* %14
%16 = sext i8 %15 to i32
%17 = icmp sle i32 %16, 55
br i1 %17, label %18, label %23
18: ; preds = %13
%19 = load i8*, i8** %3
%20 = load i8, i8* %19
%21 = sext i8 %20 to i32
%22 = sub nsw i32 %21, 48
store i32 %22, i32* %2
br label %24
23: ; preds = %13, %8
store i32 -1, i32* %2
br label %24
24: ; preds = %23, %18, %7
%25 = load i32, i32* %2
ret i32 %25
}

LLVM IR (-O2):
define i32 @getPinNumber(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = icmp eq i32 %2, 1
br i1 %3, label %4, label %11
4: ; preds = %1
%5 = load i8, i8* %0
%6 = and i8 %5, -8
%7 = icmp eq i8 %6, 48
br i1 %7, label %8, label %11
8: ; preds = %4
%9 = zext i8 %5 to i32
%10 = add nsw i32 %9, -48
br label %11
11: ; preds = %4, %1, %8
%12 = phi i32 [ %10, %8 ], [ -1, %1 ], [ -1, %4 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ strcpy(char *, char *);
int save_history(char **history, char *cmd_input, int commands_run) {
  int index = commands_run++ % 10;
  strcpy(history[index], cmd_input);
  return commands_run;
}


x86 assembly (clang, -O0):
<save_history>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0x14(%rbp)
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x18(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<save_history>:
push   %rbx
movslq %edx,%rax
lea    0x1(%rdx),%ebx
imul   $0x66666667,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x22,%rcx
add    %edx,%ecx
add    %ecx,%ecx
lea    (%rcx,%rcx,4),%ecx
sub    %ecx,%eax
cltq
mov    (%rdi,%rax,8),%rdi
call   1030 <strcpy@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @save_history(i8** %0, i8* %1, i32 %2) {
%4 = alloca i8**
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
store i8** %0, i8*** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%8 = load i32, i32* %6
%9 = add nsw i32 %8, 1
store i32 %9, i32* %6
%10 = srem i32 %8, 10
store i32 %10, i32* %7
%11 = load i8**, i8*** %4
%12 = load i32, i32* %7
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i8*, i8** %11, i64 %13
%15 = load i8*, i8** %14
%16 = load i8*, i8** %5
%17 = call i32 @strcpy(i8* %15, i8* %16)
%18 = load i32, i32* %6
ret i32 %18
}

LLVM IR (-O2):
define i32 @save_history(i8** nocapture %0, i8* %1, i32 %2) {
%4 = add nsw i32 %2, 1
%5 = srem i32 %2, 10
%6 = sext i32 %5 to i64
%7 = getelementptr inbounds i8*, i8** %0, i64 %6
%8 = load i8*, i8** %7
%9 = tail call i32 @strcpy(i8* %8, i8* %1)
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128i;

/* Variables and functions */
int /*<<< orphan*/ _mm_set_epi8(int, int, int, int, int, int, int, int, int,
                                int, int, int, int /*<<< orphan*/, int, int,
                                int);
int /*<<< orphan*/ _mm_shuffle_epi8(int /*<<< orphan*/, int /*<<< orphan*/);
__attribute__((always_)) __m128i rot8(__m128i x) {
  return _mm_shuffle_epi8(
      x, _mm_set_epi8(12, 15, 14, 13, 8, 11, 10, 9, 4, 7, 6, 5, 0, 3, 2, 1));
}


x86 assembly (clang, -O0):
<rot8>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    $0xc,%edi
mov    $0xf,%esi
mov    $0xe,%edx
mov    $0xd,%ecx
mov    $0x8,%r8d
mov    $0xb,%r9d
xor    %eax,%eax
movl   $0xa,(%rsp)
movl   $0x9,0x8(%rsp)
movl   $0x4,0x10(%rsp)
movl   $0x7,0x18(%rsp)
movl   $0x6,0x20(%rsp)
movl   $0x5,0x28(%rsp)
movl   $0x0,0x30(%rsp)
movl   $0x3,0x38(%rsp)
movl   $0x2,0x40(%rsp)
movl   $0x1,0x48(%rsp)
call   1040 <_mm_set_epi8@plt>
mov    -0x8(%rbp),%edi
mov    %eax,%esi
call   1030 <_mm_shuffle_epi8@plt>
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rot8>:
push   %rbx
mov    %edi,%ebx
mov    $0xc,%edi
mov    $0xf,%esi
mov    $0xe,%edx
mov    $0xd,%ecx
mov    $0x8,%r8d
mov    $0xb,%r9d
push   $0x1
push   $0x2
push   $0x3
push   $0x0
push   $0x5
push   $0x6
push   $0x7
push   $0x4
push   $0x9
push   $0xa
call   1040 <_mm_set_epi8@plt>
add    $0x50,%rsp
mov    %ebx,%edi
mov    %eax,%esi
pop    %rbx
jmp    1030 <_mm_shuffle_epi8@plt>

LLVM IR (-O0):
define i32 @rot8(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @_mm_set_epi8(i32 12, i32 15, i32 14, i32 13, i32 8, i32 11, i32 10, i32 9, i32 4, i32 7, i32 6, i32 5, i32 0, i32 3, i32 2, i32 1)
%5 = call i32 @_mm_shuffle_epi8(i32 %3, i32 %4)
ret i32 %5
}

LLVM IR (-O2):
define i32 @rot8(i32 %0) {
%2 = tail call i32 @_mm_set_epi8(i32 12, i32 15, i32 14, i32 13, i32 8, i32 11, i32 10, i32 9, i32 4, i32 7, i32 6, i32 5, i32 0, i32 3, i32 2, i32 1)
%3 = tail call i32 @_mm_shuffle_epi8(i32 %0, i32 %2)
ret i32 %3
}
/* Variables and functions */
int get_click_count(char *);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, char *);
int main() {
  char input_text[160];
  int clicks_needed = 0;
  scanf("%[^\n]s", input_text);
  clicks_needed = get_click_count(input_text);
  printf("%d", clicks_needed);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xc0,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0xb4(%rbp)
lea    -0xb0(%rbp),%rsi
lea    0xea6(%rip),%rdi
call   1050 <scanf@plt>
lea    -0xb0(%rbp),%rdi
call   1030 <get_click_count@plt>
mov    %eax,-0xb4(%rbp)
mov    -0xb4(%rbp),%esi
lea    0xe89(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0xc0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0xa0,%rsp
lea    0xec1(%rip),%rdi
mov    %rsp,%rbx
mov    %rbx,%rsi
call   1050 <scanf@plt>
mov    %rbx,%rdi
call   1030 <get_click_count@plt>
lea    0xeae(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0xa0,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [7 x i8] c"%[^\0A]s\00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca [160 x i8]
%2 = getelementptr inbounds [160 x i8], [160 x i8]* %1, i64 0, i64 0
%3 = call i32 @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = call i32 @get_click_count(i8* %2)
%5 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %4)
ret i32 0
}
int do_612() { return 612; }


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

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

LLVM IR (-O0):
define i32 @do_612() {
ret i32 612
}

LLVM IR (-O2):
define i32 @do_612() {
ret i32 612
}
int sike_r2_fp_code_identifier() { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @sike_r2_fp_code_identifier() {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
void error(const char *msg) {
  fprintf(stderr, "%s\n", msg);
  exit(1);
}


x86 assembly (clang, -O0):
<error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<error>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [4 x i8] c"%s\0A\00"
define void @error(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [4 x i8] c"%s\0A\00"
define void @error(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int main(void) {
  int x = 10, y = 20;
  if (y != x)
    printf("y: %d is not equal to x: %d", y, x);
  else
    printf("comparison is false");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xa,-0x8(%rbp)
movl   $0x14,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
je     1152 <main+0x42>
mov    -0xc(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xeba(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1160 <main+0x50>
lea    0xec3(%rip),%rdi
mov    $0x0,%al
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    $0x14,%esi
mov    $0xa,%edx
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [28 x i8] c"y: %d is not equal to x: %d\00"
@.str.1 = [20 x i8] c"comparison is false\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 10, i32* %2
store i32 20, i32* %3
%4 = load i32, i32* %3
%5 = load i32, i32* %2
%6 = icmp ne i32 %4, %5
br i1 %6, label %7, label %11
7: ; preds = %0
%8 = load i32, i32* %3
%9 = load i32, i32* %2
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i32 %8, i32 %9)
br label %13
11: ; preds = %0
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0))
br label %13
13: ; preds = %11, %7
ret i32 0
}

LLVM IR (-O2):
@.str = [28 x i8] c"y: %d is not equal to x: %d\00"
define i32 @main() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i32 20, i32 10)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ cwd;

/* Variables and functions */
int /*<<< orphan*/ getcwd(char *, int);
int /*<<< orphan*/ printf(char *, char *);
void pwdfunc() {
  char cwd[2000];
  getcwd(cwd, sizeof(cwd));
  printf("%s\n", cwd);
}


x86 assembly (clang, -O0):
<pwdfunc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x7d0,%rsp
lea    -0x7d0(%rbp),%rdi
mov    $0x7d0,%esi
call   1040 <getcwd@plt>
lea    -0x7d0(%rbp),%rsi
lea    0xeb6(%rip),%rdi
call   1030 <printf@plt>
add    $0x7d0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pwdfunc>:
push   %rbx
sub    $0x7d0,%rsp
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x7d0,%esi
call   1040 <getcwd@plt>
lea    0xec1(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
add    $0x7d0,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%s\0A\00"
define void @pwdfunc() {
%1 = alloca [2000 x i8]
%2 = getelementptr inbounds [2000 x i8], [2000 x i8]* %1, i64 0, i64 0
%3 = call i32 @getcwd(i8* %2, i32 2000)
%4 = getelementptr inbounds [2000 x i8], [2000 x i8]* %1, i64 0, i64 0
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %4)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define void @pwdfunc() {
%1 = alloca [2000 x i8]
%2 = getelementptr inbounds [2000 x i8], [2000 x i8]* %1, i64 0, i64 0
%3 = call i32 @getcwd(i8* %2, i32 2000)
%4 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ SIGILL;
int /*<<< orphan*/ raise(int /*<<< orphan*/);
int main(int argc, char *argv[]) { raise(SIGILL); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2ec2(%rip),%rax
mov    (%rax),%edi
call   1030 <raise@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2ed0(%rip),%rax
mov    (%rax),%edi
call   1030 <raise@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@SIGILL = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = load i32, i32* @SIGILL
%6 = call i32 @raise(i32 %5)
ret i32 0
}

LLVM IR (-O2):
@SIGILL = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = load i32, i32* @SIGILL
%4 = tail call i32 @raise(i32 %3)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
void *malloc(size_t);
int /*<<< orphan*/ perror(char *);
void *emalloc(size_t size) {
  void *retval = malloc(size);
  if (retval == NULL) {
    perror("Error in function emalloc()");
    exit(0);
  }
  return retval;
}


x86 assembly (clang, -O0):
<emalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1167 <emalloc+0x37>
lea    0xea5(%rip),%rdi
call   1040 <perror@plt>
xor    %edi,%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<emalloc>:
push   %rax
call   1030 <malloc@plt>
test   %rax,%rax
je     113d <emalloc+0xd>
pop    %rcx
ret
lea    0xebc(%rip),%rdi
call   1040 <perror@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [28 x i8] c"Error in function emalloc()\00"
define i8* @emalloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp eq i8* %6, null
br i1 %7, label %8, label %11
8: ; preds = %1
%9 = call i32 @perror(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
%10 = call i32 @exit(i32 0)
unreachable
11: ; preds = %1
%12 = load i8*, i8** %3
ret i8* %12
}

LLVM IR (-O2):
@.str = [28 x i8] c"Error in function emalloc()\00"
define noalias i8* @emalloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = tail call i32 @perror(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
%6 = tail call i32 @exit(i32 0)
unreachable
7: ; preds = %1
ret i8* %2
}
void foo506(int p) {}


x86 assembly (clang, -O0):
<foo506>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @foo506(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void buzz() { printf("Buzz\n"); }


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

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

LLVM IR (-O0):
@.str = [6 x i8] c"Buzz\0A\00"
define void @buzz() {
%1 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [5 x i8] c"Buzz\00"
define void @buzz() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ notify_pvcall(char *);
int pvGetCCDSize(char byBoardNum, int *nWidth, int *nHeight) {
  notify_pvcall("f");
  return (0);
}


x86 assembly (clang, -O0):
<pvGetCCDSize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
lea    0xed3(%rip),%rdi
call   1030 <notify_pvcall@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pvGetCCDSize>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <notify_pvcall@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [2 x i8] c"f\00"
define i32 @pvGetCCDSize(i8 signext %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 = call i32 @notify_pvcall(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [2 x i8] c"f\00"
define i32 @pvGetCCDSize(i8 signext %0, i32* nocapture readnone %1, i32* nocapture readnone %2) {
%4 = tail call i32 @notify_pvcall(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
int BCHCode_Decode(struct BCHCode *BCHCode_data, int recd[]) {
  (void)BCHCode_data;
  (void)recd;
  return 0;
}


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

x86 assembly (clang, -O2):
<BCHCode_Decode>:
xor    %eax,%eax
ret

LLVM IR (-O0):
%struct.BCHCode = type opaque
define i32 @BCHCode_Decode(%struct.BCHCode* %0, i32* %1) {
%3 = alloca %struct.BCHCode*
%4 = alloca i32*
store %struct.BCHCode* %0, %struct.BCHCode** %3
store i32* %1, i32** %4
%5 = load %struct.BCHCode*, %struct.BCHCode** %3
%6 = load i32*, i32** %4
ret i32 0
}

LLVM IR (-O2):
%struct.BCHCode = type opaque
define i32 @BCHCode_Decode(%struct.BCHCode* nocapture readnone %0, i32* nocapture readnone %1) {
ret i32 0
}
extern int GetScreenSize() {
  int retval;
  __asm__ __volatile__("int $0x40" : "=a"(retval) : "a"(61), "b"(1));
  return retval;
}


x86 assembly (clang, -O0):
<GetScreenSize>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
mov    $0x3d,%eax
mov    $0x1,%ebx
int    $0x40
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<GetScreenSize>:
push   %rbx
mov    $0x3d,%eax
mov    $0x1,%ebx
int    $0x40
pop    %rbx
ret

LLVM IR (-O0):
define i32 @GetScreenSize() {
%1 = alloca i32
%2 = call i32 asm sideeffect "int $$0x40", "={ax},{ax},{bx},~{dirflag},~{fpsr},~{flags}"(i32 61, i32 1)
store i32 %2, i32* %1
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
define i32 @GetScreenSize() {
%1 = tail call i32 asm sideeffect "int $$0x40", "={ax},{ax},{bx},~{dirflag},~{fpsr},~{flags}"(i32 61, i32 1)
ret i32 %1
}
int dblcmp(double val1, double val2) {
  long double diff = (long double)val1 - (long double)val2;
  if (diff > 1e-13) {
    return 1;
  } else if (-diff > 1e-13) {
    return -1;
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<dblcmp>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
fldl   -0x10(%rbp)
fldl   -0x18(%rbp)
fsubrp %st,%st(1)
fstpt  -0x30(%rbp)
fldt   -0x30(%rbp)
fldl   0xede(%rip)
fxch   %st(1)
fucomip %st(1),%st
fstp   %st(0)
jbe    113f <dblcmp+0x3f>
jmp    1133 <dblcmp+0x33>
movl   $0x1,-0x4(%rbp)
jmp    1170 <dblcmp+0x70>
fldt   -0x30(%rbp)
fld    %st(0)
fchs
fstp   %st(0)
fldl   0xeba(%rip)
fucomip %st(1),%st
fstp   %st(0)
jbe    1169 <dblcmp+0x69>
jmp    115d <dblcmp+0x5d>
movl   $0xffffffff,-0x4(%rbp)
jmp    1170 <dblcmp+0x70>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<dblcmp>:
movsd  %xmm0,-0x8(%rsp)
fldl   -0x8(%rsp)
movsd  %xmm1,-0x10(%rsp)
fsubl  -0x10(%rsp)
fldl   0xee6(%rip)
xor    %ecx,%ecx
fucomip %st(1),%st
seta   %cl
neg    %ecx
fldl   0xedf(%rip)
fxch   %st(1)
fucomip %st(1),%st
fstp   %st(0)
mov    $0x1,%eax
cmovbe %ecx,%eax
ret

LLVM IR (-O0):
define i32 @dblcmp(double %0, double %1) {
%3 = alloca i32
%4 = alloca double
%5 = alloca double
%6 = alloca x86_fp80
store double %0, double* %4
store double %1, double* %5
%7 = load double, double* %4
%8 = fpext double %7 to x86_fp80
%9 = load double, double* %5
%10 = fpext double %9 to x86_fp80
%11 = fsub x86_fp80 %8, %10
store x86_fp80 %11, x86_fp80* %6
%12 = load x86_fp80, x86_fp80* %6
%13 = fcmp ogt x86_fp80 %12, 0xK3FD3E12E13424BB41000
br i1 %13, label %14, label %15
14: ; preds = %2
store i32 1, i32* %3
br label %21
15: ; preds = %2
%16 = load x86_fp80, x86_fp80* %6
%17 = fneg x86_fp80 %16
%18 = fcmp ogt x86_fp80 %17, 0xK3FD3E12E13424BB41000
br i1 %18, label %19, label %20
19: ; preds = %15
store i32 -1, i32* %3
br label %21
20: ; preds = %15
store i32 0, i32* %3
br label %21
21: ; preds = %20, %19, %14
%22 = load i32, i32* %3
ret i32 %22
}

LLVM IR (-O2):
define i32 @dblcmp(double %0, double %1) {
%3 = fpext double %0 to x86_fp80
%4 = fpext double %1 to x86_fp80
%5 = fsub x86_fp80 %3, %4
%6 = fcmp ogt x86_fp80 %5, 0xK3FD3E12E13424BB41000
%7 = fcmp olt x86_fp80 %5, 0xKBFD3E12E13424BB41000
%8 = sext i1 %7 to i32
%9 = select i1 %6, i32 1, i32 %8
ret i32 %9
}
/* Variables and functions */
int get1();
void skipStr(void) {
  int cnt = get1() / 4;
  while (--cnt >= 0)
    get1();
}


x86 assembly (clang, -O0):
<skipStr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <get1@plt>
mov    $0x4,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x4(%rbp)
cmp    $0x0,%eax
jl     1148 <skipStr+0x38>
mov    $0x0,%al
call   1030 <get1@plt>
jmp    112a <skipStr+0x1a>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<skipStr>:
push   %rbx
xor    %eax,%eax
call   1030 <get1@plt>
cmp    $0x4,%eax
jl     113f <skipStr+0x2f>
mov    %eax,%ebx
shr    $0x2,%ebx
add    $0x1,%ebx
cs nopw 0x0(%rax,%rax,1)
nop
xor    %eax,%eax
call   1030 <get1@plt>
add    $0xffffffff,%ebx
cmp    $0x1,%ebx
ja     1130 <skipStr+0x20>
pop    %rbx
ret

LLVM IR (-O0):
define void @skipStr() {
%1 = alloca i32
%2 = call i32 (...) @get1()
%3 = sdiv i32 %2, 4
store i32 %3, i32* %1
br label %4
4: ; preds = %8, %0
%5 = load i32, i32* %1
%6 = add nsw i32 %5, -1
store i32 %6, i32* %1
%7 = icmp sge i32 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %4
%9 = call i32 (...) @get1()
br label %4
10: ; preds = %4
ret void
}

LLVM IR (-O2):
define void @skipStr() {
%1 = tail call i32 (...) @get1()
%2 = icmp sgt i32 %1, 3
br i1 %2, label %3, label %10
3: ; preds = %0
%4 = lshr i32 %1, 2
br label %5
5: ; preds = %3, %5
%6 = phi i32 [ %7, %5 ], [ %4, %3 ]
%7 = add nsw i32 %6, -1
%8 = tail call i32 (...) @get1()
%9 = icmp ugt i32 %6, 1
br i1 %9, label %5, label %10
10: ; preds = %5, %0
ret void
}
/* Variables and functions */
long long strtoll(char const *, char **, int);
long long strtonum(const char *numstr, long long minval, long long maxval,
                   const char **errstrp) {
  char *ep;
  return (strtoll(numstr, &ep, 10));
}


x86 assembly (clang, -O0):
<strtonum>:
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
lea    -0x28(%rbp),%rsi
mov    $0xa,%edx
call   1030 <strtoll@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strtonum>:
push   %rax
mov    %rsp,%rsi
mov    $0xa,%edx
call   1030 <strtoll@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i64 @strtonum(i8* %0, i64 %1, i64 %2, i8** %3) {
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i64
%8 = alloca i8**
%9 = alloca i8*
store i8* %0, i8** %5
store i64 %1, i64* %6
store i64 %2, i64* %7
store i8** %3, i8*** %8
%10 = load i8*, i8** %5
%11 = call i64 @strtoll(i8* %10, i8** %9, i32 10)
ret i64 %11
}

LLVM IR (-O2):
define i64 @strtonum(i8* %0, i64 %1, i64 %2, i8** nocapture readnone %3) {
%5 = alloca i8*
%6 = bitcast i8** %5 to i8*
%7 = call i64 @strtoll(i8* %0, i8** %5, i32 10)
ret i64 %7
}
/* Variables and functions */
int _rdrand16_step(unsigned short *);
int rdrand16(unsigned short *p) { return _rdrand16_step(p); }


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

x86 assembly (clang, -O2):
<rdrand16>:
jmp    1030 <_rdrand16_step@plt>

LLVM IR (-O0):
define i32 @rdrand16(i16* %0) {
%2 = alloca i16*
store i16* %0, i16** %2
%3 = load i16*, i16** %2
%4 = call i32 @_rdrand16_step(i16* %3)
ret i32 %4
}

LLVM IR (-O2):
define i32 @rdrand16(i16* %0) {
%2 = tail call i32 @_rdrand16_step(i16* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void ze_red() { printf("[31m"); }


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

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

LLVM IR (-O0):
@.str = [6 x i8] c"\1B[31m\00"
define void @ze_red() {
%1 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"\1B[31m\00"
define void @ze_red() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret void
}
int ispow2(int n) {
  int i;
  int bitset = 0;
  for (i = 0; i < 32; i++) {
    if (n && (1 << i)) {
      bitset++;
    }
    if (bitset > 1) {
      return ((0));
    }
  }
  return ((1));
}


x86 assembly (clang, -O0):
<ispow2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x20,-0xc(%rbp)
jge    116e <ispow2+0x6e>
cmpl   $0x0,-0x8(%rbp)
je     1145 <ispow2+0x45>
mov    -0xc(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
cmp    $0x0,%eax
je     1145 <ispow2+0x45>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
cmpl   $0x1,-0x10(%rbp)
jle    115b <ispow2+0x5b>
movl   $0x0,-0x4(%rbp)
jmp    1175 <ispow2+0x75>
jmp    1160 <ispow2+0x60>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1115 <ispow2+0x15>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ispow2>:
xor    %eax,%eax
test   %edi,%edi
sete   %al
ret

LLVM IR (-O0):
define i32 @ispow2(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 0, i32* %5
store i32 0, i32* %4
br label %6
6: ; preds = %24, %1
%7 = load i32, i32* %4
%8 = icmp slt i32 %7, 32
br i1 %8, label %9, label %27
9: ; preds = %6
%10 = load i32, i32* %3
%11 = icmp ne i32 %10, 0
br i1 %11, label %12, label %19
12: ; preds = %9
%13 = load i32, i32* %4
%14 = shl i32 1, %13
%15 = icmp ne i32 %14, 0
br i1 %15, label %16, label %19
16: ; preds = %12
%17 = load i32, i32* %5
%18 = add nsw i32 %17, 1
store i32 %18, i32* %5
br label %19
19: ; preds = %16, %12, %9
%20 = load i32, i32* %5
%21 = icmp sgt i32 %20, 1
br i1 %21, label %22, label %23
22: ; preds = %19
store i32 0, i32* %2
br label %28
23: ; preds = %19
br label %24
24: ; preds = %23
%25 = load i32, i32* %4
%26 = add nsw i32 %25, 1
store i32 %26, i32* %4
br label %6
27: ; preds = %6
store i32 1, i32* %2
br label %28
28: ; preds = %27, %22
%29 = load i32, i32* %2
ret i32 %29
}

LLVM IR (-O2):
define i32 @ispow2(i32 %0) {
%2 = icmp eq i32 %0, 0
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int w5100_readSn(unsigned int, int, int /*<<< orphan*/ *, int);
unsigned readSnDHAR(unsigned sock, uint8_t *buf) {
  return w5100_readSn(sock, 0x0006, buf, 6);
}


x86 assembly (clang, -O0):
<readSnDHAR>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rdx
mov    $0x6,%ecx
mov    %ecx,%esi
call   1030 <w5100_readSn@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<readSnDHAR>:
mov    %rsi,%rdx
mov    $0x6,%esi
mov    $0x6,%ecx
jmp    1030 <w5100_readSn@plt>

LLVM IR (-O0):
define i32 @readSnDHAR(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 = call i32 @w5100_readSn(i32 %5, i32 6, i32* %6, i32 6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @readSnDHAR(i32 %0, i32* %1) {
%3 = tail call i32 @w5100_readSn(i32 %0, i32 6, i32* %1, i32 6)
ret i32 %3
}
/* Type definitions */
struct BasePRNGObject {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ stdlib_base_prng_free(struct BasePRNGObject *);
void stdlib_base_random_randi_free(struct BasePRNGObject *obj) {
  stdlib_base_prng_free(obj);
}


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

x86 assembly (clang, -O2):
<stdlib_base_random_randi_free>:
jmp    1030 <stdlib_base_prng_free@plt>

LLVM IR (-O0):
%struct.BasePRNGObject = type { i32 }
define void @stdlib_base_random_randi_free(%struct.BasePRNGObject* %0) {
%2 = alloca %struct.BasePRNGObject*
store %struct.BasePRNGObject* %0, %struct.BasePRNGObject** %2
%3 = load %struct.BasePRNGObject*, %struct.BasePRNGObject** %2
%4 = call i32 @stdlib_base_prng_free(%struct.BasePRNGObject* %3)
ret void
}

LLVM IR (-O2):
%struct.BasePRNGObject = type { i32 }
define void @stdlib_base_random_randi_free(%struct.BasePRNGObject* %0) {
%2 = tail call i32 @stdlib_base_prng_free(%struct.BasePRNGObject* %0)
ret void
}