xunge/DecIR huggingface dataset:
int op_ldee(void) { return (4); }


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

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

LLVM IR (-O0):
define i32 @op_ldee() {
ret i32 4
}

LLVM IR (-O2):
define i32 @op_ldee() {
ret i32 4
}
void ScaleRowDown4Box_Any_AVX2() {}


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

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

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

LLVM IR (-O2):
define void @ScaleRowDown4Box_Any_AVX2() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_mutexattr_t;
typedef int /*<<< orphan*/ pthread_mutex_t;

/* Variables and functions */
int pthread_mutex_init(pthread_mutex_t *mutex,
                       const pthread_mutexattr_t *attr) {
  return 1;
}


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

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

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

LLVM IR (-O2):
define i32 @pthread_mutex_init(i32* nocapture readnone %0, i32* nocapture readnone %1) {
ret i32 1
}
void gtk_widget_grab_default() {}


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

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

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

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

/* Variables and functions */
struct cpufreq_affected_cpus *sysfs_get_cpu_list(unsigned int, char *);
struct cpufreq_affected_cpus *sysfs_get_freq_affected_cpus(unsigned int cpu) {
  return sysfs_get_cpu_list(cpu, "affected_cpus");
}


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

x86 assembly (clang, -O2):
<sysfs_get_freq_affected_cpus>:
lea    0xee9(%rip),%rsi
jmp    1030 <sysfs_get_cpu_list@plt>

LLVM IR (-O0):
%struct.cpufreq_affected_cpus = type { i32 }
@.str = [14 x i8] c"affected_cpus\00"
define %struct.cpufreq_affected_cpus* @sysfs_get_freq_affected_cpus(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call %struct.cpufreq_affected_cpus* @sysfs_get_cpu_list(i32 %3, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret %struct.cpufreq_affected_cpus* %4
}

LLVM IR (-O2):
%struct.cpufreq_affected_cpus = type { i32 }
@.str = [14 x i8] c"affected_cpus\00"
define %struct.cpufreq_affected_cpus* @sysfs_get_freq_affected_cpus(i32 %0) {
%2 = tail call %struct.cpufreq_affected_cpus* @sysfs_get_cpu_list(i32 %0, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret %struct.cpufreq_affected_cpus* %2
}
void thread_empty_cleanup(void *arg) {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ fgets(char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ stdin;
int main() {
  char a[8];
  fgets(a, sizeof(a), stdin);
  if (!a[sizeof(a) - 1]) {
    printf("Greater than %lu. Thus, null terminated\n", sizeof(a));
  }
  puts(a);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0xc(%rbp),%rdi
mov    0x2e9e(%rip),%rax
mov    (%rax),%edx
mov    $0x8,%esi
call   1050 <fgets@plt>
cmpb   $0x0,-0x5(%rbp)
jne    1171 <main+0x41>
lea    0xe99(%rip),%rdi
mov    $0x8,%esi
call   1040 <printf@plt>
lea    -0xc(%rbp),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2eb0(%rip),%rax
mov    (%rax),%edx
mov    %rsp,%rdi
mov    $0x8,%esi
call   1050 <fgets@plt>
cmpb   $0x0,0x7(%rsp)
jne    115f <main+0x2f>
lea    0xeab(%rip),%rdi
mov    $0x8,%esi
call   1040 <printf@plt>
mov    %rsp,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stdin = global i32 0
@.str = [41 x i8] c"Greater than %lu. Thus, null terminated\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [8 x i8]
store i32 0, i32* %1
%3 = getelementptr inbounds [8 x i8], [8 x i8]* %2, i64 0, i64 0
%4 = load i32, i32* @stdin
%5 = call i32 @fgets(i8* %3, i32 8, i32 %4)
%6 = getelementptr inbounds [8 x i8], [8 x i8]* %2, i64 0, i64 7
%7 = load i8, i8* %6
%8 = icmp ne i8 %7, 0
br i1 %8, label %11, label %9
9: ; preds = %0
%10 = call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0), i32 8)
br label %11
11: ; preds = %9, %0
%12 = getelementptr inbounds [8 x i8], [8 x i8]* %2, i64 0, i64 0
%13 = call i32 @puts(i8* %12)
ret i32 0
}

LLVM IR (-O2):
@stdin = global i32 0
@.str = [41 x i8] c"Greater than %lu. Thus, null terminated\0A\00"
define i32 @main() {
%1 = alloca [8 x i8]
%2 = getelementptr inbounds [8 x i8], [8 x i8]* %1, i64 0, i64 0
%3 = load i32, i32* @stdin
%4 = call i32 @fgets(i8* %2, i32 8, i32 %3)
%5 = getelementptr inbounds [8 x i8], [8 x i8]* %1, i64 0, i64 7
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %0
%9 = call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0), i32 8)
br label %10
10: ; preds = %8, %0
%11 = call i32 @puts(i8* %2)
ret i32 0
}
void INT_Excep_TPU1_TGI1A(void) {}


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

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

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

LLVM IR (-O2):
define void @INT_Excep_TPU1_TGI1A() {
ret void
}
/* Variables and functions */
scalar_t__ malloc(size_t);
int /*<<< orphan*/ memset(void *, int, size_t);
int main() {
  int chunk_size = 1024 * 1024;
  void *p = NULL;
  while (1) {
    if ((p = (int *)malloc((size_t)chunk_size)) == NULL) {
      break;
    }
    memset(p, 1, (size_t)chunk_size);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x100000,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
movslq -0x8(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
jne    115a <main+0x3a>
jmp    1171 <main+0x51>
mov    -0x10(%rbp),%rdi
movslq -0x8(%rbp),%rdx
mov    $0x1,%esi
call   1030 <memset@plt>
jmp    113e <main+0x1e>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    $0x100000,%edi
call   1040 <malloc@plt>
test   %rax,%rax
je     1153 <main+0x33>
mov    $0x100000,%edx
mov    %rax,%rdi
mov    $0x1,%esi
call   1030 <memset@plt>
jmp    1130 <main+0x10>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i8*
store i32 0, i32* %1
store i32 1048576, i32* %2
store i8* null, i8** %3
br label %4
4: ; preds = %0, %12
%5 = load i32, i32* %2
%6 = sext i32 %5 to i64
%7 = call i64 @malloc(i64 %6)
%8 = inttoptr i64 %7 to i32*
%9 = bitcast i32* %8 to i8*
store i8* %9, i8** %3
%10 = icmp eq i8* %9, null
br i1 %10, label %11, label %12
11: ; preds = %4
br label %17
12: ; preds = %4
%13 = load i8*, i8** %3
%14 = load i32, i32* %2
%15 = sext i32 %14 to i64
%16 = call i32 @memset(i8* %13, i32 1, i64 %15)
br label %4
17: ; preds = %11
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i64 @malloc(i64 1048576)
%2 = icmp eq i64 %1, 0
br i1 %2, label %9, label %3
3: ; preds = %0, %3
%4 = phi i64 [ %7, %3 ], [ %1, %0 ]
%5 = inttoptr i64 %4 to i8*
%6 = tail call i32 @memset(i8* %5, i32 1, i64 1048576)
%7 = tail call i64 @malloc(i64 1048576)
%8 = icmp eq i64 %7, 0
br i1 %8, label %9, label %3
9: ; preds = %3, %0
ret i32 0
}
extern void libvampsdk_v_2_2_1_present(void) {}


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

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

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

LLVM IR (-O2):
define void @libvampsdk_v_2_2_1_present() {
ret void
}
int isxdigit(int ch) {
  return (((ch >= '0') && (ch <= '9')) || ((ch >= 'A') && (ch <= 'Z')) ||
          ((ch >= 'a') && (ch <= 'z')));
}


x86 assembly (clang, -O0):
<isxdigit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x30,-0x4(%rbp)
jl     1120 <isxdigit+0x20>
mov    $0x1,%al
cmpl   $0x39,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jle    1158 <isxdigit+0x58>
cmpl   $0x41,-0x4(%rbp)
jl     1139 <isxdigit+0x39>
mov    $0x1,%al
cmpl   $0x5a,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jle    1158 <isxdigit+0x58>
xor    %eax,%eax
cmpl   $0x61,-0x4(%rbp)
mov    %al,-0x6(%rbp)
jl     1152 <isxdigit+0x52>
cmpl   $0x7a,-0x4(%rbp)
setle  %al
mov    %al,-0x6(%rbp)
mov    -0x6(%rbp),%al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isxdigit>:
lea    -0x30(%rdi),%eax
cmp    $0xa,%eax
setb   %al
and    $0xffffffdf,%edi
add    $0xffffffbf,%edi
cmp    $0x1a,%edi
setb   %cl
or     %al,%cl
movzbl %cl,%eax
ret

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

LLVM IR (-O2):
define i32 @isxdigit(i32 %0) {
%2 = add i32 %0, -48
%3 = icmp ult i32 %2, 10
%4 = and i32 %0, -33
%5 = add i32 %4, -65
%6 = icmp ult i32 %5, 26
%7 = or i1 %3, %6
%8 = zext i1 %7 to i32
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ bad_jump();
int /*<<< orphan*/ free(char *);
scalar_t__ malloc(int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ strcpy(char *, char *);
int main(int argc, char *argv[]) {
  char *buffer;
  buffer = (char *)malloc(64);
  strcpy(buffer, "abc");
  printf("%s\n", buffer);
  bad_jump();
  printf("returned from bad_jump.\n");
  free(buffer);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x40,%edi
call   1060 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
lea    0xe81(%rip),%rsi
call   1040 <strcpy@plt>
mov    -0x18(%rbp),%rsi
lea    0xe75(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    $0x0,%al
call   1070 <bad_jump@plt>
lea    0xe64(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x40,%edi
call   1060 <malloc@plt>
mov    %rax,%rbx
lea    0xe9b(%rip),%rsi
mov    %rax,%rdi
call   1040 <strcpy@plt>
mov    %rbx,%rdi
call   1050 <puts@plt>
xor    %eax,%eax
call   1070 <bad_jump@plt>
lea    0xe81(%rip),%rdi
call   1050 <puts@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"abc\00"
@.str.1 = [4 x i8] c"%s\0A\00"
@.str.2 = [25 x i8] c"returned from bad_jump.\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = call i64 @malloc(i32 64)
%8 = inttoptr i64 %7 to i8*
store i8* %8, i8** %6
%9 = load i8*, i8** %6
%10 = call i32 @strcpy(i8* %9, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%11 = load i8*, i8** %6
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %11)
%13 = call i32 (...) @bad_jump()
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0))
%15 = load i8*, i8** %6
%16 = call i32 @free(i8* %15)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"abc\00"
@str = [24 x i8] c"returned from bad_jump.\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i64 @malloc(i32 64)
%4 = inttoptr i64 %3 to i8*
%5 = tail call i32 @strcpy(i8* %4, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%6 = tail call i32 @puts(i8* dereferenceable(1) %4)
%7 = tail call i32 (...) @bad_jump()
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str, i64 0, i64 0))
%9 = tail call i32 @free(i8* %4)
ret i32 0
}
/* Type definitions */
typedef int uint8_t;
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ gen(int *, int *, int, int, int, int /*<<< orphan*/,
                       int /*<<< orphan*/);
int /*<<< orphan*/ memcpy(int *, int *, int);
void gen_127251(uint8_t *b, uint32_t *buflen) {
  gen(b, buflen, 8, 127251, 2, 0, 0);
  uint8_t sentence[] = {0xc4, 0x20, 0x6d, 0x00, 0x00, 0xff, 0xff, 0xff};
  memcpy(&b[10], sentence, 8);
  *buflen = 18;
}


x86 assembly (clang, -O0):
<gen_127251>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    $0x8,%edx
mov    $0x1f113,%ecx
mov    $0x2,%r8d
xor    %r9d,%r9d
movl   $0x0,(%rsp)
call   1040 <gen@plt>
mov    0xea2(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xe9f(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0xe9c(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xe99(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
add    $0x28,%rdi
lea    -0x30(%rbp),%rsi
mov    $0x8,%edx
call   1030 <memcpy@plt>
mov    -0x10(%rbp),%rax
movl   $0x12,(%rax)
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gen_127251>:
push   %r14
push   %rbx
sub    $0x38,%rsp
mov    %rsi,%r14
mov    %rdi,%rbx
movl   $0x0,(%rsp)
mov    $0x8,%edx
mov    $0x1f113,%ecx
mov    $0x2,%r8d
xor    %r9d,%r9d
call   1040 <gen@plt>
movaps 0xebd(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xea1(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
add    $0x28,%rbx
lea    0x10(%rsp),%rsi
mov    %rbx,%rdi
mov    $0x8,%edx
call   1030 <memcpy@plt>
movl   $0x12,(%r14)
add    $0x38,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@__const.gen_127251.sentence = [8 x i32] [i32 196, i32 32, i32 109, i32 0, i32 0, i32 255, i32 255, i32 255]
define void @gen_127251(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
%5 = alloca [8 x i32]
store i32* %0, i32** %3
store i32* %1, i32** %4
%6 = load i32*, i32** %3
%7 = load i32*, i32** %4
%8 = call i32 @gen(i32* %6, i32* %7, i32 8, i32 127251, i32 2, i32 0, i32 0)
%9 = bitcast [8 x i32]* %5 to i8*
%10 = load i32*, i32** %3
%11 = getelementptr inbounds i32, i32* %10, i64 10
%12 = getelementptr inbounds [8 x i32], [8 x i32]* %5, i64 0, i64 0
%13 = call i32 @memcpy(i32* %11, i32* %12, i32 8)
%14 = load i32*, i32** %4
store i32 18, i32* %14
ret void
}

LLVM IR (-O2):
@__const.gen_127251.sentence = [8 x i32] [i32 196, i32 32, i32 109, i32 0, i32 0, i32 255, i32 255, i32 255]
define void @gen_127251(i32* %0, i32* %1) {
%3 = alloca [8 x i32]
%4 = tail call i32 @gen(i32* %0, i32* %1, i32 8, i32 127251, i32 2, i32 0, i32 0)
%5 = bitcast [8 x i32]* %3 to i8*
%6 = getelementptr inbounds i32, i32* %0, i64 10
%7 = getelementptr inbounds [8 x i32], [8 x i32]* %3, i64 0, i64 0
%8 = call i32 @memcpy(i32* %6, i32* %7, i32 8)
store i32 18, i32* %1
ret void
}
void *memset(void *buf, int chr, unsigned int len) {
  asm("cld ; rep ; stosb" : "+D"(buf), "+c"(len) : "a"(chr));
  return buf;
}


x86 assembly (clang, -O0):
<memset>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%ecx
mov    -0xc(%rbp),%eax
cld
rep stos %al,%es:(%rdi)
mov    %rdi,-0x8(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<memset>:
mov    %edx,%ecx
mov    %esi,%eax
cld
rep stos %al,%es:(%rdi)
mov    %rdi,%rax
ret

LLVM IR (-O0):
define i8* @memset(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i8*, i8** %4
%8 = load i32, i32* %6
%9 = load i32, i32* %5
%10 = call { i8*, i32 } asm "cld ; rep ; stosb", "={di},={cx},{ax},0,1,~{dirflag},~{fpsr},~{flags}"(i32 %9, i8* %7, i32 %8)
%11 = extractvalue { i8*, i32 } %10, 0
%12 = extractvalue { i8*, i32 } %10, 1
store i8* %11, i8** %4
store i32 %12, i32* %6
%13 = load i8*, i8** %4
ret i8* %13
}

LLVM IR (-O2):
define i8* @memset(i8* %0, i32 %1, i32 %2) {
%4 = tail call { i8*, i32 } asm "cld ; rep ; stosb", "={di},={cx},{ax},0,1,~{dirflag},~{fpsr},~{flags}"(i32 %1, i8* %0, i32 %2)
%5 = extractvalue { i8*, i32 } %4, 0
ret i8* %5
}
/* Variables and functions */
void *gm_register(int /*<<< orphan*/);
int /*<<< orphan*/ malloc(unsigned int);
void *galloc(unsigned bytes) { return gm_register(malloc(bytes + 1)); }


x86 assembly (clang, -O0):
<galloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
add    $0x1,%edi
call   1030 <malloc@plt>
mov    %eax,%edi
call   1040 <gm_register@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<galloc>:
push   %rax
add    $0x1,%edi
call   1030 <malloc@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <gm_register@plt>

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

LLVM IR (-O2):
define i8* @galloc(i32 %0) {
%2 = add i32 %0, 1
%3 = tail call i32 @malloc(i32 %2)
%4 = tail call i8* @gm_register(i32 %3)
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ perror(char *);
void quitter(int status) {
  perror("argv[0] --s ip_dest [ --n nom_d_utilisateur ]\n");
  exit(status);
}


x86 assembly (clang, -O0):
<quitter>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xece(%rip),%rdi
call   1030 <perror@plt>
mov    -0x4(%rbp),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<quitter>:
push   %rbx
mov    %edi,%ebx
lea    0xed6(%rip),%rdi
call   1030 <perror@plt>
mov    %ebx,%edi
call   1040 <exit@plt>

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

LLVM IR (-O2):
@.str = [47 x i8] c"argv[0] --s ip_dest [ --n nom_d_utilisateur ]\0A\00"
define void @quitter(i32 %0) {
%2 = tail call i32 @perror(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 %0)
unreachable
}
void addfract(xnum, xdenom, a, b) int *xnum;
int *xdenom;
int a, b;
{
  *xnum = (*xnum) * b + a * (*xdenom);
  *xdenom = (*xdenom) * b;
  reduce(xnum, xdenom);
}


x86 assembly (clang, -O0):
<addfract>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
imul   -0x18(%rbp),%ecx
mov    -0x14(%rbp),%eax
mov    -0x10(%rbp),%rdx
imul   (%rdx),%eax
add    %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
imul   -0x18(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    $0x0,%al
call   1030 <reduce@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<addfract>:
mov    (%rdi),%eax
imul   %ecx,%eax
imul   (%rsi),%edx
add    %eax,%edx
mov    %edx,(%rdi)
imul   (%rsi),%ecx
mov    %ecx,(%rsi)
xor    %eax,%eax
jmp    1030 <reduce@plt>

LLVM IR (-O0):
define void @addfract(i32* %0, i32* %1, i32 %2, i32 %3) {
%5 = alloca i32*
%6 = alloca i32*
%7 = alloca i32
%8 = alloca i32
store i32* %0, i32** %5
store i32* %1, i32** %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32*, i32** %5
%10 = load i32, i32* %9
%11 = load i32, i32* %8
%12 = mul nsw i32 %10, %11
%13 = load i32, i32* %7
%14 = load i32*, i32** %6
%15 = load i32, i32* %14
%16 = mul nsw i32 %13, %15
%17 = add nsw i32 %12, %16
%18 = load i32*, i32** %5
store i32 %17, i32* %18
%19 = load i32*, i32** %6
%20 = load i32, i32* %19
%21 = load i32, i32* %8
%22 = mul nsw i32 %20, %21
%23 = load i32*, i32** %6
store i32 %22, i32* %23
%24 = load i32*, i32** %5
%25 = load i32*, i32** %6
%26 = call i32 (i32*, i32*, ...) bitcast (i32 (...)* @reduce to i32 (i32*, i32*, ...)*)(i32* %24, i32* %25)
ret void
}

LLVM IR (-O2):
define void @addfract(i32* %0, i32* %1, i32 %2, i32 %3) {
%5 = load i32, i32* %0
%6 = mul nsw i32 %5, %3
%7 = load i32, i32* %1
%8 = mul nsw i32 %7, %2
%9 = add nsw i32 %8, %6
store i32 %9, i32* %0
%10 = load i32, i32* %1
%11 = mul nsw i32 %10, %3
store i32 %11, i32* %1
%12 = tail call i32 (i32*, i32*, ...) bitcast (i32 (...)* @reduce to i32 (i32*, i32*, ...)*)(i32* %0, i32* %1)
ret void
}
void menu_print_ordinances_data() {}


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

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

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

LLVM IR (-O2):
define void @menu_print_ordinances_data() {
ret void
}
/* Variables and functions */
int id2val(int);
int f0_val(int base) {
  int id = (base);
  return id2val(id);
}


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

x86 assembly (clang, -O2):
<f0_val>:
jmp    1030 <id2val@plt>

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

LLVM IR (-O2):
define i32 @f0_val(i32 %0) {
%2 = tail call i32 @id2val(i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ bar();
void(__attribute__((nosave_low_regs)) isr)() { bar(); }


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

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

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

LLVM IR (-O2):
define void @isr() {
%1 = tail call i32 (...) @bar()
ret void
}
void mdp4_dmap_done_mddi(int cndx) {}


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

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

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

LLVM IR (-O2):
define void @mdp4_dmap_done_mddi(i32 %0) {
ret void
}
/* Variables and functions */
int syscall(int, char const *, int);
int swapon(const char *path, int flags) { return syscall(87, path, flags); }


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

x86 assembly (clang, -O2):
<swapon>:
mov    %esi,%edx
mov    %rdi,%rsi
mov    $0x57,%edi
jmp    1030 <syscall@plt>

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

LLVM IR (-O2):
define i32 @swapon(i8* %0, i32 %1) {
%3 = tail call i32 @syscall(i32 87, i8* %0, i32 %1)
ret i32 %3
}
void test_two(int x, int y) {
#pragma omp target teams distribute simd
  for (int i = 0; i < x; i++)
    for (int i = 0; i < y; i++)
      ;
}


x86 assembly (clang, -O0):
<test_two>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1156 <test_two+0x56>
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1143 <test_two+0x43>
jmp    1135 <test_two+0x35>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1124 <test_two+0x24>
jmp    1148 <test_two+0x48>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1111 <test_two+0x11>
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @test_two(i32 %0, i32 %1) {
ret void
}
void rop3_236_0_1(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  stk2 = *D & T;
  stk1 = S | stk2;
  *D = (stk1 & S) | (stk1 & (~T)) | (T & (~S) & *D);
}


x86 assembly (clang, -O0):
<rop3_236_0_1>:
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
and    %ecx,%eax
mov    %al,-0xc(%rbp)
movzbl -0x9(%rbp),%eax
movzbl -0xc(%rbp),%ecx
or     %ecx,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
movzbl -0x9(%rbp),%ecx
and    %ecx,%eax
movzbl -0xb(%rbp),%ecx
movzbl -0xa(%rbp),%edx
xor    $0xffffffff,%edx
and    %edx,%ecx
or     %ecx,%eax
movzbl -0xa(%rbp),%ecx
movzbl -0x9(%rbp),%edx
xor    $0xffffffff,%edx
and    %edx,%ecx
mov    -0x8(%rbp),%rdx
movzbl (%rdx),%edx
and    %edx,%ecx
or     %ecx,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rop3_236_0_1>:
mov    %esi,%eax
not    %al
and    %dl,%al
and    (%rdi),%al
or     %sil,%al
mov    %al,(%rdi)
ret

LLVM IR (-O0):
define void @rop3_236_0_1(i8* %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
store i8* %0, i8** %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%9 = load i8*, i8** %4
%10 = load i8, i8* %9
%11 = zext i8 %10 to i32
%12 = load i8, i8* %6
%13 = zext i8 %12 to i32
%14 = and i32 %11, %13
%15 = trunc i32 %14 to i8
store i8 %15, i8* %8
%16 = load i8, i8* %5
%17 = zext i8 %16 to i32
%18 = load i8, i8* %8
%19 = zext i8 %18 to i32
%20 = or i32 %17, %19
%21 = trunc i32 %20 to i8
store i8 %21, i8* %7
%22 = load i8, i8* %7
%23 = zext i8 %22 to i32
%24 = load i8, i8* %5
%25 = zext i8 %24 to i32
%26 = and i32 %23, %25
%27 = load i8, i8* %7
%28 = zext i8 %27 to i32
%29 = load i8, i8* %6
%30 = zext i8 %29 to i32
%31 = xor i32 %30, -1
%32 = and i32 %28, %31
%33 = or i32 %26, %32
%34 = load i8, i8* %6
%35 = zext i8 %34 to i32
%36 = load i8, i8* %5
%37 = zext i8 %36 to i32
%38 = xor i32 %37, -1
%39 = and i32 %35, %38
%40 = load i8*, i8** %4
%41 = load i8, i8* %40
%42 = zext i8 %41 to i32
%43 = and i32 %39, %42
%44 = or i32 %33, %43
%45 = trunc i32 %44 to i8
%46 = load i8*, i8** %4
store i8 %45, i8* %46
ret void
}

LLVM IR (-O2):
define void @rop3_236_0_1(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = load i8, i8* %0
%5 = xor i8 %1, -1
%6 = and i8 %5, %2
%7 = and i8 %6, %4
%8 = or i8 %7, %1
store i8 %8, i8* %0
ret void
}
/* Variables and functions */
int pipe(int *);
int /*<<< orphan*/ syssuerr(char *, char *);
int epipe(int fds[2]) {
  int returnmode;
  if (-1 == (returnmode = pipe(fds)))
    syssuerr("%s: epipe: pipe failed",
             "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
             "2022-01-22/02-19-57/repos/TobbeTripitaka/src/refs/heads/master/"
             "trip/iwave/sucore/src/syscalls.c");
  return returnmode;
}


x86 assembly (clang, -O0):
<epipe>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <pipe@plt>
mov    %eax,%ecx
mov    %ecx,-0xc(%rbp)
mov    $0xffffffff,%eax
cmp    %ecx,%eax
jne    115a <epipe+0x3a>
lea    0xeb2(%rip),%rdi
lea    0xec2(%rip),%rsi
call   1030 <syssuerr@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<epipe>:
push   %rbx
call   1040 <pipe@plt>
mov    %eax,%ebx
cmp    $0xffffffff,%eax
jne    1140 <epipe+0x20>
lea    0xecc(%rip),%rdi
lea    0xedc(%rip),%rsi
call   1030 <syssuerr@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [23 x i8] c"%s: epipe: pipe failed\00"
@.str.1 = [160 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/TobbeTripitaka/src/refs/heads/master/trip/iwave/sucore/src/syscalls.c\00"
define i32 @epipe(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = call i32 @pipe(i32* %4)
store i32 %5, i32* %3
%6 = icmp eq i32 -1, %5
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = call i32 @syssuerr(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([160 x i8], [160 x i8]* @.str.1, i64 0, i64 0))
br label %9
9: ; preds = %7, %1
%10 = load i32, i32* %3
ret i32 %10
}

LLVM IR (-O2):
@.str = [23 x i8] c"%s: epipe: pipe failed\00"
@.str.1 = [160 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/TobbeTripitaka/src/refs/heads/master/trip/iwave/sucore/src/syscalls.c\00"
define i32 @epipe(i32* %0) {
%2 = tail call i32 @pipe(i32* %0)
%3 = icmp eq i32 %2, -1
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @syssuerr(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([160 x i8], [160 x i8]* @.str.1, i64 0, i64 0))
br label %6
6: ; preds = %4, %1
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ ButtonHardware_Init();
int /*<<< orphan*/ ButtonModel_Init();
void ButtonConductor_Init() {
  ButtonModel_Init();
  ButtonHardware_Init();
}


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

x86 assembly (clang, -O2):
<ButtonConductor_Init>:
push   %rax
xor    %eax,%eax
call   1040 <ButtonModel_Init@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <ButtonHardware_Init@plt>

LLVM IR (-O0):
define void @ButtonConductor_Init() {
%1 = call i32 (...) @ButtonModel_Init()
%2 = call i32 (...) @ButtonHardware_Init()
ret void
}

LLVM IR (-O2):
define void @ButtonConductor_Init() {
%1 = tail call i32 (...) @ButtonModel_Init()
%2 = tail call i32 (...) @ButtonHardware_Init()
ret void
}
/* Variables and functions */
int __set_thread_area(void *);
int __set_tls(void *ptr) { return __set_thread_area(ptr); }


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

x86 assembly (clang, -O2):
<__set_tls>:
jmp    1030 <__set_thread_area@plt>

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

LLVM IR (-O2):
define i32 @__set_tls(i8* %0) {
%2 = tail call i32 @__set_thread_area(i8* %0)
ret i32 %2
}
/* Variables and functions */
int M_PI;
int acos(double);
double calcAngleA(double sideA, double sideB, double sideC) {
  return acos((sideB * sideB + sideC * sideC - sideA * sideA) /
              (2 * sideB * sideC)) *
         180 / M_PI;
}


x86 assembly (clang, -O0):
<calcAngleA>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm2
movsd  -0x18(%rbp),%xmm0
mulsd  -0x18(%rbp),%xmm0
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  -0x8(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm2
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  0xe8c(%rip),%xmm1
mulsd  -0x10(%rbp),%xmm1
mulsd  -0x18(%rbp),%xmm1
divsd  %xmm1,%xmm0
call   1030 <acos@plt>
imul   $0xb4,%eax,%eax
mov    0x2e54(%rip),%rcx
cltd
idivl  (%rcx)
cvtsi2sd %eax,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<calcAngleA>:
push   %rax
movapd %xmm1,%xmm3
addsd  %xmm1,%xmm1
mulsd  %xmm2,%xmm1
mulsd  %xmm2,%xmm2
mulsd  %xmm3,%xmm3
addsd  %xmm2,%xmm3
mulsd  %xmm0,%xmm0
subsd  %xmm0,%xmm3
divsd  %xmm1,%xmm3
movapd %xmm3,%xmm0
call   1030 <acos@plt>
imul   $0xb4,%eax,%eax
mov    0x2e9d(%rip),%rcx
cltd
idivl  (%rcx)
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
pop    %rax
ret

LLVM IR (-O0):
@M_PI = global i32 0
define double @calcAngleA(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%7 = load double, double* %5
%8 = load double, double* %5
%9 = load double, double* %6
%10 = load double, double* %6
%11 = fmul double %9, %10
%12 = call double @llvm.fmuladd.f64(double %7, double %8, double %11)
%13 = load double, double* %4
%14 = load double, double* %4
%15 = fneg double %13
%16 = call double @llvm.fmuladd.f64(double %15, double %14, double %12)
%17 = load double, double* %5
%18 = fmul double 2.000000e+00, %17
%19 = load double, double* %6
%20 = fmul double %18, %19
%21 = fdiv double %16, %20
%22 = call i32 @acos(double %21)
%23 = mul nsw i32 %22, 180
%24 = load i32, i32* @M_PI
%25 = sdiv i32 %23, %24
%26 = sitofp i32 %25 to double
ret double %26
}

LLVM IR (-O2):
@M_PI = global i32 0
define double @calcAngleA(double %0, double %1, double %2) {
%4 = fmul double %2, %2
%5 = tail call double @llvm.fmuladd.f64(double %1, double %1, double %4)
%6 = fneg double %0
%7 = tail call double @llvm.fmuladd.f64(double %6, double %0, double %5)
%8 = fmul double %1, 2.000000e+00
%9 = fmul double %8, %2
%10 = fdiv double %7, %9
%11 = tail call i32 @acos(double %10)
%12 = mul nsw i32 %11, 180
%13 = load i32, i32* @M_PI
%14 = sdiv i32 %12, %13
%15 = sitofp i32 %14 to double
ret double %15
}
/* Variables and functions */
int /*<<< orphan*/ wreg(int /*<<< orphan*/, int);
void wreg_twice(void) {
  wreg(0, 42);
  wreg(0, 42);
}


x86 assembly (clang, -O0):
<wreg_twice>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
mov    $0x2a,%esi
call   1030 <wreg@plt>
xor    %edi,%edi
mov    $0x2a,%esi
call   1030 <wreg@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<wreg_twice>:
push   %rax
xor    %edi,%edi
mov    $0x2a,%esi
call   1030 <wreg@plt>
xor    %edi,%edi
mov    $0x2a,%esi
pop    %rax
jmp    1030 <wreg@plt>

LLVM IR (-O0):
define void @wreg_twice() {
%1 = call i32 @wreg(i32 0, i32 42)
%2 = call i32 @wreg(i32 0, i32 42)
ret void
}

LLVM IR (-O2):
define void @wreg_twice() {
%1 = tail call i32 @wreg(i32 0, i32 42)
%2 = tail call i32 @wreg(i32 0, i32 42)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ uartTx(char *, int);
void lcdSetBrightness(char level) {
  char uartOut[3];
  char pwmValue;
  pwmValue = (level / 8) + 128;
  if (pwmValue > 157) {
    pwmValue = 157;
  }
  if (pwmValue < 128) {
    pwmValue = 128;
  }
  uartOut[0] = 0x7C;
  uartOut[1] = pwmValue;
  uartOut[2] = 0;
  uartTx(uartOut, 2);
}


x86 assembly (clang, -O0):
<lcdSetBrightness>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
add    $0x80,%eax
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x9d,%eax
jle    1145 <lcdSetBrightness+0x35>
movb   $0x9d,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x80,%eax
jge    1158 <lcdSetBrightness+0x48>
movb   $0x80,-0x5(%rbp)
movb   $0x7c,-0x4(%rbp)
mov    -0x5(%rbp),%al
mov    %al,-0x3(%rbp)
movb   $0x0,-0x2(%rbp)
lea    -0x4(%rbp),%rdi
mov    $0x2,%esi
call   1030 <uartTx@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lcdSetBrightness>:
push   %rax
movw   $0x807c,0x5(%rsp)
movb   $0x0,0x7(%rsp)
lea    0x5(%rsp),%rdi
mov    $0x2,%esi
call   1030 <uartTx@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @lcdSetBrightness(i8 signext %0) {
%2 = alloca i8
%3 = alloca [3 x i8]
%4 = alloca i8
store i8 %0, i8* %2
%5 = load i8, i8* %2
%6 = sext i8 %5 to i32
%7 = sdiv i32 %6, 8
%8 = add nsw i32 %7, 128
%9 = trunc i32 %8 to i8
store i8 %9, i8* %4
%10 = load i8, i8* %4
%11 = sext i8 %10 to i32
%12 = icmp sgt i32 %11, 157
br i1 %12, label %13, label %14
13: ; preds = %1
store i8 -99, i8* %4
br label %14
14: ; preds = %13, %1
%15 = load i8, i8* %4
%16 = sext i8 %15 to i32
%17 = icmp slt i32 %16, 128
br i1 %17, label %18, label %19
18: ; preds = %14
store i8 -128, i8* %4
br label %19
19: ; preds = %18, %14
%20 = getelementptr inbounds [3 x i8], [3 x i8]* %3, i64 0, i64 0
store i8 124, i8* %20
%21 = load i8, i8* %4
%22 = getelementptr inbounds [3 x i8], [3 x i8]* %3, i64 0, i64 1
store i8 %21, i8* %22
%23 = getelementptr inbounds [3 x i8], [3 x i8]* %3, i64 0, i64 2
store i8 0, i8* %23
%24 = getelementptr inbounds [3 x i8], [3 x i8]* %3, i64 0, i64 0
%25 = call i32 @uartTx(i8* %24, i32 2)
ret void
}

LLVM IR (-O2):
define void @lcdSetBrightness(i8 signext %0) {
%2 = alloca [3 x i8]
%3 = getelementptr inbounds [3 x i8], [3 x i8]* %2, i64 0, i64 0
store i8 124, i8* %3
%4 = getelementptr inbounds [3 x i8], [3 x i8]* %2, i64 0, i64 1
store i8 -128, i8* %4
%5 = getelementptr inbounds [3 x i8], [3 x i8]* %2, i64 0, i64 2
store i8 0, i8* %5
%6 = call i32 @uartTx(i8* %3, i32 2)
ret void
}
int cg_calculate_offset_astore_var(struct NExpr *expr) {}


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

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

LLVM IR (-O0):
%struct.NExpr = type opaque
define i32 @cg_calculate_offset_astore_var(%struct.NExpr* %0) {
%2 = alloca i32
%3 = alloca %struct.NExpr*
store %struct.NExpr* %0, %struct.NExpr** %3
%4 = load i32, i32* %2
ret i32 %4
}

LLVM IR (-O2):
%struct.NExpr = type opaque
define i32 @cg_calculate_offset_astore_var(%struct.NExpr* nocapture readnone %0) {
ret i32 undef
}
void init_accept_tbl(int startups, int accepts, int time) {}


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

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

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

LLVM IR (-O2):
define void @init_accept_tbl(i32 %0, i32 %1, i32 %2) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ off_t;

/* Variables and functions */
int _get_msr(int, int /*<<< orphan*/, unsigned long long *, int);
int get_msr(int cpu, off_t offset, unsigned long long *msr) {
  return _get_msr(cpu, offset, msr, 1);
}


x86 assembly (clang, -O0):
<get_msr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0x10(%rbp),%rdx
mov    $0x1,%ecx
call   1030 <_get_msr@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_msr>:
mov    $0x1,%ecx
jmp    1030 <_get_msr@plt>

LLVM IR (-O0):
define i32 @get_msr(i32 %0, i32 %1, i64* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i64*
store i32 %0, i32* %4
store i32 %1, i32* %5
store i64* %2, i64** %6
%7 = load i32, i32* %4
%8 = load i32, i32* %5
%9 = load i64*, i64** %6
%10 = call i32 @_get_msr(i32 %7, i32 %8, i64* %9, i32 1)
ret i32 %10
}

LLVM IR (-O2):
define i32 @get_msr(i32 %0, i32 %1, i64* %2) {
%4 = tail call i32 @_get_msr(i32 %0, i32 %1, i64* %2, i32 1)
ret i32 %4
}
void hline(int y, int x1, int x2, unsigned char c) {
  int x;
  for (x = x1; x < x2; x++)
    *(((unsigned char *)0x00100000) + (x) + (y)*640) = c;
}


x86 assembly (clang, -O0):
<hline>:
push   %rbp
mov    %rsp,%rbp
mov    %cl,%al
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %al,-0xd(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    114e <hline+0x4e>
mov    -0xd(%rbp),%dl
movslq -0x14(%rbp),%rcx
mov    $0x100000,%eax
add    %rcx,%rax
imul   $0x280,-0x4(%rbp),%ecx
movslq %ecx,%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1118 <hline+0x18>
pop    %rbp
ret

x86 assembly (clang, -O2):
<hline>:
cmp    %edx,%esi
jge    1144 <hline+0x34>
push   %rax
mov    %esi,%eax
shl    $0x7,%edi
lea    (%rdi,%rdi,4),%esi
movslq %esi,%rsi
movslq %eax,%rdi
add    %rsi,%rdi
add    $0x100000,%rdi
not    %eax
add    %edx,%eax
add    $0x1,%rax
movzbl %cl,%esi
mov    %rax,%rdx
call   1030 <memset@plt>
add    $0x8,%rsp
ret

LLVM IR (-O0):
define void @hline(i32 %0, i32 %1, i32 %2, i8 zeroext %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i8
%9 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i8 %3, i8* %8
%10 = load i32, i32* %6
store i32 %10, i32* %9
br label %11
11: ; preds = %24, %4
%12 = load i32, i32* %9
%13 = load i32, i32* %7
%14 = icmp slt i32 %12, %13
br i1 %14, label %15, label %27
15: ; preds = %11
%16 = load i8, i8* %8
%17 = load i32, i32* %9
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds i8, i8* inttoptr (i64 1048576 to i8*), i64 %18
%20 = load i32, i32* %5
%21 = mul nsw i32 %20, 640
%22 = sext i32 %21 to i64
%23 = getelementptr inbounds i8, i8* %19, i64 %22
store i8 %16, i8* %23
br label %24
24: ; preds = %15
%25 = load i32, i32* %9
%26 = add nsw i32 %25, 1
store i32 %26, i32* %9
br label %11
27: ; preds = %11
ret void
}

LLVM IR (-O2):
define void @hline(i32 %0, i32 %1, i32 %2, i8 zeroext %3) {
%5 = icmp slt i32 %1, %2
br i1 %5, label %6, label %16
6: ; preds = %4
%7 = mul nsw i32 %0, 640
%8 = sext i32 %7 to i64
%9 = sext i32 %1 to i64
%10 = add nsw i64 %9, %8
%11 = getelementptr i8, i8* inttoptr (i64 1048576 to i8*), i64 %10
%12 = xor i32 %1, -1
%13 = add i32 %12, %2
%14 = zext i32 %13 to i64
%15 = add nuw nsw i64 %14, 1
br label %16
16: ; preds = %6, %4
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void _free_cleanup(void *pp) {
  void *p = *((void **)pp);
  if (p)
    free(p);
}


x86 assembly (clang, -O0):
<_free_cleanup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     113b <_free_cleanup+0x2b>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_free_cleanup>:
mov    (%rdi),%rdi
test   %rdi,%rdi
je     111d <_free_cleanup+0xd>
jmp    1030 <free@plt>
ret

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

LLVM IR (-O2):
define void @_free_cleanup(i8* nocapture %0) {
%2 = bitcast i8* %0 to i8**
%3 = load i8*, i8** %2
%4 = icmp eq i8* %3, null
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = tail call i32 @free(i8* %3)
br label %7
7: ; preds = %5, %1
ret void
}
float __ocl_sign_float(float x) {
  return (x > 0.0f) ? 1.0f : (x < 0.0f) ? -1.0f : x;
}


x86 assembly (clang, -O0):
<__ocl_sign_float>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jbe    112c <__ocl_sign_float+0x2c>
movss  0xee2(%rip),%xmm0
movss  %xmm0,-0x8(%rbp)
jmp    115f <__ocl_sign_float+0x5f>
xorps  %xmm0,%xmm0
ucomiss -0x4(%rbp),%xmm0
jbe    114b <__ocl_sign_float+0x4b>
movss  0xebf(%rip),%xmm0
movss  %xmm0,-0xc(%rbp)
jmp    1155 <__ocl_sign_float+0x55>
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<__ocl_sign_float>:
xorps  %xmm1,%xmm1
movaps %xmm0,%xmm2
cmpltss %xmm1,%xmm2
movss  0xeed(%rip),%xmm3
andps  %xmm2,%xmm3
andnps %xmm0,%xmm2
orps   %xmm3,%xmm2
cmpltss %xmm0,%xmm1
movss  0xedb(%rip),%xmm0
andps  %xmm1,%xmm0
andnps %xmm2,%xmm1
orps   %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @__ocl_sign_float(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fcmp ogt float %3, 0.000000e+00
br i1 %4, label %5, label %6
5: ; preds = %1
br label %14
6: ; preds = %1
%7 = load float, float* %2
%8 = fcmp olt float %7, 0.000000e+00
br i1 %8, label %9, label %10
9: ; preds = %6
br label %12
10: ; preds = %6
%11 = load float, float* %2
br label %12
12: ; preds = %10, %9
%13 = phi float [ -1.000000e+00, %9 ], [ %11, %10 ]
br label %14
14: ; preds = %12, %5
%15 = phi float [ 1.000000e+00, %5 ], [ %13, %12 ]
ret float %15
}

LLVM IR (-O2):
define float @__ocl_sign_float(float %0) {
%2 = fcmp ogt float %0, 0.000000e+00
%3 = fcmp olt float %0, 0.000000e+00
%4 = select i1 %3, float -1.000000e+00, float %0
%5 = select i1 %2, float 1.000000e+00, float %4
ret float %5
}
/* Type definitions */
typedef int /*<<< orphan*/ ASN1_OBJECT;

/* Variables and functions */
int OBJ_obj2txt(char *, int, int /*<<< orphan*/ const *, int /*<<< orphan*/);
int i2t_ASN1_OBJECT(char *buf, int buf_len, const ASN1_OBJECT *a) {
  return OBJ_obj2txt(buf, buf_len, a, 0);
}


x86 assembly (clang, -O0):
<i2t_ASN1_OBJECT>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
xor    %ecx,%ecx
call   1030 <OBJ_obj2txt@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<i2t_ASN1_OBJECT>:
xor    %ecx,%ecx
jmp    1030 <OBJ_obj2txt@plt>

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

LLVM IR (-O2):
define i32 @i2t_ASN1_OBJECT(i8* %0, i32 %1, i32* %2) {
%4 = tail call i32 @OBJ_obj2txt(i8* %0, i32 %1, i32* %2, i32 0)
ret i32 %4
}