xunge/DecIR huggingface dataset:
/* Type definitions */
struct timespec {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ CLOCK_PROCESS_CPUTIME_ID;
int clock_gettime(int /*<<< orphan*/, struct timespec *);
int /*<<< orphan*/ printf(char *, int);
int main() {
  struct timespec t;
  printf("%d", clock_gettime(CLOCK_PROCESS_CPUTIME_ID, &t));
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2ec0(%rip),%rax
mov    (%rax),%edi
mov    %rsp,%rsi
call   1030 <clock_gettime@plt>
lea    0xec7(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.timespec = type { i32 }
@.str = [3 x i8] c"%d\00"
@CLOCK_PROCESS_CPUTIME_ID = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca %struct.timespec
store i32 0, i32* %1
%3 = load i32, i32* @CLOCK_PROCESS_CPUTIME_ID
%4 = call i32 @clock_gettime(i32 %3, %struct.timespec* %2)
%5 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i32 0
}

LLVM IR (-O2):
%struct.timespec = type { i32 }
@.str = [3 x i8] c"%d\00"
@CLOCK_PROCESS_CPUTIME_ID = global i32 0
define i32 @main() {
%1 = alloca %struct.timespec
%2 = bitcast %struct.timespec* %1 to i8*
%3 = load i32, i32* @CLOCK_PROCESS_CPUTIME_ID
%4 = call i32 @clock_gettime(i32 %3, %struct.timespec* %1)
%5 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i32 0
}
/* Variables and functions */
int chdir(char *);
int /*<<< orphan*/ gets(char *);
int /*<<< orphan*/ list_all();
int /*<<< orphan*/ printf(char *);
int cdir() {
  char dir[30] = "";
  printf("\n");
  list_all();
  printf("where would you like to go? ");
  gets(dir);
  int ret;
  ret = chdir(dir);
  return 0;
}


x86 assembly (clang, -O0):
<cdir>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
lea    -0x20(%rbp),%rdi
xor    %esi,%esi
mov    $0x1e,%edx
call   1050 <memset@plt>
lea    0xe91(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1070 <list_all@plt>
lea    0xe80(%rip),%rdi
call   1040 <printf@plt>
lea    -0x20(%rbp),%rdi
call   1060 <gets@plt>
lea    -0x20(%rbp),%rdi
call   1030 <chdir@plt>
mov    %eax,-0x24(%rbp)
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cdir>:
push   %rbx
sub    $0x20,%rsp
xorps  %xmm0,%xmm0
movups %xmm0,0xe(%rsp)
movaps %xmm0,(%rsp)
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
call   1070 <list_all@plt>
lea    0xe87(%rip),%rdi
call   1050 <printf@plt>
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1060 <gets@plt>
mov    %rbx,%rdi
call   1040 <chdir@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [2 x i8] c"\0A\00"
@.str.1 = [29 x i8] c"where would you like to go? \00"
define i32 @cdir() {
%1 = alloca [30 x i8]
%2 = alloca i32
%3 = bitcast [30 x i8]* %1 to i8*
%4 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%5 = call i32 (...) @list_all()
%6 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
%7 = getelementptr inbounds [30 x i8], [30 x i8]* %1, i64 0, i64 0
%8 = call i32 @gets(i8* %7)
%9 = getelementptr inbounds [30 x i8], [30 x i8]* %1, i64 0, i64 0
%10 = call i32 @chdir(i8* %9)
store i32 %10, i32* %2
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [29 x i8] c"where would you like to go? \00"
define i32 @cdir() {
%1 = alloca [30 x i8]
%2 = getelementptr inbounds [30 x i8], [30 x i8]* %1, i64 0, i64 0
%3 = tail call i32 @putchar(i32 10)
%4 = tail call i32 (...) @list_all()
%5 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
%6 = call i32 @gets(i8* %2)
%7 = call i32 @chdir(i8* %2)
ret i32 0
}
void f1(void) {
  int A1;
  int B1 = A1 * 2;
}


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

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

LLVM IR (-O0):
define void @f1() {
%1 = alloca i32
%2 = alloca i32
%3 = load i32, i32* %1
%4 = mul nsw i32 %3, 2
store i32 %4, i32* %2
ret void
}

LLVM IR (-O2):
define void @f1() {
ret void
}
/* Variables and functions */
scalar_t__ isblank(char);
int is_blank(char c) { return (isblank(c) || (c == '\t')); }


x86 assembly (clang, -O0):
<is_blank>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edi
call   1030 <isblank@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x2(%rbp)
jne    1146 <is_blank+0x36>
movsbl -0x1(%rbp),%eax
cmp    $0x9,%eax
sete   %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_blank>:
push   %rbx
mov    %edi,%ebx
call   1030 <isblank@plt>
test   %rax,%rax
setne  %al
cmp    $0x9,%bl
sete   %cl
or     %al,%cl
movzbl %cl,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @is_blank(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = call i64 @isblank(i8 signext %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %10, label %6
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp eq i32 %8, 9
br label %10
10: ; preds = %6, %1
%11 = phi i1 [ true, %1 ], [ %9, %6 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @is_blank(i8 signext %0) {
%2 = tail call i64 @isblank(i8 signext %0)
%3 = icmp ne i64 %2, 0
%4 = icmp eq i8 %0, 9
%5 = or i1 %4, %3
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ all_event_masks;
};
typedef TYPE_1__ XWindowAttributes;

/* Variables and functions */
long get_XWindowAttributes_all_event_masks(void *_p) {
  return (long)((XWindowAttributes *)_p)->all_event_masks;
}


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

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

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

LLVM IR (-O2):
define i64 @get_XWindowAttributes_all_event_masks(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
ret i64 %3
}
/* Type definitions */
typedef int off_t;

/* Variables and functions */
int open(char *, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, int);
int sendfile(int, int, int *, int);
int main() {
  int fd = open("havesendfile.c", 0);
  off_t o = 0;
  off_t r = sendfile(1, fd, &o, 23);
  if (r != -1)
    printf("sent %llu bytes.\n", r);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
xor    %esi,%esi
call   1050 <open@plt>
mov    %eax,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%esi
mov    $0x1,%edi
lea    -0xc(%rbp),%rdx
mov    $0x17,%ecx
call   1040 <sendfile@plt>
mov    %eax,-0x10(%rbp)
cmpl   $0xffffffff,-0x10(%rbp)
je     1189 <main+0x59>
mov    -0x10(%rbp),%esi
lea    0xe8b(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
xor    %esi,%esi
call   1050 <open@plt>
movl   $0x0,0x4(%rsp)
lea    0x4(%rsp),%rdx
mov    $0x1,%edi
mov    %eax,%esi
mov    $0x17,%ecx
call   1040 <sendfile@plt>
cmp    $0xffffffff,%eax
je     1170 <main+0x40>
lea    0xea6(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [15 x i8] c"havesendfile.c\00"
@.str.1 = [18 x i8] c"sent %llu bytes.\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = tail call i32 @open(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 0)
%3 = bitcast i32* %1 to i8*
store i32 0, i32* %1
%4 = call i32 @sendfile(i32 1, i32 %2, i32* %1, i32 23)
%5 = icmp eq i32 %4, -1
br i1 %5, label %8, label %6
6: ; preds = %0
%7 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i32 %4)
br label %8
8: ; preds = %6, %0
ret i32 0
}
int chkEndianess() {
  int num = 1;
  if (*(char *)&num == 1) {
    return 1;
  }
  return -1;
}


x86 assembly (clang, -O0):
<chkEndianess>:
push   %rbp
mov    %rsp,%rbp
movl   $0x1,-0x8(%rbp)
movsbl -0x8(%rbp),%eax
cmp    $0x1,%eax
jne    1124 <chkEndianess+0x24>
movl   $0x1,-0x4(%rbp)
jmp    112b <chkEndianess+0x2b>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @chkEndianess() {
ret i32 1
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ drawLine(int, int, int, int);
void drawT(uint32_t row, uint32_t column) {
  uint32_t baseX = 112 + (column * 133);
  uint32_t baseY = 34 + (row * 116);
  drawLine(baseX + 10, baseY + 10, baseX + 123, baseY + 10);
  drawLine(baseX + 66, baseY + 106, baseX + 66, baseY + 10);
}


x86 assembly (clang, -O0):
<drawT>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
imul   $0x85,-0x8(%rbp),%eax
add    $0x70,%eax
mov    %eax,-0xc(%rbp)
imul   $0x74,-0x4(%rbp),%eax
add    $0x22,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%edi
add    $0xa,%edi
mov    -0x10(%rbp),%esi
add    $0xa,%esi
mov    -0xc(%rbp),%edx
add    $0x7b,%edx
mov    -0x10(%rbp),%ecx
add    $0xa,%ecx
call   1030 <drawLine@plt>
mov    -0xc(%rbp),%edi
add    $0x42,%edi
mov    -0x10(%rbp),%esi
add    $0x6a,%esi
mov    -0xc(%rbp),%edx
add    $0x42,%edx
mov    -0x10(%rbp),%ecx
add    $0xa,%ecx
call   1030 <drawLine@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<drawT>:
push   %rbp
push   %r14
push   %rbx
imul   $0x85,%esi,%ebx
imul   $0x74,%edi,%r14d
lea    0x7a(%rbx),%edi
lea    0x2c(%r14),%ebp
lea    0xeb(%rbx),%edx
mov    %ebp,%esi
mov    %ebp,%ecx
call   1030 <drawLine@plt>
add    $0xb2,%ebx
add    $0x8c,%r14d
mov    %ebx,%edi
mov    %r14d,%esi
mov    %ebx,%edx
mov    %ebp,%ecx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <drawLine@plt>

LLVM IR (-O0):
define void @drawT(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%7 = load i32, i32* %4
%8 = mul nsw i32 %7, 133
%9 = add nsw i32 112, %8
store i32 %9, i32* %5
%10 = load i32, i32* %3
%11 = mul nsw i32 %10, 116
%12 = add nsw i32 34, %11
store i32 %12, i32* %6
%13 = load i32, i32* %5
%14 = add nsw i32 %13, 10
%15 = load i32, i32* %6
%16 = add nsw i32 %15, 10
%17 = load i32, i32* %5
%18 = add nsw i32 %17, 123
%19 = load i32, i32* %6
%20 = add nsw i32 %19, 10
%21 = call i32 @drawLine(i32 %14, i32 %16, i32 %18, i32 %20)
%22 = load i32, i32* %5
%23 = add nsw i32 %22, 66
%24 = load i32, i32* %6
%25 = add nsw i32 %24, 106
%26 = load i32, i32* %5
%27 = add nsw i32 %26, 66
%28 = load i32, i32* %6
%29 = add nsw i32 %28, 10
%30 = call i32 @drawLine(i32 %23, i32 %25, i32 %27, i32 %29)
ret void
}

LLVM IR (-O2):
define void @drawT(i32 %0, i32 %1) {
%3 = mul nsw i32 %1, 133
%4 = mul nsw i32 %0, 116
%5 = add nsw i32 %3, 122
%6 = add nsw i32 %4, 44
%7 = add nsw i32 %3, 235
%8 = tail call i32 @drawLine(i32 %5, i32 %6, i32 %7, i32 %6)
%9 = add nsw i32 %3, 178
%10 = add nsw i32 %4, 140
%11 = tail call i32 @drawLine(i32 %9, i32 %10, i32 %9, i32 %6)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ SA1AbsoluteLong(int);
int /*<<< orphan*/ STA8(int /*<<< orphan*/);
void Op8FM1(void) { STA8(SA1AbsoluteLong(2)); }


x86 assembly (clang, -O0):
<Op8FM1>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2,%edi
call   1030 <SA1AbsoluteLong@plt>
mov    %eax,%edi
call   1040 <STA8@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<Op8FM1>:
push   %rax
mov    $0x2,%edi
call   1030 <SA1AbsoluteLong@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <STA8@plt>

LLVM IR (-O0):
define void @Op8FM1() {
%1 = call i32 @SA1AbsoluteLong(i32 2)
%2 = call i32 @STA8(i32 %1)
ret void
}

LLVM IR (-O2):
define void @Op8FM1() {
%1 = tail call i32 @SA1AbsoluteLong(i32 2)
%2 = tail call i32 @STA8(i32 %1)
ret void
}
/* Type definitions */
struct libjte_env {
  int dummy;
};

/* Variables and functions */
int jte_add_path_match(struct libjte_env *, char *, int);
extern int jte_add_exclude(struct libjte_env *o, char *pattern) {
  int ret;
  ret = jte_add_path_match(o, pattern, 1);
  return ret;
}


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

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

LLVM IR (-O0):
%struct.libjte_env = type { i32 }
define i32 @jte_add_exclude(%struct.libjte_env* %0, i8* %1) {
%3 = alloca %struct.libjte_env*
%4 = alloca i8*
%5 = alloca i32
store %struct.libjte_env* %0, %struct.libjte_env** %3
store i8* %1, i8** %4
%6 = load %struct.libjte_env*, %struct.libjte_env** %3
%7 = load i8*, i8** %4
%8 = call i32 @jte_add_path_match(%struct.libjte_env* %6, i8* %7, i32 1)
store i32 %8, i32* %5
%9 = load i32, i32* %5
ret i32 %9
}

LLVM IR (-O2):
%struct.libjte_env = type { i32 }
define i32 @jte_add_exclude(%struct.libjte_env* %0, i8* %1) {
%3 = tail call i32 @jte_add_path_match(%struct.libjte_env* %0, i8* %1, i32 1)
ret i32 %3
}
char *vl_string_find_char_rev(char const *beg, char const *end, char c) {
  while (end-- != beg) {
    if (*end == 'c')
      return (char *)end;
  }
  return 0;
}


x86 assembly (clang, -O0):
<vl_string_find_char_rev>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %al,-0x19(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0xffffffffffffffff,%rcx
mov    %rcx,-0x18(%rbp)
cmp    -0x10(%rbp),%rax
je     114c <vl_string_find_char_rev+0x4c>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x63,%eax
jne    1147 <vl_string_find_char_rev+0x47>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1154 <vl_string_find_char_rev+0x54>
jmp    1111 <vl_string_find_char_rev+0x11>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<vl_string_find_char_rev>:
cmp    %rdi,%rsi
je     1113 <vl_string_find_char_rev+0x13>
lea    -0x1(%rsi),%rax
cmpb   $0x63,-0x1(%rsi)
mov    %rax,%rsi
jne    1100 <vl_string_find_char_rev>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i8* @vl_string_find_char_rev(i8* readnone %0, i8* %1, i8 signext %2) {
br label %4
4: ; preds = %8, %3
%5 = phi i8* [ %1, %3 ], [ %6, %8 ]
%6 = getelementptr inbounds i8, i8* %5, i64 -1
%7 = icmp eq i8* %5, %0
br i1 %7, label %11, label %8
8: ; preds = %4
%9 = load i8, i8* %6
%10 = icmp eq i8 %9, 99
br i1 %10, label %11, label %4
11: ; preds = %4, %8
%12 = phi i8* [ %6, %8 ], [ null, %4 ]
ret i8* %12
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isgraph(int);
void t_isgraph_0xad() {
  Assert_real((isgraph(173) == 0),
              "/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_isgraph.c",
              870, ("isgraph should be 0 for 0xad"));
}


x86 assembly (clang, -O0):
<t_isgraph_0xad>:
push   %rbp
mov    %rsp,%rbp
mov    $0xad,%edi
call   1040 <isgraph@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x366,%edx
lea    0xf5b(%rip),%rcx
call   1030 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isgraph_0xad>:
push   %rax
mov    $0xad,%edi
call   1040 <isgraph@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x366,%edx
pop    %rax
jmp    1030 <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_isgraph.c\00"
@.str.1 = [29 x i8] c"isgraph should be 0 for 0xad\00"
define void @t_isgraph_0xad() {
%1 = call i64 @isgraph(i32 173)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 870, i8* getelementptr inbounds ([29 x i8], [29 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_isgraph.c\00"
@.str.1 = [29 x i8] c"isgraph should be 0 for 0xad\00"
define void @t_isgraph_0xad() {
%1 = tail call i64 @isgraph(i32 173)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 870, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ va_list;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
void debug(const char *fmt, ...) {
  va_list vap;
  fprintf(stderr, "%s", fmt);
}


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

x86 assembly (clang, -O2):
<debug>:
mov    %rdi,%rdx
mov    0x2ec6(%rip),%rax
mov    (%rax),%edi
lea    0xedd(%rip),%rsi
jmp    1030 <fprintf@plt>

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

LLVM IR (-O2):
@stderr = global i32 0
@.str = [3 x i8] c"%s\00"
define void @debug(i8* %0, ...) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
void _return_memory(ptr, filename, linenumber) void *ptr;
char *filename;
int linenumber;
{ free(ptr); }


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

x86 assembly (clang, -O2):
<_return_memory>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @_return_memory(i8* nocapture %0, i8* nocapture readnone %1, i32 %2) {
tail call void @free(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
int /*<<< orphan*/ printf(char *, void *);
void parrt_free(void *p) {
  printf("free %p\n", p);
  free(p);
}


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

x86 assembly (clang, -O2):
<parrt_free>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

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

LLVM IR (-O2):
@.str = [9 x i8] c"free %p\0A\00"
define void @parrt_free(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @free(i8* %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ *fopen(char *, char *);
FILE *get_datafile(int argc, char *argv[]) {
  char *default_datafile_name = "default.sdc";
  char *datafile_name = NULL;
  datafile_name = default_datafile_name;
  FILE *datafile = fopen(datafile_name, "r");
  return datafile;
}


x86 assembly (clang, -O0):
<get_datafile>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xeda(%rip),%rax
mov    %rax,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
lea    0xec7(%rip),%rsi
call   1030 <fopen@plt>
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_datafile>:
lea    0xee9(%rip),%rdi
lea    0xeee(%rip),%rsi
jmp    1030 <fopen@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"default.sdc\00"
@.str.1 = [2 x i8] c"r\00"
define i32* @get_datafile(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i32*
store i32 %0, i32* %3
store i8** %1, i8*** %4
store i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8** %5
store i8* null, i8** %6
%8 = load i8*, i8** %5
store i8* %8, i8** %6
%9 = load i8*, i8** %6
%10 = call i32* @fopen(i8* %9, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %10, i32** %7
%11 = load i32*, i32** %7
ret i32* %11
}

LLVM IR (-O2):
@.str = [12 x i8] c"default.sdc\00"
@.str.1 = [2 x i8] c"r\00"
define noalias i32* @get_datafile(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32* @fopen(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret i32* %3
}
/* Variables and functions */
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
char *input_str();
int /*<<< orphan*/ stdout;
char *prompt() {
  fputs("$> ", stdout);
  return (input_str());
}


x86 assembly (clang, -O0):
<prompt>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%esi
lea    0xecc(%rip),%rdi
call   1040 <fputs@plt>
mov    $0x0,%al
call   1030 <input_str@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<prompt>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%esi
lea    0xecf(%rip),%rdi
call   1040 <fputs@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <input_str@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"$> \00"
@stdout = global i32 0
define i8* @prompt() {
%1 = load i32, i32* @stdout
%2 = call i32 @fputs(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = call i8* (...) @input_str()
ret i8* %3
}

LLVM IR (-O2):
@.str = [4 x i8] c"$> \00"
@stdout = global i32 0
define i8* @prompt() {
%1 = load i32, i32* @stdout
%2 = tail call i32 @fputs(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i8* (...) @input_str()
ret i8* %3
}
/* Variables and functions */
double sqrt(double);
double hypot(double x, double y) { return sqrt(x * x + y * y); }


x86 assembly (clang, -O0):
<hypot>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm2
movsd  -0x10(%rbp),%xmm1
mulsd  -0x10(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
call   1030 <sqrt@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hypot>:
mulsd  %xmm1,%xmm1
mulsd  %xmm0,%xmm0
addsd  %xmm1,%xmm0
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     112b <hypot+0x1b>
sqrtsd %xmm0,%xmm0
ret
jmp    1030 <sqrt@plt>

LLVM IR (-O0):
define double @hypot(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %3
%7 = load double, double* %4
%8 = load double, double* %4
%9 = fmul double %7, %8
%10 = call double @llvm.fmuladd.f64(double %5, double %6, double %9)
%11 = call double @sqrt(double %10)
ret double %11
}

LLVM IR (-O2):
define double @hypot(double %0, double %1) {
%3 = fmul double %1, %1
%4 = tail call double @llvm.fmuladd.f64(double %0, double %0, double %3)
%5 = tail call double @sqrt(double %4)
ret double %5
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_attr_t;

/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
int pthread_attr_getguardsize(const pthread_attr_t *a, size_t *b) { assert(0); }


x86 assembly (clang, -O0):
<pthread_attr_getguardsize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
xor    %edi,%edi
call   1030 <assert@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pthread_attr_getguardsize>:
xor    %edi,%edi
jmp    1030 <assert@plt>

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

LLVM IR (-O2):
define i32 @pthread_attr_getguardsize(i32* nocapture readnone %0, i64* nocapture readnone %1) {
%3 = tail call i32 @assert(i32 0)
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ pr_info(char *);
void myexit(void) { pr_info("exit buildroot\n"); }


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

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

LLVM IR (-O0):
@.str = [16 x i8] c"exit buildroot\0A\00"
define void @myexit() {
%1 = call i32 @pr_info(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [16 x i8] c"exit buildroot\0A\00"
define void @myexit() {
%1 = tail call i32 @pr_info(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint;

/* Variables and functions */
scalar_t__ syscall(int, int /*<<< orphan*/, int /*<<< orphan*/,
                   int /*<<< orphan*/);
int read(int file, char *ptr, int len) {
  return (int)syscall(3, (uint)file, (uint)ptr, (uint)len);
}


x86 assembly (clang, -O0):
<read>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rax
mov    %eax,%edx
mov    -0x14(%rbp),%ecx
mov    $0x3,%edi
call   1030 <syscall@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read>:
mov    %edx,%ecx
mov    %rsi,%rdx
mov    %edi,%esi
mov    $0x3,%edi
jmp    1030 <syscall@plt>

LLVM IR (-O0):
define i32 @read(i32 %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
store i32 %0, i32* %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load i8*, i8** %5
%9 = ptrtoint i8* %8 to i32
%10 = load i32, i32* %6
%11 = call i64 @syscall(i32 3, i32 %7, i32 %9, i32 %10)
%12 = trunc i64 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @read(i32 %0, i8* %1, i32 %2) {
%4 = ptrtoint i8* %1 to i64
%5 = trunc i64 %4 to i32
%6 = tail call i64 @syscall(i32 3, i32 %0, i32 %5, i32 %2)
%7 = trunc i64 %6 to i32
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_parent_dir() {
  printf("NOT IMPLEMENTED:"
         "pa_parent_dir"
         "\n");
}


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

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

LLVM IR (-O0):
@.str = [31 x i8] c"NOT IMPLEMENTED:pa_parent_dir\0A\00"
define i32 @pa_parent_dir() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [30 x i8] c"NOT IMPLEMENTED:pa_parent_dir\00"
define i32 @pa_parent_dir() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
void pthread_exit(void *retval) {}


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

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

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

LLVM IR (-O2):
define void @pthread_exit(i8* nocapture %0) {
ret void
}
int test_imm_D8int8_reg(signed char val) {
  return ((val) & (0xD8 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_D8int8_reg(i8 signext %0) {
%2 = and i8 %0, -40
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ is_valid_name_char(int /*<<< orphan*/);
int is_valid_name(const char *name) {
  const char *p = name;
  while (*p) {
    if (!is_valid_name_char(*p++))
      return 0;
  }
  return 1;
}


x86 assembly (clang, -O0):
<is_valid_name>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmpb   $0x0,(%rax)
je     1162 <is_valid_name+0x52>
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x18(%rbp)
movsbl (%rax),%edi
call   1030 <is_valid_name_char@plt>
cmp    $0x0,%eax
jne    115d <is_valid_name+0x4d>
movl   $0x0,-0x4(%rbp)
jmp    1169 <is_valid_name+0x59>
jmp    1124 <is_valid_name+0x14>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_valid_name>:
push   %rbx
mov    %rdi,%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movsbl (%rbx),%edi
test   %edi,%edi
je     1138 <is_valid_name+0x28>
add    $0x1,%rbx
call   1030 <is_valid_name_char@plt>
test   %eax,%eax
jne    1120 <is_valid_name+0x10>
xor    %eax,%eax
pop    %rbx
ret
mov    $0x1,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @is_valid_name(i8* nocapture %0) {
br label %2
2: ; preds = %6, %1
%3 = phi i8* [ %0, %1 ], [ %7, %6 ]
%4 = load i8, i8* %3
%5 = icmp eq i8 %4, 0
br i1 %5, label %11, label %6
6: ; preds = %2
%7 = getelementptr inbounds i8, i8* %3, i64 1
%8 = sext i8 %4 to i32
%9 = tail call i32 @is_valid_name_char(i32 %8)
%10 = icmp eq i32 %9, 0
br i1 %10, label %11, label %2
11: ; preds = %2, %6
%12 = phi i32 [ 0, %6 ], [ 1, %2 ]
ret i32 %12
}
void acpi_mid_lpss_init(void) {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ read_token(char **);
struct token_queue_s *token_queue_init();
int /*<<< orphan*/ token_queue_push(int /*<<< orphan*/, struct token_queue_s *);
struct token_queue_s *tokenize(char *stream) {
  struct token_queue_s *tokens;
  tokens = token_queue_init();
  while (*stream)
    token_queue_push(read_token(&stream), tokens);
  return tokens;
}


x86 assembly (clang, -O0):
<tokenize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <token_queue_init@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     116d <tokenize+0x3d>
lea    -0x8(%rbp),%rdi
call   1040 <read_token@plt>
mov    %eax,%edi
mov    -0x10(%rbp),%rsi
call   1050 <token_queue_push@plt>
jmp    1147 <tokenize+0x17>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tokenize>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    %rdi,(%rsp)
xor    %eax,%eax
call   1030 <token_queue_init@plt>
mov    %rax,%rbx
cmpb   $0x0,(%r14)
je     116b <tokenize+0x3b>
mov    %rsp,%r14
xchg   %ax,%ax
mov    %r14,%rdi
call   1040 <read_token@plt>
mov    %eax,%edi
mov    %rbx,%rsi
call   1050 <token_queue_push@plt>
mov    (%rsp),%rax
cmpb   $0x0,(%rax)
jne    1150 <tokenize+0x20>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.token_queue_s = type { i32 }
define %struct.token_queue_s* @tokenize(i8* %0) {
%2 = alloca i8*
%3 = alloca %struct.token_queue_s*
store i8* %0, i8** %2
%4 = call %struct.token_queue_s* (...) @token_queue_init()
store %struct.token_queue_s* %4, %struct.token_queue_s** %3
br label %5
5: ; preds = %9, %1
%6 = load i8*, i8** %2
%7 = load i8, i8* %6
%8 = icmp ne i8 %7, 0
br i1 %8, label %9, label %13
9: ; preds = %5
%10 = call i32 @read_token(i8** %2)
%11 = load %struct.token_queue_s*, %struct.token_queue_s** %3
%12 = call i32 @token_queue_push(i32 %10, %struct.token_queue_s* %11)
br label %5
13: ; preds = %5
%14 = load %struct.token_queue_s*, %struct.token_queue_s** %3
ret %struct.token_queue_s* %14
}

LLVM IR (-O2):
%struct.token_queue_s = type { i32 }
define %struct.token_queue_s* @tokenize(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = tail call %struct.token_queue_s* (...) @token_queue_init()
%4 = load i8, i8* %0
%5 = icmp eq i8 %4, 0
br i1 %5, label %12, label %6
6: ; preds = %1, %6
%7 = call i32 @read_token(i8** %2)
%8 = call i32 @token_queue_push(i32 %7, %struct.token_queue_s* %3)
%9 = load i8*, i8** %2
%10 = load i8, i8* %9
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %6
12: ; preds = %6, %1
ret %struct.token_queue_s* %3
}
int ipc_sock_unlock_q(void *dri_if) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @ipc_sock_unlock_q(i8* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ print_num(unsigned long long, int, char *);
void print_hex(unsigned long long n) { print_num(n, 16, "0x%s\n"); }


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

x86 assembly (clang, -O2):
<print_hex>:
lea    0xee9(%rip),%rdx
mov    $0x10,%esi
jmp    1030 <print_num@plt>

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

LLVM IR (-O2):
@.str = [6 x i8] c"0x%s\0A\00"
define void @print_hex(i64 %0) {
%2 = tail call i32 @print_num(i64 %0, i32 16, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
double exp(double);
double log(int);
double efunc(double x) { return exp(-x * x) * log(1 - x); }


x86 assembly (clang, -O0):
<efunc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  -0x8(%rbp),%xmm0
call   1030 <exp@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  0xea0(%rip),%xmm0
subsd  -0x8(%rbp),%xmm0
cvttsd2si %xmm0,%edi
call   1040 <log@plt>
movaps %xmm0,%xmm1
movsd  -0x10(%rbp),%xmm0
mulsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<efunc>:
sub    $0x28,%rsp
movapd %xmm0,%xmm1
movapd %xmm0,0x10(%rsp)
movapd 0xeca(%rip),%xmm0
xorpd  %xmm1,%xmm0
mulsd  %xmm1,%xmm0
call   1030 <exp@plt>
movsd  %xmm0,0x8(%rsp)
movsd  0xebf(%rip),%xmm0
subsd  0x10(%rsp),%xmm0
cvttsd2si %xmm0,%edi
call   1040 <log@plt>
mulsd  0x8(%rsp),%xmm0
add    $0x28,%rsp
ret

LLVM IR (-O0):
define double @efunc(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fneg double %3
%5 = load double, double* %2
%6 = fmul double %4, %5
%7 = call double @exp(double %6)
%8 = load double, double* %2
%9 = fsub double 1.000000e+00, %8
%10 = fptosi double %9 to i32
%11 = call double @log(i32 %10)
%12 = fmul double %7, %11
ret double %12
}

LLVM IR (-O2):
define double @efunc(double %0) {
%2 = fneg double %0
%3 = fmul double %2, %0
%4 = tail call double @exp(double %3)
%5 = fsub double 1.000000e+00, %0
%6 = fptosi double %5 to i32
%7 = tail call double @log(i32 %6)
%8 = fmul double %4, %7
ret double %8
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  scalar_t__ window;
};
struct TYPE_4__ {
  TYPE_1__ xkeymap;
};
typedef TYPE_2__ XEvent;

/* Variables and functions */
unsigned long get_XEvent_xkeymap_window(void *_p) {
  return (unsigned long)((XEvent *)_p)->xkeymap.window;
}


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

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

LLVM IR (-O0):
%struct.TYPE_4__ = type { %struct.TYPE_3__ }
%struct.TYPE_3__ = type { i64 }
define i64 @get_XEvent_xkeymap_window(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.TYPE_4__*
%5 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %4, i32 0, i32 0
%6 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %5, i32 0, i32 0
%7 = load i64, i64* %6
ret i64 %7
}

LLVM IR (-O2):
define i64 @get_XEvent_xkeymap_window(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
ret i64 %3
}
int null_pointer() {
  int *p = 0;
  return *p;
}


x86 assembly (clang, -O0):
<null_pointer>:
push   %rbp
mov    %rsp,%rbp
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @null_pointer() {
ret i32 undef
}
/* Type definitions */
struct katcl_gueue {
  int dummy;
};

/* Variables and functions */
struct katcl_gueue *create_precedence_gueue_katcl(void (*)(void *),
                                                  int /*<<< orphan*/ *);
struct katcl_gueue *create_gueue_katcl(void (*release)(void *datum)) {
  return create_precedence_gueue_katcl(release, NULL);
}


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

x86 assembly (clang, -O2):
<create_gueue_katcl>:
xor    %esi,%esi
jmp    1030 <create_precedence_gueue_katcl@plt>

LLVM IR (-O0):
%struct.katcl_gueue = type { i32 }
define %struct.katcl_gueue* @create_gueue_katcl(void (i8*)* %0) {
%2 = alloca void (i8*)*
store void (i8*)* %0, void (i8*)** %2
%3 = load void (i8*)*, void (i8*)** %2
%4 = call %struct.katcl_gueue* @create_precedence_gueue_katcl(void (i8*)* %3, i32* null)
ret %struct.katcl_gueue* %4
}

LLVM IR (-O2):
%struct.katcl_gueue = type { i32 }
define %struct.katcl_gueue* @create_gueue_katcl(void (i8*)* %0) {
%2 = tail call %struct.katcl_gueue* @create_precedence_gueue_katcl(void (i8*)* %0, i32* null)
ret %struct.katcl_gueue* %2
}
/* Type definitions */
typedef double int32_t;

/* Variables and functions */
double exp(double);
int32_t altitude_to_pressure(int32_t altitude) {
  return (int32_t)(1013.0 * exp(-altitude / 7800000.0));
}


x86 assembly (clang, -O0):
<altitude_to_pressure>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  0xec7(%rip),%xmm1
divsd  %xmm1,%xmm0
call   1030 <exp@plt>
movaps %xmm0,%xmm1
movsd  0xeab(%rip),%xmm0
mulsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<altitude_to_pressure>:
push   %rax
divsd  0xee7(%rip),%xmm0
call   1030 <exp@plt>
mulsd  0xee2(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @altitude_to_pressure(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fneg double %3
%5 = fdiv double %4, 7.800000e+06
%6 = call double @exp(double %5)
%7 = fmul double 1.013000e+03, %6
ret double %7
}

LLVM IR (-O2):
define double @altitude_to_pressure(double %0) {
%2 = fdiv double %0, -7.800000e+06
%3 = tail call double @exp(double %2)
%4 = fmul double %3, 1.013000e+03
ret double %4
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
size_t list_meter_uint8_t(const void *el) {
  if (el) {
  }
  return sizeof(uint8_t);
}


x86 assembly (clang, -O0):
<list_meter_uint8_t>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1118 <list_meter_uint8_t+0x18>
jmp    1118 <list_meter_uint8_t+0x18>
mov    $0x4,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i64 @list_meter_uint8_t(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp ne i8* %3, null
br i1 %4, label %5, label %6
5: ; preds = %1
br label %6
6: ; preds = %5, %1
ret i64 4
}

LLVM IR (-O2):
define i64 @list_meter_uint8_t(i8* nocapture readnone %0) {
ret i64 4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void handle_noop(void) { printf("NOOP\n"); }


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

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

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

LLVM IR (-O2):
@str = [5 x i8] c"NOOP\00"
define void @handle_noop() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str, i64 0, i64 0))
ret void
}
float asinf(float x) { return __builtin_asinf(x); }


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

x86 assembly (clang, -O2):
<asinf>:
movss  0xef8(%rip),%xmm1
ucomiss %xmm0,%xmm1
ja     1120 <asinf+0x20>
ucomiss 0xef0(%rip),%xmm0
ja     1120 <asinf+0x20>
ret
nopw   0x0(%rax,%rax,1)
jmp    1120 <asinf+0x20>

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

LLVM IR (-O2):
define float @asinf(float %0) {
%2 = fcmp ogt float %0, 1.000000e+00
%3 = fcmp olt float %0, -1.000000e+00
%4 = or i1 %3, %2
br i1 %4, label %5, label %6
5: ; preds = %1, %5
br label %5
6: ; preds = %1
ret float undef
}
/* Type definitions */
typedef unsigned long volatile uint32_t;

/* Variables and functions */
void FlashIntDisable(uint32_t ui32IntFlags) {
  (*((volatile unsigned long *)(0x40030000 + 0x00002288))) = 5;
  (*((volatile unsigned long *)(0x40030000 + 0x0000227C))) &= ~ui32IntFlags;
  (*((volatile unsigned long *)(0x40030000 + 0x00002288))) = 2;
}


x86 assembly (clang, -O0):
<FlashIntDisable>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    $0x40032288,%eax
movq   $0x5,(%rax)
mov    -0x8(%rbp),%rax
xor    $0xffffffffffffffff,%rax
mov    $0x4003227c,%ecx
mov    (%rcx),%rcx
and    %rax,%rcx
mov    $0x4003227c,%eax
mov    %rcx,(%rax)
mov    $0x40032288,%eax
movq   $0x2,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<FlashIntDisable>:
mov    %rdi,-0x8(%rsp)
movq   $0x5,0x40032288
mov    -0x8(%rsp),%rax
not    %rax
and    %rax,0x4003227c
40
movq   $0x2,0x40032288
ret

LLVM IR (-O0):
define void @FlashIntDisable(i64 %0) {
%2 = alloca i64
store volatile i64 %0, i64* %2
store volatile i64 5, i64* inttoptr (i64 1073947272 to i64*)
%3 = load volatile i64, i64* %2
%4 = xor i64 %3, -1
%5 = load volatile i64, i64* inttoptr (i64 1073947260 to i64*)
%6 = and i64 %5, %4
store volatile i64 %6, i64* inttoptr (i64 1073947260 to i64*)
store volatile i64 2, i64* inttoptr (i64 1073947272 to i64*)
ret void
}

LLVM IR (-O2):
define void @FlashIntDisable(i64 %0) {
%2 = alloca i64
store volatile i64 %0, i64* %2
store volatile i64 5, i64* inttoptr (i64 1073947272 to i64*)
%3 = load volatile i64, i64* %2
%4 = xor i64 %3, -1
%5 = load volatile i64, i64* inttoptr (i64 1073947260 to i64*)
%6 = and i64 %5, %4
store volatile i64 %6, i64* inttoptr (i64 1073947260 to i64*)
store volatile i64 2, i64* inttoptr (i64 1073947272 to i64*)
ret void
}