xunge/DecIR huggingface dataset:
int uppercase(char *s) {
  for (; *s; s++)
    if (*s >= 'a' && *s <= 'z')
      *s += 'A' - 'a';
  return 0;
}


x86 assembly (clang, -O0):
<uppercase>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1157 <uppercase+0x57>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x61,%eax
jl     1141 <uppercase+0x41>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x7a,%eax
jg     1141 <uppercase+0x41>
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
add    $0xffffffe0,%ecx
mov    %cl,(%rax)
jmp    1146 <uppercase+0x46>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1108 <uppercase+0x8>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<uppercase>:
mov    (%rdi),%al
test   %al,%al
je     112a <uppercase+0x2a>
add    $0x1,%rdi
jmp    111b <uppercase+0x1b>
nopl   0x0(%rax)
movzbl (%rdi),%eax
add    $0x1,%rdi
test   %al,%al
je     112a <uppercase+0x2a>
lea    -0x61(%rax),%ecx
cmp    $0x19,%cl
ja     1110 <uppercase+0x10>
add    $0xe0,%al
mov    %al,-0x1(%rdi)
jmp    1110 <uppercase+0x10>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @uppercase(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %15, label %4
4: ; preds = %1, %11
%5 = phi i8 [ %13, %11 ], [ %2, %1 ]
%6 = phi i8* [ %12, %11 ], [ %0, %1 ]
%7 = add i8 %5, -97
%8 = icmp ult i8 %7, 26
br i1 %8, label %9, label %11
9: ; preds = %4
%10 = add nsw i8 %5, -32
store i8 %10, i8* %6
br label %11
11: ; preds = %4, %9
%12 = getelementptr inbounds i8, i8* %6, i64 1
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %4
15: ; preds = %11, %1
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ itox(int);
void put_nibbles(char *dst, unsigned int src, int n_nibbles) {
  int nibble;
  while (n_nibbles--) {
    nibble = (src >> (n_nibbles << 2)) & 0xF;
    *dst++ = itox(nibble);
  }
}


x86 assembly (clang, -O0):
<put_nibbles>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x10(%rbp)
cmp    $0x0,%eax
je     1167 <put_nibbles+0x57>
mov    -0xc(%rbp),%eax
mov    -0x10(%rbp),%ecx
shl    $0x2,%ecx
shr    %cl,%eax
and    $0xf,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
call   1030 <itox@plt>
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %cl,(%rax)
jmp    1122 <put_nibbles+0x12>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<put_nibbles>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
test   %edx,%edx
je     114f <put_nibbles+0x3f>
mov    %esi,%r14d
mov    %rdi,%r15
lea    -0x4(,%rdx,4),%ebp
mov    %edx,%r12d
xor    %ebx,%ebx
xchg   %ax,%ax
mov    %r14d,%edi
mov    %ebp,%ecx
shr    %cl,%edi
and    $0xf,%edi
call   1030 <itox@plt>
mov    %al,(%r15,%rbx,1)
add    $0xfffffffc,%ebp
add    $0x1,%rbx
cmp    %ebx,%r12d
jne    1130 <put_nibbles+0x20>
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define void @put_nibbles(i8* nocapture writeonly %0, i32 %1, i32 %2) {
%4 = icmp eq i32 %2, 0
br i1 %4, label %16, label %5
5: ; preds = %3, %5
%6 = phi i32 [ %8, %5 ], [ %2, %3 ]
%7 = phi i8* [ %14, %5 ], [ %0, %3 ]
%8 = add nsw i32 %6, -1
%9 = shl i32 %8, 2
%10 = lshr i32 %1, %9
%11 = and i32 %10, 15
%12 = tail call i32 @itox(i32 %11)
%13 = trunc i32 %12 to i8
%14 = getelementptr inbounds i8, i8* %7, i64 1
store i8 %13, i8* %7
%15 = icmp eq i32 %8, 0
br i1 %15, label %16, label %5
16: ; preds = %5, %3
ret void
}
char char2lower(char c) { return c >= 'A' && c <= 'Z' ? c | 0x60 : c; }


x86 assembly (clang, -O0):
<char2lower>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x41,%eax
jl     1133 <char2lower+0x33>
movsbl -0x1(%rbp),%eax
cmp    $0x5a,%eax
jg     1133 <char2lower+0x33>
movsbl -0x1(%rbp),%eax
or     $0x60,%eax
mov    %eax,-0x8(%rbp)
jmp    113a <char2lower+0x3a>
movsbl -0x1(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<char2lower>:
lea    -0x41(%rdi),%eax
mov    %edi,%ecx
or     $0x60,%cl
cmp    $0x1a,%al
movzbl %cl,%eax
cmovae %edi,%eax
ret

LLVM IR (-O0):
define signext i8 @char2lower(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp sge i32 %4, 65
br i1 %5, label %6, label %14
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp sle i32 %8, 90
br i1 %9, label %10, label %14
10: ; preds = %6
%11 = load i8, i8* %2
%12 = sext i8 %11 to i32
%13 = or i32 %12, 96
br label %17
14: ; preds = %6, %1
%15 = load i8, i8* %2
%16 = sext i8 %15 to i32
br label %17
17: ; preds = %14, %10
%18 = phi i32 [ %13, %10 ], [ %16, %14 ]
%19 = trunc i32 %18 to i8
ret i8 %19
}

LLVM IR (-O2):
define signext i8 @char2lower(i8 signext %0) {
%2 = add i8 %0, -65
%3 = icmp ult i8 %2, 26
%4 = or i8 %0, 96
%5 = select i1 %3, i8 %4, i8 %0
ret i8 %5
}
/* Variables and functions */
void *calloc(size_t, size_t);
int /*<<< orphan*/ nomem();
void *xcalloc(size_t n, size_t s) {
  void *p;
  if ((p = calloc(n, s)) == NULL)
    nomem();
  return (p);
}


x86 assembly (clang, -O0):
<xcalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <calloc@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
jne    1152 <xcalloc+0x32>
mov    $0x0,%al
call   1040 <nomem@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xcalloc>:
push   %rbx
call   1030 <calloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1135 <xcalloc+0x15>
xor    %eax,%eax
call   1040 <nomem@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define noalias i8* @xcalloc(i64 %0, i64 %1) {
%3 = tail call i8* @calloc(i64 %0, i64 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 (...) @nomem()
br label %7
7: ; preds = %5, %2
ret i8* %3
}
/* Variables and functions */
int dev_clear();
int cleanup(void) { return dev_clear(); }


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

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

LLVM IR (-O0):
define i32 @cleanup() {
%1 = call i32 (...) @dev_clear()
ret i32 %1
}

LLVM IR (-O2):
define i32 @cleanup() {
%1 = tail call i32 (...) @dev_clear()
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ ErrorExit(char const *, int /*<<< orphan*/);
int /*<<< orphan*/ strerror(int const);
void ErrorIntExit(const char *who, const int how) {
  ErrorExit(who, strerror(how));
}


x86 assembly (clang, -O0):
<ErrorIntExit>:
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    -0xc(%rbp),%edi
call   1040 <strerror@plt>
mov    -0x18(%rbp),%rdi
mov    %eax,%esi
call   1030 <ErrorExit@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ErrorIntExit>:
push   %rbx
mov    %rdi,%rbx
mov    %esi,%edi
call   1040 <strerror@plt>
mov    %rbx,%rdi
mov    %eax,%esi
pop    %rbx
jmp    1030 <ErrorExit@plt>

LLVM IR (-O0):
define void @ErrorIntExit(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 i32, i32* %4
%7 = call i32 @strerror(i32 %6)
%8 = call i32 @ErrorExit(i8* %5, i32 %7)
ret void
}

LLVM IR (-O2):
define void @ErrorIntExit(i8* %0, i32 %1) {
%3 = tail call i32 @strerror(i32 %1)
%4 = tail call i32 @ErrorExit(i8* %0, i32 %3)
ret void
}
/* Variables and functions */
scalar_t__ Malloc(size_t);
char *strcpy(char *, char *);
scalar_t__ strlen(char *);
char *StrSave(char *string) {
  return (strcpy((char *)Malloc((size_t)(strlen(string) + 1)), string));
}


x86 assembly (clang, -O0):
<StrSave>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <strlen@plt>
mov    %rax,%rdi
add    $0x1,%rdi
call   1030 <Malloc@plt>
mov    %rax,%rdi
mov    -0x8(%rbp),%rsi
call   1040 <strcpy@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<StrSave>:
push   %rbx
mov    %rdi,%rbx
call   1050 <strlen@plt>
lea    0x1(%rax),%rdi
call   1030 <Malloc@plt>
mov    %rax,%rdi
mov    %rbx,%rsi
pop    %rbx
jmp    1040 <strcpy@plt>

LLVM IR (-O0):
define i8* @StrSave(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i64 @strlen(i8* %3)
%5 = add nsw i64 %4, 1
%6 = call i64 @Malloc(i64 %5)
%7 = inttoptr i64 %6 to i8*
%8 = load i8*, i8** %2
%9 = call i8* @strcpy(i8* %7, i8* %8)
ret i8* %9
}

LLVM IR (-O2):
define i8* @StrSave(i8* nocapture %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add nsw i64 %2, 1
%4 = tail call i64 @Malloc(i64 %3)
%5 = inttoptr i64 %4 to i8*
%6 = tail call i8* @strcpy(i8* dereferenceable(1) %5, i8* dereferenceable(1) %0)
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void PT(int howmany) {
  int i;
  for (i = 0; i < howmany; i++)
    printf(" ");
}


x86 assembly (clang, -O0):
<PT>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1148 <PT+0x38>
lea    0xecb(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1122 <PT+0x12>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PT>:
push   %rbx
test   %edi,%edi
jle    112f <PT+0x1f>
mov    %edi,%ebx
nopw   0x0(%rax,%rax,1)
mov    $0x20,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebx
jne    1120 <PT+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @PT(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %8
3: ; preds = %1, %3
%4 = phi i32 [ %6, %3 ], [ 0, %1 ]
%5 = tail call i32 @putchar(i32 32)
%6 = add nuw nsw i32 %4, 1
%7 = icmp eq i32 %6, %0
br i1 %7, label %8, label %3
8: ; preds = %3, %1
ret void
}
int my_aes_get_size(int source_length) {
  return 16 * (source_length / 16) + 16;
}


x86 assembly (clang, -O0):
<my_aes_get_size>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x10,%ecx
cltd
idiv   %ecx
shl    $0x4,%eax
add    $0x10,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_aes_get_size>:
lea    0xf(%rdi),%eax
test   %edi,%edi
cmovns %edi,%eax
and    $0xfffffff0,%eax
add    $0x10,%eax
ret

LLVM IR (-O0):
define i32 @my_aes_get_size(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sdiv i32 %3, 16
%5 = mul nsw i32 16, %4
%6 = add nsw i32 %5, 16
ret i32 %6
}

LLVM IR (-O2):
define i32 @my_aes_get_size(i32 %0) {
%2 = sdiv i32 %0, 16
%3 = shl nsw i32 %2, 4
%4 = add nsw i32 %3, 16
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int age = 10;
  int height = 60;
  printf("I am %d years old.\n", age);
  printf("I am %d inches tall.\n", height);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xa,-0x8(%rbp)
movl   $0x3c,-0xc(%rbp)
mov    -0x8(%rbp),%esi
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%esi
lea    0xece(%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
mov    $0xa,%esi
call   1030 <printf@plt>
lea    0xeeb(%rip),%rdi
mov    $0x3c,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [20 x i8] c"I am %d years old.\0A\00"
@.str.1 = [22 x i8] c"I am %d inches tall.\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 10, i32* %2
store i32 60, i32* %3
%4 = load i32, i32* %2
%5 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = load i32, i32* %3
%7 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i32 %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [20 x i8] c"I am %d years old.\0A\00"
@.str.1 = [22 x i8] c"I am %d inches tall.\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 10)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i32 60)
ret i32 0
}
void ERR_get_state(void) {}


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

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

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

LLVM IR (-O2):
define void @ERR_get_state() {
ret void
}
int main(int argc, char **argv) {
  int x = 3 + 7;
  int y = x + 22;
  return 10 + y;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0xa,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x16,%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
add    $0xa,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 10, i32* %6
%8 = load i32, i32* %6
%9 = add nsw i32 %8, 22
store i32 %9, i32* %7
%10 = load i32, i32* %7
%11 = add nsw i32 10, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
ret i32 42
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int prompt(void) {
  printf("imma run the interpreter.\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [27 x i8] c"imma run the interpreter.\0A\00"
define i32 @prompt() {
%1 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [26 x i8] c"imma run the interpreter.\00"
define i32 @prompt() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  unsigned long window;
};
struct TYPE_4__ {
  TYPE_1__ xmaprequest;
};
typedef TYPE_2__ XEvent;

/* Variables and functions */
void set_XEvent_xmaprequest_window(void *_p, unsigned long _v) {
  ((XEvent *)_p)->xmaprequest.window = (unsigned long)_v;
}


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

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

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

LLVM IR (-O2):
define void @set_XEvent_xmaprequest_window(i8* nocapture writeonly %0, i64 %1) {
%3 = bitcast i8* %0 to i64*
store i64 %1, i64* %3
ret void
}
/* Variables and functions */
scalar_t__ malloc(int);
int /*<<< orphan*/ strcpy(char *, char *);
int strlen(char *);
char *internal_sub_strdup(char *src) {
  char *ret;
  int len;
  len = strlen(src);
  ret = (char *)malloc(len + 1);
  if (ret) {
    strcpy(ret, src);
  }
  return ret;
}


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

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

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

LLVM IR (-O2):
define i8* @internal_sub_strdup(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = add nsw i32 %2, 1
%4 = tail call i64 @malloc(i32 %3)
%5 = inttoptr i64 %4 to i8*
%6 = icmp eq i64 %4, 0
br i1 %6, label %9, label %7
7: ; preds = %1
%8 = tail call i32 @strcpy(i8* %5, i8* %0)
br label %9
9: ; preds = %7, %1
ret i8* %5
}
void DMTimerIntRawStatusSet(unsigned int baseAdd, unsigned int intFlags) {
  (*((volatile unsigned int *)(baseAdd + (0x24)))) =
      (intFlags & ((0x00000001u) | (0x00000002u) | (0x00000004u)));
}


x86 assembly (clang, -O0):
<DMTimerIntRawStatusSet>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%ecx
and    $0x7,%ecx
mov    -0x4(%rbp),%eax
add    $0x24,%eax
mov    %eax,%eax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<DMTimerIntRawStatusSet>:
and    $0x7,%esi
add    $0x24,%edi
mov    %esi,(%rdi)
ret

LLVM IR (-O0):
define void @DMTimerIntRawStatusSet(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = and i32 %5, 7
%7 = load i32, i32* %3
%8 = add i32 %7, 36
%9 = zext i32 %8 to i64
%10 = inttoptr i64 %9 to i32*
store volatile i32 %6, i32* %10
ret void
}

LLVM IR (-O2):
define void @DMTimerIntRawStatusSet(i32 %0, i32 %1) {
%3 = and i32 %1, 7
%4 = add i32 %0, 36
%5 = zext i32 %4 to i64
%6 = inttoptr i64 %5 to i32*
store volatile i32 %3, i32* %6
ret void
}
/* Variables and functions */
int putchar(int);
int putcharf(int c) { return (putchar(c)); }


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

x86 assembly (clang, -O2):
<putcharf>:
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
define i32 @putcharf(i32 %0) {
%2 = tail call i32 @putchar(i32 %0)
ret i32 %2
}
/* Type definitions */
struct TreeNode {
  int dummy;
};

/* Variables and functions */
int *malloc(int);
int /*<<< orphan*/ traversal(struct TreeNode *, int *, int *);
int *postorderTraversal(struct TreeNode *root, int *returnSize) {
  int *postorder = malloc(sizeof(int));
  int counter = 0;
  traversal(root, postorder, &counter);
  *returnSize = counter;
  return postorder;
}


x86 assembly (clang, -O0):
<postorderTraversal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x4,%edi
call   1030 <malloc@plt>
mov    %rax,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
lea    -0x1c(%rbp),%rdx
call   1040 <traversal@plt>
mov    -0x1c(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<postorderTraversal>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%r14
mov    %rdi,%r15
mov    $0x4,%edi
call   1030 <malloc@plt>
mov    %rax,%rbx
movl   $0x0,0xc(%rsp)
lea    0xc(%rsp),%rdx
mov    %r15,%rdi
mov    %rax,%rsi
call   1040 <traversal@plt>
mov    0xc(%rsp),%eax
mov    %eax,(%r14)
mov    %rbx,%rax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
%struct.TreeNode = type { i32 }
define i32* @postorderTraversal(%struct.TreeNode* %0, i32* %1) {
%3 = alloca %struct.TreeNode*
%4 = alloca i32*
%5 = alloca i32*
%6 = alloca i32
store %struct.TreeNode* %0, %struct.TreeNode** %3
store i32* %1, i32** %4
%7 = call i32* @malloc(i32 4)
store i32* %7, i32** %5
store i32 0, i32* %6
%8 = load %struct.TreeNode*, %struct.TreeNode** %3
%9 = load i32*, i32** %5
%10 = call i32 @traversal(%struct.TreeNode* %8, i32* %9, i32* %6)
%11 = load i32, i32* %6
%12 = load i32*, i32** %4
store i32 %11, i32* %12
%13 = load i32*, i32** %5
ret i32* %13
}

LLVM IR (-O2):
%struct.TreeNode = type { i32 }
define i32* @postorderTraversal(%struct.TreeNode* %0, i32* nocapture writeonly %1) {
%3 = alloca i32
%4 = tail call i32* @malloc(i32 4)
%5 = bitcast i32* %3 to i8*
store i32 0, i32* %3
%6 = call i32 @traversal(%struct.TreeNode* %0, i32* %4, i32* %3)
%7 = load i32, i32* %3
store i32 %7, i32* %1
ret i32* %4
}
/* Variables and functions */
int listen(int, int);
int /*<<< orphan*/ unix_error(char *);
void Listen(int s, int backlog) {
  int rc;
  if ((rc = listen(s, backlog)) < 0)
    unix_error("Listen error");
}


x86 assembly (clang, -O0):
<Listen>:
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   1040 <listen@plt>
mov    %eax,-0xc(%rbp)
cmp    $0x0,%eax
jge    1151 <Listen+0x31>
lea    0xeb4(%rip),%rdi
call   1030 <unix_error@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Listen>:
push   %rax
call   1040 <listen@plt>
test   %eax,%eax
js     112c <Listen+0xc>
pop    %rax
ret
lea    0xecd(%rip),%rdi
pop    %rax
jmp    1030 <unix_error@plt>

LLVM IR (-O0):
@.str = [13 x i8] c"Listen error\00"
define void @Listen(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* %3
%7 = load i32, i32* %4
%8 = call i32 @listen(i32 %6, i32 %7)
store i32 %8, i32* %5
%9 = icmp slt i32 %8, 0
br i1 %9, label %10, label %12
10: ; preds = %2
%11 = call i32 @unix_error(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
br label %12
12: ; preds = %10, %2
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c"Listen error\00"
define void @Listen(i32 %0, i32 %1) {
%3 = tail call i32 @listen(i32 %0, i32 %1)
%4 = icmp slt i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @unix_error(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %2
ret void
}
int main() {
  double a[2][2];
  memcpy(a, (double[2][2]){{1.0, 2.0}, {3.0, 4.0}}, sizeof a);
  printf("%f %f %f %f\n", a[0][0], a[0][1], a[1][0], a[1][1]);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2f02(%rip),%rax
mov    %rax,-0x50(%rbp)
mov    0x2eff(%rip),%rax
mov    %rax,-0x48(%rbp)
mov    0x2efc(%rip),%rax
mov    %rax,-0x40(%rbp)
mov    0x2ef9(%rip),%rax
mov    %rax,-0x38(%rbp)
mov    -0x50(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x48(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x40(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x38(%rbp),%rax
mov    %rax,-0x18(%rbp)
movsd  -0x30(%rbp),%xmm0
movsd  -0x28(%rbp),%xmm1
movsd  -0x20(%rbp),%xmm2
movsd  -0x18(%rbp),%xmm3
lea    0xe7a(%rip),%rdi
mov    $0x4,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xf08(%rip),%rdi
movsd  0xee0(%rip),%xmm0
movsd  0xee0(%rip),%xmm1
movsd  0xee0(%rip),%xmm2
movsd  0xee0(%rip),%xmm3
mov    $0x4,%al
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@constinit = private global [2 x [2 x double]] [[2 x double] [double 1.000000e+00, double 2.000000e+00], [2 x double] [double 3.000000e+00, double 4.000000e+00]]
@.str = [13 x i8] c"%f %f %f %f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [2 x [2 x double]]
%3 = alloca [2 x [2 x double]]
store i32 0, i32* %1
%4 = getelementptr inbounds [2 x [2 x double]], [2 x [2 x double]]* %2, i64 0, i64 0
%5 = bitcast [2 x double]* %4 to i8*
%6 = getelementptr inbounds [2 x [2 x double]], [2 x [2 x double]]* %3, i64 0, i64 0
%7 = bitcast [2 x [2 x double]]* %3 to i8*
%8 = getelementptr inbounds [2 x [2 x double]], [2 x [2 x double]]* %3, i64 0, i64 0
%9 = bitcast [2 x double]* %8 to i8*
%10 = getelementptr inbounds [2 x [2 x double]], [2 x [2 x double]]* %2, i64 0, i64 0
%11 = getelementptr inbounds [2 x double], [2 x double]* %10, i64 0, i64 0
%12 = load double, double* %11
%13 = getelementptr inbounds [2 x [2 x double]], [2 x [2 x double]]* %2, i64 0, i64 0
%14 = getelementptr inbounds [2 x double], [2 x double]* %13, i64 0, i64 1
%15 = load double, double* %14
%16 = getelementptr inbounds [2 x [2 x double]], [2 x [2 x double]]* %2, i64 0, i64 1
%17 = getelementptr inbounds [2 x double], [2 x double]* %16, i64 0, i64 0
%18 = load double, double* %17
%19 = getelementptr inbounds [2 x [2 x double]], [2 x [2 x double]]* %2, i64 0, i64 1
%20 = getelementptr inbounds [2 x double], [2 x double]* %19, i64 0, i64 1
%21 = load double, double* %20
%22 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), double %12, double %15, double %18, double %21)
ret i32 0
}

LLVM IR (-O2):
@.str = [13 x i8] c"%f %f %f %f\0A\00"
define i32 @main() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), double 1.000000e+00, double 2.000000e+00, double 3.000000e+00, double 4.000000e+00)
ret i32 0
}
void map(void **arr, int length, void (*func)(void *)) {
  int i = 0;
  while (i < length)
    func(arr[i++]);
}


x86 assembly (clang, -O0):
<map>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1147 <map+0x47>
mov    -0x18(%rbp),%rax
mov    -0x8(%rbp),%rcx
mov    -0x1c(%rbp),%edx
mov    %edx,%esi
add    $0x1,%esi
mov    %esi,-0x1c(%rbp)
movslq %edx,%rdx
mov    (%rcx,%rdx,8),%rdi
call   *%rax
jmp    111a <map+0x1a>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<map>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1130 <map+0x30>
mov    %rdx,%r14
mov    %rdi,%r15
mov    %esi,%r12d
xor    %ebx,%ebx
nopw   0x0(%rax,%rax,1)
mov    (%r15,%rbx,8),%rdi
add    $0x1,%rbx
call   *%r14
cmp    %rbx,%r12
jne    1120 <map+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @map(i8** nocapture %0, i32 %1, void (i8*)* nocapture %2) {
%4 = icmp sgt i32 %1, 0
br i1 %4, label %5, label %13
5: ; preds = %3
%6 = zext i32 %1 to i64
br label %7
7: ; preds = %5, %7
%8 = phi i64 [ 0, %5 ], [ %9, %7 ]
%9 = add nuw nsw i64 %8, 1
%10 = getelementptr inbounds i8*, i8** %0, i64 %8
%11 = load i8*, i8** %10
tail call void %2(i8* %11)
%12 = icmp eq i64 %9, %6
br i1 %12, label %13, label %7
13: ; preds = %7, %3
ret void
}
void delay_x(void) {
  volatile int count = 50000000;
  ;
  while (count--)
    ;
}


x86 assembly (clang, -O0):
<delay_x>:
push   %rbp
mov    %rsp,%rbp
movl   $0x2faf080,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x4(%rbp)
cmp    $0x0,%eax
je     1124 <delay_x+0x24>
jmp    110b <delay_x+0xb>
pop    %rbp
ret

x86 assembly (clang, -O2):
<delay_x>:
movl   $0x2faf080,-0x4(%rsp)
02
nopl   0x0(%rax,%rax,1)
subl   $0x1,-0x4(%rsp)
jae    1110 <delay_x+0x10>
ret

LLVM IR (-O0):
define void @delay_x() {
%1 = alloca i32
store volatile i32 50000000, i32* %1
br label %2
2: ; preds = %6, %0
%3 = load volatile i32, i32* %1
%4 = add nsw i32 %3, -1
store volatile i32 %4, i32* %1
%5 = icmp ne i32 %3, 0
br i1 %5, label %6, label %7
6: ; preds = %2
br label %2
7: ; preds = %2
ret void
}

LLVM IR (-O2):
define void @delay_x() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store volatile i32 50000000, i32* %1
br label %3
3: ; preds = %3, %0
%4 = load volatile i32, i32* %1
%5 = add nsw i32 %4, -1
store volatile i32 %5, i32* %1
%6 = icmp eq i32 %4, 0
br i1 %6, label %7, label %3
7: ; preds = %3
ret void
}
int test_imm_DFint64_lowword_mem(long long *val) {
  return ((*val) & (0xDF << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_DFint64_lowword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 223
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
long int longint_ignoring_unsignedchar(long int x, unsigned char y) {
  return x;
}


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

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

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

LLVM IR (-O2):
define i64 @longint_ignoring_unsignedchar(i64 returned %0, i8 zeroext %1) {
ret i64 %0
}
int len_name(char *name) {
  int len = 20;
  int real_len = 0;
  for (int i = 0; i < len; ++i) {
    if (name[i] > 0) {
      real_len++;
    }
  }
  return real_len;
}


x86 assembly (clang, -O0):
<len_name>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x14,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    115a <len_name+0x5a>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
jle    1147 <len_name+0x47>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    114c <len_name+0x4c>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    111d <len_name+0x1d>
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<len_name>:
movdqu (%rdi),%xmm0
pxor   %xmm1,%xmm1
movd   0x10(%rdi),%xmm2
pcmpgtb %xmm1,%xmm0
pmovmskb %xmm0,%eax
mov    %eax,%ecx
shr    %ecx
and    $0x5555,%ecx
sub    %ecx,%eax
mov    %eax,%ecx
and    $0x3333,%ecx
shr    $0x2,%eax
and    $0x3333,%eax
add    %ecx,%eax
mov    %eax,%ecx
shr    $0x4,%ecx
add    %eax,%ecx
and    $0xf0f,%ecx
mov    %ecx,%eax
shl    $0x8,%eax
add    %ecx,%eax
movzbl %ah,%ecx
pcmpgtb %xmm1,%xmm2
punpcklbw %xmm2,%xmm0
punpcklwd %xmm0,%xmm0
movmskps %xmm0,%eax
mov    %eax,%edx
shr    %dl
and    $0x5,%dl
sub    %dl,%al
mov    %eax,%edx
and    $0x33,%dl
shr    $0x2,%al
and    $0x33,%al
add    %dl,%al
mov    %eax,%edx
shr    $0x4,%dl
add    %al,%dl
and    $0xf,%dl
movzbl %dl,%eax
add    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @len_name(i8* nocapture %0) {
%2 = bitcast i8* %0 to <16 x i8>*
%3 = load <16 x i8>, <16 x i8>* %2
%4 = icmp sgt <16 x i8> %3, zeroinitializer
%5 = getelementptr inbounds i8, i8* %0, i64 16
%6 = bitcast i8* %5 to <4 x i8>*
%7 = load <4 x i8>, <4 x i8>* %6
%8 = icmp sgt <4 x i8> %7, zeroinitializer
%9 = bitcast <16 x i1> %4 to i16
%10 = call i16 @llvm.ctpop.i16(i16 %9)
%11 = zext i16 %10 to i32
%12 = bitcast <4 x i1> %8 to i4
%13 = call i4 @llvm.ctpop.i4(i4 %12)
%14 = zext i4 %13 to i32
%15 = add nuw nsw i32 %11, %14
ret i32 %15
}
/* Variables and functions */
char *addColor(char *, char *);
char *blue(char *str) { return addColor("34", str); }


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

x86 assembly (clang, -O2):
<blue>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <addColor@plt>

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

LLVM IR (-O2):
@.str = [3 x i8] c"34\00"
define i8* @blue(i8* %0) {
%2 = tail call i8* @addColor(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %0)
ret i8* %2
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_cond_t;

/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/ *);
int /*<<< orphan*/ cond_broadcast(int /*<<< orphan*/ *);
int pthread_cond_broadcast(pthread_cond_t *cond) {
  assert(cond);
  cond_broadcast(cond);
  return 0;
}


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

x86 assembly (clang, -O2):
<pthread_cond_broadcast>:
push   %rbx
mov    %rdi,%rbx
call   1030 <assert@plt>
mov    %rbx,%rdi
call   1040 <cond_broadcast@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @pthread_cond_broadcast(i32* %0) {
%2 = tail call i32 @assert(i32* %0)
%3 = tail call i32 @cond_broadcast(i32* %0)
ret i32 0
}
/* Variables and functions */
int _ada_use_c2phc(int, int *, int *, double *, int /*<<< orphan*/);
int retrieve_continuation_parameters(double *c) {
  int *a, *b, fail;
  fail = _ada_use_c2phc(72, a, b, c, 0);
  return fail;
}


x86 assembly (clang, -O0):
<retrieve_continuation_parameters>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x8(%rbp),%rcx
mov    $0x48,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<retrieve_continuation_parameters>:
mov    %rdi,%rcx
mov    $0x48,%edi
xor    %r8d,%r8d
jmp    1030 <_ada_use_c2phc@plt>

LLVM IR (-O0):
define i32 @retrieve_continuation_parameters(double* %0) {
%2 = alloca double*
%3 = alloca i32*
%4 = alloca i32*
%5 = alloca i32
store double* %0, double** %2
%6 = load i32*, i32** %3
%7 = load i32*, i32** %4
%8 = load double*, double** %2
%9 = call i32 @_ada_use_c2phc(i32 72, i32* %6, i32* %7, double* %8, i32 0)
store i32 %9, i32* %5
%10 = load i32, i32* %5
ret i32 %10
}

LLVM IR (-O2):
define i32 @retrieve_continuation_parameters(double* %0) {
%2 = tail call i32 @_ada_use_c2phc(i32 72, i32* undef, i32* undef, double* %0, i32 0)
ret i32 %2
}
/* Variables and functions */
char *malloc(int);
int /*<<< orphan*/ memcpy(char *, char const *, int);
int strlen(char const *);
char *_qs_strdup(const char *str) {
  if (str == NULL)
    return NULL;
  int len = strlen(str) + 1;
  char *buf = malloc(len);
  memcpy(buf, str, len);
  return buf;
}


x86 assembly (clang, -O0):
<_qs_strdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1154 <_qs_strdup+0x24>
movq   $0x0,-0x8(%rbp)
jmp    1187 <_qs_strdup+0x57>
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
call   1050 <malloc@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1040 <memcpy@plt>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_qs_strdup>:
push   %rbp
push   %r14
push   %rbx
test   %rdi,%rdi
je     115d <_qs_strdup+0x2d>
mov    %rdi,%rbx
call   1030 <strlen@plt>
lea    0x1(%rax),%ebp
mov    %ebp,%edi
call   1050 <malloc@plt>
mov    %rax,%r14
mov    %rax,%rdi
mov    %rbx,%rsi
mov    %ebp,%edx
call   1040 <memcpy@plt>
jmp    1160 <_qs_strdup+0x30>
xor    %r14d,%r14d
mov    %r14,%rax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define i8* @_qs_strdup(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %8, label %3
3: ; preds = %1
%4 = tail call i32 @strlen(i8* %0)
%5 = add nsw i32 %4, 1
%6 = tail call i8* @malloc(i32 %5)
%7 = tail call i32 @memcpy(i8* %6, i8* %0, i32 %5)
br label %8
8: ; preds = %1, %3
%9 = phi i8* [ %6, %3 ], [ null, %1 ]
ret i8* %9
}
double rangelimit(double x, double min, double max) {
  if (x < min)
    x = min;
  if (x > max)
    x = max;
  return x;
}


x86 assembly (clang, -O0):
<rangelimit>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    1131 <rangelimit+0x31>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
ucomisd -0x18(%rbp),%xmm0
jbe    114b <rangelimit+0x4b>
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<rangelimit>:
maxsd  %xmm0,%xmm1
minsd  %xmm1,%xmm2
movapd %xmm2,%xmm0
ret

LLVM IR (-O0):
define double @rangelimit(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* %5
%9 = fcmp olt double %7, %8
br i1 %9, label %10, label %12
10: ; preds = %3
%11 = load double, double* %5
store double %11, double* %4
br label %12
12: ; preds = %10, %3
%13 = load double, double* %4
%14 = load double, double* %6
%15 = fcmp ogt double %13, %14
br i1 %15, label %16, label %18
16: ; preds = %12
%17 = load double, double* %6
store double %17, double* %4
br label %18
18: ; preds = %16, %12
%19 = load double, double* %4
ret double %19
}

LLVM IR (-O2):
define double @rangelimit(double %0, double %1, double %2) {
%4 = fcmp olt double %0, %1
%5 = select i1 %4, double %1, double %0
%6 = fcmp ogt double %5, %2
%7 = select i1 %6, double %2, double %5
ret double %7
}
/* Variables and functions */
int /*<<< orphan*/ O_RDONLY;
size_t auto_read_fd(int, char **, size_t *);
int /*<<< orphan*/ close(int);
int open(char const *, int /*<<< orphan*/);
size_t auto_read_file(const char *path, char **buf, size_t *len) {
  int fd = open(path, O_RDONLY);
  size_t red = auto_read_fd(fd, buf, len);
  close(fd);
  return red;
}


x86 assembly (clang, -O0):
<auto_read_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2e99(%rip),%rax
mov    (%rax),%esi
call   1050 <open@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1040 <auto_read_fd@plt>
mov    %rax,-0x28(%rbp)
mov    -0x1c(%rbp),%edi
call   1030 <close@plt>
mov    -0x28(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<auto_read_file>:
push   %rbp
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %rsi,%rbx
mov    0x2ea7(%rip),%rax
mov    (%rax),%esi
call   1050 <open@plt>
mov    %eax,%ebp
mov    %eax,%edi
mov    %rbx,%rsi
mov    %r14,%rdx
call   1040 <auto_read_fd@plt>
mov    %rax,%rbx
mov    %ebp,%edi
call   1030 <close@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@O_RDONLY = global i32 0
define i64 @auto_read_file(i8* %0, i8** %1, i64* %2) {
%4 = alloca i8*
%5 = alloca i8**
%6 = alloca i64*
%7 = alloca i32
%8 = alloca i64
store i8* %0, i8** %4
store i8** %1, i8*** %5
store i64* %2, i64** %6
%9 = load i8*, i8** %4
%10 = load i32, i32* @O_RDONLY
%11 = call i32 @open(i8* %9, i32 %10)
store i32 %11, i32* %7
%12 = load i32, i32* %7
%13 = load i8**, i8*** %5
%14 = load i64*, i64** %6
%15 = call i64 @auto_read_fd(i32 %12, i8** %13, i64* %14)
store i64 %15, i64* %8
%16 = load i32, i32* %7
%17 = call i32 @close(i32 %16)
%18 = load i64, i64* %8
ret i64 %18
}

LLVM IR (-O2):
@O_RDONLY = global i32 0
define i64 @auto_read_file(i8* nocapture %0, i8** %1, i64* %2) {
%4 = load i32, i32* @O_RDONLY
%5 = tail call i32 @open(i8* %0, i32 %4)
%6 = tail call i64 @auto_read_fd(i32 %5, i8** %1, i64* %2)
%7 = tail call i32 @close(i32 %5)
ret i64 %6
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ iscntrl(int);
void t_iscntrl_0x70() {
  Assert_real((iscntrl(112) == 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_iscntrl.c",
              565, ("iscntrl should be 0 for p"));
}


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

x86 assembly (clang, -O2):
<t_iscntrl_0x70>:
push   %rax
mov    $0x70,%edi
call   1030 <iscntrl@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x235,%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_iscntrl.c\00"
@.str.1 = [26 x i8] c"iscntrl should be 0 for p\00"
define void @t_iscntrl_0x70() {
%1 = call i64 @iscntrl(i32 112)
%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 565, 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_iscntrl.c\00"
@.str.1 = [26 x i8] c"iscntrl should be 0 for p\00"
define void @t_iscntrl_0x70() {
%1 = tail call i64 @iscntrl(i32 112)
%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 565, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}