xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ assert(float *);
scalar_t__ calloc(size_t const, int);
float *fvector(const size_t n) {
  float *v = (float *)calloc(n, sizeof(float));
  assert(v);
  return v;
}


x86 assembly (clang, -O0):
<fvector>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x4,%esi
call   1030 <calloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <assert@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fvector>:
push   %rbx
mov    $0x4,%esi
call   1030 <calloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1040 <assert@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define float* @fvector(i64 %0) {
%2 = alloca i64
%3 = alloca float*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i64 @calloc(i64 %4, i32 4)
%6 = inttoptr i64 %5 to float*
store float* %6, float** %3
%7 = load float*, float** %3
%8 = call i32 @assert(float* %7)
%9 = load float*, float** %3
ret float* %9
}

LLVM IR (-O2):
define float* @fvector(i64 %0) {
%2 = tail call i64 @calloc(i64 %0, i32 4)
%3 = inttoptr i64 %2 to float*
%4 = tail call i32 @assert(float* %3)
ret float* %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void usage(void) {
  printf("fmapp - ver 1.0.0.2\n");
  printf("Usage:\n"
         "\tfmapp [options] devicename ogf 0cf [command content]\n"
         "\tdevicename example mfmchar0\n"
         "\togf example 0x3f\n"
         "\tocf example 0x280\n"
         "\tCommands supported are as follows:\n");
  printf("Command Options:\n"
         "\t-h\tDisplay help\n"
         "\t-v\tVerbose\n");
}


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

x86 assembly (clang, -O2):
<usage>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xef0(%rip),%rdi
call   1030 <puts@plt>
lea    0xf87(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [21 x i8] c"fmapp - ver 1.0.0.2\0A\00"
@.str.1 = [164 x i8] c"Usage:\0A\09fmapp [options] devicename ogf 0cf [command content]\0A\09devicename example mfmchar0\0A\09ogf example 0x3f\0A\09ocf example 0x280\0A\09Commands supported are as follows:\0A\00"
@.str.2 = [47 x i8] c"Command Options:\0A\09-h\09Display help\0A\09-v\09Verbose\0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([164 x i8], [164 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [20 x i8] c"fmapp - ver 1.0.0.2\00"
@str.3 = [163 x i8] c"Usage:\0A\09fmapp [options] devicename ogf 0cf [command content]\0A\09devicename example mfmchar0\0A\09ogf example 0x3f\0A\09ocf example 0x280\0A\09Commands supported are as follows:\00"
@str.4 = [46 x i8] c"Command Options:\0A\09-h\09Display help\0A\09-v\09Verbose\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([163 x i8], [163 x i8]* @str.3, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([46 x i8], [46 x i8]* @str.4, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ putchar(char);
int main(int argc, char **argv) {
  while (argc-- > 1)
    printf("%s ", *++argv);
  putchar('\n');
  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    -0x8(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x8(%rbp)
cmp    $0x1,%eax
jle    116e <main+0x4e>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x10(%rbp)
mov    0x8(%rax),%rsi
lea    0xe9c(%rip),%rdi
call   1040 <printf@plt>
jmp    1136 <main+0x16>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
cmp    $0x2,%edi
jl     1157 <main+0x37>
mov    %rsi,%rbx
mov    %edi,%ebp
add    $0x8,%rbx
add    $0x1,%ebp
lea    0xec4(%rip),%r14
nopl   0x0(%rax)
mov    (%rbx),%rsi
mov    %r14,%rdi
call   1040 <printf@plt>
add    $0x8,%rbx
add    $0xffffffff,%ebp
cmp    $0x2,%ebp
ja     1140 <main+0x20>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%s \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
br label %6
6: ; preds = %10, %2
%7 = load i32, i32* %4
%8 = add nsw i32 %7, -1
store i32 %8, i32* %4
%9 = icmp sgt i32 %7, 1
br i1 %9, label %10, label %15
10: ; preds = %6
%11 = load i8**, i8*** %5
%12 = getelementptr inbounds i8*, i8** %11, i32 1
store i8** %12, i8*** %5
%13 = load i8*, i8** %12
%14 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %13)
br label %6
15: ; preds = %6
%16 = call i32 @putchar(i8 signext 10)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%s \00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 1
br i1 %3, label %4, label %12
4: ; preds = %2, %4
%5 = phi i8** [ %8, %4 ], [ %1, %2 ]
%6 = phi i32 [ %7, %4 ], [ %0, %2 ]
%7 = add nsw i32 %6, -1
%8 = getelementptr inbounds i8*, i8** %5, i64 1
%9 = load i8*, i8** %8
%10 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %9)
%11 = icmp ugt i32 %6, 2
br i1 %11, label %4, label %12
12: ; preds = %4, %2
%13 = tail call i32 @putchar(i8 signext 10)
ret i32 0
}
int mpic_u3msi_init(struct mpic *mpic) { return -1; }


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

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

LLVM IR (-O0):
%struct.mpic = type opaque
define i32 @mpic_u3msi_init(%struct.mpic* %0) {
%2 = alloca %struct.mpic*
store %struct.mpic* %0, %struct.mpic** %2
ret i32 -1
}

LLVM IR (-O2):
%struct.mpic = type opaque
define i32 @mpic_u3msi_init(%struct.mpic* nocapture readnone %0) {
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ check(char *, char *);
int /*<<< orphan*/ init(char *, char *);
int /*<<< orphan*/ vec_mult(char *);
int /*<<< orphan*/ vec_mult_ref(char *);
int main() {
  char p1[100000], p2[100000];
  char v1[100000], v2[100000];
  init(v1, v2);
  vec_mult_ref(p1);
  vec_mult(p2);
  check(p1, p2);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x61a90,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x493f0(%rbp),%rdi
lea    -0x61a90(%rbp),%rsi
call   1030 <init@plt>
lea    -0x186b0(%rbp),%rdi
call   1040 <vec_mult_ref@plt>
lea    -0x30d50(%rbp),%rdi
call   1060 <vec_mult@plt>
lea    -0x186b0(%rbp),%rdi
lea    -0x30d50(%rbp),%rsi
call   1050 <check@plt>
xor    %eax,%eax
add    $0x61a90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x61a88,%rsp
lea    0x186a0(%rsp),%rdi
mov    %rsp,%rsi
call   1030 <init@plt>
lea    0x493e0(%rsp),%r14
mov    %r14,%rdi
call   1040 <vec_mult_ref@plt>
lea    0x30d40(%rsp),%rbx
mov    %rbx,%rdi
call   1060 <vec_mult@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1050 <check@plt>
xor    %eax,%eax
add    $0x61a88,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca [100000 x i8]
%3 = alloca [100000 x i8]
%4 = alloca [100000 x i8]
%5 = alloca [100000 x i8]
store i32 0, i32* %1
%6 = getelementptr inbounds [100000 x i8], [100000 x i8]* %4, i64 0, i64 0
%7 = getelementptr inbounds [100000 x i8], [100000 x i8]* %5, i64 0, i64 0
%8 = call i32 @init(i8* %6, i8* %7)
%9 = getelementptr inbounds [100000 x i8], [100000 x i8]* %2, i64 0, i64 0
%10 = call i32 @vec_mult_ref(i8* %9)
%11 = getelementptr inbounds [100000 x i8], [100000 x i8]* %3, i64 0, i64 0
%12 = call i32 @vec_mult(i8* %11)
%13 = getelementptr inbounds [100000 x i8], [100000 x i8]* %2, i64 0, i64 0
%14 = getelementptr inbounds [100000 x i8], [100000 x i8]* %3, i64 0, i64 0
%15 = call i32 @check(i8* %13, i8* %14)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca [100000 x i8]
%2 = alloca [100000 x i8]
%3 = alloca [100000 x i8]
%4 = alloca [100000 x i8]
%5 = getelementptr inbounds [100000 x i8], [100000 x i8]* %1, i64 0, i64 0
%6 = getelementptr inbounds [100000 x i8], [100000 x i8]* %2, i64 0, i64 0
%7 = getelementptr inbounds [100000 x i8], [100000 x i8]* %3, i64 0, i64 0
%8 = getelementptr inbounds [100000 x i8], [100000 x i8]* %4, i64 0, i64 0
%9 = call i32 @init(i8* %7, i8* %8)
%10 = call i32 @vec_mult_ref(i8* %5)
%11 = call i32 @vec_mult(i8* %6)
%12 = call i32 @check(i8* %5, i8* %6)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;

/* Variables and functions */
char *ctime(int /*<<< orphan*/ *);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
void prtime(void) {
  time_t t;
  (void)time(&t);
  (void)printf("%s", ctime(&t));
}


x86 assembly (clang, -O0):
<prtime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x4(%rbp),%rdi
call   1050 <time@plt>
lea    -0x4(%rbp),%rdi
call   1030 <ctime@plt>
mov    %rax,%rsi
lea    0xeac(%rip),%rdi
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<prtime>:
push   %rbx
sub    $0x10,%rsp
lea    0xc(%rsp),%rbx
mov    %rbx,%rdi
call   1050 <time@plt>
mov    %rbx,%rdi
call   1030 <ctime@plt>
lea    0xeaf(%rip),%rdi
mov    %rax,%rsi
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define void @prtime() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @time(i32* %1)
%4 = call i8* @ctime(i32* %1)
%5 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %4)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *);
void google_chart_include(FILE *output_file) {
  fprintf(output_file,
          "<script type=\"text/javascript\" "
          "src=\"https://www.gstatic.com/charts/loader.js\"></script>\n");
}


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

x86 assembly (clang, -O2):
<google_chart_include>:
mov    %rdi,%rcx
lea    0xee6(%rip),%rdi
mov    $0x58,%esi
mov    $0x1,%edx
jmp    1030 <fwrite@plt>

LLVM IR (-O0):
@.str = [89 x i8] c"<script type=\22text/javascript\22 src=\22https://www.gstatic.com/charts/loader.js\22></script>\0A\00"
define void @google_chart_include(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @fprintf(i32* %3, i8* getelementptr inbounds ([89 x i8], [89 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [89 x i8] c"<script type=\22text/javascript\22 src=\22https://www.gstatic.com/charts/loader.js\22></script>\0A\00"
define void @google_chart_include(i32* nocapture %0) {
%2 = tail call i64 @fwrite(i8* getelementptr inbounds ([89 x i8], [89 x i8]* @.str, i64 0, i64 0), i64 88, i64 1, i32* %0)
ret void
}
void PlatformLibraryInit() {}


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

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

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

LLVM IR (-O2):
define void @PlatformLibraryInit() {
ret void
}
int flip_on(char *addr) {
  if ((addr[0] & 1) == 0) {
    addr[0] |= 0x01;
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<flip_on>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
and    $0x1,%eax
cmp    $0x0,%eax
jne    1133 <flip_on+0x33>
mov    -0x10(%rbp),%rax
movsbl (%rax),%ecx
or     $0x1,%ecx
mov    %cl,(%rax)
movl   $0x1,-0x4(%rbp)
jmp    113a <flip_on+0x3a>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<flip_on>:
mov    (%rdi),%cl
xor    %eax,%eax
test   $0x1,%cl
jne    1113 <flip_on+0x13>
or     $0x1,%cl
mov    %cl,(%rdi)
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @flip_on(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, 1
%4 = icmp eq i8 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = or i8 %2, 1
store i8 %6, i8* %0
br label %7
7: ; preds = %1, %5
%8 = phi i32 [ 1, %5 ], [ 0, %1 ]
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ vecNf_print(float const *, int);
void vec4f_print(const float v[4]) { vecNf_print(v, 4); }


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

x86 assembly (clang, -O2):
<vec4f_print>:
mov    $0x4,%esi
jmp    1030 <vecNf_print@plt>

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

LLVM IR (-O2):
define void @vec4f_print(float* %0) {
%2 = tail call i32 @vecNf_print(float* %0, i32 4)
ret void
}
/* Type definitions */
typedef int int16_t;

/* Variables and functions */
int /*<<< orphan*/ assert_or_panic(int);
void c_i16(int16_t x) { assert_or_panic(x == -2); }


x86 assembly (clang, -O0):
<c_i16>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0xfffffffe,-0x4(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert_or_panic@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<c_i16>:
xor    %eax,%eax
cmp    $0xfffffffe,%edi
sete   %al
mov    %eax,%edi
jmp    1030 <assert_or_panic@plt>

LLVM IR (-O0):
define void @c_i16(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, -2
%5 = zext i1 %4 to i32
%6 = call i32 @assert_or_panic(i32 %5)
ret void
}

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

/* Variables and functions */
int /*<<< orphan*/ bin_to_hex4(int);
int /*<<< orphan*/ putc(int /*<<< orphan*/, int /*<<< orphan*/ *);
void puth(uint8_t hex, FILE *f) {
  putc(bin_to_hex4((hex >> 4)), f);
  putc(bin_to_hex4((hex >> 0)), f);
}


x86 assembly (clang, -O0):
<puth>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
sar    $0x4,%edi
call   1040 <bin_to_hex4@plt>
mov    %eax,%edi
mov    -0x10(%rbp),%rsi
call   1030 <putc@plt>
mov    -0x4(%rbp),%edi
sar    $0x0,%edi
call   1040 <bin_to_hex4@plt>
mov    %eax,%edi
mov    -0x10(%rbp),%rsi
call   1030 <putc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<puth>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
sar    $0x4,%edi
call   1040 <bin_to_hex4@plt>
mov    %eax,%edi
mov    %rbx,%rsi
call   1030 <putc@plt>
mov    %ebp,%edi
call   1040 <bin_to_hex4@plt>
mov    %eax,%edi
mov    %rbx,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <putc@plt>

LLVM IR (-O0):
define void @puth(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 = ashr i32 %5, 4
%7 = call i32 @bin_to_hex4(i32 %6)
%8 = load i32*, i32** %4
%9 = call i32 @putc(i32 %7, i32* %8)
%10 = load i32, i32* %3
%11 = ashr i32 %10, 0
%12 = call i32 @bin_to_hex4(i32 %11)
%13 = load i32*, i32** %4
%14 = call i32 @putc(i32 %12, i32* %13)
ret void
}

LLVM IR (-O2):
define void @puth(i32 %0, i32* nocapture %1) {
%3 = ashr i32 %0, 4
%4 = tail call i32 @bin_to_hex4(i32 %3)
%5 = tail call i32 @putc(i32 %4, i32* %1)
%6 = tail call i32 @bin_to_hex4(i32 %0)
%7 = tail call i32 @putc(i32 %6, i32* %1)
ret void
}
/* Variables and functions */
int RSA2048_execute(int, char *);
int /*<<< orphan*/ printf(char *);
int RSA2048_Sign_CRT(int fd) {
  int ret;
  ret = RSA2048_execute(fd, "BF13C08000");
  if (ret != 0) {
    printf("ERR:RSA2048_Encrypt failed!\n");
    return 1;
  }
}


x86 assembly (clang, -O0):
<RSA2048_Sign_CRT>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
lea    0xecb(%rip),%rsi
call   1040 <RSA2048_execute@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     115a <RSA2048_Sign_CRT+0x3a>
lea    0xebd(%rip),%rdi
call   1030 <printf@plt>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<RSA2048_Sign_CRT>:
push   %rax
lea    0xed8(%rip),%rsi
call   1040 <RSA2048_execute@plt>
test   %eax,%eax
je     113d <RSA2048_Sign_CRT+0x1d>
lea    0xed3(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [11 x i8] c"BF13C08000\00"
@.str.1 = [29 x i8] c"ERR:RSA2048_Encrypt failed!\0A\00"
define i32 @RSA2048_Sign_CRT(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
%5 = load i32, i32* %3
%6 = call i32 @RSA2048_execute(i32 %5, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
store i32 %6, i32* %4
%7 = load i32, i32* %4
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %1
%10 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
store i32 1, i32* %2
br label %11
11: ; preds = %9, %1
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
@.str = [11 x i8] c"BF13C08000\00"
@str = [28 x i8] c"ERR:RSA2048_Encrypt failed!\00"
define i32 @RSA2048_Sign_CRT(i32 %0) {
%2 = tail call i32 @RSA2048_execute(i32 %0, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i32 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str, i64 0, i64 0))
br label %6
6: ; preds = %1, %4
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ new_prefix(char const *);
void picosat_set_prefix(const char *str) { new_prefix(str); }


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

x86 assembly (clang, -O2):
<picosat_set_prefix>:
jmp    1030 <new_prefix@plt>

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

LLVM IR (-O2):
define void @picosat_set_prefix(i8* %0) {
%2 = tail call i32 @new_prefix(i8* %0)
ret void
}
/* Variables and functions */
int U_WMRCREATEBRUSHINDIRECT_get(char const *, char const **);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ wlogbrush_print(char const *);
void U_WMRCREATEBRUSHINDIRECT_print(const char *contents) {
  const char *brush;
  int size = U_WMRCREATEBRUSHINDIRECT_get(contents, &brush);
  if (size > 0) {
    printf("   Brush:");
    wlogbrush_print(brush);
    printf("\n");
  }
}


x86 assembly (clang, -O0):
<U_WMRCREATEBRUSHINDIRECT_print>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x10(%rbp),%rsi
call   1050 <U_WMRCREATEBRUSHINDIRECT_get@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jle    1177 <U_WMRCREATEBRUSHINDIRECT_print+0x47>
lea    0xea3(%rip),%rdi
call   1040 <printf@plt>
mov    -0x10(%rbp),%rdi
call   1030 <wlogbrush_print@plt>
lea    0xe98(%rip),%rdi
call   1040 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<U_WMRCREATEBRUSHINDIRECT_print>:
push   %rax
mov    %rsp,%rsi
call   1060 <U_WMRCREATEBRUSHINDIRECT_get@plt>
test   %eax,%eax
jle    116c <U_WMRCREATEBRUSHINDIRECT_print+0x2c>
lea    0xeac(%rip),%rdi
call   1050 <printf@plt>
mov    (%rsp),%rdi
call   1040 <wlogbrush_print@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [10 x i8] c" Brush:\00"
@.str.1 = [2 x i8] c"\0A\00"
define void @U_WMRCREATEBRUSHINDIRECT_print(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i32 @U_WMRCREATEBRUSHINDIRECT_get(i8* %5, i8** %3)
store i32 %6, i32* %4
%7 = load i32, i32* %4
%8 = icmp sgt i32 %7, 0
br i1 %8, label %9, label %14
9: ; preds = %1
%10 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%11 = load i8*, i8** %3
%12 = call i32 @wlogbrush_print(i8* %11)
%13 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
br label %14
14: ; preds = %9, %1
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c" Brush:\00"
define void @U_WMRCREATEBRUSHINDIRECT_print(i8* %0) {
%2 = alloca i8*
%3 = bitcast i8** %2 to i8*
%4 = call i32 @U_WMRCREATEBRUSHINDIRECT_get(i8* %0, i8** %2)
%5 = icmp sgt i32 %4, 0
br i1 %5, label %6, label %11
6: ; preds = %1
%7 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%8 = load i8*, i8** %2
%9 = call i32 @wlogbrush_print(i8* %8)
%10 = call i32 @putchar(i32 10)
br label %11
11: ; preds = %6, %1
ret void
}
void path_append_restore(char *storeval) { *storeval = '\0'; }


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

x86 assembly (clang, -O2):
<path_append_restore>:
movb   $0x0,(%rdi)
ret

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

LLVM IR (-O2):
define void @path_append_restore(i8* nocapture writeonly %0) {
store i8 0, i8* %0
ret void
}
/* Type definitions */
struct demod_state {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ selcall_init(struct demod_state *);
void zvei2_init(struct demod_state *s) { selcall_init(s); }


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

x86 assembly (clang, -O2):
<zvei2_init>:
jmp    1030 <selcall_init@plt>

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

LLVM IR (-O2):
%struct.demod_state = type { i32 }
define void @zvei2_init(%struct.demod_state* %0) {
%2 = tail call i32 @selcall_init(%struct.demod_state* %0)
ret void
}
/* Variables and functions */
scalar_t__ malloc(int);
void function_with_leak3(int y) {
  char *x = (char *)malloc(12);
  if (y)
    y++;
}


x86 assembly (clang, -O0):
<function_with_leak3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0xc,%edi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     113c <function_with_leak3+0x2c>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<function_with_leak3>:
mov    $0xc,%edi
jmp    1030 <malloc@plt>

LLVM IR (-O0):
define void @function_with_leak3(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
%4 = call i64 @malloc(i32 12)
%5 = inttoptr i64 %4 to i8*
store i8* %5, i8** %3
%6 = load i32, i32* %2
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %11
8: ; preds = %1
%9 = load i32, i32* %2
%10 = add nsw i32 %9, 1
store i32 %10, i32* %2
br label %11
11: ; preds = %8, %1
ret void
}

LLVM IR (-O2):
define void @function_with_leak3(i32 %0) {
%2 = tail call i64 @malloc(i32 12)
ret void
}
sock_close(fd_sock) char *fd_sock;
{
  int fd;
  int ret;
  fd = atoi(fd_sock);
  shutdown(fd, 2);
  close(fd);
  return 0;
}


x86 assembly (clang, -O0):
<sock_close>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1050 <atoi@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%edi
mov    $0x2,%esi
mov    $0x0,%al
call   1030 <shutdown@plt>
mov    -0xc(%rbp),%edi
mov    $0x0,%al
call   1040 <close@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sock_close>:
push   %rbx
xor    %eax,%eax
call   1050 <atoi@plt>
mov    %eax,%ebx
mov    %eax,%edi
mov    $0x2,%esi
xor    %eax,%eax
call   1030 <shutdown@plt>
mov    %ebx,%edi
xor    %eax,%eax
call   1040 <close@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @sock_close(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i32
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i32 (i8*, ...) bitcast (i32 (...)* @atoi to i32 (i8*, ...)*)(i8* %5)
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = call i32 (i32, i32, ...) bitcast (i32 (...)* @shutdown to i32 (i32, i32, ...)*)(i32 %7, i32 2)
%9 = load i32, i32* %3
%10 = call i32 (i32, ...) bitcast (i32 (...)* @close to i32 (i32, ...)*)(i32 %9)
ret i32 0
}

LLVM IR (-O2):
define i32 @sock_close(i8* %0) {
%2 = tail call i32 (i8*, ...) bitcast (i32 (...)* @atoi to i32 (i8*, ...)*)(i8* %0)
%3 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @shutdown to i32 (i32, i32, ...)*)(i32 %2, i32 2)
%4 = tail call i32 (i32, ...) bitcast (i32 (...)* @close to i32 (i32, ...)*)(i32 %2)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ *stderr;
FILE *__ghdl_get_stderr(void) { return stderr; }


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

x86 assembly (clang, -O2):
<__ghdl_get_stderr>:
mov    0x2ed9(%rip),%rax
mov    (%rax),%rax
ret

LLVM IR (-O0):
@stderr = global i32* null
define i32* @__ghdl_get_stderr() {
%1 = load i32*, i32** @stderr
ret i32* %1
}

LLVM IR (-O2):
@stderr = global i32* null
define i32* @__ghdl_get_stderr() {
%1 = load i32*, i32** @stderr
ret i32* %1
}
/* Variables and functions */
scalar_t__ stderr;
scalar_t__ stdin;
scalar_t__ stdout;
int isatty(int fd) {
  return (fd == ((int)stdin) || fd == ((int)stdout) || fd == ((int)stderr));
}


x86 assembly (clang, -O0):
<isatty>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
mov    0x2ed7(%rip),%rax
mov    (%rax),%rax
mov    %eax,%edx
mov    $0x1,%al
cmp    %edx,%ecx
mov    %al,-0x5(%rbp)
je     1154 <isatty+0x54>
mov    -0x4(%rbp),%ecx
mov    0x2ea3(%rip),%rax
mov    (%rax),%rax
mov    %eax,%edx
mov    $0x1,%al
cmp    %edx,%ecx
mov    %al,-0x5(%rbp)
je     1154 <isatty+0x54>
mov    -0x4(%rbp),%eax
mov    0x2e8f(%rip),%rcx
mov    (%rcx),%rcx
cmp    %ecx,%eax
sete   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isatty>:
mov    0x2ee1(%rip),%rax
cmp    %edi,(%rax)
sete   %al
mov    0x2ebd(%rip),%rcx
cmp    %edi,(%rcx)
sete   %cl
or     %al,%cl
mov    0x2eb7(%rip),%rax
cmp    %edi,(%rax)
sete   %al
or     %cl,%al
movzbl %al,%eax
ret

LLVM IR (-O0):
@stdin = global i64 0
@stdout = global i64 0
@stderr = global i64 0
define i32 @isatty(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i64, i64* @stdin
%5 = trunc i64 %4 to i32
%6 = icmp eq i32 %3, %5
br i1 %6, label %17, label %7
7: ; preds = %1
%8 = load i32, i32* %2
%9 = load i64, i64* @stdout
%10 = trunc i64 %9 to i32
%11 = icmp eq i32 %8, %10
br i1 %11, label %17, label %12
12: ; preds = %7
%13 = load i32, i32* %2
%14 = load i64, i64* @stderr
%15 = trunc i64 %14 to i32
%16 = icmp eq i32 %13, %15
br label %17
17: ; preds = %12, %7, %1
%18 = phi i1 [ true, %7 ], [ true, %1 ], [ %16, %12 ]
%19 = zext i1 %18 to i32
ret i32 %19
}

LLVM IR (-O2):
@stdin = global i64 0
@stdout = global i64 0
@stderr = global i64 0
define i32 @isatty(i32 %0) {
%2 = load i64, i64* @stdin
%3 = trunc i64 %2 to i32
%4 = icmp eq i32 %3, %0
%5 = load i64, i64* @stdout
%6 = trunc i64 %5 to i32
%7 = icmp eq i32 %6, %0
%8 = select i1 %4, i1 true, i1 %7
%9 = load i64, i64* @stderr
%10 = trunc i64 %9 to i32
%11 = icmp eq i32 %10, %0
%12 = select i1 %8, i1 true, i1 %11
%13 = zext i1 %12 to i32
ret i32 %13
}
char test_43_0(char *mem) { return __atomic_sub_fetch(mem + 4, 1, 4); }


x86 assembly (clang, -O0):
<test_43_0>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
movb   $0x1,-0x9(%rbp)
mov    -0x9(%rbp),%cl
mov    %cl,%al
neg    %al
lock xadd %al,0x4(%rdx)
sub    %cl,%al
mov    %al,-0xa(%rbp)
movsbl -0xa(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_43_0>:
mov    $0xff,%al
lock xadd %al,0x4(%rdi)
add    $0xff,%al
ret

LLVM IR (-O0):
define signext i8 @test_43_0(i8* %0) {
%2 = alloca i8*
%3 = alloca i8
%4 = alloca i8
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = getelementptr inbounds i8, i8* %5, i64 4
store i8 1, i8* %3
%7 = load i8, i8* %3
%8 = atomicrmw sub i8* %6, i8 %7 acq_rel
%9 = sub i8 %8, %7
store i8 %9, i8* %4
%10 = load i8, i8* %4
ret i8 %10
}

LLVM IR (-O2):
define signext i8 @test_43_0(i8* nocapture %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 4
%3 = atomicrmw sub i8* %2, i8 1 acq_rel
%4 = add i8 %3, -1
ret i8 %4
}
int _apply_set(void *item, void *info) {
  *(int *)item = *(int *)info;
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @_apply_set(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = bitcast i8* %5 to i32*
%7 = load i32, i32* %6
%8 = load i8*, i8** %3
%9 = bitcast i8* %8 to i32*
store i32 %7, i32* %9
ret i32 0
}

LLVM IR (-O2):
define i32 @_apply_set(i8* nocapture writeonly %0, i8* nocapture %1) {
%3 = bitcast i8* %1 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %0 to i32*
store i32 %4, i32* %5
ret i32 0
}
/* Variables and functions */
unsigned strlen(const char *str) {
  int cnt = 0;
  if (!str)
    return 0;
  for (; *str != '\0'; ++str) {
    ++cnt;
  }
  return cnt;
}


x86 assembly (clang, -O0):
<strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1126 <strlen+0x26>
movl   $0x0,-0x4(%rbp)
jmp    115b <strlen+0x5b>
jmp    112b <strlen+0x2b>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1155 <strlen+0x55>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    112b <strlen+0x2b>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlen>:
xor    %eax,%eax
test   %rdi,%rdi
je     111b <strlen+0x1b>
cmpb   $0x0,(%rdi)
je     111b <strlen+0x1b>
xor    %eax,%eax
xchg   %ax,%ax
cmpb   $0x0,0x1(%rdi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <strlen+0x10>
ret

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

LLVM IR (-O2):
define i32 @strlen(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %13, label %3
3: ; preds = %1
%4 = load i8, i8* %0
%5 = icmp eq i8 %4, 0
br i1 %5, label %13, label %6
6: ; preds = %3, %6
%7 = phi i32 [ %9, %6 ], [ 0, %3 ]
%8 = phi i8* [ %10, %6 ], [ %0, %3 ]
%9 = add nuw nsw i32 %7, 1
%10 = getelementptr inbounds i8, i8* %8, i64 1
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %6
13: ; preds = %6, %3, %1
%14 = phi i32 [ 0, %1 ], [ 0, %3 ], [ %9, %6 ]
ret i32 %14
}
void halt() { asm volatile("		hlt;\n"); }


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

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

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

LLVM IR (-O2):
define void @halt() {
tail call void asm sideeffect "\09\09hlt;\0A", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ASL8(int /*<<< orphan*/);
int /*<<< orphan*/ Direct(int);
void Op06M1(void) { ASL8(Direct(3)); }


x86 assembly (clang, -O0):
<Op06M1>:
push   %rbp
mov    %rsp,%rbp
mov    $0x3,%edi
call   1040 <Direct@plt>
mov    %eax,%edi
call   1030 <ASL8@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<Op06M1>:
push   %rax
mov    $0x3,%edi
call   1040 <Direct@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <ASL8@plt>

LLVM IR (-O0):
define void @Op06M1() {
%1 = call i32 @Direct(i32 3)
%2 = call i32 @ASL8(i32 %1)
ret void
}

LLVM IR (-O2):
define void @Op06M1() {
%1 = tail call i32 @Direct(i32 3)
%2 = tail call i32 @ASL8(i32 %1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int fclose(int /*<<< orphan*/ *);
__attribute__((__weak__, __always___)) int softboundcets_fclose(FILE *fp) {
  return fclose(fp);
}


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

x86 assembly (clang, -O2):
<softboundcets_fclose>:
jmp    1030 <fclose@plt>

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

LLVM IR (-O2):
define weak i32 @softboundcets_fclose(i32* %0) {
%2 = tail call i32 @fclose(i32* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, int, char *);
int /*<<< orphan*/ sscanf(char *, char *, int *, char *, char *);
void getMol2AtomHead(char *line, char *head) {
  char buff[8];
  char x[30];
  int i;
  char *pC;
  sscanf(line, "%d %s %s", &i, buff, x);
  sprintf(head, "%4d %-5s", i, buff);
}


x86 assembly (clang, -O0):
<getMol2AtomHead>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x18(%rbp),%rcx
lea    -0x40(%rbp),%r8
lea    0xebd(%rip),%rsi
lea    -0x44(%rbp),%rdx
call   1030 <sscanf@plt>
mov    -0x10(%rbp),%rdi
mov    -0x44(%rbp),%edx
lea    -0x18(%rbp),%rcx
lea    0xeab(%rip),%rsi
call   1040 <sprintf@plt>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getMol2AtomHead>:
push   %r14
push   %rbx
sub    $0x38,%rsp
mov    %rsi,%rbx
lea    0xecf(%rip),%rsi
lea    0x4(%rsp),%rdx
lea    0x8(%rsp),%r14
lea    0x10(%rsp),%r8
mov    %r14,%rcx
call   1030 <sscanf@plt>
mov    0x4(%rsp),%edx
lea    0xeb6(%rip),%rsi
mov    %rbx,%rdi
mov    %r14,%rcx
call   1040 <sprintf@plt>
add    $0x38,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [9 x i8] c"%d %s %s\00"
@.str.1 = [9 x i8] c"%4d %-5s\00"
define void @getMol2AtomHead(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca [8 x i8]
%6 = alloca [30 x i8]
%7 = alloca i32
%8 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%9 = load i8*, i8** %3
%10 = getelementptr inbounds [8 x i8], [8 x i8]* %5, i64 0, i64 0
%11 = getelementptr inbounds [30 x i8], [30 x i8]* %6, i64 0, i64 0
%12 = call i32 @sscanf(i8* %9, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32* %7, i8* %10, i8* %11)
%13 = load i8*, i8** %4
%14 = load i32, i32* %7
%15 = getelementptr inbounds [8 x i8], [8 x i8]* %5, i64 0, i64 0
%16 = call i32 @sprintf(i8* %13, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32 %14, i8* %15)
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"%d %s %s\00"
@.str.1 = [9 x i8] c"%4d %-5s\00"
define void @getMol2AtomHead(i8* nocapture %0, i8* nocapture writeonly %1) {
%3 = alloca [8 x i8]
%4 = alloca [30 x i8]
%5 = alloca i32
%6 = getelementptr inbounds [8 x i8], [8 x i8]* %3, i64 0, i64 0
%7 = getelementptr inbounds [30 x i8], [30 x i8]* %4, i64 0, i64 0
%8 = bitcast i32* %5 to i8*
%9 = call i32 @sscanf(i8* %0, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32* %5, i8* %6, i8* %7)
%10 = load i32, i32* %5
%11 = call i32 @sprintf(i8* dereferenceable(1) %1, i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32 %10, i8* %6)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ int64_t;

/* Variables and functions */
int /*<<< orphan*/ ntohll(int /*<<< orphan*/);
int64_t htonll(int64_t x) { return ntohll(x); }


x86 assembly (clang, -O0):
<htonll>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <ntohll@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<htonll>:
jmp    1030 <ntohll@plt>

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

LLVM IR (-O2):
define i32 @htonll(i32 %0) {
%2 = tail call i32 @ntohll(i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *, int *);
int main(void) {
  int a, b;
  scanf("%d %d", &a, &b);
  printf("%d\n", (a <= b ? b - a : 100 - a + b));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jg     115d <main+0x3d>
mov    -0xc(%rbp),%eax
sub    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    116b <main+0x4b>
mov    $0x64,%eax
sub    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%esi
lea    0xe91(%rip),%rdi
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    0x4(%rsp),%rsi
mov    %rsp,%rdx
call   1040 <scanf@plt>
mov    (%rsp),%esi
mov    0x4(%rsp),%eax
mov    %esi,%ecx
sub    %eax,%ecx
add    $0x64,%ecx
sub    %eax,%esi
cmovl  %ecx,%esi
lea    0xeb7(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [6 x i8] c"%d %d\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2)
%6 = load i32, i32* %1
%7 = load i32, i32* %2
%8 = icmp slt i32 %7, %6
%9 = select i1 %8, i32 100, i32 0
%10 = sub i32 %7, %6
%11 = add i32 %10, %9
%12 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %11)
ret i32 0
}
unsigned int cpuFlags() {
  int flags = 0;
  return (flags);
}


x86 assembly (clang, -O0):
<cpuFlags>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @cpuFlags() {
ret i32 0
}
void gtk_widget_freeze_child_notify() {}


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

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

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

LLVM IR (-O2):
define void @gtk_widget_freeze_child_notify() {
ret void
}
void __attribute__((noipa, no)) my_free(void *p) {}


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

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

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

LLVM IR (-O2):
define void @my_free(i8* nocapture %0) {
ret void
}
void joy_set_devicename(char *name) { return; }


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

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

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

LLVM IR (-O2):
define void @joy_set_devicename(i8* nocapture %0) {
ret void
}
/* Variables and functions */
scalar_t__ lround(double);
long lroundf(float x) { return (long)lround((double)x); }


x86 assembly (clang, -O0):
<lroundf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
call   1030 <lround@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lroundf>:
cvtss2sd %xmm0,%xmm0
jmp    1030 <lround@plt>

LLVM IR (-O0):
define i64 @lroundf(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fpext float %3 to double
%5 = call i64 @lround(double %4)
ret i64 %5
}

LLVM IR (-O2):
define i64 @lroundf(float %0) {
%2 = fpext float %0 to double
%3 = tail call i64 @lround(double %2)
ret i64 %3
}
/* Variables and functions */
size_t snprintf(char *, size_t, char *, char const *);
size_t strlcpy(char *d, char const *s, size_t n) {
  return snprintf(d, n, "%s", s);
}


x86 assembly (clang, -O0):
<strlcpy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x10(%rbp),%rcx
lea    0xec9(%rip),%rdx
call   1030 <snprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlcpy>:
mov    %rsi,%rcx
lea    0xee6(%rip),%rax
mov    %rdx,%rsi
mov    %rax,%rdx
jmp    1030 <snprintf@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
define i64 @strlcpy(i8* %0, i8* %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
store i8* %0, i8** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%7 = load i8*, i8** %4
%8 = load i64, i64* %6
%9 = load i8*, i8** %5
%10 = call i64 @snprintf(i8* %7, i64 %8, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %9)
ret i64 %10
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define i64 @strlcpy(i8* %0, i8* %1, i64 %2) {
%4 = tail call i64 @snprintf(i8* %0, i64 %2, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %1)
ret i64 %4
}
int icmp_unsigned(unsigned a, unsigned b) {
  if (a > b)
    return 1;
  else if (a < b)
    return -1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<icmp_unsigned>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jbe    1122 <icmp_unsigned+0x22>
movl   $0x1,-0x4(%rbp)
jmp    1141 <icmp_unsigned+0x41>
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jae    113a <icmp_unsigned+0x3a>
movl   $0xffffffff,-0x4(%rbp)
jmp    1141 <icmp_unsigned+0x41>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<icmp_unsigned>:
cmp    %esi,%edi
sbb    %ecx,%ecx
cmp    %esi,%edi
mov    $0x1,%eax
cmovbe %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @icmp_unsigned(i32 %0, i32 %1) {
%3 = icmp ugt i32 %0, %1
%4 = icmp ult i32 %0, %1
%5 = sext i1 %4 to i32
%6 = select i1 %3, i32 1, i32 %5
ret i32 %6
}
int op_logand(int a, int b) { return a && b; }


x86 assembly (clang, -O0):
<op_logand>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0x4(%rbp)
mov    %al,-0x9(%rbp)
je     1123 <op_logand+0x23>
cmpl   $0x0,-0x8(%rbp)
setne  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<op_logand>:
test   %edi,%edi
setne  %al
test   %esi,%esi
setne  %cl
and    %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @op_logand(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 = icmp ne i32 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %2
%8 = load i32, i32* %4
%9 = icmp ne i32 %8, 0
br label %10
10: ; preds = %7, %2
%11 = phi i1 [ false, %2 ], [ %9, %7 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @op_logand(i32 %0, i32 %1) {
%3 = icmp ne i32 %0, 0
%4 = icmp ne i32 %1, 0
%5 = and i1 %3, %4
%6 = zext i1 %5 to i32
ret i32 %6
}