xunge/DecIR huggingface dataset:
/* Variables and functions */
int code_table_4_0(unsigned char **);
unsigned char *percentile_value_location(unsigned char **sec) {
  int pdt;
  unsigned char *p;
  pdt = code_table_4_0(sec);
  switch (pdt) {
  case 6:
  case 10:
    p = sec[4] + 34;
    break;
  default:
    p = NULL;
    break;
  }
  return p;
}


x86 assembly (clang, -O0):
<percentile_value_location>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <code_table_4_0@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x1c(%rbp)
sub    $0x6,%eax
je     114d <percentile_value_location+0x3d>
jmp    113c <percentile_value_location+0x2c>
mov    -0x1c(%rbp),%eax
sub    $0xa,%eax
jne    1162 <percentile_value_location+0x52>
jmp    114d <percentile_value_location+0x3d>
mov    -0x8(%rbp),%rax
mov    0x20(%rax),%rax
add    $0x22,%rax
mov    %rax,-0x18(%rbp)
jmp    116a <percentile_value_location+0x5a>
movq   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<percentile_value_location>:
push   %rbx
mov    %rdi,%rbx
call   1030 <code_table_4_0@plt>
cmp    $0xa,%eax
je     1123 <percentile_value_location+0x13>
cmp    $0x6,%eax
jne    112d <percentile_value_location+0x1d>
mov    0x20(%rbx),%rax
add    $0x22,%rax
pop    %rbx
ret
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @percentile_value_location(i8** %0) {
%2 = alloca i8**
%3 = alloca i32
%4 = alloca i8*
store i8** %0, i8*** %2
%5 = load i8**, i8*** %2
%6 = call i32 @code_table_4_0(i8** %5)
store i32 %6, i32* %3
%7 = load i32, i32* %3
switch i32 %7, label %13 [
i32 6, label %8
i32 10, label %8
]
8: ; preds = %1, %1
%9 = load i8**, i8*** %2
%10 = getelementptr inbounds i8*, i8** %9, i64 4
%11 = load i8*, i8** %10
%12 = getelementptr inbounds i8, i8* %11, i64 34
store i8* %12, i8** %4
br label %14
13: ; preds = %1
store i8* null, i8** %4
br label %14
14: ; preds = %13, %8
%15 = load i8*, i8** %4
ret i8* %15
}

LLVM IR (-O2):
define i8* @percentile_value_location(i8** %0) {
%2 = tail call i32 @code_table_4_0(i8** %0)
switch i32 %2, label %7 [
i32 6, label %3
i32 10, label %3
]
3: ; preds = %1, %1
%4 = getelementptr inbounds i8*, i8** %0, i64 4
%5 = load i8*, i8** %4
%6 = getelementptr inbounds i8, i8* %5, i64 34
br label %7
7: ; preds = %1, %3
%8 = phi i8* [ %6, %3 ], [ null, %1 ]
ret i8* %8
}
void RTRandU32(void) {}


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

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

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

LLVM IR (-O2):
define void @RTRandU32() {
ret void
}
unsigned short unsignedshort_ignoring_unsignedshortint(unsigned short x,
                                                       unsigned short int y) {
  return x;
}


x86 assembly (clang, -O0):
<unsignedshort_ignoring_unsignedshortint>:
push   %rbp
mov    %rsp,%rbp
mov    %si,%ax
mov    %di,%cx
mov    %cx,-0x2(%rbp)
mov    %ax,-0x4(%rbp)
movzwl -0x2(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<unsignedshort_ignoring_unsignedshortint>:
mov    %edi,%eax
ret

LLVM IR (-O0):
define zeroext i16 @unsignedshort_ignoring_unsignedshortint(i16 zeroext %0, i16 zeroext %1) {
%3 = alloca i16
%4 = alloca i16
store i16 %0, i16* %3
store i16 %1, i16* %4
%5 = load i16, i16* %3
ret i16 %5
}

LLVM IR (-O2):
define zeroext i16 @unsignedshort_ignoring_unsignedshortint(i16 returned zeroext %0, i16 zeroext %1) {
ret i16 %0
}
void *Function20Handle(void *a, void *b, void *c, void *d, void *e, void *f,
                       void *g, void *h, void *i, void *j, void *k, void *l,
                       void *m, void *n, void *o, void *p, void *q, void *r,
                       void *s, void *t) {
  return a;
}


x86 assembly (clang, -O0):
<Function20Handle>:
push   %rbp
mov    %rsp,%rbp
mov    0x78(%rbp),%rax
mov    0x70(%rbp),%rax
mov    0x68(%rbp),%rax
mov    0x60(%rbp),%rax
mov    0x58(%rbp),%rax
mov    0x50(%rbp),%rax
mov    0x48(%rbp),%rax
mov    0x40(%rbp),%rax
mov    0x38(%rbp),%rax
mov    0x30(%rbp),%rax
mov    0x28(%rbp),%rax
mov    0x20(%rbp),%rax
mov    0x18(%rbp),%rax
mov    0x10(%rbp),%rax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Function20Handle>:
mov    %rdi,%rax
ret

LLVM IR (-O0):
define i8* @Function20Handle(i8* %0, i8* %1, i8* %2, i8* %3, i8* %4, i8* %5, i8* %6, i8* %7, i8* %8, i8* %9, i8* %10, i8* %11, i8* %12, i8* %13, i8* %14, i8* %15, i8* %16, i8* %17, i8* %18, i8* %19) {
%21 = alloca i8*
%22 = alloca i8*
%23 = alloca i8*
%24 = alloca i8*
%25 = alloca i8*
%26 = alloca i8*
%27 = alloca i8*
%28 = alloca i8*
%29 = alloca i8*
%30 = alloca i8*
%31 = alloca i8*
%32 = alloca i8*
%33 = alloca i8*
%34 = alloca i8*
%35 = alloca i8*
%36 = alloca i8*
%37 = alloca i8*
%38 = alloca i8*
%39 = alloca i8*
%40 = alloca i8*
store i8* %0, i8** %21
store i8* %1, i8** %22
store i8* %2, i8** %23
store i8* %3, i8** %24
store i8* %4, i8** %25
store i8* %5, i8** %26
store i8* %6, i8** %27
store i8* %7, i8** %28
store i8* %8, i8** %29
store i8* %9, i8** %30
store i8* %10, i8** %31
store i8* %11, i8** %32
store i8* %12, i8** %33
store i8* %13, i8** %34
store i8* %14, i8** %35
store i8* %15, i8** %36
store i8* %16, i8** %37
store i8* %17, i8** %38
store i8* %18, i8** %39
store i8* %19, i8** %40
%41 = load i8*, i8** %21
ret i8* %41
}

LLVM IR (-O2):
define i8* @Function20Handle(i8* readnone returned %0, i8* nocapture readnone %1, i8* nocapture readnone %2, i8* nocapture readnone %3, i8* nocapture readnone %4, i8* nocapture readnone %5, i8* nocapture readnone %6, i8* nocapture readnone %7, i8* nocapture readnone %8, i8* nocapture readnone %9, i8* nocapture readnone %10, i8* nocapture readnone %11, i8* nocapture readnone %12, i8* nocapture readnone %13, i8* nocapture readnone %14, i8* nocapture readnone %15, i8* nocapture readnone %16, i8* nocapture readnone %17, i8* nocapture readnone %18, i8* nocapture readnone %19) {
ret i8* %0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int subi(uint32_t *env) {
  uint32_t *context = (uint32_t *)*(uint32_t **)(env + 1);
  int a = (int)*(int *)(context);
  int b = (int)*(int *)(context + 1);
  return a - b;
}


x86 assembly (clang, -O0):
<subi>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    0x4(%rax),%eax
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%eax
sub    -0x18(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<subi>:
mov    0x4(%rdi),%rcx
mov    (%rcx),%eax
sub    0x4(%rcx),%eax
ret

LLVM IR (-O0):
define i32 @subi(i32* %0) {
%2 = alloca i32*
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
store i32* %0, i32** %2
%6 = load i32*, i32** %2
%7 = getelementptr inbounds i32, i32* %6, i64 1
%8 = bitcast i32* %7 to i32**
%9 = load i32*, i32** %8
store i32* %9, i32** %3
%10 = load i32*, i32** %3
%11 = load i32, i32* %10
store i32 %11, i32* %4
%12 = load i32*, i32** %3
%13 = getelementptr inbounds i32, i32* %12, i64 1
%14 = load i32, i32* %13
store i32 %14, i32* %5
%15 = load i32, i32* %4
%16 = load i32, i32* %5
%17 = sub nsw i32 %15, %16
ret i32 %17
}

LLVM IR (-O2):
define i32 @subi(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 1
%3 = bitcast i32* %2 to i32**
%4 = load i32*, i32** %3
%5 = load i32, i32* %4
%6 = getelementptr inbounds i32, i32* %4, i64 1
%7 = load i32, i32* %6
%8 = sub nsw i32 %5, %7
ret i32 %8
}
/* Type definitions */
struct L0 {
  int dummy;
};

/* Variables and functions */
scalar_t__ __VERIFIER_nondet_int();
int /*<<< orphan*/ l0_destroy(struct L0 *);
int /*<<< orphan*/ l0_insert(struct L0 **);
int main() {
  static struct L0 *list;
  int c = 0;
  do {
    l0_insert(&list);
    c++;
  } while (__VERIFIER_nondet_int() && c < 3);
  l0_destroy(list);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
lea    0x2ef3(%rip),%rdi
call   1050 <l0_insert@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x9(%rbp)
je     117e <main+0x4e>
cmpl   $0x3,-0x8(%rbp)
setl   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
test   $0x1,%al
jne    1146 <main+0x16>
mov    0x2eb0(%rip),%rdi
call   1040 <l0_destroy@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
lea    0x2f05(%rip),%r14
xor    %ebx,%ebx
nopl   (%rax)
mov    %r14,%rdi
call   1050 <l0_insert@plt>
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_int@plt>
test   %rax,%rax
je     115e <main+0x2e>
lea    0x1(%rbx),%eax
cmp    $0x2,%ebx
mov    %eax,%ebx
jb     1140 <main+0x10>
mov    0x2edb(%rip),%rdi
call   1040 <l0_destroy@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.L0 = type { i32 }
@main.list = internal global %struct.L0* null
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
br label %3
3: ; preds = %13, %0
%4 = call i32 @l0_insert(%struct.L0** @main.list)
%5 = load i32, i32* %2
%6 = add nsw i32 %5, 1
store i32 %6, i32* %2
br label %7
7: ; preds = %3
%8 = call i64 (...) @__VERIFIER_nondet_int()
%9 = icmp ne i64 %8, 0
br i1 %9, label %10, label %13
10: ; preds = %7
%11 = load i32, i32* %2
%12 = icmp slt i32 %11, 3
br label %13
13: ; preds = %10, %7
%14 = phi i1 [ false, %7 ], [ %12, %10 ]
br i1 %14, label %3, label %15
15: ; preds = %13
%16 = load %struct.L0*, %struct.L0** @main.list
%17 = call i32 @l0_destroy(%struct.L0* %16)
%18 = load i32, i32* %1
ret i32 %18
}

LLVM IR (-O2):
%struct.L0 = type { i32 }
@main.list = internal global %struct.L0* null
define i32 @main() {
br label %1
1: ; preds = %1, %0
%2 = phi i32 [ 0, %0 ], [ %4, %1 ]
%3 = tail call i32 @l0_insert(%struct.L0** @main.list)
%4 = add nuw nsw i32 %2, 1
%5 = tail call i64 (...) @__VERIFIER_nondet_int()
%6 = icmp ne i64 %5, 0
%7 = icmp ult i32 %2, 2
%8 = select i1 %6, i1 %7, i1 false
br i1 %8, label %1, label %9
9: ; preds = %1
%10 = load %struct.L0*, %struct.L0** @main.list
%11 = tail call i32 @l0_destroy(%struct.L0* %10)
ret i32 0
}
short test6(short a) {
  a &= 0x7fff;
  a >>= 2;
  return a;
}


x86 assembly (clang, -O0):
<test6>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%eax
and    $0x7fff,%eax
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%eax
sar    $0x2,%eax
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test6>:
mov    %edi,%eax
shr    $0x2,%eax
and    $0x1fff,%eax
ret

LLVM IR (-O0):
define signext i16 @test6(i16 signext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = sext i16 %3 to i32
%5 = and i32 %4, 32767
%6 = trunc i32 %5 to i16
store i16 %6, i16* %2
%7 = load i16, i16* %2
%8 = sext i16 %7 to i32
%9 = ashr i32 %8, 2
%10 = trunc i32 %9 to i16
store i16 %10, i16* %2
%11 = load i16, i16* %2
ret i16 %11
}

LLVM IR (-O2):
define signext i16 @test6(i16 signext %0) {
%2 = lshr i16 %0, 2
%3 = and i16 %2, 8191
ret i16 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char *argv[]) { printf("Hello world\n"); }


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

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

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

LLVM IR (-O2):
@str = [12 x i8] c"Hello world\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int atoi(char const *);
int module_libc_atoi(const char *str) { return atoi(str); }


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

x86 assembly (clang, -O2):
<module_libc_atoi>:
jmp    1030 <atoi@plt>

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

LLVM IR (-O2):
define i32 @module_libc_atoi(i8* nocapture %0) {
%2 = tail call i32 @atoi(i8* %0)
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ buf2;

/* Variables and functions */
int /*<<< orphan*/ sflap_send(char *, int, int);
int /*<<< orphan*/ snprintf(char *, int, char *, int, char *, char *);
void serv_chat_whisper(int id, char *who, char *message) {
  char buf2[2048];
  snprintf(buf2, sizeof(buf2), "toc_chat_whisper %d %s \"%s\"", id, who,
           message);
  sflap_send(buf2, -1, 2);
}


x86 assembly (clang, -O0):
<serv_chat_whisper>:
push   %rbp
mov    %rsp,%rbp
sub    $0x820,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
lea    -0x820(%rbp),%rdi
mov    -0x4(%rbp),%ecx
mov    -0x10(%rbp),%r8
mov    -0x18(%rbp),%r9
mov    $0x800,%esi
lea    0xeac(%rip),%rdx
call   1030 <snprintf@plt>
lea    -0x820(%rbp),%rdi
mov    $0xffffffff,%esi
mov    $0x2,%edx
call   1040 <sflap_send@plt>
add    $0x820,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<serv_chat_whisper>:
push   %rbx
sub    $0x800,%rsp
mov    %rdx,%r9
mov    %rsi,%r8
mov    %edi,%ecx
lea    0xec9(%rip),%rdx
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x800,%esi
call   1030 <snprintf@plt>
mov    %rbx,%rdi
mov    $0xffffffff,%esi
mov    $0x2,%edx
call   1040 <sflap_send@plt>
add    $0x800,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [28 x i8] c"toc_chat_whisper %d %s \22%s\22\00"
define void @serv_chat_whisper(i32 %0, i8* %1, i8* %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca [2048 x i8]
store i32 %0, i32* %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%8 = getelementptr inbounds [2048 x i8], [2048 x i8]* %7, i64 0, i64 0
%9 = load i32, i32* %4
%10 = load i8*, i8** %5
%11 = load i8*, i8** %6
%12 = call i32 @snprintf(i8* %8, i32 2048, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i32 %9, i8* %10, i8* %11)
%13 = getelementptr inbounds [2048 x i8], [2048 x i8]* %7, i64 0, i64 0
%14 = call i32 @sflap_send(i8* %13, i32 -1, i32 2)
ret void
}

LLVM IR (-O2):
@.str = [28 x i8] c"toc_chat_whisper %d %s \22%s\22\00"
define void @serv_chat_whisper(i32 %0, i8* %1, i8* %2) {
%4 = alloca [2048 x i8]
%5 = getelementptr inbounds [2048 x i8], [2048 x i8]* %4, i64 0, i64 0
%6 = call i32 @snprintf(i8* %5, i32 2048, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i32 %0, i8* %1, i8* %2)
%7 = call i32 @sflap_send(i8* %5, i32 -1, i32 2)
ret void
}
/* Variables and functions */
int isBlankNewLineChars(char const *, size_t const);
scalar_t__ isCharacter(char const *, size_t const);
int isValid(const char *ccp_input, const size_t i_offset) {
  return ((isCharacter(ccp_input, i_offset) == 0)
              ? 0
              : isBlankNewLineChars(ccp_input, i_offset));
}


x86 assembly (clang, -O0):
<isValid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <isCharacter@plt>
cmp    $0x0,%rax
jne    1151 <isValid+0x31>
xor    %eax,%eax
mov    %eax,-0x14(%rbp)
jmp    1161 <isValid+0x41>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <isBlankNewLineChars@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isValid>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <isCharacter@plt>
test   %rax,%rax
je     1146 <isValid+0x26>
mov    %rbx,%rdi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <isBlankNewLineChars@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @isValid(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 = load i64, i64* %4
%7 = call i64 @isCharacter(i8* %5, i64 %6)
%8 = icmp eq i64 %7, 0
br i1 %8, label %9, label %10
9: ; preds = %2
br label %14
10: ; preds = %2
%11 = load i8*, i8** %3
%12 = load i64, i64* %4
%13 = call i32 @isBlankNewLineChars(i8* %11, i64 %12)
br label %14
14: ; preds = %10, %9
%15 = phi i32 [ 0, %9 ], [ %13, %10 ]
ret i32 %15
}

LLVM IR (-O2):
define i32 @isValid(i8* %0, i64 %1) {
%3 = tail call i64 @isCharacter(i8* %0, i64 %1)
%4 = icmp eq i64 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 @isBlankNewLineChars(i8* %0, i64 %1)
br label %7
7: ; preds = %2, %5
%8 = phi i32 [ %6, %5 ], [ 0, %2 ]
ret i32 %8
}
char valueToHexDigit(unsigned char d) {
  if (d >= 0 && d < 10) {
    return d + 48;
  } else if (d > 9 && d < 16) {
    return d + 55;
  }
  return 0;
}


x86 assembly (clang, -O0):
<valueToHexDigit>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x2(%rbp)
movzbl -0x2(%rbp),%eax
cmp    $0x0,%eax
jl     1133 <valueToHexDigit+0x33>
movzbl -0x2(%rbp),%eax
cmp    $0xa,%eax
jge    1133 <valueToHexDigit+0x33>
movzbl -0x2(%rbp),%eax
add    $0x30,%eax
mov    %al,-0x1(%rbp)
jmp    1165 <valueToHexDigit+0x65>
movzbl -0x2(%rbp),%eax
cmp    $0x9,%eax
jle    115c <valueToHexDigit+0x5c>
movzbl -0x2(%rbp),%eax
cmp    $0x10,%eax
jge    115c <valueToHexDigit+0x5c>
movzbl -0x2(%rbp),%eax
add    $0x37,%eax
mov    %al,-0x1(%rbp)
jmp    1165 <valueToHexDigit+0x65>
jmp    1161 <valueToHexDigit+0x61>
movb   $0x0,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<valueToHexDigit>:
lea    0x30(%rdi),%eax
lea    0x37(%rdi),%ecx
xor    %edx,%edx
cmp    $0x10,%dil
movzbl %cl,%ecx
cmovae %edx,%ecx
cmp    $0xa,%dil
movzbl %al,%eax
cmovae %ecx,%eax
ret

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

LLVM IR (-O2):
define signext i8 @valueToHexDigit(i8 zeroext %0) {
%2 = icmp ult i8 %0, 10
%3 = add i8 %0, 48
%4 = icmp ult i8 %0, 16
%5 = add i8 %0, 55
%6 = select i1 %4, i8 %5, i8 0
%7 = select i1 %2, i8 %3, i8 %6
ret i8 %7
}
/* Type definitions */
typedef int int64_t;

/* Variables and functions */
int64_t __compare_by_pointer(const void *keyA, const void *keyB) {
  return keyA - keyB;
}


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

x86 assembly (clang, -O2):
<__compare_by_pointer>:
mov    %rdi,%rax
sub    %esi,%eax
ret

LLVM IR (-O0):
define i32 @__compare_by_pointer(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = ptrtoint i8* %5 to i64
%8 = ptrtoint i8* %6 to i64
%9 = sub i64 %7, %8
%10 = trunc i64 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @__compare_by_pointer(i8* %0, i8* %1) {
%3 = ptrtoint i8* %0 to i64
%4 = ptrtoint i8* %1 to i64
%5 = sub i64 %3, %4
%6 = trunc i64 %5 to i32
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ pass_init();
int /*<<< orphan*/ ramfs_clean();
int /*<<< orphan*/ ramfs_init();
int /*<<< orphan*/ sqfs_gen();
int /*<<< orphan*/ sqfs_init();
int /*<<< orphan*/ sshd_init();
void abms_init(void) {
  ramfs_init();
  pass_init();
  sshd_init();
  sqfs_gen();
  ramfs_clean();
  sqfs_init();
}


x86 assembly (clang, -O0):
<abms_init>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1050 <ramfs_init@plt>
mov    $0x0,%al
call   1060 <pass_init@plt>
mov    $0x0,%al
call   1030 <sshd_init@plt>
mov    $0x0,%al
call   1080 <sqfs_gen@plt>
mov    $0x0,%al
call   1070 <ramfs_clean@plt>
mov    $0x0,%al
call   1040 <sqfs_init@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<abms_init>:
push   %rax
xor    %eax,%eax
call   1050 <ramfs_init@plt>
xor    %eax,%eax
call   1060 <pass_init@plt>
xor    %eax,%eax
call   1030 <sshd_init@plt>
xor    %eax,%eax
call   1080 <sqfs_gen@plt>
xor    %eax,%eax
call   1070 <ramfs_clean@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <sqfs_init@plt>

LLVM IR (-O0):
define void @abms_init() {
%1 = call i32 (...) @ramfs_init()
%2 = call i32 (...) @pass_init()
%3 = call i32 (...) @sshd_init()
%4 = call i32 (...) @sqfs_gen()
%5 = call i32 (...) @ramfs_clean()
%6 = call i32 (...) @sqfs_init()
ret void
}

LLVM IR (-O2):
define void @abms_init() {
%1 = tail call i32 (...) @ramfs_init()
%2 = tail call i32 (...) @pass_init()
%3 = tail call i32 (...) @sshd_init()
%4 = tail call i32 (...) @sqfs_gen()
%5 = tail call i32 (...) @ramfs_clean()
%6 = tail call i32 (...) @sqfs_init()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Putl(int, int);
extern void SetDimensions(int width, int height) {
  Putl(0x40, width | (height << 16));
}


x86 assembly (clang, -O0):
<SetDimensions>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%eax
shl    $0x10,%eax
or     %eax,%esi
mov    $0x40,%edi
call   1030 <Putl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SetDimensions>:
shl    $0x10,%esi
or     %edi,%esi
mov    $0x40,%edi
jmp    1030 <Putl@plt>

LLVM IR (-O0):
define void @SetDimensions(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 %6, 16
%8 = or i32 %5, %7
%9 = call i32 @Putl(i32 64, i32 %8)
ret void
}

LLVM IR (-O2):
define void @SetDimensions(i32 %0, i32 %1) {
%3 = shl i32 %1, 16
%4 = or i32 %3, %0
%5 = tail call i32 @Putl(i32 64, i32 %4)
ret void
}
/* Variables and functions */
int getStartValueImpl();
int getStartValue() { return getStartValueImpl(); }


x86 assembly (clang, -O0):
<getStartValue>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <getStartValueImpl@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<getStartValue>:
xor    %eax,%eax
jmp    1030 <getStartValueImpl@plt>

LLVM IR (-O0):
define i32 @getStartValue() {
%1 = call i32 (...) @getStartValueImpl()
ret i32 %1
}

LLVM IR (-O2):
define i32 @getStartValue() {
%1 = tail call i32 (...) @getStartValueImpl()
ret i32 %1
}
/* Variables and functions */
int atoi(char *);
extern unsigned get_revision_number_SM_SOCKET() { return atoi("0"); }


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

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

LLVM IR (-O0):
@.str = [2 x i8] c"0\00"
define i32 @get_revision_number_SM_SOCKET() {
%1 = call i32 @atoi(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}

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


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

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

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

LLVM IR (-O2):
@str = [9 x i8] c"CarStep1\00"
define void @CarStep1() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str, i64 0, i64 0))
ret void
}
void shut_down_in(float delay) {}


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

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

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

LLVM IR (-O2):
define void @shut_down_in(float %0) {
ret void
}
/* Type definitions */
typedef int uint8_t;
typedef scalar_t__ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ __wleu32(int *, scalar_t__);
int i2c_transact(int, int, int *, int, int /*<<< orphan*/);
int i2c_write_leuint32(int fd, int chip_addr, int reg, uint32_t value) {
  uint8_t data[1 + sizeof(uint32_t)];
  data[0] = reg;
  __wleu32(&data[1], (uint32_t)value);
  return i2c_transact(fd, chip_addr, data, 1 + sizeof(uint32_t), 0);
}


x86 assembly (clang, -O0):
<i2c_write_leuint32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %rcx,-0x18(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x40(%rbp)
lea    -0x40(%rbp),%rdi
add    $0x4,%rdi
mov    -0x18(%rbp),%rsi
call   1030 <__wleu32@plt>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
lea    -0x40(%rbp),%rdx
mov    $0x9,%ecx
xor    %r8d,%r8d
call   1040 <i2c_transact@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<i2c_write_leuint32>:
push   %rbp
push   %rbx
sub    $0x28,%rsp
mov    %esi,%ebx
mov    %edi,%ebp
mov    %edx,(%rsp)
lea    0x4(%rsp),%rdi
mov    %rcx,%rsi
call   1030 <__wleu32@plt>
mov    %rsp,%rdx
mov    %ebp,%edi
mov    %ebx,%esi
mov    $0x9,%ecx
xor    %r8d,%r8d
call   1040 <i2c_transact@plt>
add    $0x28,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @i2c_write_leuint32(i32 %0, i32 %1, i32 %2, i64 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i64
%9 = alloca [9 x i32]
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i64 %3, i64* %8
%10 = load i32, i32* %7
%11 = getelementptr inbounds [9 x i32], [9 x i32]* %9, i64 0, i64 0
store i32 %10, i32* %11
%12 = getelementptr inbounds [9 x i32], [9 x i32]* %9, i64 0, i64 1
%13 = load i64, i64* %8
%14 = call i32 @__wleu32(i32* %12, i64 %13)
%15 = load i32, i32* %5
%16 = load i32, i32* %6
%17 = getelementptr inbounds [9 x i32], [9 x i32]* %9, i64 0, i64 0
%18 = call i32 @i2c_transact(i32 %15, i32 %16, i32* %17, i32 9, i32 0)
ret i32 %18
}

LLVM IR (-O2):
define i32 @i2c_write_leuint32(i32 %0, i32 %1, i32 %2, i64 %3) {
%5 = alloca [9 x i32]
%6 = bitcast [9 x i32]* %5 to i8*
%7 = getelementptr inbounds [9 x i32], [9 x i32]* %5, i64 0, i64 0
store i32 %2, i32* %7
%8 = getelementptr inbounds [9 x i32], [9 x i32]* %5, i64 0, i64 1
%9 = call i32 @__wleu32(i32* %8, i64 %3)
%10 = call i32 @i2c_transact(i32 %0, i32 %1, i32* %7, i32 9, i32 0)
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void print_int_val(const void *v) { printf("%d\n", *((int *)v)); }


x86 assembly (clang, -O0):
<print_int_val>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%esi
lea    0xed7(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_int_val>:
mov    (%rdi),%esi
lea    0xee7(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
define void @print_int_val(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to i32*
%5 = load i32, i32* %4
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %5)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define void @print_int_val(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %3)
ret void
}
unsigned long b_system_config(unsigned long function, unsigned long var) {
  unsigned long tlong;
  asm volatile("call *0x00100080" : "=a"(tlong) : "d"(function), "a"(var));
  return tlong;
}


x86 assembly (clang, -O0):
<b_system_config>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rax
call   *0x100080
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<b_system_config>:
mov    %rsi,%rax
mov    %rdi,%rdx
call   *0x100080
ret

LLVM IR (-O0):
define i64 @b_system_config(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%6 = load i64, i64* %3
%7 = load i64, i64* %4
%8 = call i64 asm sideeffect "call *0x00100080", "={ax},{dx},{ax},~{dirflag},~{fpsr},~{flags}"(i64 %6, i64 %7)
store i64 %8, i64* %5
%9 = load i64, i64* %5
ret i64 %9
}

LLVM IR (-O2):
define i64 @b_system_config(i64 %0, i64 %1) {
%3 = tail call i64 asm sideeffect "call *0x00100080", "={ax},{dx},{ax},~{dirflag},~{fpsr},~{flags}"(i64 %0, i64 %1)
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ strcmp(char *, char const *);
char *strrchr(char const *, char);
char *has_library_ext(const char *filename, const char *so_ext) {
  char *ext = 0;
  ext = strrchr(filename, '.');
  if (ext && !strcmp(ext, so_ext))
    return ext;
  return 0;
}


x86 assembly (clang, -O0):
<has_library_ext>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x2e,%esi
call   1030 <strrchr@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     1178 <has_library_ext+0x58>
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%eax
jne    1178 <has_library_ext+0x58>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1180 <has_library_ext+0x60>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<has_library_ext>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    $0x2e,%esi
call   1030 <strrchr@plt>
test   %rax,%rax
je     1148 <has_library_ext+0x28>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
call   1040 <strcmp@plt>
test   %eax,%eax
je     114a <has_library_ext+0x2a>
xor    %ebx,%ebx
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @has_library_ext(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* null, i8** %6
%7 = load i8*, i8** %4
%8 = call i8* @strrchr(i8* %7, i8 signext 46)
store i8* %8, i8** %6
%9 = load i8*, i8** %6
%10 = icmp ne i8* %9, null
br i1 %10, label %11, label %18
11: ; preds = %2
%12 = load i8*, i8** %6
%13 = load i8*, i8** %5
%14 = call i32 @strcmp(i8* %12, i8* %13)
%15 = icmp ne i32 %14, 0
br i1 %15, label %18, label %16
16: ; preds = %11
%17 = load i8*, i8** %6
store i8* %17, i8** %3
br label %19
18: ; preds = %11, %2
store i8* null, i8** %3
br label %19
19: ; preds = %18, %16
%20 = load i8*, i8** %3
ret i8* %20
}

LLVM IR (-O2):
define i8* @has_library_ext(i8* %0, i8* nocapture %1) {
%3 = tail call i8* @strrchr(i8* dereferenceable(1) %0, i8 signext 46)
%4 = icmp eq i8* %3, null
br i1 %4, label %8, label %5
5: ; preds = %2
%6 = tail call i32 @strcmp(i8* %3, i8* dereferenceable(1) %1)
%7 = icmp eq i32 %6, 0
br i1 %7, label %9, label %8
8: ; preds = %5, %2
br label %9
9: ; preds = %5, %8
%10 = phi i8* [ null, %8 ], [ %3, %5 ]
ret i8* %10
}
/* Variables and functions */
int check_arg_count(int, int);
int /*<<< orphan*/ report_count(int);
int /*<<< orphan*/ report_error(char *);
void cmd_add_wchnstr(int nargs, char **args) {
  if (check_arg_count(nargs, 1) == 1)
    return;
  report_count(1);
  report_error("UNSUPPORTED");
}


x86 assembly (clang, -O0):
<cmd_add_wchnstr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x1,%esi
call   1030 <check_arg_count@plt>
cmp    $0x1,%eax
jne    115a <cmd_add_wchnstr+0x2a>
jmp    1170 <cmd_add_wchnstr+0x40>
mov    $0x1,%edi
call   1040 <report_count@plt>
lea    0xe95(%rip),%rdi
call   1050 <report_error@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmd_add_wchnstr>:
push   %rax
mov    $0x1,%esi
call   1030 <check_arg_count@plt>
cmp    $0x1,%eax
jne    1142 <cmd_add_wchnstr+0x12>
pop    %rax
ret
mov    $0x1,%edi
call   1040 <report_count@plt>
lea    0xead(%rip),%rdi
pop    %rax
jmp    1050 <report_error@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"UNSUPPORTED\00"
define void @cmd_add_wchnstr(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 @check_arg_count(i32 %5, i32 1)
%7 = icmp eq i32 %6, 1
br i1 %7, label %8, label %9
8: ; preds = %2
br label %12
9: ; preds = %2
%10 = call i32 @report_count(i32 1)
%11 = call i32 @report_error(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
br label %12
12: ; preds = %9, %8
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"UNSUPPORTED\00"
define void @cmd_add_wchnstr(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @check_arg_count(i32 %0, i32 1)
%4 = icmp eq i32 %3, 1
br i1 %4, label %8, label %5
5: ; preds = %2
%6 = tail call i32 @report_count(i32 1)
%7 = tail call i32 @report_error(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %2, %5
ret void
}
/* Variables and functions */
int /*<<< orphan*/ glutPassiveMotionFunc(void (*)(int, int));
void s2winPassiveMotionFunc(void (*func)(int x, int y)) {
  glutPassiveMotionFunc(func);
}


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

x86 assembly (clang, -O2):
<s2winPassiveMotionFunc>:
jmp    1030 <glutPassiveMotionFunc@plt>

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

LLVM IR (-O2):
define void @s2winPassiveMotionFunc(void (i32, i32)* %0) {
%2 = tail call i32 @glutPassiveMotionFunc(void (i32, i32)* %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ atomic_postsub_uint32_t(int /*<<< orphan*/ *, int);
uint32_t atomic_postdec_uint32_t(uint32_t *var) {
  return atomic_postsub_uint32_t(var, 1);
}


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

x86 assembly (clang, -O2):
<atomic_postdec_uint32_t>:
mov    $0x1,%esi
jmp    1030 <atomic_postsub_uint32_t@plt>

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

LLVM IR (-O2):
define i32 @atomic_postdec_uint32_t(i32* %0) {
%2 = tail call i32 @atomic_postsub_uint32_t(i32* %0, i32 1)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ isdigit(char);
int isNumber(char *input) {
  while (*input) {
    if (!isdigit(*input))
      return 0;
    else
      input += 1;
  }
  return 1;
}


x86 assembly (clang, -O0):
<isNumber>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     115b <isNumber+0x4b>
mov    -0x10(%rbp),%rax
movsbl (%rax),%edi
call   1030 <isdigit@plt>
cmp    $0x0,%eax
jne    114a <isNumber+0x3a>
movl   $0x0,-0x4(%rbp)
jmp    1162 <isNumber+0x52>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    111c <isNumber+0xc>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isNumber>:
push   %rbp
push   %rbx
push   %rax
mov    (%rdi),%al
mov    $0x1,%ebp
test   %al,%al
je     114b <isNumber+0x3b>
mov    %rdi,%rbx
add    $0x1,%rbx
cs nopw 0x0(%rax,%rax,1)
nop
movsbl %al,%edi
call   1030 <isdigit@plt>
test   %eax,%eax
je     1149 <isNumber+0x39>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1130 <isNumber+0x20>
jmp    114b <isNumber+0x3b>
xor    %ebp,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @isNumber(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %13, label %7
4: ; preds = %7
%5 = load i8, i8* %12
%6 = icmp eq i8 %5, 0
br i1 %6, label %13, label %7
7: ; preds = %1, %4
%8 = phi i8 [ %5, %4 ], [ %2, %1 ]
%9 = phi i8* [ %12, %4 ], [ %0, %1 ]
%10 = tail call i32 @isdigit(i8 signext %8)
%11 = icmp eq i32 %10, 0
%12 = getelementptr inbounds i8, i8* %9, i64 1
br i1 %11, label %13, label %4
13: ; preds = %7, %4, %1
%14 = phi i32 [ 1, %1 ], [ 1, %4 ], [ 0, %7 ]
ret i32 %14
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
void usage(void) {
  puts("romprog <devicefile> -w <romdump>\n"
       "  Write a binary ROM blob to a rom programmer at a device file\n\n"
       "romprog <devicefile> -r <romdump>\n"
       "  Read a binary ROM blob from a rom programmer to a file\n");
}


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

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

LLVM IR (-O0):
@.str = [190 x i8] c"romprog <devicefile> -w <romdump>\0A Write a binary ROM blob to a rom programmer at a device file\0A\0Aromprog <devicefile> -r <romdump>\0A Read a binary ROM blob from a rom programmer to a file\0A\00"
define void @usage() {
%1 = call i32 @puts(i8* getelementptr inbounds ([190 x i8], [190 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [190 x i8] c"romprog <devicefile> -w <romdump>\0A Write a binary ROM blob to a rom programmer at a device file\0A\0Aromprog <devicefile> -r <romdump>\0A Read a binary ROM blob from a rom programmer to a file\0A\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([190 x i8], [190 x i8]* @.str, i64 0, i64 0))
ret void
}
int goal_state_init(void) { return 0; }


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

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

LLVM IR (-O0):
define i32 @goal_state_init() {
ret i32 0
}

LLVM IR (-O2):
define i32 @goal_state_init() {
ret i32 0
}
int __attribute__((stdcall)) version_minor() { return 0; }


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

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

LLVM IR (-O0):
define i32 @version_minor() {
ret i32 0
}

LLVM IR (-O2):
define i32 @version_minor() {
ret i32 0
}
int decrypt_byte(unsigned long *pkeys, const unsigned long *pcrc_32_tab) {
  unsigned temp;
  (void)pcrc_32_tab;
  temp = ((unsigned)(*(pkeys + 2)) & 0xffff) | 2;
  return (int)(((temp * (temp ^ 1)) >> 8) & 0xff);
}


x86 assembly (clang, -O0):
<decrypt_byte>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    0x10(%rax),%rax
and    $0xffff,%eax
or     $0x2,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0x14(%rbp),%ecx
xor    $0x1,%ecx
imul   %ecx,%eax
shr    $0x8,%eax
and    $0xff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<decrypt_byte>:
mov    $0xfffd,%eax
and    0x10(%rdi),%eax
lea    0x2(%rax),%ecx
xor    $0x3,%eax
imul   %ecx,%eax
movzbl %ah,%eax
ret

LLVM IR (-O0):
define i32 @decrypt_byte(i64* %0, i64* %1) {
%3 = alloca i64*
%4 = alloca i64*
%5 = alloca i32
store i64* %0, i64** %3
store i64* %1, i64** %4
%6 = load i64*, i64** %4
%7 = load i64*, i64** %3
%8 = getelementptr inbounds i64, i64* %7, i64 2
%9 = load i64, i64* %8
%10 = trunc i64 %9 to i32
%11 = and i32 %10, 65535
%12 = or i32 %11, 2
store i32 %12, i32* %5
%13 = load i32, i32* %5
%14 = load i32, i32* %5
%15 = xor i32 %14, 1
%16 = mul i32 %13, %15
%17 = lshr i32 %16, 8
%18 = and i32 %17, 255
ret i32 %18
}

LLVM IR (-O2):
define i32 @decrypt_byte(i64* nocapture %0, i64* nocapture readnone %1) {
%3 = getelementptr inbounds i64, i64* %0, i64 2
%4 = load i64, i64* %3
%5 = trunc i64 %4 to i32
%6 = and i32 %5, 65533
%7 = or i32 %6, 2
%8 = xor i32 %6, 3
%9 = mul nuw i32 %7, %8
%10 = lshr i32 %9, 8
%11 = and i32 %10, 255
ret i32 %11
}
void biosfn_alternate_prtsc() {}


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

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

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

LLVM IR (-O2):
define void @biosfn_alternate_prtsc() {
ret void
}
extern __attribute__((__gnu___)) long double __attribute__((__const__))
cargl(long double _Complex _Z) {
  long double res;
  __asm__("fpatan;" : "=t"(res) : "0"(__real__ _Z), "u"(__imag__ _Z) : "st(1)");
  return res;
}


x86 assembly (clang, -O0):
<cargl>:
push   %rbp
mov    %rsp,%rbp
lea    0x10(%rbp),%rax
fldt   (%rax)
fldt   0x10(%rax)
fxch   %st(1)
fpatan
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<cargl>:
fldt   0x8(%rsp)
fldt   0x18(%rsp)
fxch   %st(1)
fpatan
ret

LLVM IR (-O0):
define x86_fp80 @cargl({ x86_fp80, x86_fp80 }* byval({ x86_fp80, x86_fp80 }) align 16 %0) {
%2 = alloca x86_fp80
%3 = getelementptr inbounds { x86_fp80, x86_fp80 }, { x86_fp80, x86_fp80 }* %0, i32 0, i32 0
%4 = load x86_fp80, x86_fp80* %3
%5 = getelementptr inbounds { x86_fp80, x86_fp80 }, { x86_fp80, x86_fp80 }* %0, i32 0, i32 1
%6 = load x86_fp80, x86_fp80* %5
%7 = call x86_fp80 asm "fpatan;", "={st},0,{st(1)},~{st(1)},~{dirflag},~{fpsr},~{flags}"(x86_fp80 %4, x86_fp80 %6)
store x86_fp80 %7, x86_fp80* %2
%8 = load x86_fp80, x86_fp80* %2
ret x86_fp80 %8
}

LLVM IR (-O2):
define x86_fp80 @cargl({ x86_fp80, x86_fp80 }* nocapture byval({ x86_fp80, x86_fp80 }) align 16 %0) {
%2 = getelementptr inbounds { x86_fp80, x86_fp80 }, { x86_fp80, x86_fp80 }* %0, i64 0, i32 0
%3 = load x86_fp80, x86_fp80* %2
%4 = getelementptr inbounds { x86_fp80, x86_fp80 }, { x86_fp80, x86_fp80 }* %0, i64 0, i32 1
%5 = load x86_fp80, x86_fp80* %4
%6 = tail call x86_fp80 asm "fpatan;", "={st},0,{st(1)},~{st(1)},~{dirflag},~{fpsr},~{flags}"(x86_fp80 %3, x86_fp80 %5)
ret x86_fp80 %6
}
/* Variables and functions */
int helper(int, int *);
int *init_table(int);
int climbStairs(int n) {
  int *table = init_table(n);
  return helper(n, table);
}


x86 assembly (clang, -O0):
<climbStairs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <init_table@plt>
mov    %rax,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1040 <helper@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<climbStairs>:
push   %rbx
mov    %edi,%ebx
call   1030 <init_table@plt>
mov    %ebx,%edi
mov    %rax,%rsi
pop    %rbx
jmp    1040 <helper@plt>

LLVM IR (-O0):
define i32 @climbStairs(i32 %0) {
%2 = alloca i32
%3 = alloca i32*
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i32* @init_table(i32 %4)
store i32* %5, i32** %3
%6 = load i32, i32* %2
%7 = load i32*, i32** %3
%8 = call i32 @helper(i32 %6, i32* %7)
ret i32 %8
}

LLVM IR (-O2):
define i32 @climbStairs(i32 %0) {
%2 = tail call i32* @init_table(i32 %0)
%3 = tail call i32 @helper(i32 %0, i32* %2)
ret i32 %3
}
void STD_go(int sig) { return; }


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

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

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

LLVM IR (-O2):
define void @STD_go(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
int /*<<< orphan*/ printf(char *, char *);
char *strutil_remove(char *, int, int);
int main(void) {
  char *str = "Hello, world!";
  char *condensed = strutil_remove(str, 5, 12);
  printf("Original:  \"%s\"\n", str);
  printf("Condensed: \"%s\"\n", condensed);
  free(condensed);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x5,%esi
mov    $0xc,%edx
call   1050 <strutil_remove@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rsi
lea    0xea2(%rip),%rdi
call   1040 <printf@plt>
mov    -0x18(%rbp),%rsi
lea    0xea3(%rip),%rdi
call   1040 <printf@plt>
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
lea    0xec5(%rip),%r14
mov    %r14,%rdi
mov    $0x5,%esi
mov    $0xc,%edx
call   1050 <strutil_remove@plt>
mov    %rax,%rbx
lea    0xeb7(%rip),%rdi
mov    %r14,%rsi
call   1040 <printf@plt>
lea    0xeb9(%rip),%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [14 x i8] c"Hello, world!\00"
@.str.1 = [17 x i8] c"Original: \22%s\22\0A\00"
@.str.2 = [17 x i8] c"Condensed: \22%s\22\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
%3 = alloca i8*
store i32 0, i32* %1
store i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8** %2
%4 = load i8*, i8** %2
%5 = call i8* @strutil_remove(i8* %4, i32 5, i32 12)
store i8* %5, i8** %3
%6 = load i8*, i8** %2
%7 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i8* %6)
%8 = load i8*, i8** %3
%9 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0), i8* %8)
%10 = load i8*, i8** %3
%11 = call i32 @free(i8* %10)
ret i32 0
}

LLVM IR (-O2):
@.str = [14 x i8] c"Hello, world!\00"
@.str.1 = [17 x i8] c"Original: \22%s\22\0A\00"
@.str.2 = [17 x i8] c"Condensed: \22%s\22\0A\00"
define i32 @main() {
%1 = tail call i8* @strutil_remove(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 5, i32 12)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0), i8* %1)
%4 = tail call i32 @free(i8* %1)
ret i32 0
}