xunge/DecIR huggingface dataset:
int foo(int x) {
  const int a = sizeof(int) * 8;
  const int b = -7;
  int c = 0;
  c += x << a;
  c += x << b;
  c += x >> a;
  c += x >> b;
  return c;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x20,-0x8(%rbp)
movl   $0xfffffff9,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x20,%ecx
shl    %cl,%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xfffffff9,%ecx
shl    %cl,%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x20,%ecx
sar    %cl,%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xfffffff9,%ecx
sar    %cl,%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @foo(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %2
store i32 32, i32* %3
store i32 -7, i32* %4
store i32 0, i32* %5
%6 = load i32, i32* %2
%7 = shl i32 %6, 32
%8 = load i32, i32* %5
%9 = add nsw i32 %8, %7
store i32 %9, i32* %5
%10 = load i32, i32* %2
%11 = shl i32 %10, -7
%12 = load i32, i32* %5
%13 = add nsw i32 %12, %11
store i32 %13, i32* %5
%14 = load i32, i32* %2
%15 = ashr i32 %14, 32
%16 = load i32, i32* %5
%17 = add nsw i32 %16, %15
store i32 %17, i32* %5
%18 = load i32, i32* %2
%19 = ashr i32 %18, -7
%20 = load i32, i32* %5
%21 = add nsw i32 %20, %19
store i32 %21, i32* %5
%22 = load i32, i32* %5
ret i32 %22
}

LLVM IR (-O2):
define i32 @foo(i32 %0) {
ret i32 poison
}
char getRank(int rank) {
  switch (rank) {
  case 0:
    return ('A');
  case 1:
    return ('2');
  case 2:
    return ('3');
  case 3:
    return ('4');
  case 4:
    return ('5');
  case 5:
    return ('6');
  case 6:
    return ('7');
  case 7:
    return ('8');
  case 8:
    return ('9');
  case 9:
    return ('T');
  case 10:
    return ('J');
  case 11:
    return ('Q');
  case 12:
    return ('K');
  }
}


x86 assembly (clang, -O0):
<getRank>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %rax,-0x10(%rbp)
sub    $0xc,%rax
ja     119c <getRank+0x9c>
mov    -0x10(%rbp),%rax
lea    0xedd(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movb   $0x41,-0x1(%rbp)
jmp    119c <getRank+0x9c>
movb   $0x32,-0x1(%rbp)
jmp    119c <getRank+0x9c>
movb   $0x33,-0x1(%rbp)
jmp    119c <getRank+0x9c>
movb   $0x34,-0x1(%rbp)
jmp    119c <getRank+0x9c>
movb   $0x35,-0x1(%rbp)
jmp    119c <getRank+0x9c>
movb   $0x36,-0x1(%rbp)
jmp    119c <getRank+0x9c>
movb   $0x37,-0x1(%rbp)
jmp    119c <getRank+0x9c>
movb   $0x38,-0x1(%rbp)
jmp    119c <getRank+0x9c>
movb   $0x39,-0x1(%rbp)
jmp    119c <getRank+0x9c>
movb   $0x54,-0x1(%rbp)
jmp    119c <getRank+0x9c>
movb   $0x4a,-0x1(%rbp)
jmp    119c <getRank+0x9c>
movb   $0x51,-0x1(%rbp)
jmp    119c <getRank+0x9c>
movb   $0x4b,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getRank>:
add    $0xffffffff,%edi
mov    $0x41,%al
cmp    $0xb,%edi
ja     1117 <getRank+0x17>
movslq %edi,%rax
lea    0xeec(%rip),%rcx
mov    (%rax,%rcx,1),%al
ret

LLVM IR (-O0):
define signext i8 @getRank(i32 %0) {
%2 = alloca i8
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %18 [
i32 0, label %5
i32 1, label %6
i32 2, label %7
i32 3, label %8
i32 4, label %9
i32 5, label %10
i32 6, label %11
i32 7, label %12
i32 8, label %13
i32 9, label %14
i32 10, label %15
i32 11, label %16
i32 12, label %17
]
5: ; preds = %1
store i8 65, i8* %2
br label %18
6: ; preds = %1
store i8 50, i8* %2
br label %18
7: ; preds = %1
store i8 51, i8* %2
br label %18
8: ; preds = %1
store i8 52, i8* %2
br label %18
9: ; preds = %1
store i8 53, i8* %2
br label %18
10: ; preds = %1
store i8 54, i8* %2
br label %18
11: ; preds = %1
store i8 55, i8* %2
br label %18
12: ; preds = %1
store i8 56, i8* %2
br label %18
13: ; preds = %1
store i8 57, i8* %2
br label %18
14: ; preds = %1
store i8 84, i8* %2
br label %18
15: ; preds = %1
store i8 74, i8* %2
br label %18
16: ; preds = %1
store i8 81, i8* %2
br label %18
17: ; preds = %1
store i8 75, i8* %2
br label %18
18: ; preds = %5, %6, %7, %8, %9, %10, %11, %12, %13, %14, %15, %16, %17, %1
%19 = load i8, i8* %2
ret i8 %19
}

LLVM IR (-O2):
@switch.table.getRank = [12 x i8] c"23456789TJQK"
define signext i8 @getRank(i32 %0) {
%2 = add i32 %0, -1
%3 = icmp ult i32 %2, 12
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = sext i32 %2 to i64
%6 = getelementptr inbounds [12 x i8], [12 x i8]* @switch.table.getRank, i64 0, i64 %5
%7 = load i8, i8* %6
br label %8
8: ; preds = %4, %1
%9 = phi i8 [ 65, %1 ], [ %7, %4 ]
ret i8 %9
}
/* Variables and functions */
int le_read16(unsigned char const *);
int decode_sbp_usec(const unsigned char *buffer) {
  int msec = le_read16(buffer);
  return (msec % 1000) * 1000;
}


x86 assembly (clang, -O0):
<decode_sbp_usec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <le_read16@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x3e8,%ecx
cltd
idiv   %ecx
imul   $0x3e8,%edx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<decode_sbp_usec>:
push   %rax
call   1030 <le_read16@plt>
cltq
imul   $0x10624dd3,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x26,%rcx
add    %edx,%ecx
imul   $0x3e8,%ecx,%ecx
sub    %ecx,%eax
imul   $0x3e8,%eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @decode_sbp_usec(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @le_read16(i8* %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = srem i32 %6, 1000
%8 = mul nsw i32 %7, 1000
ret i32 %8
}

LLVM IR (-O2):
define i32 @decode_sbp_usec(i8* %0) {
%2 = tail call i32 @le_read16(i8* %0)
%3 = srem i32 %2, 1000
%4 = mul nsw i32 %3, 1000
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ sprintf(char *, char *, char *);
void closeWithError_1(char *error) {
  char errMsj[50];
  sprintf(errMsj,
          "\x1B[31m"
          "%s"
          "\033[0m",
          error);
  perror(errMsj);
  exit(1);
}


x86 assembly (clang, -O0):
<closeWithError_1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x40(%rbp),%rdi
mov    -0x8(%rbp),%rdx
lea    0xeb5(%rip),%rsi
call   1040 <sprintf@plt>
lea    -0x40(%rbp),%rdi
call   1030 <perror@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<closeWithError_1>:
push   %rbx
sub    $0x40,%rsp
mov    %rdi,%rdx
lea    0xec1(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1040 <sprintf@plt>
mov    %rbx,%rdi
call   1030 <perror@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"\1B[31m%s\1B[0m\00"
define void @closeWithError_1(i8* %0) {
%2 = alloca i8*
%3 = alloca [50 x i8]
store i8* %0, i8** %2
%4 = getelementptr inbounds [50 x i8], [50 x i8]* %3, i64 0, i64 0
%5 = load i8*, i8** %2
%6 = call i32 @sprintf(i8* %4, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %5)
%7 = getelementptr inbounds [50 x i8], [50 x i8]* %3, i64 0, i64 0
%8 = call i32 @perror(i8* %7)
%9 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [12 x i8] c"\1B[31m%s\1B[0m\00"
define void @closeWithError_1(i8* %0) {
%2 = alloca [50 x i8]
%3 = getelementptr inbounds [50 x i8], [50 x i8]* %2, i64 0, i64 0
%4 = call i32 @sprintf(i8* %3, i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %0)
%5 = call i32 @perror(i8* %3)
%6 = tail call i32 @exit(i32 1)
unreachable
}
/* Type definitions */
typedef int uint16_t;

/* Variables and functions */
int virtq_need_event(uint16_t event_idx, uint16_t new_idx, uint16_t old_idx) {
  return (uint16_t)(new_idx - event_idx - 1) < (uint16_t)(new_idx - old_idx);
}


x86 assembly (clang, -O0):
<virtq_need_event>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x8(%rbp),%eax
sub    -0x4(%rbp),%eax
sub    $0x1,%eax
mov    -0x8(%rbp),%ecx
sub    -0xc(%rbp),%ecx
cmp    %ecx,%eax
setl   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<virtq_need_event>:
not    %edi
add    %esi,%edi
sub    %edx,%esi
xor    %eax,%eax
cmp    %esi,%edi
setl   %al
ret

LLVM IR (-O0):
define i32 @virtq_need_event(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %5
%8 = load i32, i32* %4
%9 = sub nsw i32 %7, %8
%10 = sub nsw i32 %9, 1
%11 = load i32, i32* %5
%12 = load i32, i32* %6
%13 = sub nsw i32 %11, %12
%14 = icmp slt i32 %10, %13
%15 = zext i1 %14 to i32
ret i32 %15
}

LLVM IR (-O2):
define i32 @virtq_need_event(i32 %0, i32 %1, i32 %2) {
%4 = xor i32 %0, -1
%5 = add i32 %4, %1
%6 = sub nsw i32 %1, %2
%7 = icmp slt i32 %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ function_with_memory_allocation();
int /*<<< orphan*/ usleep(int);
int main(void) {
  int i;
  for (i = 0; i < 1000; ++i) {
    function_with_memory_allocation();
    usleep(10000);
  }
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x3e8,-0x8(%rbp)
jge    1162 <main+0x42>
mov    $0x0,%al
call   1030 <function_with_memory_allocation@plt>
mov    $0x2710,%edi
call   1040 <usleep@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1136 <main+0x16>
mov    0x2e77(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x3e8,%ebx
cs nopw 0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <function_with_memory_allocation@plt>
mov    $0x2710,%edi
call   1040 <usleep@plt>
add    $0xffffffff,%ebx
jne    1130 <main+0x10>
mov    0x2e93(%rip),%rax
mov    (%rax),%eax
pop    %rbx
ret

LLVM IR (-O0):
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
br label %3
3: ; preds = %9, %0
%4 = load i32, i32* %2
%5 = icmp slt i32 %4, 1000
br i1 %5, label %6, label %12
6: ; preds = %3
%7 = call i32 (...) @function_with_memory_allocation()
%8 = call i32 @usleep(i32 10000)
br label %9
9: ; preds = %6
%10 = load i32, i32* %2
%11 = add nsw i32 %10, 1
store i32 %11, i32* %2
br label %3
12: ; preds = %3
%13 = load i32, i32* @EXIT_SUCCESS
ret i32 %13
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 0, %0 ], [ %5, %1 ]
%3 = tail call i32 (...) @function_with_memory_allocation()
%4 = tail call i32 @usleep(i32 10000)
%5 = add nuw nsw i32 %2, 1
%6 = icmp eq i32 %5, 1000
br i1 %6, label %7, label %1
7: ; preds = %1
%8 = load i32, i32* @EXIT_SUCCESS
ret i32 %8
}
/* Variables and functions */
int EXIT_FAILURE;
int EXIT_SUCCESS;
int /*<<< orphan*/ print_name(char *);
int /*<<< orphan*/ printf(char *, char *);
int main(int argc, char **argv) {
  if (argc != 2) {
    printf("usage:\n%s string\n", argv[0]);
    return EXIT_FAILURE;
  }
  print_name(argv[1]);
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x8(%rbp)
je     1164 <main+0x44>
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
lea    0xeb2(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e86(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    117d <main+0x5d>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1040 <print_name@plt>
mov    0x2e60(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
cmp    $0x2,%edi
jne    1138 <main+0x18>
mov    0x8(%rsi),%rdi
call   1040 <print_name@plt>
mov    0x2ea2(%rip),%rax
jmp    114e <main+0x2e>
mov    (%rsi),%rsi
lea    0xebe(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e92(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [18 x i8] c"usage:\0A%s string\0A\00"
@EXIT_FAILURE = global i32 0
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* %4
%7 = icmp ne i32 %6, 2
br i1 %7, label %8, label %14
8: ; preds = %2
%9 = load i8**, i8*** %5
%10 = getelementptr inbounds i8*, i8** %9, i64 0
%11 = load i8*, i8** %10
%12 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %11)
%13 = load i32, i32* @EXIT_FAILURE
store i32 %13, i32* %3
br label %20
14: ; preds = %2
%15 = load i8**, i8*** %5
%16 = getelementptr inbounds i8*, i8** %15, i64 1
%17 = load i8*, i8** %16
%18 = call i32 @print_name(i8* %17)
%19 = load i32, i32* @EXIT_SUCCESS
store i32 %19, i32* %3
br label %20
20: ; preds = %14, %8
%21 = load i32, i32* %3
ret i32 %21
}

LLVM IR (-O2):
@.str = [18 x i8] c"usage:\0A%s string\0A\00"
@EXIT_FAILURE = global i32 0
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 2
br i1 %3, label %7, label %4
4: ; preds = %2
%5 = load i8*, i8** %1
%6 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %5)
br label %11
7: ; preds = %2
%8 = getelementptr inbounds i8*, i8** %1, i64 1
%9 = load i8*, i8** %8
%10 = tail call i32 @print_name(i8* %9)
br label %11
11: ; preds = %7, %4
%12 = phi i32* [ @EXIT_FAILURE, %4 ], [ @EXIT_SUCCESS, %7 ]
%13 = load i32, i32* %12
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ FCEUD_PrintError(char *);
int /*<<< orphan*/ sprintf(char *, char *, char *);
void ShowDDErr(char *s) {
  char tempo[512];
  sprintf(tempo, "DirectDraw: %s", s);
  FCEUD_PrintError(tempo);
}


x86 assembly (clang, -O0):
<ShowDDErr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x210,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x210(%rbp),%rdi
mov    -0x8(%rbp),%rdx
lea    0xebf(%rip),%rsi
call   1040 <sprintf@plt>
lea    -0x210(%rbp),%rdi
call   1030 <FCEUD_PrintError@plt>
add    $0x210,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ShowDDErr>:
push   %rbx
sub    $0x200,%rsp
mov    %rdi,%rdx
lea    0xece(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1040 <sprintf@plt>
mov    %rbx,%rdi
call   1030 <FCEUD_PrintError@plt>
add    $0x200,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [15 x i8] c"DirectDraw: %s\00"
define void @ShowDDErr(i8* %0) {
%2 = alloca i8*
%3 = alloca [512 x i8]
store i8* %0, i8** %2
%4 = getelementptr inbounds [512 x i8], [512 x i8]* %3, i64 0, i64 0
%5 = load i8*, i8** %2
%6 = call i32 @sprintf(i8* %4, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %5)
%7 = getelementptr inbounds [512 x i8], [512 x i8]* %3, i64 0, i64 0
%8 = call i32 @FCEUD_PrintError(i8* %7)
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"DirectDraw: %s\00"
define void @ShowDDErr(i8* %0) {
%2 = alloca [512 x i8]
%3 = getelementptr inbounds [512 x i8], [512 x i8]* %2, i64 0, i64 0
%4 = call i32 @sprintf(i8* %3, i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %0)
%5 = call i32 @FCEUD_PrintError(i8* %3)
ret void
}
/* Variables and functions */
scalar_t__ get_bit(int, int);
int test_get_bit() { return get_bit(0b10101, 0) && !get_bit(0b010101, 1); }


x86 assembly (clang, -O0):
<test_get_bit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x15,%edi
xor    %esi,%esi
call   1030 <get_bit@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x1(%rbp)
je     1151 <test_get_bit+0x41>
mov    $0x15,%edi
mov    $0x1,%esi
call   1030 <get_bit@plt>
cmp    $0x0,%rax
setne  %al
xor    $0xff,%al
mov    %al,-0x1(%rbp)
mov    -0x1(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_get_bit>:
push   %rbx
xor    %ebx,%ebx
mov    $0x15,%edi
xor    %esi,%esi
call   1030 <get_bit@plt>
test   %rax,%rax
je     113b <test_get_bit+0x2b>
mov    $0x15,%edi
mov    $0x1,%esi
call   1030 <get_bit@plt>
xor    %ebx,%ebx
test   %rax,%rax
sete   %bl
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @test_get_bit() {
%1 = call i64 @get_bit(i32 21, i32 0)
%2 = icmp ne i64 %1, 0
br i1 %2, label %3, label %7
3: ; preds = %0
%4 = call i64 @get_bit(i32 21, i32 1)
%5 = icmp ne i64 %4, 0
%6 = xor i1 %5, true
br label %7
7: ; preds = %3, %0
%8 = phi i1 [ false, %0 ], [ %6, %3 ]
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @test_get_bit() {
%1 = tail call i64 @get_bit(i32 21, i32 0)
%2 = icmp eq i64 %1, 0
br i1 %2, label %7, label %3
3: ; preds = %0
%4 = tail call i64 @get_bit(i32 21, i32 1)
%5 = icmp eq i64 %4, 0
%6 = zext i1 %5 to i32
br label %7
7: ; preds = %3, %0
%8 = phi i32 [ 0, %0 ], [ %6, %3 ]
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ SetPixel151(unsigned long, unsigned long);
void setpixel(unsigned long x, unsigned long y) { SetPixel151(x, y); }


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

x86 assembly (clang, -O2):
<setpixel>:
jmp    1030 <SetPixel151@plt>

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

LLVM IR (-O2):
define void @setpixel(i64 %0, i64 %1) {
%3 = tail call i32 @SetPixel151(i64 %0, i64 %1)
ret void
}
/* Type definitions */
typedef int uint8_t;
typedef int int32_t;

/* Variables and functions */
int32_t bufToInt32(uint8_t *buf) {
  return (buf[0] << 24) | (buf[1] << 16) | (buf[2] << 8) | (buf[3] << 0);
}


x86 assembly (clang, -O0):
<bufToInt32>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
shl    $0x18,%eax
mov    -0x8(%rbp),%rcx
mov    0x4(%rcx),%ecx
shl    $0x10,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
mov    0x8(%rcx),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
mov    0xc(%rcx),%ecx
shl    $0x0,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bufToInt32>:
mov    (%rdi),%eax
mov    0x4(%rdi),%ecx
shl    $0x18,%eax
shl    $0x10,%ecx
or     %eax,%ecx
mov    0x8(%rdi),%eax
shl    $0x8,%eax
or     %ecx,%eax
or     0xc(%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @bufToInt32(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = shl i32 %2, 24
%4 = getelementptr inbounds i32, i32* %0, i64 1
%5 = load i32, i32* %4
%6 = shl i32 %5, 16
%7 = or i32 %6, %3
%8 = getelementptr inbounds i32, i32* %0, i64 2
%9 = load i32, i32* %8
%10 = shl i32 %9, 8
%11 = or i32 %7, %10
%12 = getelementptr inbounds i32, i32* %0, i64 3
%13 = load i32, i32* %12
%14 = or i32 %11, %13
ret i32 %14
}
/* Type definitions */
struct bitmask {
  int dummy;
};

/* Variables and functions */
struct bitmask *numa_bitmask_alloc(int);
int numa_max_possible_node_v1_int();
struct bitmask *allocate_nodemask_v1(void) {
  int nnodes = numa_max_possible_node_v1_int() + 1;
  return numa_bitmask_alloc(nnodes);
}


x86 assembly (clang, -O0):
<allocate_nodemask_v1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <numa_max_possible_node_v1_int@plt>
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <numa_bitmask_alloc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<allocate_nodemask_v1>:
push   %rax
xor    %eax,%eax
call   1040 <numa_max_possible_node_v1_int@plt>
lea    0x1(%rax),%edi
pop    %rax
jmp    1030 <numa_bitmask_alloc@plt>

LLVM IR (-O0):
%struct.bitmask = type { i32 }
define %struct.bitmask* @allocate_nodemask_v1() {
%1 = alloca i32
%2 = call i32 (...) @numa_max_possible_node_v1_int()
%3 = add nsw i32 %2, 1
store i32 %3, i32* %1
%4 = load i32, i32* %1
%5 = call %struct.bitmask* @numa_bitmask_alloc(i32 %4)
ret %struct.bitmask* %5
}

LLVM IR (-O2):
%struct.bitmask = type { i32 }
define %struct.bitmask* @allocate_nodemask_v1() {
%1 = tail call i32 (...) @numa_max_possible_node_v1_int()
%2 = add nsw i32 %1, 1
%3 = tail call %struct.bitmask* @numa_bitmask_alloc(i32 %2)
ret %struct.bitmask* %3
}
/* Type definitions */
typedef int uint16_t;

/* Variables and functions */
uint16_t betole(uint16_t value) {
  return ((value & 0xff00u) >> 8) | ((value & 0xffu) << 8);
}


x86 assembly (clang, -O0):
<betole>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xff00,%eax
shr    $0x8,%eax
mov    -0x4(%rbp),%ecx
and    $0xff,%ecx
shl    $0x8,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<betole>:
rol    $0x8,%di
movzwl %di,%eax
ret

LLVM IR (-O0):
define i32 @betole(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 65280
%5 = lshr i32 %4, 8
%6 = load i32, i32* %2
%7 = and i32 %6, 255
%8 = shl i32 %7, 8
%9 = or i32 %5, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @betole(i32 %0) {
%2 = trunc i32 %0 to i16
%3 = tail call i16 @llvm.bswap.i16(i16 %2)
%4 = zext i16 %3 to i32
ret i32 %4
}
void vboxCConv() {}


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

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

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

LLVM IR (-O2):
define void @vboxCConv() {
ret void
}
double CBRT(x)
double x;
{
  double pow();
  if (x == 0)
    return (0);
  else if (x > 0)
    return (pow(x, (double)1.0 / 3.0));
  else
    return (-pow(-x, (double)1.0 / 3.0));
}


x86 assembly (clang, -O0):
<CBRT>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    1142 <CBRT+0x32>
jp     1142 <CBRT+0x32>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    11b5 <CBRT+0xa5>
movsd  -0x10(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    1170 <CBRT+0x60>
movsd  -0x10(%rbp),%xmm0
movsd  0xe9f(%rip),%xmm1
call   1030 <pow@plt>
movsd  %xmm0,-0x8(%rbp)
jmp    11b5 <CBRT+0xa5>
movsd  -0x10(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  0xe6c(%rip),%xmm1
call   1030 <pow@plt>
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CBRT>:
push   %rax
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    111d <CBRT+0xd>
jnp    1156 <CBRT+0x46>
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    1135 <CBRT+0x25>
movsd  0xee1(%rip),%xmm1
pop    %rax
jmp    1030 <pow@plt>
xorpd  0xec3(%rip),%xmm0
movsd  0xecb(%rip),%xmm1
call   1030 <pow@plt>
movapd %xmm0,%xmm1
xorpd  0xeaa(%rip),%xmm1
movapd %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @CBRT(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %3
%4 = load double, double* %3
%5 = fcmp oeq double %4, 0.000000e+00
br i1 %5, label %6, label %7
6: ; preds = %1
store double 0.000000e+00, double* %2
br label %18
7: ; preds = %1
%8 = load double, double* %3
%9 = fcmp ogt double %8, 0.000000e+00
br i1 %9, label %10, label %13
10: ; preds = %7
%11 = load double, double* %3
%12 = call double @pow(double %11, double 0x3FD5555555555555)
store double %12, double* %2
br label %18
13: ; preds = %7
%14 = load double, double* %3
%15 = fneg double %14
%16 = call double @pow(double %15, double 0x3FD5555555555555)
%17 = fneg double %16
store double %17, double* %2
br label %18
18: ; preds = %13, %10, %6
%19 = load double, double* %2
ret double %19
}

LLVM IR (-O2):
define double @CBRT(double %0) {
%2 = fcmp oeq double %0, 0.000000e+00
br i1 %2, label %11, label %3
3: ; preds = %1
%4 = fcmp ogt double %0, 0.000000e+00
br i1 %4, label %5, label %7
5: ; preds = %3
%6 = tail call double @pow(double %0, double 0x3FD5555555555555)
br label %11
7: ; preds = %3
%8 = fneg double %0
%9 = tail call double @pow(double %8, double 0x3FD5555555555555)
%10 = fneg double %9
br label %11
11: ; preds = %1, %7, %5
%12 = phi double [ %6, %5 ], [ %10, %7 ], [ 0.000000e+00, %1 ]
ret double %12
}
/* Variables and functions */
int /*<<< orphan*/ is_pali(int *);
int /*<<< orphan*/ letter_count(char *, int *);
int /*<<< orphan*/ scanf(char *, char *);
int main() {
  char arr[100001];
  int letter_frequency[26] = {0};
  scanf("%s", arr);
  letter_count(arr, letter_frequency);
  is_pali(letter_frequency);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x18720,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x18720(%rbp),%rdi
xor    %esi,%esi
mov    $0x68,%edx
call   1040 <memset@plt>
lea    -0x186b0(%rbp),%rsi
lea    0xe8d(%rip),%rdi
call   1050 <scanf@plt>
lea    -0x186b0(%rbp),%rdi
lea    -0x18720(%rbp),%rsi
call   1030 <letter_count@plt>
lea    -0x18720(%rbp),%rdi
call   1060 <is_pali@plt>
xor    %eax,%eax
add    $0x18720,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x18718,%rsp
xorps  %xmm0,%xmm0
movaps %xmm0,0x50(%rsp)
movaps %xmm0,0x40(%rsp)
movaps %xmm0,0x30(%rsp)
movaps %xmm0,0x20(%rsp)
movaps %xmm0,0x10(%rsp)
movaps %xmm0,(%rsp)
movq   $0x0,0x60(%rsp)
lea    0xe96(%rip),%rdi
lea    0x70(%rsp),%r14
mov    %r14,%rsi
call   1040 <scanf@plt>
mov    %rsp,%rbx
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <letter_count@plt>
mov    %rbx,%rdi
call   1050 <is_pali@plt>
xor    %eax,%eax
add    $0x18718,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [100001 x i8]
%3 = alloca [26 x i32]
store i32 0, i32* %1
%4 = bitcast [26 x i32]* %3 to i8*
%5 = getelementptr inbounds [100001 x i8], [100001 x i8]* %2, i64 0, i64 0
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %5)
%7 = getelementptr inbounds [100001 x i8], [100001 x i8]* %2, i64 0, i64 0
%8 = getelementptr inbounds [26 x i32], [26 x i32]* %3, i64 0, i64 0
%9 = call i32 @letter_count(i8* %7, i32* %8)
%10 = getelementptr inbounds [26 x i32], [26 x i32]* %3, i64 0, i64 0
%11 = call i32 @is_pali(i32* %10)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define i32 @main() {
%1 = alloca [100001 x i8]
%2 = alloca [26 x i32]
%3 = getelementptr inbounds [100001 x i8], [100001 x i8]* %1, i64 0, i64 0
%4 = bitcast [26 x i32]* %2 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %3)
%6 = getelementptr inbounds [26 x i32], [26 x i32]* %2, i64 0, i64 0
%7 = call i32 @letter_count(i8* %3, i32* %6)
%8 = call i32 @is_pali(i32* %6)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ sqlite3_file;

/* Variables and functions */
int SQLITE_OK;
int memSync(sqlite3_file *pFile, int flags) { return SQLITE_OK; }


x86 assembly (clang, -O0):
<memSync>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    0x2ed6(%rip),%rax
mov    (%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<memSync>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%eax
ret

LLVM IR (-O0):
@SQLITE_OK = global i32 0
define i32 @memSync(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32, i32* @SQLITE_OK
ret i32 %5
}

LLVM IR (-O2):
@SQLITE_OK = global i32 0
define i32 @memSync(i32* nocapture readnone %0, i32 %1) {
%3 = load i32, i32* @SQLITE_OK
ret i32 %3
}
/* Variables and functions */
int random();
unsigned short xt_core_toss_coin() { return random() % 2; }


x86 assembly (clang, -O0):
<xt_core_toss_coin>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <random@plt>
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %dx,%ax
movzwl %ax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xt_core_toss_coin>:
push   %rax
xor    %eax,%eax
call   1030 <random@plt>
mov    %eax,%ecx
shr    $0x1f,%ecx
add    %eax,%ecx
and    $0xfffe,%ecx
sub    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define zeroext i16 @xt_core_toss_coin() {
%1 = call i32 (...) @random()
%2 = srem i32 %1, 2
%3 = trunc i32 %2 to i16
ret i16 %3
}

LLVM IR (-O2):
define zeroext i16 @xt_core_toss_coin() {
%1 = tail call i32 (...) @random()
%2 = srem i32 %1, 2
%3 = trunc i32 %2 to i16
ret i16 %3
}
/* Variables and functions */
int /*<<< orphan*/ WNOHANG;
int /*<<< orphan*/ printf(char *);
scalar_t__ waitpid(int, int /*<<< orphan*/ *, int /*<<< orphan*/);
void sigchld_handler(int s) {
  (void)s;
  while (waitpid(-1, NULL, WNOHANG) > 0)
    ;
  printf("Connection closed.\n");
}


x86 assembly (clang, -O0):
<sigchld_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2eb6(%rip),%rax
mov    (%rax),%edx
mov    $0xffffffff,%edi
xor    %eax,%eax
mov    %eax,%esi
call   1040 <waitpid@plt>
cmp    $0x0,%rax
jle    1151 <sigchld_handler+0x31>
jmp    112b <sigchld_handler+0xb>
lea    0xea8(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sigchld_handler>:
push   %rbx
mov    0x2ec0(%rip),%rbx
nopl   0x0(%rax,%rax,1)
mov    (%rbx),%edx
mov    $0xffffffff,%edi
xor    %esi,%esi
call   1040 <waitpid@plt>
test   %rax,%rax
jg     1130 <sigchld_handler+0x10>
lea    0xeb6(%rip),%rdi
pop    %rbx
jmp    1030 <puts@plt>

LLVM IR (-O0):
@WNOHANG = global i32 0
@.str = [20 x i8] c"Connection closed.\0A\00"
define void @sigchld_handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
br label %4
4: ; preds = %8, %1
%5 = load i32, i32* @WNOHANG
%6 = call i64 @waitpid(i32 -1, i32* null, i32 %5)
%7 = icmp sgt i64 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %4
br label %4
9: ; preds = %4
%10 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@WNOHANG = global i32 0
@str = [19 x i8] c"Connection closed.\00"
define void @sigchld_handler(i32 %0) {
br label %2
2: ; preds = %2, %1
%3 = load i32, i32* @WNOHANG
%4 = tail call i64 @waitpid(i32 -1, i32* null, i32 %3)
%5 = icmp sgt i64 %4, 0
br i1 %5, label %2, label %6
6: ; preds = %2
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str, i64 0, i64 0))
ret void
}
void __libc_csu_fini() {}


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

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

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

LLVM IR (-O2):
define void @__libc_csu_fini() {
ret void
}
int test_imm_50uint16_mem(unsigned short *val) {
  return ((*val) & (-0x50 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_50uint16_mem>:
movzwl (%rdi),%eax
test   $0xffb0,%eax
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_50uint16_mem(i16* %0) {
%2 = alloca i16*
store i16* %0, i16** %2
%3 = load i16*, i16** %2
%4 = load i16, i16* %3
%5 = zext i16 %4 to i32
%6 = and i32 %5, -80
%7 = icmp ne i32 %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_50uint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, -80
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Type definitions */
struct object {
  int dummy;
};

/* Variables and functions */
struct object *cons(struct object *, struct object *);
struct object *extend_env(struct object *var, struct object *val,
                          struct object *env) {
  return cons(cons(var, val), env);
}


x86 assembly (clang, -O0):
<extend_env>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <cons@plt>
mov    %rax,%rdi
mov    -0x18(%rbp),%rsi
call   1030 <cons@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<extend_env>:
push   %rbx
mov    %rdx,%rbx
call   1030 <cons@plt>
mov    %rax,%rdi
mov    %rbx,%rsi
pop    %rbx
jmp    1030 <cons@plt>

LLVM IR (-O0):
%struct.object = type { i32 }
define %struct.object* @extend_env(%struct.object* %0, %struct.object* %1, %struct.object* %2) {
%4 = alloca %struct.object*
%5 = alloca %struct.object*
%6 = alloca %struct.object*
store %struct.object* %0, %struct.object** %4
store %struct.object* %1, %struct.object** %5
store %struct.object* %2, %struct.object** %6
%7 = load %struct.object*, %struct.object** %4
%8 = load %struct.object*, %struct.object** %5
%9 = call %struct.object* @cons(%struct.object* %7, %struct.object* %8)
%10 = load %struct.object*, %struct.object** %6
%11 = call %struct.object* @cons(%struct.object* %9, %struct.object* %10)
ret %struct.object* %11
}

LLVM IR (-O2):
%struct.object = type { i32 }
define %struct.object* @extend_env(%struct.object* %0, %struct.object* %1, %struct.object* %2) {
%4 = tail call %struct.object* @cons(%struct.object* %0, %struct.object* %1)
%5 = tail call %struct.object* @cons(%struct.object* %4, %struct.object* %2)
ret %struct.object* %5
}
int system(const char *command) {
  anvil_syslog(0, "%s unimplemented\n", __FUNCTION__);
  while (1)
    ;
  return 0;
}


x86 assembly (clang, -O0):
<system>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
xor    %edi,%edi
lea    0xedb(%rip),%rsi
lea    0xee6(%rip),%rdx
mov    $0x0,%al
call   1030 <anvil_syslog@plt>
jmp    1133 <system+0x23>

x86 assembly (clang, -O2):
<system>:
push   %rax
lea    0xee8(%rip),%rsi
lea    0xef3(%rip),%rdx
xor    %edi,%edi
xor    %eax,%eax
call   1030 <anvil_syslog@plt>
nopl   0x0(%rax,%rax,1)
jmp    1130 <system+0x20>

LLVM IR (-O0):
@.str = [18 x i8] c"%s unimplemented\0A\00"
@__FUNCTION__.system = [7 x i8] c"system\00"
define i32 @system(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (i32, i8*, i8*, ...) bitcast (i32 (...)* @anvil_syslog to i32 (i32, i8*, i8*, ...)*)(i32 0, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @__FUNCTION__.system, i64 0, i64 0))
br label %4
4: ; preds = %1, %4
br label %4
}

LLVM IR (-O2):
@.str = [18 x i8] c"%s unimplemented\0A\00"
@__FUNCTION__.system = [7 x i8] c"system\00"
define i32 @system(i8* nocapture readnone %0) {
%2 = tail call i32 (i32, i8*, i8*, ...) bitcast (i32 (...)* @anvil_syslog to i32 (i32, i8*, i8*, ...)*)(i32 0, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @__FUNCTION__.system, i64 0, i64 0))
br label %3
3: ; preds = %1, %3
br label %3
}
int test_imm_E8int64_lowword_reg(long long val) {
  return ((val) & (0xE8 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_E8int64_lowword_reg(i64 %0) {
%2 = and i64 %0, 232
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
unsigned and (unsigned a, unsigned b) {
  if (a && b)
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<and>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     112a <and+0x2a>
cmpl   $0x0,-0xc(%rbp)
je     112a <and+0x2a>
movl   $0x1,-0x4(%rbp)
jmp    1131 <and+0x31>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<and>:
test   %edi,%edi
setne  %al
test   %esi,%esi
setne  %cl
and    %al,%cl
movzbl %cl,%eax
ret

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

LLVM IR (-O2):
define i32 @and(i32 %0, i32 %1) {
%3 = icmp ne i32 %0, 0
%4 = icmp ne i32 %1, 0
%5 = and i1 %3, %4
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isalpha(int);
void t_isalpha_0xa1() {
  Assert_real((isalpha(161) == 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_isalpha.c",
              810, ("isalpha should be 0 for 0xa1"));
}


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

x86 assembly (clang, -O2):
<t_isalpha_0xa1>:
push   %rax
mov    $0xa1,%edi
call   1030 <isalpha@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x32a,%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_isalpha.c\00"
@.str.1 = [29 x i8] c"isalpha should be 0 for 0xa1\00"
define void @t_isalpha_0xa1() {
%1 = call i64 @isalpha(i32 161)
%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 810, 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_isalpha.c\00"
@.str.1 = [29 x i8] c"isalpha should be 0 for 0xa1\00"
define void @t_isalpha_0xa1() {
%1 = tail call i64 @isalpha(i32 161)
%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 810, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int phy_read(int);
int /*<<< orphan*/ phy_write(int /*<<< orphan*/, int);
void phy_loopback_en() {
  phy_write(0, 1 << 14);
  while (phy_read(1) & (1 << 4))
    ;
}


x86 assembly (clang, -O0):
<phy_loopback_en>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
mov    $0x4000,%esi
call   1030 <phy_write@plt>
mov    $0x1,%edi
call   1040 <phy_read@plt>
and    $0x10,%eax
cmp    $0x0,%eax
je     114b <phy_loopback_en+0x2b>
jmp    1130 <phy_loopback_en+0x10>
pop    %rbp
ret

x86 assembly (clang, -O2):
<phy_loopback_en>:
push   %rax
xor    %edi,%edi
mov    $0x4000,%esi
call   1030 <phy_write@plt>
nopl   (%rax)
mov    $0x1,%edi
call   1040 <phy_read@plt>
test   $0x10,%al
jne    1130 <phy_loopback_en+0x10>
pop    %rax
ret

LLVM IR (-O0):
define void @phy_loopback_en() {
%1 = call i32 @phy_write(i32 0, i32 16384)
br label %2
2: ; preds = %6, %0
%3 = call i32 @phy_read(i32 1)
%4 = and i32 %3, 16
%5 = icmp ne i32 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %2
br label %2
7: ; preds = %2
ret void
}

LLVM IR (-O2):
define void @phy_loopback_en() {
%1 = tail call i32 @phy_write(i32 0, i32 16384)
br label %2
2: ; preds = %2, %0
%3 = tail call i32 @phy_read(i32 1)
%4 = and i32 %3, 16
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %2
6: ; preds = %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ e_clc();
void e_clc_accu() { e_clc(); }


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

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

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

LLVM IR (-O2):
define void @e_clc_accu() {
%1 = tail call i32 (...) @e_clc()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ f3(char **);
int /*<<< orphan*/ printf(char *, char *);
void main() {
  char string1[10] = "123qweasdzxc";
  printf("before f3 strintg1 = %s;\n", string1);
  f3(&string1);
  printf("after f3 string1 = %s;\n", string1);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0xed1(%rip),%rax
mov    %rax,-0xa(%rbp)
mov    0xece(%rip),%ax
mov    %ax,-0x2(%rbp)
lea    -0xa(%rbp),%rsi
lea    0xec1(%rip),%rdi
call   1030 <printf@plt>
lea    -0xa(%rbp),%rdi
call   1040 <f3@plt>
lea    -0xa(%rbp),%rsi
lea    0xec2(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
movabs $0x7361657771333231,%rax
65 61 73
mov    %rax,(%rsp)
movw   $0x7a64,0x8(%rsp)
lea    0xec9(%rip),%rdi
mov    %rsp,%rbx
mov    %rbx,%rsi
call   1030 <printf@plt>
mov    %rbx,%rdi
call   1040 <f3@plt>
lea    0xec9(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.string1 = [10 x i8] c"123qweasdz"
@.str = [26 x i8] c"before f3 strintg1 = %s;\0A\00"
@.str.1 = [24 x i8] c"after f3 string1 = %s;\0A\00"
define void @main() {
%1 = alloca [10 x i8]
%2 = bitcast [10 x i8]* %1 to i8*
%3 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 0
%4 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = bitcast [10 x i8]* %1 to i8**
%6 = call i32 @f3(i8** %5)
%7 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 0
%8 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), i8* %7)
ret void
}

LLVM IR (-O2):
@__const.main.string1 = [10 x i8] c"123qweasdz"
@.str = [26 x i8] c"before f3 strintg1 = %s;\0A\00"
@.str.1 = [24 x i8] c"after f3 string1 = %s;\0A\00"
define void @main() {
%1 = alloca [10 x i8]
%2 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 0
%3 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = bitcast [10 x i8]* %1 to i8**
%5 = call i32 @f3(i8** %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), i8* %2)
ret void
}
/* Type definitions */
struct clad_test {
  int dummy;
};

/* Variables and functions */
struct clad_test *clad_test_assert(struct clad_test *, int, char *, int, int,
                                   char const *);
struct clad_test *clad_test_intneq(struct clad_test *test, int i1, int i2,
                                   const char *explain) {
  return clad_test_assert(test, i1 != i2,
                          "Integers should not be equal: %d %d; %s ", i1, i2,
                          explain);
}


x86 assembly (clang, -O0):
<clad_test_intneq>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
setne  %al
and    $0x1,%al
movzbl %al,%esi
mov    -0xc(%rbp),%ecx
mov    -0x10(%rbp),%r8d
mov    -0x18(%rbp),%r9
lea    0xeb6(%rip),%rdx
call   1030 <clad_test_assert@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clad_test_intneq>:
mov    %rcx,%r9
mov    %edx,%r8d
mov    %esi,%ecx
xor    %esi,%esi
cmp    %edx,%ecx
setne  %sil
lea    0xed9(%rip),%rdx
jmp    1030 <clad_test_assert@plt>

LLVM IR (-O0):
%struct.clad_test = type { i32 }
@.str = [41 x i8] c"Integers should not be equal: %d %d; %s \00"
define %struct.clad_test* @clad_test_intneq(%struct.clad_test* %0, i32 %1, i32 %2, i8* %3) {
%5 = alloca %struct.clad_test*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i8*
store %struct.clad_test* %0, %struct.clad_test** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i8* %3, i8** %8
%9 = load %struct.clad_test*, %struct.clad_test** %5
%10 = load i32, i32* %6
%11 = load i32, i32* %7
%12 = icmp ne i32 %10, %11
%13 = zext i1 %12 to i32
%14 = load i32, i32* %6
%15 = load i32, i32* %7
%16 = load i8*, i8** %8
%17 = call %struct.clad_test* @clad_test_assert(%struct.clad_test* %9, i32 %13, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0), i32 %14, i32 %15, i8* %16)
ret %struct.clad_test* %17
}

LLVM IR (-O2):
%struct.clad_test = type { i32 }
@.str = [41 x i8] c"Integers should not be equal: %d %d; %s \00"
define %struct.clad_test* @clad_test_intneq(%struct.clad_test* %0, i32 %1, i32 %2, i8* %3) {
%5 = icmp ne i32 %1, %2
%6 = zext i1 %5 to i32
%7 = tail call %struct.clad_test* @clad_test_assert(%struct.clad_test* %0, i32 %6, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0), i32 %1, i32 %2, i8* %3)
ret %struct.clad_test* %7
}
/* Type definitions */
typedef scalar_t__ uint64_t;

/* Variables and functions */
uint64_t absDiff(uint64_t aValue1, uint64_t aValue2) {
  if (aValue1 > aValue2) {
    return aValue1 - aValue2;
  } else {
    return aValue2 - aValue1;
  }
}


x86 assembly (clang, -O0):
<absDiff>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
jle    112b <absDiff+0x2b>
mov    -0x10(%rbp),%rax
sub    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1137 <absDiff+0x37>
mov    -0x18(%rbp),%rax
sub    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<absDiff>:
mov    %rdi,%rax
sub    %rsi,%rax
neg    %rax
sub    %rsi,%rdi
cmovg  %rdi,%rax
ret

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

LLVM IR (-O2):
define i64 @absDiff(i64 %0, i64 %1) {
%3 = icmp sgt i64 %0, %1
%4 = sub nsw i64 %0, %1
%5 = sub nsw i64 %1, %0
%6 = select i1 %3, i64 %4, i64 %5
ret i64 %6
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
void g() {
  int array[1], i, j;
  i = 0;
  array[i] = 1;
  j = 0;
  assert(array[j] == 1);
}


x86 assembly (clang, -O0):
<g>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x8(%rbp)
movslq -0x8(%rbp),%rax
movl   $0x1,-0x4(%rbp,%rax,4)
movl   $0x0,-0xc(%rbp)
movslq -0xc(%rbp),%rax
cmpl   $0x1,-0x4(%rbp,%rax,4)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<g>:
mov    $0x1,%edi
jmp    1030 <assert@plt>

LLVM IR (-O0):
define void @g() {
%1 = alloca [1 x i32]
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %2
%4 = load i32, i32* %2
%5 = sext i32 %4 to i64
%6 = getelementptr inbounds [1 x i32], [1 x i32]* %1, i64 0, i64 %5
store i32 1, i32* %6
store i32 0, i32* %3
%7 = load i32, i32* %3
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds [1 x i32], [1 x i32]* %1, i64 0, i64 %8
%10 = load i32, i32* %9
%11 = icmp eq i32 %10, 1
%12 = zext i1 %11 to i32
%13 = call i32 @assert(i32 %12)
ret void
}

LLVM IR (-O2):
define void @g() {
%1 = tail call i32 @assert(i32 1)
ret void
}