xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void Print_Array(int array[], int size) {
  for (int i = 0; i < size; i++)
    printf("%d ", array[i]);
  printf("\n");
}


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d \00"
define void @Print_Array(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %8
6: ; preds = %8, %2
%7 = tail call i32 @putchar(i32 10)
ret void
8: ; preds = %4, %8
%9 = phi i64 [ 0, %4 ], [ %13, %8 ]
%10 = getelementptr inbounds i32, i32* %0, i64 %9
%11 = load i32, i32* %10
%12 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %11)
%13 = add nuw nsw i64 %9, 1
%14 = icmp eq i64 %13, %5
br i1 %14, label %6, label %8
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
struct tm {
  int dummy;
};

/* Variables and functions */
struct tm *gmtime_r(int /*<<< orphan*/ const *, struct tm *);
struct tm *gmtime(const time_t *timep) {
  static struct tm __tm;
  return gmtime_r(timep, &__tm);
}


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

x86 assembly (clang, -O2):
<gmtime>:
lea    0x2f15(%rip),%rsi
jmp    1030 <gmtime_r@plt>

LLVM IR (-O0):
%struct.tm = type { i32 }
@gmtime.__tm = internal global %struct.tm zeroinitializer
define %struct.tm* @gmtime(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call %struct.tm* @gmtime_r(i32* %3, %struct.tm* @gmtime.__tm)
ret %struct.tm* %4
}

LLVM IR (-O2):
%struct.tm = type { i32 }
@gmtime.__tm = internal global %struct.tm zeroinitializer
define %struct.tm* @gmtime(i32* %0) {
%2 = tail call %struct.tm* @gmtime_r(i32* %0, %struct.tm* @gmtime.__tm)
ret %struct.tm* %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int XSetWindowBorderPixmap() {
  printf("XSetWindowBorderPixmap called\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [31 x i8] c"XSetWindowBorderPixmap called\0A\00"
define i32 @XSetWindowBorderPixmap() {
%1 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [30 x i8] c"XSetWindowBorderPixmap called\00"
define i32 @XSetWindowBorderPixmap() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str, i64 0, i64 0))
ret i32 0
}
void claim_vspace() {}


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

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

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

LLVM IR (-O2):
define void @claim_vspace() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_thread_get_data() {
  printf("NOT IMPLEMENTED:"
         "pa_thread_get_data"
         "\n");
}


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

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

LLVM IR (-O0):
@.str = [36 x i8] c"NOT IMPLEMENTED:pa_thread_get_data\0A\00"
define i32 @pa_thread_get_data() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [35 x i8] c"NOT IMPLEMENTED:pa_thread_get_data\00"
define i32 @pa_thread_get_data() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ lstrip(char *, char const);
int /*<<< orphan*/ rstrip(char *, char const);
void strip(char str[], const char del) {
  lstrip(str, del);
  rstrip(str, del);
}


x86 assembly (clang, -O0):
<strip>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rdi
movsbl -0x9(%rbp),%esi
call   1040 <lstrip@plt>
mov    -0x8(%rbp),%rdi
movsbl -0x9(%rbp),%esi
call   1030 <rstrip@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strip>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
call   1040 <lstrip@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <rstrip@plt>

LLVM IR (-O0):
define void @strip(i8* %0, i8 signext %1) {
%3 = alloca i8*
%4 = alloca i8
store i8* %0, i8** %3
store i8 %1, i8* %4
%5 = load i8*, i8** %3
%6 = load i8, i8* %4
%7 = call i32 @lstrip(i8* %5, i8 signext %6)
%8 = load i8*, i8** %3
%9 = load i8, i8* %4
%10 = call i32 @rstrip(i8* %8, i8 signext %9)
ret void
}

LLVM IR (-O2):
define void @strip(i8* %0, i8 signext %1) {
%3 = tail call i32 @lstrip(i8* %0, i8 signext %1)
%4 = tail call i32 @rstrip(i8* %0, i8 signext %1)
ret void
}
int is_valid_grade(int n) { return 0 <= n && n <= 100; }


x86 assembly (clang, -O0):
<is_valid_grade>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
xor    %ecx,%ecx
cmp    -0x4(%rbp),%ecx
mov    %al,-0x5(%rbp)
jg     1121 <is_valid_grade+0x21>
cmpl   $0x64,-0x4(%rbp)
setle  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_valid_grade>:
xor    %eax,%eax
cmp    $0x65,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @is_valid_grade(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sle i32 0, %3
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 100
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ false, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @is_valid_grade(i32 %0) {
%2 = icmp ult i32 %0, 101
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
char Soft_SPI_Read(int);
void SPI_Read_Bytes(char *buffer, unsigned NoBytes) {
  int i;
  for (i = 0; i < NoBytes; i++)
    buffer[i] = Soft_SPI_Read(0xFF);
}


x86 assembly (clang, -O0):
<SPI_Read_Bytes>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jae    1157 <SPI_Read_Bytes+0x47>
mov    $0xff,%edi
call   1030 <Soft_SPI_Read@plt>
mov    %al,%dl
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <SPI_Read_Bytes+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SPI_Read_Bytes>:
push   %r15
push   %r14
push   %rbx
test   %esi,%esi
je     1147 <SPI_Read_Bytes+0x37>
mov    %rdi,%r14
mov    %esi,%r15d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    $0xff,%edi
call   1030 <Soft_SPI_Read@plt>
mov    %al,(%r14,%rbx,1)
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <SPI_Read_Bytes+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @SPI_Read_Bytes(i8* nocapture writeonly %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %12, label %4
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %10, %6 ]
%8 = tail call signext i8 @Soft_SPI_Read(i32 255)
%9 = getelementptr inbounds i8, i8* %0, i64 %7
store i8 %8, i8* %9
%10 = add nuw nsw i64 %7, 1
%11 = icmp eq i64 %10, %5
br i1 %11, label %12, label %6
12: ; preds = %6, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _IOW(int, int, int /*<<< orphan*/);
int /*<<< orphan*/ __u64;
int /*<<< orphan*/ exit(int);
int ioctl(int, int /*<<< orphan*/, unsigned long long *);
int /*<<< orphan*/ perror(char *);
void do_snap_wait(int fd, unsigned long long transid) {
  int r = ioctl(fd, _IOW(0x94, 22, __u64), &transid);
  if (r < 0) {
    perror("do_snap_wait: ioctl");
    exit(1);
  }
}


x86 assembly (clang, -O0):
<do_snap_wait>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    0x2e84(%rip),%rax
mov    (%rax),%edx
mov    $0x94,%edi
mov    $0x16,%esi
call   1030 <_IOW@plt>
mov    -0x18(%rbp),%edi
mov    %eax,%esi
lea    -0x10(%rbp),%rdx
call   1040 <ioctl@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jge    119e <do_snap_wait+0x5e>
lea    0xe71(%rip),%rdi
call   1050 <perror@plt>
mov    $0x1,%edi
call   1060 <exit@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_snap_wait>:
push   %rbx
sub    $0x10,%rsp
mov    %edi,%ebx
mov    %rsi,0x8(%rsp)
mov    0x2e8d(%rip),%rax
mov    (%rax),%edx
mov    $0x94,%edi
mov    $0x16,%esi
call   1030 <_IOW@plt>
lea    0x8(%rsp),%rdx
mov    %ebx,%edi
mov    %eax,%esi
call   1040 <ioctl@plt>
test   %eax,%eax
js     117c <do_snap_wait+0x3c>
add    $0x10,%rsp
pop    %rbx
ret
lea    0xe7d(%rip),%rdi
call   1050 <perror@plt>
mov    $0x1,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@__u64 = global i32 0
@.str = [20 x i8] c"do_snap_wait: ioctl\00"
define void @do_snap_wait(i32 %0, i64 %1) {
%3 = alloca i32
%4 = alloca i64
%5 = alloca i32
store i32 %0, i32* %3
store i64 %1, i64* %4
%6 = load i32, i32* %3
%7 = load i32, i32* @__u64
%8 = call i32 @_IOW(i32 148, i32 22, i32 %7)
%9 = call i32 @ioctl(i32 %6, i32 %8, i64* %4)
store i32 %9, i32* %5
%10 = load i32, i32* %5
%11 = icmp slt i32 %10, 0
br i1 %11, label %12, label %15
12: ; preds = %2
%13 = call i32 @perror(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%14 = call i32 @exit(i32 1)
unreachable
15: ; preds = %2
ret void
}

LLVM IR (-O2):
@__u64 = global i32 0
@.str = [20 x i8] c"do_snap_wait: ioctl\00"
define void @do_snap_wait(i32 %0, i64 %1) {
%3 = alloca i64
store i64 %1, i64* %3
%4 = load i32, i32* @__u64
%5 = tail call i32 @_IOW(i32 148, i32 22, i32 %4)
%6 = call i32 @ioctl(i32 %0, i32 %5, i64* %3)
%7 = icmp slt i32 %6, 0
br i1 %7, label %8, label %11
8: ; preds = %2
%9 = call i32 @perror(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%10 = call i32 @exit(i32 1)
unreachable
11: ; preds = %2
ret void
}
/* Variables and functions */
scalar_t__ isspace(unsigned char);
char *after_blanks(char *s) {
  while (*s != '\0' && isspace((unsigned char)(*s)))
    ++s;
  return s;
}


x86 assembly (clang, -O0):
<after_blanks>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x9(%rbp)
je     1147 <after_blanks+0x37>
mov    -0x8(%rbp),%rax
movzbl (%rax),%edi
call   1030 <isspace@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
test   $0x1,%al
jne    1157 <after_blanks+0x47>
jmp    1168 <after_blanks+0x58>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    111c <after_blanks+0xc>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<after_blanks>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%al
test   %al,%al
je     1139 <after_blanks+0x29>
nopw   0x0(%rax,%rax,1)
movzbl %al,%edi
call   1030 <isspace@plt>
test   %rax,%rax
je     1139 <after_blanks+0x29>
movzbl 0x1(%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <after_blanks+0x10>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @after_blanks(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %15, %1
%4 = load i8*, i8** %2
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %13
8: ; preds = %3
%9 = load i8*, i8** %2
%10 = load i8, i8* %9
%11 = call i64 @isspace(i8 zeroext %10)
%12 = icmp ne i64 %11, 0
br label %13
13: ; preds = %8, %3
%14 = phi i1 [ false, %3 ], [ %12, %8 ]
br i1 %14, label %15, label %18
15: ; preds = %13
%16 = load i8*, i8** %2
%17 = getelementptr inbounds i8, i8* %16, i32 1
store i8* %17, i8** %2
br label %3
18: ; preds = %13
%19 = load i8*, i8** %2
ret i8* %19
}

LLVM IR (-O2):
define i8* @after_blanks(i8* %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %13, label %4
4: ; preds = %1, %9
%5 = phi i8 [ %11, %9 ], [ %2, %1 ]
%6 = phi i8* [ %10, %9 ], [ %0, %1 ]
%7 = tail call i64 @isspace(i8 zeroext %5)
%8 = icmp eq i64 %7, 0
br i1 %8, label %13, label %9
9: ; preds = %4
%10 = getelementptr inbounds i8, i8* %6, i64 1
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %4
13: ; preds = %4, %9, %1
%14 = phi i8* [ %0, %1 ], [ %10, %9 ], [ %6, %4 ]
ret i8* %14
}
/* Variables and functions */
int /*<<< orphan*/ setuid(int /*<<< orphan*/);
int system(char const *);
int main() {
  const char *cmd = "/bin/umount `/usr/bin/dirname "
                    "$0`/build/subversion/tests/cmdline/svn-test-work";
  setuid(0);
  return system(cmd);
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
call   1040 <setuid@plt>
lea    0xed1(%rip),%rdi
pop    %rax
jmp    1030 <system@plt>

LLVM IR (-O0):
@.str = [79 x i8] c"/bin/umount `/usr/bin/dirname $0`/build/subversion/tests/cmdline/svn-test-work\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
store i32 0, i32* %1
store i8* getelementptr inbounds ([79 x i8], [79 x i8]* @.str, i64 0, i64 0), i8** %2
%3 = call i32 @setuid(i32 0)
%4 = load i8*, i8** %2
%5 = call i32 @system(i8* %4)
ret i32 %5
}

LLVM IR (-O2):
@.str = [79 x i8] c"/bin/umount `/usr/bin/dirname $0`/build/subversion/tests/cmdline/svn-test-work\00"
define i32 @main() {
%1 = tail call i32 @setuid(i32 0)
%2 = tail call i32 @system(i8* getelementptr inbounds ([79 x i8], [79 x i8]* @.str, i64 0, i64 0))
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_usage(void) {
  printf("USAGE: webserver PORT PATH\n");
  printf("PORT is integer between 0 and 65535\n");
}


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

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

LLVM IR (-O0):
@.str = [28 x i8] c"USAGE: webserver PORT PATH\0A\00"
@.str.1 = [37 x i8] c"PORT is integer between 0 and 65535\0A\00"
define void @print_usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [27 x i8] c"USAGE: webserver PORT PATH\00"
@str.2 = [36 x i8] c"PORT is integer between 0 and 65535\00"
define void @print_usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @str.2, i64 0, i64 0))
ret void
}
AR0AR1(r0, r1, x0, x1, p0, p1) int r0, r1;
int *p0, *p1;
{ (p0[10000000]) = (p1[1111111 / 4]); }


x86 assembly (clang, -O0):
<AR0AR1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8,-0x20(%rbp)
mov    %r9,-0x28(%rbp)
mov    -0x28(%rbp),%rax
mov    0x10f444(%rax),%ecx
mov    -0x20(%rbp),%rax
mov    %ecx,0x2625a00(%rax)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<AR0AR1>:
mov    0x10f444(%r9),%eax
mov    %eax,0x2625a00(%r8)
ret

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

LLVM IR (-O2):
define i32 @AR0AR1(i32 %0, i32 %1, i32 %2, i32 %3, i32* nocapture writeonly %4, i32* nocapture %5) {
%7 = getelementptr inbounds i32, i32* %5, i64 277777
%8 = load i32, i32* %7
%9 = getelementptr inbounds i32, i32* %4, i64 10000000
store i32 %8, i32* %9
ret i32 undef
}
/* Variables and functions */
void *test17_malloc(size_t n) {
  (void)(n);
  return 0;
}


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

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

LLVM IR (-O0):
define i8* @test17_malloc(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @test17_malloc(i64 %0) {
ret i8* null
}
unsigned int mul2(unsigned int x) {
  if (x < 0xfffffffe)
    return x * 2;
  else
    return 0;
}


x86 assembly (clang, -O0):
<mul2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0xfffffffe,-0x8(%rbp)
jae    111f <mul2+0x1f>
mov    -0x8(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1126 <mul2+0x26>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mul2>:
lea    (%rdi,%rdi,1),%ecx
xor    %eax,%eax
cmp    $0xfffffffe,%edi
cmovb  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @mul2(i32 %0) {
%2 = icmp ult i32 %0, -2
%3 = shl i32 %0, 1
%4 = select i1 %2, i32 %3, i32 0
ret i32 %4
}
/* Type definitions */
typedef size_t uint;

/* Variables and functions */
void SetField32(uint *A, register uint index, register uint x) { A[index] = x; }


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

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

LLVM IR (-O0):
define void @SetField32(i64* %0, i64 %1, i64 %2) {
%4 = alloca i64*
%5 = alloca i64
%6 = alloca i64
store i64* %0, i64** %4
store i64 %1, i64* %5
store i64 %2, i64* %6
%7 = load i64, i64* %6
%8 = load i64*, i64** %4
%9 = load i64, i64* %5
%10 = getelementptr inbounds i64, i64* %8, i64 %9
store i64 %7, i64* %10
ret void
}

LLVM IR (-O2):
define void @SetField32(i64* nocapture writeonly %0, i64 %1, i64 %2) {
%4 = getelementptr inbounds i64, i64* %0, i64 %1
store i64 %2, i64* %4
ret void
}
/* Variables and functions */
int /*<<< orphan*/ interp_init();
int /*<<< orphan*/ load(char *);
int main(int argc, char *argv[]) {
  if (argc < 2) {
    return 1;
  }
  interp_init();
  load(argv[1]);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x8(%rbp)
jge    114c <main+0x2c>
movl   $0x1,-0x4(%rbp)
jmp    1167 <main+0x47>
mov    $0x0,%al
call   1030 <interp_init@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1040 <load@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    $0x1,%ebx
cmp    $0x2,%edi
jl     1143 <main+0x23>
mov    %rsi,%r14
xor    %ebx,%ebx
xor    %eax,%eax
call   1030 <interp_init@plt>
mov    0x8(%r14),%rdi
call   1040 <load@plt>
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
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 slt i32 %6, 2
br i1 %7, label %8, label %9
8: ; preds = %2
store i32 1, i32* %3
br label %15
9: ; preds = %2
%10 = call i32 (...) @interp_init()
%11 = load i8**, i8*** %5
%12 = getelementptr inbounds i8*, i8** %11, i64 1
%13 = load i8*, i8** %12
%14 = call i32 @load(i8* %13)
store i32 0, i32* %3
br label %15
15: ; preds = %9, %8
%16 = load i32, i32* %3
ret i32 %16
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp slt i32 %0, 2
br i1 %3, label %9, label %4
4: ; preds = %2
%5 = tail call i32 (...) @interp_init()
%6 = getelementptr inbounds i8*, i8** %1, i64 1
%7 = load i8*, i8** %6
%8 = tail call i32 @load(i8* %7)
br label %9
9: ; preds = %2, %4
%10 = phi i32 [ 0, %4 ], [ 1, %2 ]
ret i32 %10
}
void wifi_rsp_hardware_adc_read(
    const struct wifi_msg_hardware_adc_read_rsp_t *msg) {}


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

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

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

LLVM IR (-O2):
%struct.wifi_msg_hardware_adc_read_rsp_t = type opaque
define void @wifi_rsp_hardware_adc_read(%struct.wifi_msg_hardware_adc_read_rsp_t* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ClearScreen();
int /*<<< orphan*/ WriteString(int, char *);
void start() {
  ClearScreen();
  char str[] = "Hello World!";
  WriteString(7, str);
}


x86 assembly (clang, -O0):
<start>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <ClearScreen@plt>
mov    0xeca(%rip),%rax
mov    %rax,-0xd(%rbp)
mov    0xec8(%rip),%eax
mov    %eax,-0x5(%rbp)
mov    0xec3(%rip),%al
mov    %al,-0x1(%rbp)
lea    -0xd(%rbp),%rsi
mov    $0x7,%edi
call   1030 <WriteString@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<start>:
sub    $0x18,%rsp
xor    %eax,%eax
call   1040 <ClearScreen@plt>
movabs $0x21646c726f5720,%rax
mov    %rax,0xd(%rsp)
movabs $0x6f57206f6c6c6548,%rax
20 57 6f
mov    %rax,0x8(%rsp)
lea    0x8(%rsp),%rsi
mov    $0x7,%edi
call   1030 <WriteString@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.start.str = [13 x i8] c"Hello World!\00"
define void @start() {
%1 = alloca [13 x i8]
%2 = call i32 (...) @ClearScreen()
%3 = bitcast [13 x i8]* %1 to i8*
%4 = getelementptr inbounds [13 x i8], [13 x i8]* %1, i64 0, i64 0
%5 = call i32 @WriteString(i32 7, i8* %4)
ret void
}

LLVM IR (-O2):
@__const.start.str = [13 x i8] c"Hello World!\00"
define void @start() {
%1 = alloca [13 x i8]
%2 = tail call i32 (...) @ClearScreen()
%3 = getelementptr inbounds [13 x i8], [13 x i8]* %1, i64 0, i64 0
%4 = call i32 @WriteString(i32 7, i8* %3)
ret void
}
/* Variables and functions */
double copysign(double, double);
int main() {
  double neg = -1.0;
  double pos = 1.0;
  double res = copysign(pos, neg);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movsd  0xf15(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  0xf00(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movaps 0xeca(%rip),%xmm2
pand   %xmm2,%xmm1
movaps 0xecf(%rip),%xmm2
pand   %xmm2,%xmm0
por    %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca double
%3 = alloca double
%4 = alloca double
store i32 0, i32* %1
store double -1.000000e+00, double* %2
store double 1.000000e+00, double* %3
%5 = load double, double* %3
%6 = load double, double* %2
%7 = call double @llvm.copysign.f64(double %5, double %6)
store double %7, double* %4
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
int compar(const void *a, const void *b) {
  if (*(int *)a > *(int *)b)
    return 1;
  if (*(int *)a < *(int *)b)
    return -1;
  return 0;
}


x86 assembly (clang, -O0):
<compar>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    -0x18(%rbp),%rcx
cmp    (%rcx),%eax
jle    112a <compar+0x2a>
movl   $0x1,-0x4(%rbp)
jmp    114f <compar+0x4f>
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    -0x18(%rbp),%rcx
cmp    (%rcx),%eax
jge    1148 <compar+0x48>
movl   $0xffffffff,-0x4(%rbp)
jmp    114f <compar+0x4f>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<compar>:
mov    (%rdi),%eax
mov    (%rsi),%ecx
xor    %edx,%edx
cmp    %ecx,%eax
setl   %dl
neg    %edx
cmp    %ecx,%eax
mov    $0x1,%eax
cmovle %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @compar(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = icmp sgt i32 %4, %6
%8 = icmp slt i32 %4, %6
%9 = sext i1 %8 to i32
%10 = select i1 %7, i32 1, i32 %9
ret i32 %10
}
/* Variables and functions */
int index(int i, int j, int row_length) { return (i * row_length) + j; }


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

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

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

LLVM IR (-O2):
define i32 @index(i32 %0, i32 %1, i32 %2) {
%4 = mul nsw i32 %2, %0
%5 = add nsw i32 %4, %1
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ sem_op(int, int);
void sem_wait(int id) { sem_op(id, -1); }


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

x86 assembly (clang, -O2):
<sem_wait>:
mov    $0xffffffff,%esi
jmp    1030 <sem_op@plt>

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

LLVM IR (-O2):
define void @sem_wait(i32 %0) {
%2 = tail call i32 @sem_op(i32 %0, i32 -1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sched_yield();
void thread_yield() { sched_yield(); }


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

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

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

LLVM IR (-O2):
define void @thread_yield() {
%1 = tail call i32 (...) @sched_yield()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isgraph(int);
void t_isgraph_0xe3() {
  Assert_real((isgraph(227) == 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_isgraph.c",
              1140, ("isgraph should be 0 for 0xe3"));
}


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

x86 assembly (clang, -O2):
<t_isgraph_0xe3>:
push   %rax
mov    $0xe3,%edi
call   1040 <isgraph@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x474,%edx
pop    %rax
jmp    1030 <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_isgraph.c\00"
@.str.1 = [29 x i8] c"isgraph should be 0 for 0xe3\00"
define void @t_isgraph_0xe3() {
%1 = call i64 @isgraph(i32 227)
%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 1140, 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_isgraph.c\00"
@.str.1 = [29 x i8] c"isgraph should be 0 for 0xe3\00"
define void @t_isgraph_0xe3() {
%1 = tail call i64 @isgraph(i32 227)
%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 1140, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void test_38_0(char *mem) { __atomic_fetch_nand(mem, 1, 4); }


x86 assembly (clang, -O0):
<test_38_0>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
movb   $0x1,-0x9(%rbp)
mov    -0x9(%rbp),%cl
mov    %cl,-0xc(%rbp)
mov    (%rax),%al
mov    %al,-0xb(%rbp)
mov    -0xb(%rbp),%al
mov    -0x18(%rbp),%rcx
mov    -0xc(%rbp),%sil
mov    %al,%dl
and    %sil,%dl
mov    %dl,-0x1a(%rbp)
not    %dl
lock cmpxchg %dl,(%rcx)
sete   %cl
mov    %al,-0x19(%rbp)
test   $0x1,%cl
mov    %al,-0xb(%rbp)
jne    114f <test_38_0+0x4f>
jmp    111f <test_38_0+0x1f>
mov    -0x19(%rbp),%al
mov    %al,-0xa(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_38_0>:
mov    (%rdi),%al
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %eax,%ecx
not    %cl
or     $0xfe,%cl
lock cmpxchg %cl,(%rdi)
jne    1110 <test_38_0+0x10>
ret

LLVM IR (-O0):
define void @test_38_0(i8* %0) {
%2 = alloca i8*
%3 = alloca i8
%4 = alloca i8
store i8* %0, i8** %2
%5 = load i8*, i8** %2
store i8 1, i8* %3
%6 = load i8, i8* %3
%7 = atomicrmw nand i8* %5, i8 %6 acq_rel
store i8 %7, i8* %4
%8 = load i8, i8* %4
ret void
}

LLVM IR (-O2):
define void @test_38_0(i8* nocapture %0) {
%2 = atomicrmw nand i8* %0, i8 1 acq_rel
ret void
}
/* Variables and functions */
int /*<<< orphan*/ arrange_cast_tab(long, int);
void remove_cast_tab(long trgt_ls_mbr_n) {
  arrange_cast_tab(trgt_ls_mbr_n, +1);
}


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

x86 assembly (clang, -O2):
<remove_cast_tab>:
mov    $0x1,%esi
jmp    1030 <arrange_cast_tab@plt>

LLVM IR (-O0):
define void @remove_cast_tab(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i32 @arrange_cast_tab(i64 %3, i32 1)
ret void
}

LLVM IR (-O2):
define void @remove_cast_tab(i64 %0) {
%2 = tail call i32 @arrange_cast_tab(i64 %0, i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ PANIC();
void *new_thread(void *arg) { PANIC(); }


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

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

LLVM IR (-O0):
define i8* @new_thread(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %3
%4 = call i32 (...) @PANIC()
%5 = load i8*, i8** %2
ret i8* %5
}

LLVM IR (-O2):
define noalias i8* @new_thread(i8* nocapture readnone %0) {
%2 = tail call i32 (...) @PANIC()
ret i8* undef
}
/* Variables and functions */
double strtod(char const *, int /*<<< orphan*/ *);
double atof(const char *ascii) { return (strtod(ascii, NULL)); }


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

x86 assembly (clang, -O2):
<atof>:
xor    %esi,%esi
jmp    1030 <strtod@plt>

LLVM IR (-O0):
define double @atof(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call double @strtod(i8* %3, i32* null)
ret double %4
}

LLVM IR (-O2):
define double @atof(i8* nocapture %0) {
%2 = tail call double @strtod(i8* nocapture %0, i32* null)
ret double %2
}
/* Variables and functions */
int binarySearch(const int query, int *array, size_t size) { return -1; }


x86 assembly (clang, -O0):
<binarySearch>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    $0xffffffff,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @binarySearch(i32 %0, i32* %1, i64 %2) {
%4 = alloca i32
%5 = alloca i32*
%6 = alloca i64
store i32 %0, i32* %4
store i32* %1, i32** %5
store i64 %2, i64* %6
ret i32 -1
}

LLVM IR (-O2):
define i32 @binarySearch(i32 %0, i32* nocapture readnone %1, i64 %2) {
ret i32 -1
}
void setval_296(unsigned *p) { *p = 2425409945U; }


x86 assembly (clang, -O0):
<setval_296>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movl   $0x9090d199,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<setval_296>:
movl   $0x9090d199,(%rdi)
ret

LLVM IR (-O0):
define void @setval_296(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
store i32 -1869557351, i32* %3
ret void
}

LLVM IR (-O2):
define void @setval_296(i32* nocapture writeonly %0) {
store i32 -1869557351, i32* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int vobb(int a) {
  printf("In shared library\n");
  a = a + 1;
  if (a > 2)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<vobb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
lea    0xede(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x2,-0x8(%rbp)
jle    1146 <vobb+0x36>
movl   $0x1,-0x4(%rbp)
jmp    114d <vobb+0x3d>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vobb>:
push   %rbx
mov    %edi,%ebx
lea    0xee6(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
cmp    $0x2,%ebx
setge  %al
pop    %rbx
ret

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

LLVM IR (-O2):
@str = [18 x i8] c"In shared library\00"
define i32 @vobb(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str, i64 0, i64 0))
%3 = icmp sgt i32 %0, 1
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int *malloc(int);
int main() {
  int *p, *q;
  int havoc;
  p = malloc(sizeof(int));
  q = p;
  *p = 0;
  *q = 1;
  assert(*p == 0);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x4,%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movl   $0x0,(%rax)
mov    -0x18(%rbp),%rax
movl   $0x1,(%rax)
mov    -0x10(%rbp),%rax
cmpl   $0x0,(%rax)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
%3 = alloca i32*
%4 = alloca i32
store i32 0, i32* %1
%5 = call i32* @malloc(i32 4)
store i32* %5, i32** %2
%6 = load i32*, i32** %2
store i32* %6, i32** %3
%7 = load i32*, i32** %2
store i32 0, i32* %7
%8 = load i32*, i32** %3
store i32 1, i32* %8
%9 = load i32*, i32** %2
%10 = load i32, i32* %9
%11 = icmp eq i32 %10, 0
%12 = zext i1 %11 to i32
%13 = call i32 @assert(i32 %12)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32* @malloc(i32 4)
%2 = tail call i32 @assert(i32 0)
ret i32 0
}
void ff_hevc_put_hevc_bi_qpel_v8_8_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_bi_qpel_v8_8_sse4() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sgen2(char *, char *, int, char *);
void cgdecpg(char *s, int v) { sgen2("%s\t$%d,%s", "subl", v, s); }


x86 assembly (clang, -O0):
<cgdecpg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%edx
mov    -0x8(%rbp),%rcx
lea    0xed3(%rip),%rdi
lea    0xed6(%rip),%rsi
call   1030 <sgen2@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cgdecpg>:
mov    %esi,%edx
mov    %rdi,%rcx
lea    0xee4(%rip),%rdi
lea    0xee7(%rip),%rsi
jmp    1030 <sgen2@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"%s\09$%d,%s\00"
@.str.1 = [5 x i8] c"subl\00"
define void @cgdecpg(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i8*, i8** %3
%7 = call i32 @sgen2(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %5, i8* %6)
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"%s\09$%d,%s\00"
@.str.1 = [5 x i8] c"subl\00"
define void @cgdecpg(i8* %0, i32 %1) {
%3 = tail call i32 @sgen2(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %1, i8* %0)
ret void
}
void rop3_10_0_0(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  stk2 = ~T;
  stk1 = *D & stk2;
  *D = stk1;
}


x86 assembly (clang, -O0):
<rop3_10_0_0>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
movzbl -0xa(%rbp),%eax
xor    $0xffffffff,%eax
mov    %al,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
movzbl -0xc(%rbp),%ecx
and    %ecx,%eax
mov    %al,-0xb(%rbp)
mov    -0xb(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rop3_10_0_0>:
not    %dl
and    %dl,(%rdi)
ret

LLVM IR (-O0):
define void @rop3_10_0_0(i8* %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
store i8* %0, i8** %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%9 = load i8, i8* %6
%10 = zext i8 %9 to i32
%11 = xor i32 %10, -1
%12 = trunc i32 %11 to i8
store i8 %12, i8* %8
%13 = load i8*, i8** %4
%14 = load i8, i8* %13
%15 = zext i8 %14 to i32
%16 = load i8, i8* %8
%17 = zext i8 %16 to i32
%18 = and i32 %15, %17
%19 = trunc i32 %18 to i8
store i8 %19, i8* %7
%20 = load i8, i8* %7
%21 = load i8*, i8** %4
store i8 %20, i8* %21
ret void
}

LLVM IR (-O2):
define void @rop3_10_0_0(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = xor i8 %2, -1
%5 = load i8, i8* %0
%6 = and i8 %5, %4
store i8 %6, i8* %0
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ c;

/* Variables and functions */
int boolean_parenthesization(char *, char *, int);
int /*<<< orphan*/ printf(char *, int);
int main() {
  char c[] = "TFTTF";
  char s[] = "|&|^";
  int n = sizeof(c) - 1 / sizeof(c[0]);
  printf("%d\n", boolean_parenthesization(c, s, n));
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xecb(%rip),%eax
mov    %eax,-0xa(%rbp)
mov    0xec5(%rip),%ax
mov    %ax,-0x6(%rbp)
mov    0xebd(%rip),%eax
mov    %eax,-0xf(%rbp)
mov    0xeb8(%rip),%al
mov    %al,-0xb(%rbp)
movl   $0x5,-0x14(%rbp)
lea    -0xa(%rbp),%rdi
lea    -0xf(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1040 <boolean_parenthesization@plt>
mov    %eax,%esi
lea    0xe96(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
movw   $0x46,0x14(%rsp)
movl   $0x54544654,0x10(%rsp)
54
movb   $0x0,0xc(%rsp)
movl   $0x5e7c267c,0x8(%rsp)
5e
lea    0x10(%rsp),%rdi
lea    0x8(%rsp),%rsi
mov    $0x5,%edx
call   1040 <boolean_parenthesization@plt>
lea    0xeb0(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.main.c = [6 x i8] c"TFTTF\00"
@__const.main.s = [5 x i8] c"|&|^\00"
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [6 x i8]
%3 = alloca [5 x i8]
%4 = alloca i32
store i32 0, i32* %1
%5 = bitcast [6 x i8]* %2 to i8*
%6 = bitcast [5 x i8]* %3 to i8*
store i32 5, i32* %4
%7 = getelementptr inbounds [6 x i8], [6 x i8]* %2, i64 0, i64 0
%8 = getelementptr inbounds [5 x i8], [5 x i8]* %3, i64 0, i64 0
%9 = load i32, i32* %4
%10 = call i32 @boolean_parenthesization(i8* %7, i8* %8, i32 %9)
%11 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %10)
ret i32 0
}

LLVM IR (-O2):
@__const.main.c = [6 x i8] c"TFTTF\00"
@__const.main.s = [5 x i8] c"|&|^\00"
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca [6 x i8]
%2 = alloca [5 x i8]
%3 = getelementptr inbounds [6 x i8], [6 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [5 x i8], [5 x i8]* %2, i64 0, i64 0
%5 = call i32 @boolean_parenthesization(i8* %3, i8* %4, i32 5)
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %5)
ret i32 0
}
int is_prime(int n) {
  int i;
  for (i = 2; i < n; i++) {
    if (n % i == 0) {
      return 1;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<is_prime>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
movl   $0x2,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1149 <is_prime+0x49>
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
cmp    $0x0,%edx
jne    1136 <is_prime+0x36>
movl   $0x1,-0x4(%rbp)
jmp    1150 <is_prime+0x50>
jmp    113b <is_prime+0x3b>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110e <is_prime+0xe>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_prime>:
xor    %ecx,%ecx
cmp    $0x3,%edi
jl     1120 <is_prime+0x20>
mov    $0x2,%esi
nopl   0x0(%rax)
mov    %edi,%eax
cltd
idiv   %esi
test   %edx,%edx
je     1123 <is_prime+0x23>
add    $0x1,%esi
cmp    %esi,%edi
jne    1110 <is_prime+0x10>
mov    %ecx,%eax
ret
mov    $0x1,%ecx
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @is_prime(i32 %0) {
%2 = icmp sgt i32 %0, 2
br i1 %2, label %5, label %10
3: ; preds = %5
%4 = icmp eq i32 %9, %0
br i1 %4, label %10, label %5
5: ; preds = %1, %3
%6 = phi i32 [ %9, %3 ], [ 2, %1 ]
%7 = srem i32 %0, %6
%8 = icmp eq i32 %7, 0
%9 = add nuw nsw i32 %6, 1
br i1 %8, label %10, label %3
10: ; preds = %5, %3, %1
%11 = phi i32 [ 0, %1 ], [ 0, %3 ], [ 1, %5 ]
ret i32 %11
}