xunge/DecIR huggingface dataset:
int sign_extend(int n, int num_bits) {
  int shift = (int)(sizeof(int) * 8 - num_bits);
  return (n << shift) >> shift;
}


x86 assembly (clang, -O0):
<sign_extend>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movslq -0x8(%rbp),%rcx
mov    $0x20,%eax
sub    %rcx,%rax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    -0xc(%rbp),%ecx
shl    %cl,%eax
mov    -0xc(%rbp),%ecx
sar    %cl,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sign_extend>:
mov    %esi,%ecx
mov    %edi,%eax
neg    %cl
shl    %cl,%eax
sar    %cl,%eax
ret

LLVM IR (-O0):
define i32 @sign_extend(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
%7 = sext i32 %6 to i64
%8 = sub i64 32, %7
%9 = trunc i64 %8 to i32
store i32 %9, i32* %5
%10 = load i32, i32* %3
%11 = load i32, i32* %5
%12 = shl i32 %10, %11
%13 = load i32, i32* %5
%14 = ashr i32 %12, %13
ret i32 %14
}

LLVM IR (-O2):
define i32 @sign_extend(i32 %0, i32 %1) {
%3 = sub i32 32, %1
%4 = shl i32 %0, %3
%5 = ashr i32 %4, %3
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ toUppercase(char *);
int main() {
  char s[] = "Now is the time";
  printf("Before: %s \n", s);
  toUppercase(s);
  printf("After: %s \n", s);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xec7(%rip),%rax
mov    %rax,-0x18(%rbp)
lea    -0x20(%rbp),%rsi
lea    0xec0(%rip),%rdi
call   1030 <printf@plt>
lea    -0x20(%rbp),%rdi
call   1040 <toUppercase@plt>
lea    -0x20(%rbp),%rsi
lea    0xeb4(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
movaps 0xed4(%rip),%xmm0
movaps %xmm0,(%rsp)
lea    0xed9(%rip),%rdi
mov    %rsp,%rbx
mov    %rbx,%rsi
call   1030 <printf@plt>
mov    %rbx,%rdi
call   1040 <toUppercase@plt>
lea    0xecc(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.s = [16 x i8] c"Now is the time\00"
@.str = [13 x i8] c"Before: %s \0A\00"
@.str.1 = [12 x i8] c"After: %s \0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [16 x i8]
store i32 0, i32* %1
%3 = bitcast [16 x i8]* %2 to i8*
%4 = getelementptr inbounds [16 x i8], [16 x i8]* %2, i64 0, i64 0
%5 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = getelementptr inbounds [16 x i8], [16 x i8]* %2, i64 0, i64 0
%7 = call i32 @toUppercase(i8* %6)
%8 = getelementptr inbounds [16 x i8], [16 x i8]* %2, i64 0, i64 0
%9 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i8* %8)
ret i32 0
}

LLVM IR (-O2):
@__const.main.s = [16 x i8] c"Now is the time\00"
@.str = [13 x i8] c"Before: %s \0A\00"
@.str.1 = [12 x i8] c"After: %s \0A\00"
define i32 @main() {
%1 = alloca [16 x i8]
%2 = getelementptr inbounds [16 x i8], [16 x i8]* %1, i64 0, i64 0
%3 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = call i32 @toUppercase(i8* %2)
%5 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i8* %2)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ t(int);
int main() {
  t(5);
  t(5);
  t(5);
  t(5);
  t(5);
  t(5);
  t(5);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x5,%edi
call   1030 <t@plt>
mov    $0x5,%edi
call   1030 <t@plt>
mov    $0x5,%edi
call   1030 <t@plt>
mov    $0x5,%edi
call   1030 <t@plt>
mov    $0x5,%edi
call   1030 <t@plt>
mov    $0x5,%edi
call   1030 <t@plt>
mov    $0x5,%edi
call   1030 <t@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x5,%edi
call   1030 <t@plt>
mov    $0x5,%edi
call   1030 <t@plt>
mov    $0x5,%edi
call   1030 <t@plt>
mov    $0x5,%edi
call   1030 <t@plt>
mov    $0x5,%edi
call   1030 <t@plt>
mov    $0x5,%edi
call   1030 <t@plt>
mov    $0x5,%edi
call   1030 <t@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 @t(i32 5)
%2 = call i32 @t(i32 5)
%3 = call i32 @t(i32 5)
%4 = call i32 @t(i32 5)
%5 = call i32 @t(i32 5)
%6 = call i32 @t(i32 5)
%7 = call i32 @t(i32 5)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @t(i32 5)
%2 = tail call i32 @t(i32 5)
%3 = tail call i32 @t(i32 5)
%4 = tail call i32 @t(i32 5)
%5 = tail call i32 @t(i32 5)
%6 = tail call i32 @t(i32 5)
%7 = tail call i32 @t(i32 5)
ret i32 0
}
void vic_clk(void) {}


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

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

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

LLVM IR (-O2):
define void @vic_clk() {
ret void
}
/* Variables and functions */
int fnPartition(int *, int, int);
void fnQuickSort(int a[], int l, int r) {
  int s;
  if (l < r) {
    s = fnPartition(a, l, r);
    fnQuickSort(a, l, s - 1);
    fnQuickSort(a, s + 1, r);
  }
}


x86 assembly (clang, -O0):
<fnQuickSort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1174 <fnQuickSort+0x54>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1030 <fnPartition@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x14(%rbp),%edx
sub    $0x1,%edx
call   1040 <fnQuickSort@plt>
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
add    $0x1,%esi
mov    -0x10(%rbp),%edx
call   1040 <fnQuickSort@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fnQuickSort>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
cmp    %edx,%esi
jge    1166 <fnQuickSort+0x46>
mov    %edx,%r14d
mov    %esi,%ebp
mov    %rdi,%r15
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %r15,%rdi
mov    %ebp,%esi
mov    %r14d,%edx
call   1030 <fnPartition@plt>
mov    %eax,%ebx
lea    -0x1(%rbx),%edx
mov    %r15,%rdi
mov    %ebp,%esi
call   1040 <fnQuickSort@plt>
add    $0x1,%ebx
mov    %ebx,%ebp
cmp    %r14d,%ebx
jl     1140 <fnQuickSort+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define void @fnQuickSort(i32* %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %1, %2
br i1 %4, label %5, label %11
5: ; preds = %3, %5
%6 = phi i32 [ %9, %5 ], [ %1, %3 ]
%7 = tail call i32 @fnPartition(i32* %0, i32 %6, i32 %2)
%8 = add nsw i32 %7, -1
tail call void @fnQuickSort(i32* %0, i32 %6, i32 %8)
%9 = add nsw i32 %7, 1
%10 = icmp slt i32 %9, %2
br i1 %10, label %5, label %11
11: ; preds = %5, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int);
void *malloc(int);
int /*<<< orphan*/ stderr;
void *my_malloc(int num_bytes) {
  void *rv;
  rv = malloc(num_bytes);
  if (rv == 0) {
    fprintf(stderr, "malloc(%d) failed.\n", num_bytes);
    exit(1);
  }
  return rv;
}


x86 assembly (clang, -O0):
<my_malloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1174 <my_malloc+0x44>
mov    0x2e87(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%edx
lea    0xe9b(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_malloc>:
push   %rbx
mov    %edi,%ebx
call   1040 <malloc@plt>
test   %rax,%rax
je     113f <my_malloc+0xf>
pop    %rbx
ret
mov    0x2e9a(%rip),%rax
mov    (%rax),%edi
lea    0xeb1(%rip),%rsi
mov    %ebx,%edx
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [20 x i8] c"malloc(%d) failed.\0A\00"
define i8* @my_malloc(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i8* @malloc(i32 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp eq i8* %6, null
br i1 %7, label %8, label %13
8: ; preds = %1
%9 = load i32, i32* @stderr
%10 = load i32, i32* %2
%11 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %10)
%12 = call i32 @exit(i32 1)
unreachable
13: ; preds = %1
%14 = load i8*, i8** %3
ret i8* %14
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [20 x i8] c"malloc(%d) failed.\0A\00"
define noalias i8* @my_malloc(i32 %0) {
%2 = tail call i8* @malloc(i32 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %0)
%7 = tail call i32 @exit(i32 1)
unreachable
8: ; preds = %1
ret i8* %2
}
/* Variables and functions */
int EOF;
int getchar();
void empty_stdin() {
  int c;
  while ((c = getchar()) != '\n' && c != EOF)
    ;
}


x86 assembly (clang, -O0):
<empty_stdin>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <getchar@plt>
mov    %eax,%ecx
mov    %ecx,-0x4(%rbp)
xor    %eax,%eax
cmp    $0xa,%ecx
mov    %al,-0x5(%rbp)
je     1144 <empty_stdin+0x34>
mov    -0x4(%rbp),%eax
mov    0x2eac(%rip),%rcx
cmp    (%rcx),%eax
setne  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
test   $0x1,%al
jne    1154 <empty_stdin+0x44>
jmp    1159 <empty_stdin+0x49>
jmp    1118 <empty_stdin+0x8>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<empty_stdin>:
push   %rbx
mov    0x2ed0(%rip),%rbx
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <getchar@plt>
cmp    $0xa,%eax
je     1130 <empty_stdin+0x20>
cmp    (%rbx),%eax
jne    1120 <empty_stdin+0x10>
pop    %rbx
ret

LLVM IR (-O0):
@EOF = global i32 0
define void @empty_stdin() {
%1 = alloca i32
br label %2
2: ; preds = %11, %0
%3 = call i32 (...) @getchar()
store i32 %3, i32* %1
%4 = icmp ne i32 %3, 10
br i1 %4, label %5, label %9
5: ; preds = %2
%6 = load i32, i32* %1
%7 = load i32, i32* @EOF
%8 = icmp ne i32 %6, %7
br label %9
9: ; preds = %5, %2
%10 = phi i1 [ false, %2 ], [ %8, %5 ]
br i1 %10, label %11, label %12
11: ; preds = %9
br label %2
12: ; preds = %9
ret void
}

LLVM IR (-O2):
@EOF = global i32 0
define void @empty_stdin() {
br label %1
1: ; preds = %1, %0
%2 = tail call i32 (...) @getchar()
%3 = icmp ne i32 %2, 10
%4 = load i32, i32* @EOF
%5 = icmp ne i32 %2, %4
%6 = select i1 %3, i1 %5, i1 false
br i1 %6, label %1, label %7
7: ; preds = %1
ret void
}
/* Variables and functions */
int write(int, void const *, int);
int write_bytes(int f, const void *b, int n) { return write(f, b, n); }


x86 assembly (clang, -O0):
<write_bytes>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <write@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_bytes>:
jmp    1030 <write@plt>

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

LLVM IR (-O2):
define i32 @write_bytes(i32 %0, i8* nocapture %1, i32 %2) {
%4 = tail call i32 @write(i32 %0, i8* %1, i32 %2)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
void term_handler(int UNUSED_signum __attribute__((__unused__))) { exit(0); }


x86 assembly (clang, -O0):
<term_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
xor    %edi,%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<term_handler>:
push   %rax
xor    %edi,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
define void @term_handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define void @term_handler(i32 %0) {
%2 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
double DSlater_2S_4S(double, double, double);
double DSlater_4S_2S(double rij, double xii, double xij) {
  return DSlater_2S_4S(rij, xij, xii);
}


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

x86 assembly (clang, -O2):
<DSlater_4S_2S>:
movaps %xmm1,%xmm3
movaps %xmm2,%xmm1
movaps %xmm3,%xmm2
jmp    1030 <DSlater_2S_4S@plt>

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

LLVM IR (-O2):
define double @DSlater_4S_2S(double %0, double %1, double %2) {
%4 = tail call double @DSlater_2S_4S(double %0, double %2, double %1)
ret double %4
}
/* Type definitions */
typedef int /*<<< orphan*/ XErrorEvent;
typedef int /*<<< orphan*/ Display;

/* Variables and functions */
int /*<<< orphan*/ XCloseDisplay(int /*<<< orphan*/ *);
int /*<<< orphan*/ exit(int);
int handle_xerror(Display *d, XErrorEvent *e) {
  XCloseDisplay(d);
  exit(1);
}


x86 assembly (clang, -O0):
<handle_xerror>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <XCloseDisplay@plt>
mov    $0x1,%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<handle_xerror>:
push   %rax
call   1040 <XCloseDisplay@plt>
mov    $0x1,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
define i32 @handle_xerror(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 = call i32 @XCloseDisplay(i32* %5)
%7 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
define i32 @handle_xerror(i32* %0, i32* nocapture readnone %1) {
%3 = tail call i32 @XCloseDisplay(i32* %0)
%4 = tail call i32 @exit(i32 1)
unreachable
}
/* Type definitions */
struct net_device {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ netif_carrier_off(struct net_device *);
void acx_carrier_off(struct net_device *ndev, const char *msg) {
  netif_carrier_off(ndev);
  if (msg)
    ;
}


x86 assembly (clang, -O0):
<acx_carrier_off>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <netif_carrier_off@plt>
cmpq   $0x0,-0x10(%rbp)
je     1139 <acx_carrier_off+0x29>
jmp    1139 <acx_carrier_off+0x29>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<acx_carrier_off>:
jmp    1030 <netif_carrier_off@plt>

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

LLVM IR (-O2):
%struct.net_device = type { i32 }
define void @acx_carrier_off(%struct.net_device* %0, i8* nocapture readnone %1) {
%3 = tail call i32 @netif_carrier_off(%struct.net_device* %0)
ret void
}
/* Variables and functions */
int memcmp(void const *, void const *, int);
int cmp_16(const void *a, const void *b) { return memcmp(a, b, 16); }


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

x86 assembly (clang, -O2):
<cmp_16>:
mov    $0x10,%edx
jmp    1030 <memcmp@plt>

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

LLVM IR (-O2):
define i32 @cmp_16(i8* %0, i8* %1) {
%3 = tail call i32 @memcmp(i8* %0, i8* %1, i32 16)
ret i32 %3
}
void potsync() {}


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

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

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

LLVM IR (-O2):
define void @potsync() {
ret void
}
__attribute__((noipa)) void *return_vla_plus_cst(int n) {
  char a[n];
  char *p = a + 3;
  sink(p);
  return p;
}


x86 assembly (clang, -O0):
<return_vla_plus_cst>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,%ecx
mov    %rsp,%rax
mov    %rax,-0x10(%rbp)
mov    %rcx,%rdx
add    $0xf,%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rax
sub    %rdx,%rax
mov    %rax,%rsp
mov    %rcx,-0x18(%rbp)
add    $0x3,%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    $0x0,%al
call   1030 <sink@plt>
mov    -0x20(%rbp),%rax
mov    -0x10(%rbp),%rcx
mov    %rcx,%rsp
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<return_vla_plus_cst>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
push   %rax
mov    %edi,%eax
mov    %rsp,%rcx
add    $0xf,%rax
and    $0xfffffffffffffff0,%rax
mov    %rcx,%rdx
sub    %rax,%rdx
mov    %rdx,%rsp
neg    %rax
lea    (%rcx,%rax,1),%rbx
add    $0x3,%rbx
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <sink@plt>
mov    %rbx,%rax
lea    -0x8(%rbp),%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i8* @return_vla_plus_cst(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i8*
store i32 %0, i32* %2
%6 = load i32, i32* %2
%7 = zext i32 %6 to i64
%8 = call i8* @llvm.stacksave()
store i8* %8, i8** %3
%9 = alloca i8, i64 %7
store i64 %7, i64* %4
%10 = getelementptr inbounds i8, i8* %9, i64 3
store i8* %10, i8** %5
%11 = load i8*, i8** %5
%12 = call i32 (i8*, ...) bitcast (i32 (...)* @sink to i32 (i8*, ...)*)(i8* %11)
%13 = load i8*, i8** %5
%14 = load i8*, i8** %3
ret i8* %13
}

LLVM IR (-O2):
define i8* @return_vla_plus_cst(i32 %0) {
%2 = zext i32 %0 to i64
%3 = alloca i8, i64 %2
%4 = getelementptr inbounds i8, i8* %3, i64 3
%5 = call i32 (i8*, ...) bitcast (i32 (...)* @sink to i32 (i8*, ...)*)(i8* %4)
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_usage() {
  printf("Usage: snoop -p < mica | mica2 > [ -t <select_timeout> ]\n");
  printf("             [ -d <serial_device_number> ]\n");
  printf("             [ -l <wrap-arround_line_length> ]\n");
  printf("             [ -c ]\n");
}


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

x86 assembly (clang, -O2):
<print_usage>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xf15(%rip),%rdi
call   1030 <puts@plt>
lea    0xf34(%rip),%rdi
call   1030 <puts@plt>
lea    0xf57(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [58 x i8] c"Usage: snoop -p < mica | mica2 > [ -t <select_timeout> ]\0A\00"
@.str.1 = [44 x i8] c" [ -d <serial_device_number> ]\0A\00"
@.str.2 = [48 x i8] c" [ -l <wrap-arround_line_length> ]\0A\00"
@.str.3 = [21 x i8] c" [ -c ]\0A\00"
define void @print_usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [57 x i8] c"Usage: snoop -p < mica | mica2 > [ -t <select_timeout> ]\00"
@str.4 = [43 x i8] c" [ -d <serial_device_number> ]\00"
@str.5 = [47 x i8] c" [ -l <wrap-arround_line_length> ]\00"
@str.6 = [20 x i8] c" [ -c ]\00"
define void @print_usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([57 x i8], [57 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @str.4, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([47 x i8], [47 x i8]* @str.5, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str.6, i64 0, i64 0))
ret void
}
int TTY_Poll(void) { return 1; }


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

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

LLVM IR (-O0):
define i32 @TTY_Poll() {
ret i32 1
}

LLVM IR (-O2):
define i32 @TTY_Poll() {
ret i32 1
}
int check_month(int *UCN) {
  int month = UCN[2] * 10 + UCN[3];
  if ((month <= 0) || (month > 12 && month < 21) ||
      (month > 32 && month < 41) || month > 52)
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<check_month>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
imul   $0xa,0x8(%rax),%eax
mov    -0x10(%rbp),%rcx
add    0xc(%rcx),%eax
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jle    1156 <check_month+0x56>
cmpl   $0xc,-0x14(%rbp)
jle    1138 <check_month+0x38>
cmpl   $0x15,-0x14(%rbp)
jl     1156 <check_month+0x56>
cmpl   $0x20,-0x14(%rbp)
jle    114c <check_month+0x4c>
cmpl   $0x29,-0x14(%rbp)
jl     1156 <check_month+0x56>
cmpl   $0x34,-0x14(%rbp)
jle    1162 <check_month+0x62>
movl   $0x1,-0x4(%rbp)
jmp    1169 <check_month+0x69>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_month>:
mov    0x8(%rdi),%eax
mov    0xc(%rdi),%edx
lea    (%rax,%rax,4),%esi
lea    (%rdx,%rsi,2),%ecx
mov    $0x1,%eax
test   %ecx,%ecx
jle    1134 <check_month+0x34>
lea    (%rdx,%rsi,2),%edx
add    $0xfffffff3,%edx
cmp    $0x8,%edx
jb     1134 <check_month+0x34>
lea    -0x21(%rcx),%eax
cmp    $0x8,%eax
setb   %al
cmp    $0x35,%ecx
setae  %cl
or     %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @check_month(i32* %0) {
%2 = alloca i32
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
%5 = load i32*, i32** %3
%6 = getelementptr inbounds i32, i32* %5, i64 2
%7 = load i32, i32* %6
%8 = mul nsw i32 %7, 10
%9 = load i32*, i32** %3
%10 = getelementptr inbounds i32, i32* %9, i64 3
%11 = load i32, i32* %10
%12 = add nsw i32 %8, %11
store i32 %12, i32* %4
%13 = load i32, i32* %4
%14 = icmp sle i32 %13, 0
br i1 %14, label %30, label %15
15: ; preds = %1
%16 = load i32, i32* %4
%17 = icmp sgt i32 %16, 12
br i1 %17, label %18, label %21
18: ; preds = %15
%19 = load i32, i32* %4
%20 = icmp slt i32 %19, 21
br i1 %20, label %30, label %21
21: ; preds = %18, %15
%22 = load i32, i32* %4
%23 = icmp sgt i32 %22, 32
br i1 %23, label %24, label %27
24: ; preds = %21
%25 = load i32, i32* %4
%26 = icmp slt i32 %25, 41
br i1 %26, label %30, label %27
27: ; preds = %24, %21
%28 = load i32, i32* %4
%29 = icmp sgt i32 %28, 52
br i1 %29, label %30, label %31
30: ; preds = %27, %24, %18, %1
store i32 1, i32* %2
br label %32
31: ; preds = %27
store i32 0, i32* %2
br label %32
32: ; preds = %31, %30
%33 = load i32, i32* %2
ret i32 %33
}

LLVM IR (-O2):
define i32 @check_month(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 2
%3 = load i32, i32* %2
%4 = mul nsw i32 %3, 10
%5 = getelementptr inbounds i32, i32* %0, i64 3
%6 = load i32, i32* %5
%7 = add nsw i32 %4, %6
%8 = icmp slt i32 %7, 1
%9 = add i32 %7, -13
%10 = icmp ult i32 %9, 8
%11 = or i1 %8, %10
br i1 %11, label %18, label %12
12: ; preds = %1
%13 = add nsw i32 %7, -33
%14 = icmp ult i32 %13, 8
%15 = icmp ugt i32 %7, 52
%16 = or i1 %15, %14
%17 = zext i1 %16 to i32
br label %18
18: ; preds = %12, %1
%19 = phi i32 [ 1, %1 ], [ %17, %12 ]
ret i32 %19
}
void clock_init() {}


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

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

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

LLVM IR (-O2):
define void @clock_init() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage() {
  fprintf(stderr, "Usage: worddiff dict1 dict2\n");
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [29 x i8] c"Usage: worddiff dict1 dict2\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [29 x i8] c"Usage: worddiff dict1 dict2\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isspace(int);
void t_isspace_0x81() {
  Assert_real((isspace(129) == 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_isspace.c",
              650, ("isspace should be 0 for 0x81"));
}


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

x86 assembly (clang, -O2):
<t_isspace_0x81>:
push   %rax
mov    $0x81,%edi
call   1030 <isspace@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x28a,%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_isspace.c\00"
@.str.1 = [29 x i8] c"isspace should be 0 for 0x81\00"
define void @t_isspace_0x81() {
%1 = call i64 @isspace(i32 129)
%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 650, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isspace.c\00"
@.str.1 = [29 x i8] c"isspace should be 0 for 0x81\00"
define void @t_isspace_0x81() {
%1 = tail call i64 @isspace(i32 129)
%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 650, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stdout;
void _erase_to_line_end(void) { fprintf(stdout, "\x1B[K"); }


x86 assembly (clang, -O0):
<_erase_to_line_end>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
@stdout = global i32 0
@.str = [4 x i8] c"\1B[K\00"
define void @_erase_to_line_end() {
%1 = load i32, i32* @stdout
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [4 x i8] c"\1B[K\00"
define void @_erase_to_line_end() {
%1 = load i32, i32* @stdout
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ isunordered(double, double);
void uninitvar_isunordered(void) {
  double d1, d2;
  (void)isunordered(d1, d2);
}


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

x86 assembly (clang, -O2):
<uninitvar_isunordered>:
jmp    1030 <isunordered@plt>

LLVM IR (-O0):
define void @uninitvar_isunordered() {
%1 = alloca double
%2 = alloca double
%3 = load double, double* %1
%4 = load double, double* %2
%5 = call i32 @isunordered(double %3, double %4)
ret void
}

LLVM IR (-O2):
define void @uninitvar_isunordered() {
%1 = tail call i32 @isunordered(double undef, double undef)
ret void
}
unsigned long http_parser_version(void) {
  return 2 * 0x10000 | 3 * 0x00100 | 0 * 0x00001;
}


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

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

LLVM IR (-O0):
define i64 @http_parser_version() {
ret i64 131840
}

LLVM IR (-O2):
define i64 @http_parser_version() {
ret i64 131840
}
/* Variables and functions */
int b_mem_release(void *, int);
int liballoc_free(void *mem, int n) {
  int freed = b_mem_release(mem, n);
  return freed != n;
}


x86 assembly (clang, -O0):
<liballoc_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <b_mem_release@plt>
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
setne  %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<liballoc_free>:
push   %rbx
mov    %esi,%ebx
call   1030 <b_mem_release@plt>
xor    %ecx,%ecx
cmp    %ebx,%eax
setne  %cl
mov    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @liballoc_free(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i8*, i8** %3
%7 = load i32, i32* %4
%8 = call i32 @b_mem_release(i8* %6, i32 %7)
store i32 %8, i32* %5
%9 = load i32, i32* %5
%10 = load i32, i32* %4
%11 = icmp ne i32 %9, %10
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @liballoc_free(i8* %0, i32 %1) {
%3 = tail call i32 @b_mem_release(i8* %0, i32 %1)
%4 = icmp ne i32 %3, %1
%5 = zext i1 %4 to i32
ret i32 %5
}
int test_imm_C9int64_highword_mem(long long *val) {
  return ((*val >> 32) & (0xC9 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_C9int64_highword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 863288426496
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ strcmp(char *, char *);
int strings_equal(char *string1, char *string2) {
  if (!strcmp(string1, string2)) {
    return 1;
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<strings_equal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%eax
jne    1142 <strings_equal+0x32>
movl   $0x1,-0x4(%rbp)
jmp    1149 <strings_equal+0x39>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @strings_equal(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
%4 = icmp eq i32 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
unsigned int ggt(unsigned int x, unsigned int y) {
  while (x != y) {
    if (x > y) {
      x = x - y;
    } else {
      y = y - x;
    }
  }
}


x86 assembly (clang, -O0):
<ggt>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
je     113e <ggt+0x3e>
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jbe    1130 <ggt+0x30>
mov    -0x8(%rbp),%eax
sub    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    1139 <ggt+0x39>
mov    -0xc(%rbp),%eax
sub    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    110a <ggt+0xa>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @ggt(i32 %0, i32 %1) {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ __wrap_fork();
int /*<<< orphan*/ srand(int /*<<< orphan*/);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
int main(int argc, char **argv) {
  srand(time(NULL));
  __wrap_fork();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1050 <time@plt>
mov    %eax,%edi
call   1040 <srand@plt>
mov    $0x0,%al
call   1030 <__wrap_fork@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
call   1050 <time@plt>
mov    %eax,%edi
call   1040 <srand@plt>
xor    %eax,%eax
call   1030 <__wrap_fork@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = call i32 @time(i32* null)
%6 = call i32 @srand(i32 %5)
%7 = call i32 (...) @__wrap_fork()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @time(i32* null)
%4 = tail call i32 @srand(i32 %3)
%5 = tail call i32 (...) @__wrap_fork()
ret i32 0
}
void __atomic_store_1(volatile void *atom, unsigned char value, int memorder) {
  *(volatile unsigned char *)atom = value;
}


x86 assembly (clang, -O0):
<__atomic_store_1>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x9(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<__atomic_store_1>:
mov    %sil,(%rdi)
ret

LLVM IR (-O0):
define void @__atomic_store_1(i8* %0, i8 zeroext %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i32
store i8* %0, i8** %4
store i8 %1, i8* %5
store i32 %2, i32* %6
%7 = load i8, i8* %5
%8 = load i8*, i8** %4
store volatile i8 %7, i8* %8
ret void
}

LLVM IR (-O2):
define void @__atomic_store_1(i8* %0, i8 zeroext %1, i32 %2) {
store volatile i8 %1, i8* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ EXIT_SUCCESS;
int SIGTERM;
int /*<<< orphan*/ _exit(int /*<<< orphan*/);
void signal_handler(int sig) {
  if (sig == SIGTERM)
    _exit(EXIT_SUCCESS);
  _exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<signal_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    113b <signal_handler+0x2b>
mov    0x2e9c(%rip),%rax
mov    (%rax),%edi
call   1030 <_exit@plt>
mov    0x2e96(%rip),%rax
mov    (%rax),%edi
call   1030 <_exit@plt>

x86 assembly (clang, -O2):
<signal_handler>:
push   %rax
mov    0x2ed0(%rip),%rax
cmp    %edi,(%rax)
jne    112a <signal_handler+0x1a>
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
call   1030 <_exit@plt>
mov    0x2ea7(%rip),%rax
mov    (%rax),%edi
call   1030 <_exit@plt>

LLVM IR (-O0):
@SIGTERM = global i32 0
@EXIT_SUCCESS = global i32 0
@EXIT_FAILURE = global i32 0
define void @signal_handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* @SIGTERM
%5 = icmp eq i32 %3, %4
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load i32, i32* @EXIT_SUCCESS
%8 = call i32 @_exit(i32 %7)
unreachable
9: ; preds = %1
%10 = load i32, i32* @EXIT_FAILURE
%11 = call i32 @_exit(i32 %10)
unreachable
}

LLVM IR (-O2):
@SIGTERM = global i32 0
@EXIT_SUCCESS = global i32 0
@EXIT_FAILURE = global i32 0
define void @signal_handler(i32 %0) {
%2 = load i32, i32* @SIGTERM
%3 = icmp eq i32 %2, %0
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = load i32, i32* @EXIT_SUCCESS
%6 = tail call i32 @_exit(i32 %5)
unreachable
7: ; preds = %1
%8 = load i32, i32* @EXIT_FAILURE
%9 = tail call i32 @_exit(i32 %8)
unreachable
}
void test4() {
  int i;
  short j;
  float *k = 1 ? &i : &j;
}


x86 assembly (clang, -O0):
<test4>:
push   %rbp
mov    %rsp,%rbp
lea    -0x4(%rbp),%rax
mov    %rax,-0x10(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @test4() {
%1 = alloca i32
%2 = alloca i16
%3 = alloca float*
%4 = bitcast i32* %1 to i8*
%5 = bitcast i8* %4 to float*
store float* %5, float** %3
ret void
}

LLVM IR (-O2):
define void @test4() {
ret void
}
/* Variables and functions */
int yaffs_readlink_reldir(int /*<<< orphan*/, char const *, char *, int);
int yaffs_readlink(const char *path, char *buf, int bufsiz) {
  return yaffs_readlink_reldir((0), path, buf, bufsiz);
}


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

x86 assembly (clang, -O2):
<yaffs_readlink>:
mov    %edx,%ecx
mov    %rsi,%rdx
mov    %rdi,%rsi
xor    %edi,%edi
jmp    1030 <yaffs_readlink_reldir@plt>

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

LLVM IR (-O2):
define i32 @yaffs_readlink(i8* %0, i8* %1, i32 %2) {
%4 = tail call i32 @yaffs_readlink_reldir(i32 0, i8* %0, i8* %1, i32 %2)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void printArray(int *arr, int nmem) {
  int i;
  for (i = 0; i < nmem; i++)
    printf("%d ", arr[i]);
  printf("\n");
}


x86 assembly (clang, -O0):
<printArray>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1159 <printArray+0x49>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xebc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <printArray+0x16>
lea    0xea4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printArray>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1157 <printArray+0x37>
mov    %rdi,%r15
mov    %esi,%r12d
lea    0xec7(%rip),%r14
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
mov    (%r15,%rbx,4),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1140 <printArray+0x20>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%d \00"
@.str.1 = [2 x i8] c"\0A\00"
define void @printArray(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
store i32 0, i32* %5
br label %6
6: ; preds = %17, %2
%7 = load i32, i32* %5
%8 = load i32, i32* %4
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %20
10: ; preds = %6
%11 = load i32*, i32** %3
%12 = load i32, i32* %5
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i32, i32* %11, i64 %13
%15 = load i32, i32* %14
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %15)
br label %17
17: ; preds = %10
%18 = load i32, i32* %5
%19 = add nsw i32 %18, 1
store i32 %19, i32* %5
br label %6
20: ; preds = %6
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d \00"
define void @printArray(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = load i32, i32* %8
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
%14 = tail call i32 @putchar(i32 10)
ret void
}
int _submask_testmaskc(int maskc) {
  if (maskc <= 0 || maskc > 32) {
    return 0;
  }
  return 1;
}


x86 assembly (clang, -O0):
<_submask_testmaskc>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jle    111b <_submask_testmaskc+0x1b>
cmpl   $0x20,-0x8(%rbp)
jle    1127 <_submask_testmaskc+0x27>
movl   $0x0,-0x4(%rbp)
jmp    112e <_submask_testmaskc+0x2e>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_submask_testmaskc>:
add    $0xffffffff,%edi
xor    %eax,%eax
cmp    $0x20,%edi
setb   %al
ret

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

LLVM IR (-O2):
define i32 @_submask_testmaskc(i32 %0) {
%2 = add i32 %0, -1
%3 = icmp ult i32 %2, 32
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ thanks_2();
int main() {
  printf("Hello World\n");
  thanks_2();
  return 0;
}


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

LLVM IR (-O0):
@.str = [13 x i8] c"Hello World\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 (...) @thanks_2()
ret i32 0
}

LLVM IR (-O2):
@str = [12 x i8] c"Hello World\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 (...) @thanks_2()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ _exit(int);
int /*<<< orphan*/ len(char const *);
int /*<<< orphan*/ write(int, char const *, int /*<<< orphan*/);
int p_exit(const char *str, int exitval) {
  write(2, str, len(str));
  _exit(exitval);
}


x86 assembly (clang, -O0):
<p_exit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <len@plt>
mov    -0x18(%rbp),%rsi
mov    %eax,%edx
mov    $0x2,%edi
call   1050 <write@plt>
mov    -0xc(%rbp),%edi
call   1040 <_exit@plt>

x86 assembly (clang, -O2):
<p_exit>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
call   1030 <len@plt>
mov    $0x2,%edi
mov    %rbx,%rsi
mov    %eax,%edx
call   1050 <write@plt>
mov    %ebp,%edi
call   1040 <_exit@plt>

LLVM IR (-O0):
define i32 @p_exit(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %3
%7 = call i32 @len(i8* %6)
%8 = call i32 @write(i32 2, i8* %5, i32 %7)
%9 = load i32, i32* %4
%10 = call i32 @_exit(i32 %9)
unreachable
}

LLVM IR (-O2):
define i32 @p_exit(i8* %0, i32 %1) {
%3 = tail call i32 @len(i8* %0)
%4 = tail call i32 @write(i32 2, i8* %0, i32 %3)
%5 = tail call i32 @_exit(i32 %1)
unreachable
}