xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ fct_subfile();
int /*<<< orphan*/ printf(char *);
int main() {
  printf("function in main\n");
  fct_subfile();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <fct_subfile@plt>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [18 x i8] c"function in main\0A\00"
define i32 @main() {
%1 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (...) @fct_subfile()
ret i32 0
}

LLVM IR (-O2):
@str = [17 x i8] c"function in main\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (...) @fct_subfile()
ret i32 0
}
/* Type definitions */
struct reset_control {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ WARN_ON(int);
int reset_control_reset(struct reset_control *rstc) {
  WARN_ON(1);
  return 0;
}


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

x86 assembly (clang, -O2):
<reset_control_reset>:
push   %rax
mov    $0x1,%edi
call   1030 <WARN_ON@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.reset_control = type { i32 }
define i32 @reset_control_reset(%struct.reset_control* %0) {
%2 = alloca %struct.reset_control*
store %struct.reset_control* %0, %struct.reset_control** %2
%3 = call i32 @WARN_ON(i32 1)
ret i32 0
}

LLVM IR (-O2):
%struct.reset_control = type { i32 }
define i32 @reset_control_reset(%struct.reset_control* nocapture readnone %0) {
%2 = tail call i32 @WARN_ON(i32 1)
ret i32 0
}
/* Variables and functions */
double atan(double);
double sin(double);
double iter_fcn(double lambda, double x) {
  return lambda * sin((4.0 * atan(1.0)) * x);
}


x86 assembly (clang, -O0):
<iter_fcn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  0xec4(%rip),%xmm0
call   1040 <atan@plt>
movaps %xmm0,%xmm1
movsd  0xeac(%rip),%xmm0
mulsd  %xmm1,%xmm0
mulsd  -0x10(%rbp),%xmm0
call   1030 <sin@plt>
movaps %xmm0,%xmm1
movsd  -0x18(%rbp),%xmm0
mulsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<iter_fcn>:
sub    $0x18,%rsp
movsd  %xmm1,0x8(%rsp)
movsd  %xmm0,0x10(%rsp)
movsd  0xec8(%rip),%xmm0
call   1040 <atan@plt>
movsd  0x8(%rsp),%xmm0
mulsd  0xebd(%rip),%xmm0
call   1030 <sin@plt>
mulsd  0x10(%rsp),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @iter_fcn(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = call double @atan(double 1.000000e+00)
%7 = fmul double 4.000000e+00, %6
%8 = load double, double* %4
%9 = fmul double %7, %8
%10 = call double @sin(double %9)
%11 = fmul double %5, %10
ret double %11
}

LLVM IR (-O2):
define double @iter_fcn(double %0, double %1) {
%3 = tail call double @atan(double 1.000000e+00)
%4 = fmul double %1, 0x400921FB54442D18
%5 = tail call double @sin(double %4)
%6 = fmul double %5, %0
ret double %6
}
void border_nesw_double_diagonal_dirt(unsigned char *pic, unsigned char *mirr) {
  *pic = 0x14;
}


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

x86 assembly (clang, -O2):
<border_nesw_double_diagonal_dirt>:
movb   $0x14,(%rdi)
ret

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

LLVM IR (-O2):
define void @border_nesw_double_diagonal_dirt(i8* nocapture writeonly %0, i8* nocapture readnone %1) {
store i8 20, i8* %0
ret void
}
/* Type definitions */
struct stat {
  int /*<<< orphan*/ st_mode;
};

/* Variables and functions */
scalar_t__ S_ISREG(int /*<<< orphan*/);
int lstat(char *, struct stat *);
int check_lstat(char *cmd) {
  struct stat buf;
  int rc = lstat(cmd, &buf);
  if (rc == 0) {
    if (S_ISREG(buf.st_mode)) {
      return 0;
    }
  }
  return 1;
}


x86 assembly (clang, -O0):
<check_lstat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1030 <lstat@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
jne    1169 <check_lstat+0x49>
mov    -0x18(%rbp),%edi
call   1040 <S_ISREG@plt>
cmp    $0x0,%rax
je     1164 <check_lstat+0x44>
movl   $0x0,-0x4(%rbp)
jmp    1170 <check_lstat+0x50>
jmp    1169 <check_lstat+0x49>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_lstat>:
push   %rax
mov    %rsp,%rsi
call   1030 <lstat@plt>
test   %eax,%eax
jne    1141 <check_lstat+0x21>
mov    (%rsp),%edi
call   1040 <S_ISREG@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
je     1141 <check_lstat+0x21>
pop    %rcx
ret
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
define i32 @check_lstat(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca %struct.stat
%5 = alloca i32
store i8* %0, i8** %3
%6 = load i8*, i8** %3
%7 = call i32 @lstat(i8* %6, %struct.stat* %4)
store i32 %7, i32* %5
%8 = load i32, i32* %5
%9 = icmp eq i32 %8, 0
br i1 %9, label %10, label %17
10: ; preds = %1
%11 = getelementptr inbounds %struct.stat, %struct.stat* %4, i32 0, i32 0
%12 = load i32, i32* %11
%13 = call i64 @S_ISREG(i32 %12)
%14 = icmp ne i64 %13, 0
br i1 %14, label %15, label %16
15: ; preds = %10
store i32 0, i32* %2
br label %18
16: ; preds = %10
br label %17
17: ; preds = %16, %1
store i32 1, i32* %2
br label %18
18: ; preds = %17, %15
%19 = load i32, i32* %2
ret i32 %19
}

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @check_lstat(i8* nocapture %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i32 @lstat(i8* %0, %struct.stat* %2)
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %11
6: ; preds = %1
%7 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%8 = load i32, i32* %7
%9 = tail call i64 @S_ISREG(i32 %8)
%10 = icmp eq i64 %9, 0
br i1 %10, label %11, label %12
11: ; preds = %6, %1
br label %12
12: ; preds = %6, %11
%13 = phi i32 [ 1, %11 ], [ 0, %6 ]
ret i32 %13
}
int inc(int a) { return (++a); }


x86 assembly (clang, -O0):
<inc>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<inc>:
lea    0x1(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @inc(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add nsw i32 %3, 1
store i32 %4, i32* %2
ret i32 %4
}

LLVM IR (-O2):
define i32 @inc(i32 %0) {
%2 = add nsw i32 %0, 1
ret i32 %2
}
/* Variables and functions */
int ENODEV;
int qpnp_pon_is_ps_hold_reset(void) { return -ENODEV; }


x86 assembly (clang, -O0):
<qpnp_pon_is_ps_hold_reset>:
push   %rbp
mov    %rsp,%rbp
xor    %eax,%eax
mov    0x2ed3(%rip),%rcx
sub    (%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<qpnp_pon_is_ps_hold_reset>:
mov    0x2ed9(%rip),%rcx
xor    %eax,%eax
sub    (%rcx),%eax
ret

LLVM IR (-O0):
@ENODEV = global i32 0
define i32 @qpnp_pon_is_ps_hold_reset() {
%1 = load i32, i32* @ENODEV
%2 = sub nsw i32 0, %1
ret i32 %2
}

LLVM IR (-O2):
@ENODEV = global i32 0
define i32 @qpnp_pon_is_ps_hold_reset() {
%1 = load i32, i32* @ENODEV
%2 = sub nsw i32 0, %1
ret i32 %2
}
/* Variables and functions */
int strlen(char const *);
int /*<<< orphan*/ write(int, char const *, int);
void herror(const char *s) {
  write(2, s, strlen(s));
  write(2, ": DNS error.\n", 13);
}


x86 assembly (clang, -O0):
<herror>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x10(%rbp),%rsi
mov    %eax,%edx
mov    $0x2,%edi
call   1030 <write@plt>
mov    $0x2,%edi
lea    0xea7(%rip),%rsi
mov    $0xd,%edx
call   1030 <write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<herror>:
push   %rbx
mov    %rdi,%rbx
call   1040 <strlen@plt>
mov    $0x2,%edi
mov    %rbx,%rsi
mov    %eax,%edx
call   1030 <write@plt>
lea    0xec1(%rip),%rsi
mov    $0x2,%edi
mov    $0xd,%edx
pop    %rbx
jmp    1030 <write@plt>

LLVM IR (-O0):
@.str = [14 x i8] c": DNS error.\0A\00"
define void @herror(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @strlen(i8* %4)
%6 = call i32 @write(i32 2, i8* %3, i32 %5)
%7 = call i32 @write(i32 2, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 13)
ret void
}

LLVM IR (-O2):
@.str = [14 x i8] c": DNS error.\0A\00"
define void @herror(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = tail call i32 @write(i32 2, i8* %0, i32 %2)
%4 = tail call i32 @write(i32 2, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 13)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int ff_ctl_send(int, int /*<<< orphan*/ *, int, int /*<<< orphan*/ *, int);
int strlen(char *);
int ff_ctl_send_string(int cmd, char *name, char *data) {
  int nlen, dlen;
  nlen = strlen(name) + 1;
  dlen = strlen(data) + 1;
  return ff_ctl_send(cmd, (uint8_t *)name, nlen, (uint8_t *)data, dlen);
}


x86 assembly (clang, -O0):
<ff_ctl_send_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <strlen@plt>
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x1c(%rbp),%edx
mov    -0x18(%rbp),%rcx
mov    -0x20(%rbp),%r8d
call   1030 <ff_ctl_send@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ff_ctl_send_string>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rsi,%rbx
mov    %edi,%r15d
mov    %rsi,%rdi
call   1040 <strlen@plt>
lea    0x1(%rax),%ebp
mov    %r14,%rdi
call   1040 <strlen@plt>
lea    0x1(%rax),%r8d
mov    %r15d,%edi
mov    %rbx,%rsi
mov    %ebp,%edx
mov    %r14,%rcx
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <ff_ctl_send@plt>

LLVM IR (-O0):
define i32 @ff_ctl_send_string(i32 %0, i8* %1, i8* %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%9 = load i8*, i8** %5
%10 = call i32 @strlen(i8* %9)
%11 = add nsw i32 %10, 1
store i32 %11, i32* %7
%12 = load i8*, i8** %6
%13 = call i32 @strlen(i8* %12)
%14 = add nsw i32 %13, 1
store i32 %14, i32* %8
%15 = load i32, i32* %4
%16 = load i8*, i8** %5
%17 = bitcast i8* %16 to i32*
%18 = load i32, i32* %7
%19 = load i8*, i8** %6
%20 = bitcast i8* %19 to i32*
%21 = load i32, i32* %8
%22 = call i32 @ff_ctl_send(i32 %15, i32* %17, i32 %18, i32* %20, i32 %21)
ret i32 %22
}

LLVM IR (-O2):
define i32 @ff_ctl_send_string(i32 %0, i8* %1, i8* %2) {
%4 = tail call i32 @strlen(i8* %1)
%5 = add nsw i32 %4, 1
%6 = tail call i32 @strlen(i8* %2)
%7 = add nsw i32 %6, 1
%8 = bitcast i8* %1 to i32*
%9 = bitcast i8* %2 to i32*
%10 = tail call i32 @ff_ctl_send(i32 %0, i32* %8, i32 %5, i32* %9, i32 %7)
ret i32 %10
}
/* Variables and functions */
bool is_whitespace(char c) { return c == '\t' || c == ' '; }


x86 assembly (clang, -O0):
<is_whitespace>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x9,%ecx
mov    %al,-0x2(%rbp)
je     1129 <is_whitespace+0x29>
movsbl -0x1(%rbp),%eax
cmp    $0x20,%eax
sete   %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_whitespace>:
cmp    $0x9,%dil
sete   %al
cmp    $0x20,%dil
sete   %cl
or     %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @is_whitespace(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp eq i32 %4, 9
br i1 %5, label %10, label %6
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp eq i32 %8, 32
br label %10
10: ; preds = %6, %1
%11 = phi i1 [ true, %1 ], [ %9, %6 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @is_whitespace(i8 signext %0) {
%2 = icmp eq i8 %0, 9
%3 = icmp eq i8 %0, 32
%4 = or i1 %2, %3
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int iscntrl(int);
bool invalidFunctionArgBool_iscntrl(bool b, int c) {
  (void)iscntrl(b);
  return iscntrl(c != 0);
}


x86 assembly (clang, -O0):
<invalidFunctionArgBool_iscntrl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <iscntrl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<invalidFunctionArgBool_iscntrl>:
xor    %edi,%edi
test   %esi,%esi
setne  %dil
jmp    1030 <iscntrl@plt>

LLVM IR (-O0):
define i32 @invalidFunctionArgBool_iscntrl(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 = call i32 @iscntrl(i32 %5)
%7 = load i32, i32* %4
%8 = icmp ne i32 %7, 0
%9 = zext i1 %8 to i32
%10 = call i32 @iscntrl(i32 %9)
ret i32 %10
}

LLVM IR (-O2):
define i32 @invalidFunctionArgBool_iscntrl(i32 %0, i32 %1) {
%3 = icmp ne i32 %1, 0
%4 = zext i1 %3 to i32
%5 = tail call i32 @iscntrl(i32 %4)
ret i32 %5
}
unsigned char extract_byte_from_word(unsigned int input_word,
                                     unsigned int left_border) {
  return (unsigned char)(input_word >> (left_border - 8));
}


x86 assembly (clang, -O0):
<extract_byte_from_word>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
sub    $0x8,%ecx
shr    %cl,%eax
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<extract_byte_from_word>:
mov    %edi,%eax
lea    -0x8(%rsi),%ecx
shr    %cl,%eax
ret

LLVM IR (-O0):
define zeroext i8 @extract_byte_from_word(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 = sub i32 %6, 8
%8 = lshr i32 %5, %7
%9 = trunc i32 %8 to i8
ret i8 %9
}

LLVM IR (-O2):
define zeroext i8 @extract_byte_from_word(i32 %0, i32 %1) {
%3 = add i32 %1, -8
%4 = lshr i32 %0, %3
%5 = trunc i32 %4 to i8
ret i8 %5
}
int test_imm_0Bint8_reg(signed char val) {
  return ((val) & (-0x0B << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_0Bint8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edx
and    $0xfffffff5,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_0Bint8_reg(i8 signext %0) {
%2 = and i8 %0, -11
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int strlen(const char *s) {
  int count;
  count = 0;
  while (*s++ != '\0')
    count++;
  return (count);
}


x86 assembly (clang, -O0):
<strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1138 <strlen+0x38>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <strlen+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlen>:
cmpb   $0x0,(%rdi)
je     111c <strlen+0x1c>
xor    %eax,%eax
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,0x1(%rdi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <strlen+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @strlen(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i32 [ %8, %4 ], [ 0, %1 ]
%6 = phi i8* [ %7, %4 ], [ %0, %1 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = add nuw nsw i32 %5, 1
%9 = load i8, i8* %7
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
%12 = phi i32 [ 0, %1 ], [ %8, %4 ]
ret i32 %12
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
uint64_t swapOffset(uint64_t v) { return (v >> 5) & (0x3FFFFFFFFFFFF); }


x86 assembly (clang, -O0):
<swapOffset>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x5,%eax
cltq
movabs $0x3ffffffffffff,%rcx
and    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<swapOffset>:
mov    %edi,%eax
sar    $0x5,%eax
ret

LLVM IR (-O0):
define i32 @swapOffset(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = ashr i32 %3, 5
%5 = sext i32 %4 to i64
%6 = and i64 %5, 1125899906842623
%7 = trunc i64 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @swapOffset(i32 %0) {
%2 = ashr i32 %0, 5
ret i32 %2
}
int seq_search(int a[], int reqV, int start, int end) {
  int i;
  for (i = start; i <= end; i++)
    if (reqV == a[i])
      return i;
  return -1;
}


x86 assembly (clang, -O0):
<seq_search>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x18(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jg     1155 <seq_search+0x55>
mov    -0x14(%rbp),%eax
mov    -0x10(%rbp),%rcx
movslq -0x20(%rbp),%rdx
cmp    (%rcx,%rdx,4),%eax
jne    1142 <seq_search+0x42>
mov    -0x20(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    115c <seq_search+0x5c>
jmp    1147 <seq_search+0x47>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    1117 <seq_search+0x17>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<seq_search>:
mov    $0xffffffff,%eax
cmp    %ecx,%edx
jg     112f <seq_search+0x2f>
movslq %edx,%r8
add    $0x1,%ecx
lea    (%rdi,%r8,4),%rdi
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
cmp    %esi,(%rdi)
je     1130 <seq_search+0x30>
add    $0x1,%edx
add    $0x4,%rdi
cmp    %edx,%ecx
jne    1120 <seq_search+0x20>
ret
mov    %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @seq_search(i32* nocapture %0, i32 %1, i32 %2, i32 %3) {
%5 = icmp sgt i32 %2, %3
br i1 %5, label %20, label %6
6: ; preds = %4
%7 = sext i32 %2 to i64
%8 = add i32 %3, 1
br label %9
9: ; preds = %6, %14
%10 = phi i64 [ %7, %6 ], [ %15, %14 ]
%11 = getelementptr inbounds i32, i32* %0, i64 %10
%12 = load i32, i32* %11
%13 = icmp eq i32 %12, %1
br i1 %13, label %18, label %14
14: ; preds = %9
%15 = add nsw i64 %10, 1
%16 = trunc i64 %15 to i32
%17 = icmp eq i32 %8, %16
br i1 %17, label %20, label %9
18: ; preds = %9
%19 = trunc i64 %10 to i32
br label %20
20: ; preds = %14, %18, %4
%21 = phi i32 [ -1, %4 ], [ %19, %18 ], [ -1, %14 ]
ret i32 %21
}
/* Variables and functions */
int /*<<< orphan*/ outw(unsigned int, unsigned short);
void OUTPORT16(unsigned idx, unsigned short val) { outw(idx, val); }


x86 assembly (clang, -O0):
<OUTPORT16>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %si,%ax
mov    %edi,-0x4(%rbp)
mov    %ax,-0x6(%rbp)
mov    -0x4(%rbp),%edi
movzwl -0x6(%rbp),%esi
call   1030 <outw@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<OUTPORT16>:
jmp    1030 <outw@plt>

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

LLVM IR (-O2):
define void @OUTPORT16(i32 %0, i16 zeroext %1) {
%3 = tail call i32 @outw(i32 %0, i16 zeroext %1)
ret void
}
void gdk_keyboard_ungrab() {}


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

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

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

LLVM IR (-O2):
define void @gdk_keyboard_ungrab() {
ret void
}
long long sumJohn(long long n) {}


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

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

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

LLVM IR (-O2):
define i64 @sumJohn(i64 %0) {
ret i64 undef
}
regx0indreg1(r0, r1, x0, x1, p0, p1) double r0, r1;
double *p0, *p1;
{
  if ((p0[x0]) <= (*p1))
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<regx0indreg1>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
mov    %edi,-0x1c(%rbp)
mov    %esi,-0x20(%rbp)
mov    %rdx,-0x28(%rbp)
mov    %rcx,-0x30(%rbp)
mov    -0x28(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
mov    -0x30(%rbp),%rax
movsd  (%rax),%xmm0
ucomisd %xmm1,%xmm0
jb     1147 <regx0indreg1+0x47>
movl   $0x1,-0x4(%rbp)
jmp    114e <regx0indreg1+0x4e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<regx0indreg1>:
movslq %edi,%rsi
movsd  (%rcx),%xmm0
xor    %eax,%eax
ucomisd (%rdx,%rsi,8),%xmm0
setae  %al
ret

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

LLVM IR (-O2):
define i32 @regx0indreg1(double %0, double %1, i32 %2, i32 %3, double* nocapture %4, double* nocapture %5) {
%7 = sext i32 %2 to i64
%8 = getelementptr inbounds double, double* %4, i64 %7
%9 = load double, double* %8
%10 = load double, double* %5
%11 = fcmp ole double %9, %10
%12 = zext i1 %11 to i32
ret i32 %12
}
int test_imm_3Fuint8_mem(unsigned char *val) {
  return ((*val) & (0x3F << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_3Fuint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, 63
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
scalar_t__ strcmp(char *, char *);
int opt_ai(char *opt) {
  if (strcmp(opt, "-c") == 0)
    return 1;
  if (strcmp(opt, "--computer") == 0)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<opt_ai>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xed9(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
jne    1142 <opt_ai+0x32>
movl   $0x1,-0x4(%rbp)
jmp    116f <opt_ai+0x5f>
mov    -0x10(%rbp),%rdi
lea    0xeb6(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
jne    1168 <opt_ai+0x58>
movl   $0x1,-0x4(%rbp)
jmp    116f <opt_ai+0x5f>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<opt_ai>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rsi
call   1030 <strcmp@plt>
test   %rax,%rax
je     1141 <opt_ai+0x31>
lea    0xed7(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
sete   %al
pop    %rbx
ret
mov    $0x1,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"-c\00"
@.str.1 = [11 x i8] c"--computer\00"
define i32 @opt_ai(i8* %0) {
%2 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i64 %2, 0
br i1 %3, label %8, label %4
4: ; preds = %1
%5 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%6 = icmp eq i64 %5, 0
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %4, %1
%9 = phi i32 [ 1, %1 ], [ %7, %4 ]
ret i32 %9
}
/* Type definitions */
struct btf_type {
  int dummy;
};

/* Variables and functions */
scalar_t__ BTF_KIND_CONST;
scalar_t__ btf_kind(struct btf_type const *);
bool btf_is_const(const struct btf_type *t) {
  return btf_kind(t) == BTF_KIND_CONST;
}


x86 assembly (clang, -O0):
<btf_is_const>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <btf_kind@plt>
mov    0x2ebc(%rip),%rcx
cmp    (%rcx),%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<btf_is_const>:
push   %rax
call   1030 <btf_kind@plt>
mov    0x2ecb(%rip),%rdx
xor    %ecx,%ecx
cmp    (%rdx),%rax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.btf_type = type { i32 }
@BTF_KIND_CONST = global i64 0
define i32 @btf_is_const(%struct.btf_type* %0) {
%2 = alloca %struct.btf_type*
store %struct.btf_type* %0, %struct.btf_type** %2
%3 = load %struct.btf_type*, %struct.btf_type** %2
%4 = call i64 @btf_kind(%struct.btf_type* %3)
%5 = load i64, i64* @BTF_KIND_CONST
%6 = icmp eq i64 %4, %5
%7 = zext i1 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
%struct.btf_type = type { i32 }
@BTF_KIND_CONST = global i64 0
define i32 @btf_is_const(%struct.btf_type* %0) {
%2 = tail call i64 @btf_kind(%struct.btf_type* %0)
%3 = load i64, i64* @BTF_KIND_CONST
%4 = icmp eq i64 %2, %3
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ addbyte(int);
void MMX_PSRAD_imm(int dst_reg, int amount) {
  addbyte(0x66);
  addbyte(0x0f);
  addbyte(0x72);
  addbyte(0xc0 | dst_reg | 0x20);
  addbyte(amount);
}


x86 assembly (clang, -O0):
<MMX_PSRAD_imm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0x66,%edi
call   1030 <addbyte@plt>
mov    $0xf,%edi
call   1030 <addbyte@plt>
mov    $0x72,%edi
call   1030 <addbyte@plt>
mov    -0x4(%rbp),%edi
or     $0xc0,%edi
or     $0x20,%edi
call   1030 <addbyte@plt>
mov    -0x8(%rbp),%edi
call   1030 <addbyte@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<MMX_PSRAD_imm>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
mov    $0x66,%edi
call   1030 <addbyte@plt>
mov    $0xf,%edi
call   1030 <addbyte@plt>
mov    $0x72,%edi
call   1030 <addbyte@plt>
or     $0xe0,%ebp
mov    %ebp,%edi
call   1030 <addbyte@plt>
mov    %ebx,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <addbyte@plt>

LLVM IR (-O0):
define void @MMX_PSRAD_imm(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = call i32 @addbyte(i32 102)
%6 = call i32 @addbyte(i32 15)
%7 = call i32 @addbyte(i32 114)
%8 = load i32, i32* %3
%9 = or i32 192, %8
%10 = or i32 %9, 32
%11 = call i32 @addbyte(i32 %10)
%12 = load i32, i32* %4
%13 = call i32 @addbyte(i32 %12)
ret void
}

LLVM IR (-O2):
define void @MMX_PSRAD_imm(i32 %0, i32 %1) {
%3 = tail call i32 @addbyte(i32 102)
%4 = tail call i32 @addbyte(i32 15)
%5 = tail call i32 @addbyte(i32 114)
%6 = or i32 %0, 224
%7 = tail call i32 @addbyte(i32 %6)
%8 = tail call i32 @addbyte(i32 %1)
ret void
}
/* Variables and functions */
int sqrt(int);
bool is_prime(int num) {
  for (int i = 2; i <= sqrt(num); i++)
    if (!(num % i))
      return false;
  return true;
}


x86 assembly (clang, -O0):
<is_prime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
movl   $0x2,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <sqrt@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
cmp    %ecx,%eax
jg     116c <is_prime+0x5c>
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
cmp    $0x0,%edx
jne    1159 <is_prime+0x49>
movl   $0x0,-0x4(%rbp)
jmp    1173 <is_prime+0x63>
jmp    115e <is_prime+0x4e>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1122 <is_prime+0x12>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_prime>:
push   %rbp
push   %r14
push   %rbx
mov    %edi,%r14d
call   1030 <sqrt@plt>
mov    %eax,%ecx
mov    $0x1,%eax
cmp    $0x2,%ecx
jl     1152 <is_prime+0x42>
mov    $0x1,%ebx
nopl   (%rax)
add    $0x1,%ebx
mov    %r14d,%eax
cltd
idiv   %ebx
mov    %edx,%ebp
test   %edx,%edx
je     114b <is_prime+0x3b>
mov    %r14d,%edi
call   1030 <sqrt@plt>
cmp    %eax,%ebx
jl     1130 <is_prime+0x20>
xor    %eax,%eax
test   %ebp,%ebp
setne  %al
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @is_prime(i32 %0) {
%2 = tail call i32 @sqrt(i32 %0)
%3 = icmp slt i32 %2, 2
br i1 %3, label %15, label %8
4: ; preds = %8
%5 = add nuw nsw i32 %9, 1
%6 = tail call i32 @sqrt(i32 %0)
%7 = icmp slt i32 %9, %6
br i1 %7, label %8, label %12
8: ; preds = %1, %4
%9 = phi i32 [ %5, %4 ], [ 2, %1 ]
%10 = srem i32 %0, %9
%11 = icmp eq i32 %10, 0
br i1 %11, label %12, label %4
12: ; preds = %8, %4
%13 = xor i1 %11, true
%14 = zext i1 %13 to i32
br label %15
15: ; preds = %12, %1
%16 = phi i32 [ 1, %1 ], [ %14, %12 ]
ret i32 %16
}
/* Variables and functions */
int /*<<< orphan*/ IntEnable(int);
int /*<<< orphan*/ IntRegister(int, void (*)());
void SysCtlIntRegister(void (*pfnHandler)(void)) {
  IntRegister(44, pfnHandler);
  IntEnable(44);
}


x86 assembly (clang, -O0):
<SysCtlIntRegister>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
mov    $0x2c,%edi
call   1040 <IntRegister@plt>
mov    $0x2c,%edi
call   1030 <IntEnable@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SysCtlIntRegister>:
push   %rax
mov    %rdi,%rsi
mov    $0x2c,%edi
call   1040 <IntRegister@plt>
mov    $0x2c,%edi
pop    %rax
jmp    1030 <IntEnable@plt>

LLVM IR (-O0):
define void @SysCtlIntRegister(void ()* %0) {
%2 = alloca void ()*
store void ()* %0, void ()** %2
%3 = load void ()*, void ()** %2
%4 = bitcast void ()* %3 to void (...)*
%5 = call i32 @IntRegister(i32 44, void (...)* %4)
%6 = call i32 @IntEnable(i32 44)
ret void
}

LLVM IR (-O2):
define void @SysCtlIntRegister(void ()* %0) {
%2 = bitcast void ()* %0 to void (...)*
%3 = tail call i32 @IntRegister(i32 44, void (...)* %2)
%4 = tail call i32 @IntEnable(i32 44)
ret void
}
double SpaSize(int n, int np, double sum_npw) {
  return (sum_npw * 8 + np * 8 + n * 4) / 1024.;
}


x86 assembly (clang, -O0):
<SpaSize>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
mov    -0x8(%rbp),%eax
shl    $0x3,%eax
cvtsi2sd %eax,%xmm1
movsd  0xee2(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x4(%rbp),%eax
shl    $0x2,%eax
cvtsi2sd %eax,%xmm1
addsd  %xmm1,%xmm0
movsd  0xebc(%rip),%xmm1
divsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<SpaSize>:
shl    $0x3,%esi
cvtsi2sd %esi,%xmm1
mulsd  0xef1(%rip),%xmm0
shl    $0x2,%edi
cvtsi2sd %edi,%xmm2
addsd  %xmm1,%xmm0
addsd  %xmm2,%xmm0
mulsd  0xee2(%rip),%xmm0
ret

LLVM IR (-O0):
define double @SpaSize(i32 %0, i32 %1, double %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca double
store i32 %0, i32* %4
store i32 %1, i32* %5
store double %2, double* %6
%7 = load double, double* %6
%8 = load i32, i32* %5
%9 = mul nsw i32 %8, 8
%10 = sitofp i32 %9 to double
%11 = call double @llvm.fmuladd.f64(double %7, double 8.000000e+00, double %10)
%12 = load i32, i32* %4
%13 = mul nsw i32 %12, 4
%14 = sitofp i32 %13 to double
%15 = fadd double %11, %14
%16 = fdiv double %15, 1.024000e+03
ret double %16
}

LLVM IR (-O2):
define double @SpaSize(i32 %0, i32 %1, double %2) {
%4 = shl nsw i32 %1, 3
%5 = sitofp i32 %4 to double
%6 = tail call double @llvm.fmuladd.f64(double %2, double 8.000000e+00, double %5)
%7 = shl nsw i32 %0, 2
%8 = sitofp i32 %7 to double
%9 = fadd double %6, %8
%10 = fmul double %9, 0x3F50000000000000
ret double %10
}
/* Variables and functions */
int /*<<< orphan*/ graph_dfs_postorder(int, int *, int *, int *, int *);
int /*<<< orphan*/ u_reverse(int *, int);
void topological_order(int n, int *xadj, int *adj, int *perm, int *aux) {
  graph_dfs_postorder(n, xadj, adj, perm, aux);
  u_reverse(perm, n);
}


x86 assembly (clang, -O0):
<topological_order>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r8
call   1040 <graph_dfs_postorder@plt>
mov    -0x20(%rbp),%rdi
mov    -0x4(%rbp),%esi
call   1030 <u_reverse@plt>
add    $0x30,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @topological_order(i32 %0, i32* %1, i32* %2, i32* %3, i32* %4) {
%6 = alloca i32
%7 = alloca i32*
%8 = alloca i32*
%9 = alloca i32*
%10 = alloca i32*
store i32 %0, i32* %6
store i32* %1, i32** %7
store i32* %2, i32** %8
store i32* %3, i32** %9
store i32* %4, i32** %10
%11 = load i32, i32* %6
%12 = load i32*, i32** %7
%13 = load i32*, i32** %8
%14 = load i32*, i32** %9
%15 = load i32*, i32** %10
%16 = call i32 @graph_dfs_postorder(i32 %11, i32* %12, i32* %13, i32* %14, i32* %15)
%17 = load i32*, i32** %9
%18 = load i32, i32* %6
%19 = call i32 @u_reverse(i32* %17, i32 %18)
ret void
}

LLVM IR (-O2):
define void @topological_order(i32 %0, i32* %1, i32* %2, i32* %3, i32* %4) {
%6 = tail call i32 @graph_dfs_postorder(i32 %0, i32* %1, i32* %2, i32* %3, i32* %4)
%7 = tail call i32 @u_reverse(i32* %3, i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ReverseGPIOP__0__Out__clr();
void LedsP__Led0__clr(void) { ReverseGPIOP__0__Out__clr(); }


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

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

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

LLVM IR (-O2):
define void @LedsP__Led0__clr() {
%1 = tail call i32 (...) @ReverseGPIOP__0__Out__clr()
ret void
}
/* Variables and functions */
scalar_t__ GetVoidMemory(size_t);
int *GetIntMemory(size_t Size) { return (int *)GetVoidMemory(Size); }


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

x86 assembly (clang, -O2):
<GetIntMemory>:
jmp    1030 <GetVoidMemory@plt>

LLVM IR (-O0):
define i32* @GetIntMemory(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i64 @GetVoidMemory(i64 %3)
%5 = inttoptr i64 %4 to i32*
ret i32* %5
}

LLVM IR (-O2):
define i32* @GetIntMemory(i64 %0) {
%2 = tail call i64 @GetVoidMemory(i64 %0)
%3 = inttoptr i64 %2 to i32*
ret i32* %3
}
/* Type definitions */
typedef int int32_t;

/* Variables and functions */
int32_t main(void) {
  int32_t a;
  if (0) {
    a = 23;
  } else if (1) {
    a = 45;
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x2d,-0x4(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
int Bematech_FI_Acrescimos(Var, Retorno) {
  return Formata("\x1b|35|30|\x1b", Var, Retorno);
}


x86 assembly (clang, -O0):
<Bematech_FI_Acrescimos>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xed5(%rip),%rdi
mov    $0x0,%al
call   1030 <Formata@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Bematech_FI_Acrescimos>:
mov    %esi,%edx
mov    %edi,%esi
lea    0xee5(%rip),%rdi
xor    %eax,%eax
jmp    1030 <Formata@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"\1B|35|30|\1B\00"
define i32 @Bematech_FI_Acrescimos(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 (i8*, i32, i32, ...) bitcast (i32 (...)* @Formata to i32 (i8*, i32, i32, ...)*)(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %5, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
@.str = [10 x i8] c"\1B|35|30|\1B\00"
define i32 @Bematech_FI_Acrescimos(i32 %0, i32 %1) {
%3 = tail call i32 (i8*, i32, i32, ...) bitcast (i32 (...)* @Formata to i32 (i8*, i32, i32, ...)*)(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1)
ret i32 %3
}
/* Variables and functions */
bool string_is_hyphen(const char *str) {
  return str[0] == '-' && str[1] == '\0';
}


x86 assembly (clang, -O0):
<string_is_hyphen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x2d,%ecx
mov    %al,-0x9(%rbp)
jne    112e <string_is_hyphen+0x2e>
mov    -0x8(%rbp),%rax
movsbl 0x1(%rax),%eax
cmp    $0x0,%eax
sete   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<string_is_hyphen>:
xor    %eax,%eax
cmpb   $0x2d,(%rdi)
jne    1110 <string_is_hyphen+0x10>
xor    %eax,%eax
cmpb   $0x0,0x1(%rdi)
sete   %al
ret

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

LLVM IR (-O2):
define i32 @string_is_hyphen(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 45
br i1 %3, label %4, label %9
4: ; preds = %1
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 0
%8 = zext i1 %7 to i32
br label %9
9: ; preds = %4, %1
%10 = phi i32 [ 0, %1 ], [ %8, %4 ]
ret i32 %10
}
int b_twist_d_on_edgeperm(eperm)
int eperm;
{
  int temp_arr[8];
  b_edgeperm_unpack(eperm, temp_arr);
  four_cycle(temp_arr, 7, 6, 5, 4);
  return b_edgeperm_pack(temp_arr);
}


x86 assembly (clang, -O0):
<b_twist_d_on_edgeperm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x30(%rbp),%rsi
mov    $0x0,%al
call   1050 <b_edgeperm_unpack@plt>
lea    -0x30(%rbp),%rdi
mov    $0x7,%esi
mov    $0x6,%edx
mov    $0x5,%ecx
mov    $0x4,%r8d
mov    $0x0,%al
call   1040 <four_cycle@plt>
lea    -0x30(%rbp),%rdi
mov    $0x0,%al
call   1030 <b_edgeperm_pack@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<b_twist_d_on_edgeperm>:
push   %rbx
sub    $0x20,%rsp
mov    %rsp,%rbx
mov    %rbx,%rsi
xor    %eax,%eax
call   1050 <b_edgeperm_unpack@plt>
mov    %rbx,%rdi
mov    $0x7,%esi
mov    $0x6,%edx
mov    $0x5,%ecx
mov    $0x4,%r8d
xor    %eax,%eax
call   1040 <four_cycle@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <b_edgeperm_pack@plt>
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @b_twist_d_on_edgeperm(i32 %0) {
%2 = alloca i32
%3 = alloca [8 x i32]
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = getelementptr inbounds [8 x i32], [8 x i32]* %3, i64 0, i64 0
%6 = call i32 (i32, i32*, ...) bitcast (i32 (...)* @b_edgeperm_unpack to i32 (i32, i32*, ...)*)(i32 %4, i32* %5)
%7 = getelementptr inbounds [8 x i32], [8 x i32]* %3, i64 0, i64 0
%8 = call i32 (i32*, i32, i32, i32, i32, ...) bitcast (i32 (...)* @four_cycle to i32 (i32*, i32, i32, i32, i32, ...)*)(i32* %7, i32 7, i32 6, i32 5, i32 4)
%9 = getelementptr inbounds [8 x i32], [8 x i32]* %3, i64 0, i64 0
%10 = call i32 (i32*, ...) bitcast (i32 (...)* @b_edgeperm_pack to i32 (i32*, ...)*)(i32* %9)
ret i32 %10
}

LLVM IR (-O2):
define i32 @b_twist_d_on_edgeperm(i32 %0) {
%2 = alloca [8 x i32]
%3 = bitcast [8 x i32]* %2 to i8*
%4 = getelementptr inbounds [8 x i32], [8 x i32]* %2, i64 0, i64 0
%5 = call i32 (i32, i32*, ...) bitcast (i32 (...)* @b_edgeperm_unpack to i32 (i32, i32*, ...)*)(i32 %0, i32* %4)
%6 = call i32 (i32*, i32, i32, i32, i32, ...) bitcast (i32 (...)* @four_cycle to i32 (i32*, i32, i32, i32, i32, ...)*)(i32* %4, i32 7, i32 6, i32 5, i32 4)
%7 = call i32 (i32*, ...) bitcast (i32 (...)* @b_edgeperm_pack to i32 (i32*, ...)*)(i32* %4)
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ default_handler();
__attribute__((weak)) void TIM4_IRQHandler() { default_handler(); }


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

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

LLVM IR (-O0):
define weak void @TIM4_IRQHandler() {
%1 = call i32 (...) @default_handler()
ret void
}

LLVM IR (-O2):
define weak void @TIM4_IRQHandler() {
%1 = tail call i32 (...) @default_handler()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ openlog(char const *, int, int);
void sfd_log_open(const char *ident, int option, int facility) {
  openlog(ident, option, facility);
}


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

x86 assembly (clang, -O2):
<sfd_log_open>:
jmp    1030 <openlog@plt>

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

LLVM IR (-O2):
define void @sfd_log_open(i8* %0, i32 %1, i32 %2) {
%4 = tail call i32 @openlog(i8* %0, i32 %1, i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_SUCCESS;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ perror(char *);
void error(char *err) {
  perror(err);
  exit(EXIT_SUCCESS);
  return;
}


x86 assembly (clang, -O0):
<error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <perror@plt>
mov    0x2ea4(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<error>:
push   %rax
call   1030 <perror@plt>
mov    0x2eb3(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@EXIT_SUCCESS = global i32 0
define void @error(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @perror(i8* %3)
%5 = load i32, i32* @EXIT_SUCCESS
%6 = call i32 @exit(i32 %5)
unreachable
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
define void @error(i8* nocapture %0) {
%2 = tail call i32 @perror(i8* %0)
%3 = load i32, i32* @EXIT_SUCCESS
%4 = tail call i32 @exit(i32 %3)
unreachable
}