xunge/DecIR huggingface dataset:
/* Type definitions */
struct stat {
  int /*<<< orphan*/ st_mode;
};

/* Variables and functions */
scalar_t__ S_ISREG(int /*<<< orphan*/);
scalar_t__ stat(char const *, struct stat *);
int file_path_is_file(const char *path) {
  struct stat stat_buffer;
  return ((stat(path, &stat_buffer) == 0) && S_ISREG(stat_buffer.st_mode));
}


x86 assembly (clang, -O0):
<file_path_is_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x10(%rbp),%rsi
call   1030 <stat@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x11(%rbp)
jne    115d <file_path_is_file+0x3d>
mov    -0x10(%rbp),%edi
call   1040 <S_ISREG@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<file_path_is_file>:
push   %rax
mov    %rsp,%rsi
call   1030 <stat@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
je     1135 <file_path_is_file+0x15>
pop    %rcx
ret
mov    (%rsp),%edi
call   1040 <S_ISREG@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
pop    %rcx
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
define i32 @file_path_is_file(i8* %0) {
%2 = alloca i8*
%3 = alloca %struct.stat
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @stat(i8* %4, %struct.stat* %3)
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %12
7: ; preds = %1
%8 = getelementptr inbounds %struct.stat, %struct.stat* %3, i32 0, i32 0
%9 = load i32, i32* %8
%10 = call i64 @S_ISREG(i32 %9)
%11 = icmp ne i64 %10, 0
br label %12
12: ; preds = %7, %1
%13 = phi i1 [ false, %1 ], [ %11, %7 ]
%14 = zext i1 %13 to i32
ret i32 %14
}

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @file_path_is_file(i8* %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i64 @stat(i8* %0, %struct.stat* %2)
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %12
6: ; preds = %1
%7 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%8 = load i32, i32* %7
%9 = call i64 @S_ISREG(i32 %8)
%10 = icmp ne i64 %9, 0
%11 = zext i1 %10 to i32
br label %12
12: ; preds = %6, %1
%13 = phi i32 [ 0, %1 ], [ %11, %6 ]
ret i32 %13
}
void test2(int x) {
  unsigned int t = ((unsigned int)1U << x);
  if (t != 2U)
    __builtin_abort();
}


x86 assembly (clang, -O0):
<test2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x2,-0x8(%rbp)
je     1137 <test2+0x27>
call   1030 <abort@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test2>:
cmp    $0x1,%edi
jne    1116 <test2+0x6>
ret
push   %rax
call   1030 <abort@plt>

LLVM IR (-O0):
define void @test2(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = shl i32 1, %4
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = icmp ne i32 %6, 2
br i1 %7, label %8, label %9
8: ; preds = %1
unreachable
9: ; preds = %1
ret void
}

LLVM IR (-O2):
define void @test2(i32 %0) {
%2 = icmp eq i32 %0, 1
br i1 %2, label %4, label %3
3: ; preds = %1
tail call void @abort()
unreachable
4: ; preds = %1
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ ssize_t;

/* Variables and functions */
int /*<<< orphan*/ dobind(int);
int /*<<< orphan*/ next_send(int, void const *, size_t, int);
int /*<<< orphan*/ set_next_send();
ssize_t send(int sockfd, const void *buf, size_t len, int flags) {
  set_next_send();
  dobind(sockfd);
  return next_send(sockfd, buf, len, flags);
}


x86 assembly (clang, -O0):
<send>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    $0x0,%al
call   1030 <set_next_send@plt>
mov    -0x4(%rbp),%edi
call   1050 <dobind@plt>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
call   1040 <next_send@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<send>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %ecx,%r14d
mov    %rdx,%r15
mov    %rsi,%rbp
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <set_next_send@plt>
mov    %ebx,%edi
call   1050 <dobind@plt>
mov    %ebx,%edi
mov    %rbp,%rsi
mov    %r15,%rdx
mov    %r14d,%ecx
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <next_send@plt>

LLVM IR (-O0):
define i32 @send(i32 %0, i8* %1, i64 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i64
%8 = alloca i32
store i32 %0, i32* %5
store i8* %1, i8** %6
store i64 %2, i64* %7
store i32 %3, i32* %8
%9 = call i32 (...) @set_next_send()
%10 = load i32, i32* %5
%11 = call i32 @dobind(i32 %10)
%12 = load i32, i32* %5
%13 = load i8*, i8** %6
%14 = load i64, i64* %7
%15 = load i32, i32* %8
%16 = call i32 @next_send(i32 %12, i8* %13, i64 %14, i32 %15)
ret i32 %16
}

LLVM IR (-O2):
define i32 @send(i32 %0, i8* %1, i64 %2, i32 %3) {
%5 = tail call i32 (...) @set_next_send()
%6 = tail call i32 @dobind(i32 %0)
%7 = tail call i32 @next_send(i32 %0, i8* %1, i64 %2, i32 %3)
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int CountNewlines(char *Pch) {
  int count = 0;
  assert(Pch != ((char *)NULL));
  while (*Pch != ('\0'))
    count += ((*Pch++) == '\n');
  return (count);
}


x86 assembly (clang, -O0):
<CountNewlines>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpq   $0x0,-0x8(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     116d <CountNewlines+0x5d>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%eax
cmp    $0xa,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1135 <CountNewlines+0x25>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CountNewlines>:
push   %rbx
mov    %rdi,%rbx
xor    %edi,%edi
test   %rbx,%rbx
setne  %dil
call   1030 <assert@plt>
mov    (%rbx),%cl
test   %cl,%cl
je     1147 <CountNewlines+0x37>
add    $0x1,%rbx
xor    %eax,%eax
xchg   %ax,%ax
xor    %edx,%edx
cmp    $0xa,%cl
sete   %dl
add    %edx,%eax
movzbl (%rbx),%ecx
add    $0x1,%rbx
test   %cl,%cl
jne    1130 <CountNewlines+0x20>
pop    %rbx
ret
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @CountNewlines(i8* %0) {
%2 = icmp ne i8* %0, null
%3 = zext i1 %2 to i32
%4 = tail call i32 @assert(i32 %3)
%5 = load i8, i8* %0
%6 = icmp eq i8 %5, 0
br i1 %6, label %17, label %7
7: ; preds = %1, %7
%8 = phi i8 [ %15, %7 ], [ %5, %1 ]
%9 = phi i32 [ %14, %7 ], [ 0, %1 ]
%10 = phi i8* [ %11, %7 ], [ %0, %1 ]
%11 = getelementptr inbounds i8, i8* %10, i64 1
%12 = icmp eq i8 %8, 10
%13 = zext i1 %12 to i32
%14 = add nuw nsw i32 %9, %13
%15 = load i8, i8* %11
%16 = icmp eq i8 %15, 0
br i1 %16, label %17, label %7
17: ; preds = %7, %1
%18 = phi i32 [ 0, %1 ], [ %14, %7 ]
ret i32 %18
}
/* Variables and functions */
int /*<<< orphan*/ box_unsigned_8(int /*<<< orphan*/);
int /*<<< orphan*/ current_micros();
void primitive_micros(void) { box_unsigned_8(current_micros()); }


x86 assembly (clang, -O0):
<primitive_micros>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <current_micros@plt>
mov    %eax,%edi
call   1030 <box_unsigned_8@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<primitive_micros>:
push   %rax
xor    %eax,%eax
call   1040 <current_micros@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <box_unsigned_8@plt>

LLVM IR (-O0):
define void @primitive_micros() {
%1 = call i32 (...) @current_micros()
%2 = call i32 @box_unsigned_8(i32 %1)
ret void
}

LLVM IR (-O2):
define void @primitive_micros() {
%1 = tail call i32 (...) @current_micros()
%2 = tail call i32 @box_unsigned_8(i32 %1)
ret void
}
int fun1198() { return 1198; }


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

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

LLVM IR (-O0):
define i32 @fun1198() {
ret i32 1198
}

LLVM IR (-O2):
define i32 @fun1198() {
ret i32 1198
}
char *strToStr(void *value) { return (char *)value; }


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

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

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

LLVM IR (-O2):
define i8* @strToStr(i8* readnone returned %0) {
ret i8* %0
}
/* Type definitions */
struct NeubotPoller {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ NeubotPoller_break_loop(struct NeubotPoller *);
void NeubotPoller_sigint(int signo, short event, void *opaque) {
  struct NeubotPoller *self;
  (void)signo;
  (void)event;
  self = (struct NeubotPoller *)opaque;
  NeubotPoller_break_loop(self);
}


x86 assembly (clang, -O0):
<NeubotPoller_sigint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %si,%ax
mov    %edi,-0x4(%rbp)
mov    %ax,-0x6(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <NeubotPoller_break_loop@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<NeubotPoller_sigint>:
mov    %rdx,%rdi
jmp    1030 <NeubotPoller_break_loop@plt>

LLVM IR (-O0):
%struct.NeubotPoller = type { i32 }
define void @NeubotPoller_sigint(i32 %0, i16 signext %1, i8* %2) {
%4 = alloca i32
%5 = alloca i16
%6 = alloca i8*
%7 = alloca %struct.NeubotPoller*
store i32 %0, i32* %4
store i16 %1, i16* %5
store i8* %2, i8** %6
%8 = load i32, i32* %4
%9 = load i16, i16* %5
%10 = load i8*, i8** %6
%11 = bitcast i8* %10 to %struct.NeubotPoller*
store %struct.NeubotPoller* %11, %struct.NeubotPoller** %7
%12 = load %struct.NeubotPoller*, %struct.NeubotPoller** %7
%13 = call i32 @NeubotPoller_break_loop(%struct.NeubotPoller* %12)
ret void
}

LLVM IR (-O2):
%struct.NeubotPoller = type { i32 }
define void @NeubotPoller_sigint(i32 %0, i16 signext %1, i8* %2) {
%4 = bitcast i8* %2 to %struct.NeubotPoller*
%5 = tail call i32 @NeubotPoller_break_loop(%struct.NeubotPoller* %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int main() {
  int x = 0;
  int y = 0;
  while (true) {
    x++;
    y++;
    x += y;
    y += x;
    if (x >= 10 || y >= 10)
      break;
  }
  assert(y >= 10);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
cmpl   $0xa,-0x8(%rbp)
jge    1165 <main+0x55>
cmpl   $0xa,-0xc(%rbp)
jl     116a <main+0x5a>
jmp    116f <main+0x5f>
jmp    112d <main+0x1d>
cmpl   $0xa,-0xc(%rbp)
setge  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
xor    %ecx,%ecx
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
lea    (%rcx,%rax,1),%edx
add    $0x1,%edx
add    %eax,%ecx
add    $0x2,%ecx
add    %edx,%eax
add    $0x2,%eax
cmp    $0x9,%ecx
jg     113a <main+0x2a>
cmp    $0xa,%eax
jl     1120 <main+0x10>
push   %rax
xor    %edi,%edi
cmp    $0xa,%eax
setge  %dil
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
store i32 0, i32* %1
store i32 0, i32* %2
store i32 0, i32* %3
br label %4
4: ; preds = %0, %21
%5 = load i32, i32* %2
%6 = add nsw i32 %5, 1
store i32 %6, i32* %2
%7 = load i32, i32* %3
%8 = add nsw i32 %7, 1
store i32 %8, i32* %3
%9 = load i32, i32* %3
%10 = load i32, i32* %2
%11 = add nsw i32 %10, %9
store i32 %11, i32* %2
%12 = load i32, i32* %2
%13 = load i32, i32* %3
%14 = add nsw i32 %13, %12
store i32 %14, i32* %3
%15 = load i32, i32* %2
%16 = icmp sge i32 %15, 10
br i1 %16, label %20, label %17
17: ; preds = %4
%18 = load i32, i32* %3
%19 = icmp sge i32 %18, 10
br i1 %19, label %20, label %21
20: ; preds = %17, %4
br label %22
21: ; preds = %17
br label %4
22: ; preds = %20
%23 = load i32, i32* %3
%24 = icmp sge i32 %23, 10
%25 = zext i1 %24 to i32
%26 = call i32 @assert(i32 %25)
%27 = load i32, i32* %1
ret i32 %27
}

LLVM IR (-O2):
define i32 @main() {
br label %1
1: ; preds = %1, %0
%2 = phi i32 [ 0, %0 ], [ %6, %1 ]
%3 = phi i32 [ 0, %0 ], [ %7, %1 ]
%4 = add nsw i32 %2, 1
%5 = add nsw i32 %3, 1
%6 = add nsw i32 %4, %5
%7 = add nsw i32 %6, %5
%8 = icmp sgt i32 %6, 9
%9 = icmp sgt i32 %7, 9
%10 = select i1 %8, i1 true, i1 %9
br i1 %10, label %11, label %1
11: ; preds = %1
%12 = zext i1 %9 to i32
%13 = tail call i32 @assert(i32 %12)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *, int);
void printword(const char *str, int n) { printf("%s\t%d\n", str, n); }


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

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

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

LLVM IR (-O2):
@.str = [7 x i8] c"%s\09%d\0A\00"
define void @printword(i8* %0, i32 %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %1)
ret void
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_1__;

/* Type definitions */
struct TYPE_4__ {
  struct TYPE_4__ *fts_statp;
};
typedef TYPE_1__ FTSENT;

/* Variables and functions */
int /*<<< orphan*/ free(TYPE_1__ *);
void fts_free(FTSENT *p) {
  if (p->fts_statp)
    free(p->fts_statp);
  free(p);
}


x86 assembly (clang, -O0):
<fts_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpq   $0x0,(%rax)
je     1136 <fts_free+0x26>
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
call   1030 <free@plt>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fts_free>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%rdi
test   %rdi,%rdi
je     1121 <fts_free+0x11>
call   1030 <free@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

LLVM IR (-O0):
%struct.TYPE_4__ = type { %struct.TYPE_4__* }
define void @fts_free(%struct.TYPE_4__* %0) {
%2 = alloca %struct.TYPE_4__*
store %struct.TYPE_4__* %0, %struct.TYPE_4__** %2
%3 = load %struct.TYPE_4__*, %struct.TYPE_4__** %2
%4 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %3, i32 0, i32 0
%5 = load %struct.TYPE_4__*, %struct.TYPE_4__** %4
%6 = icmp ne %struct.TYPE_4__* %5, null
br i1 %6, label %7, label %12
7: ; preds = %1
%8 = load %struct.TYPE_4__*, %struct.TYPE_4__** %2
%9 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %8, i32 0, i32 0
%10 = load %struct.TYPE_4__*, %struct.TYPE_4__** %9
%11 = call i32 @free(%struct.TYPE_4__* %10)
br label %12
12: ; preds = %7, %1
%13 = load %struct.TYPE_4__*, %struct.TYPE_4__** %2
%14 = call i32 @free(%struct.TYPE_4__* %13)
ret void
}

LLVM IR (-O2):
%struct.TYPE_4__ = type { %struct.TYPE_4__* }
define void @fts_free(%struct.TYPE_4__* nocapture %0) {
%2 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %0, i64 0, i32 0
%3 = load %struct.TYPE_4__*, %struct.TYPE_4__** %2
%4 = icmp eq %struct.TYPE_4__* %3, null
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = tail call i32 @free(%struct.TYPE_4__* %3)
br label %7
7: ; preds = %5, %1
%8 = tail call i32 @free(%struct.TYPE_4__* %0)
ret void
}
/* Variables and functions */
int omp_get_thread_num();
int /*<<< orphan*/ printf(char *, int);
int main() {
#pragma omp parallel
  {
    int id = omp_get_thread_num();
    printf("Hello (%d)", id);
    printf(" World (%d)\n", id);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <omp_get_thread_num@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xec4(%rip),%rdi
call   1040 <printf@plt>
mov    -0x4(%rbp),%esi
lea    0xec0(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1030 <omp_get_thread_num@plt>
mov    %eax,%ebx
lea    0xecf(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
lea    0xecc(%rip),%rdi
mov    %ebx,%esi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [11 x i8] c"Hello (%d)\00"
@.str.1 = [13 x i8] c" World (%d)\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @omp_get_thread_num()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Type definitions */
struct conn_info_st {
  int dummy;
};

/* Variables and functions */
int fw_open(char const *, struct conn_info_st *);
int fw_site(const char *args, struct conn_info_st *conn_info) {
  return fw_open(args, conn_info);
}


x86 assembly (clang, -O0):
<fw_site>:
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 <fw_open@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fw_site>:
jmp    1030 <fw_open@plt>

LLVM IR (-O0):
%struct.conn_info_st = type { i32 }
define i32 @fw_site(i8* %0, %struct.conn_info_st* %1) {
%3 = alloca i8*
%4 = alloca %struct.conn_info_st*
store i8* %0, i8** %3
store %struct.conn_info_st* %1, %struct.conn_info_st** %4
%5 = load i8*, i8** %3
%6 = load %struct.conn_info_st*, %struct.conn_info_st** %4
%7 = call i32 @fw_open(i8* %5, %struct.conn_info_st* %6)
ret i32 %7
}

LLVM IR (-O2):
%struct.conn_info_st = type { i32 }
define i32 @fw_site(i8* %0, %struct.conn_info_st* %1) {
%3 = tail call i32 @fw_open(i8* %0, %struct.conn_info_st* %1)
ret i32 %3
}
/* Variables and functions */
size_t getIndex(const size_t x, const size_t y, const size_t n) {
  size_t k = (n * (n - 1) / 2) - ((n - x) * (n - x - 1) / 2) + y - x - 1;
  return k;
}


x86 assembly (clang, -O0):
<getIndex>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    -0x18(%rbp),%rcx
sub    $0x1,%rcx
imul   %rcx,%rax
shr    $0x1,%rax
mov    -0x18(%rbp),%rcx
sub    -0x8(%rbp),%rcx
mov    -0x18(%rbp),%rdx
sub    -0x8(%rbp),%rdx
sub    $0x1,%rdx
imul   %rdx,%rcx
shr    $0x1,%rcx
sub    %rcx,%rax
add    -0x10(%rbp),%rax
sub    -0x8(%rbp),%rax
sub    $0x1,%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getIndex>:
lea    -0x1(%rdx),%rcx
imul   %rdx,%rcx
shr    %rcx
sub    %rdi,%rdx
lea    -0x1(%rdx),%rax
imul   %rdx,%rax
shr    %rax
add    %rsi,%rcx
add    %rdi,%rax
not    %rax
add    %rcx,%rax
ret

LLVM IR (-O0):
define i64 @getIndex(i64 %0, i64 %1, i64 %2) {
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
%7 = alloca i64
store i64 %0, i64* %4
store i64 %1, i64* %5
store i64 %2, i64* %6
%8 = load i64, i64* %6
%9 = load i64, i64* %6
%10 = sub i64 %9, 1
%11 = mul i64 %8, %10
%12 = udiv i64 %11, 2
%13 = load i64, i64* %6
%14 = load i64, i64* %4
%15 = sub i64 %13, %14
%16 = load i64, i64* %6
%17 = load i64, i64* %4
%18 = sub i64 %16, %17
%19 = sub i64 %18, 1
%20 = mul i64 %15, %19
%21 = udiv i64 %20, 2
%22 = sub i64 %12, %21
%23 = load i64, i64* %5
%24 = add i64 %22, %23
%25 = load i64, i64* %4
%26 = sub i64 %24, %25
%27 = sub i64 %26, 1
store i64 %27, i64* %7
%28 = load i64, i64* %7
ret i64 %28
}

LLVM IR (-O2):
define i64 @getIndex(i64 %0, i64 %1, i64 %2) {
%4 = add i64 %2, -1
%5 = mul i64 %4, %2
%6 = lshr i64 %5, 1
%7 = sub i64 %2, %0
%8 = add i64 %7, -1
%9 = mul i64 %8, %7
%10 = lshr i64 %9, 1
%11 = add i64 %6, %1
%12 = add i64 %10, %0
%13 = xor i64 %12, -1
%14 = add i64 %11, %13
ret i64 %14
}
unsigned lower_4bytes(unsigned d) { return d | 0x20202020; }


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

x86 assembly (clang, -O2):
<lower_4bytes>:
mov    %edi,%eax
or     $0x20202020,%eax
ret

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

LLVM IR (-O2):
define i32 @lower_4bytes(i32 %0) {
%2 = or i32 %0, 538976288
ret i32 %2
}
int test_imm_C5uint64_midword_mem(unsigned long long *val) {
  return ((*val >> 16) & (0xC5 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_C5uint64_midword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 12910592
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ a_fetch_and(int volatile *, int);
void a_and(volatile int *p, int v) { a_fetch_and(p, v); }


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

x86 assembly (clang, -O2):
<a_and>:
jmp    1030 <a_fetch_and@plt>

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

LLVM IR (-O2):
define void @a_and(i32* %0, i32 %1) {
%3 = tail call i32 @a_fetch_and(i32* %0, i32 %1)
ret void
}
/* Variables and functions */
const float *vertex3f(const float *buffer, size_t index) {
  return buffer + (3u * index);
}


x86 assembly (clang, -O0):
<vertex3f>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
imul   $0x3,-0x10(%rbp),%rcx
shl    $0x2,%rcx
add    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<vertex3f>:
lea    (%rsi,%rsi,2),%rax
lea    (%rdi,%rax,4),%rax
ret

LLVM IR (-O0):
define float* @vertex3f(float* %0, i64 %1) {
%3 = alloca float*
%4 = alloca i64
store float* %0, float** %3
store i64 %1, i64* %4
%5 = load float*, float** %3
%6 = load i64, i64* %4
%7 = mul i64 3, %6
%8 = getelementptr inbounds float, float* %5, i64 %7
ret float* %8
}

LLVM IR (-O2):
define float* @vertex3f(float* readnone %0, i64 %1) {
%3 = mul i64 %1, 3
%4 = getelementptr inbounds float, float* %0, i64 %3
ret float* %4
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
int isqrt(int);
void t_sqrt_107() {
  Assert_real((isqrt(107) == 10),
              "/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/stdlib/isqrt.c",
              540, ("Integer square root of 107 should be 10"));
}


x86 assembly (clang, -O0):
<t_sqrt_107>:
push   %rbp
mov    %rsp,%rbp
mov    $0x6b,%edi
call   1030 <isqrt@plt>
cmp    $0xa,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xec0(%rip),%rsi
mov    $0x21c,%edx
lea    0xf56(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_sqrt_107>:
push   %rax
mov    $0x6b,%edi
call   1030 <isqrt@plt>
xor    %edi,%edi
cmp    $0xa,%eax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf60(%rip),%rcx
mov    $0x21c,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [162 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/stdlib/isqrt.c\00"
@.str.1 = [40 x i8] c"Integer square root of 107 should be 10\00"
define void @t_sqrt_107() {
%1 = call i32 @isqrt(i32 107)
%2 = icmp eq i32 %1, 10
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str, i64 0, i64 0), i32 540, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [162 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/stdlib/isqrt.c\00"
@.str.1 = [40 x i8] c"Integer square root of 107 should be 10\00"
define void @t_sqrt_107() {
%1 = tail call i32 @isqrt(i32 107)
%2 = icmp eq i32 %1, 10
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str, i64 0, i64 0), i32 540, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ pclog(char *);
void iso_stop(void) {
  pclog("iso_stop stub\n");
  return;
}


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

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

LLVM IR (-O0):
@.str = [15 x i8] c"iso_stop stub\0A\00"
define void @iso_stop() {
%1 = call i32 @pclog(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"iso_stop stub\0A\00"
define void @iso_stop() {
%1 = tail call i32 @pclog(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ cnd_t;

/* Variables and functions */
int cond_signal(int /*<<< orphan*/ *);
int cnd_signal(cnd_t *cond) { return cond_signal(cond); }


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

x86 assembly (clang, -O2):
<cnd_signal>:
jmp    1030 <cond_signal@plt>

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

LLVM IR (-O2):
define i32 @cnd_signal(i32* %0) {
%2 = tail call i32 @cond_signal(i32* %0)
ret i32 %2
}
const char *mpfr_get_version(void) { return "MPFR NOT AVAILABLE"; }


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

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

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

LLVM IR (-O2):
@.str = [19 x i8] c"MPFR NOT AVAILABLE\00"
define i8* @mpfr_get_version() {
ret i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0)
}
main() {
  void *p = &&x;
rejmp:
  goto *p;
x:
  p = &&y;
  goto rejmp;
y:
  return 3;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
lea    0x11(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    113a <main+0x3a>
lea    0x9(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    1116 <main+0x16>
mov    $0x3,%eax
pop    %rbp
ret
mov    -0x18(%rbp),%rax
jmp    *%rax

x86 assembly (clang, -O2):
<main>:
lea    0x9(%rip),%rax
jmp    *%rax
nopl   0x0(%rax)
lea    0x2(%rip),%rax
jmp    *%rax
mov    $0x3,%eax
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
store i32 0, i32* %1
store i8* blockaddress(@main, %5), i8** %2
br label %3
3: ; preds = %5, %0
%4 = load i8*, i8** %2
br label %7
5: ; preds = %7
store i8* blockaddress(@main, %6), i8** %2
br label %3
6: ; preds = %7
ret i32 3
7: ; preds = %3
%8 = phi i8* [ %4, %3 ]
indirectbr i8* %8, [label %5, label %6]
}

LLVM IR (-O2):
define i32 @main() {
br label %1
1: ; preds = %1, %0
%2 = phi i8* [ blockaddress(@main, %1), %0 ], [ blockaddress(@main, %3), %1 ]
indirectbr i8* %2, [label %1, label %3]
3: ; preds = %1
ret i32 3
}
/* Variables and functions */
int r_close(int);
int d_close(int fd) { return r_close(fd); }


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

x86 assembly (clang, -O2):
<d_close>:
jmp    1030 <r_close@plt>

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

LLVM IR (-O2):
define i32 @d_close(i32 %0) {
%2 = tail call i32 @r_close(i32 %0)
ret i32 %2
}
void gtk_check_menu_item_get_inconsistent() {}


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

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

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

LLVM IR (-O2):
define void @gtk_check_menu_item_get_inconsistent() {
ret void
}
double get_cpu_time(void) { return -1; }


x86 assembly (clang, -O0):
<get_cpu_time>:
push   %rbp
mov    %rsp,%rbp
movsd  0xef4(%rip),%xmm0
pop    %rbp
ret

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

LLVM IR (-O0):
define double @get_cpu_time() {
ret double -1.000000e+00
}

LLVM IR (-O2):
define double @get_cpu_time() {
ret double -1.000000e+00
}
void bitops_set(unsigned char *val, int bit) {
  int pos = bit >> 3;
  int idx = bit & 0x7;
  val[pos] |= (1 << idx);
}


x86 assembly (clang, -O0):
<bitops_set>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
sar    $0x3,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
and    $0x7,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%ecx
mov    $0x1,%esi
shl    %cl,%esi
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movzbl (%rax,%rcx,1),%edx
or     %esi,%edx
mov    %dl,(%rax,%rcx,1)
pop    %rbp
ret

x86 assembly (clang, -O2):
<bitops_set>:
mov    %esi,%ecx
mov    %esi,%eax
sar    $0x3,%eax
and    $0x7,%cl
mov    $0x1,%edx
shl    %cl,%edx
cltq
or     %dl,(%rdi,%rax,1)
ret

LLVM IR (-O0):
define void @bitops_set(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%7 = load i32, i32* %4
%8 = ashr i32 %7, 3
store i32 %8, i32* %5
%9 = load i32, i32* %4
%10 = and i32 %9, 7
store i32 %10, i32* %6
%11 = load i32, i32* %6
%12 = shl i32 1, %11
%13 = load i8*, i8** %3
%14 = load i32, i32* %5
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i8, i8* %13, i64 %15
%17 = load i8, i8* %16
%18 = zext i8 %17 to i32
%19 = or i32 %18, %12
%20 = trunc i32 %19 to i8
store i8 %20, i8* %16
ret void
}

LLVM IR (-O2):
define void @bitops_set(i8* nocapture %0, i32 %1) {
%3 = ashr i32 %1, 3
%4 = and i32 %1, 7
%5 = shl nuw nsw i32 1, %4
%6 = sext i32 %3 to i64
%7 = getelementptr inbounds i8, i8* %0, i64 %6
%8 = load i8, i8* %7
%9 = trunc i32 %5 to i8
%10 = or i8 %8, %9
store i8 %10, i8* %7
ret void
}
unsigned xrop3_245_0_1(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  stk2 = ~D;
  stk1 = T | stk2;
  return (stk1 & S) | (stk1 & (~T)) | (T & (~S) & D);
}


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

x86 assembly (clang, -O2):
<xrop3_245_0_1>:
mov    %edi,%eax
shl    $0x8,%eax
or     %edi,%eax
lea    0xff00(%rsi),%ecx
and    %eax,%ecx
not    %eax
and    %esi,%eax
mov    %esi,%edx
not    %edx
shl    $0x8,%edx
or     %ecx,%edx
or     %edx,%eax
ret

LLVM IR (-O0):
define i32 @xrop3_245_0_1(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
store i32 255, i32* %5
%10 = load i8, i8* %3
%11 = zext i8 %10 to i32
%12 = shl i32 %11, 8
%13 = load i8, i8* %3
%14 = zext i8 %13 to i32
%15 = or i32 %12, %14
store i32 %15, i32* %6
%16 = load i8, i8* %4
%17 = zext i8 %16 to i32
%18 = shl i32 %17, 8
%19 = load i8, i8* %4
%20 = zext i8 %19 to i32
%21 = or i32 %18, %20
store i32 %21, i32* %7
%22 = load i32, i32* %5
%23 = xor i32 %22, -1
store i32 %23, i32* %9
%24 = load i32, i32* %7
%25 = load i32, i32* %9
%26 = or i32 %24, %25
store i32 %26, i32* %8
%27 = load i32, i32* %8
%28 = load i32, i32* %6
%29 = and i32 %27, %28
%30 = load i32, i32* %8
%31 = load i32, i32* %7
%32 = xor i32 %31, -1
%33 = and i32 %30, %32
%34 = or i32 %29, %33
%35 = load i32, i32* %7
%36 = load i32, i32* %6
%37 = xor i32 %36, -1
%38 = and i32 %35, %37
%39 = load i32, i32* %5
%40 = and i32 %38, %39
%41 = or i32 %34, %40
ret i32 %41
}

LLVM IR (-O2):
define i32 @xrop3_245_0_1(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = mul nuw nsw i32 %3, 257
%5 = zext i8 %1 to i32
%6 = or i32 %5, 65280
%7 = and i32 %6, %4
%8 = xor i32 %5, -1
%9 = shl nsw i32 %8, 8
%10 = or i32 %7, %9
%11 = xor i32 %4, -1
%12 = and i32 %11, %5
%13 = or i32 %10, %12
ret i32 %13
}
/* Type definitions */
struct wl_surface {
  int dummy;
};
struct wl_proxy {
  int dummy;
};
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int /*<<< orphan*/ wl_proxy_marshal(struct wl_proxy *, int, int /*<<< orphan*/);
void wl_surface_set_buffer_transform(struct wl_surface *wl_surface,
                                     int32_t transform) {
  wl_proxy_marshal((struct wl_proxy *)wl_surface, 7, transform);
}


x86 assembly (clang, -O0):
<wl_surface_set_buffer_transform>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
mov    $0x7,%esi
call   1030 <wl_proxy_marshal@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wl_surface_set_buffer_transform>:
mov    %esi,%edx
mov    $0x7,%esi
jmp    1030 <wl_proxy_marshal@plt>

LLVM IR (-O0):
%struct.wl_surface = type { i32 }
%struct.wl_proxy = type { i32 }
define void @wl_surface_set_buffer_transform(%struct.wl_surface* %0, i32 %1) {
%3 = alloca %struct.wl_surface*
%4 = alloca i32
store %struct.wl_surface* %0, %struct.wl_surface** %3
store i32 %1, i32* %4
%5 = load %struct.wl_surface*, %struct.wl_surface** %3
%6 = bitcast %struct.wl_surface* %5 to %struct.wl_proxy*
%7 = load i32, i32* %4
%8 = call i32 @wl_proxy_marshal(%struct.wl_proxy* %6, i32 7, i32 %7)
ret void
}

LLVM IR (-O2):
%struct.wl_surface = type { i32 }
%struct.wl_proxy = type { i32 }
define void @wl_surface_set_buffer_transform(%struct.wl_surface* %0, i32 %1) {
%3 = bitcast %struct.wl_surface* %0 to %struct.wl_proxy*
%4 = tail call i32 @wl_proxy_marshal(%struct.wl_proxy* %3, i32 7, i32 %1)
ret void
}
char *name(void) { return "TinyLight"; }


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

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

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

LLVM IR (-O2):
@.str = [10 x i8] c"TinyLight\00"
define i8* @name() {
ret i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
void *allocate_something_helper2();
void *allocate_something_helper1(void) { return allocate_something_helper2(); }


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

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

LLVM IR (-O0):
define i8* @allocate_something_helper1() {
%1 = call i8* (...) @allocate_something_helper2()
ret i8* %1
}

LLVM IR (-O2):
define i8* @allocate_something_helper1() {
%1 = tail call i8* (...) @allocate_something_helper2()
ret i8* %1
}
/* Variables and functions */
int /*<<< orphan*/ PutBit(int /*<<< orphan*/);
void FlushBitBuffer(void) {
  int i;
  for (i = 0; i < 7; i++)
    PutBit(0);
}


x86 assembly (clang, -O0):
<FlushBitBuffer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
cmpl   $0x7,-0x4(%rbp)
jge    113e <FlushBitBuffer+0x2e>
xor    %edi,%edi
call   1030 <PutBit@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    111f <FlushBitBuffer+0xf>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<FlushBitBuffer>:
push   %rax
xor    %edi,%edi
call   1030 <PutBit@plt>
xor    %edi,%edi
call   1030 <PutBit@plt>
xor    %edi,%edi
call   1030 <PutBit@plt>
xor    %edi,%edi
call   1030 <PutBit@plt>
xor    %edi,%edi
call   1030 <PutBit@plt>
xor    %edi,%edi
call   1030 <PutBit@plt>
xor    %edi,%edi
pop    %rax
jmp    1030 <PutBit@plt>

LLVM IR (-O0):
define void @FlushBitBuffer() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %7, %0
%3 = load i32, i32* %1
%4 = icmp slt i32 %3, 7
br i1 %4, label %5, label %10
5: ; preds = %2
%6 = call i32 @PutBit(i32 0)
br label %7
7: ; preds = %5
%8 = load i32, i32* %1
%9 = add nsw i32 %8, 1
store i32 %9, i32* %1
br label %2
10: ; preds = %2
ret void
}

LLVM IR (-O2):
define void @FlushBitBuffer() {
%1 = tail call i32 @PutBit(i32 0)
%2 = tail call i32 @PutBit(i32 0)
%3 = tail call i32 @PutBit(i32 0)
%4 = tail call i32 @PutBit(i32 0)
%5 = tail call i32 @PutBit(i32 0)
%6 = tail call i32 @PutBit(i32 0)
%7 = tail call i32 @PutBit(i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ print_menu();
int main() {
  print_menu();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <print_menu@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <print_menu@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @print_menu()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, char *);
void main() {
  char str[80];
  int i = 0;
  printf("Enter the text:\n");
  scanf("%s", str);
  printf("the string is: %s", str);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movl   $0x0,-0x54(%rbp)
lea    0xeca(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x50(%rbp),%rsi
lea    0xed8(%rip),%rdi
call   1040 <scanf@plt>
lea    -0x50(%rbp),%rsi
lea    0xeb9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x50,%rsp
lea    0xed6(%rip),%rdi
call   1030 <puts@plt>
lea    0xec7(%rip),%rdi
mov    %rsp,%rbx
mov    %rbx,%rsi
call   1050 <scanf@plt>
lea    0xea6(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x50,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [17 x i8] c"Enter the text:\0A\00"
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [18 x i8] c"the string is: %s\00"
define void @main() {
%1 = alloca [80 x i8]
%2 = alloca i32
store i32 0, i32* %2
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%4 = getelementptr inbounds [80 x i8], [80 x i8]* %1, i64 0, i64 0
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %4)
%6 = getelementptr inbounds [80 x i8], [80 x i8]* %1, i64 0, i64 0
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0), i8* %6)
ret void
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [18 x i8] c"the string is: %s\00"
@str = [16 x i8] c"Enter the text:\00"
define void @main() {
%1 = alloca [80 x i8]
%2 = getelementptr inbounds [80 x i8], [80 x i8]* %1, i64 0, i64 0
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %2)
%5 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0), i8* %2)
ret void
}
float sqf(float x) { return x * x; }


x86 assembly (clang, -O0):
<sqf>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
mulss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<sqf>:
mulss  %xmm0,%xmm0
ret

LLVM IR (-O0):
define float @sqf(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = load float, float* %2
%5 = fmul float %3, %4
ret float %5
}

LLVM IR (-O2):
define float @sqf(float %0) {
%2 = fmul float %0, %0
ret float %2
}
/* Variables and functions */
scalar_t__ do_need_sigen_inc(int, int);
int need_sigen_inc(int old, int new) {
  return (do_need_sigen_inc(old, new) || do_need_sigen_inc(new, old));
}


x86 assembly (clang, -O0):
<need_sigen_inc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <do_need_sigen_inc@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x9(%rbp)
jne    1150 <need_sigen_inc+0x40>
mov    -0x8(%rbp),%edi
mov    -0x4(%rbp),%esi
call   1030 <do_need_sigen_inc@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<need_sigen_inc>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %edi,%ebx
call   1030 <do_need_sigen_inc@plt>
mov    %rax,%rcx
mov    $0x1,%eax
test   %rcx,%rcx
jne    113d <need_sigen_inc+0x2d>
mov    %ebp,%edi
mov    %ebx,%esi
call   1030 <do_need_sigen_inc@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @need_sigen_inc(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = call i64 @do_need_sigen_inc(i32 %5, i32 %6)
%8 = icmp ne i64 %7, 0
br i1 %8, label %14, label %9
9: ; preds = %2
%10 = load i32, i32* %4
%11 = load i32, i32* %3
%12 = call i64 @do_need_sigen_inc(i32 %10, i32 %11)
%13 = icmp ne i64 %12, 0
br label %14
14: ; preds = %9, %2
%15 = phi i1 [ true, %2 ], [ %13, %9 ]
%16 = zext i1 %15 to i32
ret i32 %16
}

LLVM IR (-O2):
define i32 @need_sigen_inc(i32 %0, i32 %1) {
%3 = tail call i64 @do_need_sigen_inc(i32 %0, i32 %1)
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %9
5: ; preds = %2
%6 = tail call i64 @do_need_sigen_inc(i32 %1, i32 %0)
%7 = icmp ne i64 %6, 0
%8 = zext i1 %7 to i32
br label %9
9: ; preds = %5, %2
%10 = phi i32 [ 1, %2 ], [ %8, %5 ]
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ script_config_read(void *);
int script_config_cb(void *data, const char *option, const char *value) {
  (void)option;
  (void)value;
  script_config_read(data);
  return 0;
}


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

x86 assembly (clang, -O2):
<script_config_cb>:
push   %rax
call   1030 <script_config_read@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @script_config_cb(i8* %0, i8* nocapture readnone %1, i8* nocapture readnone %2) {
%4 = tail call i32 @script_config_read(i8* %0)
ret i32 0
}
void port_lock(void) { asm volatile("cli" : : : "memory"); }


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

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

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

LLVM IR (-O2):
define void @port_lock() {
tail call void asm sideeffect "cli", "~{memory},~{dirflag},~{fpsr},~{flags}"()
ret void
}