xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ FUTEX_WAKE;
int /*<<< orphan*/ FUTEX_WAKE_PRIVATE;
int __futex(void volatile *, int /*<<< orphan*/, int, int /*<<< orphan*/ *);
int __futex_wake_ex(volatile void *ftx, bool shared, int count) {
  return __futex(ftx, shared ? FUTEX_WAKE : FUTEX_WAKE_PRIVATE, count, NULL);
}


x86 assembly (clang, -O0):
<__futex_wake_ex>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     1145 <__futex_wake_ex+0x35>
mov    0x2e95(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x1c(%rbp)
jmp    1151 <__futex_wake_ex+0x41>
mov    0x2e9c(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x1c(%rbp),%esi
mov    -0x10(%rbp),%edx
xor    %eax,%eax
mov    %eax,%ecx
call   1030 <__futex@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__futex_wake_ex>:
test   %esi,%esi
jne    111d <__futex_wake_ex+0xd>
mov    0x2ecd(%rip),%rax
jmp    1124 <__futex_wake_ex+0x14>
mov    0x2eac(%rip),%rax
mov    (%rax),%esi
xor    %ecx,%ecx
jmp    1030 <__futex@plt>

LLVM IR (-O0):
@FUTEX_WAKE = global i32 0
@FUTEX_WAKE_PRIVATE = global i32 0
define i32 @__futex_wake_ex(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i8*, i8** %4
%8 = load i32, i32* %5
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %12
10: ; preds = %3
%11 = load i32, i32* @FUTEX_WAKE
br label %14
12: ; preds = %3
%13 = load i32, i32* @FUTEX_WAKE_PRIVATE
br label %14
14: ; preds = %12, %10
%15 = phi i32 [ %11, %10 ], [ %13, %12 ]
%16 = load i32, i32* %6
%17 = call i32 @__futex(i8* %7, i32 %15, i32 %16, i32* null)
ret i32 %17
}

LLVM IR (-O2):
@FUTEX_WAKE = global i32 0
@FUTEX_WAKE_PRIVATE = global i32 0
define i32 @__futex_wake_ex(i8* %0, i32 %1, i32 %2) {
%4 = icmp eq i32 %1, 0
%5 = load i32, i32* @FUTEX_WAKE
%6 = load i32, i32* @FUTEX_WAKE_PRIVATE
%7 = select i1 %4, i32 %6, i32 %5
%8 = tail call i32 @__futex(i8* %0, i32 %7, i32 %2, i32* null)
ret i32 %8
}
/* Variables and functions */
bool bor(bool a, bool b) { return a || b; }


x86 assembly (clang, -O0):
<bor>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0x1,%al
cmpl   $0x0,-0x4(%rbp)
mov    %al,-0x9(%rbp)
jne    1123 <bor+0x23>
cmpl   $0x0,-0x8(%rbp)
setne  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bor>:
xor    %eax,%eax
or     %esi,%edi
setne  %al
ret

LLVM IR (-O0):
define i32 @bor(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 = icmp ne i32 %5, 0
br i1 %6, label %10, label %7
7: ; preds = %2
%8 = load i32, i32* %4
%9 = icmp ne i32 %8, 0
br label %10
10: ; preds = %7, %2
%11 = phi i1 [ true, %2 ], [ %9, %7 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @bor(i32 %0, i32 %1) {
%3 = or i32 %1, %0
%4 = icmp ne i32 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, char **);
int main() {
  char s[100];
  scanf("%[^\n]%*c", &s);
  printf("Hello, World!\n");
  printf("%s\n", s);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x70(%rbp),%rsi
lea    0xec6(%rip),%rdi
call   1040 <scanf@plt>
lea    0xec3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x70(%rbp),%rsi
lea    0xec0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [9 x i8] c"%[^\0A]%*c\00"
@.str.1 = [15 x i8] c"Hello, World!\0A\00"
@.str.2 = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [100 x i8]
store i32 0, i32* %1
%3 = bitcast [100 x i8]* %2 to i8**
%4 = call i32 @scanf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8** %3)
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
%6 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [9 x i8] c"%[^\0A]%*c\00"
@str = [14 x i8] c"Hello, World!\00"
define i32 @main() {
%1 = alloca [100 x i8]
%2 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%3 = bitcast [100 x i8]* %1 to i8**
%4 = call i32 @scanf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8** %3)
%5 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
%6 = call i32 @puts(i8* %2)
ret i32 0
}
void ff_hevc_put_hevc_epel_hv32_10_avx2() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_epel_hv32_10_avx2() {
ret void
}
/* Variables and functions */
int g(int);
int f(int x) {
  x = g(1);
  if (x > 0) {
    x = g(2);
  }
  x = x + 1;
  return x;
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x1,%edi
call   1030 <g@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jle    113f <f+0x2f>
mov    $0x2,%edi
call   1030 <g@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
push   %rax
mov    $0x1,%edi
call   1030 <g@plt>
test   %eax,%eax
jle    1129 <f+0x19>
mov    $0x2,%edi
call   1030 <g@plt>
add    $0x1,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @f(i32 %0) {
%2 = tail call i32 @g(i32 1)
%3 = icmp sgt i32 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @g(i32 2)
br label %6
6: ; preds = %4, %1
%7 = phi i32 [ %5, %4 ], [ %2, %1 ]
%8 = add nsw i32 %7, 1
ret i32 %8
}
void CANIntDisable(unsigned long ulBase, unsigned long ulIntFlags) {
  ;

  ;
  (*((volatile unsigned long *)(ulBase + 0x00000000))) =
      (*((volatile unsigned long *)(ulBase + 0x00000000))) & ~(ulIntFlags);
}


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

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

LLVM IR (-O0):
define void @CANIntDisable(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = add i64 %5, 0
%7 = inttoptr i64 %6 to i64*
%8 = load volatile i64, i64* %7
%9 = load i64, i64* %4
%10 = xor i64 %9, -1
%11 = and i64 %8, %10
%12 = load i64, i64* %3
%13 = add i64 %12, 0
%14 = inttoptr i64 %13 to i64*
store volatile i64 %11, i64* %14
ret void
}

LLVM IR (-O2):
define void @CANIntDisable(i64 %0, i64 %1) {
%3 = inttoptr i64 %0 to i64*
%4 = load volatile i64, i64* %3
%5 = xor i64 %1, -1
%6 = and i64 %4, %5
store volatile i64 %6, i64* %3
ret void
}
int highest_of_u64(unsigned long long int arg1, unsigned long long int arg2) {
  if (arg1 >= arg2)
    return arg1;
  else
    return arg2;
}


x86 assembly (clang, -O0):
<highest_of_u64>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
jb     1126 <highest_of_u64+0x26>
mov    -0x10(%rbp),%rax
mov    %eax,-0x4(%rbp)
jmp    112d <highest_of_u64+0x2d>
mov    -0x18(%rbp),%rax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<highest_of_u64>:
mov    %rdi,%rax
cmp    %rsi,%rdi
cmovb  %esi,%eax
ret

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

LLVM IR (-O2):
define i32 @highest_of_u64(i64 %0, i64 %1) {
%3 = icmp ult i64 %0, %1
%4 = select i1 %3, i64 %1, i64 %0
%5 = trunc i64 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ errno;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printErr(char *);
int /*<<< orphan*/ sprintf(char *, char *, char const *, char *);
char *strerror(int /*<<< orphan*/);
void fatalSys(char const *str) {
  char buf[1024];
  sprintf(buf, "%.256s: %.256s", str, strerror(errno));
  printErr(buf);
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<fatalSys>:
push   %rbp
mov    %rsp,%rbp
sub    $0x420,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x410(%rbp),%rax
mov    %rax,-0x420(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x418(%rbp)
mov    0x2e71(%rip),%rax
mov    (%rax),%edi
call   1060 <strerror@plt>
mov    -0x420(%rbp),%rdi
mov    -0x418(%rbp),%rdx
mov    %rax,%rcx
lea    0xe72(%rip),%rsi
call   1040 <sprintf@plt>
lea    -0x410(%rbp),%rdi
call   1030 <printErr@plt>
mov    0x2e32(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<fatalSys>:
push   %r14
push   %rbx
sub    $0x408,%rsp
mov    %rdi,%rbx
mov    0x2e8c(%rip),%rax
mov    (%rax),%edi
call   1060 <strerror@plt>
lea    0xe9e(%rip),%rsi
mov    %rsp,%r14
mov    %r14,%rdi
mov    %rbx,%rdx
mov    %rax,%rcx
call   1040 <sprintf@plt>
mov    %r14,%rdi
call   1030 <printErr@plt>
mov    0x2e56(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"%.256s: %.256s\00"
@errno = global i32 0
@EXIT_FAILURE = global i32 0
define void @fatalSys(i8* %0) {
%2 = alloca i8*
%3 = alloca [1024 x i8]
store i8* %0, i8** %2
%4 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 0
%5 = load i8*, i8** %2
%6 = load i32, i32* @errno
%7 = call i8* @strerror(i32 %6)
%8 = call i32 @sprintf(i8* %4, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %5, i8* %7)
%9 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 0
%10 = call i32 @printErr(i8* %9)
%11 = load i32, i32* @EXIT_FAILURE
%12 = call i32 @exit(i32 %11)
unreachable
}

LLVM IR (-O2):
@.str = [15 x i8] c"%.256s: %.256s\00"
@errno = global i32 0
@EXIT_FAILURE = global i32 0
define void @fatalSys(i8* %0) {
%2 = alloca [1024 x i8]
%3 = getelementptr inbounds [1024 x i8], [1024 x i8]* %2, i64 0, i64 0
%4 = load i32, i32* @errno
%5 = tail call i8* @strerror(i32 %4)
%6 = call i32 @sprintf(i8* %3, i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %5)
%7 = call i32 @printErr(i8* %3)
%8 = load i32, i32* @EXIT_FAILURE
%9 = call i32 @exit(i32 %8)
unreachable
}
/* Type definitions */
struct window {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ ptr_array_add(void *, struct window *);
void collect_window(struct window *w, void *data) { ptr_array_add(data, w); }


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

x86 assembly (clang, -O2):
<collect_window>:
mov    %rdi,%rax
mov    %rsi,%rdi
mov    %rax,%rsi
jmp    1030 <ptr_array_add@plt>

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

LLVM IR (-O2):
%struct.window = type { i32 }
define void @collect_window(%struct.window* %0, i8* %1) {
%3 = tail call i32 @ptr_array_add(i8* %1, %struct.window* %0)
ret void
}
/* Type definitions */
typedef int uint8_t;
typedef int uint32_t;

/* Variables and functions */
void libcperciva_be32enc(void *pp, uint32_t x) {
  uint8_t *p = (uint8_t *)pp;
  p[3] = x & 0xff;
  p[2] = (x >> 8) & 0xff;
  p[1] = (x >> 16) & 0xff;
  p[0] = (x >> 24) & 0xff;
}


x86 assembly (clang, -O0):
<libcperciva_be32enc>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%ecx
and    $0xff,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,0xc(%rax)
mov    -0xc(%rbp),%ecx
sar    $0x8,%ecx
and    $0xff,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,0x8(%rax)
mov    -0xc(%rbp),%ecx
sar    $0x10,%ecx
and    $0xff,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,0x4(%rax)
mov    -0xc(%rbp),%ecx
sar    $0x18,%ecx
and    $0xff,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<libcperciva_be32enc>:
mov    %esi,%eax
movzbl %al,%ecx
mov    %ecx,0xc(%rdi)
movzbl %ah,%ecx
mov    %ecx,0x8(%rdi)
mov    %esi,%ecx
shr    $0x10,%ecx
movzbl %cl,%ecx
mov    %ecx,0x4(%rdi)
shr    $0x18,%eax
mov    %eax,(%rdi)
ret

LLVM IR (-O0):
define void @libcperciva_be32enc(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32*
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to i32*
store i32* %7, i32** %5
%8 = load i32, i32* %4
%9 = and i32 %8, 255
%10 = load i32*, i32** %5
%11 = getelementptr inbounds i32, i32* %10, i64 3
store i32 %9, i32* %11
%12 = load i32, i32* %4
%13 = ashr i32 %12, 8
%14 = and i32 %13, 255
%15 = load i32*, i32** %5
%16 = getelementptr inbounds i32, i32* %15, i64 2
store i32 %14, i32* %16
%17 = load i32, i32* %4
%18 = ashr i32 %17, 16
%19 = and i32 %18, 255
%20 = load i32*, i32** %5
%21 = getelementptr inbounds i32, i32* %20, i64 1
store i32 %19, i32* %21
%22 = load i32, i32* %4
%23 = ashr i32 %22, 24
%24 = and i32 %23, 255
%25 = load i32*, i32** %5
%26 = getelementptr inbounds i32, i32* %25, i64 0
store i32 %24, i32* %26
ret void
}

LLVM IR (-O2):
define void @libcperciva_be32enc(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
%4 = and i32 %1, 255
%5 = getelementptr inbounds i8, i8* %0, i64 12
%6 = bitcast i8* %5 to i32*
store i32 %4, i32* %6
%7 = lshr i32 %1, 8
%8 = and i32 %7, 255
%9 = getelementptr inbounds i8, i8* %0, i64 8
%10 = bitcast i8* %9 to i32*
store i32 %8, i32* %10
%11 = lshr i32 %1, 16
%12 = and i32 %11, 255
%13 = getelementptr inbounds i8, i8* %0, i64 4
%14 = bitcast i8* %13 to i32*
store i32 %12, i32* %14
%15 = lshr i32 %1, 24
store i32 %15, i32* %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ strlen(char *);
int /*<<< orphan*/ uiMessage(int, char *, char *);
int /*<<< orphan*/ write(int, char *, int /*<<< orphan*/);
void sckSend(int *sock, char *buff) {
  uiMessage(4, ">>> %s", buff);
  write(*sock, buff, strlen(buff));
}


x86 assembly (clang, -O0):
<sckSend>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdx
mov    $0x4,%edi
lea    0xeb0(%rip),%rsi
call   1050 <uiMessage@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x1c(%rbp),%edi
mov    -0x18(%rbp),%rsi
mov    %eax,%edx
call   1030 <write@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sckSend>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%rbx
mov    %rdi,%r14
lea    0xebf(%rip),%rsi
mov    $0x4,%edi
mov    %rbx,%rdx
call   1050 <uiMessage@plt>
mov    (%r14),%ebp
mov    %rbx,%rdi
call   1040 <strlen@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %eax,%edx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <write@plt>

LLVM IR (-O0):
@.str = [7 x i8] c">>> %s\00"
define void @sckSend(i32* %0, i8* %1) {
%3 = alloca i32*
%4 = alloca i8*
store i32* %0, i32** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = call i32 @uiMessage(i32 4, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %5)
%7 = load i32*, i32** %3
%8 = load i32, i32* %7
%9 = load i8*, i8** %4
%10 = load i8*, i8** %4
%11 = call i32 @strlen(i8* %10)
%12 = call i32 @write(i32 %8, i8* %9, i32 %11)
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c">>> %s\00"
define void @sckSend(i32* nocapture %0, i8* %1) {
%3 = tail call i32 @uiMessage(i32 4, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %1)
%4 = load i32, i32* %0
%5 = tail call i32 @strlen(i8* %1)
%6 = tail call i32 @write(i32 %4, i8* %1, i32 %5)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Copy_V1(char *, char const *, size_t);
__attribute__((flatten)) void *exegesis_memcpy(void *dst, const void *src,
                                               size_t count) {
  Copy_V1((char *)(dst), (const char *)(src), count);
  return dst;
}


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

x86 assembly (clang, -O2):
<exegesis_memcpy>:
push   %rbx
mov    %rdi,%rbx
call   1030 <Copy_V1@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @exegesis_memcpy(i8* returned %0, i8* %1, i64 %2) {
%4 = tail call i32 @Copy_V1(i8* %0, i8* %1, i64 %2)
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int svnCheckDB();
int /*<<< orphan*/ system(char *);
int main() {
  int i;
  i = svnCheckDB();
  if (i == 1)
    printf("e bine");
  else
    printf("nu e bine");
  system("pause");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1050 <svnCheckDB@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
jne    1164 <main+0x34>
lea    0xea9(%rip),%rdi
call   1040 <printf@plt>
jmp    1170 <main+0x40>
lea    0xe95(%rip),%rdi
call   1040 <printf@plt>
lea    0xe93(%rip),%rdi
call   1030 <system@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1050 <svnCheckDB@plt>
cmp    $0x1,%eax
lea    0xec1(%rip),%rax
lea    0xeb7(%rip),%rdi
cmove  %rax,%rdi
call   1040 <printf@plt>
lea    0xeb1(%rip),%rdi
call   1030 <system@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [7 x i8] c"e bine\00"
@.str.1 = [10 x i8] c"nu e bine\00"
@.str.2 = [6 x i8] c"pause\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 (...) @svnCheckDB()
store i32 %3, i32* %2
%4 = load i32, i32* %2
%5 = icmp eq i32 %4, 1
br i1 %5, label %6, label %8
6: ; preds = %0
%7 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
br label %10
8: ; preds = %0
%9 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
br label %10
10: ; preds = %8, %6
%11 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [7 x i8] c"e bine\00"
@.str.1 = [10 x i8] c"nu e bine\00"
@.str.2 = [6 x i8] c"pause\00"
define i32 @main() {
%1 = tail call i32 (...) @svnCheckDB()
%2 = icmp eq i32 %1, 1
%3 = select i1 %2, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0)
%4 = tail call i32 @printf(i8* dereferenceable(1) %3)
%5 = tail call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}
void object_desctructor(struct m_class_object_instance *p_this) {}


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

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

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

LLVM IR (-O2):
%struct.m_class_object_instance = type opaque
define void @object_desctructor(%struct.m_class_object_instance* nocapture %0) {
ret void
}
/* Variables and functions */
scalar_t__ ceil(int /*<<< orphan*/);
int /*<<< orphan*/ log2(double);
int CMUTIL_MemRcyIndex(size_t size) {
  int rval = (int)ceil(log2((double)size));
  return rval < 0 ? 0 : rval;
}


x86 assembly (clang, -O0):
<CMUTIL_MemRcyIndex>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movaps 0xecd(%rip),%xmm1
movq   -0x8(%rbp),%xmm0
punpckldq %xmm1,%xmm0
movapd 0xecc(%rip),%xmm1
subpd  %xmm1,%xmm0
movaps %xmm0,%xmm1
unpckhpd %xmm0,%xmm0
addsd  %xmm1,%xmm0
call   1030 <log2@plt>
mov    %eax,%edi
call   1040 <ceil@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jge    1176 <CMUTIL_MemRcyIndex+0x56>
xor    %eax,%eax
mov    %eax,-0x10(%rbp)
jmp    117c <CMUTIL_MemRcyIndex+0x5c>
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CMUTIL_MemRcyIndex>:
push   %rax
movq   %rdi,%xmm1
punpckldq 0xed2(%rip),%xmm1
subpd  0xeda(%rip),%xmm1
movapd %xmm1,%xmm0
unpckhpd %xmm1,%xmm0
addsd  %xmm1,%xmm0
call   1030 <log2@plt>
mov    %eax,%edi
call   1040 <ceil@plt>
xor    %ecx,%ecx
test   %eax,%eax
cmovs  %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @CMUTIL_MemRcyIndex(i64 %0) {
%2 = alloca i64
%3 = alloca i32
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = uitofp i64 %4 to double
%6 = call i32 @log2(double %5)
%7 = call i64 @ceil(i32 %6)
%8 = trunc i64 %7 to i32
store i32 %8, i32* %3
%9 = load i32, i32* %3
%10 = icmp slt i32 %9, 0
br i1 %10, label %11, label %12
11: ; preds = %1
br label %14
12: ; preds = %1
%13 = load i32, i32* %3
br label %14
14: ; preds = %12, %11
%15 = phi i32 [ 0, %11 ], [ %13, %12 ]
ret i32 %15
}

LLVM IR (-O2):
define i32 @CMUTIL_MemRcyIndex(i64 %0) {
%2 = uitofp i64 %0 to double
%3 = tail call i32 @log2(double %2)
%4 = tail call i64 @ceil(i32 %3)
%5 = trunc i64 %4 to i32
%6 = icmp sgt i32 %5, 0
%7 = select i1 %6, i32 %5, i32 0
ret i32 %7
}
int get_bit(int *n, int b) { return *n & (1 << b); }


x86 assembly (clang, -O0):
<get_bit>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    -0xc(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
and    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_bit>:
mov    %esi,%ecx
mov    $0x1,%eax
shl    %cl,%eax
and    (%rdi),%eax
ret

LLVM IR (-O0):
define i32 @get_bit(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* %5
%7 = load i32, i32* %4
%8 = shl i32 1, %7
%9 = and i32 %6, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @get_bit(i32* nocapture %0, i32 %1) {
%3 = load i32, i32* %0
%4 = shl nuw i32 1, %1
%5 = and i32 %3, %4
ret i32 %5
}
float average(float g1, float g2) {
  if (g2 == 0)
    return 0;
  else
    return g1 / g2;
}


x86 assembly (clang, -O0):
<average>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x8(%rbp)
movss  %xmm1,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jne    1132 <average+0x32>
jp     1132 <average+0x32>
xorps  %xmm0,%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    1141 <average+0x41>
movss  -0x8(%rbp),%xmm0
divss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<average>:
xorps  %xmm2,%xmm2
ucomiss %xmm2,%xmm1
jne    110e <average+0xe>
jp     110e <average+0xe>
movaps %xmm2,%xmm0
ret
divss  %xmm1,%xmm0
movaps %xmm0,%xmm2
movaps %xmm2,%xmm0
ret

LLVM IR (-O0):
define float @average(float %0, float %1) {
%3 = alloca float
%4 = alloca float
%5 = alloca float
store float %0, float* %4
store float %1, float* %5
%6 = load float, float* %5
%7 = fcmp oeq float %6, 0.000000e+00
br i1 %7, label %8, label %9
8: ; preds = %2
store float 0.000000e+00, float* %3
br label %13
9: ; preds = %2
%10 = load float, float* %4
%11 = load float, float* %5
%12 = fdiv float %10, %11
store float %12, float* %3
br label %13
13: ; preds = %9, %8
%14 = load float, float* %3
ret float %14
}

LLVM IR (-O2):
define float @average(float %0, float %1) {
%3 = fcmp oeq float %1, 0.000000e+00
%4 = fdiv float %0, %1
%5 = select i1 %3, float 0.000000e+00, float %4
ret float %5
}
/* Variables and functions */
int BIO_fd_non_fatal_error(int);
int errno;
int BIO_fd_should_retry(int i) {
  int err;
  if ((i == 0) || (i == -1)) {
    err = errno;
    return (BIO_fd_non_fatal_error(err));
  }
  return (0);
}


x86 assembly (clang, -O0):
<BIO_fd_should_retry>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     112f <BIO_fd_should_retry+0x1f>
cmpl   $0xffffffff,-0x8(%rbp)
jne    114b <BIO_fd_should_retry+0x3b>
mov    0x2eaa(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%edi
call   1030 <BIO_fd_non_fatal_error@plt>
mov    %eax,-0x4(%rbp)
jmp    1152 <BIO_fd_should_retry+0x42>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<BIO_fd_should_retry>:
add    $0x1,%edi
cmp    $0x1,%edi
ja     1126 <BIO_fd_should_retry+0x16>
mov    0x2ec1(%rip),%rax
mov    (%rax),%edi
jmp    1030 <BIO_fd_non_fatal_error@plt>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
@errno = global i32 0
define i32 @BIO_fd_should_retry(i32 %0) {
%2 = add i32 %0, 1
%3 = icmp ult i32 %2, 2
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = load i32, i32* @errno
%6 = tail call i32 @BIO_fd_non_fatal_error(i32 %5)
br label %7
7: ; preds = %1, %4
%8 = phi i32 [ %6, %4 ], [ 0, %1 ]
ret i32 %8
}
void set_fpu_underflow_mode(int gradual __attribute__((unused))) {}


x86 assembly (clang, -O0):
<set_fpu_underflow_mode>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @set_fpu_underflow_mode(i32 %0) {
ret void
}
int Selective_MaxFdsPlusOne(int a, int b) {
  if (a > b)
    return a + 1;
  else
    return b + 1;
}


x86 assembly (clang, -O0):
<Selective_MaxFdsPlusOne>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    1124 <Selective_MaxFdsPlusOne+0x24>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    112d <Selective_MaxFdsPlusOne+0x2d>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Selective_MaxFdsPlusOne>:
cmp    %esi,%edi
cmovg  %edi,%esi
lea    0x1(%rsi),%eax
ret

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

LLVM IR (-O2):
define i32 @Selective_MaxFdsPlusOne(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
%5 = add nsw i32 %4, 1
ret i32 %5
}
/* Variables and functions */
int INT_MAX;
int /*<<< orphan*/ printf(char *, int);
int main(void) { printf("Maximun int value on this system = %d \n", INT_MAX); }


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2ed0(%rip),%rax
mov    (%rax),%esi
lea    0xedf(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [40 x i8] c"Maximun int value on this system = %d \0A\00"
@INT_MAX = global i32 0
define i32 @main() {
%1 = load i32, i32* @INT_MAX
%2 = call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}

LLVM IR (-O2):
@.str = [40 x i8] c"Maximun int value on this system = %d \0A\00"
@INT_MAX = global i32 0
define i32 @main() {
%1 = load i32, i32* @INT_MAX
%2 = tail call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ sigset_t;

/* Variables and functions */
int /*<<< orphan*/ sigaddset(int /*<<< orphan*/ *, int);
void c_sigaddset_(sigset_t *set, int *sig, int dmy) { sigaddset(set, *sig); }


x86 assembly (clang, -O0):
<c_sigaddset_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    (%rax),%esi
call   1030 <sigaddset@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<c_sigaddset_>:
mov    (%rsi),%esi
jmp    1030 <sigaddset@plt>

LLVM IR (-O0):
define void @c_sigaddset_(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** %5
%9 = load i32, i32* %8
%10 = call i32 @sigaddset(i32* %7, i32 %9)
ret void
}

LLVM IR (-O2):
define void @c_sigaddset_(i32* %0, i32* nocapture %1, i32 %2) {
%4 = load i32, i32* %1
%5 = tail call i32 @sigaddset(i32* %0, i32 %4)
ret void
}
/* Type definitions */
typedef int uint32_t;
typedef int int32_t;

/* Variables and functions */
int __IUSAT(int, int const);
__attribute__((always_)) uint32_t __USAT16(uint32_t x, const uint32_t y) {
  int32_t r = 0, s = 0;
  r = __IUSAT(((x << 16) >> 16), y) & 0x0000FFFF;
  s = __IUSAT(((x) >> 16), y) & 0x0000FFFF;
  return ((s << 16) | (r));
}


x86 assembly (clang, -O0):
<__USAT16>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x4(%rbp),%edi
shl    $0x10,%edi
sar    $0x10,%edi
mov    -0x8(%rbp),%esi
call   1030 <__IUSAT@plt>
and    $0xffff,%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%edi
sar    $0x10,%edi
mov    -0x8(%rbp),%esi
call   1030 <__IUSAT@plt>
and    $0xffff,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
shl    $0x10,%eax
or     -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__USAT16>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%ebx
mov    %edi,%ebp
movswl %bp,%edi
call   1030 <__IUSAT@plt>
movzwl %ax,%r14d
sar    $0x10,%ebp
mov    %ebp,%edi
mov    %ebx,%esi
call   1030 <__IUSAT@plt>
shl    $0x10,%eax
or     %r14d,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @__USAT16(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
store i32 0, i32* %5
store i32 0, i32* %6
%7 = load i32, i32* %3
%8 = shl i32 %7, 16
%9 = ashr i32 %8, 16
%10 = load i32, i32* %4
%11 = call i32 @__IUSAT(i32 %9, i32 %10)
%12 = and i32 %11, 65535
store i32 %12, i32* %5
%13 = load i32, i32* %3
%14 = ashr i32 %13, 16
%15 = load i32, i32* %4
%16 = call i32 @__IUSAT(i32 %14, i32 %15)
%17 = and i32 %16, 65535
store i32 %17, i32* %6
%18 = load i32, i32* %6
%19 = shl i32 %18, 16
%20 = load i32, i32* %5
%21 = or i32 %19, %20
ret i32 %21
}

LLVM IR (-O2):
define i32 @__USAT16(i32 %0, i32 %1) {
%3 = shl i32 %0, 16
%4 = ashr exact i32 %3, 16
%5 = tail call i32 @__IUSAT(i32 %4, i32 %1)
%6 = and i32 %5, 65535
%7 = ashr i32 %0, 16
%8 = tail call i32 @__IUSAT(i32 %7, i32 %1)
%9 = shl i32 %8, 16
%10 = or i32 %9, %6
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ I2CM_I2CInit();
void I2CM_Init(void) { I2CM_I2CInit(); }


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

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

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

LLVM IR (-O2):
define void @I2CM_Init() {
%1 = tail call i32 (...) @I2CM_I2CInit()
ret void
}
void mremap_userfaultfd_complete(struct vm_userfaultfd_ctx *ctx,
                                 unsigned long from, unsigned long to,
                                 unsigned long len) {}


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

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

LLVM IR (-O0):
%struct.vm_userfaultfd_ctx = type opaque
define void @mremap_userfaultfd_complete(%struct.vm_userfaultfd_ctx* %0, i64 %1, i64 %2, i64 %3) {
%5 = alloca %struct.vm_userfaultfd_ctx*
%6 = alloca i64
%7 = alloca i64
%8 = alloca i64
store %struct.vm_userfaultfd_ctx* %0, %struct.vm_userfaultfd_ctx** %5
store i64 %1, i64* %6
store i64 %2, i64* %7
store i64 %3, i64* %8
ret void
}

LLVM IR (-O2):
%struct.vm_userfaultfd_ctx = type opaque
define void @mremap_userfaultfd_complete(%struct.vm_userfaultfd_ctx* nocapture %0, i64 %1, i64 %2, i64 %3) {
ret void
}
/* Type definitions */
struct element {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ systray_update();
void infobar_elem_systray_update(struct element *e) {
  (void)e;
  systray_update();
}


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

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

LLVM IR (-O0):
%struct.element = type { i32 }
define void @infobar_elem_systray_update(%struct.element* %0) {
%2 = alloca %struct.element*
store %struct.element* %0, %struct.element** %2
%3 = load %struct.element*, %struct.element** %2
%4 = call i32 (...) @systray_update()
ret void
}

LLVM IR (-O2):
%struct.element = type { i32 }
define void @infobar_elem_systray_update(%struct.element* nocapture readnone %0) {
%2 = tail call i32 (...) @systray_update()
ret void
}
void PS_NullPrintAfterLastPage(void) {}


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

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

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

LLVM IR (-O2):
define void @PS_NullPrintAfterLastPage() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _Error(long, char *);
void Error_BinarySyntaxMustStartWithExpression(long p_position) {
  _Error(p_position, "Binary operator syntax must start with an expression");
}


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

x86 assembly (clang, -O2):
<Error_BinarySyntaxMustStartWithExpression>:
lea    0xee9(%rip),%rsi
jmp    1030 <_Error@plt>

LLVM IR (-O0):
@.str = [53 x i8] c"Binary operator syntax must start with an expression\00"
define void @Error_BinarySyntaxMustStartWithExpression(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i32 @_Error(i64 %3, i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [53 x i8] c"Binary operator syntax must start with an expression\00"
define void @Error_BinarySyntaxMustStartWithExpression(i64 %0) {
%2 = tail call i32 @_Error(i64 %0, i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str, i64 0, i64 0))
ret void
}
void disable_interrupts() { __asm__ volatile("cli"); }


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

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

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

LLVM IR (-O2):
define void @disable_interrupts() {
tail call void asm sideeffect "cli", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ log_set_level_fp(int);
int /*<<< orphan*/ log_set_level_stderr(int);
void log_set_level(int level) {
  log_set_level_fp(level);
  log_set_level_stderr(level);
}


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

x86 assembly (clang, -O2):
<log_set_level>:
push   %rbx
mov    %edi,%ebx
call   1040 <log_set_level_fp@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1030 <log_set_level_stderr@plt>

LLVM IR (-O0):
define void @log_set_level(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @log_set_level_fp(i32 %3)
%5 = load i32, i32* %2
%6 = call i32 @log_set_level_stderr(i32 %5)
ret void
}

LLVM IR (-O2):
define void @log_set_level(i32 %0) {
%2 = tail call i32 @log_set_level_fp(i32 %0)
%3 = tail call i32 @log_set_level_stderr(i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ utest_control();
void utest_adts_trie(void) {
  utest_control();
  return;
}


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

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

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

LLVM IR (-O2):
define void @utest_adts_trie() {
%1 = tail call i32 (...) @utest_control()
ret void
}
/* Variables and functions */
size_t ft_power_s(size_t nb, int power) {
  if (power == 0)
    return (1);
  if (power < 0)
    return (0);
  return (nb * ft_power_s(nb, power - 1));
}


x86 assembly (clang, -O0):
<ft_power_s>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jne    1136 <ft_power_s+0x26>
movq   $0x1,-0x8(%rbp)
jmp    1173 <ft_power_s+0x63>
cmpl   $0x0,-0x14(%rbp)
jge    114d <ft_power_s+0x3d>
movq   $0x0,-0x8(%rbp)
jmp    1173 <ft_power_s+0x63>
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
sub    $0x1,%esi
call   1030 <ft_power_s@plt>
mov    %rax,%rcx
mov    -0x20(%rbp),%rax
imul   %rcx,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_power_s>:
mov    $0x1,%eax
test   %esi,%esi
je     1126 <ft_power_s+0x26>
xor    %ecx,%ecx
nopl   0x0(%rax,%rax,1)
test   %esi,%esi
js     1122 <ft_power_s+0x22>
imul   %rdi,%rax
add    $0xffffffff,%esi
jne    1110 <ft_power_s+0x10>
mov    $0x1,%ecx
imul   %rcx,%rax
ret

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

LLVM IR (-O2):
define i64 @ft_power_s(i64 %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %16, label %4
4: ; preds = %2, %8
%5 = phi i32 [ %9, %8 ], [ %1, %2 ]
%6 = phi i64 [ %10, %8 ], [ 1, %2 ]
%7 = icmp slt i32 %5, 0
br i1 %7, label %12, label %8
8: ; preds = %4
%9 = add nsw i32 %5, -1
%10 = mul i64 %6, %0
%11 = icmp eq i32 %9, 0
br i1 %11, label %12, label %4
12: ; preds = %4, %8
%13 = phi i64 [ %10, %8 ], [ %6, %4 ]
%14 = phi i64 [ 1, %8 ], [ 0, %4 ]
%15 = mul nuw nsw i64 %14, %13
br label %16
16: ; preds = %12, %2
%17 = phi i64 [ %15, %12 ], [ 1, %2 ]
ret i64 %17
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isalpha(int);
void t_isalpha_0xe7() {
  Assert_real((isalpha(231) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isalpha.c",
              1160, ("isalpha should be 0 for 0xe7"));
}


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

x86 assembly (clang, -O2):
<t_isalpha_0xe7>:
push   %rax
mov    $0xe7,%edi
call   1030 <isalpha@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x488,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isalpha.c\00"
@.str.1 = [29 x i8] c"isalpha should be 0 for 0xe7\00"
define void @t_isalpha_0xe7() {
%1 = call i64 @isalpha(i32 231)
%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 1160, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isalpha.c\00"
@.str.1 = [29 x i8] c"isalpha should be 0 for 0xe7\00"
define void @t_isalpha_0xe7() {
%1 = tail call i64 @isalpha(i32 231)
%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 1160, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
float *test_func_00(float *p, float c) {
  *--p = c;
  return p;
}


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0xfffffffffffffffc,%rcx
mov    %rcx,-0x8(%rbp)
movss  %xmm0,-0x4(%rax)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
movss  %xmm0,-0x4(%rdi)
lea    -0x4(%rdi),%rax
ret

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

LLVM IR (-O2):
define float* @test_func_00(float* writeonly %0, float %1) {
%3 = getelementptr inbounds float, float* %0, i64 -1
store float %1, float* %3
ret float* %3
}
short ret_const() { return 123; }


x86 assembly (clang, -O0):
<ret_const>:
push   %rbp
mov    %rsp,%rbp
mov    $0x7b,%ax
cwtl
pop    %rbp
ret

x86 assembly (clang, -O2):
<ret_const>:
mov    $0x7b,%ax
ret

LLVM IR (-O0):
define signext i16 @ret_const() {
ret i16 123
}

LLVM IR (-O2):
define signext i16 @ret_const() {
ret i16 123
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
void prompts_2(void) {
  int x;
  char *prompts[] = {"Type something", "C:\>", "."};
  for (x = 0; x < 3; x++) {
    puts(prompts[x]);
  }
}


x86 assembly (clang, -O0):
<prompts_2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    0x2ce1(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0x2cde(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0x2cdb(%rip),%rax
mov    %rax,-0x10(%rbp)
movl   $0x0,-0x4(%rbp)
cmpl   $0x3,-0x4(%rbp)
jge    1166 <prompts_2+0x56>
movslq -0x4(%rbp),%rax
mov    -0x20(%rbp,%rax,8),%rdi
call   1030 <puts@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1140 <prompts_2+0x30>
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [15 x i8] c"Type something\00"
@.str.1 = [4 x i8] c"C:>\00"
@.str.2 = [2 x i8] c".\00"
@__const.prompts_2.prompts = [3 x i8*] [i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i32 0, i32 0)]
define void @prompts_2() {
%1 = alloca i32
%2 = alloca [3 x i8*]
%3 = bitcast [3 x i8*]* %2 to i8*
store i32 0, i32* %1
br label %4
4: ; preds = %13, %0
%5 = load i32, i32* %1
%6 = icmp slt i32 %5, 3
br i1 %6, label %7, label %16
7: ; preds = %4
%8 = load i32, i32* %1
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds [3 x i8*], [3 x i8*]* %2, i64 0, i64 %9
%11 = load i8*, i8** %10
%12 = call i32 @puts(i8* %11)
br label %13
13: ; preds = %7
%14 = load i32, i32* %1
%15 = add nsw i32 %14, 1
store i32 %15, i32* %1
br label %4
16: ; preds = %4
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"Type something\00"
@.str.1 = [4 x i8] c"C:>\00"
@.str.2 = [2 x i8] c".\00"
define void @prompts_2() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
ret void
}