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

/* Variables and functions */
int /*<<< orphan*/ ns_printf(struct ns_connection *, char *, int, char const *);
void send_http_error(struct ns_connection *nc, int code, const char *reason) {
  ns_printf(nc, "HTTP/1.1 %d %s\r\nContent-Length: 0\r\n\r\n", code, reason);
}


x86 assembly (clang, -O0):
<send_http_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
mov    -0x18(%rbp),%rcx
lea    0xecb(%rip),%rsi
call   1030 <ns_printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<send_http_error>:
mov    %rdx,%rcx
mov    %esi,%edx
lea    0xee4(%rip),%rsi
jmp    1030 <ns_printf@plt>

LLVM IR (-O0):
%struct.ns_connection = type { i32 }
@.str = [38 x i8] c"HTTP/1.1 %d %s\0D\0AContent-Length: 0\0D\0A\0D\0A\00"
define void @send_http_error(%struct.ns_connection* %0, i32 %1, i8* %2) {
%4 = alloca %struct.ns_connection*
%5 = alloca i32
%6 = alloca i8*
store %struct.ns_connection* %0, %struct.ns_connection** %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%7 = load %struct.ns_connection*, %struct.ns_connection** %4
%8 = load i32, i32* %5
%9 = load i8*, i8** %6
%10 = call i32 @ns_printf(%struct.ns_connection* %7, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), i32 %8, i8* %9)
ret void
}

LLVM IR (-O2):
%struct.ns_connection = type { i32 }
@.str = [38 x i8] c"HTTP/1.1 %d %s\0D\0AContent-Length: 0\0D\0A\0D\0A\00"
define void @send_http_error(%struct.ns_connection* %0, i32 %1, i8* %2) {
%4 = tail call i32 @ns_printf(%struct.ns_connection* %0, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), i32 %1, i8* %2)
ret void
}
int get_port_foo(void) {
  static int counter = 10000;
  return ++counter;
}


x86 assembly (clang, -O0):
<get_port_foo>:
push   %rbp
mov    %rsp,%rbp
mov    0x2f16(%rip),%eax
add    $0x1,%eax
mov    %eax,0x2f0d(%rip)
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_port_foo>:
mov    0x2f1a(%rip),%eax
add    $0x1,%eax
mov    %eax,0x2f11(%rip)
ret

LLVM IR (-O0):
@get_port_foo.counter = internal global i32 10000
define i32 @get_port_foo() {
%1 = load i32, i32* @get_port_foo.counter
%2 = add nsw i32 %1, 1
store i32 %2, i32* @get_port_foo.counter
ret i32 %2
}

LLVM IR (-O2):
@get_port_foo.counter = internal unnamed_addr global i32 10000
define i32 @get_port_foo() {
%1 = load i32, i32* @get_port_foo.counter
%2 = add nsw i32 %1, 1
store i32 %2, i32* @get_port_foo.counter
ret i32 %2
}
/* Variables and functions */
char *U_WMRCORENONE_set(char *);
char *U_WMRA0_set(void) { return U_WMRCORENONE_set("U_WMRA0"); }


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

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

LLVM IR (-O0):
@.str = [8 x i8] c"U_WMRA0\00"
define i8* @U_WMRA0_set() {
%1 = call i8* @U_WMRCORENONE_set(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}

LLVM IR (-O2):
@.str = [8 x i8] c"U_WMRA0\00"
define i8* @U_WMRA0_set() {
%1 = tail call i8* @U_WMRCORENONE_set(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}
char xx(unsigned char c) {
  if (c >= 32 && c < 128)
    return c;
  return '?';
}


x86 assembly (clang, -O0):
<xx>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x2(%rbp)
movzbl -0x2(%rbp),%eax
cmp    $0x20,%eax
jl     1131 <xx+0x31>
movzbl -0x2(%rbp),%eax
cmp    $0x80,%eax
jge    1131 <xx+0x31>
mov    -0x2(%rbp),%al
mov    %al,-0x1(%rbp)
jmp    1135 <xx+0x35>
movb   $0x3f,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xx>:
cmp    $0x20,%dil
mov    $0x3f,%eax
cmovge %edi,%eax
ret

LLVM IR (-O0):
define signext i8 @xx(i8 zeroext %0) {
%2 = alloca i8
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = zext i8 %4 to i32
%6 = icmp sge i32 %5, 32
br i1 %6, label %7, label %13
7: ; preds = %1
%8 = load i8, i8* %3
%9 = zext i8 %8 to i32
%10 = icmp slt i32 %9, 128
br i1 %10, label %11, label %13
11: ; preds = %7
%12 = load i8, i8* %3
store i8 %12, i8* %2
br label %14
13: ; preds = %7, %1
store i8 63, i8* %2
br label %14
14: ; preds = %13, %11
%15 = load i8, i8* %2
ret i8 %15
}

LLVM IR (-O2):
define signext i8 @xx(i8 zeroext %0) {
%2 = icmp sgt i8 %0, 31
%3 = select i1 %2, i8 %0, i8 63
ret i8 %3
}
void dbg_printf(const char *func, const int line, const char *format, ...) {}


x86 assembly (clang, -O0):
<dbg_printf>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @dbg_printf(i8* %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
ret void
}

LLVM IR (-O2):
define void @dbg_printf(i8* nocapture %0, i32 %1, i8* nocapture %2, ...) {
ret void
}
/* Type definitions */
struct sembuf {
  int member_1;
  int /*<<< orphan*/ member_2;
  int /*<<< orphan*/ member_0;
};
typedef int /*<<< orphan*/ operation;

/* Variables and functions */
int /*<<< orphan*/ SEM_UNDO;
int /*<<< orphan*/ semop(int, struct sembuf *, int);
void sem_unlock(int semid) {
  struct sembuf operation[] = {
      {0, 1, SEM_UNDO},
  };
  semop(semid, operation, (sizeof(operation) / sizeof(struct sembuf)));
}


x86 assembly (clang, -O0):
<sem_unlock>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x1,-0xc(%rbp)
mov    0x2ec0(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x10(%rbp),%rsi
mov    $0x1,%edx
call   1030 <semop@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sem_unlock>:
sub    $0x18,%rsp
movabs $0x100000000,%rax
mov    %rax,0x8(%rsp)
mov    0x2ec6(%rip),%rax
mov    (%rax),%eax
mov    %eax,0x10(%rsp)
lea    0x8(%rsp),%rsi
mov    $0x1,%edx
call   1030 <semop@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.sembuf = type { i32, i32, i32 }
@SEM_UNDO = global i32 0
define void @sem_unlock(i32 %0) {
%2 = alloca i32
%3 = alloca [1 x %struct.sembuf]
store i32 %0, i32* %2
%4 = getelementptr inbounds [1 x %struct.sembuf], [1 x %struct.sembuf]* %3, i64 0, i64 0
%5 = getelementptr inbounds %struct.sembuf, %struct.sembuf* %4, i32 0, i32 0
store i32 0, i32* %5
%6 = getelementptr inbounds %struct.sembuf, %struct.sembuf* %4, i32 0, i32 1
store i32 1, i32* %6
%7 = getelementptr inbounds %struct.sembuf, %struct.sembuf* %4, i32 0, i32 2
%8 = load i32, i32* @SEM_UNDO
store i32 %8, i32* %7
%9 = load i32, i32* %2
%10 = getelementptr inbounds [1 x %struct.sembuf], [1 x %struct.sembuf]* %3, i64 0, i64 0
%11 = call i32 @semop(i32 %9, %struct.sembuf* %10, i32 1)
ret void
}

LLVM IR (-O2):
%struct.sembuf = type { i32, i32, i32 }
@SEM_UNDO = global i32 0
define void @sem_unlock(i32 %0) {
%2 = alloca [1 x %struct.sembuf]
%3 = bitcast [1 x %struct.sembuf]* %2 to i8*
%4 = getelementptr inbounds [1 x %struct.sembuf], [1 x %struct.sembuf]* %2, i64 0, i64 0
%5 = getelementptr inbounds [1 x %struct.sembuf], [1 x %struct.sembuf]* %2, i64 0, i64 0, i32 0
store i32 0, i32* %5
%6 = getelementptr inbounds [1 x %struct.sembuf], [1 x %struct.sembuf]* %2, i64 0, i64 0, i32 1
store i32 1, i32* %6
%7 = getelementptr inbounds [1 x %struct.sembuf], [1 x %struct.sembuf]* %2, i64 0, i64 0, i32 2
%8 = load i32, i32* @SEM_UNDO
store i32 %8, i32* %7
%9 = call i32 @semop(i32 %0, %struct.sembuf* %4, i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ aeabi_uidivmod(unsigned int, unsigned int);
int /*<<< orphan*/ uidiv_t_return(int /*<<< orphan*/);
void __aeabi_uidivmod(unsigned num, unsigned den) {
  uidiv_t_return(aeabi_uidivmod(num, den));
}


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

x86 assembly (clang, -O2):
<__aeabi_uidivmod>:
push   %rax
call   1030 <aeabi_uidivmod@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <uidiv_t_return@plt>

LLVM IR (-O0):
define void @__aeabi_uidivmod(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = call i32 @aeabi_uidivmod(i32 %5, i32 %6)
%8 = call i32 @uidiv_t_return(i32 %7)
ret void
}

LLVM IR (-O2):
define void @__aeabi_uidivmod(i32 %0, i32 %1) {
%3 = tail call i32 @aeabi_uidivmod(i32 %0, i32 %1)
%4 = tail call i32 @uidiv_t_return(i32 %3)
ret void
}
int Com_Clampi(int min, int max, int value) {
  if (value < min) {
    return min;
  }
  if (value > max) {
    return max;
  }
  return value;
}


x86 assembly (clang, -O0):
<Com_Clampi>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1124 <Com_Clampi+0x24>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1141 <Com_Clampi+0x41>
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    113b <Com_Clampi+0x3b>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1141 <Com_Clampi+0x41>
mov    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Com_Clampi>:
mov    %esi,%eax
cmp    %esi,%edx
cmovle %edx,%eax
cmp    %edi,%edx
cmovl  %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @Com_Clampi(i32 %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %2, %0
%5 = icmp sgt i32 %2, %1
%6 = select i1 %5, i32 %1, i32 %2
%7 = select i1 %4, i32 %0, i32 %6
ret i32 %7
}
int do_437() { return 437; }


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

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

LLVM IR (-O0):
define i32 @do_437() {
ret i32 437
}

LLVM IR (-O2):
define i32 @do_437() {
ret i32 437
}
/* Variables and functions */
int SIGUSR1;
int /*<<< orphan*/ write(int /*<<< orphan*/, char *, int);
void handler(int signo) {
  if (signo == SIGUSR1)
    write(0, "SIGUSR1 captured\n", 17);
}


x86 assembly (clang, -O0):
<handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    0x2ec3(%rip),%rcx
cmp    (%rcx),%eax
jne    1140 <handler+0x30>
xor    %edi,%edi
lea    0xeca(%rip),%rsi
mov    $0x11,%edx
call   1030 <write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<handler>:
mov    0x2ed1(%rip),%rax
cmp    %edi,(%rax)
jne    112e <handler+0x1e>
lea    0xede(%rip),%rsi
xor    %edi,%edi
mov    $0x11,%edx
jmp    1030 <write@plt>
ret

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

LLVM IR (-O2):
@SIGUSR1 = global i32 0
@.str = [18 x i8] c"SIGUSR1 captured\0A\00"
define void @handler(i32 %0) {
%2 = load i32, i32* @SIGUSR1
%3 = icmp eq i32 %2, %0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @write(i32 0, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 17)
br label %6
6: ; preds = %4, %1
ret void
}
/* Variables and functions */
void *myrealloc(void *ptr, size_t size) { return NULL; }


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

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

LLVM IR (-O0):
define i8* @myrealloc(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @myrealloc(i8* nocapture readnone %0, i64 %1) {
ret i8* null
}
int math_max(int a, int b) {
  if (a > b)
    return a;
  else
    return b;
}


x86 assembly (clang, -O0):
<math_max>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    1121 <math_max+0x21>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1127 <math_max+0x27>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<math_max>:
mov    %esi,%eax
cmp    %esi,%edi
cmovg  %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @math_max(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char *argv[]) {
  printf("Hello World !!!");
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [16 x i8] c"Hello World !!!\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
const char *hello(void) { return ("hello"); }


x86 assembly (clang, -O0):
<hello>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hello>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [6 x i8] c"hello\00"
define i8* @hello() {
ret i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [6 x i8] c"hello\00"
define i8* @hello() {
ret i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0)
}
int mt_cpu_dormant_init(void) { return 0; }


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

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

LLVM IR (-O0):
define i32 @mt_cpu_dormant_init() {
ret i32 0
}

LLVM IR (-O2):
define i32 @mt_cpu_dormant_init() {
ret i32 0
}
void led_on() {}


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

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

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

LLVM IR (-O2):
define void @led_on() {
ret void
}
int lp_reset(int fd) { return (0); }


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

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

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

LLVM IR (-O2):
define i32 @lp_reset(i32 %0) {
ret i32 0
}
int fuzz_isatty(int fd) { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @fuzz_isatty(i32 %0) {
ret i32 1
}
int gsm_hexchar_to_int(char c) {
  if ((unsigned)(c - '0') < 10)
    return c - '0';
  if ((unsigned)(c - 'a') < 6)
    return 10 + (c - 'a');
  if ((unsigned)(c - 'A') < 6)
    return 10 + (c - 'A');
  return -1;
}


x86 assembly (clang, -O0):
<gsm_hexchar_to_int>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
sub    $0x30,%eax
cmp    $0xa,%eax
jae    1129 <gsm_hexchar_to_int+0x29>
movsbl -0x5(%rbp),%eax
sub    $0x30,%eax
mov    %eax,-0x4(%rbp)
jmp    1174 <gsm_hexchar_to_int+0x74>
movsbl -0x5(%rbp),%eax
sub    $0x61,%eax
cmp    $0x6,%eax
jae    114b <gsm_hexchar_to_int+0x4b>
movsbl -0x5(%rbp),%eax
sub    $0x61,%eax
add    $0xa,%eax
mov    %eax,-0x4(%rbp)
jmp    1174 <gsm_hexchar_to_int+0x74>
movsbl -0x5(%rbp),%eax
sub    $0x41,%eax
cmp    $0x6,%eax
jae    116d <gsm_hexchar_to_int+0x6d>
movsbl -0x5(%rbp),%eax
sub    $0x41,%eax
add    $0xa,%eax
mov    %eax,-0x4(%rbp)
jmp    1174 <gsm_hexchar_to_int+0x74>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<gsm_hexchar_to_int>:
lea    -0x30(%rdi),%eax
cmp    $0xa,%eax
jb     1127 <gsm_hexchar_to_int+0x27>
lea    -0x61(%rdi),%eax
cmp    $0x5,%eax
ja     1116 <gsm_hexchar_to_int+0x16>
add    $0xffffffa9,%edi
mov    %edi,%eax
ret
lea    -0x41(%rdi),%eax
add    $0xffffffc9,%edi
cmp    $0x6,%eax
mov    $0xffffffff,%eax
cmovb  %edi,%eax
ret

LLVM IR (-O0):
define i32 @gsm_hexchar_to_int(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = sub nsw i32 %5, 48
%7 = icmp ult i32 %6, 10
br i1 %7, label %8, label %12
8: ; preds = %1
%9 = load i8, i8* %3
%10 = sext i8 %9 to i32
%11 = sub nsw i32 %10, 48
store i32 %11, i32* %2
br label %33
12: ; preds = %1
%13 = load i8, i8* %3
%14 = sext i8 %13 to i32
%15 = sub nsw i32 %14, 97
%16 = icmp ult i32 %15, 6
br i1 %16, label %17, label %22
17: ; preds = %12
%18 = load i8, i8* %3
%19 = sext i8 %18 to i32
%20 = sub nsw i32 %19, 97
%21 = add nsw i32 10, %20
store i32 %21, i32* %2
br label %33
22: ; preds = %12
%23 = load i8, i8* %3
%24 = sext i8 %23 to i32
%25 = sub nsw i32 %24, 65
%26 = icmp ult i32 %25, 6
br i1 %26, label %27, label %32
27: ; preds = %22
%28 = load i8, i8* %3
%29 = sext i8 %28 to i32
%30 = sub nsw i32 %29, 65
%31 = add nsw i32 10, %30
store i32 %31, i32* %2
br label %33
32: ; preds = %22
store i32 -1, i32* %2
br label %33
33: ; preds = %32, %27, %17, %8
%34 = load i32, i32* %2
ret i32 %34
}

LLVM IR (-O2):
define i32 @gsm_hexchar_to_int(i8 signext %0) {
%2 = sext i8 %0 to i32
%3 = add nsw i32 %2, -48
%4 = icmp ult i32 %3, 10
br i1 %4, label %15, label %5
5: ; preds = %1
%6 = add nsw i32 %2, -97
%7 = icmp ult i32 %6, 6
br i1 %7, label %8, label %10
8: ; preds = %5
%9 = add nsw i32 %2, -87
br label %15
10: ; preds = %5
%11 = add nsw i32 %2, -65
%12 = icmp ult i32 %11, 6
%13 = add nsw i32 %2, -55
%14 = select i1 %12, i32 %13, i32 -1
br label %15
15: ; preds = %10, %1, %8
%16 = phi i32 [ %9, %8 ], [ %3, %1 ], [ %14, %10 ]
ret i32 %16
}
void foo_2_1_1_2_1_1_1_1_1() {}


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

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

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

LLVM IR (-O2):
define void @foo_2_1_1_2_1_1_1_1_1() {
ret void
}
double FtoK(double F) {
  double k = (.5556 * (F - 32)) + 273.15;
  return k;
}


x86 assembly (clang, -O0):
<FtoK>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xefa(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  0xede(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xeda(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<FtoK>:
addsd  0xef8(%rip),%xmm0
mulsd  0xef8(%rip),%xmm0
addsd  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define double @FtoK(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %2
%4 = load double, double* %2
%5 = fsub double %4, 3.200000e+01
%6 = call double @llvm.fmuladd.f64(double 5.556000e-01, double %5, double 2.731500e+02)
store double %6, double* %3
%7 = load double, double* %3
ret double %7
}

LLVM IR (-O2):
define double @FtoK(double %0) {
%2 = fadd double %0, -3.200000e+01
%3 = tail call double @llvm.fmuladd.f64(double %2, double 5.556000e-01, double 2.731500e+02)
ret double %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, char *);
int strlen(char *);
int main(void) {
  char a[50];
  printf("Enter the String:");
  scanf("%49s", a);
  printf("Length:%d\n", strlen(a));
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x40,%rsp
lea    0xec4(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xec8(%rip),%rdi
mov    %rsp,%rbx
mov    %rbx,%rsi
call   1050 <scanf@plt>
mov    %rbx,%rdi
call   1030 <strlen@plt>
lea    0xeb3(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [18 x i8] c"Enter the String:\00"
@.str.1 = [5 x i8] c"%49s\00"
@.str.2 = [11 x i8] c"Length:%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [50 x i8]
store i32 0, i32* %1
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%4 = getelementptr inbounds [50 x i8], [50 x i8]* %2, i64 0, i64 0
%5 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* %4)
%6 = getelementptr inbounds [50 x i8], [50 x i8]* %2, i64 0, i64 0
%7 = call i32 @strlen(i8* %6)
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), i32 %7)
ret i32 0
}

LLVM IR (-O2):
@.str = [18 x i8] c"Enter the String:\00"
@.str.1 = [5 x i8] c"%49s\00"
@.str.2 = [11 x i8] c"Length:%d\0A\00"
define i32 @main() {
%1 = alloca [50 x i8]
%2 = getelementptr inbounds [50 x i8], [50 x i8]* %1, i64 0, i64 0
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* %2)
%5 = call i32 @strlen(i8* %2)
%6 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), i32 %5)
ret i32 0
}
/* Variables and functions */
long atol(char *);
int getfield(int, char *, char *, int, char);
int getfldlong(int fldno, char *str, long *dst, char sep) {
  char tmp[21];
  int ret;
  *dst = 0L;
  ret = getfield(fldno, str, tmp, 20, sep);
  if (ret)
    *dst = atol(tmp);
  return (ret);
}


x86 assembly (clang, -O0):
<getfldlong>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %cl,%al
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %al,-0x19(%rbp)
mov    -0x18(%rbp),%rax
movq   $0x0,(%rax)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
lea    -0x30(%rbp),%rdx
mov    $0x14,%ecx
movsbl -0x19(%rbp),%r8d
call   1030 <getfield@plt>
mov    %eax,-0x34(%rbp)
cmpl   $0x0,-0x34(%rbp)
je     117d <getfldlong+0x5d>
lea    -0x30(%rbp),%rdi
call   1040 <atol@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x34(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getfldlong>:
push   %rbp
push   %rbx
sub    $0x18,%rsp
mov    %ecx,%r8d
mov    %rdx,%rbx
movq   $0x0,(%rdx)
mov    %rsp,%rdx
mov    $0x14,%ecx
call   1030 <getfield@plt>
mov    %eax,%ebp
test   %eax,%eax
je     1151 <getfldlong+0x31>
mov    %rsp,%rdi
call   1040 <atol@plt>
mov    %rax,(%rbx)
mov    %ebp,%eax
add    $0x18,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @getfldlong(i32 %0, i8* %1, i64* %2, i8 signext %3) {
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i64*
%8 = alloca i8
%9 = alloca [21 x i8]
%10 = alloca i32
store i32 %0, i32* %5
store i8* %1, i8** %6
store i64* %2, i64** %7
store i8 %3, i8* %8
%11 = load i64*, i64** %7
store i64 0, i64* %11
%12 = load i32, i32* %5
%13 = load i8*, i8** %6
%14 = getelementptr inbounds [21 x i8], [21 x i8]* %9, i64 0, i64 0
%15 = load i8, i8* %8
%16 = call i32 @getfield(i32 %12, i8* %13, i8* %14, i32 20, i8 signext %15)
store i32 %16, i32* %10
%17 = load i32, i32* %10
%18 = icmp ne i32 %17, 0
br i1 %18, label %19, label %23
19: ; preds = %4
%20 = getelementptr inbounds [21 x i8], [21 x i8]* %9, i64 0, i64 0
%21 = call i64 @atol(i8* %20)
%22 = load i64*, i64** %7
store i64 %21, i64* %22
br label %23
23: ; preds = %19, %4
%24 = load i32, i32* %10
ret i32 %24
}

LLVM IR (-O2):
define i32 @getfldlong(i32 %0, i8* %1, i64* nocapture writeonly %2, i8 signext %3) {
%5 = alloca [21 x i8]
%6 = getelementptr inbounds [21 x i8], [21 x i8]* %5, i64 0, i64 0
store i64 0, i64* %2
%7 = call i32 @getfield(i32 %0, i8* %1, i8* %6, i32 20, i8 signext %3)
%8 = icmp eq i32 %7, 0
br i1 %8, label %11, label %9
9: ; preds = %4
%10 = call i64 @atol(i8* %6)
store i64 %10, i64* %2
br label %11
11: ; preds = %9, %4
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ Sys_failure(char *);
int /*<<< orphan*/ assert(int /*<<< orphan*/);
char *getenv(char const *);
char *Getenv(const char *name) {
  char *retval;
  assert(name != NULL);
  retval = getenv(name);
  if (retval == NULL)
    Sys_failure("getenv");
  return retval;
}


x86 assembly (clang, -O0):
<Getenv>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    -0x8(%rbp),%rdi
call   1030 <getenv@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1172 <Getenv+0x42>
lea    0xe93(%rip),%rdi
call   1050 <Sys_failure@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Getenv>:
push   %rbx
mov    %rdi,%rbx
xor    %edi,%edi
test   %rbx,%rbx
setne  %dil
call   1040 <assert@plt>
mov    %rbx,%rdi
call   1030 <getenv@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    115e <Getenv+0x2e>
lea    0xea7(%rip),%rdi
call   1050 <Sys_failure@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [7 x i8] c"getenv\00"
define i8* @Getenv(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = icmp ne i8* %4, null
%6 = zext i1 %5 to i32
%7 = call i32 @assert(i32 %6)
%8 = load i8*, i8** %2
%9 = call i8* @getenv(i8* %8)
store i8* %9, i8** %3
%10 = load i8*, i8** %3
%11 = icmp eq i8* %10, null
br i1 %11, label %12, label %14
12: ; preds = %1
%13 = call i32 @Sys_failure(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
br label %14
14: ; preds = %12, %1
%15 = load i8*, i8** %3
ret i8* %15
}

LLVM IR (-O2):
@.str = [7 x i8] c"getenv\00"
define i8* @Getenv(i8* %0) {
%2 = icmp ne i8* %0, null
%3 = zext i1 %2 to i32
%4 = tail call i32 @assert(i32 %3)
%5 = tail call i8* @getenv(i8* %0)
%6 = icmp eq i8* %5, null
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = tail call i32 @Sys_failure(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
br label %9
9: ; preds = %7, %1
ret i8* %5
}
int ffi_test_3(int x, int y, int z, int t) { return x + y + z * t; }


x86 assembly (clang, -O0):
<ffi_test_3>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
mov    -0xc(%rbp),%ecx
imul   -0x10(%rbp),%ecx
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ffi_test_3>:
lea    (%rdi,%rsi,1),%eax
imul   %ecx,%edx
add    %edx,%eax
ret

LLVM IR (-O0):
define i32 @ffi_test_3(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* %5
%10 = load i32, i32* %6
%11 = add nsw i32 %9, %10
%12 = load i32, i32* %7
%13 = load i32, i32* %8
%14 = mul nsw i32 %12, %13
%15 = add nsw i32 %11, %14
ret i32 %15
}

LLVM IR (-O2):
define i32 @ffi_test_3(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = add nsw i32 %1, %0
%6 = mul nsw i32 %3, %2
%7 = add nsw i32 %5, %6
ret i32 %7
}
float converterDiasEmAnos(float dias) { return dias / 365; }


x86 assembly (clang, -O0):
<converterDiasEmAnos>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
movss  0xeea(%rip),%xmm1
divss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<converterDiasEmAnos>:
divss  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define float @converterDiasEmAnos(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fdiv float %3, 3.650000e+02
ret float %4
}

LLVM IR (-O2):
define float @converterDiasEmAnos(float %0) {
%2 = fdiv float %0, 3.650000e+02
ret float %2
}
/* Variables and functions */
int EOF;
int getchar();
int /*<<< orphan*/ putchar(int);
int main(int argc, char **argv) {
  int c;
  c = getchar();
  while (c != EOF) {
    putchar(c);
    c = getchar();
  }
}


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)
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    0x2e9e(%rip),%rcx
cmp    (%rcx),%eax
je     1169 <main+0x49>
mov    -0x14(%rbp),%edi
call   1030 <putchar@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0x14(%rbp)
jmp    1140 <main+0x20>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1040 <getchar@plt>
mov    0x2eb9(%rip),%rbx
cmp    (%rbx),%eax
je     1152 <main+0x32>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %eax,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
cmp    (%rbx),%eax
jne    1140 <main+0x20>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@EOF = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @getchar()
%4 = load i32, i32* @EOF
%5 = icmp eq i32 %3, %4
br i1 %5, label %12, label %6
6: ; preds = %2, %6
%7 = phi i32 [ %9, %6 ], [ %3, %2 ]
%8 = tail call i32 @putchar(i32 %7)
%9 = tail call i32 (...) @getchar()
%10 = load i32, i32* @EOF
%11 = icmp eq i32 %9, %10
br i1 %11, label %12, label %6
12: ; preds = %6, %2
ret i32 0
}
unsigned xrop3_136_0_0(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned stk1;
  stk1 = D & S;
  return stk1;
}


x86 assembly (clang, -O0):
<xrop3_136_0_0>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xff,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
and    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_136_0_0>:
mov    %edi,%eax
ret

LLVM IR (-O0):
define i32 @xrop3_136_0_0(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
store i32 255, i32* %5
%8 = load i8, i8* %3
%9 = zext i8 %8 to i32
%10 = shl i32 %9, 8
%11 = load i8, i8* %3
%12 = zext i8 %11 to i32
%13 = or i32 %10, %12
store i32 %13, i32* %6
%14 = load i32, i32* %5
%15 = load i32, i32* %6
%16 = and i32 %14, %15
store i32 %16, i32* %7
%17 = load i32, i32* %7
ret i32 %17
}

LLVM IR (-O2):
define i32 @xrop3_136_0_0(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
ret i32 %3
}
void __do_global_ctors() {}


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

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

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

LLVM IR (-O2):
define void @__do_global_ctors() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isdigit(int);
void t_isdigit_0x59() {
  Assert_real((isdigit(89) == 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_isdigit.c",
              450, ("isdigit should be 0 for Y"));
}


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

x86 assembly (clang, -O2):
<t_isdigit_0x59>:
push   %rax
mov    $0x59,%edi
call   1030 <isdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x1c2,%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_isdigit.c\00"
@.str.1 = [26 x i8] c"isdigit should be 0 for Y\00"
define void @t_isdigit_0x59() {
%1 = call i64 @isdigit(i32 89)
%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 450, 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_isdigit.c\00"
@.str.1 = [26 x i8] c"isdigit should be 0 for Y\00"
define void @t_isdigit_0x59() {
%1 = tail call i64 @isdigit(i32 89)
%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 450, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int disable_setting(char *);
int disable_mptcp() {
  return disable_setting("/proc/sys/net/mptcp/mptcp_enabled");
}


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

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

LLVM IR (-O0):
@.str = [34 x i8] c"/proc/sys/net/mptcp/mptcp_enabled\00"
define i32 @disable_mptcp() {
%1 = call i32 @disable_setting(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}

LLVM IR (-O2):
@.str = [34 x i8] c"/proc/sys/net/mptcp/mptcp_enabled\00"
define i32 @disable_mptcp() {
%1 = tail call i32 @disable_setting(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}
/* Variables and functions */
#define DT_RPATH 128
const char *elf_tagname(int tag) {
  switch (tag) {
  case DT_RPATH:
    return "RPATH";
    break;
  }
  return "UNKNOWN";
}


x86 assembly (clang, -O0):
<elf_tagname>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
sub    $0x80,%eax
jne    112a <elf_tagname+0x2a>
jmp    111a <elf_tagname+0x1a>
lea    0xedf(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1135 <elf_tagname+0x35>
lea    0xed5(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<elf_tagname>:
cmp    $0x80,%edi
lea    0xef3(%rip),%rcx
lea    0xef2(%rip),%rax
cmove  %rcx,%rax
ret

LLVM IR (-O0):
@.str = [6 x i8] c"RPATH\00"
@.str.1 = [8 x i8] c"UNKNOWN\00"
define i8* @elf_tagname(i32 %0) {
%2 = alloca i8*
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %6 [
i32 128, label %5
]
5: ; preds = %1
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8** %2
br label %7
6: ; preds = %1
store i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8** %2
br label %7
7: ; preds = %6, %5
%8 = load i8*, i8** %2
ret i8* %8
}

LLVM IR (-O2):
@.str = [6 x i8] c"RPATH\00"
@.str.1 = [8 x i8] c"UNKNOWN\00"
define i8* @elf_tagname(i32 %0) {
%2 = icmp eq i32 %0, 128
%3 = select i1 %2, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0)
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ UART1_Write(int);
int /*<<< orphan*/ UART1_Write_Text(char *);
void UART1_Write_Line(char *uart_text) {
  UART1_Write_Text(uart_text);
  UART1_Write(13);
  UART1_Write(10);
}


x86 assembly (clang, -O0):
<UART1_Write_Line>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <UART1_Write_Text@plt>
mov    $0xd,%edi
call   1030 <UART1_Write@plt>
mov    $0xa,%edi
call   1030 <UART1_Write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<UART1_Write_Line>:
push   %rax
call   1040 <UART1_Write_Text@plt>
mov    $0xd,%edi
call   1030 <UART1_Write@plt>
mov    $0xa,%edi
pop    %rax
jmp    1030 <UART1_Write@plt>

LLVM IR (-O0):
define void @UART1_Write_Line(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @UART1_Write_Text(i8* %3)
%5 = call i32 @UART1_Write(i32 13)
%6 = call i32 @UART1_Write(i32 10)
ret void
}

LLVM IR (-O2):
define void @UART1_Write_Line(i8* %0) {
%2 = tail call i32 @UART1_Write_Text(i8* %0)
%3 = tail call i32 @UART1_Write(i32 13)
%4 = tail call i32 @UART1_Write(i32 10)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int);
int /*<<< orphan*/ stderr;
int get_js_bound(int m_ext) {
  static const int jsb_table[4] = {4, 8, 12, 16};
  if (m_ext < 0 || m_ext > 3) {
    fprintf(stderr, "get_js_bound() bad modext (%d)\n", m_ext);
    exit(1);
  }
  return (jsb_table[m_ext]);
}


x86 assembly (clang, -O0):
<get_js_bound>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jl     113f <get_js_bound+0x1f>
cmpl   $0x3,-0x4(%rbp)
jle    1161 <get_js_bound+0x41>
mov    0x2e9a(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%edx
lea    0xebe(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>
movslq -0x4(%rbp),%rcx
lea    0xe94(%rip),%rax
mov    (%rax,%rcx,4),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_js_bound>:
push   %rax
mov    %edi,%edx
cmp    $0x4,%edi
jae    1136 <get_js_bound+0x16>
mov    %edx,%eax
lea    0xecf(%rip),%rcx
mov    (%rcx,%rax,4),%eax
pop    %rcx
ret
mov    0x2ea3(%rip),%rax
mov    (%rax),%edi
lea    0xeca(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@get_js_bound.jsb_table = internal constant [4 x i32] [i32 4, i32 8, i32 12, i32 16]
@stderr = global i32 0
@.str = [32 x i8] c"get_js_bound() bad modext (%d)\0A\00"
define i32 @get_js_bound(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp slt i32 %3, 0
br i1 %4, label %8, label %5
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sgt i32 %6, 3
br i1 %7, label %8, label %13
8: ; preds = %5, %1
%9 = load i32, i32* @stderr
%10 = load i32, i32* %2
%11 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i32 %10)
%12 = call i32 @exit(i32 1)
unreachable
13: ; preds = %5
%14 = load i32, i32* %2
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds [4 x i32], [4 x i32]* @get_js_bound.jsb_table, i64 0, i64 %15
%17 = load i32, i32* %16
ret i32 %17
}

LLVM IR (-O2):
@get_js_bound.jsb_table = internal unnamed_addr constant [4 x i32] [i32 4, i32 8, i32 12, i32 16]
@stderr = global i32 0
@.str = [32 x i8] c"get_js_bound() bad modext (%d)\0A\00"
define i32 @get_js_bound(i32 %0) {
%2 = icmp ugt i32 %0, 3
br i1 %2, label %3, label %7
3: ; preds = %1
%4 = load i32, i32* @stderr
%5 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i32 %0)
%6 = tail call i32 @exit(i32 1)
unreachable
7: ; preds = %1
%8 = zext i32 %0 to i64
%9 = getelementptr inbounds [4 x i32], [4 x i32]* @get_js_bound.jsb_table, i64 0, i64 %8
%10 = load i32, i32* %9
ret i32 %10
}
/* Variables and functions */
int __builtin_inb(int);
int /*<<< orphan*/ __builtin_outb(int, int);
void main(void) {
  int i;
  i = __builtin_inb(0x1234);
  goto next;
  int j;
  j = __builtin_inb(0xabcd);
  __builtin_outb(j, 0xef90);
next:
  __builtin_outb(i, 0x5678);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x1234,%edi
call   1030 <__builtin_inb@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x5678,%esi
call   1040 <__builtin_outb@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1234,%edi
call   1030 <__builtin_inb@plt>
mov    %eax,%edi
mov    $0x5678,%esi
pop    %rax
jmp    1040 <__builtin_outb@plt>

LLVM IR (-O0):
define void @main() {
%1 = alloca i32
%2 = alloca i32
%3 = call i32 @__builtin_inb(i32 4660)
store i32 %3, i32* %1
br label %4
4: ; preds = %0
%5 = load i32, i32* %1
%6 = call i32 @__builtin_outb(i32 %5, i32 22136)
ret void
}

LLVM IR (-O2):
define void @main() {
%1 = tail call i32 @__builtin_inb(i32 4660)
%2 = tail call i32 @__builtin_outb(i32 %1, i32 22136)
ret void
}
void set_amp_features(struct btdev *btdev) {}


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

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

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

LLVM IR (-O2):
%struct.btdev = type opaque
define void @set_amp_features(%struct.btdev* nocapture %0) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ BIO;

/* Variables and functions */
int strlen(char const *);
int tou_socket_write(int /*<<< orphan*/ *, char const *, int);
int tou_socket_puts(BIO *bp, const char *str) {
  int n, ret;
  n = strlen(str);
  ret = tou_socket_write(bp, str, n);
  return (ret);
}


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

x86 assembly (clang, -O2):
<tou_socket_puts>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1040 <strlen@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %eax,%edx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <tou_socket_write@plt>

LLVM IR (-O0):
define i32 @tou_socket_puts(i32* %0, i8* %1) {
%3 = alloca i32*
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
store i32* %0, i32** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %4
%8 = call i32 @strlen(i8* %7)
store i32 %8, i32* %5
%9 = load i32*, i32** %3
%10 = load i8*, i8** %4
%11 = load i32, i32* %5
%12 = call i32 @tou_socket_write(i32* %9, i8* %10, i32 %11)
store i32 %12, i32* %6
%13 = load i32, i32* %6
ret i32 %13
}

LLVM IR (-O2):
define i32 @tou_socket_puts(i32* %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %1)
%4 = tail call i32 @tou_socket_write(i32* %0, i8* %1, i32 %3)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stdout;
void c_intface(int *i) { fprintf(stdout, "DNoChange\n"); }


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

x86 assembly (clang, -O2):
<c_intface>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
jmp    1030 <fprintf@plt>

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

LLVM IR (-O2):
@stdout = global i32 0
@.str = [11 x i8] c"DNoChange\0A\00"
define void @c_intface(i32* nocapture readnone %0) {
%2 = load i32, i32* @stdout
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
ret void
}
unsigned short v_unsigned_short_func() { return (0); }


x86 assembly (clang, -O0):
<v_unsigned_short_func>:
push   %rbp
mov    %rsp,%rbp
xor    %eax,%eax
movzwl %ax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define zeroext i16 @v_unsigned_short_func() {
ret i16 0
}

LLVM IR (-O2):
define zeroext i16 @v_unsigned_short_func() {
ret i16 0
}
void gpio3_iomux_config() {}


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

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

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

LLVM IR (-O2):
define void @gpio3_iomux_config() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ cleanup();
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int);
int /*<<< orphan*/ stderr;
void sig_handler(int signum) {
  fprintf(stderr, "Caught signal %d\n", signum);
  cleanup();
  exit(-signum);
}


x86 assembly (clang, -O0):
<sig_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2e9e(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%edx
lea    0xeb2(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x0,%al
call   1040 <cleanup@plt>
xor    %edi,%edi
sub    -0x4(%rbp),%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<sig_handler>:
push   %rbx
mov    %edi,%ebx
mov    0x2ea6(%rip),%rax
mov    (%rax),%edi
lea    0xebd(%rip),%rsi
mov    %ebx,%edx
call   1030 <fprintf@plt>
xor    %eax,%eax
call   1040 <cleanup@plt>
neg    %ebx
mov    %ebx,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [18 x i8] c"Caught signal %d\0A\00"
define void @sig_handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @stderr
%4 = load i32, i32* %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = call i32 (...) @cleanup()
%7 = load i32, i32* %2
%8 = sub nsw i32 0, %7
%9 = call i32 @exit(i32 %8)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [18 x i8] c"Caught signal %d\0A\00"
define void @sig_handler(i32 %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %0)
%4 = tail call i32 (...) @cleanup()
%5 = sub nsw i32 0, %0
%6 = tail call i32 @exit(i32 %5)
unreachable
}