xunge/DecIR huggingface dataset:
/* Type definitions */
struct uhid_event {
  int /*<<< orphan*/ type;
};
typedef int /*<<< orphan*/ ev;

/* Variables and functions */
int /*<<< orphan*/ UHID_DESTROY;
int /*<<< orphan*/ memset(struct uhid_event *, int /*<<< orphan*/, int);
int /*<<< orphan*/ uhid_write(int, struct uhid_event *);
void destroy(int fd) {
  struct uhid_event ev;
  memset(&ev, 0, sizeof(ev));
  ev.type = UHID_DESTROY;
  uhid_write(fd, &ev);
}


x86 assembly (clang, -O0):
<destroy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    -0x8(%rbp),%rdi
xor    %esi,%esi
mov    $0x4,%edx
call   1030 <memset@plt>
mov    0x2e9e(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x8(%rbp),%rsi
call   1040 <uhid_write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<destroy>:
push   %r14
push   %rbx
push   %rax
mov    %edi,%ebx
mov    %rsp,%r14
mov    %r14,%rdi
xor    %esi,%esi
mov    $0x4,%edx
call   1030 <memset@plt>
mov    0x2ea1(%rip),%rax
mov    (%rax),%eax
mov    %eax,(%rsp)
mov    %ebx,%edi
mov    %r14,%rsi
call   1040 <uhid_write@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.uhid_event = type { i32 }
@UHID_DESTROY = global i32 0
define void @destroy(i32 %0) {
%2 = alloca i32
%3 = alloca %struct.uhid_event
store i32 %0, i32* %2
%4 = call i32 @memset(%struct.uhid_event* %3, i32 0, i32 4)
%5 = load i32, i32* @UHID_DESTROY
%6 = getelementptr inbounds %struct.uhid_event, %struct.uhid_event* %3, i32 0, i32 0
store i32 %5, i32* %6
%7 = load i32, i32* %2
%8 = call i32 @uhid_write(i32 %7, %struct.uhid_event* %3)
ret void
}

LLVM IR (-O2):
%struct.uhid_event = type { i32 }
@UHID_DESTROY = global i32 0
define void @destroy(i32 %0) {
%2 = alloca %struct.uhid_event
%3 = bitcast %struct.uhid_event* %2 to i8*
%4 = call i32 @memset(%struct.uhid_event* %2, i32 0, i32 4)
%5 = load i32, i32* @UHID_DESTROY
%6 = getelementptr inbounds %struct.uhid_event, %struct.uhid_event* %2, i64 0, i32 0
store i32 %5, i32* %6
%7 = call i32 @uhid_write(i32 %0, %struct.uhid_event* %2)
ret void
}
/* Variables and functions */
int unknown_function();
int mone_to_one() {
  int x = unknown_function();
  if (x >= -1 && x <= 1) {
    return x;
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<mone_to_one>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <unknown_function@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0xffffffff,-0x8(%rbp)
jl     1141 <mone_to_one+0x31>
cmpl   $0x1,-0x8(%rbp)
jg     1141 <mone_to_one+0x31>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1148 <mone_to_one+0x38>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mone_to_one>:
push   %rbx
xor    %ebx,%ebx
xor    %eax,%eax
call   1030 <unknown_function@plt>
lea    0x1(%rax),%ecx
cmp    $0x3,%ecx
cmovae %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @mone_to_one() {
%1 = tail call i32 (...) @unknown_function()
%2 = add i32 %1, 1
%3 = icmp ult i32 %2, 3
%4 = select i1 %3, i32 %1, i32 0
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int print(const void *datum) {
  printf("%s ", (char *)datum);
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s \00"
define i32 @print(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
ret i32 0
}
/* Type definitions */
struct semaphore {
  int dummy;
};

/* Variables and functions */
int __down_interruptible(struct semaphore *);
int down_interruptible(struct semaphore *sem) {
  return __down_interruptible(sem);
}


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

x86 assembly (clang, -O2):
<down_interruptible>:
jmp    1030 <__down_interruptible@plt>

LLVM IR (-O0):
%struct.semaphore = type { i32 }
define i32 @down_interruptible(%struct.semaphore* %0) {
%2 = alloca %struct.semaphore*
store %struct.semaphore* %0, %struct.semaphore** %2
%3 = load %struct.semaphore*, %struct.semaphore** %2
%4 = call i32 @__down_interruptible(%struct.semaphore* %3)
ret i32 %4
}

LLVM IR (-O2):
%struct.semaphore = type { i32 }
define i32 @down_interruptible(%struct.semaphore* %0) {
%2 = tail call i32 @__down_interruptible(%struct.semaphore* %0)
ret i32 %2
}
/* Type definitions */
struct trace {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ handle_notify(struct trace *);
void check_record(struct trace *trace) { handle_notify(trace); }


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

x86 assembly (clang, -O2):
<check_record>:
jmp    1030 <handle_notify@plt>

LLVM IR (-O0):
%struct.trace = type { i32 }
define void @check_record(%struct.trace* %0) {
%2 = alloca %struct.trace*
store %struct.trace* %0, %struct.trace** %2
%3 = load %struct.trace*, %struct.trace** %2
%4 = call i32 @handle_notify(%struct.trace* %3)
ret void
}

LLVM IR (-O2):
%struct.trace = type { i32 }
define void @check_record(%struct.trace* %0) {
%2 = tail call i32 @handle_notify(%struct.trace* %0)
ret void
}
/* Variables and functions */
unsigned char receiveByte(unsigned char);
void receiveBlock(unsigned char reg, int len, unsigned char *buf) {
  buf += len;
  while (len-- > 0) {
    *--buf = receiveByte(reg);
  }
}


x86 assembly (clang, -O0):
<receiveBlock>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x8(%rbp),%ecx
mov    -0x10(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x8(%rbp)
cmp    $0x0,%eax
jle    116c <receiveBlock+0x5c>
movzbl -0x1(%rbp),%edi
call   1030 <receiveByte@plt>
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %rax,%rdx
add    $0xffffffffffffffff,%rdx
mov    %rdx,-0x10(%rbp)
mov    %cl,-0x1(%rax)
jmp    1136 <receiveBlock+0x26>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<receiveBlock>:
push   %rbp
push   %r14
push   %rbx
test   %esi,%esi
jle    1148 <receiveBlock+0x38>
mov    %rdx,%r14
mov    %esi,%ebx
movzbl %dil,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %ebp,%edi
call   1030 <receiveByte@plt>
mov    %al,-0x1(%r14,%rbx,1)
add    $0xffffffffffffffff,%rbx
lea    0x1(%rbx),%eax
cmp    $0x1,%eax
ja     1130 <receiveBlock+0x20>
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define void @receiveBlock(i8 zeroext %0, i32 %1, i8* nocapture writeonly %2) {
%4 = icmp sgt i32 %1, 0
br i1 %4, label %5, label %15
5: ; preds = %3
%6 = zext i32 %1 to i64
%7 = getelementptr inbounds i8, i8* %2, i64 %6
br label %8
8: ; preds = %5, %8
%9 = phi i8* [ %13, %8 ], [ %7, %5 ]
%10 = phi i32 [ %11, %8 ], [ %1, %5 ]
%11 = add nsw i32 %10, -1
%12 = tail call zeroext i8 @receiveByte(i8 zeroext %0)
%13 = getelementptr inbounds i8, i8* %9, i64 -1
store i8 %12, i8* %13
%14 = icmp ugt i32 %10, 1
br i1 %14, label %8, label %15
15: ; preds = %8, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ munmap(void *, size_t);
void free_noaccess_page(void *ptr, size_t size) {
  if (ptr) {
    munmap(ptr, size);
  }
}


x86 assembly (clang, -O0):
<free_noaccess_page>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1138 <free_noaccess_page+0x28>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <munmap@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_noaccess_page>:
test   %rdi,%rdi
je     111a <free_noaccess_page+0xa>
jmp    1030 <munmap@plt>
ret

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

LLVM IR (-O2):
define void @free_noaccess_page(i8* %0, i64 %1) {
%3 = icmp eq i8* %0, null
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i32 @munmap(i8* %0, i64 %1)
br label %6
6: ; preds = %4, %2
ret void
}
int comp(const void *a, const void *b) {
  const int *x = a;
  const int *y = b;
  return *y - *x;
}


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

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

LLVM IR (-O0):
define i32 @comp(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32*
%6 = alloca i32*
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = bitcast i8* %7 to i32*
store i32* %8, i32** %5
%9 = load i8*, i8** %4
%10 = bitcast i8* %9 to i32*
store i32* %10, i32** %6
%11 = load i32*, i32** %6
%12 = load i32, i32* %11
%13 = load i32*, i32** %5
%14 = load i32, i32* %13
%15 = sub nsw i32 %12, %14
ret i32 %15
}

LLVM IR (-O2):
define i32 @comp(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = bitcast i8* %1 to i32*
%5 = load i32, i32* %4
%6 = load i32, i32* %3
%7 = sub nsw i32 %5, %6
ret i32 %7
}
void snd_ak4114_suspend(struct ak4114 *chip) {}


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

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

LLVM IR (-O0):
%struct.ak4114 = type opaque
define void @snd_ak4114_suspend(%struct.ak4114* %0) {
%2 = alloca %struct.ak4114*
store %struct.ak4114* %0, %struct.ak4114** %2
ret void
}

LLVM IR (-O2):
%struct.ak4114 = type opaque
define void @snd_ak4114_suspend(%struct.ak4114* nocapture %0) {
ret void
}
/* Variables and functions */
scalar_t__ malloc(scalar_t__);
int /*<<< orphan*/ strcpy(char *, char *);
scalar_t__ strlen(char *);
char *_strdup(char *s) {
  char *p;
  p = (char *)malloc(strlen(s) + 1);
  if (p != NULL)
    strcpy(p, s);
  return p;
}


x86 assembly (clang, -O0):
<_strdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rdi
add    $0x1,%rdi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     116d <_strdup+0x3d>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_strdup>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <strlen@plt>
lea    0x1(%rax),%rdi
call   1050 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
je     1158 <_strdup+0x28>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @_strdup(i8* %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add nsw i64 %2, 1
%4 = tail call i64 @malloc(i64 %3)
%5 = inttoptr i64 %4 to i8*
%6 = icmp eq i64 %4, 0
br i1 %6, label %9, label %7
7: ; preds = %1
%8 = tail call i32 @strcpy(i8* %5, i8* %0)
br label %9
9: ; preds = %7, %1
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ has_last_slash(char *);
int /*<<< orphan*/ strcat(char *, char *);
char *add_last_slash(char *path) {
  if (path && !has_last_slash(path))
    strcat(path, "/");
  return path;
}


x86 assembly (clang, -O0):
<add_last_slash>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1159 <add_last_slash+0x39>
mov    -0x8(%rbp),%rdi
call   1030 <has_last_slash@plt>
cmp    $0x0,%eax
jne    1159 <add_last_slash+0x39>
mov    -0x8(%rbp),%rdi
lea    0xeac(%rip),%rsi
call   1040 <strcat@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<add_last_slash>:
push   %rbx
mov    %rdi,%rbx
test   %rdi,%rdi
je     1144 <add_last_slash+0x24>
mov    %rbx,%rdi
call   1030 <has_last_slash@plt>
test   %eax,%eax
jne    1144 <add_last_slash+0x24>
lea    0xec4(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcat@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [2 x i8] c"/\00"
define i8* @add_last_slash(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 %12
5: ; preds = %1
%6 = load i8*, i8** %2
%7 = call i32 @has_last_slash(i8* %6)
%8 = icmp ne i32 %7, 0
br i1 %8, label %12, label %9
9: ; preds = %5
%10 = load i8*, i8** %2
%11 = call i32 @strcat(i8* %10, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
br label %12
12: ; preds = %9, %5, %1
%13 = load i8*, i8** %2
ret i8* %13
}

LLVM IR (-O2):
@.str = [2 x i8] c"/\00"
define i8* @add_last_slash(i8* returned %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %8, label %3
3: ; preds = %1
%4 = tail call i32 @has_last_slash(i8* %0)
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %3
%7 = tail call i32 @strcat(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %3, %1
ret i8* %0
}
int toupper(int c) {
  if ((unsigned int)c > 255)
    return (c);
  else if (c >= 'A' && c <= 'Z')
    return (c + 'a' - 'A');
  else
    return (c);
}


x86 assembly (clang, -O0):
<toupper>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0xff,-0x8(%rbp)
jbe    111f <toupper+0x1f>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    114a <toupper+0x4a>
cmpl   $0x41,-0x8(%rbp)
jl     1144 <toupper+0x44>
cmpl   $0x5a,-0x8(%rbp)
jg     1144 <toupper+0x44>
mov    -0x8(%rbp),%eax
add    $0x61,%eax
sub    $0x41,%eax
mov    %eax,-0x4(%rbp)
jmp    114a <toupper+0x4a>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<toupper>:
lea    -0x41(%rdi),%ecx
lea    0x20(%rdi),%eax
cmp    $0x1a,%ecx
cmovae %edi,%eax
ret

LLVM IR (-O0):
define i32 @toupper(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp ugt i32 %4, 255
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = load i32, i32* %3
store i32 %7, i32* %2
br label %20
8: ; preds = %1
%9 = load i32, i32* %3
%10 = icmp sge i32 %9, 65
br i1 %10, label %11, label %18
11: ; preds = %8
%12 = load i32, i32* %3
%13 = icmp sle i32 %12, 90
br i1 %13, label %14, label %18
14: ; preds = %11
%15 = load i32, i32* %3
%16 = add nsw i32 %15, 97
%17 = sub nsw i32 %16, 65
store i32 %17, i32* %2
br label %20
18: ; preds = %11, %8
%19 = load i32, i32* %3
store i32 %19, i32* %2
br label %20
20: ; preds = %18, %14, %6
%21 = load i32, i32* %2
ret i32 %21
}

LLVM IR (-O2):
define i32 @toupper(i32 %0) {
%2 = add i32 %0, -65
%3 = icmp ult i32 %2, 26
%4 = add nsw i32 %0, 32
%5 = select i1 %3, i32 %4, i32 %0
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, int, int /*<<< orphan*/, int,
                           char *);
const char *get_version() {
  static char verstr[128];
  sprintf(verstr, "Version %d.%d Build %d (%s)", 1, 0, 35, "Mar 16 2022");
  return verstr;
}


x86 assembly (clang, -O0):
<get_version>:
push   %rbp
mov    %rsp,%rbp
lea    0x2f25(%rip),%rdi
lea    0xede(%rip),%rsi
mov    $0x1,%edx
xor    %ecx,%ecx
mov    $0x23,%r8d
lea    0xee6(%rip),%r9
call   1030 <sprintf@plt>
lea    0x2efe(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_version>:
push   %rbx
lea    0x2f28(%rip),%rbx
lea    0xee1(%rip),%rsi
lea    0xef6(%rip),%r9
mov    %rbx,%rdi
mov    $0x1,%edx
xor    %ecx,%ecx
mov    $0x23,%r8d
call   1030 <sprintf@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@get_version.verstr = internal global [128 x i8] zeroinitializer
@.str = [28 x i8] c"Version %d.%d Build %d (%s)\00"
@.str.1 = [12 x i8] c"Mar 16 2022\00"
define i8* @get_version() {
%1 = call i32 @sprintf(i8* getelementptr inbounds ([128 x i8], [128 x i8]* @get_version.verstr, i64 0, i64 0), i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i32 1, i32 0, i32 35, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
ret i8* getelementptr inbounds ([128 x i8], [128 x i8]* @get_version.verstr, i64 0, i64 0)
}

LLVM IR (-O2):
@get_version.verstr = internal global [128 x i8] zeroinitializer
@.str = [28 x i8] c"Version %d.%d Build %d (%s)\00"
@.str.1 = [12 x i8] c"Mar 16 2022\00"
define i8* @get_version() {
%1 = tail call i32 @sprintf(i8* dereferenceable(1) getelementptr inbounds ([128 x i8], [128 x i8]* @get_version.verstr, i64 0, i64 0), i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i32 1, i32 0, i32 35, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
ret i8* getelementptr inbounds ([128 x i8], [128 x i8]* @get_version.verstr, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ UARTConsolePutc(int);
int uart_putc(int ch) { UARTConsolePutc(ch); }


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

x86 assembly (clang, -O2):
<uart_putc>:
jmp    1030 <UARTConsolePutc@plt>

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

LLVM IR (-O2):
define i32 @uart_putc(i32 %0) {
%2 = tail call i32 @UARTConsolePutc(i32 %0)
ret i32 undef
}
int test_imm_1Duint64_lowword_mem(unsigned long long *val) {
  return ((*val) & (0x1D << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_1Duint64_lowword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 29
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ jstp_tx_char(char);
void jstp_tx_array_begin() { jstp_tx_char('['); }


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

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

LLVM IR (-O0):
define void @jstp_tx_array_begin() {
%1 = call i32 @jstp_tx_char(i8 signext 91)
ret void
}

LLVM IR (-O2):
define void @jstp_tx_array_begin() {
%1 = tail call i32 @jstp_tx_char(i8 signext 91)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ zmalloc_free(char *);
scalar_t__ zmalloc_malloc(int);
int main(int argc, char **argv) {
  char *p;
  int i;
  ;
  for (i = 0; i < 100; i++) {
    p = (char *)zmalloc_malloc(sizeof(long long));
    if ((i % 9)) {
      zmalloc_free(p);
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x1c(%rbp)
cmpl   $0x64,-0x1c(%rbp)
jge    1185 <main+0x65>
mov    $0x8,%edi
call   1030 <zmalloc_malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x1c(%rbp),%eax
mov    $0x9,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
je     1172 <main+0x52>
mov    -0x18(%rbp),%rdi
call   1040 <zmalloc_free@plt>
jmp    1177 <main+0x57>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    113d <main+0x1d>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
xor    %r14d,%r14d
xor    %ebp,%ebp
jmp    113c <main+0x1c>
nopl   0x0(%rax,%rax,1)
add    $0xffffffff,%ebp
add    $0x1,%r14b
cmp    $0xffffff9c,%ebp
je     1164 <main+0x44>
movzbl %r14b,%eax
imul   $0x39,%eax,%eax
shr    $0x9,%eax
lea    (%rax,%rax,8),%ebx
neg    %ebx
mov    $0x8,%edi
call   1030 <zmalloc_malloc@plt>
cmp    %bpl,%bl
je     1130 <main+0x10>
mov    %rax,%rdi
call   1040 <zmalloc_free@plt>
jmp    1130 <main+0x10>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
br label %3
3: ; preds = %2, %12
%4 = phi i32 [ 0, %2 ], [ %13, %12 ]
%5 = tail call i64 @zmalloc_malloc(i32 8)
%6 = trunc i32 %4 to i8
%7 = urem i8 %6, 9
%8 = icmp eq i8 %7, 0
br i1 %8, label %12, label %9
9: ; preds = %3
%10 = inttoptr i64 %5 to i8*
%11 = tail call i32 @zmalloc_free(i8* %10)
br label %12
12: ; preds = %3, %9
%13 = add nuw nsw i32 %4, 1
%14 = icmp eq i32 %13, 100
br i1 %14, label %15, label %3
15: ; preds = %12
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ Interpolate_3(int /*<<< orphan*/, int, int /*<<< orphan*/,
                                 int, int /*<<< orphan*/, int, int);
void Interp10(uint32_t *pc, uint32_t c1, uint32_t c2, uint32_t c3) {
  *pc = Interpolate_3(c1, 14, c2, 1, c3, 1, 4);
}


x86 assembly (clang, -O0):
<Interp10>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    -0xc(%rbp),%edi
mov    -0x10(%rbp),%edx
mov    -0x14(%rbp),%r8d
mov    $0xe,%esi
mov    $0x1,%r9d
mov    %r9d,%ecx
movl   $0x4,(%rsp)
call   1030 <Interpolate_3@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Interp10>:
push   %rbx
sub    $0x10,%rsp
mov    %ecx,%r8d
mov    %rdi,%rbx
movl   $0x4,(%rsp)
mov    %esi,%edi
mov    $0xe,%esi
mov    $0x1,%ecx
mov    $0x1,%r9d
call   1030 <Interpolate_3@plt>
mov    %eax,(%rbx)
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @Interp10(i32* %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32* %0, i32** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32, i32* %6
%10 = load i32, i32* %7
%11 = load i32, i32* %8
%12 = call i32 @Interpolate_3(i32 %9, i32 14, i32 %10, i32 1, i32 %11, i32 1, i32 4)
%13 = load i32*, i32** %5
store i32 %12, i32* %13
ret void
}

LLVM IR (-O2):
define void @Interp10(i32* nocapture writeonly %0, i32 %1, i32 %2, i32 %3) {
%5 = tail call i32 @Interpolate_3(i32 %1, i32 14, i32 %2, i32 1, i32 %3, i32 1, i32 4)
store i32 %5, i32* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
char *malloc(int);
void testFixManipulatedPointerBeforeFree2() {
  char *r = malloc(sizeof(char));
  r = r + 10;
  free(r - 10);
}


x86 assembly (clang, -O0):
<testFixManipulatedPointerBeforeFree2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x1,%edi
call   1040 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0xa,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
add    $0xfffffffffffffff6,%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<testFixManipulatedPointerBeforeFree2>:
push   %rax
mov    $0x1,%edi
call   1040 <malloc@plt>
mov    %rax,%rdi
pop    %rax
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @testFixManipulatedPointerBeforeFree2() {
%1 = alloca i8*
%2 = call i8* @malloc(i32 1)
store i8* %2, i8** %1
%3 = load i8*, i8** %1
%4 = getelementptr inbounds i8, i8* %3, i64 10
store i8* %4, i8** %1
%5 = load i8*, i8** %1
%6 = getelementptr inbounds i8, i8* %5, i64 -10
%7 = call i32 @free(i8* %6)
ret void
}

LLVM IR (-O2):
define void @testFixManipulatedPointerBeforeFree2() {
%1 = tail call dereferenceable_or_null(1) i8* @malloc(i32 1)
%2 = tail call i32 @free(i8* %1)
ret void
}
void hidecursor(void) {}


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

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

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

LLVM IR (-O2):
define void @hidecursor() {
ret void
}
int XGetCommand() {}


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

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

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

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

/* Variables and functions */
int minipmi_parse(struct minipmi_context *, char);
int minipmi_version2_parse(struct minipmi_context *ctx) {
  return minipmi_parse(ctx, ';');
}


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

x86 assembly (clang, -O2):
<minipmi_version2_parse>:
mov    $0x3b,%esi
jmp    1030 <minipmi_parse@plt>

LLVM IR (-O0):
%struct.minipmi_context = type { i32 }
define i32 @minipmi_version2_parse(%struct.minipmi_context* %0) {
%2 = alloca %struct.minipmi_context*
store %struct.minipmi_context* %0, %struct.minipmi_context** %2
%3 = load %struct.minipmi_context*, %struct.minipmi_context** %2
%4 = call i32 @minipmi_parse(%struct.minipmi_context* %3, i8 signext 59)
ret i32 %4
}

LLVM IR (-O2):
%struct.minipmi_context = type { i32 }
define i32 @minipmi_version2_parse(%struct.minipmi_context* %0) {
%2 = tail call i32 @minipmi_parse(%struct.minipmi_context* %0, i8 signext 59)
ret i32 %2
}
clrmes(f, n) int f, n;
{
  mlforce("");
  return (1);
}


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

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

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define i32 @clrmes(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = call i32 (i8*, ...) bitcast (i32 (...)* @mlforce to i32 (i8*, ...)*)(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
ret i32 1
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
define i32 @clrmes(i32 %0, i32 %1) {
%3 = tail call i32 (i8*, ...) bitcast (i32 (...)* @mlforce to i32 (i8*, ...)*)(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ tprintf(char *, double, double, char *, char *);
void putTextPicture(double px, double py, char *pos, char *text) {
  tprintf("\\put(%3.4f,%3.4f){\\makebox(0,0)%s{%s}}\n", px, py, pos, text);
}


x86 assembly (clang, -O0):
<putTextPicture>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
mov    %rdi,-0x18(%rbp)
mov    %rsi,-0x20(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
lea    0xebd(%rip),%rdi
call   1030 <tprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<putTextPicture>:
mov    %rsi,%rdx
mov    %rdi,%rsi
lea    0xee3(%rip),%rdi
jmp    1030 <tprintf@plt>

LLVM IR (-O0):
@.str = [40 x i8] c"\\put(%3.4f,%3.4f){\\makebox(0,0)%s{%s}}\0A\00"
define void @putTextPicture(double %0, double %1, i8* %2, i8* %3) {
%5 = alloca double
%6 = alloca double
%7 = alloca i8*
%8 = alloca i8*
store double %0, double* %5
store double %1, double* %6
store i8* %2, i8** %7
store i8* %3, i8** %8
%9 = load double, double* %5
%10 = load double, double* %6
%11 = load i8*, i8** %7
%12 = load i8*, i8** %8
%13 = call i32 @tprintf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0), double %9, double %10, i8* %11, i8* %12)
ret void
}

LLVM IR (-O2):
@.str = [40 x i8] c"\\put(%3.4f,%3.4f){\\makebox(0,0)%s{%s}}\0A\00"
define void @putTextPicture(double %0, double %1, i8* %2, i8* %3) {
%5 = tail call i32 @tprintf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0), double %0, double %1, i8* %2, i8* %3)
ret void
}
OP(ed, e6) { illegal_2(); }


x86 assembly (clang, -O0):
<OP>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    $0x0,%al
call   1030 <illegal_2@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @OP(i32 %0, i32 %1) {
%3 = tail call i32 (...) @illegal_2()
ret i32 undef
}
/* Variables and functions */
short convert(int);
int a52_resample_MONO_to_1_C(float *_f, signed short *s16) {
  int i;
  signed int *f = (signed int *)_f;
  for (i = 0; i < 256; i++) {
    s16[i] = convert(f[i]);
  }
  return 1 * 256;
}


x86 assembly (clang, -O0):
<a52_resample_MONO_to_1_C>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x100,-0x14(%rbp)
jge    1169 <a52_resample_MONO_to_1_C+0x59>
mov    -0x20(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,4),%edi
call   1030 <convert@plt>
mov    %ax,%dx
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    %dx,(%rax,%rcx,2)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    112f <a52_resample_MONO_to_1_C+0x1f>
mov    $0x100,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<a52_resample_MONO_to_1_C>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%r15
xor    %ebx,%ebx
nopl   (%rax)
mov    (%r15,%rbx,4),%edi
call   1030 <convert@plt>
mov    %ax,(%r14,%rbx,2)
add    $0x1,%rbx
cmp    $0x100,%rbx
jne    1120 <a52_resample_MONO_to_1_C+0x10>
mov    $0x100,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i32 @a52_resample_MONO_to_1_C(float* nocapture %0, i16* nocapture writeonly %1) {
br label %3
3: ; preds = %2, %3
%4 = phi i64 [ 0, %2 ], [ %10, %3 ]
%5 = getelementptr inbounds float, float* %0, i64 %4
%6 = bitcast float* %5 to i32*
%7 = load i32, i32* %6
%8 = tail call signext i16 @convert(i32 %7)
%9 = getelementptr inbounds i16, i16* %1, i64 %4
store i16 %8, i16* %9
%10 = add nuw nsw i64 %4, 1
%11 = icmp eq i64 %10, 256
br i1 %11, label %12, label %3
12: ; preds = %3
ret i32 256
}
void ft_get_values(char **data, char **s1, char **s2, char **n) {
  *s1 = data[0];
  *s2 = data[1];
  *n = data[2];
}


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

x86 assembly (clang, -O2):
<ft_get_values>:
mov    (%rdi),%rax
mov    %rax,(%rsi)
mov    0x8(%rdi),%rax
mov    %rax,(%rdx)
mov    0x10(%rdi),%rax
mov    %rax,(%rcx)
ret

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

LLVM IR (-O2):
define void @ft_get_values(i8** nocapture %0, i8** nocapture writeonly %1, i8** nocapture writeonly %2, i8** nocapture writeonly %3) {
%5 = load i8*, i8** %0
store i8* %5, i8** %1
%6 = getelementptr inbounds i8*, i8** %0, i64 1
%7 = load i8*, i8** %6
store i8* %7, i8** %2
%8 = getelementptr inbounds i8*, i8** %0, i64 2
%9 = load i8*, i8** %8
store i8* %9, i8** %3
ret void
}
/* Variables and functions */
int __semihost(int, int /*<<< orphan*/ *);
int semihost_vbus(void) { return __semihost(((0x100) + 3), NULL); }


x86 assembly (clang, -O0):
<semihost_vbus>:
push   %rbp
mov    %rsp,%rbp
mov    $0x103,%edi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <__semihost@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<semihost_vbus>:
mov    $0x103,%edi
xor    %esi,%esi
jmp    1030 <__semihost@plt>

LLVM IR (-O0):
define i32 @semihost_vbus() {
%1 = call i32 @__semihost(i32 259, i32* null)
ret i32 %1
}

LLVM IR (-O2):
define i32 @semihost_vbus() {
%1 = tail call i32 @__semihost(i32 259, i32* null)
ret i32 %1
}
/* Type definitions */
struct mux {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ mux_unlock(struct mux *);
void sender_cleanup(void *arg) {
  struct mux *m;
  m = (struct mux *)arg;
  mux_unlock(m);
}


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

x86 assembly (clang, -O2):
<sender_cleanup>:
jmp    1030 <mux_unlock@plt>

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

LLVM IR (-O2):
%struct.mux = type { i32 }
define void @sender_cleanup(i8* %0) {
%2 = bitcast i8* %0 to %struct.mux*
%3 = tail call i32 @mux_unlock(%struct.mux* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ test_writev();
int main() {
  printf("test writev\n");
  test_writev();
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [13 x i8] c"test writev\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (...) @test_writev()
ret i32 0
}

LLVM IR (-O2):
@str = [12 x i8] c"test writev\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (...) @test_writev()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ ispunct(int);
void t_ispunct_0x40() {
  Assert_real((ispunct(64)),
              "/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_ispunct.c",
              325, ("ispunct should be 1 for @"));
}


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

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

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

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_ispunct.c\00"
@.str.1 = [26 x i8] c"ispunct should be 1 for @\00"
define void @t_ispunct_0x40() {
%1 = tail call i32 @ispunct(i32 64)
%2 = tail call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 325, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Control_Reg_1_SaveConfig();
void Control_Reg_1_Sleep(void) { Control_Reg_1_SaveConfig(); }


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

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

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

LLVM IR (-O2):
define void @Control_Reg_1_Sleep() {
%1 = tail call i32 (...) @Control_Reg_1_SaveConfig()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ WINDOW;

/* Variables and functions */
int /*<<< orphan*/ mvwaddch(int /*<<< orphan*/ *, int, int, char);
void clearblock(WINDOW **w, int x, int y) {
  mvwaddch(w[1], y, x * 2, ' ');
  mvwaddch(w[1], y, x * 2 + 1, ' ');
}


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

x86 assembly (clang, -O2):
<clearblock>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%r14d
mov    %esi,%ebx
mov    %rdi,%rbp
mov    0x8(%rdi),%rdi
lea    (%rbx,%rbx,1),%edx
mov    %r14d,%esi
mov    $0x20,%ecx
call   1030 <mvwaddch@plt>
mov    0x8(%rbp),%rdi
lea    (%rbx,%rbx,1),%edx
add    $0x1,%edx
mov    %r14d,%esi
mov    $0x20,%ecx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <mvwaddch@plt>

LLVM IR (-O0):
define void @clearblock(i32** %0, i32 %1, i32 %2) {
%4 = alloca i32**
%5 = alloca i32
%6 = alloca i32
store i32** %0, i32*** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32**, i32*** %4
%8 = getelementptr inbounds i32*, i32** %7, i64 1
%9 = load i32*, i32** %8
%10 = load i32, i32* %6
%11 = load i32, i32* %5
%12 = mul nsw i32 %11, 2
%13 = call i32 @mvwaddch(i32* %9, i32 %10, i32 %12, i8 signext 32)
%14 = load i32**, i32*** %4
%15 = getelementptr inbounds i32*, i32** %14, i64 1
%16 = load i32*, i32** %15
%17 = load i32, i32* %6
%18 = load i32, i32* %5
%19 = mul nsw i32 %18, 2
%20 = add nsw i32 %19, 1
%21 = call i32 @mvwaddch(i32* %16, i32 %17, i32 %20, i8 signext 32)
ret void
}

LLVM IR (-O2):
define void @clearblock(i32** nocapture %0, i32 %1, i32 %2) {
%4 = getelementptr inbounds i32*, i32** %0, i64 1
%5 = load i32*, i32** %4
%6 = shl nsw i32 %1, 1
%7 = tail call i32 @mvwaddch(i32* %5, i32 %2, i32 %6, i8 signext 32)
%8 = load i32*, i32** %4
%9 = or i32 %6, 1
%10 = tail call i32 @mvwaddch(i32* %8, i32 %2, i32 %9, i8 signext 32)
ret void
}
void user_enter(void) {}


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

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

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

LLVM IR (-O2):
define void @user_enter() {
ret void
}
int PLAL_FS450_UIM_mode(void) { return 3; }


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

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

LLVM IR (-O0):
define i32 @PLAL_FS450_UIM_mode() {
ret i32 3
}

LLVM IR (-O2):
define i32 @PLAL_FS450_UIM_mode() {
ret i32 3
}
int int_to_bits(int value) {
  unsigned int uvalue = *(unsigned *)&value;
  unsigned int p = 1;
  int bits = 0;
  while (p != 0) {
    if (p & uvalue) {
      bits += 1;
    }
    p <<= 1;
  }
  return bits;
}


x86 assembly (clang, -O0):
<int_to_bits>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     114b <int_to_bits+0x4b>
mov    -0xc(%rbp),%eax
and    -0x8(%rbp),%eax
cmp    $0x0,%eax
je     113d <int_to_bits+0x3d>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    111b <int_to_bits+0x1b>
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<int_to_bits>:
mov    $0x1,%ecx
xor    %eax,%eax
nopw   0x0(%rax,%rax,1)
mov    %ecx,%edx
and    %edi,%edx
cmp    $0x1,%edx
sbb    $0xffffffff,%eax
lea    (%rcx,%rcx,1),%edx
and    %edi,%edx
cmp    $0x1,%edx
sbb    $0xffffffff,%eax
lea    0x0(,%rcx,4),%edx
and    %edi,%edx
cmp    $0x1,%edx
sbb    $0xffffffff,%eax
lea    0x0(,%rcx,8),%edx
and    %edi,%edx
cmp    $0x1,%edx
sbb    $0xffffffff,%eax
shl    $0x4,%ecx
jne    1110 <int_to_bits+0x10>
ret

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

LLVM IR (-O2):
define i32 @int_to_bits(i32 %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i32 [ 0, %1 ], [ %23, %2 ]
%4 = phi i32 [ 1, %1 ], [ %24, %2 ]
%5 = and i32 %4, %0
%6 = icmp ne i32 %5, 0
%7 = zext i1 %6 to i32
%8 = add nuw nsw i32 %3, %7
%9 = shl i32 %4, 1
%10 = and i32 %9, %0
%11 = icmp ne i32 %10, 0
%12 = zext i1 %11 to i32
%13 = add nuw nsw i32 %8, %12
%14 = shl i32 %4, 2
%15 = and i32 %14, %0
%16 = icmp ne i32 %15, 0
%17 = zext i1 %16 to i32
%18 = add nuw nsw i32 %13, %17
%19 = shl i32 %4, 3
%20 = and i32 %19, %0
%21 = icmp ne i32 %20, 0
%22 = zext i1 %21 to i32
%23 = add nuw nsw i32 %18, %22
%24 = shl i32 %4, 4
%25 = icmp eq i32 %24, 0
br i1 %25, label %26, label %2
26: ; preds = %2
ret i32 %23
}
/* Variables and functions */
int inp_emulate(int);
char TOSH_READ_YELLOW_LED_PIN() { return 0x01 & (inp_emulate(0x38) >> 5); }


x86 assembly (clang, -O0):
<TOSH_READ_YELLOW_LED_PIN>:
push   %rbp
mov    %rsp,%rbp
mov    $0x38,%edi
call   1030 <inp_emulate@plt>
sar    $0x5,%eax
and    $0x1,%eax
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<TOSH_READ_YELLOW_LED_PIN>:
push   %rax
mov    $0x38,%edi
call   1030 <inp_emulate@plt>
shr    $0x5,%al
and    $0x1,%al
pop    %rcx
ret

LLVM IR (-O0):
define signext i8 @TOSH_READ_YELLOW_LED_PIN() {
%1 = call i32 @inp_emulate(i32 56)
%2 = ashr i32 %1, 5
%3 = and i32 1, %2
%4 = trunc i32 %3 to i8
ret i8 %4
}

LLVM IR (-O2):
define signext i8 @TOSH_READ_YELLOW_LED_PIN() {
%1 = tail call i32 @inp_emulate(i32 56)
%2 = trunc i32 %1 to i8
%3 = lshr i8 %2, 5
%4 = and i8 %3, 1
ret i8 %4
}