xunge/DecIR huggingface dataset:
/* Type definitions */
struct particle {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct particle *);
void particle_free(struct particle *p) { free(p); }


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

x86 assembly (clang, -O2):
<particle_free>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
%struct.particle = type { i32 }
define void @particle_free(%struct.particle* nocapture %0) {
%2 = tail call i32 @free(%struct.particle* %0)
ret void
}
void XtMergeArgLists() {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ gethostbyname_r(char const *, struct hostent *, char *,
                                   size_t, struct hostent **, int *);
int __gnat_safe_gethostbyname(const char *name, struct hostent *ret, char *buf,
                              size_t buflen, int *h_errnop) {
  struct hostent *rh;
  int ri;
  (void)gethostbyname_r(name, ret, buf, buflen, &rh, h_errnop);
  ri = (rh == NULL) ? -1 : 0;
  return ri;
}


x86 assembly (clang, -O0):
<__gnat_safe_gethostbyname>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r9
lea    -0x30(%rbp),%r8
call   1030 <gethostbyname_r@plt>
mov    -0x30(%rbp),%rdx
xor    %eax,%eax
mov    $0xffffffff,%ecx
cmp    $0x0,%rdx
cmove  %ecx,%eax
mov    %eax,-0x34(%rbp)
mov    -0x34(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__gnat_safe_gethostbyname>:
push   %rax
mov    %r8,%r9
mov    %rsp,%r8
call   1030 <gethostbyname_r@plt>
cmpq   $0x1,(%rsp)
sbb    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.hostent = type { i32 }
define i32 @__gnat_safe_gethostbyname(i8* %0, %struct.hostent* %1, i8* %2, i64 %3, i32* %4) {
%6 = alloca i8*
%7 = alloca %struct.hostent*
%8 = alloca i8*
%9 = alloca i64
%10 = alloca i32*
%11 = alloca %struct.hostent*
%12 = alloca i32
store i8* %0, i8** %6
store %struct.hostent* %1, %struct.hostent** %7
store i8* %2, i8** %8
store i64 %3, i64* %9
store i32* %4, i32** %10
%13 = load i8*, i8** %6
%14 = load %struct.hostent*, %struct.hostent** %7
%15 = load i8*, i8** %8
%16 = load i64, i64* %9
%17 = load i32*, i32** %10
%18 = call i32 @gethostbyname_r(i8* %13, %struct.hostent* %14, i8* %15, i64 %16, %struct.hostent** %11, i32* %17)
%19 = load %struct.hostent*, %struct.hostent** %11
%20 = icmp eq %struct.hostent* %19, null
%21 = zext i1 %20 to i64
%22 = select i1 %20, i32 -1, i32 0
store i32 %22, i32* %12
%23 = load i32, i32* %12
ret i32 %23
}

LLVM IR (-O2):
%struct.hostent = type { i32 }
define i32 @__gnat_safe_gethostbyname(i8* %0, %struct.hostent* %1, i8* %2, i64 %3, i32* %4) {
%6 = alloca %struct.hostent*
%7 = bitcast %struct.hostent** %6 to i8*
%8 = call i32 @gethostbyname_r(i8* %0, %struct.hostent* %1, i8* %2, i64 %3, %struct.hostent** %6, i32* %4)
%9 = load %struct.hostent*, %struct.hostent** %6
%10 = icmp eq %struct.hostent* %9, null
%11 = sext i1 %10 to i32
ret i32 %11
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int /*<<< orphan*/ parse_u32(int /*<<< orphan*/ *);
int32_t parse_i32(uint8_t *d) { return (int32_t)parse_u32(d); }


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

x86 assembly (clang, -O2):
<parse_i32>:
jmp    1030 <parse_u32@plt>

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

LLVM IR (-O2):
define i32 @parse_i32(i32* %0) {
%2 = tail call i32 @parse_u32(i32* %0)
ret i32 %2
}
/* Variables and functions */
unsigned int __sync_fetch_and_add_si(int *, int);
unsigned int bar(volatile unsigned int *mem, unsigned int val) {
  return __sync_fetch_and_add_si((int *)mem, (int)val);
}


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

x86 assembly (clang, -O2):
<bar>:
jmp    1030 <__sync_fetch_and_add_si@plt>

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

LLVM IR (-O2):
define i32 @bar(i32* %0, i32 %1) {
%3 = tail call i32 @__sync_fetch_and_add_si(i32* %0, i32 %1)
ret i32 %3
}
int _getpid() { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @_getpid() {
ret i32 1
}
/* Variables and functions */
char EOF;
char getchar();
int /*<<< orphan*/ printf(char *, char);
int main() {
  char c;
  while ((c = getchar()) != EOF) {
    printf("%c", c);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %al,-0x5(%rbp)
movsbl %al,%eax
mov    0x2ea5(%rip),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
je     1163 <main+0x43>
lea    0xeab(%rip),%rdi
movsbl -0x5(%rbp),%esi
call   1030 <printf@plt>
jmp    112f <main+0xf>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
xor    %eax,%eax
call   1040 <getchar@plt>
mov    0x2eb6(%rip),%r14
cmp    (%r14),%al
je     1157 <main+0x37>
lea    0xec2(%rip),%rbx
xchg   %ax,%ax
movsbl %al,%esi
mov    %rbx,%rdi
call   1030 <printf@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
cmp    (%r14),%al
jne    1140 <main+0x20>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@EOF = global i8 0
@.str = [3 x i8] c"%c\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
store i32 0, i32* %1
br label %3
3: ; preds = %9, %0
%4 = call signext i8 (...) @getchar()
store i8 %4, i8* %2
%5 = sext i8 %4 to i32
%6 = load i8, i8* @EOF
%7 = sext i8 %6 to i32
%8 = icmp ne i32 %5, %7
br i1 %8, label %9, label %12
9: ; preds = %3
%10 = load i8, i8* %2
%11 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext %10)
br label %3
12: ; preds = %3
ret i32 0
}

LLVM IR (-O2):
@EOF = global i8 0
@.str = [3 x i8] c"%c\00"
define i32 @main() {
%1 = tail call signext i8 (...) @getchar()
%2 = load i8, i8* @EOF
%3 = icmp eq i8 %1, %2
br i1 %3, label %10, label %4
4: ; preds = %0, %4
%5 = phi i8 [ %7, %4 ], [ %1, %0 ]
%6 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext %5)
%7 = tail call signext i8 (...) @getchar()
%8 = load i8, i8* @EOF
%9 = icmp eq i8 %7, %8
br i1 %9, label %10, label %4
10: ; preds = %4, %0
ret i32 0
}
char *hash_plugin_summary(void) {
  return ("lastpass \tLastPass keychain plugin");
}


x86 assembly (clang, -O0):
<hash_plugin_summary>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash_plugin_summary>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [35 x i8] c"lastpass \09LastPass keychain plugin\00"
define i8* @hash_plugin_summary() {
ret i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [35 x i8] c"lastpass \09LastPass keychain plugin\00"
define i8* @hash_plugin_summary() {
ret i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
scalar_t__ malloc(int);
char *CuStrAlloc(int size) {
  char *newStr = (char *)malloc(sizeof(char) * (size_t)size);
  return newStr;
}


x86 assembly (clang, -O0):
<CuStrAlloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movslq -0x4(%rbp),%rax
shl    $0x0,%rax
mov    %eax,%edi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CuStrAlloc>:
jmp    1030 <malloc@plt>

LLVM IR (-O0):
define i8* @CuStrAlloc(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = sext i32 %4 to i64
%6 = mul i64 1, %5
%7 = trunc i64 %6 to i32
%8 = call i64 @malloc(i32 %7)
%9 = inttoptr i64 %8 to i8*
store i8* %9, i8** %3
%10 = load i8*, i8** %3
ret i8* %10
}

LLVM IR (-O2):
define i8* @CuStrAlloc(i32 %0) {
%2 = tail call i64 @malloc(i32 %0)
%3 = inttoptr i64 %2 to i8*
ret i8* %3
}
/* Type definitions */
struct timeval {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
long long usec_from_tv(struct timeval *);
long long currtime_usec(void) {
  struct timeval tv;
  gettimeofday(&tv, NULL);
  return usec_from_tv(&tv);
}


x86 assembly (clang, -O0):
<currtime_usec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x8(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1040 <gettimeofday@plt>
lea    -0x8(%rbp),%rdi
call   1030 <usec_from_tv@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<currtime_usec>:
push   %rbx
sub    $0x10,%rsp
lea    0x8(%rsp),%rbx
mov    %rbx,%rdi
xor    %esi,%esi
call   1040 <gettimeofday@plt>
mov    %rbx,%rdi
call   1030 <usec_from_tv@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.timeval = type { i32 }
define i64 @currtime_usec() {
%1 = alloca %struct.timeval
%2 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%3 = call i64 @usec_from_tv(%struct.timeval* %1)
ret i64 %3
}

LLVM IR (-O2):
%struct.timeval = type { i32 }
define i64 @currtime_usec() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = call i64 @usec_from_tv(%struct.timeval* %1)
ret i64 %4
}
int *hop(int *elem) {
  int *result = elem + *elem;
  return result;
}


x86 assembly (clang, -O0):
<hop>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x8(%rbp),%rcx
movslq (%rcx),%rcx
shl    $0x2,%rcx
add    %rcx,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hop>:
movslq (%rdi),%rax
lea    (%rdi,%rax,4),%rax
ret

LLVM IR (-O0):
define i32* @hop(i32* %0) {
%2 = alloca i32*
%3 = alloca i32*
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = load i32*, i32** %2
%6 = load i32, i32* %5
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds i32, i32* %4, i64 %7
store i32* %8, i32** %3
%9 = load i32*, i32** %3
ret i32* %9
}

LLVM IR (-O2):
define i32* @hop(i32* %0) {
%2 = load i32, i32* %0
%3 = sext i32 %2 to i64
%4 = getelementptr inbounds i32, i32* %0, i64 %3
ret i32* %4
}
void cleanupPending() {}


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

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

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

LLVM IR (-O2):
define void @cleanupPending() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  int n, numeroTriangular;
  numeroTriangular = 0;
  for (n = 1; n <= 200; n++) {
    numeroTriangular += n;
  }
  printf("El 200vo numero triangular es %i\n", numeroTriangular);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x1,-0x8(%rbp)
cmpl   $0xc8,-0x8(%rbp)
jg     1151 <main+0x41>
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    112d <main+0x1d>
mov    -0xc(%rbp),%esi
lea    0xea5(%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
mov    $0x4e84,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [34 x i8] c"El 200vo numero triangular es %i\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %3
store i32 1, i32* %2
br label %4
4: ; preds = %11, %0
%5 = load i32, i32* %2
%6 = icmp sle i32 %5, 200
br i1 %6, label %7, label %14
7: ; preds = %4
%8 = load i32, i32* %2
%9 = load i32, i32* %3
%10 = add nsw i32 %9, %8
store i32 %10, i32* %3
br label %11
11: ; preds = %7
%12 = load i32, i32* %2
%13 = add nsw i32 %12, 1
store i32 %13, i32* %2
br label %4
14: ; preds = %4
%15 = load i32, i32* %3
%16 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i32 %15)
ret i32 0
}

LLVM IR (-O2):
@.str = [34 x i8] c"El 200vo numero triangular es %i\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i32 20100)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ dotest(int, int, int, char *);
int main() {
  dotest(2, 100, 110, "101, 103");
  dotest(4, 100, 110, "103, 107");
  dotest(6, 100, 110, "0, 0");
  dotest(8, 300, 400, "359, 367");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2,%edi
mov    $0x64,%esi
mov    $0x6e,%edx
lea    0xed6(%rip),%rcx
call   1030 <dotest@plt>
mov    $0x4,%edi
mov    $0x64,%esi
mov    $0x6e,%edx
lea    0xec4(%rip),%rcx
call   1030 <dotest@plt>
mov    $0x6,%edi
mov    $0x64,%esi
mov    $0x6e,%edx
lea    0xeb2(%rip),%rcx
call   1030 <dotest@plt>
mov    $0x8,%edi
mov    $0x12c,%esi
mov    $0x190,%edx
lea    0xe9c(%rip),%rcx
call   1030 <dotest@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rcx
mov    $0x2,%edi
mov    $0x64,%esi
mov    $0x6e,%edx
call   1030 <dotest@plt>
lea    0xed6(%rip),%rcx
mov    $0x4,%edi
mov    $0x64,%esi
mov    $0x6e,%edx
call   1030 <dotest@plt>
lea    0xec4(%rip),%rcx
mov    $0x6,%edi
mov    $0x64,%esi
mov    $0x6e,%edx
call   1030 <dotest@plt>
lea    0xeae(%rip),%rcx
mov    $0x8,%edi
mov    $0x12c,%esi
mov    $0x190,%edx
call   1030 <dotest@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [9 x i8] c"101, 103\00"
@.str.1 = [9 x i8] c"103, 107\00"
@.str.2 = [5 x i8] c"0, 0\00"
@.str.3 = [9 x i8] c"359, 367\00"
define i32 @main() {
%1 = call i32 @dotest(i32 2, i32 100, i32 110, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @dotest(i32 4, i32 100, i32 110, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @dotest(i32 6, i32 100, i32 110, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @dotest(i32 8, i32 300, i32 400, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [9 x i8] c"101, 103\00"
@.str.1 = [9 x i8] c"103, 107\00"
@.str.2 = [5 x i8] c"0, 0\00"
@.str.3 = [9 x i8] c"359, 367\00"
define i32 @main() {
%1 = tail call i32 @dotest(i32 2, i32 100, i32 110, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @dotest(i32 4, i32 100, i32 110, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @dotest(i32 6, i32 100, i32 110, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
%4 = tail call i32 @dotest(i32 8, i32 300, i32 400, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0))
ret i32 0
}
void main() {
  int i;
  int j;
  int k;
  i = 0;
  j = 0;
  k = 0;
  while (i < 100) {
    while (j < 100) {
      while (k < 100) {
        i = i + 1;
        j = j + 1;
        k = k + 1;
      }
    }
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x64,-0x4(%rbp)
jge    116b <main+0x6b>
jmp    1128 <main+0x28>
cmpl   $0x64,-0x8(%rbp)
jge    1166 <main+0x66>
jmp    1137 <main+0x37>
cmpl   $0x64,-0xc(%rbp)
jge    1161 <main+0x61>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1137 <main+0x37>
jmp    1128 <main+0x28>
jmp    1119 <main+0x19>
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @main() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stdout;
void usage() {
  fprintf(stdout, "Tool for packing WebUI firmware.\n"
                  "Usage: uipack -d <dir> -o <output file>\n"
                  "\t-s DDNS server name\n"
                  "\t-a camera hostname\n"
                  "\t-i IP address to register\n"
                  "\t-h print this message\n");
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stdout = global i32 0
@.str = [165 x i8] c"Tool for packing WebUI firmware.\0AUsage: uipack -d <dir> -o <output file>\0A\09-s DDNS server name\0A\09-a camera hostname\0A\09-i IP address to register\0A\09-h print this message\0A\00"
define void @usage() {
%1 = load i32, i32* @stdout
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([165 x i8], [165 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [165 x i8] c"Tool for packing WebUI firmware.\0AUsage: uipack -d <dir> -o <output file>\0A\09-s DDNS server name\0A\09-a camera hostname\0A\09-i IP address to register\0A\09-h print this message\0A\00"
define void @usage() {
%1 = load i32, i32* @stdout
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([165 x i8], [165 x i8]* @.str, i64 0, i64 0))
ret void
}
void outbyte(char c) {}


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

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

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

LLVM IR (-O2):
define void @outbyte(i8 signext %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ tty_cleanup();
void cleanup() { tty_cleanup(); }


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

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

LLVM IR (-O0):
define void @cleanup() {
%1 = call i32 (...) @tty_cleanup()
ret void
}

LLVM IR (-O2):
define void @cleanup() {
%1 = tail call i32 (...) @tty_cleanup()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, char const *);
void _panic(const char *str) {
  printf("%s\n", str);
  exit(1);
}


x86 assembly (clang, -O0):
<_panic>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<_panic>:
push   %rax
mov    %rdi,%rsi
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define void @_panic(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @exit(i32 1)
unreachable
}
int test_imm_69int64_midword_mem(long long *val) {
  return ((*val >> 16) & (0x69 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_69int64_midword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 6881280
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
int rect(unsigned int phase, unsigned int amplitude) {
  if (phase < 0x8000)
    return amplitude;
  else
    return -amplitude;
}


x86 assembly (clang, -O0):
<rect>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x8000,-0x8(%rbp)
jae    1122 <rect+0x22>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    112a <rect+0x2a>
xor    %eax,%eax
sub    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rect>:
mov    %esi,%eax
neg    %eax
cmp    $0x8000,%edi
cmovb  %esi,%eax
ret

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

LLVM IR (-O2):
define i32 @rect(i32 %0, i32 %1) {
%3 = icmp ult i32 %0, 32768
%4 = sub i32 0, %1
%5 = select i1 %3, i32 %1, i32 %4
ret i32 %5
}
/* Type definitions */
typedef int int64_t;

/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ errno;
int64_t cfs_stub_setxattr(const char *path, const char *name, const void *data,
                          size_t size, int flags) {
  errno = ENOSYS;
  return -1;
}


x86 assembly (clang, -O0):
<cfs_stub_setxattr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
mov    0x2ec9(%rip),%rax
mov    (%rax),%ecx
mov    0x2eb0(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cfs_stub_setxattr>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%eax
mov    0x2ec8(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @cfs_stub_setxattr(i8* %0, i8* %1, i8* %2, i64 %3, i32 %4) {
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i64
%10 = alloca i32
store i8* %0, i8** %6
store i8* %1, i8** %7
store i8* %2, i8** %8
store i64 %3, i64* %9
store i32 %4, i32* %10
%11 = load i32, i32* @ENOSYS
store i32 %11, i32* @errno
ret i32 -1
}

LLVM IR (-O2):
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @cfs_stub_setxattr(i8* nocapture readnone %0, i8* nocapture readnone %1, i8* nocapture readnone %2, i64 %3, i32 %4) {
%6 = load i32, i32* @ENOSYS
store i32 %6, i32* @errno
ret i32 -1
}
float max_out_three(float a, float b, float c) {
  if (a > b && a > c)
    return a;
  if (b > a && b > c)
    return b;
  return c;
}


x86 assembly (clang, -O0):
<max_out_three>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x8(%rbp)
movss  %xmm1,-0xc(%rbp)
movss  %xmm2,-0x10(%rbp)
movss  -0x8(%rbp),%xmm0
ucomiss -0xc(%rbp),%xmm0
jbe    1140 <max_out_three+0x40>
movss  -0x8(%rbp),%xmm0
ucomiss -0x10(%rbp),%xmm0
jbe    1140 <max_out_three+0x40>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    1177 <max_out_three+0x77>
movss  -0xc(%rbp),%xmm0
ucomiss -0x8(%rbp),%xmm0
jbe    116d <max_out_three+0x6d>
movss  -0xc(%rbp),%xmm0
ucomiss -0x10(%rbp),%xmm0
jbe    116d <max_out_three+0x6d>
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    1177 <max_out_three+0x77>
movss  -0x10(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<max_out_three>:
movaps %xmm1,%xmm3
maxss  %xmm2,%xmm3
movaps %xmm0,%xmm4
cmpltss %xmm1,%xmm4
andps  %xmm4,%xmm3
andnps %xmm2,%xmm4
orps   %xmm3,%xmm4
cmpltss %xmm0,%xmm1
cmpltss %xmm0,%xmm2
andps  %xmm2,%xmm0
andnps %xmm4,%xmm2
orps   %xmm2,%xmm0
andps  %xmm1,%xmm0
andnps %xmm4,%xmm1
orps   %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @max_out_three(float %0, float %1, float %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca float
%7 = alloca float
store float %0, float* %5
store float %1, float* %6
store float %2, float* %7
%8 = load float, float* %5
%9 = load float, float* %6
%10 = fcmp ogt float %8, %9
br i1 %10, label %11, label %17
11: ; preds = %3
%12 = load float, float* %5
%13 = load float, float* %7
%14 = fcmp ogt float %12, %13
br i1 %14, label %15, label %17
15: ; preds = %11
%16 = load float, float* %5
store float %16, float* %4
br label %29
17: ; preds = %11, %3
%18 = load float, float* %6
%19 = load float, float* %5
%20 = fcmp ogt float %18, %19
br i1 %20, label %21, label %27
21: ; preds = %17
%22 = load float, float* %6
%23 = load float, float* %7
%24 = fcmp ogt float %22, %23
br i1 %24, label %25, label %27
25: ; preds = %21
%26 = load float, float* %6
store float %26, float* %4
br label %29
27: ; preds = %21, %17
%28 = load float, float* %7
store float %28, float* %4
br label %29
29: ; preds = %27, %25, %15
%30 = load float, float* %4
ret float %30
}

LLVM IR (-O2):
define float @max_out_three(float %0, float %1, float %2) {
%4 = fcmp ogt float %0, %1
%5 = fcmp ogt float %0, %2
%6 = and i1 %4, %5
%7 = fcmp ogt float %1, %0
%8 = fcmp ogt float %1, %2
%9 = and i1 %7, %8
%10 = select i1 %9, float %1, float %2
%11 = select i1 %6, float %0, float %10
ret float %11
}
/* Variables and functions */
int /*<<< orphan*/ write(int, char *, int);
void send1car(int s, char c) {
  char b[2];
  b[0] = c;
  b[1] = (char)3;
  write(s, b, 2);
}


x86 assembly (clang, -O0):
<send1car>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %edi,-0x4(%rbp)
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
mov    %al,-0x7(%rbp)
movb   $0x3,-0x6(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x7(%rbp),%rsi
mov    $0x2,%edx
call   1030 <write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<send1car>:
push   %rax
mov    %sil,0x6(%rsp)
movb   $0x3,0x7(%rsp)
lea    0x6(%rsp),%rsi
mov    $0x2,%edx
call   1030 <write@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @send1car(i32 %0, i8 signext %1) {
%3 = alloca i32
%4 = alloca i8
%5 = alloca [2 x i8]
store i32 %0, i32* %3
store i8 %1, i8* %4
%6 = load i8, i8* %4
%7 = getelementptr inbounds [2 x i8], [2 x i8]* %5, i64 0, i64 0
store i8 %6, i8* %7
%8 = getelementptr inbounds [2 x i8], [2 x i8]* %5, i64 0, i64 1
store i8 3, i8* %8
%9 = load i32, i32* %3
%10 = getelementptr inbounds [2 x i8], [2 x i8]* %5, i64 0, i64 0
%11 = call i32 @write(i32 %9, i8* %10, i32 2)
ret void
}

LLVM IR (-O2):
define void @send1car(i32 %0, i8 signext %1) {
%3 = alloca [2 x i8]
%4 = getelementptr inbounds [2 x i8], [2 x i8]* %3, i64 0, i64 0
store i8 %1, i8* %4
%5 = getelementptr inbounds [2 x i8], [2 x i8]* %3, i64 0, i64 1
store i8 3, i8* %5
%6 = call i32 @write(i32 %0, i8* %4, i32 2)
ret void
}
int len(char *p) {
  int n;
  n = 0;
  while (*p != '\0') {
    n++;
    p++;
  }
  return (n);
}


x86 assembly (clang, -O0):
<len>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1139 <len+0x39>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    110f <len+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<len>:
cmpb   $0x0,(%rdi)
je     111c <len+0x1c>
xor    %eax,%eax
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,0x1(%rdi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <len+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @len(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i32 [ %7, %4 ], [ 0, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = add nuw nsw i32 %5, 1
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
%12 = phi i32 [ 0, %1 ], [ %7, %4 ]
ret i32 %12
}
/* Variables and functions */
scalar_t__ ispunct(int);
int utlispunct(int ch) { return (ch <= 0xFF) && ispunct(ch); }


x86 assembly (clang, -O0):
<utlispunct>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0xff,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jg     113f <utlispunct+0x2f>
mov    -0x4(%rbp),%edi
call   1030 <ispunct@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<utlispunct>:
xor    %eax,%eax
cmp    $0xff,%edi
jg     112f <utlispunct+0x1f>
push   %rax
call   1030 <ispunct@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
add    $0x8,%rsp
ret

LLVM IR (-O0):
define i32 @utlispunct(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sle i32 %3, 255
br i1 %4, label %5, label %9
5: ; preds = %1
%6 = load i32, i32* %2
%7 = call i64 @ispunct(i32 %6)
%8 = icmp ne i64 %7, 0
br label %9
9: ; preds = %5, %1
%10 = phi i1 [ false, %1 ], [ %8, %5 ]
%11 = zext i1 %10 to i32
ret i32 %11
}

LLVM IR (-O2):
define i32 @utlispunct(i32 %0) {
%2 = icmp slt i32 %0, 256
br i1 %2, label %3, label %7
3: ; preds = %1
%4 = tail call i64 @ispunct(i32 %0)
%5 = icmp ne i64 %4, 0
%6 = zext i1 %5 to i32
br label %7
7: ; preds = %3, %1
%8 = phi i32 [ 0, %1 ], [ %6, %3 ]
ret i32 %8
}
void foo(void) {
  int a;
  int b;
  a = b;
  return;
}


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

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

LLVM IR (-O0):
define void @foo() {
%1 = alloca i32
%2 = alloca i32
%3 = load i32, i32* %2
store i32 %3, i32* %1
ret void
}

LLVM IR (-O2):
define void @foo() {
ret void
}
/* Variables and functions */
int strncmp(char const *, char const *, size_t);
int strcmp(const char *first, const char *second) {
  return strncmp(first, second, ~((size_t)0));
}


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

x86 assembly (clang, -O2):
<strcmp>:
mov    $0xffffffffffffffff,%rdx
jmp    1030 <strncmp@plt>

LLVM IR (-O0):
define i32 @strcmp(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 = call i32 @strncmp(i8* %5, i8* %6, i64 -1)
ret i32 %7
}

LLVM IR (-O2):
define i32 @strcmp(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32 @strncmp(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1, i64 -1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ _hmt_register_covercase(char *, char *);
void _hmt_covercase_HMM_Mat4_init(void) {
  _hmt_register_covercase("HMM_Mat4", "1");
}


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

x86 assembly (clang, -O2):
<_hmt_covercase_HMM_Mat4_init>:
lea    0xee9(%rip),%rdi
lea    0xeeb(%rip),%rsi
jmp    1030 <_hmt_register_covercase@plt>

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

LLVM IR (-O2):
@.str = [9 x i8] c"HMM_Mat4\00"
@.str.1 = [2 x i8] c"1\00"
define void @_hmt_covercase_HMM_Mat4_init() {
%1 = tail call i32 @_hmt_register_covercase(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int smax1(int a, int b) { return a ^ ((a ^ b) & -(a < b)); }


x86 assembly (clang, -O0):
<smax1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
xor    -0x8(%rbp),%ecx
mov    -0x4(%rbp),%edx
cmp    -0x8(%rbp),%edx
setl   %dl
and    $0x1,%dl
movzbl %dl,%esi
xor    %edx,%edx
sub    %esi,%edx
and    %edx,%ecx
xor    %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @smax1(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* %3
%7 = load i32, i32* %4
%8 = xor i32 %6, %7
%9 = load i32, i32* %3
%10 = load i32, i32* %4
%11 = icmp slt i32 %9, %10
%12 = zext i1 %11 to i32
%13 = sub nsw i32 0, %12
%14 = and i32 %8, %13
%15 = xor i32 %5, %14
ret i32 %15
}

LLVM IR (-O2):
define i32 @smax1(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, %1
%4 = select i1 %3, i32 %1, i32 %0
ret i32 %4
}
int get_mask(unsigned int *mask, int e) {
  int w;
  unsigned int m, n;
  w = e / (8 * sizeof(int) - 1);
  if (w >= 0 && w < (((2 * (12) + 2)) / (4 * 8) + 1)) {
    m = mask[w];
    n = (1 << e % (8 * sizeof(int) - 1));
    ;
    return ((m & n) != 0);
  } else {
    return (0);
  }
}


x86 assembly (clang, -O0):
<get_mask>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
movslq -0x14(%rbp),%rax
mov    $0x1f,%ecx
xor    %edx,%edx
div    %rcx
mov    %eax,-0x18(%rbp)
cmpl   $0x0,-0x18(%rbp)
jl     1171 <get_mask+0x71>
cmpl   $0x1,-0x18(%rbp)
jge    1171 <get_mask+0x71>
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x1c(%rbp)
movslq -0x14(%rbp),%rax
mov    $0x1f,%ecx
xor    %edx,%edx
div    %rcx
mov    %edx,%ecx
mov    $0x1,%eax
shl    %cl,%eax
mov    %eax,-0x20(%rbp)
mov    -0x1c(%rbp),%eax
and    -0x20(%rbp),%eax
cmp    $0x0,%eax
setne  %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
jmp    1178 <get_mask+0x78>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_mask>:
movslq %esi,%rcx
movabs $0x842108421084211,%rdx
10 42 08
mov    %rcx,%rax
mul    %rdx
mov    %rcx,%rsi
sub    %rdx,%rsi
shr    %rsi
add    %rdx,%rsi
shr    $0x4,%rsi
xor    %eax,%eax
test   %esi,%esi
je     112a <get_mask+0x2a>
ret
mov    %rsi,%rax
shl    $0x5,%rax
sub    %rax,%rsi
add    %rsi,%rcx
mov    (%rdi),%eax
shr    %cl,%eax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @get_mask(i32* %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32* %0, i32** %4
store i32 %1, i32* %5
%9 = load i32, i32* %5
%10 = sext i32 %9 to i64
%11 = udiv i64 %10, 31
%12 = trunc i64 %11 to i32
store i32 %12, i32* %6
%13 = load i32, i32* %6
%14 = icmp sge i32 %13, 0
br i1 %14, label %15, label %34
15: ; preds = %2
%16 = load i32, i32* %6
%17 = icmp slt i32 %16, 1
br i1 %17, label %18, label %34
18: ; preds = %15
%19 = load i32*, i32** %4
%20 = load i32, i32* %6
%21 = sext i32 %20 to i64
%22 = getelementptr inbounds i32, i32* %19, i64 %21
%23 = load i32, i32* %22
store i32 %23, i32* %7
%24 = load i32, i32* %5
%25 = sext i32 %24 to i64
%26 = urem i64 %25, 31
%27 = trunc i64 %26 to i32
%28 = shl i32 1, %27
store i32 %28, i32* %8
%29 = load i32, i32* %7
%30 = load i32, i32* %8
%31 = and i32 %29, %30
%32 = icmp ne i32 %31, 0
%33 = zext i1 %32 to i32
store i32 %33, i32* %3
br label %35
34: ; preds = %15, %2
store i32 0, i32* %3
br label %35
35: ; preds = %34, %18
%36 = load i32, i32* %3
ret i32 %36
}

LLVM IR (-O2):
define i32 @get_mask(i32* nocapture %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = udiv i64 %3, 31
%5 = urem i64 %3, 31
%6 = trunc i64 %4 to i32
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %13
8: ; preds = %2
%9 = load i32, i32* %0
%10 = trunc i64 %5 to i32
%11 = lshr i32 %9, %10
%12 = and i32 %11, 1
br label %13
13: ; preds = %2, %8
%14 = phi i32 [ %12, %8 ], [ 0, %2 ]
ret i32 %14
}
void mmap(void *virt_addr, void *phys_addr) {
  asm volatile("movl %0, %%ebx" ::"m"(virt_addr) : "%ebx");
  asm volatile("movl %0, %%ecx" ::"m"(phys_addr) : "%ecx");
  syscall(7);
}


x86 assembly (clang, -O0):
<mmap>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
sub    $0x18,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%ebx
mov    -0x18(%rbp),%ecx
mov    $0x7,%edi
mov    $0x0,%al
call   1030 <syscall@plt>
add    $0x18,%rsp
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<mmap>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,0x8(%rsp)
mov    %rsi,(%rsp)
mov    0x8(%rsp),%ebx
mov    (%rsp),%ecx
mov    $0x7,%edi
xor    %eax,%eax
call   1030 <syscall@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @mmap(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = call i32 (i32, ...) bitcast (i32 (...)* @syscall to i32 (i32, ...)*)(i32 7)
ret void
}

LLVM IR (-O2):
define void @mmap(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = call i32 (i32, ...) bitcast (i32 (...)* @syscall to i32 (i32, ...)*)(i32 7)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ dta_ctx_free(void *);
void dta_module_ctx_free(void *module_ctx) { dta_ctx_free(module_ctx); }


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

x86 assembly (clang, -O2):
<dta_module_ctx_free>:
jmp    1030 <dta_ctx_free@plt>

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

LLVM IR (-O2):
define void @dta_module_ctx_free(i8* %0) {
%2 = tail call i32 @dta_ctx_free(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ gen(char *);
void cgscale2(void) { gen("shlq\t$3,%rcx"); }


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

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

LLVM IR (-O0):
@.str = [13 x i8] c"shlq\09$3,%rcx\00"
define void @cgscale2() {
%1 = call i32 @gen(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c"shlq\09$3,%rcx\00"
define void @cgscale2() {
%1 = tail call i32 @gen(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int sock_op_get_fds(int sock_fd, int fds_num, int *fds) { abort(); }


x86 assembly (clang, -O0):
<sock_op_get_fds>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<sock_op_get_fds>:
push   %rax
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define i32 @sock_op_get_fds(i32 %0, i32 %1, i32* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32*
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32* %2, i32** %6
%7 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
define i32 @sock_op_get_fds(i32 %0, i32 %1, i32* nocapture readnone %2) {
%4 = tail call i32 (...) @abort()
unreachable
}
void __DELETE_org_apache_harmony_niochar_charset_UTF_8_Decoder(
    void *me, void *client_data) {}


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

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

LLVM IR (-O0):
define void @__DELETE_org_apache_harmony_niochar_charset_UTF_8_Decoder(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
ret void
}

LLVM IR (-O2):
define void @__DELETE_org_apache_harmony_niochar_charset_UTF_8_Decoder(i8* nocapture %0, i8* nocapture %1) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ key;

/* Variables and functions */
int /*<<< orphan*/ eprint(char *, int);
int getch();
int /*<<< orphan*/ keypress(int /*<<< orphan*/);
void escapekey(const char *args[]) {
  int key;
  if ((key = getch()) >= 0) {
    eprint("escaping key `%c'\n", key);
    keypress(((key)&0x1F));
  }
}


x86 assembly (clang, -O0):
<escapekey>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1040 <getch@plt>
mov    %eax,-0xc(%rbp)
cmp    $0x0,%eax
jl     1169 <escapekey+0x39>
mov    -0xc(%rbp),%esi
lea    0xea7(%rip),%rdi
call   1050 <eprint@plt>
mov    -0xc(%rbp),%edi
and    $0x1f,%edi
call   1030 <keypress@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<escapekey>:
push   %rbx
xor    %eax,%eax
call   1040 <getch@plt>
test   %eax,%eax
js     1157 <escapekey+0x27>
mov    %eax,%ebx
lea    0xebb(%rip),%rdi
mov    %eax,%esi
call   1050 <eprint@plt>
and    $0x1f,%ebx
mov    %ebx,%edi
pop    %rbx
jmp    1030 <keypress@plt>
pop    %rbx
ret

LLVM IR (-O0):
@.str = [19 x i8] c"escaping key `%c'\0A\00"
define void @escapekey(i8** %0) {
%2 = alloca i8**
%3 = alloca i32
store i8** %0, i8*** %2
%4 = call i32 (...) @getch()
store i32 %4, i32* %3
%5 = icmp sge i32 %4, 0
br i1 %5, label %6, label %12
6: ; preds = %1
%7 = load i32, i32* %3
%8 = call i32 @eprint(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = load i32, i32* %3
%10 = and i32 %9, 31
%11 = call i32 @keypress(i32 %10)
br label %12
12: ; preds = %6, %1
ret void
}

LLVM IR (-O2):
@.str = [19 x i8] c"escaping key `%c'\0A\00"
define void @escapekey(i8** nocapture readnone %0) {
%2 = tail call i32 (...) @getch()
%3 = icmp sgt i32 %2, -1
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = tail call i32 @eprint(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %2)
%6 = and i32 %2, 31
%7 = tail call i32 @keypress(i32 %6)
br label %8
8: ; preds = %4, %1
ret void
}
int fun109() { return 109; }


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

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

LLVM IR (-O0):
define i32 @fun109() {
ret i32 109
}

LLVM IR (-O2):
define i32 @fun109() {
ret i32 109
}
char *err_bit_type(int etype) {
  switch (etype) {
  case 0x0:
    return "single-bit ecc";
  case 0x1:
    return "multi-bit ecc";
  }
  return "unknown error";
}


x86 assembly (clang, -O0):
<err_bit_type>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
test   %eax,%eax
je     112b <err_bit_type+0x2b>
jmp    111a <err_bit_type+0x1a>
mov    -0x10(%rbp),%eax
sub    $0x1,%eax
je     113b <err_bit_type+0x3b>
jmp    114b <err_bit_type+0x4b>
lea    0xece(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1156 <err_bit_type+0x56>
lea    0xecd(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1156 <err_bit_type+0x56>
lea    0xecb(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<err_bit_type>:
cmp    $0x1,%edi
lea    0xf05(%rip),%rax
lea    0xf0c(%rip),%rcx
cmove  %rax,%rcx
test   %edi,%edi
lea    0xee2(%rip),%rax
cmovne %rcx,%rax
ret

LLVM IR (-O0):
@.str = [15 x i8] c"single-bit ecc\00"
@.str.1 = [14 x i8] c"multi-bit ecc\00"
@.str.2 = [14 x i8] c"unknown error\00"
define i8* @err_bit_type(i32 %0) {
%2 = alloca i8*
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %7 [
i32 0, label %5
i32 1, label %6
]
5: ; preds = %1
store i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8** %2
br label %8
6: ; preds = %1
store i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i8** %2
br label %8
7: ; preds = %1
store i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), i8** %2
br label %8
8: ; preds = %7, %6, %5
%9 = load i8*, i8** %2
ret i8* %9
}

LLVM IR (-O2):
@.str = [15 x i8] c"single-bit ecc\00"
@.str.1 = [14 x i8] c"multi-bit ecc\00"
@.str.2 = [14 x i8] c"unknown error\00"
define i8* @err_bit_type(i32 %0) {
%2 = icmp eq i32 %0, 1
%3 = select i1 %2, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0)
%4 = icmp eq i32 %0, 0
%5 = select i1 %4, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %3
ret i8* %5
}
/* Variables and functions */
scalar_t__ malloc(int);
int /*<<< orphan*/ sprintf(char *, char *, int);
char *m_ftoa(float f) {
  char *s = (char *)malloc(16);
  sprintf(s, "%d", *(int *)&f);
  return s;
}


x86 assembly (clang, -O0):
<m_ftoa>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
mov    $0x10,%edi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x4(%rbp),%edx
lea    0xeb7(%rip),%rsi
call   1040 <sprintf@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<m_ftoa>:
push   %rbx
sub    $0x10,%rsp
movss  %xmm0,0xc(%rsp)
mov    $0x10,%edi
call   1030 <malloc@plt>
mov    %rax,%rbx
movd   0xc(%rsp),%xmm0
movd   %xmm0,%edx
lea    0xeb7(%rip),%rsi
mov    %rax,%rdi
call   1040 <sprintf@plt>
mov    %rbx,%rax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
define i8* @m_ftoa(float %0) {
%2 = alloca float
%3 = alloca i8*
store float %0, float* %2
%4 = call i64 @malloc(i32 16)
%5 = inttoptr i64 %4 to i8*
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = bitcast float* %2 to i32*
%8 = load i32, i32* %7
%9 = call i32 @sprintf(i8* %6, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %8)
%10 = load i8*, i8** %3
ret i8* %10
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i8* @m_ftoa(float %0) {
%2 = tail call i64 @malloc(i32 16)
%3 = inttoptr i64 %2 to i8*
%4 = bitcast float %0 to i32
%5 = tail call i32 @sprintf(i8* dereferenceable(1) %3, i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i8* %3
}