xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ access(char const *, int /*<<< orphan*/);
int IsFileExist(const char *fileName) {
  if (!access(fileName, 0))
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<IsFileExist>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
xor    %esi,%esi
call   1030 <access@plt>
cmp    $0x0,%eax
jne    113c <IsFileExist+0x2c>
movl   $0x1,-0x4(%rbp)
jmp    1143 <IsFileExist+0x33>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<IsFileExist>:
push   %rax
xor    %esi,%esi
call   1030 <access@plt>
xor    %ecx,%ecx
test   %eax,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @IsFileExist(i8* nocapture %0) {
%2 = tail call i32 @access(i8* %0, i32 0)
%3 = icmp eq i32 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
int do_972() { return 972; }


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

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

LLVM IR (-O0):
define i32 @do_972() {
ret i32 972
}

LLVM IR (-O2):
define i32 @do_972() {
ret i32 972
}
int dns_opt_cmp(const struct dns_opt *a, const struct dns_opt *b) {
  (void)a;
  (void)b;
  return -1;
}


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

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

LLVM IR (-O0):
%struct.dns_opt = type opaque
define i32 @dns_opt_cmp(%struct.dns_opt* %0, %struct.dns_opt* %1) {
%3 = alloca %struct.dns_opt*
%4 = alloca %struct.dns_opt*
store %struct.dns_opt* %0, %struct.dns_opt** %3
store %struct.dns_opt* %1, %struct.dns_opt** %4
%5 = load %struct.dns_opt*, %struct.dns_opt** %3
%6 = load %struct.dns_opt*, %struct.dns_opt** %4
ret i32 -1
}

LLVM IR (-O2):
%struct.dns_opt = type opaque
define i32 @dns_opt_cmp(%struct.dns_opt* nocapture readnone %0, %struct.dns_opt* nocapture readnone %1) {
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void display_array(int a[], int n) {
  int i;
  for (i = 0; i < n; i++) {
    printf("%d  ", a[i]);
  }
  printf("\n");
}


x86 assembly (clang, -O0):
<display_array>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1159 <display_array+0x49>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xebc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <display_array+0x16>
lea    0xea5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<display_array>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1157 <display_array+0x37>
mov    %rdi,%r15
mov    %esi,%r12d
lea    0xec7(%rip),%r14
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
mov    (%r15,%rbx,4),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1140 <display_array+0x20>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
@.str = [5 x i8] c"%d \00"
define void @display_array(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = load i32, i32* %8
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
%14 = tail call i32 @putchar(i32 10)
ret void
}
/* Type definitions */
struct s_host_info {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ query_from_dns_server(struct s_host_info *);
void *query_dns_async_thread(void *args) {
  struct s_host_info *p_host_info = (struct s_host_info *)args;
  query_from_dns_server(p_host_info);
  return NULL;
}


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

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

LLVM IR (-O0):
%struct.s_host_info = type { i32 }
define i8* @query_dns_async_thread(i8* %0) {
%2 = alloca i8*
%3 = alloca %struct.s_host_info*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = bitcast i8* %4 to %struct.s_host_info*
store %struct.s_host_info* %5, %struct.s_host_info** %3
%6 = load %struct.s_host_info*, %struct.s_host_info** %3
%7 = call i32 @query_from_dns_server(%struct.s_host_info* %6)
ret i8* null
}

LLVM IR (-O2):
%struct.s_host_info = type { i32 }
define noalias i8* @query_dns_async_thread(i8* %0) {
%2 = bitcast i8* %0 to %struct.s_host_info*
%3 = tail call i32 @query_from_dns_server(%struct.s_host_info* %2)
ret i8* null
}
/* Variables and functions */
double exp(int /*<<< orphan*/);
int /*<<< orphan*/ pow(double, int);
double funcao_x(double x) { return exp(-pow(x, 2)); }


x86 assembly (clang, -O0):
<funcao_x>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
mov    $0x2,%edi
call   1040 <pow@plt>
xor    %edi,%edi
sub    %eax,%edi
call   1030 <exp@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<funcao_x>:
push   %rax
mov    $0x2,%edi
call   1040 <pow@plt>
neg    %eax
mov    %eax,%edi
pop    %rax
jmp    1030 <exp@plt>

LLVM IR (-O0):
define double @funcao_x(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call i32 @pow(double %3, i32 2)
%5 = sub nsw i32 0, %4
%6 = call double @exp(i32 %5)
ret double %6
}

LLVM IR (-O2):
define double @funcao_x(double %0) {
%2 = tail call i32 @pow(double %0, i32 2)
%3 = sub nsw i32 0, %2
%4 = tail call double @exp(i32 %3)
ret double %4
}
/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ stdout;
int /*<<< orphan*/ write(int, char *, int);
void c_type(int count, char buffer[]) {
  write(1, buffer, count);
  fflush(stdout);
}


x86 assembly (clang, -O0):
<c_type>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
mov    -0x4(%rbp),%edx
mov    $0x1,%edi
call   1030 <write@plt>
mov    0x2e99(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<c_type>:
push   %rax
mov    %edi,%edx
mov    $0x1,%edi
call   1030 <write@plt>
mov    0x2eac(%rip),%rax
mov    (%rax),%edi
pop    %rax
jmp    1040 <fflush@plt>

LLVM IR (-O0):
@stdout = global i32 0
define void @c_type(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = load i32, i32* %3
%7 = call i32 @write(i32 1, i8* %5, i32 %6)
%8 = load i32, i32* @stdout
%9 = call i32 @fflush(i32 %8)
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
define void @c_type(i32 %0, i8* nocapture %1) {
%3 = tail call i32 @write(i32 1, i8* %1, i32 %0)
%4 = load i32, i32* @stdout
%5 = tail call i32 @fflush(i32 %4)
ret void
}
/* Type definitions */
struct t_config_option {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ gui_hotlist_resort();
void config_change_hotlist(void *data, struct t_config_option *option) {
  (void)data;
  (void)option;
  gui_hotlist_resort();
}


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

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

LLVM IR (-O0):
%struct.t_config_option = type { i32 }
define void @config_change_hotlist(i8* %0, %struct.t_config_option* %1) {
%3 = alloca i8*
%4 = alloca %struct.t_config_option*
store i8* %0, i8** %3
store %struct.t_config_option* %1, %struct.t_config_option** %4
%5 = load i8*, i8** %3
%6 = load %struct.t_config_option*, %struct.t_config_option** %4
%7 = call i32 (...) @gui_hotlist_resort()
ret void
}

LLVM IR (-O2):
%struct.t_config_option = type { i32 }
define void @config_change_hotlist(i8* nocapture readnone %0, %struct.t_config_option* nocapture readnone %1) {
%3 = tail call i32 (...) @gui_hotlist_resort()
ret void
}
/* Variables and functions */
size_t strlen(const char *str) {
  const char *s;
  if (str == 0)
    return 0;
  for (s = str; *s; ++s)
    ;
  return s - str;
}


x86 assembly (clang, -O0):
<strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1120 <strlen+0x20>
movq   $0x0,-0x8(%rbp)
jmp    115a <strlen+0x5a>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmpb   $0x0,(%rax)
je     114b <strlen+0x4b>
jmp    113a <strlen+0x3a>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1128 <strlen+0x28>
mov    -0x18(%rbp),%rax
mov    -0x10(%rbp),%rcx
sub    %rcx,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlen>:
test   %rdi,%rdi
je     111f <strlen+0x1f>
mov    $0xffffffffffffffff,%rcx
nopl   0x0(%rax)
lea    0x1(%rcx),%rax
cmpb   $0x0,0x1(%rdi,%rcx,1)
mov    %rax,%rcx
jne    1110 <strlen+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i64 @strlen(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %12, label %3
3: ; preds = %1, %3
%4 = phi i8* [ %7, %3 ], [ %0, %1 ]
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = getelementptr inbounds i8, i8* %4, i64 1
br i1 %6, label %8, label %3
8: ; preds = %3
%9 = ptrtoint i8* %4 to i64
%10 = ptrtoint i8* %0 to i64
%11 = sub i64 %9, %10
br label %12
12: ; preds = %1, %8
%13 = phi i64 [ %11, %8 ], [ 0, %1 ]
ret i64 %13
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
struct tm {
  int tm_hour;
  int tm_min;
  int tm_sec;
};

/* Variables and functions */
struct tm *localtime(int /*<<< orphan*/ *);
int /*<<< orphan*/ sprintf(char *, char *, int, int, int);
void print_time(char *ch, time_t *now) {
  struct tm *stm;
  stm = localtime(now);
  sprintf(ch, "%02d:%02d:%02d\n", stm->tm_hour, stm->tm_min, stm->tm_sec);
}


x86 assembly (clang, -O0):
<print_time>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <localtime@plt>
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rax
mov    (%rax),%edx
mov    -0x18(%rbp),%rax
mov    0x4(%rax),%ecx
mov    -0x18(%rbp),%rax
mov    0x8(%rax),%r8d
lea    0xea3(%rip),%rsi
call   1040 <sprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_time>:
push   %rbx
mov    %rdi,%rbx
mov    %rsi,%rdi
call   1030 <localtime@plt>
mov    (%rax),%edx
mov    0x4(%rax),%ecx
mov    0x8(%rax),%r8d
lea    0xec4(%rip),%rsi
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <sprintf@plt>

LLVM IR (-O0):
%struct.tm = type { i32, i32, i32 }
@.str = [16 x i8] c"%02d:%02d:%02d\0A\00"
define void @print_time(i8* %0, i32* %1) {
%3 = alloca i8*
%4 = alloca i32*
%5 = alloca %struct.tm*
store i8* %0, i8** %3
store i32* %1, i32** %4
%6 = load i32*, i32** %4
%7 = call %struct.tm* @localtime(i32* %6)
store %struct.tm* %7, %struct.tm** %5
%8 = load i8*, i8** %3
%9 = load %struct.tm*, %struct.tm** %5
%10 = getelementptr inbounds %struct.tm, %struct.tm* %9, i32 0, i32 0
%11 = load i32, i32* %10
%12 = load %struct.tm*, %struct.tm** %5
%13 = getelementptr inbounds %struct.tm, %struct.tm* %12, i32 0, i32 1
%14 = load i32, i32* %13
%15 = load %struct.tm*, %struct.tm** %5
%16 = getelementptr inbounds %struct.tm, %struct.tm* %15, i32 0, i32 2
%17 = load i32, i32* %16
%18 = call i32 @sprintf(i8* %8, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %11, i32 %14, i32 %17)
ret void
}

LLVM IR (-O2):
%struct.tm = type { i32, i32, i32 }
@.str = [16 x i8] c"%02d:%02d:%02d\0A\00"
define void @print_time(i8* nocapture writeonly %0, i32* %1) {
%3 = tail call %struct.tm* @localtime(i32* %1)
%4 = getelementptr inbounds %struct.tm, %struct.tm* %3, i64 0, i32 0
%5 = load i32, i32* %4
%6 = getelementptr inbounds %struct.tm, %struct.tm* %3, i64 0, i32 1
%7 = load i32, i32* %6
%8 = getelementptr inbounds %struct.tm, %struct.tm* %3, i64 0, i32 2
%9 = load i32, i32* %8
%10 = tail call i32 @sprintf(i8* dereferenceable(1) %0, i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %5, i32 %7, i32 %9)
ret void
}
void lib_handler(int signum) {}


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

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

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

LLVM IR (-O2):
define void @lib_handler(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ifc_close();
int ifc_down(char const *);
int /*<<< orphan*/ ifc_init();
int /*<<< orphan*/ ifc_set_addr(char const *, int /*<<< orphan*/);
int ifc_disable(const char *ifname) {
  int result;
  ifc_init();
  result = ifc_down(ifname);
  ifc_set_addr(ifname, 0);
  ifc_close();
  return result;
}


x86 assembly (clang, -O0):
<ifc_disable>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1040 <ifc_init@plt>
mov    -0x8(%rbp),%rdi
call   1050 <ifc_down@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
xor    %esi,%esi
call   1030 <ifc_set_addr@plt>
mov    $0x0,%al
call   1060 <ifc_close@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ifc_disable>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
xor    %eax,%eax
call   1040 <ifc_init@plt>
mov    %rbx,%rdi
call   1050 <ifc_down@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
xor    %esi,%esi
call   1030 <ifc_set_addr@plt>
xor    %eax,%eax
call   1060 <ifc_close@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @ifc_disable(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = call i32 (...) @ifc_init()
%5 = load i8*, i8** %2
%6 = call i32 @ifc_down(i8* %5)
store i32 %6, i32* %3
%7 = load i8*, i8** %2
%8 = call i32 @ifc_set_addr(i8* %7, i32 0)
%9 = call i32 (...) @ifc_close()
%10 = load i32, i32* %3
ret i32 %10
}

LLVM IR (-O2):
define i32 @ifc_disable(i8* %0) {
%2 = tail call i32 (...) @ifc_init()
%3 = tail call i32 @ifc_down(i8* %0)
%4 = tail call i32 @ifc_set_addr(i8* %0, i32 0)
%5 = tail call i32 (...) @ifc_close()
ret i32 %3
}
int test_imm_A1uint64_midword_reg(unsigned long long val) {
  return ((val >> 16) & (0xA1 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_A1uint64_midword_reg(i64 %0) {
%2 = and i64 %0, 10551296
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ GPT2_DriverIRQHandler();
__attribute__((weak)) void GPT2_IRQHandler(void) { GPT2_DriverIRQHandler(); }


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

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

LLVM IR (-O0):
define weak void @GPT2_IRQHandler() {
%1 = call i32 (...) @GPT2_DriverIRQHandler()
ret void
}

LLVM IR (-O2):
define weak void @GPT2_IRQHandler() {
%1 = tail call i32 (...) @GPT2_DriverIRQHandler()
ret void
}
int removedir(dir)
char *dir;
{
  static char *argv[] = {"rm", "-r", 0, 0};
  printf("(rm -r %s)\n", dir);
  argv[2] = dir;
  return execute(argv);
}


x86 assembly (clang, -O0):
<removedir>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xecf(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
mov    %rax,0x2f07(%rip)
lea    0x2ef0(%rip),%rdi
mov    $0x0,%al
call   1040 <execute@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<removedir>:
push   %rbx
mov    %rdi,%rbx
lea    0xedb(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rbx,0x2f14(%rip)
lea    0x2efd(%rip),%rdi
xor    %eax,%eax
pop    %rbx
jmp    1040 <execute@plt>

LLVM IR (-O0):
@removedir.argv = internal global [4 x i8*] [i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i32 0, i32 0), i8* null, i8* null]
@.str = [3 x i8] c"rm\00"
@.str.1 = [3 x i8] c"-r\00"
@.str.2 = [12 x i8] c"(rm -r %s)\0A\00"
define i32 @removedir(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i8* %3)
%5 = load i8*, i8** %2
store i8* %5, i8** getelementptr inbounds ([4 x i8*], [4 x i8*]* @removedir.argv, i64 0, i64 2)
%6 = call i32 (i8**, ...) bitcast (i32 (...)* @execute to i32 (i8**, ...)*)(i8** getelementptr inbounds ([4 x i8*], [4 x i8*]* @removedir.argv, i64 0, i64 0))
ret i32 %6
}

LLVM IR (-O2):
@removedir.argv = internal global [4 x i8*] [i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i32 0, i32 0), i8* null, i8* null]
@.str = [3 x i8] c"rm\00"
@.str.1 = [3 x i8] c"-r\00"
@.str.2 = [12 x i8] c"(rm -r %s)\0A\00"
define i32 @removedir(i8* %0) {
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i8* %0)
store i8* %0, i8** getelementptr inbounds ([4 x i8*], [4 x i8*]* @removedir.argv, i64 0, i64 2)
%3 = tail call i32 (i8**, ...) bitcast (i32 (...)* @execute to i32 (i8**, ...)*)(i8** getelementptr inbounds ([4 x i8*], [4 x i8*]* @removedir.argv, i64 0, i64 0))
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ test_dlist();
int /*<<< orphan*/ test_slist();
void test_list() {
  test_dlist();
  test_slist();
}


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

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

LLVM IR (-O0):
define void @test_list() {
%1 = call i32 (...) @test_dlist()
%2 = call i32 (...) @test_slist()
ret void
}

LLVM IR (-O2):
define void @test_list() {
%1 = tail call i32 (...) @test_dlist()
%2 = tail call i32 (...) @test_slist()
ret void
}
void f6(int x) {
  int a[20];
  if (x == 25) {
  }
  if (a[x] == 123) {
  }
}


x86 assembly (clang, -O0):
<f6>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x19,-0x4(%rbp)
jne    1116 <f6+0x16>
jmp    1116 <f6+0x16>
movslq -0x4(%rbp),%rax
cmpl   $0x7b,-0x60(%rbp,%rax,4)
jne    112a <f6+0x2a>
jmp    112a <f6+0x2a>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @f6(i32 %0) {
%2 = alloca i32
%3 = alloca [20 x i32]
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = icmp eq i32 %4, 25
br i1 %5, label %6, label %7
6: ; preds = %1
br label %7
7: ; preds = %6, %1
%8 = load i32, i32* %2
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds [20 x i32], [20 x i32]* %3, i64 0, i64 %9
%11 = load i32, i32* %10
%12 = icmp eq i32 %11, 123
br i1 %12, label %13, label %14
13: ; preds = %7
br label %14
14: ; preds = %13, %7
ret void
}

LLVM IR (-O2):
define void @f6(i32 %0) {
ret void
}
long long fi4(long long j, short *b, int i) { return j + b[i]; }


x86 assembly (clang, -O0):
<fi4>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
movslq -0x14(%rbp),%rdx
movswq (%rcx,%rdx,2),%rcx
add    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fi4>:
movslq %edx,%rax
movswq (%rsi,%rax,2),%rax
add    %rdi,%rax
ret

LLVM IR (-O0):
define i64 @fi4(i64 %0, i16* %1, i32 %2) {
%4 = alloca i64
%5 = alloca i16*
%6 = alloca i32
store i64 %0, i64* %4
store i16* %1, i16** %5
store i32 %2, i32* %6
%7 = load i64, i64* %4
%8 = load i16*, i16** %5
%9 = load i32, i32* %6
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i16, i16* %8, i64 %10
%12 = load i16, i16* %11
%13 = sext i16 %12 to i64
%14 = add nsw i64 %7, %13
ret i64 %14
}

LLVM IR (-O2):
define i64 @fi4(i64 %0, i16* nocapture %1, i32 %2) {
%4 = sext i32 %2 to i64
%5 = getelementptr inbounds i16, i16* %1, i64 %4
%6 = load i16, i16* %5
%7 = sext i16 %6 to i64
%8 = add nsw i64 %7, %0
ret i64 %8
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
scalar_t__ some_condition();
void may_call_free(void *victim) {
  if (some_condition())
    return;
  free(victim);
}


x86 assembly (clang, -O0):
<may_call_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1040 <some_condition@plt>
cmp    $0x0,%rax
je     1142 <may_call_free+0x22>
jmp    114b <may_call_free+0x2b>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<may_call_free>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1040 <some_condition@plt>
test   %rax,%rax
je     1132 <may_call_free+0x12>
pop    %rbx
ret
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @may_call_free(i8* nocapture %0) {
%2 = tail call i64 (...) @some_condition()
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @free(i8* %0)
br label %6
6: ; preds = %1, %4
ret void
}
int func1(void) {
  int j;
  {
    j = 6;
    return (j);
  }
}


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

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

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

LLVM IR (-O2):
define i32 @func1() {
ret i32 6
}
void cli() { __asm__ __volatile__("cli"); }


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

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

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

LLVM IR (-O2):
define void @cli() {
tail call void asm sideeffect "cli", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
void halLcdSpiInit(void) {}


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

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

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

LLVM IR (-O2):
define void @halLcdSpiInit() {
ret void
}
char makeAttr(char fgcolor, char bgcolor) { return (bgcolor << 4) | fgcolor; }


x86 assembly (clang, -O0):
<makeAttr>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movsbl -0x2(%rbp),%eax
shl    $0x4,%eax
movsbl -0x1(%rbp),%ecx
or     %ecx,%eax
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<makeAttr>:
mov    %esi,%eax
shl    $0x4,%al
or     %dil,%al
ret

LLVM IR (-O0):
define signext i8 @makeAttr(i8 signext %0, i8 signext %1) {
%3 = alloca i8
%4 = alloca i8
store i8 %0, i8* %3
store i8 %1, i8* %4
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = shl i32 %6, 4
%8 = load i8, i8* %3
%9 = sext i8 %8 to i32
%10 = or i32 %7, %9
%11 = trunc i32 %10 to i8
ret i8 %11
}

LLVM IR (-O2):
define signext i8 @makeAttr(i8 signext %0, i8 signext %1) {
%3 = shl i8 %1, 4
%4 = or i8 %3, %0
ret i8 %4
}
/* Type definitions */
struct genlist {
  int dummy;
};
struct datafile_list {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ genlist_shuffle(struct genlist *);
void datafile_list_shuffle(struct datafile_list *tthis) {
  genlist_shuffle(((struct genlist *)(tthis)));
}


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

x86 assembly (clang, -O2):
<datafile_list_shuffle>:
jmp    1030 <genlist_shuffle@plt>

LLVM IR (-O0):
%struct.datafile_list = type { i32 }
%struct.genlist = type { i32 }
define void @datafile_list_shuffle(%struct.datafile_list* %0) {
%2 = alloca %struct.datafile_list*
store %struct.datafile_list* %0, %struct.datafile_list** %2
%3 = load %struct.datafile_list*, %struct.datafile_list** %2
%4 = bitcast %struct.datafile_list* %3 to %struct.genlist*
%5 = call i32 @genlist_shuffle(%struct.genlist* %4)
ret void
}

LLVM IR (-O2):
%struct.datafile_list = type { i32 }
%struct.genlist = type { i32 }
define void @datafile_list_shuffle(%struct.datafile_list* %0) {
%2 = bitcast %struct.datafile_list* %0 to %struct.genlist*
%3 = tail call i32 @genlist_shuffle(%struct.genlist* %2)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, char *);
void XMLDB_Generate_Begin_Paragraph(FILE *dest_doc) {
  fprintf(dest_doc, "%s", "<para>\n");
}


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

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

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
@.str.1 = [8 x i8] c"<para>\0A\00"
define void @XMLDB_Generate_Begin_Paragraph(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @fprintf(i32* %3, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str.1 = [8 x i8] c"<para>\0A\00"
define void @XMLDB_Generate_Begin_Paragraph(i32* nocapture %0) {
%2 = tail call i64 @fwrite(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i64 7, i64 1, i32* %0)
ret void
}
int main() {
  printf("\n%s: \n", __func__);
  liba();
  libb();
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
lea    0xec8(%rip),%rsi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
call   1040 <liba@plt>
xor    %eax,%eax
call   1050 <libb@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [7 x i8] c"\0A%s: \0A\00"
@__func__.main = [5 x i8] c"main\00"
define i32 @main() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @__func__.main, i64 0, i64 0))
%2 = tail call i32 (...) @liba()
%3 = tail call i32 (...) @libb()
ret i32 0
}
int existeixProducte(int idProducte, int stock[64 + 64]) {
  int i;
  for (i = 0; i < 64 + 64; i++) {
    if (idProducte == stock[i]) {
      return 1;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<existeixProducte>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x80,-0x14(%rbp)
jge    1152 <existeixProducte+0x52>
mov    -0x8(%rbp),%eax
mov    -0x10(%rbp),%rcx
movslq -0x14(%rbp),%rdx
cmp    (%rcx,%rdx,4),%eax
jne    113f <existeixProducte+0x3f>
movl   $0x1,-0x4(%rbp)
jmp    1159 <existeixProducte+0x59>
jmp    1144 <existeixProducte+0x44>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1112 <existeixProducte+0x12>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<existeixProducte>:
xor    %ecx,%ecx
mov    $0x1,%eax
nopw   0x0(%rax,%rax,1)
cmp    %edi,(%rsi,%rcx,4)
je     1136 <existeixProducte+0x36>
cmp    %edi,0x4(%rsi,%rcx,4)
je     1136 <existeixProducte+0x36>
cmp    %edi,0x8(%rsi,%rcx,4)
je     1136 <existeixProducte+0x36>
cmp    %edi,0xc(%rsi,%rcx,4)
je     1136 <existeixProducte+0x36>
add    $0x4,%rcx
cmp    $0x80,%rcx
jne    1110 <existeixProducte+0x10>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @existeixProducte(i32 %0, i32* nocapture %1) {
br label %21
3: ; preds = %21
%4 = or i64 %22, 1
%5 = getelementptr inbounds i32, i32* %1, i64 %4
%6 = load i32, i32* %5
%7 = icmp eq i32 %6, %0
br i1 %7, label %26, label %8
8: ; preds = %3
%9 = or i64 %22, 2
%10 = getelementptr inbounds i32, i32* %1, i64 %9
%11 = load i32, i32* %10
%12 = icmp eq i32 %11, %0
br i1 %12, label %26, label %13
13: ; preds = %8
%14 = or i64 %22, 3
%15 = getelementptr inbounds i32, i32* %1, i64 %14
%16 = load i32, i32* %15
%17 = icmp eq i32 %16, %0
br i1 %17, label %26, label %18
18: ; preds = %13
%19 = add nuw nsw i64 %22, 4
%20 = icmp eq i64 %19, 128
br i1 %20, label %26, label %21
21: ; preds = %18, %2
%22 = phi i64 [ 0, %2 ], [ %19, %18 ]
%23 = getelementptr inbounds i32, i32* %1, i64 %22
%24 = load i32, i32* %23
%25 = icmp eq i32 %24, %0
br i1 %25, label %26, label %3
26: ; preds = %18, %13, %8, %3, %21
%27 = phi i32 [ 1, %21 ], [ 1, %3 ], [ 1, %8 ], [ 1, %13 ], [ 0, %18 ]
ret i32 %27
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int foo(int x) {
  printf("foo: %d\n", x);
  return x;
}


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

x86 assembly (clang, -O2):
<foo>:
push   %rbx
mov    %edi,%ebx
lea    0xee6(%rip),%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [9 x i8] c"foo: %d\0A\00"
define i32 @foo(i32 returned %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %0)
ret i32 %0
}
/* Variables and functions */
int /*<<< orphan*/ arr_delete(void *);
void arr_delete_cb(void *self) { arr_delete(self); }


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

x86 assembly (clang, -O2):
<arr_delete_cb>:
jmp    1030 <arr_delete@plt>

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

LLVM IR (-O2):
define void @arr_delete_cb(i8* %0) {
%2 = tail call i32 @arr_delete(i8* %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ bswap_16(int /*<<< orphan*/);
uint16_t elf16_to_cpu(uint16_t val) { return bswap_16(val); }


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

x86 assembly (clang, -O2):
<elf16_to_cpu>:
jmp    1030 <bswap_16@plt>

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

LLVM IR (-O2):
define i32 @elf16_to_cpu(i32 %0) {
%2 = tail call i32 @bswap_16(i32 %0)
ret i32 %2
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  unsigned long serial;
};
typedef TYPE_1__ XAnyEvent;

/* Variables and functions */
void set_XAnyEvent_serial(void *_p, unsigned long _v) {
  ((XAnyEvent *)_p)->serial = (unsigned long)_v;
}


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

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

LLVM IR (-O0):
%struct.TYPE_2__ = type { i64 }
define void @set_XAnyEvent_serial(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to %struct.TYPE_2__*
%8 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %7, i32 0, i32 0
store i64 %5, i64* %8
ret void
}

LLVM IR (-O2):
define void @set_XAnyEvent_serial(i8* nocapture writeonly %0, i64 %1) {
%3 = bitcast i8* %0 to i64*
store i64 %1, i64* %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int sum(int, int);
int main() {
  printf("Hello World\n");
  printf("Sum: %d\n", sum(5, 3));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x5,%edi
mov    $0x3,%esi
call   1040 <sum@plt>
mov    %eax,%esi
lea    0xeb8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed1(%rip),%rdi
call   1030 <puts@plt>
mov    $0x5,%edi
mov    $0x3,%esi
call   1050 <sum@plt>
lea    0xead(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [13 x i8] c"Hello World\0A\00"
@.str.1 = [9 x i8] c"Sum: %d\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @sum(i32 5, i32 3)
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32 %3)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [9 x i8] c"Sum: %d\0A\00"
@str = [12 x i8] c"Hello World\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @sum(i32 5, i32 3)
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32 %2)
ret i32 0
}
int test_imm_CEuint64_highword_mem(unsigned long long *val) {
  return ((*val >> 32) & (0xCE << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_CEuint64_highword_mem>:
testb  $0xce,0x4(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_CEuint64_highword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 884763262976
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
int main(void) {
  int n = 0;
  while (n != 42) {
    scanf("%d", &n);
    if (n != 42)
      printf("%d\n", n);
  }
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x2a,-0x8(%rbp)
je     116e <main+0x4e>
lea    0xeb9(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
cmpl   $0x2a,-0x8(%rbp)
je     1169 <main+0x49>
mov    -0x8(%rbp),%esi
lea    0xe9f(%rip),%rdi
call   1030 <printf@plt>
jmp    1136 <main+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
movl   $0x0,0xc(%rsp)
lea    0xec8(%rip),%r14
lea    0xc(%rsp),%rbx
lea    0xebf(%rip),%r15
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <scanf@plt>
mov    0xc(%rsp),%esi
cmp    $0x2a,%esi
je     1173 <main+0x53>
mov    %r15,%rdi
call   1030 <printf@plt>
cmpl   $0x2a,0xc(%rsp)
jne    1150 <main+0x30>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 0, i32* %1
br label %3
3: ; preds = %0, %7
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = icmp eq i32 %5, 42
br i1 %6, label %11, label %7
7: ; preds = %3
%8 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %5)
%9 = load i32, i32* %1
%10 = icmp eq i32 %9, 42
br i1 %10, label %11, label %3
11: ; preds = %3, %7
ret i32 0
}
int sign(const double x) {
  if (x < 0)
    return -1;
  if (x > 0)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<sign>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    1123 <sign+0x23>
movl   $0xffffffff,-0x4(%rbp)
jmp    1148 <sign+0x48>
movsd  -0x10(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    1141 <sign+0x41>
movl   $0x1,-0x4(%rbp)
jmp    1148 <sign+0x48>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sign>:
xorpd  %xmm1,%xmm1
xor    %ecx,%ecx
ucomisd %xmm1,%xmm0
seta   %cl
ucomisd %xmm0,%xmm1
mov    $0xffffffff,%eax
cmovbe %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @sign(double %0) {
%2 = fcmp olt double %0, 0.000000e+00
%3 = fcmp ogt double %0, 0.000000e+00
%4 = zext i1 %3 to i32
%5 = select i1 %2, i32 -1, i32 %4
ret i32 %5
}
void test() {
#pragma omp parallel reduction(+ : incomplete)
  ;
}


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

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

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

LLVM IR (-O2):
define void @test() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ comando();
int /*<<< orphan*/ declaracao_variaveis();
void bloco_de_funcao(void) {
  declaracao_variaveis();
  comando();
}


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

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

LLVM IR (-O0):
define void @bloco_de_funcao() {
%1 = call i32 (...) @declaracao_variaveis()
%2 = call i32 (...) @comando()
ret void
}

LLVM IR (-O2):
define void @bloco_de_funcao() {
%1 = tail call i32 (...) @declaracao_variaveis()
%2 = tail call i32 (...) @comando()
ret void
}
int mid_pred(int a, int b, int c) {
  int vmin, vmax;
  vmax = vmin = a;
  if (b < vmin)
    vmin = b;
  else
    vmax = b;
  if (c < vmin)
    vmin = c;
  else if (c > vmax)
    vmax = c;
  return a + b + c - vmin - vmax;
}


x86 assembly (clang, -O0):
<mid_pred>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    112d <mid_pred+0x2d>
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    1133 <mid_pred+0x33>
mov    -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    114a <mid_pred+0x4a>
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    1161 <mid_pred+0x61>
mov    -0xc(%rbp),%eax
cmp    -0x14(%rbp),%eax
jle    115c <mid_pred+0x5c>
mov    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
jmp    1161 <mid_pred+0x61>
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
sub    -0x10(%rbp),%eax
sub    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mid_pred>:
cmp    %edi,%esi
mov    %esi,%eax
cmovl  %edi,%eax
mov    %edi,%r8d
cmovl  %esi,%r8d
cmp    %edx,%eax
mov    %eax,%ecx
cmovl  %edx,%ecx
cmp    %edx,%r8d
cmovg  %edx,%r8d
cmovg  %eax,%ecx
lea    (%rsi,%rdi,1),%eax
add    %edx,%eax
add    %r8d,%ecx
sub    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @mid_pred(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%9 = load i32, i32* %4
store i32 %9, i32* %7
store i32 %9, i32* %8
%10 = load i32, i32* %5
%11 = load i32, i32* %7
%12 = icmp slt i32 %10, %11
br i1 %12, label %13, label %15
13: ; preds = %3
%14 = load i32, i32* %5
store i32 %14, i32* %7
br label %17
15: ; preds = %3
%16 = load i32, i32* %5
store i32 %16, i32* %8
br label %17
17: ; preds = %15, %13
%18 = load i32, i32* %6
%19 = load i32, i32* %7
%20 = icmp slt i32 %18, %19
br i1 %20, label %21, label %23
21: ; preds = %17
%22 = load i32, i32* %6
store i32 %22, i32* %7
br label %30
23: ; preds = %17
%24 = load i32, i32* %6
%25 = load i32, i32* %8
%26 = icmp sgt i32 %24, %25
br i1 %26, label %27, label %29
27: ; preds = %23
%28 = load i32, i32* %6
store i32 %28, i32* %8
br label %29
29: ; preds = %27, %23
br label %30
30: ; preds = %29, %21
%31 = load i32, i32* %4
%32 = load i32, i32* %5
%33 = add nsw i32 %31, %32
%34 = load i32, i32* %6
%35 = add nsw i32 %33, %34
%36 = load i32, i32* %7
%37 = sub nsw i32 %35, %36
%38 = load i32, i32* %8
%39 = sub nsw i32 %37, %38
ret i32 %39
}

LLVM IR (-O2):
define i32 @mid_pred(i32 %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %1, %0
%5 = select i1 %4, i32 %1, i32 %0
%6 = select i1 %4, i32 %0, i32 %1
%7 = icmp sgt i32 %5, %2
%8 = icmp slt i32 %6, %2
%9 = select i1 %8, i32 %2, i32 %6
%10 = select i1 %7, i32 %2, i32 %5
%11 = select i1 %7, i32 %6, i32 %9
%12 = add i32 %1, %0
%13 = add i32 %12, %2
%14 = add i32 %10, %11
%15 = sub i32 %13, %14
ret i32 %15
}