xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ foo(unsigned short *, unsigned short *);
main() {
  short unsigned int x, y;
  x = -5;
  y = -10;
  foo(&x, &y);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movw   $0xfffb,-0x2(%rbp)
movw   $0xfff6,-0x4(%rbp)
lea    -0x2(%rbp),%rdi
lea    -0x4(%rbp),%rsi
call   1030 <foo@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movw   $0xfffb,0x6(%rsp)
movw   $0xfff6,0x4(%rsp)
lea    0x6(%rsp),%rdi
lea    0x4(%rsp),%rsi
call   1030 <foo@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i16
%2 = alloca i16
store i16 -5, i16* %1
store i16 -10, i16* %2
%3 = call i32 @foo(i16* %1, i16* %2)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca i16
%2 = alloca i16
%3 = bitcast i16* %1 to i8*
%4 = bitcast i16* %2 to i8*
store i16 -5, i16* %1
store i16 -10, i16* %2
%5 = call i32 @foo(i16* %1, i16* %2)
ret i32 0
}
double residual(double x, double y, double slope, double intcp) {
  return y - (intcp + (slope * x));
}


x86 assembly (clang, -O0):
<residual>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm2
movsd  -0x18(%rbp),%xmm1
movsd  -0x8(%rbp),%xmm3
mulsd  %xmm3,%xmm1
addsd  %xmm2,%xmm1
subsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<residual>:
mulsd  %xmm2,%xmm0
addsd  %xmm3,%xmm0
subsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @residual(double %0, double %1, double %2, double %3) {
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
store double %0, double* %5
store double %1, double* %6
store double %2, double* %7
store double %3, double* %8
%9 = load double, double* %6
%10 = load double, double* %8
%11 = load double, double* %7
%12 = load double, double* %5
%13 = call double @llvm.fmuladd.f64(double %11, double %12, double %10)
%14 = fsub double %9, %13
ret double %14
}

LLVM IR (-O2):
define double @residual(double %0, double %1, double %2, double %3) {
%5 = tail call double @llvm.fmuladd.f64(double %2, double %0, double %3)
%6 = fsub double %1, %5
ret double %6
}
/* Variables and functions */
int /*<<< orphan*/ reverseprint(char *);
main(int argc, char **argv) { reverseprint((char *)argv[1]); }


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x8(%rsi),%rdi
call   1030 <reverseprint@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = load i8**, i8*** %4
%6 = getelementptr inbounds i8*, i8** %5, i64 1
%7 = load i8*, i8** %6
%8 = call i32 @reverseprint(i8* %7)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = load i8*, i8** %3
%5 = tail call i32 @reverseprint(i8* %4)
ret i32 0
}
int fun791() { return 791; }


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

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

LLVM IR (-O0):
define i32 @fun791() {
ret i32 791
}

LLVM IR (-O2):
define i32 @fun791() {
ret i32 791
}
/* Type definitions */
typedef char uint32_t;

/* Variables and functions */
uint32_t getWordTotal(const char *a) {
  uint32_t sum = 0;
  for (; *a; sum += *a++ - '@')
    ;
  return sum;
}


x86 assembly (clang, -O0):
<getWordTotal>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movb   $0x0,-0x9(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1141 <getWordTotal+0x41>
jmp    111e <getWordTotal+0x1e>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%ecx
sub    $0x40,%ecx
movsbl -0x9(%rbp),%eax
add    %ecx,%eax
mov    %al,-0x9(%rbp)
jmp    110c <getWordTotal+0xc>
movsbl -0x9(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getWordTotal>:
mov    (%rdi),%cl
test   %cl,%cl
je     1122 <getWordTotal+0x22>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
add    %al,%cl
mov    %ecx,%eax
add    $0xc0,%al
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <getWordTotal+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define signext i8 @getWordTotal(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %13, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %11, %4 ], [ %2, %1 ]
%6 = phi i8 [ %10, %4 ], [ 0, %1 ]
%7 = phi i8* [ %8, %4 ], [ %0, %1 ]
%8 = getelementptr inbounds i8, i8* %7, i64 1
%9 = add i8 %6, -64
%10 = add i8 %9, %5
%11 = load i8, i8* %8
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %4
13: ; preds = %4, %1
%14 = phi i8 [ 0, %1 ], [ %10, %4 ]
ret i8 %14
}
/* Variables and functions */
int /*<<< orphan*/ parsingReset();
void zcb_onObjectStart(char *name) {
  ;
  parsingReset();
}


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

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

LLVM IR (-O0):
define void @zcb_onObjectStart(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (...) @parsingReset()
ret void
}

LLVM IR (-O2):
define void @zcb_onObjectStart(i8* nocapture readnone %0) {
%2 = tail call i32 (...) @parsingReset()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/ *);
void WriteHeaderComment(FILE *out) {
  fputs("/*\n  This file was generated by the code generator. \n", out);
  fputs("  Changing the content manually may result in loss of changes. \n",
        out);
  fputs("  The code generator recommends using auto generation after changing "
        "the seed file.\n */ \n\n",
        out);
  return;
}


x86 assembly (clang, -O0):
<WriteHeaderComment>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xed9(%rip),%rdi
call   1030 <fputs@plt>
mov    -0x8(%rbp),%rsi
lea    0xeff(%rip),%rdi
call   1030 <fputs@plt>
mov    -0x8(%rbp),%rsi
lea    0xf30(%rip),%rdi
call   1030 <fputs@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<WriteHeaderComment>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rdi
mov    $0x35,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1030 <fwrite@plt>
lea    0xf02(%rip),%rdi
mov    $0x40,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1030 <fwrite@plt>
lea    0xf2a(%rip),%rdi
mov    $0x5a,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
pop    %rbx
jmp    1030 <fwrite@plt>

LLVM IR (-O0):
@.str = [54 x i8] c"/*\0A This file was generated by the code generator. \0A\00"
@.str.1 = [65 x i8] c" Changing the content manually may result in loss of changes. \0A\00"
@.str.2 = [91 x i8] c" The code generator recommends using auto generation after changing the seed file.\0A */ \0A\0A\00"
define void @WriteHeaderComment(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @fputs(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str, i64 0, i64 0), i32* %3)
%5 = load i32*, i32** %2
%6 = call i32 @fputs(i8* getelementptr inbounds ([65 x i8], [65 x i8]* @.str.1, i64 0, i64 0), i32* %5)
%7 = load i32*, i32** %2
%8 = call i32 @fputs(i8* getelementptr inbounds ([91 x i8], [91 x i8]* @.str.2, i64 0, i64 0), i32* %7)
ret void
}

LLVM IR (-O2):
@.str = [54 x i8] c"/*\0A This file was generated by the code generator. \0A\00"
@.str.1 = [65 x i8] c" Changing the content manually may result in loss of changes. \0A\00"
@.str.2 = [91 x i8] c" The code generator recommends using auto generation after changing the seed file.\0A */ \0A\0A\00"
define void @WriteHeaderComment(i32* nocapture %0) {
%2 = tail call i64 @fwrite(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str, i64 0, i64 0), i64 53, i64 1, i32* %0)
%3 = tail call i64 @fwrite(i8* getelementptr inbounds ([65 x i8], [65 x i8]* @.str.1, i64 0, i64 0), i64 64, i64 1, i32* %0)
%4 = tail call i64 @fwrite(i8* getelementptr inbounds ([91 x i8], [91 x i8]* @.str.2, i64 0, i64 0), i64 90, i64 1, i32* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ log_write(int, char *, size_t);
scalar_t__ write(int, void const *, size_t);
int c_write(int fd, const void *buf, size_t count) {
  log_write(fd, (char *)buf, count);
  return (int)write(fd, buf, count);
}


x86 assembly (clang, -O0):
<c_write>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1040 <log_write@plt>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <write@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<c_write>:
push   %rbp
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %rsi,%rbx
mov    %edi,%ebp
call   1040 <log_write@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %r14,%rdx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <write@plt>

LLVM IR (-O0):
define i32 @c_write(i32 %0, i8* %1, i64 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i64
store i32 %0, i32* %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%7 = load i32, i32* %4
%8 = load i8*, i8** %5
%9 = load i64, i64* %6
%10 = call i32 @log_write(i32 %7, i8* %8, i64 %9)
%11 = load i32, i32* %4
%12 = load i8*, i8** %5
%13 = load i64, i64* %6
%14 = call i64 @write(i32 %11, i8* %12, i64 %13)
%15 = trunc i64 %14 to i32
ret i32 %15
}

LLVM IR (-O2):
define i32 @c_write(i32 %0, i8* %1, i64 %2) {
%4 = tail call i32 @log_write(i32 %0, i8* %1, i64 %2)
%5 = tail call i64 @write(i32 %0, i8* %1, i64 %2)
%6 = trunc i64 %5 to i32
ret i32 %6
}
/* Type definitions */
struct msg_buff {
  int dummy;
};
typedef int /*<<< orphan*/ __u16;

/* Variables and functions */
int nla_put(struct msg_buff *, int, int, int /*<<< orphan*/ *);
int nla_put_u16(struct msg_buff *msg, int attrtype, __u16 value) {
  return nla_put(msg, attrtype, sizeof(__u16), &value);
}


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

x86 assembly (clang, -O2):
<nla_put_u16>:
push   %rax
mov    %edx,0x4(%rsp)
lea    0x4(%rsp),%rcx
mov    $0x4,%edx
call   1030 <nla_put@plt>
pop    %rcx
ret

LLVM IR (-O0):
%struct.msg_buff = type { i32 }
define i32 @nla_put_u16(%struct.msg_buff* %0, i32 %1, i32 %2) {
%4 = alloca %struct.msg_buff*
%5 = alloca i32
%6 = alloca i32
store %struct.msg_buff* %0, %struct.msg_buff** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load %struct.msg_buff*, %struct.msg_buff** %4
%8 = load i32, i32* %5
%9 = call i32 @nla_put(%struct.msg_buff* %7, i32 %8, i32 4, i32* %6)
ret i32 %9
}

LLVM IR (-O2):
%struct.msg_buff = type { i32 }
define i32 @nla_put_u16(%struct.msg_buff* %0, i32 %1, i32 %2) {
%4 = alloca i32
store i32 %2, i32* %4
%5 = call i32 @nla_put(%struct.msg_buff* %0, i32 %1, i32 4, i32* %4)
ret i32 %5
}
int negate(int x) {
  int result;
L:
  result = -x;
  return (result);
}


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

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

LLVM IR (-O0):
define i32 @negate(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
br label %4
4: ; preds = %1
%5 = load i32, i32* %2
%6 = sub nsw i32 0, %5
store i32 %6, i32* %3
%7 = load i32, i32* %3
ret i32 %7
}

LLVM IR (-O2):
define i32 @negate(i32 %0) {
%2 = sub nsw i32 0, %0
ret i32 %2
}
/* Variables and functions */
char *Alloc(unsigned int);
int /*<<< orphan*/ sprintf(char *, char *, char *, int, char *);
scalar_t__ strlen(char *);
char *AllocKey(char *normal, int type, char *abbrev) {
  char *tmp = Alloc((unsigned)(4 + strlen(normal) + strlen(abbrev)));
  (void)sprintf(tmp, "%s\n%c\n%s", normal, type, abbrev);
  return tmp;
}


x86 assembly (clang, -O0):
<AllocKey>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
add    $0x4,%rax
mov    %rax,-0x28(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rcx
mov    -0x28(%rbp),%rax
add    %rcx,%rax
mov    %eax,%edi
call   1030 <Alloc@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x8(%rbp),%rdx
mov    -0xc(%rbp),%ecx
mov    -0x18(%rbp),%r8
lea    0xe78(%rip),%rsi
call   1050 <sprintf@plt>
mov    -0x20(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<AllocKey>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r15
mov    %esi,%r14d
mov    %rdi,%rbp
call   1040 <strlen@plt>
mov    %rax,%rbx
mov    %r15,%rdi
call   1040 <strlen@plt>
lea    (%rbx,%rax,1),%edi
add    $0x4,%edi
call   1030 <Alloc@plt>
mov    %rax,%rbx
lea    0xe9b(%rip),%rsi
mov    %rax,%rdi
mov    %rbp,%rdx
mov    %r14d,%ecx
mov    %r15,%r8
call   1050 <sprintf@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [9 x i8] c"%s\0A%c\0A%s\00"
define i8* @AllocKey(i8* %0, i32 %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i8*
store i8* %0, i8** %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%8 = load i8*, i8** %4
%9 = call i64 @strlen(i8* %8)
%10 = add nsw i64 4, %9
%11 = load i8*, i8** %6
%12 = call i64 @strlen(i8* %11)
%13 = add nsw i64 %10, %12
%14 = trunc i64 %13 to i32
%15 = call i8* @Alloc(i32 %14)
store i8* %15, i8** %7
%16 = load i8*, i8** %7
%17 = load i8*, i8** %4
%18 = load i32, i32* %5
%19 = load i8*, i8** %6
%20 = call i32 @sprintf(i8* %16, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* %17, i32 %18, i8* %19)
%21 = load i8*, i8** %7
ret i8* %21
}

LLVM IR (-O2):
@.str = [9 x i8] c"%s\0A%c\0A%s\00"
define i8* @AllocKey(i8* %0, i32 %1, i8* %2) {
%4 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%5 = add nsw i64 %4, 4
%6 = tail call i64 @strlen(i8* dereferenceable(1) %2)
%7 = add nsw i64 %5, %6
%8 = trunc i64 %7 to i32
%9 = tail call i8* @Alloc(i32 %8)
%10 = tail call i32 @sprintf(i8* dereferenceable(1) %9, i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %1, i8* %2)
ret i8* %9
}
/* Variables and functions */
int /*<<< orphan*/ read_burst();
int c_main() {
  read_burst();
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @c_main() {
%1 = call i32 (...) @read_burst()
ret i32 0
}

LLVM IR (-O2):
define i32 @c_main() {
%1 = tail call i32 (...) @read_burst()
ret i32 0
}
int get_cp_hash_value(char *name) {
  int hash = 0;
  int index = 0;
  char c;
  while ((c = name[index++]))
    hash += (int)c;
  hash %= 47;
  return hash;
}


x86 assembly (clang, -O0):
<get_cp_hash_value>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
mov    %ecx,%edx
add    $0x1,%edx
mov    %edx,-0x10(%rbp)
movslq %ecx,%rcx
mov    (%rax,%rcx,1),%al
mov    %al,-0x11(%rbp)
cmp    $0x0,%al
je     1145 <get_cp_hash_value+0x45>
movsbl -0x11(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1116 <get_cp_hash_value+0x16>
mov    -0xc(%rbp),%eax
mov    $0x2f,%ecx
cltd
idiv   %ecx
mov    %edx,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_cp_hash_value>:
mov    (%rdi),%al
test   %al,%al
je     1140 <get_cp_hash_value+0x40>
add    $0x1,%rdi
xor    %ecx,%ecx
nopl   0x0(%rax)
movsbl %al,%eax
add    %eax,%ecx
movzbl (%rdi),%eax
add    $0x1,%rdi
test   %al,%al
jne    1110 <get_cp_hash_value+0x10>
movslq %ecx,%rax
imul   $0xffffffffae4c415d,%rax,%rcx
shr    $0x20,%rcx
add    %eax,%ecx
mov    %ecx,%edx
shr    $0x1f,%edx
sar    $0x5,%ecx
add    %edx,%ecx
imul   $0x2f,%ecx,%ecx
sub    %ecx,%eax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @get_cp_hash_value(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %16, label %4
4: ; preds = %1, %4
%5 = phi i64 [ %8, %4 ], [ 0, %1 ]
%6 = phi i8 [ %12, %4 ], [ %2, %1 ]
%7 = phi i32 [ %10, %4 ], [ 0, %1 ]
%8 = add nuw nsw i64 %5, 1
%9 = sext i8 %6 to i32
%10 = add nsw i32 %7, %9
%11 = getelementptr inbounds i8, i8* %0, i64 %8
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4
%15 = srem i32 %10, 47
br label %16
16: ; preds = %14, %1
%17 = phi i32 [ 0, %1 ], [ %15, %14 ]
ret i32 %17
}
/* Variables and functions */
char *strchr(char const *, int);
char *strrchr(char const *, int);
int /*<<< orphan*/ test_assert(int);
int main(void) {
  int FORWARD = 0;
  char *a = "baba";
  char *(*f)(const char *s, int c) = strchr;
  if (FORWARD) {
    f = strrchr;
  }
  char *x = f(a, 'b');
  test_assert(x == a);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
lea    0xed3(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0x2ea0(%rip),%rax
mov    %rax,-0x18(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1151 <main+0x41>
mov    0x2e93(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    -0x10(%rbp),%rdi
mov    $0x62,%esi
call   *%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x10(%rbp),%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <test_assert@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [5 x i8] c"baba\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i8* (i8*, i32)*
%5 = alloca i8*
store i32 0, i32* %1
store i32 0, i32* %2
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8** %3
store i8* (i8*, i32)* @strchr, i8* (i8*, i32)** %4
%6 = load i32, i32* %2
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %0
store i8* (i8*, i32)* @strrchr, i8* (i8*, i32)** %4
br label %9
9: ; preds = %8, %0
%10 = load i8* (i8*, i32)*, i8* (i8*, i32)** %4
%11 = load i8*, i8** %3
%12 = call i8* %10(i8* %11, i32 98)
store i8* %12, i8** %5
%13 = load i8*, i8** %5
%14 = load i8*, i8** %3
%15 = icmp eq i8* %13, %14
%16 = zext i1 %15 to i32
%17 = call i32 @test_assert(i32 %16)
%18 = load i32, i32* %1
ret i32 %18
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @test_assert(i32 1)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ tmp;
struct sspm_buffer {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ snprintf(char *, int, char *, char);
int /*<<< orphan*/ sspm_append_string(struct sspm_buffer *, char *);
void sspm_append_hex(struct sspm_buffer *buf, char ch) {
  char tmp[4];
  snprintf(tmp, sizeof(tmp), "=%02X", ch);
  sspm_append_string(buf, tmp);
}


x86 assembly (clang, -O0):
<sspm_append_hex>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
lea    -0xd(%rbp),%rdi
mov    $0x4,%esi
lea    0xebe(%rip),%rdx
movsbl -0x9(%rbp),%ecx
call   1040 <snprintf@plt>
mov    -0x8(%rbp),%rdi
lea    -0xd(%rbp),%rsi
call   1030 <sspm_append_string@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sspm_append_hex>:
push   %r14
push   %rbx
push   %rax
mov    %esi,%ecx
mov    %rdi,%rbx
lea    0xed0(%rip),%rdx
lea    0x4(%rsp),%r14
mov    %r14,%rdi
mov    $0x4,%esi
call   1040 <snprintf@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <sspm_append_string@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.sspm_buffer = type { i32 }
@.str = [6 x i8] c"=%02X\00"
define void @sspm_append_hex(%struct.sspm_buffer* %0, i8 signext %1) {
%3 = alloca %struct.sspm_buffer*
%4 = alloca i8
%5 = alloca [4 x i8]
store %struct.sspm_buffer* %0, %struct.sspm_buffer** %3
store i8 %1, i8* %4
%6 = getelementptr inbounds [4 x i8], [4 x i8]* %5, i64 0, i64 0
%7 = load i8, i8* %4
%8 = call i32 @snprintf(i8* %6, i32 4, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8 signext %7)
%9 = load %struct.sspm_buffer*, %struct.sspm_buffer** %3
%10 = getelementptr inbounds [4 x i8], [4 x i8]* %5, i64 0, i64 0
%11 = call i32 @sspm_append_string(%struct.sspm_buffer* %9, i8* %10)
ret void
}

LLVM IR (-O2):
%struct.sspm_buffer = type { i32 }
@.str = [6 x i8] c"=%02X\00"
define void @sspm_append_hex(%struct.sspm_buffer* %0, i8 signext %1) {
%3 = alloca [4 x i8]
%4 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 0
%5 = call i32 @snprintf(i8* %4, i32 4, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8 signext %1)
%6 = call i32 @sspm_append_string(%struct.sspm_buffer* %0, i8* %4)
ret void
}
/* Variables and functions */
char getchar();
int main() {
  char c;
  while ((getchar()) != 'q')
    ;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <getchar@plt>
movsbl %al,%eax
cmp    $0x71,%eax
je     1137 <main+0x27>
jmp    111f <main+0xf>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <getchar@plt>
cmp    $0x71,%al
jne    1120 <main+0x10>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
store i32 0, i32* %1
br label %3
3: ; preds = %7, %0
%4 = call signext i8 (...) @getchar()
%5 = sext i8 %4 to i32
%6 = icmp ne i32 %5, 113
br i1 %6, label %7, label %8
7: ; preds = %3
br label %3
8: ; preds = %3
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
br label %1
1: ; preds = %1, %0
%2 = tail call signext i8 (...) @getchar()
%3 = icmp eq i8 %2, 113
br i1 %3, label %4, label %1
4: ; preds = %1
ret i32 0
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
bool ispalindrome(uint64_t x) {
  uint64_t t = x;
  uint64_t y = 0;
  while (t > 0) {
    y = (y * 10) + (t % 10);
    t = t / 10;
  }
  return x == y;
}


x86 assembly (clang, -O0):
<ispalindrome>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
jle    114b <ispalindrome+0x4b>
imul   $0xa,-0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    -0x10(%rbp),%eax
add    %edx,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x8(%rbp)
jmp    1114 <ispalindrome+0x14>
mov    -0x4(%rbp),%eax
cmp    -0xc(%rbp),%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ispalindrome>:
xor    %edx,%edx
test   %edi,%edi
jle    1133 <ispalindrome+0x33>
mov    $0xcccccccd,%r8d
mov    %edi,%ecx
xchg   %ax,%ax
lea    (%rdx,%rdx,4),%r9d
mov    %ecx,%esi
imul   %r8,%rsi
shr    $0x23,%rsi
lea    (%rsi,%rsi,1),%eax
lea    (%rax,%rax,4),%eax
mov    %ecx,%edx
sub    %eax,%edx
lea    (%rdx,%r9,2),%edx
cmp    $0x9,%ecx
mov    %esi,%ecx
ja     1110 <ispalindrome+0x10>
xor    %eax,%eax
cmp    %edi,%edx
sete   %al
ret

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

LLVM IR (-O2):
define i32 @ispalindrome(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %11
3: ; preds = %1, %3
%4 = phi i32 [ %8, %3 ], [ 0, %1 ]
%5 = phi i32 [ %9, %3 ], [ %0, %1 ]
%6 = mul nsw i32 %4, 10
%7 = urem i32 %5, 10
%8 = add nsw i32 %6, %7
%9 = udiv i32 %5, 10
%10 = icmp ult i32 %5, 10
br i1 %10, label %11, label %3
11: ; preds = %3, %1
%12 = phi i32 [ 0, %1 ], [ %8, %3 ]
%13 = icmp eq i32 %12, %0
%14 = zext i1 %13 to i32
ret i32 %14
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void pddlfree(void *ptr) { free((char *)ptr); }


x86 assembly (clang, -O0):
<pddlfree>:
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):
<pddlfree>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @pddlfree(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
int nrf_write_register_mb(int, char *, int, char *);
int nrf_set_tx_address(const char *address, char *retstatus) {
  return nrf_write_register_mb(0x10, (char *)address, 5, retstatus);
}


x86 assembly (clang, -O0):
<nrf_set_tx_address>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rcx
mov    $0x10,%edi
mov    $0x5,%edx
call   1030 <nrf_write_register_mb@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nrf_set_tx_address>:
mov    %rsi,%rcx
mov    %rdi,%rsi
mov    $0x10,%edi
mov    $0x5,%edx
jmp    1030 <nrf_write_register_mb@plt>

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

LLVM IR (-O2):
define i32 @nrf_set_tx_address(i8* %0, i8* %1) {
%3 = tail call i32 @nrf_write_register_mb(i32 16, i8* %0, i32 5, i8* %1)
ret i32 %3
}
const char *RegexVer() { return "none"; }


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

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

LLVM IR (-O0):
@.str = [5 x i8] c"none\00"
define i8* @RegexVer() {
ret i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [5 x i8] c"none\00"
define i8* @RegexVer() {
ret i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ sfree(void *);
void trlang_rawnamenode_hook_free(void *hook) {
  if (hook) {
    sfree(hook);
  }
  return;
}


x86 assembly (clang, -O0):
<trlang_rawnamenode_hook_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1130 <trlang_rawnamenode_hook_free+0x20>
mov    -0x8(%rbp),%rdi
call   1030 <sfree@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<trlang_rawnamenode_hook_free>:
test   %rdi,%rdi
je     111a <trlang_rawnamenode_hook_free+0xa>
jmp    1030 <sfree@plt>
ret

LLVM IR (-O0):
define void @trlang_rawnamenode_hook_free(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp ne i8* %3, null
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i8*, i8** %2
%7 = call i32 @sfree(i8* %6)
br label %8
8: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
define void @trlang_rawnamenode_hook_free(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @sfree(i8* %0)
br label %5
5: ; preds = %3, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ GL_COLOR_MATERIAL;
int /*<<< orphan*/ glClearColor(float, float, float, float);
int /*<<< orphan*/ glEnable(int /*<<< orphan*/);
void initRendering() {
  glEnable(GL_COLOR_MATERIAL);
  glClearColor(0.0f, 0.6f, 0.8f, 1.0f);
}


x86 assembly (clang, -O0):
<initRendering>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
call   1030 <glEnable@plt>
xorps  %xmm0,%xmm0
movss  0xec3(%rip),%xmm1
movss  0xebf(%rip),%xmm2
movss  0xebb(%rip),%xmm3
call   1040 <glClearColor@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<initRendering>:
push   %rax
mov    0x2ec0(%rip),%rax
mov    (%rax),%edi
call   1030 <glEnable@plt>
movss  0xec9(%rip),%xmm1
movss  0xec5(%rip),%xmm2
movss  0xec1(%rip),%xmm3
xorps  %xmm0,%xmm0
pop    %rax
jmp    1040 <glClearColor@plt>

LLVM IR (-O0):
@GL_COLOR_MATERIAL = global i32 0
define void @initRendering() {
%1 = load i32, i32* @GL_COLOR_MATERIAL
%2 = call i32 @glEnable(i32 %1)
%3 = call i32 @glClearColor(float 0.000000e+00, float 0x3FE3333340000000, float 0x3FE99999A0000000, float 1.000000e+00)
ret void
}

LLVM IR (-O2):
@GL_COLOR_MATERIAL = global i32 0
define void @initRendering() {
%1 = load i32, i32* @GL_COLOR_MATERIAL
%2 = tail call i32 @glEnable(i32 %1)
%3 = tail call i32 @glClearColor(float 0.000000e+00, float 0x3FE3333340000000, float 0x3FE99999A0000000, float 1.000000e+00)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ putchar(char);
void screenOut(void *node) { putchar((char)node); }


x86 assembly (clang, -O0):
<screenOut>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl %al,%edi
call   1030 <putchar@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<screenOut>:
movsbl %dil,%edi
jmp    1030 <putchar@plt>

LLVM IR (-O0):
define void @screenOut(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = ptrtoint i8* %3 to i8
%5 = call i32 @putchar(i8 signext %4)
ret void
}

LLVM IR (-O2):
define void @screenOut(i8* %0) {
%2 = ptrtoint i8* %0 to i64
%3 = trunc i64 %2 to i8
%4 = tail call i32 @putchar(i8 signext %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int my_main(int argc, char **argv) {
  printf("Hello, World\n");
  return 0;
}


x86 assembly (clang, -O0):
<my_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):
<my_main>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"Hello, World\0A\00"
define i32 @my_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 ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [13 x i8] c"Hello, World\00"
define i32 @my_main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
ret i32 0
}
void CALC_loadCurrentFunction() {}


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

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

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

LLVM IR (-O2):
define void @CALC_loadCurrentFunction() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ PE_low_level_init();
int /*<<< orphan*/ TestApp_Init();
int /*<<< orphan*/ TestApp_Task();
void main(void) {
  PE_low_level_init();
  (void)TestApp_Init();
  for (;;) {
    TestApp_Task();
  }
  for (;;) {
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1050 <PE_low_level_init@plt>
mov    $0x0,%al
call   1030 <TestApp_Init@plt>
mov    $0x0,%al
call   1040 <TestApp_Task@plt>
jmp    1142 <main+0x12>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1050 <PE_low_level_init@plt>
xor    %eax,%eax
call   1030 <TestApp_Init@plt>
nop
xor    %eax,%eax
call   1040 <TestApp_Task@plt>
jmp    1140 <main+0x10>

LLVM IR (-O0):
define void @main() {
%1 = call i32 (...) @PE_low_level_init()
%2 = call i32 (...) @TestApp_Init()
br label %3
3: ; preds = %3, %0
%4 = call i32 (...) @TestApp_Task()
br label %3
}

LLVM IR (-O2):
define void @main() {
%1 = tail call i32 (...) @PE_low_level_init()
%2 = tail call i32 (...) @TestApp_Init()
br label %3
3: ; preds = %3, %0
%4 = tail call i32 (...) @TestApp_Task()
br label %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char, char, int);
int /*<<< orphan*/ scanf(char *, char **);
int main() {
  char number[5];
  scanf("%s", &number);
  printf("%c + %c = %d", number[0], number[3],
         (int)number[0] + (int)number[3] - 2 * (int)'0');
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x5(%rbp),%rsi
lea    0xecd(%rip),%rdi
call   1040 <scanf@plt>
mov    -0x5(%rbp),%dl
mov    -0x2(%rbp),%al
movsbl -0x5(%rbp),%ecx
movsbl -0x2(%rbp),%esi
add    %esi,%ecx
sub    $0x60,%ecx
lea    0xeb1(%rip),%rdi
movsbl %dl,%esi
movsbl %al,%edx
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0x3(%rsp),%rsi
call   1040 <scanf@plt>
movsbl 0x3(%rsp),%esi
movsbl 0x6(%rsp),%edx
lea    (%rsi,%rdx,1),%ecx
add    $0xffffffa0,%ecx
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
@.str.1 = [13 x i8] c"%c + %c = %d\00"
define i32 @main() {
%1 = alloca [5 x i8]
%2 = bitcast [5 x i8]* %1 to i8**
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8** %2)
%4 = getelementptr inbounds [5 x i8], [5 x i8]* %1, i64 0, i64 0
%5 = load i8, i8* %4
%6 = getelementptr inbounds [5 x i8], [5 x i8]* %1, i64 0, i64 3
%7 = load i8, i8* %6
%8 = getelementptr inbounds [5 x i8], [5 x i8]* %1, i64 0, i64 0
%9 = load i8, i8* %8
%10 = sext i8 %9 to i32
%11 = getelementptr inbounds [5 x i8], [5 x i8]* %1, i64 0, i64 3
%12 = load i8, i8* %11
%13 = sext i8 %12 to i32
%14 = add nsw i32 %10, %13
%15 = sub nsw i32 %14, 96
%16 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i8 signext %5, i8 signext %7, i32 %15)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
@.str.1 = [13 x i8] c"%c + %c = %d\00"
define i32 @main() {
%1 = alloca [5 x i8]
%2 = getelementptr inbounds [5 x i8], [5 x i8]* %1, i64 0, i64 0
%3 = bitcast [5 x i8]* %1 to i8**
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8** %3)
%5 = load i8, i8* %2
%6 = getelementptr inbounds [5 x i8], [5 x i8]* %1, i64 0, i64 3
%7 = load i8, i8* %6
%8 = sext i8 %5 to i32
%9 = sext i8 %7 to i32
%10 = add nsw i32 %8, -96
%11 = add nsw i32 %10, %9
%12 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i8 signext %5, i8 signext %7, i32 %11)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ perror(char *);
void fatal(char *msg) {
  perror(msg);
  exit(1);
}


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

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

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

LLVM IR (-O2):
define void @fatal(i8* nocapture %0) {
%2 = tail call i32 @perror(i8* %0)
%3 = tail call i32 @exit(i32 1)
unreachable
}
int cmp_long_asc(const void *x, const void *y) {
  if (*(long *)x < *(long *)y) {
    return -1;
  } else if (*(long *)x > *(long *)y) {
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<cmp_long_asc>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    -0x18(%rbp),%rcx
cmp    (%rcx),%rax
jge    112c <cmp_long_asc+0x2c>
movl   $0xffffffff,-0x4(%rbp)
jmp    1158 <cmp_long_asc+0x58>
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    -0x18(%rbp),%rcx
cmp    (%rcx),%rax
jle    114c <cmp_long_asc+0x4c>
movl   $0x1,-0x4(%rbp)
jmp    1158 <cmp_long_asc+0x58>
jmp    1151 <cmp_long_asc+0x51>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmp_long_asc>:
mov    (%rdi),%rax
xor    %ecx,%ecx
cmp    (%rsi),%rax
setg   %cl
mov    $0xffffffff,%eax
cmovge %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @cmp_long_asc(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i64*
%4 = load i64, i64* %3
%5 = bitcast i8* %1 to i64*
%6 = load i64, i64* %5
%7 = icmp slt i64 %4, %6
%8 = icmp sgt i64 %4, %6
%9 = zext i1 %8 to i32
%10 = select i1 %7, i32 -1, i32 %9
ret i32 %10
}
void foo(int i) {
  switch (i) {
#pragma acc parallel
    { case 0:; }
  }
  switch (i) {
#pragma acc kernels
    { case 0:; }
  }
  switch (i) {
#pragma acc data
    { case 0:; }
  }
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
test   %eax,%eax
jne    111c <foo+0x1c>
jmp    1117 <foo+0x17>
jmp    111c <foo+0x1c>
mov    -0x4(%rbp),%eax
test   %eax,%eax
jne    1131 <foo+0x31>
jmp    112c <foo+0x2c>
jmp    1131 <foo+0x31>
mov    -0x4(%rbp),%eax
test   %eax,%eax
jne    1146 <foo+0x46>
jmp    1141 <foo+0x41>
jmp    1146 <foo+0x46>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @foo(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
switch i32 %3, label %5 [
i32 0, label %4
]
4: ; preds = %1
br label %5
5: ; preds = %4, %1
%6 = load i32, i32* %2
switch i32 %6, label %8 [
i32 0, label %7
]
7: ; preds = %5
br label %8
8: ; preds = %7, %5
%9 = load i32, i32* %2
switch i32 %9, label %11 [
i32 0, label %10
]
10: ; preds = %8
br label %11
11: ; preds = %10, %8
ret void
}

LLVM IR (-O2):
define void @foo(i32 %0) {
ret void
}
unsigned int get_731(void *pnt) {
  unsigned char *p = (unsigned char *)pnt;
  return ((unsigned int)p[0]) + ((unsigned int)p[1] << 8) +
         ((unsigned int)p[2] << 16) + ((unsigned int)p[3] << 24);
}


x86 assembly (clang, -O0):
<get_731>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movzbl (%rax),%eax
mov    -0x10(%rbp),%rcx
movzbl 0x1(%rcx),%ecx
shl    $0x8,%ecx
add    %ecx,%eax
mov    -0x10(%rbp),%rcx
movzbl 0x2(%rcx),%ecx
shl    $0x10,%ecx
add    %ecx,%eax
mov    -0x10(%rbp),%rcx
movzbl 0x3(%rcx),%ecx
shl    $0x18,%ecx
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_731>:
mov    (%rdi),%eax
ret

LLVM IR (-O0):
define i32 @get_731(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
store i8* %4, i8** %3
%5 = load i8*, i8** %3
%6 = getelementptr inbounds i8, i8* %5, i64 0
%7 = load i8, i8* %6
%8 = zext i8 %7 to i32
%9 = load i8*, i8** %3
%10 = getelementptr inbounds i8, i8* %9, i64 1
%11 = load i8, i8* %10
%12 = zext i8 %11 to i32
%13 = shl i32 %12, 8
%14 = add i32 %8, %13
%15 = load i8*, i8** %3
%16 = getelementptr inbounds i8, i8* %15, i64 2
%17 = load i8, i8* %16
%18 = zext i8 %17 to i32
%19 = shl i32 %18, 16
%20 = add i32 %14, %19
%21 = load i8*, i8** %3
%22 = getelementptr inbounds i8, i8* %21, i64 3
%23 = load i8, i8* %22
%24 = zext i8 %23 to i32
%25 = shl i32 %24, 24
%26 = add i32 %20, %25
ret i32 %26
}

LLVM IR (-O2):
define i32 @get_731(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = zext i8 %2 to i32
%4 = getelementptr inbounds i8, i8* %0, i64 1
%5 = load i8, i8* %4
%6 = zext i8 %5 to i32
%7 = shl nuw nsw i32 %6, 8
%8 = or i32 %7, %3
%9 = getelementptr inbounds i8, i8* %0, i64 2
%10 = load i8, i8* %9
%11 = zext i8 %10 to i32
%12 = shl nuw nsw i32 %11, 16
%13 = or i32 %8, %12
%14 = getelementptr inbounds i8, i8* %0, i64 3
%15 = load i8, i8* %14
%16 = zext i8 %15 to i32
%17 = shl nuw i32 %16, 24
%18 = or i32 %13, %17
ret i32 %18
}
long arch_callsize() { return 8; }


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

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

LLVM IR (-O0):
define i64 @arch_callsize() {
ret i64 8
}

LLVM IR (-O2):
define i64 @arch_callsize() {
ret i64 8
}
int test_imm_BBint16_mem(short *val) {
  return ((*val) & (-0xBB << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_BBint16_mem>:
movzwl (%rdi),%eax
test   $0xff45,%eax
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_BBint16_mem(i16* %0) {
%2 = alloca i16*
store i16* %0, i16** %2
%3 = load i16*, i16** %2
%4 = load i16, i16* %3
%5 = sext i16 %4 to i32
%6 = and i32 %5, -187
%7 = icmp ne i32 %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_BBint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, -187
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Type definitions */
struct shl_htable {
  int dummy;
};

/* Variables and functions */
size_t shl_htable_hash_str(struct shl_htable *, char const *, size_t *);
int shl_htable_remove(struct shl_htable *, void const *, size_t, void **);
bool shl_htable_remove_str(struct shl_htable *htable, const char *str,
                           size_t *hash, char ***out) {
  size_t h;
  h = shl_htable_hash_str(htable, str, hash);
  return shl_htable_remove(htable, (const void *)&str, h, (void **)out);
}


x86 assembly (clang, -O0):
<shl_htable_remove_str>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <shl_htable_hash_str@plt>
mov    %rax,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x10(%rbp),%rsi
mov    -0x28(%rbp),%rdx
mov    -0x20(%rbp),%rcx
call   1040 <shl_htable_remove@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<shl_htable_remove_str>:
push   %r14
push   %rbx
push   %rax
mov    %rcx,%r14
mov    %rdi,%rbx
mov    %rsi,(%rsp)
call   1030 <shl_htable_hash_str@plt>
mov    %rsp,%rsi
mov    %rbx,%rdi
mov    %rax,%rdx
mov    %r14,%rcx
call   1040 <shl_htable_remove@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.shl_htable = type { i32 }
define i32 @shl_htable_remove_str(%struct.shl_htable* %0, i8* %1, i64* %2, i8*** %3) {
%5 = alloca %struct.shl_htable*
%6 = alloca i8*
%7 = alloca i64*
%8 = alloca i8***
%9 = alloca i64
store %struct.shl_htable* %0, %struct.shl_htable** %5
store i8* %1, i8** %6
store i64* %2, i64** %7
store i8*** %3, i8**** %8
%10 = load %struct.shl_htable*, %struct.shl_htable** %5
%11 = load i8*, i8** %6
%12 = load i64*, i64** %7
%13 = call i64 @shl_htable_hash_str(%struct.shl_htable* %10, i8* %11, i64* %12)
store i64 %13, i64* %9
%14 = load %struct.shl_htable*, %struct.shl_htable** %5
%15 = bitcast i8** %6 to i8*
%16 = load i64, i64* %9
%17 = load i8***, i8**** %8
%18 = bitcast i8*** %17 to i8**
%19 = call i32 @shl_htable_remove(%struct.shl_htable* %14, i8* %15, i64 %16, i8** %18)
ret i32 %19
}

LLVM IR (-O2):
%struct.shl_htable = type { i32 }
define i32 @shl_htable_remove_str(%struct.shl_htable* %0, i8* %1, i64* %2, i8*** %3) {
%5 = alloca i8*
store i8* %1, i8** %5
%6 = tail call i64 @shl_htable_hash_str(%struct.shl_htable* %0, i8* %1, i64* %2)
%7 = bitcast i8** %5 to i8*
%8 = bitcast i8*** %3 to i8**
%9 = call i32 @shl_htable_remove(%struct.shl_htable* %0, i8* %7, i64 %6, i8** %8)
ret i32 %9
}
/* Variables and functions */
int system(char *);
int clearScreen(void) { return system("tput clear"); }


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

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

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

LLVM IR (-O2):
@.str = [11 x i8] c"tput clear\00"
define i32 @clearScreen() {
%1 = tail call i32 @system(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}