xunge/DecIR huggingface dataset:
/* Variables and functions */
unsigned char eeread(int);
int /*<<< orphan*/ eewrite(int /*<<< orphan*/, unsigned char);
int erasestr(int addr) {
  for (;;) {
    unsigned char c = eeread(addr);
    if (c == ((unsigned char)255))
      return addr;
    eewrite(addr++, ((unsigned char)255));
    if (!c)
      return addr;
  }
}


x86 assembly (clang, -O0):
<erasestr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1040 <eeread@plt>
mov    %al,-0x9(%rbp)
movzbl -0x9(%rbp),%eax
cmp    $0xff,%eax
jne    1150 <erasestr+0x30>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    117f <erasestr+0x5f>
mov    -0x8(%rbp),%edi
mov    %edi,%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    $0xff,%esi
call   1030 <eewrite@plt>
cmpb   $0x0,-0x9(%rbp)
jne    117a <erasestr+0x5a>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    117f <erasestr+0x5f>
jmp    112b <erasestr+0xb>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<erasestr>:
push   %rbp
push   %r14
push   %rbx
mov    %edi,%ebp
cs nopw 0x0(%rax,%rax,1)
mov    %ebp,%edi
call   1040 <eeread@plt>
cmp    $0xff,%al
je     1156 <erasestr+0x36>
mov    %eax,%ebx
lea    0x1(%rbp),%r14d
mov    %ebp,%edi
mov    $0xff,%esi
call   1030 <eewrite@plt>
mov    %r14d,%ebp
test   %bl,%bl
jne    1130 <erasestr+0x10>
jmp    1159 <erasestr+0x39>
mov    %ebp,%r14d
mov    %r14d,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @erasestr(i32 %0) {
br label %2
2: ; preds = %6, %1
%3 = phi i32 [ %0, %1 ], [ %7, %6 ]
%4 = tail call zeroext i8 @eeread(i32 %3)
%5 = icmp eq i8 %4, -1
br i1 %5, label %10, label %6
6: ; preds = %2
%7 = add nsw i32 %3, 1
%8 = tail call i32 @eewrite(i32 %3, i8 zeroext -1)
%9 = icmp eq i8 %4, 0
br i1 %9, label %10, label %2
10: ; preds = %2, %6
%11 = phi i32 [ %7, %6 ], [ %3, %2 ]
ret i32 %11
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
unsigned long fread(void *, int, unsigned long, int /*<<< orphan*/ *);
int psi_read(FILE *fp, void *buf, unsigned long cnt) {
  if (fread(buf, 1, cnt, fp) != cnt) {
    return (1);
  }
  return (0);
}


x86 assembly (clang, -O0):
<psi_read>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rdx
mov    -0x10(%rbp),%rcx
mov    $0x1,%esi
call   1030 <fread@plt>
cmp    -0x20(%rbp),%rax
je     1150 <psi_read+0x40>
movl   $0x1,-0x4(%rbp)
jmp    1157 <psi_read+0x47>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<psi_read>:
push   %rbx
mov    %rdx,%rbx
mov    %rdi,%rcx
mov    %rsi,%rdi
mov    $0x1,%esi
call   1030 <fread@plt>
xor    %ecx,%ecx
cmp    %rbx,%rax
setne  %cl
mov    %ecx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @psi_read(i32* nocapture %0, i8* nocapture %1, i64 %2) {
%4 = tail call i64 @fread(i8* %1, i32 1, i64 %2, i32* %0)
%5 = icmp ne i64 %4, %2
%6 = zext i1 %5 to i32
ret i32 %6
}
void FreeMatrix4Double(double ****in) {
  free(in[0][0][0]);
  free(in[0][0]);
  free(in[0]);
  free(in);
}


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

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

LLVM IR (-O0):
define void @FreeMatrix4Double(double**** %0) {
%2 = alloca double****
store double**** %0, double***** %2
%3 = load double****, double***** %2
%4 = getelementptr inbounds double***, double**** %3, i64 0
%5 = load double***, double**** %4
%6 = getelementptr inbounds double**, double*** %5, i64 0
%7 = load double**, double*** %6
%8 = getelementptr inbounds double*, double** %7, i64 0
%9 = load double*, double** %8
%10 = bitcast double* %9 to i8*
%11 = load double****, double***** %2
%12 = getelementptr inbounds double***, double**** %11, i64 0
%13 = load double***, double**** %12
%14 = getelementptr inbounds double**, double*** %13, i64 0
%15 = load double**, double*** %14
%16 = bitcast double** %15 to i8*
%17 = load double****, double***** %2
%18 = getelementptr inbounds double***, double**** %17, i64 0
%19 = load double***, double**** %18
%20 = bitcast double*** %19 to i8*
%21 = load double****, double***** %2
%22 = bitcast double**** %21 to i8*
ret void
}

LLVM IR (-O2):
define void @FreeMatrix4Double(double**** nocapture %0) {
%2 = bitcast double**** %0 to i8****
%3 = load i8***, i8**** %2
%4 = load i8**, i8*** %3
%5 = load i8*, i8** %4
tail call void @free(i8* %5)
%6 = bitcast double**** %0 to i8***
%7 = load i8**, i8*** %6
%8 = load i8*, i8** %7
tail call void @free(i8* %8)
%9 = bitcast double**** %0 to i8**
%10 = load i8*, i8** %9
tail call void @free(i8* %10)
%11 = bitcast double**** %0 to i8*
tail call void @free(i8* %11)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sscanf(char *, char *, int *);
int myctoi(char *array) {
  int val = 0;
  (void)sscanf(array, "%d", &val);
  return val;
}


x86 assembly (clang, -O0):
<myctoi>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xed2(%rip),%rsi
lea    -0xc(%rbp),%rdx
call   1030 <sscanf@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<myctoi>:
push   %rax
movl   $0x0,0x4(%rsp)
lea    0xee0(%rip),%rsi
lea    0x4(%rsp),%rdx
call   1030 <sscanf@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @myctoi(i8* nocapture %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
store i32 0, i32* %2
%4 = call i32 @sscanf(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%5 = load i32, i32* %2
ret i32 %5
}
char *_safe_name(char *name) {
  char *ptr;
  ptr = name;
  while (*ptr) {
    switch (*ptr) {
    case '$':
    case '\\':
    case '/':
      *ptr = ':';
      break;
    }
    ptr++;
  }
  return name;
}


x86 assembly (clang, -O0):
<_safe_name>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     116f <_safe_name+0x6f>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
mov    %eax,-0x14(%rbp)
sub    $0x24,%eax
je     1157 <_safe_name+0x57>
jmp    1135 <_safe_name+0x35>
mov    -0x14(%rbp),%eax
sub    $0x2f,%eax
je     1157 <_safe_name+0x57>
jmp    1146 <_safe_name+0x46>
mov    -0x14(%rbp),%eax
sub    $0x5c,%eax
jne    115e <_safe_name+0x5e>
jmp    1157 <_safe_name+0x57>
mov    -0x10(%rbp),%rax
movb   $0x3a,(%rax)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <_safe_name+0x10>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_safe_name>:
mov    %rdi,%rax
mov    (%rdi),%dl
test   %dl,%dl
je     1142 <_safe_name+0x42>
lea    0x1(%rax),%rcx
movabs $0x100000000000801,%rsi
jmp    112b <_safe_name+0x2b>
nopl   0x0(%rax)
movzbl (%rcx),%edx
add    $0x1,%rcx
test   %dl,%dl
je     1142 <_safe_name+0x42>
movsbl %dl,%edx
add    $0xffffffdc,%edx
cmp    $0x38,%edx
ja     1120 <_safe_name+0x20>
bt     %rdx,%rsi
jae    1120 <_safe_name+0x20>
movb   $0x3a,-0x1(%rcx)
jmp    1120 <_safe_name+0x20>
ret

LLVM IR (-O0):
define i8* @_safe_name(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
store i8* %4, i8** %3
br label %5
5: ; preds = %15, %1
%6 = load i8*, i8** %3
%7 = load i8, i8* %6
%8 = icmp ne i8 %7, 0
br i1 %8, label %9, label %18
9: ; preds = %5
%10 = load i8*, i8** %3
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
switch i32 %12, label %15 [
i32 36, label %13
i32 92, label %13
i32 47, label %13
]
13: ; preds = %9, %9, %9
%14 = load i8*, i8** %3
store i8 58, i8* %14
br label %15
15: ; preds = %9, %13
%16 = load i8*, i8** %3
%17 = getelementptr inbounds i8, i8* %16, i32 1
store i8* %17, i8** %3
br label %5
18: ; preds = %5
%19 = load i8*, i8** %2
ret i8* %19
}

LLVM IR (-O2):
define i8* @_safe_name(i8* returned %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %13, label %4
4: ; preds = %1, %9
%5 = phi i8 [ %11, %9 ], [ %2, %1 ]
%6 = phi i8* [ %10, %9 ], [ %0, %1 ]
%7 = sext i8 %5 to i32
switch i32 %7, label %9 [
i32 36, label %8
i32 92, label %8
i32 47, label %8
]
8: ; preds = %4, %4, %4
store i8 58, i8* %6
br label %9
9: ; preds = %4, %8
%10 = getelementptr inbounds i8, i8* %6, i64 1
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %4
13: ; preds = %9, %1
ret i8* %0
}
float gb_smooth_step(float a, float b, float t) {
  float x = (t - a) / (b - a);
  return x * x * (3.0f - 2.0f * x);
}


x86 assembly (clang, -O0):
<gb_smooth_step>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
subss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
subss  -0x4(%rbp),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x10(%rbp),%xmm0
mulss  -0x10(%rbp),%xmm0
movss  -0x10(%rbp),%xmm2
addss  %xmm2,%xmm2
movss  0xeb5(%rip),%xmm1
subss  %xmm2,%xmm1
mulss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<gb_smooth_step>:
subss  %xmm0,%xmm2
subss  %xmm0,%xmm1
divss  %xmm1,%xmm2
movaps %xmm2,%xmm1
mulss  %xmm2,%xmm1
addss  %xmm2,%xmm2
movss  0xee1(%rip),%xmm0
subss  %xmm2,%xmm0
mulss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @gb_smooth_step(float %0, float %1, float %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca float
%7 = alloca float
store float %0, float* %4
store float %1, float* %5
store float %2, float* %6
%8 = load float, float* %6
%9 = load float, float* %4
%10 = fsub float %8, %9
%11 = load float, float* %5
%12 = load float, float* %4
%13 = fsub float %11, %12
%14 = fdiv float %10, %13
store float %14, float* %7
%15 = load float, float* %7
%16 = load float, float* %7
%17 = fmul float %15, %16
%18 = load float, float* %7
%19 = call float @llvm.fmuladd.f32(float -2.000000e+00, float %18, float 3.000000e+00)
%20 = fmul float %17, %19
ret float %20
}

LLVM IR (-O2):
define float @gb_smooth_step(float %0, float %1, float %2) {
%4 = fsub float %2, %0
%5 = fsub float %1, %0
%6 = fdiv float %4, %5
%7 = fmul float %6, %6
%8 = tail call float @llvm.fmuladd.f32(float %6, float -2.000000e+00, float 3.000000e+00)
%9 = fmul float %7, %8
ret float %9
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_SUCCESS;
int /*<<< orphan*/ endwin();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ initscr();
int /*<<< orphan*/ move(int, int);
int /*<<< orphan*/ printw(char *, char *);
int /*<<< orphan*/ refresh();
int /*<<< orphan*/ sleep(int);
int main() {
  initscr();
  move(5, 15);
  printw("%s", "Hello world");
  refresh();
  sleep(2);
  endwin();
  exit(EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <initscr@plt>
mov    $0x5,%edi
mov    $0xf,%esi
call   1090 <move@plt>
lea    0xe64(%rip),%rdi
lea    0xe60(%rip),%rsi
call   1040 <printw@plt>
mov    $0x0,%al
call   1050 <refresh@plt>
mov    $0x2,%edi
call   1080 <sleep@plt>
mov    $0x0,%al
call   1060 <endwin@plt>
mov    0x2e19(%rip),%rax
mov    (%rax),%edi
call   1070 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <initscr@plt>
mov    $0x5,%edi
mov    $0xf,%esi
call   1090 <move@plt>
lea    0xe72(%rip),%rdi
lea    0xe6e(%rip),%rsi
call   1040 <printw@plt>
xor    %eax,%eax
call   1050 <refresh@plt>
mov    $0x2,%edi
call   1080 <sleep@plt>
xor    %eax,%eax
call   1060 <endwin@plt>
mov    0x2e27(%rip),%rax
mov    (%rax),%edi
call   1070 <exit@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
@.str.1 = [12 x i8] c"Hello world\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @initscr()
%3 = call i32 @move(i32 5, i32 15)
%4 = call i32 @printw(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
%5 = call i32 (...) @refresh()
%6 = call i32 @sleep(i32 2)
%7 = call i32 (...) @endwin()
%8 = load i32, i32* @EXIT_SUCCESS
%9 = call i32 @exit(i32 %8)
unreachable
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
@.str.1 = [12 x i8] c"Hello world\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = tail call i32 (...) @initscr()
%2 = tail call i32 @move(i32 5, i32 15)
%3 = tail call i32 @printw(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
%4 = tail call i32 (...) @refresh()
%5 = tail call i32 @sleep(i32 2)
%6 = tail call i32 (...) @endwin()
%7 = load i32, i32* @EXIT_SUCCESS
%8 = tail call i32 @exit(i32 %7)
unreachable
}
void INT_Excep_USB_USBR0(void) {}


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

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

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

LLVM IR (-O2):
define void @INT_Excep_USB_USBR0() {
ret void
}
void *foo_stack_create(void) {
  struct foo_stack_item **stack = calloc(1, sizeof(*stack));
  return stack;
}


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

x86 assembly (clang, -O2):
<foo_stack_create>:
mov    $0x1,%edi
mov    $0x8,%esi
jmp    1030 <calloc@plt>

LLVM IR (-O0):
%struct.foo_stack_item = type opaque
define i8* @foo_stack_create() {
%1 = alloca %struct.foo_stack_item**
%2 = call i8* @calloc(i64 1, i64 8)
%3 = bitcast i8* %2 to %struct.foo_stack_item**
store %struct.foo_stack_item** %3, %struct.foo_stack_item*** %1
%4 = load %struct.foo_stack_item**, %struct.foo_stack_item*** %1
%5 = bitcast %struct.foo_stack_item** %4 to i8*
ret i8* %5
}

LLVM IR (-O2):
define noalias i8* @foo_stack_create() {
%1 = tail call dereferenceable_or_null(8) i8* @calloc(i64 1, i64 8)
ret i8* %1
}
/* Variables and functions */
int /*<<< orphan*/ Msp430GpioC__4__GeneralIO__set();
void CC2420TransmitP__CSN__set(void) { Msp430GpioC__4__GeneralIO__set(); }


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

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

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

LLVM IR (-O2):
define void @CC2420TransmitP__CSN__set() {
%1 = tail call i32 (...) @Msp430GpioC__4__GeneralIO__set()
ret void
}
int tlink_execute(prog, argv, redir) const char *prog;
char **argv;
const char *redir;
{
  collect_execute(prog, argv, redir);
  return collect_wait(prog);
}


x86 assembly (clang, -O0):
<tlink_execute>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    $0x0,%al
call   1040 <collect_execute@plt>
mov    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1030 <collect_wait@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tlink_execute>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1040 <collect_execute@plt>
mov    %rbx,%rdi
xor    %eax,%eax
pop    %rbx
jmp    1030 <collect_wait@plt>

LLVM IR (-O0):
define i32 @tlink_execute(i8* %0, i8** %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8**
%6 = alloca i8*
store i8* %0, i8** %4
store i8** %1, i8*** %5
store i8* %2, i8** %6
%7 = load i8*, i8** %4
%8 = load i8**, i8*** %5
%9 = load i8*, i8** %6
%10 = call i32 (i8*, i8**, i8*, ...) bitcast (i32 (...)* @collect_execute to i32 (i8*, i8**, i8*, ...)*)(i8* %7, i8** %8, i8* %9)
%11 = load i8*, i8** %4
%12 = call i32 (i8*, ...) bitcast (i32 (...)* @collect_wait to i32 (i8*, ...)*)(i8* %11)
ret i32 %12
}

LLVM IR (-O2):
define i32 @tlink_execute(i8* %0, i8** %1, i8* %2) {
%4 = tail call i32 (i8*, i8**, i8*, ...) bitcast (i32 (...)* @collect_execute to i32 (i8*, i8**, i8*, ...)*)(i8* %0, i8** %1, i8* %2)
%5 = tail call i32 (i8*, ...) bitcast (i32 (...)* @collect_wait to i32 (i8*, ...)*)(i8* %0)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ memset(char *, int /*<<< orphan*/, int);
int strlen(char *);
int /*<<< orphan*/ strncpy(char *, char *, int);
void __circle_set_field(char *dest, char *src, int maxlen) {
  int len = strlen(src);
  if (len > maxlen)
    len = maxlen;
  memset(dest, 0, maxlen + 1);
  strncpy(dest, src, len);
}


x86 assembly (clang, -O0):
<__circle_set_field>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jle    1161 <__circle_set_field+0x31>
mov    -0x14(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%edx
add    $0x1,%edx
xor    %esi,%esi
call   1050 <memset@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%edx
call   1030 <strncpy@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__circle_set_field>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %edx,%ebx
mov    %rsi,%r14
mov    %rdi,%r15
mov    %rsi,%rdi
call   1040 <strlen@plt>
mov    %eax,%ebp
cmp    %ebx,%eax
cmovg  %ebx,%ebp
add    $0x1,%ebx
mov    %r15,%rdi
xor    %esi,%esi
mov    %ebx,%edx
call   1050 <memset@plt>
mov    %r15,%rdi
mov    %r14,%rsi
mov    %ebp,%edx
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <strncpy@plt>

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

LLVM IR (-O2):
define void @__circle_set_field(i8* %0, i8* %1, i32 %2) {
%4 = tail call i32 @strlen(i8* %1)
%5 = icmp sgt i32 %4, %2
%6 = select i1 %5, i32 %2, i32 %4
%7 = add nsw i32 %2, 1
%8 = tail call i32 @memset(i8* %0, i32 0, i32 %7)
%9 = tail call i32 @strncpy(i8* %0, i8* %1, i32 %6)
ret void
}
void RGB565ToYRow_NEON() {}


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

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

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

LLVM IR (-O2):
define void @RGB565ToYRow_NEON() {
ret void
}
/* Variables and functions */
int w5100_read_byte(int);
unsigned w5100_readIMR() { return w5100_read_byte(0x0016); }


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
mov    $0x16,%edi
call   1030 <w5100_read_byte@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @w5100_readIMR() {
%1 = call i32 @w5100_read_byte(i32 22)
ret i32 %1
}

LLVM IR (-O2):
define i32 @w5100_readIMR() {
%1 = tail call i32 @w5100_read_byte(i32 22)
ret i32 %1
}
void RTPathFilename(void) {}


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

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

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

LLVM IR (-O2):
define void @RTPathFilename() {
ret void
}
/* Variables and functions */
int rand();
int parcels_randint(int low, int high) { return (rand() % (high - low)) + low; }


x86 assembly (clang, -O0):
<parcels_randint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
mov    -0x8(%rbp),%ecx
sub    -0x4(%rbp),%ecx
cltd
idiv   %ecx
mov    %edx,%eax
add    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parcels_randint>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
xor    %eax,%eax
call   1030 <rand@plt>
sub    %ebp,%ebx
cltd
idiv   %ebx
add    %edx,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @parcels_randint(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = call i32 (...) @rand()
%6 = load i32, i32* %4
%7 = load i32, i32* %3
%8 = sub nsw i32 %6, %7
%9 = srem i32 %5, %8
%10 = load i32, i32* %3
%11 = add nsw i32 %9, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @parcels_randint(i32 %0, i32 %1) {
%3 = tail call i32 (...) @rand()
%4 = sub nsw i32 %1, %0
%5 = srem i32 %3, %4
%6 = add nsw i32 %5, %0
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ clang_analyzer_eval(int);
scalar_t__ strncasecmp(char *, char *, int);
void strncasecmp_constant_and_var_1() {
  char *x = "abc";
  clang_analyzer_eval(strncasecmp("Abc", x, 3) == 0);
}


x86 assembly (clang, -O0):
<strncasecmp_constant_and_var_1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec6(%rip),%rdi
mov    $0x3,%edx
call   1030 <strncasecmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <clang_analyzer_eval@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strncasecmp_constant_and_var_1>:
push   %rax
lea    0xedc(%rip),%rdi
lea    0xed1(%rip),%rsi
mov    $0x3,%edx
call   1030 <strncasecmp@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
pop    %rax
jmp    1040 <clang_analyzer_eval@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"abc\00"
@.str.1 = [4 x i8] c"Abc\00"
define void @strncasecmp_constant_and_var_1() {
%1 = alloca i8*
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8** %1
%2 = load i8*, i8** %1
%3 = call i64 @strncasecmp(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %2, i32 3)
%4 = icmp eq i64 %3, 0
%5 = zext i1 %4 to i32
%6 = call i32 @clang_analyzer_eval(i32 %5)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"abc\00"
@.str.1 = [4 x i8] c"Abc\00"
define void @strncasecmp_constant_and_var_1() {
%1 = tail call i64 @strncasecmp(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 3)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @clang_analyzer_eval(i32 %3)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ AUTH;

/* Variables and functions */
int atoi(char *);
int /*<<< orphan*/ auth_destroy(int /*<<< orphan*/ *);
int /*<<< orphan*/ *authnone_create();
int /*<<< orphan*/ printf(char *, int);
int main(int argn, char *argc[]) {
  int run_mode = 0;
  int test_status = 1;
  int progNum = atoi(argc[2]);
  AUTH *authNone = NULL;
  authNone = authnone_create();
  auth_destroy(authNone);
  test_status = 0;
  printf("%d\n", test_status);
  return test_status;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x1,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
call   1060 <atoi@plt>
mov    %eax,-0x1c(%rbp)
movq   $0x0,-0x28(%rbp)
mov    $0x0,%al
call   1040 <authnone_create@plt>
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rdi
call   1030 <auth_destroy@plt>
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%esi
lea    0xe5f(%rip),%rdi
call   1050 <printf@plt>
mov    -0x18(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %6
store i32 1, i32* %7
%10 = load i8**, i8*** %5
%11 = getelementptr inbounds i8*, i8** %10, i64 2
%12 = load i8*, i8** %11
%13 = call i32 @atoi(i8* %12)
store i32 %13, i32* %8
store i32* null, i32** %9
%14 = call i32* (...) @authnone_create()
store i32* %14, i32** %9
%15 = load i32*, i32** %9
%16 = call i32 @auth_destroy(i32* %15)
store i32 0, i32* %7
%17 = load i32, i32* %7
%18 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %17)
%19 = load i32, i32* %7
ret i32 %19
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32* (...) @authnone_create()
%4 = tail call i32 @auth_destroy(i32* %3)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 0)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *);
void exec_help(FILE *fout) {
  fprintf(fout,
          "<!-- HELP\n"
          "get (node|way|relation) <id>     Retrieve OSM object.\n"
          ".                                Get next matching OSM object.\n"
          "-->\n");
}


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

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

LLVM IR (-O0):
@.str = [132 x i8] c"<!-- HELP\0Aget (node|way|relation) <id> Retrieve OSM object.\0A. Get next matching OSM object.\0A-->\0A\00"
define void @exec_help(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @fprintf(i32* %3, i8* getelementptr inbounds ([132 x i8], [132 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [132 x i8] c"<!-- HELP\0Aget (node|way|relation) <id> Retrieve OSM object.\0A. Get next matching OSM object.\0A-->\0A\00"
define void @exec_help(i32* nocapture %0) {
%2 = tail call i64 @fwrite(i8* getelementptr inbounds ([132 x i8], [132 x i8]* @.str, i64 0, i64 0), i64 131, i64 1, i32* %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ memset(int /*<<< orphan*/ *, int, int);
const uint32_t *unpack0_32_avx2(const uint32_t *in, uint32_t *out) {
  memset(out, 0x0, 32 * sizeof(*out));
  out += 32;
  return in;
}


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

x86 assembly (clang, -O2):
<unpack0_32_avx2>:
push   %rbx
mov    %rdi,%rbx
mov    %rsi,%rdi
xor    %esi,%esi
mov    $0x80,%edx
call   1030 <memset@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i32* @unpack0_32_avx2(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
store i32* %0, i32** %3
store i32* %1, i32** %4
%5 = load i32*, i32** %4
%6 = call i32 @memset(i32* %5, i32 0, i32 128)
%7 = load i32*, i32** %4
%8 = getelementptr inbounds i32, i32* %7, i64 32
store i32* %8, i32** %4
%9 = load i32*, i32** %3
ret i32* %9
}

LLVM IR (-O2):
define i32* @unpack0_32_avx2(i32* readnone returned %0, i32* %1) {
%3 = tail call i32 @memset(i32* %1, i32 0, i32 128)
ret i32* %0
}
/* Type definitions */
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
pid_t clone(int (*func)(void *), void *stack, int flags, void *arg) {
  return (0);
}


x86 assembly (clang, -O0):
<clone>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @clone(i32 (i8*)* %0, i8* %1, i32 %2, i8* %3) {
%5 = alloca i32 (i8*)*
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i8*
store i32 (i8*)* %0, i32 (i8*)** %5
store i8* %1, i8** %6
store i32 %2, i32* %7
store i8* %3, i8** %8
ret i32 0
}

LLVM IR (-O2):
define i32 @clone(i32 (i8*)* nocapture readnone %0, i8* nocapture readnone %1, i32 %2, i8* nocapture readnone %3) {
ret i32 0
}
/* Type definitions */
struct katcp_dispatch {
  int dummy;
};

/* Variables and functions */
int run_config_server_katcp(struct katcp_dispatch *, int /*<<< orphan*/ *, int,
                            char *, int);
int run_multi_server_katcp(struct katcp_dispatch *d, int count, char *host,
                           int port) {
  return run_config_server_katcp(d, NULL, count, host, port);
}


x86 assembly (clang, -O0):
<run_multi_server_katcp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
mov    -0x18(%rbp),%rcx
mov    -0x1c(%rbp),%r8d
xor    %eax,%eax
mov    %eax,%esi
call   1030 <run_config_server_katcp@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<run_multi_server_katcp>:
mov    %ecx,%r8d
mov    %rdx,%rcx
mov    %esi,%edx
xor    %esi,%esi
jmp    1030 <run_config_server_katcp@plt>

LLVM IR (-O0):
%struct.katcp_dispatch = type { i32 }
define i32 @run_multi_server_katcp(%struct.katcp_dispatch* %0, i32 %1, i8* %2, i32 %3) {
%5 = alloca %struct.katcp_dispatch*
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i32
store %struct.katcp_dispatch* %0, %struct.katcp_dispatch** %5
store i32 %1, i32* %6
store i8* %2, i8** %7
store i32 %3, i32* %8
%9 = load %struct.katcp_dispatch*, %struct.katcp_dispatch** %5
%10 = load i32, i32* %6
%11 = load i8*, i8** %7
%12 = load i32, i32* %8
%13 = call i32 @run_config_server_katcp(%struct.katcp_dispatch* %9, i32* null, i32 %10, i8* %11, i32 %12)
ret i32 %13
}

LLVM IR (-O2):
%struct.katcp_dispatch = type { i32 }
define i32 @run_multi_server_katcp(%struct.katcp_dispatch* %0, i32 %1, i8* %2, i32 %3) {
%5 = tail call i32 @run_config_server_katcp(%struct.katcp_dispatch* %0, i32* null, i32 %1, i8* %2, i32 %3)
ret i32 %5
}
/* Variables and functions */
long get_table_index(char *, char *, char *, char *);
long get_title_index(char *title) {
  return get_table_index(title, "titles", "titleid", "title");
}


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

x86 assembly (clang, -O2):
<get_title_index>:
lea    0xee9(%rip),%rsi
lea    0xee9(%rip),%rdx
lea    0xeea(%rip),%rcx
jmp    1030 <get_table_index@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"titles\00"
@.str.1 = [8 x i8] c"titleid\00"
@.str.2 = [6 x i8] c"title\00"
define i64 @get_title_index(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i64 @get_table_index(i8* %3, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
ret i64 %4
}

LLVM IR (-O2):
@.str = [7 x i8] c"titles\00"
@.str.1 = [8 x i8] c"titleid\00"
@.str.2 = [6 x i8] c"title\00"
define i64 @get_title_index(i8* %0) {
%2 = tail call i64 @get_table_index(i8* %0, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
ret i64 %2
}
/* Variables and functions */
int readEmpList(char *);
int /*<<< orphan*/ sortRecords(char *, int);
int main() {
  char *FILENAME = "employeeDA.dat";
  int count = readEmpList(FILENAME);
  sortRecords(FILENAME, count);
  readEmpList(FILENAME);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xed8(%rip),%rbx
mov    %rbx,%rdi
call   1040 <readEmpList@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <sortRecords@plt>
mov    %rbx,%rdi
call   1040 <readEmpList@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [15 x i8] c"employeeDA.dat\00"
define i32 @main() {
%1 = tail call i32 @readEmpList(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @sortRecords(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 @readEmpList(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int bs_size_ue_big(int);
int bs_size_se(int val) {
  return bs_size_ue_big(val <= 0 ? -val * 2 : val * 2 - 1);
}


x86 assembly (clang, -O0):
<bs_size_se>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jg     1135 <bs_size_se+0x25>
xor    %eax,%eax
sub    -0x4(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1141 <bs_size_se+0x31>
mov    -0x4(%rbp),%eax
shl    $0x1,%eax
sub    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <bs_size_ue_big@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bs_size_se>:
lea    (%rdi,%rdi,1),%eax
neg    %eax
test   %edi,%edi
lea    -0x1(%rdi,%rdi,1),%edi
cmovle %eax,%edi
jmp    1030 <bs_size_ue_big@plt>

LLVM IR (-O0):
define i32 @bs_size_se(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sle i32 %3, 0
br i1 %4, label %5, label %9
5: ; preds = %1
%6 = load i32, i32* %2
%7 = sub nsw i32 0, %6
%8 = mul nsw i32 %7, 2
br label %13
9: ; preds = %1
%10 = load i32, i32* %2
%11 = mul nsw i32 %10, 2
%12 = sub nsw i32 %11, 1
br label %13
13: ; preds = %9, %5
%14 = phi i32 [ %8, %5 ], [ %12, %9 ]
%15 = call i32 @bs_size_ue_big(i32 %14)
ret i32 %15
}

LLVM IR (-O2):
define i32 @bs_size_se(i32 %0) {
%2 = icmp slt i32 %0, 1
%3 = mul i32 %0, -2
%4 = shl nsw i32 %0, 1
%5 = add nsw i32 %4, -1
%6 = select i1 %2, i32 %3, i32 %5
%7 = tail call i32 @bs_size_ue_big(i32 %6)
ret i32 %7
}
/* Variables and functions */
int write_block(int, int, int /*<<< orphan*/, int /*<<< orphan*/);
int trim_write(int value) {
  if (value > 100)
    value = 100;
  else if (value < -100)
    value = -100;
  value += 100;
  return write_block(31, value, 0, 0);
}


x86 assembly (clang, -O0):
<trim_write>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x64,-0x4(%rbp)
jle    1131 <trim_write+0x21>
movl   $0x64,-0x4(%rbp)
jmp    1147 <trim_write+0x37>
cmpl   $0xffffff9c,-0x4(%rbp)
jge    1142 <trim_write+0x32>
movl   $0xffffff9c,-0x4(%rbp)
jmp    1147 <trim_write+0x37>
mov    -0x4(%rbp),%eax
add    $0x64,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%esi
mov    $0x1f,%edi
xor    %ecx,%ecx
mov    %ecx,%edx
call   1030 <write_block@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<trim_write>:
cmp    $0xffffff9d,%edi
mov    $0xffffff9c,%eax
cmovge %edi,%eax
add    $0x64,%eax
cmp    $0x65,%edi
mov    $0xc8,%esi
cmovl  %eax,%esi
mov    $0x1f,%edi
xor    %edx,%edx
xor    %ecx,%ecx
jmp    1030 <write_block@plt>

LLVM IR (-O0):
define i32 @trim_write(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sgt i32 %3, 100
br i1 %4, label %5, label %6
5: ; preds = %1
store i32 100, i32* %2
br label %11
6: ; preds = %1
%7 = load i32, i32* %2
%8 = icmp slt i32 %7, -100
br i1 %8, label %9, label %10
9: ; preds = %6
store i32 -100, i32* %2
br label %10
10: ; preds = %9, %6
br label %11
11: ; preds = %10, %5
%12 = load i32, i32* %2
%13 = add nsw i32 %12, 100
store i32 %13, i32* %2
%14 = load i32, i32* %2
%15 = call i32 @write_block(i32 31, i32 %14, i32 0, i32 0)
ret i32 %15
}

LLVM IR (-O2):
define i32 @trim_write(i32 %0) {
%2 = icmp sgt i32 %0, 100
%3 = icmp sgt i32 %0, -100
%4 = select i1 %3, i32 %0, i32 -100
%5 = add i32 %4, 100
%6 = select i1 %2, i32 200, i32 %5
%7 = tail call i32 @write_block(i32 31, i32 %6, i32 0, i32 0)
ret i32 %7
}
chkwld(s) char *s;
{
  for (; *s != '\0'; s++) {
    if ((*s == '*') || (*s == '?'))
      return (1);
  }
  return (0);
}


x86 assembly (clang, -O0):
<chkwld>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     115a <chkwld+0x5a>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2a,%eax
je     1138 <chkwld+0x38>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x3f,%eax
jne    1144 <chkwld+0x44>
movl   $0x1,-0x4(%rbp)
jmp    1161 <chkwld+0x61>
jmp    1149 <chkwld+0x49>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1108 <chkwld+0x8>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<chkwld>:
movzbl (%rdi),%eax
test   %al,%al
je     111b <chkwld+0x1b>
cmp    $0x2a,%al
je     1115 <chkwld+0x15>
cmp    $0x3f,%al
je     1115 <chkwld+0x15>
add    $0x1,%rdi
jmp    1100 <chkwld>
mov    $0x1,%eax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @chkwld(i8* nocapture %0) {
br label %2
2: ; preds = %5, %1
%3 = phi i8* [ %0, %1 ], [ %6, %5 ]
%4 = load i8, i8* %3
switch i8 %4, label %5 [
i8 0, label %8
i8 42, label %7
i8 63, label %7
]
5: ; preds = %2
%6 = getelementptr inbounds i8, i8* %3, i64 1
br label %2
7: ; preds = %2, %2
br label %8
8: ; preds = %2, %7
%9 = phi i32 [ 1, %7 ], [ 0, %2 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, double);
double CircleRadius(double perimeter, double a) {
  double radius;
  radius = (2 * a) / perimeter;
  printf("The radius of the inscribed cirlce is %f \n", radius);
  return radius;
}


x86 assembly (clang, -O0):
<CircleRadius>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  0xed6(%rip),%xmm0
mulsd  -0x10(%rbp),%xmm0
divsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
movsd  -0x18(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CircleRadius>:
push   %rax
addsd  %xmm1,%xmm1
divsd  %xmm0,%xmm1
movsd  %xmm1,(%rsp)
lea    0xedb(%rip),%rdi
movapd %xmm1,%xmm0
call   1030 <printf@plt>
movsd  (%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
@.str = [43 x i8] c"The radius of the inscribed cirlce is %f \0A\00"
define double @CircleRadius(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
store double %0, double* %3
store double %1, double* %4
%6 = load double, double* %4
%7 = fmul double 2.000000e+00, %6
%8 = load double, double* %3
%9 = fdiv double %7, %8
store double %9, double* %5
%10 = load double, double* %5
%11 = call i32 @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0), double %10)
%12 = load double, double* %5
ret double %12
}

LLVM IR (-O2):
@.str = [43 x i8] c"The radius of the inscribed cirlce is %f \0A\00"
define double @CircleRadius(double %0, double %1) {
%3 = fmul double %1, 2.000000e+00
%4 = fdiv double %3, %0
%5 = tail call i32 @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0), double %4)
ret double %4
}
/* Variables and functions */
int /*<<< orphan*/ core5_swap(char *, int);
int U_EMRSETTEXTCOLOR_swap(char *record, int torev) {
  if (!core5_swap(record, torev))
    return (0);
  return (1);
}


x86 assembly (clang, -O0):
<U_EMRSETTEXTCOLOR_swap>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1030 <core5_swap@plt>
cmp    $0x0,%eax
jne    1140 <U_EMRSETTEXTCOLOR_swap+0x30>
movl   $0x0,-0x4(%rbp)
jmp    1147 <U_EMRSETTEXTCOLOR_swap+0x37>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @U_EMRSETTEXTCOLOR_swap(i8* %0, i32 %1) {
%3 = tail call i32 @core5_swap(i8* %0, i32 %1)
%4 = icmp ne i32 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
char CurrentPortKind();
int /*<<< orphan*/ DwReconnect();
int /*<<< orphan*/ DwSync();
int /*<<< orphan*/ Wsl(char *);
void DeviceBreak(void) {
  Wsl("\rDevice reached breakpoint.                                        ");
  if (CurrentPortKind() == 's')
    DwSync();
  DwReconnect();
}


x86 assembly (clang, -O0):
<DeviceBreak>:
push   %rbp
mov    %rsp,%rbp
lea    0xeb5(%rip),%rdi
call   1050 <Wsl@plt>
mov    $0x0,%al
call   1030 <CurrentPortKind@plt>
movsbl %al,%eax
cmp    $0x73,%eax
jne    116a <DeviceBreak+0x2a>
mov    $0x0,%al
call   1060 <DwSync@plt>
mov    $0x0,%al
call   1040 <DwReconnect@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<DeviceBreak>:
push   %rax
lea    0xeb8(%rip),%rdi
call   1050 <Wsl@plt>
xor    %eax,%eax
call   1030 <CurrentPortKind@plt>
cmp    $0x73,%al
jne    115f <DeviceBreak+0x1f>
xor    %eax,%eax
call   1060 <DwSync@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <DwReconnect@plt>

LLVM IR (-O0):
@.str = [68 x i8] c"\0DDevice reached breakpoint. \00"
define void @DeviceBreak() {
%1 = call i32 @Wsl(i8* getelementptr inbounds ([68 x i8], [68 x i8]* @.str, i64 0, i64 0))
%2 = call signext i8 (...) @CurrentPortKind()
%3 = sext i8 %2 to i32
%4 = icmp eq i32 %3, 115
br i1 %4, label %5, label %7
5: ; preds = %0
%6 = call i32 (...) @DwSync()
br label %7
7: ; preds = %5, %0
%8 = call i32 (...) @DwReconnect()
ret void
}

LLVM IR (-O2):
@.str = [68 x i8] c"\0DDevice reached breakpoint. \00"
define void @DeviceBreak() {
%1 = tail call i32 @Wsl(i8* getelementptr inbounds ([68 x i8], [68 x i8]* @.str, i64 0, i64 0))
%2 = tail call signext i8 (...) @CurrentPortKind()
%3 = icmp eq i8 %2, 115
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = tail call i32 (...) @DwSync()
br label %6
6: ; preds = %4, %0
%7 = tail call i32 (...) @DwReconnect()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ output_byte(char);
print_tab() { output_byte('\t'); }


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

x86 assembly (clang, -O2):
<print_tab>:
mov    $0x9,%edi
jmp    1030 <output_byte@plt>

LLVM IR (-O0):
define i32 @print_tab() {
%1 = alloca i32
%2 = call i32 @output_byte(i8 signext 9)
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
define i32 @print_tab() {
%1 = tail call i32 @output_byte(i8 signext 9)
ret i32 undef
}