xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int lmsc_get_page_size();
int lmsc_xget_page_size(void) {
  int s = lmsc_get_page_size();
  if (s < 0) {
    exit(1);
  }
  return s;
}


x86 assembly (clang, -O0):
<lmsc_xget_page_size>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <lmsc_get_page_size@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    1146 <lmsc_xget_page_size+0x26>
mov    $0x1,%edi
call   1040 <exit@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lmsc_xget_page_size>:
push   %rax
xor    %eax,%eax
call   1030 <lmsc_get_page_size@plt>
test   %eax,%eax
js     112e <lmsc_xget_page_size+0xe>
pop    %rcx
ret
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define i32 @lmsc_xget_page_size() {
%1 = alloca i32
%2 = call i32 (...) @lmsc_get_page_size()
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = icmp slt i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %0
%6 = call i32 @exit(i32 1)
unreachable
7: ; preds = %0
%8 = load i32, i32* %1
ret i32 %8
}

LLVM IR (-O2):
define i32 @lmsc_xget_page_size() {
%1 = tail call i32 (...) @lmsc_get_page_size()
%2 = icmp slt i32 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 @exit(i32 1)
unreachable
5: ; preds = %0
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int prc_b1(int a) {
  a = a - 10;
  printf("a-10 [%d]\n", a);
  return a;
}


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

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

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

LLVM IR (-O2):
@.str = [11 x i8] c"a-10 [%d]\0A\00"
define i32 @prc_b1(i32 %0) {
%2 = add nsw i32 %0, -10
%3 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %2)
ret i32 %2
}
/* Variables and functions */
int kwait(int *);
int /*<<< orphan*/ printf(char *, int, int);
void do_wait() {
  int status;
  int cid;
  while ((cid = kwait(&status)) != -1) {
    printf("Done waiting for %d, returned status %d\n", cid, status);
  }
}


x86 assembly (clang, -O0):
<do_wait>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x4(%rbp),%rdi
call   1040 <kwait@plt>
mov    %eax,-0x8(%rbp)
cmp    $0xffffffff,%eax
je     1154 <do_wait+0x34>
mov    -0x8(%rbp),%esi
mov    -0x4(%rbp),%edx
lea    0xeb6(%rip),%rdi
call   1030 <printf@plt>
jmp    1128 <do_wait+0x8>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_wait>:
push   %r14
push   %rbx
push   %rax
lea    0x4(%rsp),%rdi
call   1040 <kwait@plt>
cmp    $0xffffffff,%eax
je     115b <do_wait+0x3b>
lea    0xec6(%rip),%r14
lea    0x4(%rsp),%rbx
nop
mov    0x4(%rsp),%edx
mov    %r14,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
call   1040 <kwait@plt>
cmp    $0xffffffff,%eax
jne    1140 <do_wait+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [41 x i8] c"Done waiting for %d, returned status %d\0A\00"
define void @do_wait() {
%1 = alloca i32
%2 = alloca i32
br label %3
3: ; preds = %6, %0
%4 = call i32 @kwait(i32* %1)
store i32 %4, i32* %2
%5 = icmp ne i32 %4, -1
br i1 %5, label %6, label %10
6: ; preds = %3
%7 = load i32, i32* %2
%8 = load i32, i32* %1
%9 = call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0), i32 %7, i32 %8)
br label %3
10: ; preds = %3
ret void
}

LLVM IR (-O2):
@.str = [41 x i8] c"Done waiting for %d, returned status %d\0A\00"
define void @do_wait() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @kwait(i32* %1)
%4 = icmp eq i32 %3, -1
br i1 %4, label %11, label %5
5: ; preds = %0, %5
%6 = phi i32 [ %9, %5 ], [ %3, %0 ]
%7 = load i32, i32* %1
%8 = call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0), i32 %6, i32 %7)
%9 = call i32 @kwait(i32* %1)
%10 = icmp eq i32 %9, -1
br i1 %10, label %11, label %5
11: ; preds = %5, %0
ret void
}
int main(void) {
  char *ptr;
  char *ptr2;
  {
    char my_char[9];
    ptr = &my_char[0];
    __builtin_memcpy(&ptr2, &ptr, sizeof(ptr2));
  }
  *(ptr2 + 9) = 'c';
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
lea    -0x19(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movb   $0x63,0x9(%rax)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i8*
%2 = alloca i8*
%3 = alloca [9 x i8]
%4 = getelementptr inbounds [9 x i8], [9 x i8]* %3, i64 0, i64 0
store i8* %4, i8** %1
%5 = bitcast i8** %2 to i8*
%6 = bitcast i8** %1 to i8*
%7 = load i8*, i8** %2
%8 = getelementptr inbounds i8, i8* %7, i64 9
store i8 99, i8* %8
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int EOF;
int /*<<< orphan*/ printf(char *, int);
int main() {
  printf("EOF的值： %d\n", EOF);
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [17 x i8] c"EOF\E7\9A\84\E5\80\BC\EF\BC\9A %d\0A\00"
@EOF = global i32 0
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = load i32, i32* @EOF
%3 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %2)
ret i32 0
}

LLVM IR (-O2):
@.str = [17 x i8] c"EOF\E7\9A\84\E5\80\BC\EF\BC\9A %d\0A\00"
@EOF = global i32 0
define i32 @main() {
%1 = load i32, i32* @EOF
%2 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
float ADC_Voltage(unsigned int adcvalue) {
  const float popugai = (3.283 / 1.603) / 4095;
  const int adczero = 186;
  return (adcvalue - adczero) * popugai;
}


x86 assembly (clang, -O0):
<ADC_Voltage>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x3a031b33,-0x8(%rbp)
movl   $0xba,-0xc(%rbp)
mov    -0x4(%rbp),%eax
add    $0xffffff46,%eax
cvtsi2ss %rax,%xmm0
movss  0xed6(%rip),%xmm1
mulss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<ADC_Voltage>:
add    $0xffffff46,%edi
cvtsi2ss %rdi,%xmm0
mulss  0xeed(%rip),%xmm0
ret

LLVM IR (-O0):
define float @ADC_Voltage(i32 %0) {
%2 = alloca i32
%3 = alloca float
%4 = alloca i32
store i32 %0, i32* %2
store float 0x3F40636660000000, float* %3
store i32 186, i32* %4
%5 = load i32, i32* %2
%6 = sub i32 %5, 186
%7 = uitofp i32 %6 to float
%8 = fmul float %7, 0x3F40636660000000
ret float %8
}

LLVM IR (-O2):
define float @ADC_Voltage(i32 %0) {
%2 = add i32 %0, -186
%3 = uitofp i32 %2 to float
%4 = fmul float %3, 0x3F40636660000000
ret float %4
}
/* Type definitions */
struct perf_event_attr {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ __NR_perf_event_open;
int syscall(int /*<<< orphan*/, struct perf_event_attr *, int, int, int,
            unsigned long);
int perf_event_open(struct perf_event_attr *attr, int pid, int cpu,
                    int group_fd, unsigned long flags) {
  return syscall(__NR_perf_event_open, attr, pid, cpu, group_fd, flags);
}


x86 assembly (clang, -O0):
<perf_event_open>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8,-0x20(%rbp)
mov    0x2eb0(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
mov    -0x14(%rbp),%r8d
mov    -0x20(%rbp),%r9
call   1030 <syscall@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<perf_event_open>:
mov    %r8,%r9
mov    %ecx,%r8d
mov    %edx,%ecx
mov    %esi,%edx
mov    %rdi,%rsi
mov    0x2ebc(%rip),%rax
mov    (%rax),%edi
jmp    1030 <syscall@plt>

LLVM IR (-O0):
%struct.perf_event_attr = type { i32 }
@__NR_perf_event_open = global i32 0
define i32 @perf_event_open(%struct.perf_event_attr* %0, i32 %1, i32 %2, i32 %3, i64 %4) {
%6 = alloca %struct.perf_event_attr*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i64
store %struct.perf_event_attr* %0, %struct.perf_event_attr** %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i64 %4, i64* %10
%11 = load i32, i32* @__NR_perf_event_open
%12 = load %struct.perf_event_attr*, %struct.perf_event_attr** %6
%13 = load i32, i32* %7
%14 = load i32, i32* %8
%15 = load i32, i32* %9
%16 = load i64, i64* %10
%17 = call i32 @syscall(i32 %11, %struct.perf_event_attr* %12, i32 %13, i32 %14, i32 %15, i64 %16)
ret i32 %17
}

LLVM IR (-O2):
%struct.perf_event_attr = type { i32 }
@__NR_perf_event_open = global i32 0
define i32 @perf_event_open(%struct.perf_event_attr* %0, i32 %1, i32 %2, i32 %3, i64 %4) {
%6 = load i32, i32* @__NR_perf_event_open
%7 = tail call i32 @syscall(i32 %6, %struct.perf_event_attr* %0, i32 %1, i32 %2, i32 %3, i64 %4)
ret i32 %7
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_attr_t;

/* Variables and functions */
int pthread_attr_destroy(pthread_attr_t *attr) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @pthread_attr_destroy(i32* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
char *strtok(char *, char const *);
int wordCount(char *str, const char *delimiters) {
  int result = 0;
  char *token = strtok(str, delimiters);
  if (token != NULL) {
    result++;
    while (strtok(NULL, delimiters) != NULL) {
      result++;
    }
  }
  return result;
}


x86 assembly (clang, -O0):
<wordCount>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strtok@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     1176 <wordCount+0x66>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%edi
call   1030 <strtok@plt>
cmp    $0x0,%rax
je     1171 <wordCount+0x61>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    114c <wordCount+0x3c>
jmp    1176 <wordCount+0x66>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wordCount>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
call   1030 <strtok@plt>
xor    %ebx,%ebx
test   %rax,%rax
je     1142 <wordCount+0x32>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
xor    %edi,%edi
mov    %r14,%rsi
call   1030 <strtok@plt>
add    $0x1,%ebx
test   %rax,%rax
jne    1130 <wordCount+0x20>
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i32 @wordCount(i8* %0, i8* nocapture %1) {
%3 = tail call i8* @strtok(i8* %0, i8* %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %10, label %5
5: ; preds = %2, %5
%6 = phi i32 [ %9, %5 ], [ 1, %2 ]
%7 = tail call i8* @strtok(i8* null, i8* %1)
%8 = icmp eq i8* %7, null
%9 = add nuw nsw i32 %6, 1
br i1 %8, label %10, label %5
10: ; preds = %5, %2
%11 = phi i32 [ 0, %2 ], [ %6, %5 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ gen_emit_impl(int, char *, char const *);
void gen_label(const char *label) {
  gen_emit_impl(454,
                "\t"
                "%s:",
                label);
}


x86 assembly (clang, -O0):
<gen_label>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
mov    $0x1c6,%edi
lea    0xed4(%rip),%rsi
call   1030 <gen_emit_impl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gen_label>:
mov    %rdi,%rdx
lea    0xee6(%rip),%rsi
mov    $0x1c6,%edi
jmp    1030 <gen_emit_impl@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"\09%s:\00"
define void @gen_label(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @gen_emit_impl(i32 454, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"\09%s:\00"
define void @gen_label(i8* %0) {
%2 = tail call i32 @gen_emit_impl(i32 454, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
void HAL_ADC_Powerdown(void) {}


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

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

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

LLVM IR (-O2):
define void @HAL_ADC_Powerdown() {
ret void
}
void I420ToARGB() {}


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

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

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

LLVM IR (-O2):
define void @I420ToARGB() {
ret void
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ s_addr;
};
struct sockaddr_in {
  TYPE_1__ sin_addr;
};

/* Variables and functions */
int /*<<< orphan*/ get_myaddress(struct sockaddr_in *);
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  int test_status = 1;
  struct sockaddr_in sin;
  sin.sin_addr.s_addr = 0;
  get_myaddress(&sin);
  test_status = (sin.sin_addr.s_addr == 0);
  printf("%d\n", test_status);
  return test_status;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
lea    -0x10(%rbp),%rdi
call   1040 <get_myaddress@plt>
cmpq   $0x0,-0x10(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xe9f(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
movq   $0x0,0x8(%rsp)
lea    0x8(%rsp),%rdi
call   1040 <get_myaddress@plt>
xor    %ebx,%ebx
cmpq   $0x0,0x8(%rsp)
sete   %bl
lea    0xeb6(%rip),%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
mov    %ebx,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.sockaddr_in = type { %struct.TYPE_2__ }
%struct.TYPE_2__ = type { i64 }
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca %struct.sockaddr_in
store i32 0, i32* %1
store i32 1, i32* %2
%4 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %3, i32 0, i32 0
%5 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %4, i32 0, i32 0
store i64 0, i64* %5
%6 = call i32 @get_myaddress(%struct.sockaddr_in* %3)
%7 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %3, i32 0, i32 0
%8 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %7, i32 0, i32 0
%9 = load i64, i64* %8
%10 = icmp eq i64 %9, 0
%11 = zext i1 %10 to i32
store i32 %11, i32* %2
%12 = load i32, i32* %2
%13 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %12)
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
%struct.sockaddr_in = type { %struct.TYPE_2__ }
%struct.TYPE_2__ = type { i64 }
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca %struct.sockaddr_in
%2 = bitcast %struct.sockaddr_in* %1 to i8*
%3 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %1, i64 0, i32 0, i32 0
store i64 0, i64* %3
%4 = call i32 @get_myaddress(%struct.sockaddr_in* %1)
%5 = load i64, i64* %3
%6 = icmp eq i64 %5, 0
%7 = zext i1 %6 to i32
%8 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %7)
ret i32 %7
}
void __ev_done(void) { return; }


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

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

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

LLVM IR (-O2):
define void @__ev_done() {
ret void
}
/* Variables and functions */
int create_server(char const *, int const, int, int const);
int create_server_tcp(const char *port, const int family, const int flags) {
  return create_server(port, family, 0x01, flags);
}


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

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

LLVM IR (-O0):
define i32 @create_server_tcp(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 @create_server(i8* %7, i32 %8, i32 1, i32 %9)
ret i32 %10
}

LLVM IR (-O2):
define i32 @create_server_tcp(i8* %0, i32 %1, i32 %2) {
%4 = tail call i32 @create_server(i8* %0, i32 %1, i32 1, i32 %2)
ret i32 %4
}
/* Type definitions */
struct mc_request {
  int dummy;
};

/* Variables and functions */
int mconsole_reply_len(struct mc_request *, char const *, int /*<<< orphan*/,
                       int, int);
int /*<<< orphan*/ strlen(char const *);
int mconsole_reply(struct mc_request *req, const char *str, int err, int more) {
  return mconsole_reply_len(req, str, strlen(str), err, more);
}


x86 assembly (clang, -O0):
<mconsole_reply>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x28(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    %eax,%edx
mov    -0x14(%rbp),%ecx
mov    -0x18(%rbp),%r8d
call   1040 <mconsole_reply_len@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mconsole_reply>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %ecx,%r14d
mov    %edx,%r15d
mov    %rsi,%rbx
mov    %rdi,%rbp
mov    %rsi,%rdi
call   1030 <strlen@plt>
mov    %rbp,%rdi
mov    %rbx,%rsi
mov    %eax,%edx
mov    %r15d,%ecx
mov    %r14d,%r8d
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <mconsole_reply_len@plt>

LLVM IR (-O0):
%struct.mc_request = type { i32 }
define i32 @mconsole_reply(%struct.mc_request* %0, i8* %1, i32 %2, i32 %3) {
%5 = alloca %struct.mc_request*
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i32
store %struct.mc_request* %0, %struct.mc_request** %5
store i8* %1, i8** %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load %struct.mc_request*, %struct.mc_request** %5
%10 = load i8*, i8** %6
%11 = load i8*, i8** %6
%12 = call i32 @strlen(i8* %11)
%13 = load i32, i32* %7
%14 = load i32, i32* %8
%15 = call i32 @mconsole_reply_len(%struct.mc_request* %9, i8* %10, i32 %12, i32 %13, i32 %14)
ret i32 %15
}

LLVM IR (-O2):
%struct.mc_request = type { i32 }
define i32 @mconsole_reply(%struct.mc_request* %0, i8* %1, i32 %2, i32 %3) {
%5 = tail call i32 @strlen(i8* %1)
%6 = tail call i32 @mconsole_reply_len(%struct.mc_request* %0, i8* %1, i32 %5, i32 %2, i32 %3)
ret i32 %6
}
/* Type definitions */
typedef int __le16;

/* Variables and functions */
int cpu_to_le16(int);
int ieee80211_is_reassoc_req(__le16 fc) {
  return (fc & cpu_to_le16(0x000c | 0x00f0)) == cpu_to_le16(0x0000 | 0x0020);
}


x86 assembly (clang, -O0):
<ieee80211_is_reassoc_req>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    $0xfc,%edi
call   1030 <cpu_to_le16@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
and    %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    $0x20,%edi
call   1030 <cpu_to_le16@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%eax
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ieee80211_is_reassoc_req>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
mov    $0xfc,%edi
call   1030 <cpu_to_le16@plt>
mov    %eax,%ebp
and    %ebx,%ebp
mov    $0x20,%edi
call   1030 <cpu_to_le16@plt>
xor    %ecx,%ecx
cmp    %eax,%ebp
sete   %cl
mov    %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @ieee80211_is_reassoc_req(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @cpu_to_le16(i32 252)
%5 = and i32 %3, %4
%6 = call i32 @cpu_to_le16(i32 32)
%7 = icmp eq i32 %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @ieee80211_is_reassoc_req(i32 %0) {
%2 = tail call i32 @cpu_to_le16(i32 252)
%3 = and i32 %2, %0
%4 = tail call i32 @cpu_to_le16(i32 32)
%5 = icmp eq i32 %3, %4
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
int strncmp(char const *, char const *, int);
int g_strncmp(const char *c1, const char *c2, int len) {
  return strncmp(c1, c2, len);
}


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

x86 assembly (clang, -O2):
<g_strncmp>:
jmp    1030 <strncmp@plt>

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

LLVM IR (-O2):
define i32 @g_strncmp(i8* %0, i8* %1, i32 %2) {
%4 = tail call i32 @strncmp(i8* %0, i8* %1, i32 %2)
ret i32 %4
}
void main(void) {
  int a;
  a = 18;
}


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

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

LLVM IR (-O0):
define void @main() {
%1 = alloca i32
store i32 18, i32* %1
ret void
}

LLVM IR (-O2):
define void @main() {
ret void
}
/* Variables and functions */
int aaa();
int bbb() { return aaa(); }


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

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

LLVM IR (-O0):
define i32 @bbb() {
%1 = call i32 (...) @aaa()
ret i32 %1
}

LLVM IR (-O2):
define i32 @bbb() {
%1 = tail call i32 (...) @aaa()
ret i32 %1
}
extern double divide(int a, int b) { return (double)a / b; }


x86 assembly (clang, -O0):
<divide>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cvtsi2sdl -0x4(%rbp),%xmm0
cvtsi2sdl -0x8(%rbp),%xmm1
divsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<divide>:
cvtsi2sd %edi,%xmm0
cvtsi2sd %esi,%xmm1
divsd  %xmm1,%xmm0
ret

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

LLVM IR (-O2):
define double @divide(i32 %0, i32 %1) {
%3 = sitofp i32 %0 to double
%4 = sitofp i32 %1 to double
%5 = fdiv double %3, %4
ret double %5
}
/* Variables and functions */
int /*<<< orphan*/ clrtoeol();
int curs_clrtoeol() { clrtoeol(); }


x86 assembly (clang, -O0):
<curs_clrtoeol>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <clrtoeol@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @curs_clrtoeol() {
%1 = alloca i32
%2 = call i32 (...) @clrtoeol()
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
define i32 @curs_clrtoeol() {
%1 = tail call i32 (...) @clrtoeol()
ret i32 undef
}
/* Type definitions */
struct asColumn {
  int dummy;
};

/* Variables and functions */
int asColumnFindIx(struct asColumn *, char *);
int /*<<< orphan*/ errAbort(char *, char *);
int asColumnMustFindIx(struct asColumn *list, char *name) {
  int ix = asColumnFindIx(list, name);
  if (ix < 0)
    errAbort("asColumnMustFindIx: cannot find column \"%s\" in list", name);
  return ix;
}


x86 assembly (clang, -O0):
<asColumnMustFindIx>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <asColumnFindIx@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jge    115a <asColumnMustFindIx+0x3a>
mov    -0x10(%rbp),%rsi
lea    0xeab(%rip),%rdi
call   1040 <errAbort@plt>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<asColumnMustFindIx>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
call   1030 <asColumnFindIx@plt>
mov    %eax,%ebp
test   %eax,%eax
jns    1140 <asColumnMustFindIx+0x20>
lea    0xec8(%rip),%rdi
mov    %rbx,%rsi
call   1040 <errAbort@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
%struct.asColumn = type { i32 }
@.str = [52 x i8] c"asColumnMustFindIx: cannot find column \22%s\22 in list\00"
define i32 @asColumnMustFindIx(%struct.asColumn* %0, i8* %1) {
%3 = alloca %struct.asColumn*
%4 = alloca i8*
%5 = alloca i32
store %struct.asColumn* %0, %struct.asColumn** %3
store i8* %1, i8** %4
%6 = load %struct.asColumn*, %struct.asColumn** %3
%7 = load i8*, i8** %4
%8 = call i32 @asColumnFindIx(%struct.asColumn* %6, i8* %7)
store i32 %8, i32* %5
%9 = load i32, i32* %5
%10 = icmp slt i32 %9, 0
br i1 %10, label %11, label %14
11: ; preds = %2
%12 = load i8*, i8** %4
%13 = call i32 @errAbort(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0), i8* %12)
br label %14
14: ; preds = %11, %2
%15 = load i32, i32* %5
ret i32 %15
}

LLVM IR (-O2):
%struct.asColumn = type { i32 }
@.str = [52 x i8] c"asColumnMustFindIx: cannot find column \22%s\22 in list\00"
define i32 @asColumnMustFindIx(%struct.asColumn* %0, i8* %1) {
%3 = tail call i32 @asColumnFindIx(%struct.asColumn* %0, i8* %1)
%4 = icmp slt i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @errAbort(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0), i8* %1)
br label %7
7: ; preds = %5, %2
ret i32 %3
}
/* Variables and functions */
int get_rand(int, int);
int gr_dir() {
  int d;
  d = get_rand(1, 8);
  switch (d) {
  case 1:
    d = 'j';
    break;
  case 2:
    d = 'k';
    break;
  case 3:
    d = 'l';
    break;
  case 4:
    d = 'h';
    break;
  case 5:
    d = 'y';
    break;
  case 6:
    d = 'u';
    break;
  case 7:
    d = 'b';
    break;
  case 8:
    d = 'n';
    break;
  }
  return (d);
}


x86 assembly (clang, -O0):
<gr_dir>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x1,%edi
mov    $0x8,%esi
call   1030 <get_rand@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0x7,%eax
ja     11ae <gr_dir+0x9e>
mov    -0x10(%rbp),%rax
lea    0xeb6(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movl   $0x6a,-0x4(%rbp)
jmp    11ae <gr_dir+0x9e>
movl   $0x6b,-0x4(%rbp)
jmp    11ae <gr_dir+0x9e>
movl   $0x6c,-0x4(%rbp)
jmp    11ae <gr_dir+0x9e>
movl   $0x68,-0x4(%rbp)
jmp    11ae <gr_dir+0x9e>
movl   $0x79,-0x4(%rbp)
jmp    11ae <gr_dir+0x9e>
movl   $0x75,-0x4(%rbp)
jmp    11ae <gr_dir+0x9e>
movl   $0x62,-0x4(%rbp)
jmp    11ae <gr_dir+0x9e>
movl   $0x6e,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gr_dir>:
push   %rax
mov    $0x1,%edi
mov    $0x8,%esi
call   1030 <get_rand@plt>
mov    %eax,%ecx
add    $0xffffffff,%ecx
cmp    $0x7,%ecx
ja     1137 <gr_dir+0x27>
movslq %ecx,%rax
lea    0xecc(%rip),%rcx
mov    (%rcx,%rax,4),%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @gr_dir() {
%1 = alloca i32
%2 = call i32 @get_rand(i32 1, i32 8)
store i32 %2, i32* %1
%3 = load i32, i32* %1
switch i32 %3, label %12 [
i32 1, label %4
i32 2, label %5
i32 3, label %6
i32 4, label %7
i32 5, label %8
i32 6, label %9
i32 7, label %10
i32 8, label %11
]
4: ; preds = %0
store i32 106, i32* %1
br label %12
5: ; preds = %0
store i32 107, i32* %1
br label %12
6: ; preds = %0
store i32 108, i32* %1
br label %12
7: ; preds = %0
store i32 104, i32* %1
br label %12
8: ; preds = %0
store i32 121, i32* %1
br label %12
9: ; preds = %0
store i32 117, i32* %1
br label %12
10: ; preds = %0
store i32 98, i32* %1
br label %12
11: ; preds = %0
store i32 110, i32* %1
br label %12
12: ; preds = %0, %11, %10, %9, %8, %7, %6, %5, %4
%13 = load i32, i32* %1
ret i32 %13
}

LLVM IR (-O2):
@switch.table.gr_dir = [8 x i32] [i32 106, i32 107, i32 108, i32 104, i32 121, i32 117, i32 98, i32 110]
define i32 @gr_dir() {
%1 = tail call i32 @get_rand(i32 1, i32 8)
%2 = add i32 %1, -1
%3 = icmp ult i32 %2, 8
br i1 %3, label %4, label %8
4: ; preds = %0
%5 = sext i32 %2 to i64
%6 = getelementptr inbounds [8 x i32], [8 x i32]* @switch.table.gr_dir, i64 0, i64 %5
%7 = load i32, i32* %6
br label %8
8: ; preds = %4, %0
%9 = phi i32 [ %1, %0 ], [ %7, %4 ]
ret i32 %9
}
int isValidKeyChar(char ch) {
  return (ch >= 'A' && ch <= 'Z') || (ch >= 'a' && ch <= 'z') ||
         (ch >= '0' && ch <= '9') || ch == '-' || ch == '~';
}


x86 assembly (clang, -O0):
<isValidKeyChar>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x41,%eax
jl     1129 <isValidKeyChar+0x29>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x5a,%ecx
mov    %al,-0x2(%rbp)
jle    1186 <isValidKeyChar+0x86>
movsbl -0x1(%rbp),%eax
cmp    $0x61,%eax
jl     1148 <isValidKeyChar+0x48>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x7a,%ecx
mov    %al,-0x2(%rbp)
jle    1186 <isValidKeyChar+0x86>
movsbl -0x1(%rbp),%eax
cmp    $0x30,%eax
jl     1167 <isValidKeyChar+0x67>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x39,%ecx
mov    %al,-0x2(%rbp)
jle    1186 <isValidKeyChar+0x86>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x2d,%ecx
mov    %al,-0x2(%rbp)
je     1186 <isValidKeyChar+0x86>
movsbl -0x1(%rbp),%eax
cmp    $0x7e,%eax
sete   %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isValidKeyChar>:
mov    %edi,%ecx
and    $0xdf,%cl
add    $0xbf,%cl
mov    $0x1,%eax
cmp    $0x1a,%cl
jb     1129 <isValidKeyChar+0x29>
cmp    $0x2d,%dil
je     1129 <isValidKeyChar+0x29>
lea    -0x30(%rdi),%ecx
cmp    $0xa,%cl
jb     1129 <isValidKeyChar+0x29>
xor    %eax,%eax
cmp    $0x7e,%dil
sete   %al
ret

LLVM IR (-O0):
define i32 @isValidKeyChar(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp sge i32 %4, 65
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp sle i32 %8, 90
br i1 %9, label %34, label %10
10: ; preds = %6, %1
%11 = load i8, i8* %2
%12 = sext i8 %11 to i32
%13 = icmp sge i32 %12, 97
br i1 %13, label %14, label %18
14: ; preds = %10
%15 = load i8, i8* %2
%16 = sext i8 %15 to i32
%17 = icmp sle i32 %16, 122
br i1 %17, label %34, label %18
18: ; preds = %14, %10
%19 = load i8, i8* %2
%20 = sext i8 %19 to i32
%21 = icmp sge i32 %20, 48
br i1 %21, label %22, label %26
22: ; preds = %18
%23 = load i8, i8* %2
%24 = sext i8 %23 to i32
%25 = icmp sle i32 %24, 57
br i1 %25, label %34, label %26
26: ; preds = %22, %18
%27 = load i8, i8* %2
%28 = sext i8 %27 to i32
%29 = icmp eq i32 %28, 45
br i1 %29, label %34, label %30
30: ; preds = %26
%31 = load i8, i8* %2
%32 = sext i8 %31 to i32
%33 = icmp eq i32 %32, 126
br label %34
34: ; preds = %30, %26, %22, %14, %6
%35 = phi i1 [ true, %26 ], [ true, %22 ], [ true, %14 ], [ true, %6 ], [ %33, %30 ]
%36 = zext i1 %35 to i32
ret i32 %36
}

LLVM IR (-O2):
define i32 @isValidKeyChar(i8 signext %0) {
%2 = and i8 %0, -33
%3 = add i8 %2, -65
%4 = icmp ult i8 %3, 26
br i1 %4, label %13, label %5
5: ; preds = %1
%6 = add i8 %0, -48
%7 = icmp ult i8 %6, 10
%8 = icmp eq i8 %0, 45
%9 = or i1 %8, %7
br i1 %9, label %13, label %10
10: ; preds = %5
%11 = icmp eq i8 %0, 126
%12 = zext i1 %11 to i32
br label %13
13: ; preds = %5, %1, %10
%14 = phi i32 [ %12, %10 ], [ 1, %1 ], [ 1, %5 ]
ret i32 %14
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ isprint(int);
void t_isprint_0x2c() {
  Assert_real((isprint(44)),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isprint.c",
              225, ("isprint should be 1 for ,"));
}


x86 assembly (clang, -O0):
<t_isprint_0x2c>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2c,%edi
call   1030 <isprint@plt>
mov    %eax,%edi
lea    0xec9(%rip),%rsi
mov    $0xe1,%edx
lea    0xf65(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isprint_0x2c>:
push   %rax
mov    $0x2c,%edi
call   1030 <isprint@plt>
lea    0xece(%rip),%rsi
lea    0xf6f(%rip),%rcx
mov    %eax,%edi
mov    $0xe1,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isprint.c\00"
@.str.1 = [26 x i8] c"isprint should be 1 for ,\00"
define void @t_isprint_0x2c() {
%1 = call i32 @isprint(i32 44)
%2 = call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 225, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isprint.c\00"
@.str.1 = [26 x i8] c"isprint should be 1 for ,\00"
define void @t_isprint_0x2c() {
%1 = tail call i32 @isprint(i32 44)
%2 = tail call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 225, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int strsize(char str[]) {
  int i = 0;
  while (str[i++] != '\0')
    ;
  return i - 1;
}


x86 assembly (clang, -O0):
<strsize>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
mov    %ecx,%edx
add    $0x1,%edx
mov    %edx,-0xc(%rbp)
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1133 <strsize+0x33>
jmp    110f <strsize+0xf>
mov    -0xc(%rbp),%eax
sub    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strsize>:
mov    $0xffffffff,%eax
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%eax
cmpb   $0x0,(%rdi)
lea    0x1(%rdi),%rdi
jne    1110 <strsize+0x10>
ret

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

LLVM IR (-O2):
define i32 @strsize(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ %4, %2 ], [ 0, %1 ]
%4 = add nuw i64 %3, 1
%5 = getelementptr inbounds i8, i8* %0, i64 %3
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 0
br i1 %7, label %8, label %2
8: ; preds = %2
%9 = trunc i64 %3 to i32
ret i32 %9
}
/* Variables and functions */
double sin(double);
double my_sin(double num) { return sin(num); }


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

x86 assembly (clang, -O2):
<my_sin>:
jmp    1030 <sin@plt>

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

LLVM IR (-O2):
define double @my_sin(double %0) {
%2 = tail call double @sin(double %0)
ret double %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char *argv[]) {
#pragma omp parallel
  { printf("I am a parallel region\n"); }
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [24 x i8] c"I am a parallel region\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [23 x i8] c"I am a parallel region\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str, i64 0, i64 0))
ret i32 0
}
float plus(float x, float y) {
  float z;
  z = x + y;
  return (z);
}


x86 assembly (clang, -O0):
<plus>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
addss  -0x8(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<plus>:
addss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @plus(float %0, float %1) {
%3 = alloca float
%4 = alloca float
%5 = alloca float
store float %0, float* %3
store float %1, float* %4
%6 = load float, float* %3
%7 = load float, float* %4
%8 = fadd float %6, %7
store float %8, float* %5
%9 = load float, float* %5
ret float %9
}

LLVM IR (-O2):
define float @plus(float %0, float %1) {
%3 = fadd float %0, %1
ret float %3
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
long ulimit(int, long);
main() {
  long maxfds = ulimit(4, 0L);
  exit(maxfds == -1L);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x4,%edi
xor    %eax,%eax
mov    %eax,%esi
call   1040 <ulimit@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0xffffffffffffffff,-0x10(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x4,%edi
xor    %esi,%esi
call   1040 <ulimit@plt>
xor    %edi,%edi
cmp    $0xffffffffffffffff,%rax
sete   %dil
call   1030 <exit@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i64
store i32 0, i32* %1
%3 = call i64 @ulimit(i32 4, i64 0)
store i64 %3, i64* %2
%4 = load i64, i64* %2
%5 = icmp eq i64 %4, -1
%6 = zext i1 %5 to i32
%7 = call i32 @exit(i32 %6)
unreachable
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i64 @ulimit(i32 4, i64 0)
%2 = icmp eq i64 %1, -1
%3 = zext i1 %2 to i32
%4 = tail call i32 @exit(i32 %3)
unreachable
}
/* Variables and functions */
int PIPE_BUF;
int pipe_buffer_size(int fd) {
  int r;
  r = PIPE_BUF;
  return r;
}


x86 assembly (clang, -O0):
<pipe_buffer_size>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    0x2ed2(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@PIPE_BUF = global i32 0
define i32 @pipe_buffer_size(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* @PIPE_BUF
store i32 %4, i32* %3
%5 = load i32, i32* %3
ret i32 %5
}

LLVM IR (-O2):
@PIPE_BUF = global i32 0
define i32 @pipe_buffer_size(i32 %0) {
%2 = load i32, i32* @PIPE_BUF
ret i32 %2
}
void arch_local_irq_enable(void) {}


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

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

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

LLVM IR (-O2):
define void @arch_local_irq_enable() {
ret void
}
int isprime(int n) {}


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

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

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

LLVM IR (-O2):
define i32 @isprime(i32 %0) {
ret i32 undef
}
/* Variables and functions */
int close(int);
int /*<<< orphan*/ errExit(char *);
void closeFile(int fd) {
  if (close(fd) == -1)
    errExit("Close");
}


x86 assembly (clang, -O0):
<closeFile>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <close@plt>
cmp    $0xffffffff,%eax
jne    1148 <closeFile+0x28>
lea    0xebd(%rip),%rdi
call   1030 <errExit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<closeFile>:
push   %rax
call   1040 <close@plt>
cmp    $0xffffffff,%eax
je     112d <closeFile+0xd>
pop    %rax
ret
lea    0xecc(%rip),%rdi
pop    %rax
jmp    1030 <errExit@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"Close\00"
define void @closeFile(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @close(i32 %3)
%5 = icmp eq i32 %4, -1
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = call i32 @errExit(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %1
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"Close\00"
define void @closeFile(i32 %0) {
%2 = tail call i32 @close(i32 %0)
%3 = icmp eq i32 %2, -1
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @errExit(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %1
ret void
}
/* Variables and functions */
int strtol(char const *, int /*<<< orphan*/, int);
int atoi(const char *str) { return strtol(str, 0, 10); }


x86 assembly (clang, -O0):
<atoi>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
xor    %esi,%esi
mov    $0xa,%edx
call   1030 <strtol@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<atoi>:
xor    %esi,%esi
mov    $0xa,%edx
jmp    1030 <strtol@plt>

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

LLVM IR (-O2):
define i32 @atoi(i8* %0) {
%2 = tail call i32 @strtol(i8* %0, i32 0, i32 10)
ret i32 %2
}
float *test_func_00(float *p, float c) {
  *--p = c;
  *--p = c;
  return p;
}


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0xfffffffffffffffc,%rcx
mov    %rcx,-0x8(%rbp)
movss  %xmm0,-0x4(%rax)
movss  -0xc(%rbp),%xmm0
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0xfffffffffffffffc,%rcx
mov    %rcx,-0x8(%rbp)
movss  %xmm0,-0x4(%rax)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
movss  %xmm0,-0x4(%rdi)
movss  %xmm0,-0x8(%rdi)
lea    -0x8(%rdi),%rax
ret

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

LLVM IR (-O2):
define float* @test_func_00(float* writeonly %0, float %1) {
%3 = getelementptr inbounds float, float* %0, i64 -1
store float %1, float* %3
%4 = getelementptr inbounds float, float* %0, i64 -2
store float %1, float* %4
ret float* %4
}
/* Variables and functions */
scalar_t__ strcmp(void *, void *);
int string_equals(void *a, void *b) { return strcmp(a, b) == 0; }


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

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

LLVM IR (-O0):
define i32 @string_equals(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = call i64 @strcmp(i8* %5, i8* %6)
%8 = icmp eq i64 %7, 0
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @string_equals(i8* %0, i8* %1) {
%3 = tail call i64 @strcmp(i8* %0, i8* %1)
%4 = icmp eq i64 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
int test_imm_6Buint64_lowword_reg(unsigned long long val) {
  return ((val) & (0x6B << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_6Buint64_lowword_reg(i64 %0) {
%2 = and i64 %0, 107
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
uintptr_t pgm_read_pointer(const void *s) { return *(const uintptr_t *)s; }


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

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

LLVM IR (-O0):
define i64 @pgm_read_pointer(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to i64*
%5 = load i64, i64* %4
ret i64 %5
}

LLVM IR (-O2):
define i64 @pgm_read_pointer(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
ret i64 %3
}