xunge/DecIR huggingface dataset:
int countChars(char *in, char find) {
  const char *p = in;
  int count = 0;
  do {
    if (*p == find) {
      count++;
    }
  } while (*(p++));
  return count;
}


x86 assembly (clang, -O0):
<countChars>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
movsbl -0x9(%rbp),%ecx
cmp    %ecx,%eax
jne    1139 <countChars+0x39>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    113e <countChars+0x3e>
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x18(%rbp)
cmpb   $0x0,(%rax)
jne    111d <countChars+0x1d>
mov    -0x1c(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<countChars>:
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movzbl (%rdi),%ecx
xor    %edx,%edx
cmp    %sil,%cl
sete   %dl
add    %edx,%eax
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <countChars+0x10>
ret

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

LLVM IR (-O2):
define i32 @countChars(i8* nocapture %0, i8 signext %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %0, %2 ], [ %10, %3 ]
%5 = phi i32 [ 0, %2 ], [ %9, %3 ]
%6 = load i8, i8* %4
%7 = icmp eq i8 %6, %1
%8 = zext i1 %7 to i32
%9 = add nuw nsw i32 %5, %8
%10 = getelementptr inbounds i8, i8* %4, i64 1
%11 = icmp eq i8 %6, 0
br i1 %11, label %12, label %3
12: ; preds = %3
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void usage(char *filename) {
  fprintf(stderr,
          "\n"
          "Backdoor By ~BluEy~      ......<<<  http://seeker.ath.cx - N.E.B.\n"
          "=================================================================\n"
          "Usage: %s [options] -p port\n\n"
          "Options:\n"
          "-h            Help\n"
          "-d level      Debug on and set to 'level'\n"
          "-p port       Port to bind to\n\n",
          filename);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xed0(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [264 x i8] c"\0ABackdoor By ~BluEy~ ......<<< http://seeker.ath.cx - N.E.B.\0A=================================================================\0AUsage: %s [options] -p port\0A\0AOptions:\0A-h Help\0A-d level Debug on and set to 'level'\0A-p port Port to bind to\0A\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([264 x i8], [264 x i8]* @.str, i64 0, i64 0), i8* %4)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [264 x i8] c"\0ABackdoor By ~BluEy~ ......<<< http://seeker.ath.cx - N.E.B.\0A=================================================================\0AUsage: %s [options] -p port\0A\0AOptions:\0A-h Help\0A-d level Debug on and set to 'level'\0A-p port Port to bind to\0A\0A\00"
define void @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([264 x i8], [264 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ SIGABRT;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ raise(int /*<<< orphan*/);
void abort() {
  raise(SIGABRT);
  exit(-SIGABRT);
}


x86 assembly (clang, -O0):
<abort>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
call   1030 <raise@plt>
xor    %edi,%edi
mov    0x2ea5(%rip),%rax
sub    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<abort>:
push   %rbx
mov    0x2eb8(%rip),%rbx
mov    (%rbx),%edi
call   1030 <raise@plt>
xor    %edi,%edi
sub    (%rbx),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@SIGABRT = global i32 0
define void @abort() {
%1 = load i32, i32* @SIGABRT
%2 = call i32 @raise(i32 %1)
%3 = load i32, i32* @SIGABRT
%4 = sub nsw i32 0, %3
%5 = call i32 @exit(i32 %4)
unreachable
}

LLVM IR (-O2):
@SIGABRT = global i32 0
define void @abort() {
%1 = load i32, i32* @SIGABRT
%2 = tail call i32 @raise(i32 %1)
%3 = load i32, i32* @SIGABRT
%4 = sub nsw i32 0, %3
%5 = tail call i32 @exit(i32 %4)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ foo(int *);
int *malloc(int);
int /*<<< orphan*/ printf(char *, int);
int main() {
  int *x = malloc(sizeof(int));
  foo(x);
  printf("%d\n", *x);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x4,%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <foo@plt>
mov    -0x10(%rbp),%rax
mov    (%rax),%esi
lea    0xe9d(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x4,%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1050 <foo@plt>
mov    (%rbx),%esi
lea    0xeb1(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32* @malloc(i32 4)
%2 = tail call i32 @foo(i32* %1)
%3 = load i32, i32* %1
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ SIGQUIT;
int /*<<< orphan*/ SIG_DFL;
scalar_t__ SIG_ERR;
int /*<<< orphan*/ printf(char *);
scalar_t__ signal(int /*<<< orphan*/, int /*<<< orphan*/);
void sig_quit(int signo) {
  printf("caughted signal SIGQUIT\n");
  if (signal(SIGQUIT, SIG_DFL) == SIG_ERR) {
    printf("install signal SIGQUIT TO SIG_DFL failed.\n");
  }
}


x86 assembly (clang, -O0):
<sig_quit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xece(%rip),%rdi
call   1030 <printf@plt>
mov    0x2eaa(%rip),%rax
mov    (%rax),%edi
mov    0x2e89(%rip),%rax
mov    (%rax),%esi
call   1040 <signal@plt>
mov    0x2e83(%rip),%rcx
cmp    (%rcx),%rax
jne    116a <sig_quit+0x4a>
lea    0xeb4(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sig_quit>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
mov    0x2eb4(%rip),%rax
mov    (%rax),%edi
mov    0x2e93(%rip),%rax
mov    (%rax),%esi
call   1040 <signal@plt>
mov    0x2e8d(%rip),%rcx
cmp    (%rcx),%rax
jne    115d <sig_quit+0x3d>
lea    0xec1(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [25 x i8] c"caughted signal SIGQUIT\0A\00"
@SIGQUIT = global i32 0
@SIG_DFL = global i32 0
@SIG_ERR = global i64 0
@.str.1 = [43 x i8] c"install signal SIGQUIT TO SIG_DFL failed.\0A\00"
define void @sig_quit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* @SIGQUIT
%5 = load i32, i32* @SIG_DFL
%6 = call i64 @signal(i32 %4, i32 %5)
%7 = load i64, i64* @SIG_ERR
%8 = icmp eq i64 %6, %7
br i1 %8, label %9, label %11
9: ; preds = %1
%10 = call i32 @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.1, i64 0, i64 0))
br label %11
11: ; preds = %9, %1
ret void
}

LLVM IR (-O2):
@SIGQUIT = global i32 0
@SIG_DFL = global i32 0
@SIG_ERR = global i64 0
@str = [24 x i8] c"caughted signal SIGQUIT\00"
@str.2 = [42 x i8] c"install signal SIGQUIT TO SIG_DFL failed.\00"
define void @sig_quit(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str, i64 0, i64 0))
%3 = load i32, i32* @SIGQUIT
%4 = load i32, i32* @SIG_DFL
%5 = tail call i64 @signal(i32 %3, i32 %4)
%6 = load i64, i64* @SIG_ERR
%7 = icmp eq i64 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @str.2, i64 0, i64 0))
br label %10
10: ; preds = %8, %1
ret void
}
long int labs(long int n) { return n < 0 ? -n : n; }


x86 assembly (clang, -O0):
<labs>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jge    1122 <labs+0x22>
xor    %eax,%eax
sub    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
jmp    112a <labs+0x2a>
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

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

LLVM IR (-O0):
define i64 @labs(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = icmp slt i64 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i64, i64* %2
%7 = sub nsw i64 0, %6
br label %10
8: ; preds = %1
%9 = load i64, i64* %2
br label %10
10: ; preds = %8, %5
%11 = phi i64 [ %7, %5 ], [ %9, %8 ]
ret i64 %11
}

LLVM IR (-O2):
define i64 @labs(i64 %0) {
%2 = tail call i64 @llvm.abs.i64(i64 %0, i1 true)
ret i64 %2
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_SUCCESS;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
void help(void) {
  printf("Usage: eichorncad [OPTION...]\n\n");
  printf("Options:\n");
  printf("  -h, --help                 print this help test\n");
  exit(EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<help>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
lea    0xee9(%rip),%rdi
call   1030 <printf@plt>
lea    0xee7(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e91(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<help>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
lea    0xeeb(%rip),%rdi
call   1030 <puts@plt>
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
mov    0x2e94(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [32 x i8] c"Usage: eichorncad [OPTION...]\0A\0A\00"
@.str.1 = [10 x i8] c"Options:\0A\00"
@.str.2 = [51 x i8] c" -h, --help print this help test\0A\00"
@EXIT_SUCCESS = global i32 0
define void @help() {
%1 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.2, i64 0, i64 0))
%4 = load i32, i32* @EXIT_SUCCESS
%5 = call i32 @exit(i32 %4)
unreachable
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
@str = [31 x i8] c"Usage: eichorncad [OPTION...]\0A\00"
@str.3 = [9 x i8] c"Options:\00"
@str.4 = [50 x i8] c" -h, --help print this help test\00"
define void @help() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str.3, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([50 x i8], [50 x i8]* @str.4, i64 0, i64 0))
%4 = load i32, i32* @EXIT_SUCCESS
%5 = tail call i32 @exit(i32 %4)
unreachable
}
int test_imm_A7int64_midword_reg(long long val) {
  return ((val >> 16) & (0xA7 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_A7int64_midword_reg>:
test   $0xa70000,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_A7int64_midword_reg(i64 %0) {
%2 = and i64 %0, 10944512
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
scalar_t__ strcmp(char const *, char *);
int isLT(const char *comm) { return strcmp(comm, "lt") == 0; }


x86 assembly (clang, -O0):
<isLT>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xed9(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isLT>:
push   %rax
lea    0xee8(%rip),%rsi
call   1030 <strcmp@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"lt\00"
define i32 @isLT(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i64 @strcmp(i8* %3, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%5 = icmp eq i64 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
@.str = [3 x i8] c"lt\00"
define i32 @isLT(i8* %0) {
%2 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i64 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void f6(int x) { printf("%d\n", x); }


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define void @f6(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
void w18(void *x, double y) { *(double *)(x + 32750) = y; }


x86 assembly (clang, -O0):
<w18>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,0x7fee(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<w18>:
movsd  %xmm0,0x7fee(%rdi)
ret

LLVM IR (-O0):
define void @w18(i8* %0, double %1) {
%3 = alloca i8*
%4 = alloca double
store i8* %0, i8** %3
store double %1, double* %4
%5 = load double, double* %4
%6 = load i8*, i8** %3
%7 = getelementptr i8, i8* %6, i64 32750
%8 = bitcast i8* %7 to double*
store double %5, double* %8
ret void
}

LLVM IR (-O2):
define void @w18(i8* nocapture writeonly %0, double %1) {
%3 = getelementptr i8, i8* %0, i64 32750
%4 = bitcast i8* %3 to double*
store double %1, double* %4
ret void
}
void fillbuf(char *buf, int count, char val) {
  while (count--)
    *buf++ = val;
}


x86 assembly (clang, -O0):
<fillbuf>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %al,-0xd(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0xc(%rbp)
cmp    $0x0,%eax
je     113d <fillbuf+0x3d>
mov    -0xd(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %cl,(%rax)
jmp    1110 <fillbuf+0x10>
pop    %rbp
ret

x86 assembly (clang, -O2):
<fillbuf>:
test   %esi,%esi
je     1126 <fillbuf+0x16>
push   %rax
mov    %esi,%eax
movzbl %dl,%esi
mov    %rax,%rdx
call   1030 <memset@plt>
add    $0x8,%rsp
ret

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

LLVM IR (-O2):
define void @fillbuf(i8* nocapture writeonly %0, i32 %1, i8 signext %2) {
%4 = icmp eq i32 %1, 0
br i1 %4, label %7, label %5
5: ; preds = %3
%6 = zext i32 %1 to i64
br label %7
7: ; preds = %5, %3
ret void
}
int *pdiff1(int *ptr, int off) { return ptr - off; }


x86 assembly (clang, -O0):
<pdiff1>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rdx
xor    %ecx,%ecx
sub    %rdx,%rcx
shl    $0x2,%rcx
add    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pdiff1>:
mov    %rdi,%rax
movslq %esi,%rcx
shl    $0x2,%rcx
sub    %rcx,%rax
ret

LLVM IR (-O0):
define i32* @pdiff1(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 = sext i32 %6 to i64
%8 = sub i64 0, %7
%9 = getelementptr inbounds i32, i32* %5, i64 %8
ret i32* %9
}

LLVM IR (-O2):
define i32* @pdiff1(i32* readnone %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = sub nsw i64 0, %3
%5 = getelementptr inbounds i32, i32* %0, i64 %4
ret i32* %5
}
void ath5k_debug_init_device(struct ath5k_softc *sc) {}


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

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

LLVM IR (-O0):
%struct.ath5k_softc = type opaque
define void @ath5k_debug_init_device(%struct.ath5k_softc* %0) {
%2 = alloca %struct.ath5k_softc*
store %struct.ath5k_softc* %0, %struct.ath5k_softc** %2
ret void
}

LLVM IR (-O2):
%struct.ath5k_softc = type opaque
define void @ath5k_debug_init_device(%struct.ath5k_softc* nocapture %0) {
ret void
}
unsigned long gt_rmq_superblock(unsigned long idx) { return ((idx) >> 8); }


x86 assembly (clang, -O0):
<gt_rmq_superblock>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
shr    $0x8,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<gt_rmq_superblock>:
mov    %rdi,%rax
shr    $0x8,%rax
ret

LLVM IR (-O0):
define i64 @gt_rmq_superblock(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = lshr i64 %3, 8
ret i64 %4
}

LLVM IR (-O2):
define i64 @gt_rmq_superblock(i64 %0) {
%2 = lshr i64 %0, 8
ret i64 %2
}
int is_wordchar(char c) {
  return ((c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z')) || c == '_';
}


x86 assembly (clang, -O0):
<is_wordchar>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x61,%eax
jl     1129 <is_wordchar+0x29>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x7a,%ecx
mov    %al,-0x2(%rbp)
jle    1155 <is_wordchar+0x55>
movsbl -0x1(%rbp),%eax
cmp    $0x41,%eax
jl     1148 <is_wordchar+0x48>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x5a,%ecx
mov    %al,-0x2(%rbp)
jle    1155 <is_wordchar+0x55>
movsbl -0x1(%rbp),%eax
cmp    $0x5f,%eax
sete   %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_wordchar>:
mov    %edi,%eax
and    $0xdf,%al
add    $0xbf,%al
cmp    $0x1a,%al
setb   %al
cmp    $0x5f,%dil
sete   %cl
or     %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @is_wordchar(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp sge i32 %4, 97
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp sle i32 %8, 122
br i1 %9, label %22, label %10
10: ; preds = %6, %1
%11 = load i8, i8* %2
%12 = sext i8 %11 to i32
%13 = icmp sge i32 %12, 65
br i1 %13, label %14, label %18
14: ; preds = %10
%15 = load i8, i8* %2
%16 = sext i8 %15 to i32
%17 = icmp sle i32 %16, 90
br i1 %17, label %22, label %18
18: ; preds = %14, %10
%19 = load i8, i8* %2
%20 = sext i8 %19 to i32
%21 = icmp eq i32 %20, 95
br label %22
22: ; preds = %18, %14, %6
%23 = phi i1 [ true, %14 ], [ true, %6 ], [ %21, %18 ]
%24 = zext i1 %23 to i32
ret i32 %24
}

LLVM IR (-O2):
define i32 @is_wordchar(i8 signext %0) {
%2 = and i8 %0, -33
%3 = add i8 %2, -65
%4 = icmp ult i8 %3, 26
%5 = icmp eq i8 %0, 95
%6 = or i1 %5, %4
%7 = zext i1 %6 to i32
ret i32 %7
}
void gtk_toggle_button_new_with_mnemonic() {}


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

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

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

LLVM IR (-O2):
define void @gtk_toggle_button_new_with_mnemonic() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ test_parser_sourcefile(char *, char *);
int /*<<< orphan*/ test_parser_verify_parse(int /*<<< orphan*/, char *, char *,
                                            char *, int /*<<< orphan*/);
void test_dmd_nested_block_comment() {
  test_parser_verify_parse(
      test_parser_sourcefile("dmd", "/+ /*d*/ not_code(); +/"), "dmd", "",
      "/+ /*d*/ not_code(); +/", 0);
}


x86 assembly (clang, -O0):
<test_dmd_nested_block_comment>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
lea    0xed2(%rip),%rsi
call   1030 <test_parser_sourcefile@plt>
mov    %eax,%edi
lea    0xec0(%rip),%rsi
lea    0xed4(%rip),%rdx
lea    0xeb6(%rip),%rcx
xor    %r8d,%r8d
call   1040 <test_parser_verify_parse@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_dmd_nested_block_comment>:
push   %r14
push   %rbx
push   %rax
lea    0xed5(%rip),%rbx
lea    0xed2(%rip),%r14
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <test_parser_sourcefile@plt>
lea    0xed7(%rip),%rdx
mov    %eax,%edi
mov    %rbx,%rsi
mov    %r14,%rcx
xor    %r8d,%r8d
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <test_parser_verify_parse@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"dmd\00"
@.str.1 = [24 x i8] c"/+ /*d*/ not_code(); +/\00"
@.str.2 = [1 x i8] zeroinitializer
define void @test_dmd_nested_block_comment() {
%1 = call i32 @test_parser_sourcefile(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0))
%2 = call i32 @test_parser_verify_parse(i32 %1, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), i32 0)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"dmd\00"
@.str.1 = [24 x i8] c"/+ /*d*/ not_code(); +/\00"
@.str.2 = [1 x i8] zeroinitializer
define void @test_dmd_nested_block_comment() {
%1 = tail call i32 @test_parser_sourcefile(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @test_parser_verify_parse(i32 %1, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, long, char *);
void printArray(char **a, long left, long right) {
  long i;
  for (i = left; i <= right; i = i + 1) {
    printf("%d: %s\n", i, a[i]);
  }
}


x86 assembly (clang, -O0):
<printArray>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x18(%rbp),%rax
jg     1167 <printArray+0x57>
mov    -0x20(%rbp),%rsi
mov    -0x8(%rbp),%rax
mov    -0x20(%rbp),%rcx
mov    (%rax,%rcx,8),%rdx
lea    0xeaf(%rip),%rdi
call   1030 <printf@plt>
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    112c <printArray+0x1c>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printArray>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
cmp    %rdx,%rsi
jg     1158 <printArray+0x48>
mov    %rdx,%r14
mov    %rsi,%rbx
mov    %rdi,%r15
add    $0x1,%r14
lea    0xecf(%rip),%r12
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    (%r15,%rbx,8),%rdx
mov    %r12,%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r14
jne    1140 <printArray+0x30>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [8 x i8] c"%d: %s\0A\00"
define void @printArray(i8** %0, i64 %1, i64 %2) {
%4 = alloca i8**
%5 = alloca i64
%6 = alloca i64
%7 = alloca i64
store i8** %0, i8*** %4
store i64 %1, i64* %5
store i64 %2, i64* %6
%8 = load i64, i64* %5
store i64 %8, i64* %7
br label %9
9: ; preds = %20, %3
%10 = load i64, i64* %7
%11 = load i64, i64* %6
%12 = icmp sle i64 %10, %11
br i1 %12, label %13, label %23
13: ; preds = %9
%14 = load i64, i64* %7
%15 = load i8**, i8*** %4
%16 = load i64, i64* %7
%17 = getelementptr inbounds i8*, i8** %15, i64 %16
%18 = load i8*, i8** %17
%19 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i64 %14, i8* %18)
br label %20
20: ; preds = %13
%21 = load i64, i64* %7
%22 = add nsw i64 %21, 1
store i64 %22, i64* %7
br label %9
23: ; preds = %9
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"%d: %s\0A\00"
define void @printArray(i8** nocapture %0, i64 %1, i64 %2) {
%4 = icmp sgt i64 %1, %2
br i1 %4, label %12, label %5
5: ; preds = %3, %5
%6 = phi i64 [ %10, %5 ], [ %1, %3 ]
%7 = getelementptr inbounds i8*, i8** %0, i64 %6
%8 = load i8*, i8** %7
%9 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i64 %6, i8* %8)
%10 = add i64 %6, 1
%11 = icmp eq i64 %6, %2
br i1 %11, label %12, label %5
12: ; preds = %5, %3
ret void
}
int test_imm_ABint64_midword_mem(long long *val) {
  return ((*val >> 16) & (0xAB << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_ABint64_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, 171
%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_ABint64_midword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 11206656
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ assert_dbl_equal_(char *, int, double, double, double);
void test_dbl_equal_fail() {
  assert_dbl_equal_("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
                    "outputs/2022-01-22/02-19-57/repos/hughbien/assertive/refs/"
                    "heads/master/test/fail_test.c",
                    38, (1.0), (1.15), (0.1));
}


x86 assembly (clang, -O0):
<test_dbl_equal_fail>:
push   %rbp
mov    %rsp,%rbp
lea    0xefd(%rip),%rdi
mov    $0x26,%esi
movsd  0xed8(%rip),%xmm0
movsd  0xed8(%rip),%xmm1
movsd  0xed8(%rip),%xmm2
call   1030 <assert_dbl_equal_@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_dbl_equal_fail>:
lea    0xf01(%rip),%rdi
movsd  0xee1(%rip),%xmm0
movsd  0xee1(%rip),%xmm1
movsd  0xee1(%rip),%xmm2
mov    $0x26,%esi
jmp    1030 <assert_dbl_equal_@plt>

LLVM IR (-O0):
@.str = [144 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/hughbien/assertive/refs/heads/master/test/fail_test.c\00"
define void @test_dbl_equal_fail() {
%1 = call i32 @assert_dbl_equal_(i8* getelementptr inbounds ([144 x i8], [144 x i8]* @.str, i64 0, i64 0), i32 38, double 1.000000e+00, double 1.150000e+00, double 1.000000e-01)
ret void
}

LLVM IR (-O2):
@.str = [144 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/hughbien/assertive/refs/heads/master/test/fail_test.c\00"
define void @test_dbl_equal_fail() {
%1 = tail call i32 @assert_dbl_equal_(i8* getelementptr inbounds ([144 x i8], [144 x i8]* @.str, i64 0, i64 0), i32 38, double 1.000000e+00, double 1.150000e+00, double 1.000000e-01)
ret void
}
void Increment(int *x, int max) {
  if ((*x) < max)
    (*x)++;
  return;
}


x86 assembly (clang, -O0):
<Increment>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
cmp    -0xc(%rbp),%eax
jge    1125 <Increment+0x25>
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
add    $0x1,%ecx
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<Increment>:
mov    (%rdi),%eax
cmp    %esi,%eax
jge    110b <Increment+0xb>
add    $0x1,%eax
mov    %eax,(%rdi)
ret

LLVM IR (-O0):
define void @Increment(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* %5
%7 = load i32, i32* %4
%8 = icmp slt i32 %6, %7
br i1 %8, label %9, label %13
9: ; preds = %2
%10 = load i32*, i32** %3
%11 = load i32, i32* %10
%12 = add nsw i32 %11, 1
store i32 %12, i32* %10
br label %13
13: ; preds = %9, %2
ret void
}

LLVM IR (-O2):
define void @Increment(i32* nocapture %0, i32 %1) {
%3 = load i32, i32* %0
%4 = icmp slt i32 %3, %1
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = add nsw i32 %3, 1
store i32 %6, i32* %0
br label %7
7: ; preds = %5, %2
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
void Set_Word(int /*<<< orphan*/ *, int /*<<< orphan*/, int /*<<< orphan*/);
void Abs_Set_Word(int32_t address, int32_t value) {
  return Set_Word(NULL, address, value);
}


x86 assembly (clang, -O0):
<Abs_Set_Word>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
xor    %eax,%eax
mov    %eax,%edi
call   1030 <Set_Word@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Abs_Set_Word>:
mov    %esi,%edx
mov    %edi,%esi
xor    %edi,%edi
jmp    1030 <Set_Word@plt>

LLVM IR (-O0):
define void @Abs_Set_Word(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
ret void
}

LLVM IR (-O2):
define void @Abs_Set_Word(i32 %0, i32 %1) {
tail call void @Set_Word(i32* null, i32 %0, i32 %1)
ret void
}
/* Type definitions */
struct conf_sect_t {
  int dummy;
};

/* Variables and functions */
struct conf_sect_t *find_sect(char const *);
__attribute__((visibility("default"))) struct conf_sect_t *
conf_get_section(const char *name) {
  return find_sect(name);
}


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

x86 assembly (clang, -O2):
<conf_get_section>:
jmp    1030 <find_sect@plt>

LLVM IR (-O0):
%struct.conf_sect_t = type { i32 }
define %struct.conf_sect_t* @conf_get_section(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call %struct.conf_sect_t* @find_sect(i8* %3)
ret %struct.conf_sect_t* %4
}

LLVM IR (-O2):
%struct.conf_sect_t = type { i32 }
define %struct.conf_sect_t* @conf_get_section(i8* %0) {
%2 = tail call %struct.conf_sect_t* @find_sect(i8* %0)
ret %struct.conf_sect_t* %2
}
void ASN1_STRING_set_by_NID(void) {}


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

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

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

LLVM IR (-O2):
define void @ASN1_STRING_set_by_NID() {
ret void
}
/* Variables and functions */
double func(int *, int);
int /*<<< orphan*/ printf(char *, double);
int main() {
  int array[] = {1, 2, 3, 4, 5};
  printf("%f\n", func(array, 5));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xec7(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xec5(%rip),%eax
mov    %eax,-0x10(%rbp)
lea    -0x20(%rbp),%rdi
mov    $0x5,%esi
call   1040 <func@plt>
lea    0xeb1(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
mov    0xee6(%rip),%eax
mov    %eax,0x10(%rsp)
movaps 0xecb(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
mov    $0x5,%esi
call   1040 <func@plt>
lea    0xec7(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.main.array = [5 x i32] [i32 1, i32 2, i32 3, i32 4, i32 5]
@.str = [4 x i8] c"%f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [5 x i32]
store i32 0, i32* %1
%3 = bitcast [5 x i32]* %2 to i8*
%4 = getelementptr inbounds [5 x i32], [5 x i32]* %2, i64 0, i64 0
%5 = call double @func(i32* %4, i32 5)
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double %5)
ret i32 0
}

LLVM IR (-O2):
@__const.main.array = [5 x i32] [i32 1, i32 2, i32 3, i32 4, i32 5]
@.str = [4 x i8] c"%f\0A\00"
define i32 @main() {
%1 = alloca [5 x i32]
%2 = bitcast [5 x i32]* %1 to i8*
%3 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 0
%4 = call double @func(i32* %3, i32 5)
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double %4)
ret i32 0
}
/* Variables and functions */
int cpuid_edx(int);
int rdtsc_is_invariant(void) {
  if (cpuid_edx(0x80000007) & (1 << 8)) {
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<rdtsc_is_invariant>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x80000007,%edi
call   1030 <cpuid_edx@plt>
and    $0x100,%eax
cmp    $0x0,%eax
je     113c <rdtsc_is_invariant+0x2c>
movl   $0x1,-0x4(%rbp)
jmp    1143 <rdtsc_is_invariant+0x33>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rdtsc_is_invariant>:
push   %rax
mov    $0x80000007,%edi
call   1030 <cpuid_edx@plt>
shr    $0x8,%eax
and    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @rdtsc_is_invariant() {
%1 = alloca i32
%2 = call i32 @cpuid_edx(i32 -2147483641)
%3 = and i32 %2, 256
%4 = icmp ne i32 %3, 0
br i1 %4, label %5, label %6
5: ; preds = %0
store i32 1, i32* %1
br label %7
6: ; preds = %0
store i32 0, i32* %1
br label %7
7: ; preds = %6, %5
%8 = load i32, i32* %1
ret i32 %8
}

LLVM IR (-O2):
define i32 @rdtsc_is_invariant() {
%1 = tail call i32 @cpuid_edx(i32 -2147483641)
%2 = lshr i32 %1, 8
%3 = and i32 %2, 1
ret i32 %3
}
/* Type definitions */
struct in_addr {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ inet_aton(char const *, struct in_addr *);
scalar_t__ strcmp(char const *, char *);
void getIp(const char *ipString, struct in_addr *out) {
  if (strcmp(ipString, "localhost") == 0) {
    inet_aton("127.0.0.1", out);
  } else {
    inet_aton(ipString, out);
  }
}


x86 assembly (clang, -O0):
<getIp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xec5(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
jne    115f <getIp+0x3f>
mov    -0x10(%rbp),%rsi
lea    0xeb5(%rip),%rdi
call   1040 <inet_aton@plt>
jmp    116c <getIp+0x4c>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <inet_aton@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getIp>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
lea    0xecf(%rip),%rsi
call   1030 <strcmp@plt>
test   %rax,%rax
lea    0xeca(%rip),%rdi
cmovne %rbx,%rdi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <inet_aton@plt>

LLVM IR (-O0):
%struct.in_addr = type { i32 }
@.str = [10 x i8] c"localhost\00"
@.str.1 = [10 x i8] c"127.0.0.1\00"
define void @getIp(i8* %0, %struct.in_addr* %1) {
%3 = alloca i8*
%4 = alloca %struct.in_addr*
store i8* %0, i8** %3
store %struct.in_addr* %1, %struct.in_addr** %4
%5 = load i8*, i8** %3
%6 = call i64 @strcmp(i8* %5, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %11
8: ; preds = %2
%9 = load %struct.in_addr*, %struct.in_addr** %4
%10 = call i32 @inet_aton(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), %struct.in_addr* %9)
br label %15
11: ; preds = %2
%12 = load i8*, i8** %3
%13 = load %struct.in_addr*, %struct.in_addr** %4
%14 = call i32 @inet_aton(i8* %12, %struct.in_addr* %13)
br label %15
15: ; preds = %11, %8
ret void
}

LLVM IR (-O2):
%struct.in_addr = type { i32 }
@.str = [10 x i8] c"localhost\00"
@.str.1 = [10 x i8] c"127.0.0.1\00"
define void @getIp(i8* %0, %struct.in_addr* %1) {
%3 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8* %0
%6 = tail call i32 @inet_aton(i8* %5, %struct.in_addr* %1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ value;
typedef scalar_t__ caddr_t;

/* Variables and functions */
int /*<<< orphan*/ memcpy(scalar_t__, float *, int);
void ptr_set_float(void *arg1, int offset, float value) {
  memcpy((caddr_t)arg1 + offset, &value, sizeof(value));
}


x86 assembly (clang, -O0):
<ptr_set_float>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movss  %xmm0,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
movslq -0xc(%rbp),%rax
add    %rax,%rdi
lea    -0x10(%rbp),%rsi
mov    $0x4,%edx
call   1030 <memcpy@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ptr_set_float>:
push   %rax
movss  %xmm0,0x4(%rsp)
movslq %esi,%rax
add    %rax,%rdi
lea    0x4(%rsp),%rsi
mov    $0x4,%edx
call   1030 <memcpy@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @ptr_set_float(i8* %0, i32 %1, float %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca float
store i8* %0, i8** %4
store i32 %1, i32* %5
store float %2, float* %6
%7 = load i8*, i8** %4
%8 = ptrtoint i8* %7 to i64
%9 = load i32, i32* %5
%10 = sext i32 %9 to i64
%11 = add nsw i64 %8, %10
%12 = call i32 @memcpy(i64 %11, float* %6, i32 4)
ret void
}

LLVM IR (-O2):
define void @ptr_set_float(i8* %0, i32 %1, float %2) {
%4 = alloca float
store float %2, float* %4
%5 = ptrtoint i8* %0 to i64
%6 = sext i32 %1 to i64
%7 = add nsw i64 %6, %5
%8 = call i32 @memcpy(i64 %7, float* %4, i32 4)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ cl_program;
typedef int cl_kernel;
typedef scalar_t__ cl_int;
typedef int /*<<< orphan*/ cl_context;

/* Variables and functions */
scalar_t__ CL_SUCCESS;
int /*<<< orphan*/ assert(int);
int clCreateKernel(int /*<<< orphan*/, char *, scalar_t__ *);
int CreateKernel(cl_kernel *kernel, cl_context ctx, cl_program program) {
  cl_int status = 0;
  *kernel = clCreateKernel(program, "VectorAddKernel", &status);
  assert(status == CL_SUCCESS);
  assert(*kernel);
  return 0;
}


x86 assembly (clang, -O0):
<CreateKernel>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x10(%rbp),%edi
lea    0xebc(%rip),%rsi
lea    -0x18(%rbp),%rdx
call   1040 <clCreateKernel@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x18(%rbp),%rax
mov    0x2e80(%rip),%rcx
cmp    (%rcx),%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
call   1030 <assert@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CreateKernel>:
push   %rbx
sub    $0x10,%rsp
mov    %edx,%eax
mov    %rdi,%rbx
movq   $0x0,0x8(%rsp)
lea    0xec6(%rip),%rsi
lea    0x8(%rsp),%rdx
mov    %eax,%edi
call   1040 <clCreateKernel@plt>
mov    %eax,(%rbx)
mov    0x8(%rsp),%rax
mov    0x2e8c(%rip),%rcx
xor    %edi,%edi
cmp    (%rcx),%rax
sete   %dil
call   1030 <assert@plt>
mov    (%rbx),%edi
call   1030 <assert@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [16 x i8] c"VectorAddKernel\00"
@CL_SUCCESS = global i64 0
define i32 @CreateKernel(i32* %0, i32 %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i64
store i32* %0, i32** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
store i64 0, i64* %7
%8 = load i32, i32* %6
%9 = call i32 @clCreateKernel(i32 %8, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i64* %7)
%10 = load i32*, i32** %4
store i32 %9, i32* %10
%11 = load i64, i64* %7
%12 = load i64, i64* @CL_SUCCESS
%13 = icmp eq i64 %11, %12
%14 = zext i1 %13 to i32
%15 = call i32 @assert(i32 %14)
%16 = load i32*, i32** %4
%17 = load i32, i32* %16
%18 = call i32 @assert(i32 %17)
ret i32 0
}

LLVM IR (-O2):
@.str = [16 x i8] c"VectorAddKernel\00"
@CL_SUCCESS = global i64 0
define i32 @CreateKernel(i32* nocapture %0, i32 %1, i32 %2) {
%4 = alloca i64
%5 = bitcast i64* %4 to i8*
store i64 0, i64* %4
%6 = call i32 @clCreateKernel(i32 %2, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i64* %4)
store i32 %6, i32* %0
%7 = load i64, i64* %4
%8 = load i64, i64* @CL_SUCCESS
%9 = icmp eq i64 %7, %8
%10 = zext i1 %9 to i32
%11 = call i32 @assert(i32 %10)
%12 = load i32, i32* %0
%13 = call i32 @assert(i32 %12)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, double);
double sin(int);
int main(int argc, const char *argv[]) {
  printf("sin(1) = %.3f\n", sin(1));
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%edi
call   1040 <sin@plt>
lea    0xece(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [15 x i8] c"sin(1) = %.3f\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call double @sin(i32 1)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), double %3)
ret i32 0
}
void check_expanded_str(const char buf[], int skip, int *nexpansions) {
  if (buf[0] != '\0' && !skip) {
    ++*nexpansions;
  }
}


x86 assembly (clang, -O0):
<check_expanded_str>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1134 <check_expanded_str+0x34>
cmpl   $0x0,-0xc(%rbp)
jne    1134 <check_expanded_str+0x34>
mov    -0x18(%rbp),%rax
mov    (%rax),%ecx
add    $0x1,%ecx
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_expanded_str>:
test   %esi,%esi
jne    110c <check_expanded_str+0xc>
cmpb   $0x0,(%rdi)
je     110c <check_expanded_str+0xc>
addl   $0x1,(%rdx)
ret

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

LLVM IR (-O2):
define void @check_expanded_str(i8* nocapture %0, i32 %1, i32* nocapture %2) {
%4 = load i8, i8* %0
%5 = icmp eq i8 %4, 0
%6 = icmp ne i32 %1, 0
%7 = or i1 %6, %5
br i1 %7, label %11, label %8
8: ; preds = %3
%9 = load i32, i32* %2
%10 = add nsw i32 %9, 1
store i32 %10, i32* %2
br label %11
11: ; preds = %8, %3
ret void
}
/* Variables and functions */
int __VERIFIER_nondet_int();
int main() {
  int x, y, tmp;
  x = __VERIFIER_nondet_int();
  y = __VERIFIER_nondet_int();
  tmp = __VERIFIER_nondet_int();
  while (x > y) {
    tmp = x;
    x = y;
    y = tmp;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0xc(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    1160 <main+0x50>
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    113d <main+0x2d>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @__VERIFIER_nondet_int()
%2 = tail call i32 (...) @__VERIFIER_nondet_int()
%3 = tail call i32 (...) @__VERIFIER_nondet_int()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(void) {
  printf("cl.h standalone test PASSED.\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [30 x i8] c"cl.h standalone test PASSED.\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [29 x i8] c"cl.h standalone test PASSED.\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @str, i64 0, i64 0))
ret i32 0
}