xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
char *proc_search_keyword(char *, char *);
int main() {
  printf("%s\n", proc_search_keyword("/proc/cpuinfo", "processor"));
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xedc(%rip),%rdi
lea    0xee3(%rip),%rsi
call   1040 <proc_search_keyword@plt>
lea    0xec5(%rip),%rdi
mov    %rax,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [14 x i8] c"/proc/cpuinfo\00"
@.str.2 = [10 x i8] c"processor\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i8* @proc_search_keyword(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %2)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [14 x i8] c"/proc/cpuinfo\00"
@.str.2 = [10 x i8] c"processor\00"
define i32 @main() {
%1 = tail call i8* @proc_search_keyword(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0))
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int /*<<< orphan*/);
void *thread3(void *d) {
  int count3 = 1;
  while (count3 <= 3) {
    printf("Thread 3: %d\n", count3++);
  }
  return NULL;
}


x86 assembly (clang, -O0):
<thread3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
cmpl   $0x3,-0xc(%rbp)
jg     1149 <thread3+0x39>
mov    -0xc(%rbp),%esi
mov    %esi,%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
lea    0xec1(%rip),%rdi
call   1030 <printf@plt>
jmp    1123 <thread3+0x13>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<thread3>:
push   %rbx
lea    0xee8(%rip),%rbx
mov    %rbx,%rdi
mov    $0x1,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x2,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x3,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"Thread 3: %d\0A\00"
define i8* @thread3(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
store i32 1, i32* %3
br label %4
4: ; preds = %7, %1
%5 = load i32, i32* %3
%6 = icmp sle i32 %5, 3
br i1 %6, label %7, label %11
7: ; preds = %4
%8 = load i32, i32* %3
%9 = add nsw i32 %8, 1
store i32 %9, i32* %3
%10 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %8)
br label %4
11: ; preds = %4
ret i8* null
}

LLVM IR (-O2):
@.str = [14 x i8] c"Thread 3: %d\0A\00"
define noalias i8* @thread3(i8* nocapture readnone %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 1)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 2)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 3)
ret i8* null
}
void pinconf_show_setting(struct seq_file *s,
                          const struct pinctrl_setting *setting) {}


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

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

LLVM IR (-O0):
%struct.seq_file = type opaque
%struct.pinctrl_setting = type opaque
define void @pinconf_show_setting(%struct.seq_file* %0, %struct.pinctrl_setting* %1) {
%3 = alloca %struct.seq_file*
%4 = alloca %struct.pinctrl_setting*
store %struct.seq_file* %0, %struct.seq_file** %3
store %struct.pinctrl_setting* %1, %struct.pinctrl_setting** %4
ret void
}

LLVM IR (-O2):
%struct.seq_file = type opaque
%struct.pinctrl_setting = type opaque
define void @pinconf_show_setting(%struct.seq_file* nocapture %0, %struct.pinctrl_setting* nocapture %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ __set_errno(int /*<<< orphan*/);
int pause() {
  __set_errno(ENOSYS);
  return -1;
}


x86 assembly (clang, -O0):
<pause>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ecd(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pause>:
push   %rax
mov    0x2ed0(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@ENOSYS = global i32 0
define i32 @pause() {
%1 = load i32, i32* @ENOSYS
%2 = call i32 @__set_errno(i32 %1)
ret i32 -1
}

LLVM IR (-O2):
@ENOSYS = global i32 0
define i32 @pause() {
%1 = load i32, i32* @ENOSYS
%2 = tail call i32 @__set_errno(i32 %1)
ret i32 -1
}
/* Variables and functions */
int EINVAL;
__attribute__((visibility("default"))) int
sd_session_get_display(const char *session, char **display) {
  return -EINVAL;
}


x86 assembly (clang, -O0):
<sd_session_get_display>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %eax,%eax
mov    0x2ecb(%rip),%rcx
sub    (%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sd_session_get_display>:
mov    0x2ed9(%rip),%rcx
xor    %eax,%eax
sub    (%rcx),%eax
ret

LLVM IR (-O0):
@EINVAL = global i32 0
define i32 @sd_session_get_display(i8* %0, i8** %1) {
%3 = alloca i8*
%4 = alloca i8**
store i8* %0, i8** %3
store i8** %1, i8*** %4
%5 = load i32, i32* @EINVAL
%6 = sub nsw i32 0, %5
ret i32 %6
}

LLVM IR (-O2):
@EINVAL = global i32 0
define i32 @sd_session_get_display(i8* nocapture readnone %0, i8** nocapture readnone %1) {
%3 = load i32, i32* @EINVAL
%4 = sub nsw i32 0, %3
ret i32 %4
}
/* Variables and functions */
int memcmp(char const *, char const *, size_t);
size_t strclen(char const *, int);
int strccmp(const char *a, const char *b, int stop) {
  size_t n = strclen(a, stop);
  size_t m = strclen(b, stop);
  return memcmp(a, b, (n < m ? n : m) + 1);
}


x86 assembly (clang, -O0):
<strccmp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1030 <strclen@plt>
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1030 <strclen@plt>
mov    %rax,-0x28(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x28(%rbp),%rax
jae    117e <strccmp+0x5e>
mov    -0x20(%rbp),%rax
mov    %rax,-0x40(%rbp)
jmp    1186 <strccmp+0x66>
mov    -0x28(%rbp),%rax
mov    %rax,-0x40(%rbp)
mov    -0x30(%rbp),%rsi
mov    -0x38(%rbp),%rdi
mov    -0x40(%rbp),%rdx
add    $0x1,%rdx
call   1040 <memcmp@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strccmp>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %edx,%ebp
mov    %rsi,%r14
mov    %rdi,%r15
mov    %edx,%esi
call   1030 <strclen@plt>
mov    %rax,%rbx
mov    %r14,%rdi
mov    %ebp,%esi
call   1030 <strclen@plt>
cmp    %rax,%rbx
cmovae %rax,%rbx
add    $0x1,%rbx
mov    %r15,%rdi
mov    %r14,%rsi
mov    %rbx,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <memcmp@plt>

LLVM IR (-O0):
define i32 @strccmp(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i64
%8 = alloca i64
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%9 = load i8*, i8** %4
%10 = load i32, i32* %6
%11 = call i64 @strclen(i8* %9, i32 %10)
store i64 %11, i64* %7
%12 = load i8*, i8** %5
%13 = load i32, i32* %6
%14 = call i64 @strclen(i8* %12, i32 %13)
store i64 %14, i64* %8
%15 = load i8*, i8** %4
%16 = load i8*, i8** %5
%17 = load i64, i64* %7
%18 = load i64, i64* %8
%19 = icmp ult i64 %17, %18
br i1 %19, label %20, label %22
20: ; preds = %3
%21 = load i64, i64* %7
br label %24
22: ; preds = %3
%23 = load i64, i64* %8
br label %24
24: ; preds = %22, %20
%25 = phi i64 [ %21, %20 ], [ %23, %22 ]
%26 = add i64 %25, 1
%27 = call i32 @memcmp(i8* %15, i8* %16, i64 %26)
ret i32 %27
}

LLVM IR (-O2):
define i32 @strccmp(i8* %0, i8* %1, i32 %2) {
%4 = tail call i64 @strclen(i8* %0, i32 %2)
%5 = tail call i64 @strclen(i8* %1, i32 %2)
%6 = icmp ult i64 %4, %5
%7 = select i1 %6, i64 %4, i64 %5
%8 = add i64 %7, 1
%9 = tail call i32 @memcmp(i8* %0, i8* %1, i64 %8)
ret i32 %9
}
/* Variables and functions */
int make_dir_mode(char const *, int, int);
int make_dir(const char *path, int full) {
  return make_dir_mode(path, full, 0755);
}


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

x86 assembly (clang, -O2):
<make_dir>:
mov    $0x1ed,%edx
jmp    1030 <make_dir_mode@plt>

LLVM IR (-O0):
define i32 @make_dir(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = load i32, i32* %4
%7 = call i32 @make_dir_mode(i8* %5, i32 %6, i32 493)
ret i32 %7
}

LLVM IR (-O2):
define i32 @make_dir(i8* %0, i32 %1) {
%3 = tail call i32 @make_dir_mode(i8* %0, i32 %1, i32 493)
ret i32 %3
}
/* Type definitions */
struct ndz_range {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ assert(struct ndz_range *);
int /*<<< orphan*/ free(struct ndz_range *);
void ndz_range_free(struct ndz_range *range) {
  assert(range);
  free(range);
}


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

x86 assembly (clang, -O2):
<ndz_range_free>:
push   %rbx
mov    %rdi,%rbx
call   1040 <assert@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

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

LLVM IR (-O2):
%struct.ndz_range = type { i32 }
define void @ndz_range_free(%struct.ndz_range* %0) {
%2 = tail call i32 @assert(%struct.ndz_range* %0)
%3 = tail call i32 @free(%struct.ndz_range* %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
pid_t vfork() { return (0); }


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

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

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

LLVM IR (-O2):
define i32 @vfork() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, float);
int main() {
  float x = 1.1;
  while (x == 1.1) {
    printf("%f\n", x);
    x = x - 0.1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movss  0xed9(%rip),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xecb(%rip),%xmm1
ucomisd %xmm1,%xmm0
jne    1181 <main+0x71>
jp     1181 <main+0x71>
movss  -0x8(%rbp),%xmm0
lea    0xebf(%rip),%rdi
call   1030 <printf@plt>
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xea1(%rip),%xmm1
subsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x8(%rbp)
jmp    112c <main+0x1c>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [4 x i8] c"%f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
store i32 0, i32* %1
store float 0x3FF19999A0000000, float* %2
br label %3
3: ; preds = %7, %0
%4 = load float, float* %2
%5 = fpext float %4 to double
%6 = fcmp oeq double %5, 1.100000e+00
br i1 %6, label %7, label %14
7: ; preds = %3
%8 = load float, float* %2
%9 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), float %8)
%10 = load float, float* %2
%11 = fpext float %10 to double
%12 = fsub double %11, 1.000000e-01
%13 = fptrunc double %12 to float
store float %13, float* %2
br label %3
14: ; preds = %3
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
struct tm {
  int dummy;
};

/* Variables and functions */
struct tm *localtime(const time_t *timep) {
  return 0;
}


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

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

LLVM IR (-O0):
%struct.tm = type { i32 }
define %struct.tm* @localtime(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
ret %struct.tm* null
}

LLVM IR (-O2):
%struct.tm = type { i32 }
define noalias %struct.tm* @localtime(i32* nocapture readnone %0) {
ret %struct.tm* null
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void ICPrintString() { printf("0123456789\n"); }


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

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

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

LLVM IR (-O2):
@str = [11 x i8] c"0123456789\00"
define void @ICPrintString() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str, i64 0, i64 0))
ret void
}
void t1() {
  int a, b, c[10];
#pragma acc enter data copyin(a) if_present
#pragma acc exit data copyout(a) if_present
#pragma acc data copy(a) if_present
  {}
#pragma acc declare create(c) if_present
#pragma acc init if_present
#pragma acc shutdown if_present
}


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

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

LLVM IR (-O0):
define void @t1() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [10 x i32]
ret void
}

LLVM IR (-O2):
define void @t1() {
ret void
}
/* Variables and functions */
int *malloc(int);
int *prepVal(int val) {
  int *ptr = malloc(sizeof(int));
  *ptr = val;
  return ptr;
}


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

x86 assembly (clang, -O2):
<prepVal>:
push   %rbx
mov    %edi,%ebx
mov    $0x4,%edi
call   1030 <malloc@plt>
mov    %ebx,(%rax)
pop    %rbx
ret

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

LLVM IR (-O2):
define noalias i32* @prepVal(i32 %0) {
%2 = tail call i32* @malloc(i32 4)
store i32 %0, i32* %2
ret i32* %2
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int EOF;
int fgetc(int /*<<< orphan*/ *);
int /*<<< orphan*/ isspace(int);
int /*<<< orphan*/ ungetc(int, int /*<<< orphan*/ *);
void skipspace(FILE *fp) {
  int ch;
  while ((ch = fgetc(fp)) != EOF)
    if (!isspace(ch)) {
      ungetc(ch, fp);
      break;
    }
}


x86 assembly (clang, -O0):
<skipspace>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <fgetc@plt>
mov    %eax,-0xc(%rbp)
mov    0x2e99(%rip),%rcx
cmp    (%rcx),%eax
je     117e <skipspace+0x4e>
mov    -0xc(%rbp),%edi
call   1040 <isspace@plt>
cmp    $0x0,%eax
jne    1179 <skipspace+0x49>
mov    -0xc(%rbp),%edi
mov    -0x8(%rbp),%rsi
call   1050 <ungetc@plt>
jmp    117e <skipspace+0x4e>
jmp    113c <skipspace+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<skipspace>:
push   %rbp
push   %r14
push   %rbx
mov    %rdi,%rbx
mov    0x2eaa(%rip),%r14
xchg   %ax,%ax
mov    %rbx,%rdi
call   1030 <fgetc@plt>
cmp    (%r14),%eax
je     1168 <skipspace+0x38>
mov    %eax,%ebp
mov    %eax,%edi
call   1040 <isspace@plt>
test   %eax,%eax
jne    1140 <skipspace+0x10>
mov    %ebp,%edi
mov    %rbx,%rsi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1050 <ungetc@plt>
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@EOF = global i32 0
define void @skipspace(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
br label %4
4: ; preds = %17, %1
%5 = load i32*, i32** %2
%6 = call i32 @fgetc(i32* %5)
store i32 %6, i32* %3
%7 = load i32, i32* @EOF
%8 = icmp ne i32 %6, %7
br i1 %8, label %9, label %18
9: ; preds = %4
%10 = load i32, i32* %3
%11 = call i32 @isspace(i32 %10)
%12 = icmp ne i32 %11, 0
br i1 %12, label %17, label %13
13: ; preds = %9
%14 = load i32, i32* %3
%15 = load i32*, i32** %2
%16 = call i32 @ungetc(i32 %14, i32* %15)
br label %18
17: ; preds = %9
br label %4
18: ; preds = %13, %4
ret void
}

LLVM IR (-O2):
@EOF = global i32 0
define void @skipspace(i32* nocapture %0) {
br label %2
2: ; preds = %6, %1
%3 = tail call i32 @fgetc(i32* %0)
%4 = load i32, i32* @EOF
%5 = icmp eq i32 %3, %4
br i1 %5, label %11, label %6
6: ; preds = %2
%7 = tail call i32 @isspace(i32 %3)
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %2
9: ; preds = %6
%10 = tail call i32 @ungetc(i32 %3, i32* %0)
br label %11
11: ; preds = %2, %9
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  fprintf(stderr, "usage: lpq [-a] [-l] [-Pprinter] [user ...] [job ...]\n");
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [55 x i8] c"usage: lpq [-a] [-l] [-Pprinter] [user ...] [job ...]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [55 x i8] c"usage: lpq [-a] [-l] [-Pprinter] [user ...] [job ...]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
double clamp(double value, double min, double max) {
  if (value < min) {
    return min;
  }
  if (value > max) {
    return max;
  }
  return value;
}


x86 assembly (clang, -O0):
<clamp>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  %xmm2,-0x20(%rbp)
movsd  -0x10(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    1136 <clamp+0x36>
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    115f <clamp+0x5f>
movsd  -0x10(%rbp),%xmm0
ucomisd -0x20(%rbp),%xmm0
jbe    1155 <clamp+0x55>
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    115f <clamp+0x5f>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<clamp>:
minsd  %xmm0,%xmm2
cmpltsd %xmm1,%xmm0
movapd %xmm0,%xmm3
andnpd %xmm2,%xmm3
andpd  %xmm1,%xmm0
orpd   %xmm3,%xmm0
ret

LLVM IR (-O0):
define double @clamp(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca double
store double %0, double* %5
store double %1, double* %6
store double %2, double* %7
%8 = load double, double* %5
%9 = load double, double* %6
%10 = fcmp olt double %8, %9
br i1 %10, label %11, label %13
11: ; preds = %3
%12 = load double, double* %6
store double %12, double* %4
br label %21
13: ; preds = %3
%14 = load double, double* %5
%15 = load double, double* %7
%16 = fcmp ogt double %14, %15
br i1 %16, label %17, label %19
17: ; preds = %13
%18 = load double, double* %7
store double %18, double* %4
br label %21
19: ; preds = %13
%20 = load double, double* %5
store double %20, double* %4
br label %21
21: ; preds = %19, %17, %11
%22 = load double, double* %4
ret double %22
}

LLVM IR (-O2):
define double @clamp(double %0, double %1, double %2) {
%4 = fcmp olt double %0, %1
%5 = fcmp ogt double %0, %2
%6 = select i1 %5, double %2, double %0
%7 = select i1 %4, double %1, double %6
ret double %7
}
/* Variables and functions */
char *strcpy(char *, char const *);
char *C_strcpy(char *destination, const char *source) {
  return strcpy(destination, source);
}


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

x86 assembly (clang, -O2):
<C_strcpy>:
jmp    1030 <strcpy@plt>

LLVM IR (-O0):
define i8* @C_strcpy(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = call i8* @strcpy(i8* %5, i8* %6)
ret i8* %7
}

LLVM IR (-O2):
define i8* @C_strcpy(i8* returned %0, i8* nocapture %1) {
%3 = tail call i8* @strcpy(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ SIG_IGN;
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ reset_xterm_color(int);
int /*<<< orphan*/ signal(int, int /*<<< orphan*/);
void Ctrlcproof(int sign) {
  signal(sign, SIG_IGN);
  reset_xterm_color(1);
  exit(-1);
}


x86 assembly (clang, -O0):
<Ctrlcproof>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2ea3(%rip),%rax
mov    (%rax),%esi
call   1030 <signal@plt>
mov    $0x1,%edi
call   1040 <reset_xterm_color@plt>
mov    $0xffffffff,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<Ctrlcproof>:
push   %rax
mov    0x2eb0(%rip),%rax
mov    (%rax),%esi
call   1030 <signal@plt>
mov    $0x1,%edi
call   1040 <reset_xterm_color@plt>
mov    $0xffffffff,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@SIG_IGN = global i32 0
define void @Ctrlcproof(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* @SIG_IGN
%5 = call i32 @signal(i32 %3, i32 %4)
%6 = call i32 @reset_xterm_color(i32 1)
%7 = call i32 @exit(i32 -1)
unreachable
}

LLVM IR (-O2):
@SIG_IGN = global i32 0
define void @Ctrlcproof(i32 %0) {
%2 = load i32, i32* @SIG_IGN
%3 = tail call i32 @signal(i32 %0, i32 %2)
%4 = tail call i32 @reset_xterm_color(i32 1)
%5 = tail call i32 @exit(i32 -1)
unreachable
}
void rop3_184_0_0(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  unsigned char stk3;
  stk3 = *D ^ T;
  stk2 = S & stk3;
  stk1 = T ^ stk2;
  *D = stk1;
}


x86 assembly (clang, -O0):
<rop3_184_0_0>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
movzbl -0xa(%rbp),%ecx
xor    %ecx,%eax
mov    %al,-0xd(%rbp)
movzbl -0x9(%rbp),%eax
movzbl -0xd(%rbp),%ecx
and    %ecx,%eax
mov    %al,-0xc(%rbp)
movzbl -0xa(%rbp),%eax
movzbl -0xc(%rbp),%ecx
xor    %ecx,%eax
mov    %al,-0xb(%rbp)
mov    -0xb(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rop3_184_0_0>:
mov    (%rdi),%al
xor    %dl,%al
and    %sil,%al
xor    %dl,%al
mov    %al,(%rdi)
ret

LLVM IR (-O0):
define void @rop3_184_0_0(i8* %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
%9 = alloca i8
store i8* %0, i8** %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%10 = load i8*, i8** %4
%11 = load i8, i8* %10
%12 = zext i8 %11 to i32
%13 = load i8, i8* %6
%14 = zext i8 %13 to i32
%15 = xor i32 %12, %14
%16 = trunc i32 %15 to i8
store i8 %16, i8* %9
%17 = load i8, i8* %5
%18 = zext i8 %17 to i32
%19 = load i8, i8* %9
%20 = zext i8 %19 to i32
%21 = and i32 %18, %20
%22 = trunc i32 %21 to i8
store i8 %22, i8* %8
%23 = load i8, i8* %6
%24 = zext i8 %23 to i32
%25 = load i8, i8* %8
%26 = zext i8 %25 to i32
%27 = xor i32 %24, %26
%28 = trunc i32 %27 to i8
store i8 %28, i8* %7
%29 = load i8, i8* %7
%30 = load i8*, i8** %4
store i8 %29, i8* %30
ret void
}

LLVM IR (-O2):
define void @rop3_184_0_0(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = load i8, i8* %0
%5 = xor i8 %4, %2
%6 = and i8 %5, %1
%7 = xor i8 %6, %2
store i8 %7, i8* %0
ret void
}
/* Variables and functions */
int SIGXCPU;
int /*<<< orphan*/ mps_lib_assert_fail(char *, int, char *);
void resumeSignalHandler(int sig) {
  do {
    if (sig == SIGXCPU)
      do {
      } while (0);
    else
      mps_lib_assert_fail("/scratch/repos/new/home/jordi_armengol_estape/"
                          "c-scraper/outputs/2022-01-22/02-19-57/repos/penberg/"
                          "hornet/refs/heads/master/mps/pthrdext.c",
                          114, ("sig == PTHREADEXT_SIGRESUME"));
  } while (0);
  ((void)sig);
  return;
}


x86 assembly (clang, -O0):
<resumeSignalHandler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    0x2ebb(%rip),%rcx
cmp    (%rcx),%eax
jne    113c <resumeSignalHandler+0x2c>
jmp    1132 <resumeSignalHandler+0x22>
jmp    1137 <resumeSignalHandler+0x27>
jmp    1154 <resumeSignalHandler+0x44>
lea    0xebd(%rip),%rdi
mov    $0x72,%esi
lea    0xf3b(%rip),%rdx
call   1030 <mps_lib_assert_fail@plt>
jmp    1159 <resumeSignalHandler+0x49>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<resumeSignalHandler>:
mov    0x2ec9(%rip),%rax
cmp    %edi,(%rax)
jne    111c <resumeSignalHandler+0xc>
ret
lea    0xedd(%rip),%rdi
lea    0xf60(%rip),%rdx
mov    $0x72,%esi
jmp    1030 <mps_lib_assert_fail@plt>

LLVM IR (-O0):
@SIGXCPU = global i32 0
@.str = [138 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/penberg/hornet/refs/heads/master/mps/pthrdext.c\00"
@.str.1 = [28 x i8] c"sig == PTHREADEXT_SIGRESUME\00"
define void @resumeSignalHandler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
br label %3
3: ; preds = %1
%4 = load i32, i32* %2
%5 = load i32, i32* @SIGXCPU
%6 = icmp eq i32 %4, %5
br i1 %6, label %7, label %10
7: ; preds = %3
br label %8
8: ; preds = %7
br label %9
9: ; preds = %8
br label %12
10: ; preds = %3
%11 = call i32 @mps_lib_assert_fail(i8* getelementptr inbounds ([138 x i8], [138 x i8]* @.str, i64 0, i64 0), i32 114, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0))
br label %12
12: ; preds = %10, %9
br label %13
13: ; preds = %12
%14 = load i32, i32* %2
ret void
}

LLVM IR (-O2):
@SIGXCPU = global i32 0
@.str = [138 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/penberg/hornet/refs/heads/master/mps/pthrdext.c\00"
@.str.1 = [28 x i8] c"sig == PTHREADEXT_SIGRESUME\00"
define void @resumeSignalHandler(i32 %0) {
%2 = load i32, i32* @SIGXCPU
%3 = icmp eq i32 %2, %0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @mps_lib_assert_fail(i8* getelementptr inbounds ([138 x i8], [138 x i8]* @.str, i64 0, i64 0), i32 114, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0))
br label %6
6: ; preds = %4, %1
ret void
}
int test_imm_4Bint8_reg(signed char val) {
  return ((val) & (0x4B << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_4Bint8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edx
and    $0x4b,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_4Bint8_reg>:
test   $0x4b,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_4Bint8_reg(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = and i32 %4, 75
%6 = icmp ne i32 %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_4Bint8_reg(i8 signext %0) {
%2 = and i8 %0, 75
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
void undenormalise(float *sample) {
  if (((*(unsigned int *)sample) & 0x7f800000) == 0)
    *sample = 0.0f;
}


x86 assembly (clang, -O0):
<undenormalise>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
and    $0x7f800000,%eax
cmp    $0x0,%eax
jne    1127 <undenormalise+0x27>
mov    -0x8(%rbp),%rax
xorps  %xmm0,%xmm0
movss  %xmm0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<undenormalise>:
movzwl 0x2(%rdi),%eax
test   $0x7f80,%eax
je     110c <undenormalise+0xc>
ret
movl   $0x0,(%rdi)
ret

LLVM IR (-O0):
define void @undenormalise(float* %0) {
%2 = alloca float*
store float* %0, float** %2
%3 = load float*, float** %2
%4 = bitcast float* %3 to i32*
%5 = load i32, i32* %4
%6 = and i32 %5, 2139095040
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = load float*, float** %2
store float 0.000000e+00, float* %9
br label %10
10: ; preds = %8, %1
ret void
}

LLVM IR (-O2):
define void @undenormalise(float* nocapture %0) {
%2 = bitcast float* %0 to i32*
%3 = load i32, i32* %2
%4 = and i32 %3, 2139095040
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %1
store float 0.000000e+00, float* %0
br label %7
7: ; preds = %6, %1
ret void
}
void gtk_file_chooser_widget_get_type() {}


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

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

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

LLVM IR (-O2):
define void @gtk_file_chooser_widget_get_type() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
char *malloc(int);
void bad_things(int offset) {
  char *m = malloc(sizeof(char) * offset);
  m[offset] = 0;
  free(m);
}


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

x86 assembly (clang, -O2):
<bad_things>:
push   %rbx
movslq %edi,%rbx
mov    %ebx,%edi
call   1040 <malloc@plt>
movb   $0x0,(%rax,%rbx,1)
mov    %rax,%rdi
pop    %rbx
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @bad_things(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = sext i32 %4 to i64
%6 = mul i64 1, %5
%7 = trunc i64 %6 to i32
%8 = call i8* @malloc(i32 %7)
store i8* %8, i8** %3
%9 = load i8*, i8** %3
%10 = load i32, i32* %2
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds i8, i8* %9, i64 %11
store i8 0, i8* %12
%13 = load i8*, i8** %3
%14 = call i32 @free(i8* %13)
ret void
}

LLVM IR (-O2):
define void @bad_things(i32 %0) {
%2 = sext i32 %0 to i64
%3 = tail call i8* @malloc(i32 %0)
%4 = getelementptr inbounds i8, i8* %3, i64 %2
store i8 0, i8* %4
%5 = tail call i32 @free(i8* %3)
ret void
}
void espconn_init() {}


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

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

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

LLVM IR (-O2):
define void @espconn_init() {
ret void
}
/* Variables and functions */
char *str_trim(char *, int);
char *str_trim_space_quote(char *str) { return str_trim(str, 1); }


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

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

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

LLVM IR (-O2):
define i8* @str_trim_space_quote(i8* %0) {
%2 = tail call i8* @str_trim(i8* %0, i32 1)
ret i8* %2
}
char test_char_1(char a) { return 'd'; }


x86 assembly (clang, -O0):
<test_char_1>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    $0x64,%al
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_char_1>:
mov    $0x64,%al
ret

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

LLVM IR (-O2):
define signext i8 @test_char_1(i8 signext %0) {
ret i8 100
}
/* Type definitions */
typedef int /*<<< orphan*/ COLOR_DIFF_FORMAT_STRINGS;

/* Variables and functions */
int /*<<< orphan*/ print_enum(char *, char const **, int);
void print_color_diff_format() {
  static const char *COLOR_DIFF_FORMAT_STRINGS[] = {
      "4:4:4",
      "4:2:2",
      "4:2:0",
  };
  print_enum("color_diff_format_index", COLOR_DIFF_FORMAT_STRINGS,
             (sizeof(COLOR_DIFF_FORMAT_STRINGS) /
              sizeof((COLOR_DIFF_FORMAT_STRINGS)[0])));
}


x86 assembly (clang, -O0):
<print_color_diff_format>:
push   %rbp
mov    %rsp,%rbp
lea    0xef7(%rip),%rdi
lea    0x2f0e(%rip),%rsi
mov    $0x3,%edx
call   1030 <print_enum@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_color_diff_format>:
lea    0xefb(%rip),%rdi
lea    0x2f12(%rip),%rsi
mov    $0x3,%edx
jmp    1030 <print_enum@plt>

LLVM IR (-O0):
@print_color_diff_format.COLOR_DIFF_FORMAT_STRINGS = internal global [3 x i8*] [i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i32 0, i32 0)]
@.str = [6 x i8] c"4:4:4\00"
@.str.1 = [6 x i8] c"4:2:2\00"
@.str.2 = [6 x i8] c"4:2:0\00"
@.str.3 = [24 x i8] c"color_diff_format_index\00"
define void @print_color_diff_format() {
%1 = call i32 @print_enum(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.3, i64 0, i64 0), i8** getelementptr inbounds ([3 x i8*], [3 x i8*]* @print_color_diff_format.COLOR_DIFF_FORMAT_STRINGS, i64 0, i64 0), i32 3)
ret void
}

LLVM IR (-O2):
@print_color_diff_format.COLOR_DIFF_FORMAT_STRINGS = internal global [3 x i8*] [i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i32 0, i32 0)]
@.str = [6 x i8] c"4:4:4\00"
@.str.1 = [6 x i8] c"4:2:2\00"
@.str.2 = [6 x i8] c"4:2:0\00"
@.str.3 = [24 x i8] c"color_diff_format_index\00"
define void @print_color_diff_format() {
%1 = tail call i32 @print_enum(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.3, i64 0, i64 0), i8** getelementptr inbounds ([3 x i8*], [3 x i8*]* @print_color_diff_format.COLOR_DIFF_FORMAT_STRINGS, i64 0, i64 0), i32 3)
ret void
}
/* Variables and functions */
int wl_bssiovar_get(char *, char *, int, int *, int);
int wl_bssiovar_getint(char *ifname, char *iovar, int bssidx, int *val) {
  return wl_bssiovar_get(ifname, iovar, bssidx, val, sizeof(int));
}


x86 assembly (clang, -O0):
<wl_bssiovar_getint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    -0x20(%rbp),%rcx
mov    $0x4,%r8d
call   1030 <wl_bssiovar_get@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wl_bssiovar_getint>:
mov    $0x4,%r8d
jmp    1030 <wl_bssiovar_get@plt>

LLVM IR (-O0):
define i32 @wl_bssiovar_getint(i8* %0, i8* %1, i32 %2, i32* %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i32*
store i8* %0, i8** %5
store i8* %1, i8** %6
store i32 %2, i32* %7
store i32* %3, i32** %8
%9 = load i8*, i8** %5
%10 = load i8*, i8** %6
%11 = load i32, i32* %7
%12 = load i32*, i32** %8
%13 = call i32 @wl_bssiovar_get(i8* %9, i8* %10, i32 %11, i32* %12, i32 4)
ret i32 %13
}

LLVM IR (-O2):
define i32 @wl_bssiovar_getint(i8* %0, i8* %1, i32 %2, i32* %3) {
%5 = tail call i32 @wl_bssiovar_get(i8* %0, i8* %1, i32 %2, i32* %3, i32 4)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ BNCIO(int);
long int BNCFieldRight() {
  long int stat = 99;
  BNCIO(41);
  return (stat);
}


x86 assembly (clang, -O0):
<BNCFieldRight>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movq   $0x63,-0x8(%rbp)
mov    $0x29,%edi
call   1030 <BNCIO@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<BNCFieldRight>:
push   %rax
mov    $0x29,%edi
call   1030 <BNCIO@plt>
mov    $0x63,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i64 @BNCFieldRight() {
%1 = alloca i64
store i64 99, i64* %1
%2 = call i32 @BNCIO(i32 41)
%3 = load i64, i64* %1
ret i64 %3
}

LLVM IR (-O2):
define i64 @BNCFieldRight() {
%1 = tail call i32 @BNCIO(i32 41)
ret i64 99
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int, int);
int /*<<< orphan*/ task_begin();
int /*<<< orphan*/ task_end();
int main() {
  int x, y, z;
  x = 1;
  z = 3;
  task_begin();
  if (z > 1)
    x = 2;
  y = 2;
  task_end();
  z = 2;
  printf("x=%d, y=%d, z=%d\n", x, y, z);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
movl   $0x3,-0x10(%rbp)
mov    $0x0,%al
call   1050 <task_begin@plt>
cmpl   $0x1,-0x10(%rbp)
jle    1165 <main+0x35>
movl   $0x2,-0x8(%rbp)
movl   $0x2,-0xc(%rbp)
mov    $0x0,%al
call   1040 <task_end@plt>
movl   $0x2,-0x10(%rbp)
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
lea    0xe76(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1050 <task_begin@plt>
xor    %eax,%eax
call   1040 <task_end@plt>
lea    0xeba(%rip),%rdi
mov    $0x2,%esi
mov    $0x2,%edx
mov    $0x2,%ecx
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [18 x i8] c"x=%d, y=%d, z=%d\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @task_begin()
%2 = tail call i32 (...) @task_end()
%3 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 2, i32 2, i32 2)
ret i32 0
}
/* Variables and functions */
int rand();
int /*<<< orphan*/ srand(int /*<<< orphan*/);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
int GetRand(int min, int max) {
  static int Init = 0;
  int rc;
  if (Init == 0) {
    srand(time(NULL));
    Init = 1;
  }
  rc = (rand() % (max - min + 1) + min);
  return (rc);
}


x86 assembly (clang, -O0):
<GetRand>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,0x2ef7(%rip)
jne    1165 <GetRand+0x35>
xor    %eax,%eax
mov    %eax,%edi
call   1040 <time@plt>
mov    %eax,%edi
call   1030 <srand@plt>
movl   $0x1,0x2ed7(%rip)
mov    $0x0,%al
call   1050 <rand@plt>
mov    -0x8(%rbp),%ecx
sub    -0x4(%rbp),%ecx
add    $0x1,%ecx
cltd
idiv   %ecx
add    -0x4(%rbp),%edx
mov    %edx,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GetRand>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %edi,%ebx
cmpb   $0x0,0x2efe(%rip)
jne    1155 <GetRand+0x25>
xor    %edi,%edi
call   1040 <time@plt>
mov    %eax,%edi
call   1030 <srand@plt>
movb   $0x1,0x2ee7(%rip)
xor    %eax,%eax
call   1050 <rand@plt>
sub    %ebx,%ebp
add    $0x1,%ebp
cltd
idiv   %ebp
add    %edx,%ebx
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@GetRand.Init = internal global i32 0
define i32 @GetRand(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* @GetRand.Init
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %11
8: ; preds = %2
%9 = call i32 @time(i32* null)
%10 = call i32 @srand(i32 %9)
store i32 1, i32* @GetRand.Init
br label %11
11: ; preds = %8, %2
%12 = call i32 (...) @rand()
%13 = load i32, i32* %4
%14 = load i32, i32* %3
%15 = sub nsw i32 %13, %14
%16 = add nsw i32 %15, 1
%17 = srem i32 %12, %16
%18 = load i32, i32* %3
%19 = add nsw i32 %17, %18
store i32 %19, i32* %5
%20 = load i32, i32* %5
ret i32 %20
}

LLVM IR (-O2):
@GetRand.Init = internal unnamed_addr global i1 false
define i32 @GetRand(i32 %0, i32 %1) {
%3 = load i1, i1* @GetRand.Init
br i1 %3, label %7, label %4
4: ; preds = %2
%5 = tail call i32 @time(i32* null)
%6 = tail call i32 @srand(i32 %5)
store i1 true, i1* @GetRand.Init
br label %7
7: ; preds = %4, %2
%8 = tail call i32 (...) @rand()
%9 = sub i32 1, %0
%10 = add i32 %9, %1
%11 = srem i32 %8, %10
%12 = add nsw i32 %11, %0
ret i32 %12
}
void b_speaker_tone(unsigned long nbr) {
  asm volatile("call 0x00100050" : : "a"(nbr));
}


x86 assembly (clang, -O0):
<b_speaker_tone>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
call   100050 <completed.0+0xfc030>
pop    %rbp
ret

x86 assembly (clang, -O2):
<b_speaker_tone>:
mov    %rdi,%rax
call   100050 <completed.0+0xfc030>
ret

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

LLVM IR (-O2):
define void @b_speaker_tone(i64 %0) {
tail call void asm sideeffect "call 0x00100050", "{ax},~{dirflag},~{fpsr},~{flags}"(i64 %0)
ret void
}
int funlockfile() { return -1; }


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

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

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

LLVM IR (-O2):
define i32 @funlockfile() {
ret i32 -1
}
int sub_4011F1(int arg_0, int arg_4) {
  int edi = arg_0;
  int esi = arg_4;
  char ebx;
  char ecx;
}


x86 assembly (clang, -O0):
<sub_4011F1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @sub_4011F1(i32 %0, i32 %1) {
ret i32 undef
}
/* Type definitions */
typedef int /*<<< orphan*/ __off_t;

/* Variables and functions */
int ENOSYS;
int posix_fallocate(int fd, __off_t offset, __off_t len) { return ENOSYS; }


x86 assembly (clang, -O0):
<posix_fallocate>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    0x2ed4(%rip),%rax
mov    (%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<posix_fallocate>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%eax
ret

LLVM IR (-O0):
@ENOSYS = global i32 0
define i32 @posix_fallocate(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* @ENOSYS
ret i32 %7
}

LLVM IR (-O2):
@ENOSYS = global i32 0
define i32 @posix_fallocate(i32 %0, i32 %1, i32 %2) {
%4 = load i32, i32* @ENOSYS
ret i32 %4
}
/* Variables and functions */
int dn_expand(char *, char *, char *, char *, int /*<<< orphan*/);
int main() {
  int rc;
  char *msg;
  rc = dn_expand(msg, msg, msg, msg, 0);
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @dn_expand(i8* undef, i8* undef, i8* undef, i8* undef, i32 0)
ret i32 0
}
_Bool f1(_Bool a, _Bool b) {
  if (a) {
    if (b)
      return 1;
    else
      return 0;
  }
  return 0;
}


x86 assembly (clang, -O0):
<f1>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
and    $0x1,%cl
mov    %cl,-0x2(%rbp)
and    $0x1,%al
mov    %al,-0x3(%rbp)
testb  $0x1,-0x2(%rbp)
je     113b <f1+0x3b>
testb  $0x1,-0x3(%rbp)
je     1132 <f1+0x32>
movb   $0x1,-0x1(%rbp)
jmp    113f <f1+0x3f>
movb   $0x0,-0x1(%rbp)
jmp    113f <f1+0x3f>
movb   $0x0,-0x1(%rbp)
mov    -0x1(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define zeroext i1 @f1(i1 zeroext %0, i1 zeroext %1) {
%3 = alloca i1
%4 = alloca i8
%5 = alloca i8
%6 = zext i1 %0 to i8
store i8 %6, i8* %4
%7 = zext i1 %1 to i8
store i8 %7, i8* %5
%8 = load i8, i8* %4
%9 = trunc i8 %8 to i1
br i1 %9, label %10, label %15
10: ; preds = %2
%11 = load i8, i8* %5
%12 = trunc i8 %11 to i1
br i1 %12, label %13, label %14
13: ; preds = %10
store i1 true, i1* %3
br label %16
14: ; preds = %10
store i1 false, i1* %3
br label %16
15: ; preds = %2
store i1 false, i1* %3
br label %16
16: ; preds = %15, %14, %13
%17 = load i1, i1* %3
ret i1 %17
}

LLVM IR (-O2):
define zeroext i1 @f1(i1 zeroext %0, i1 zeroext %1) {
%3 = and i1 %0, %1
ret i1 %3
}
/* Variables and functions */
int /*<<< orphan*/ function_x();
int main() { function_x(); }


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @function_x()
ret i32 0
}