xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
scalar_t__ f(int /*<<< orphan*/, int);
main() {
  if (f(0, -1))
    abort();
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xor    %edi,%edi
mov    $0xffffffff,%esi
call   1040 <f@plt>
cmp    $0x0,%rax
je     115c <main+0x2c>
mov    $0x0,%al
call   1030 <abort@plt>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
mov    $0xffffffff,%esi
call   1040 <f@plt>
test   %rax,%rax
jne    1149 <main+0x19>
xor    %edi,%edi
call   1050 <exit@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i64 @f(i32 0, i32 -1)
%3 = icmp ne i64 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = call i32 (...) @abort()
unreachable
6: ; preds = %0
%7 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i64 @f(i32 0, i32 -1)
%2 = icmp eq i64 %1, 0
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 (...) @abort()
unreachable
5: ; preds = %0
%6 = tail call i32 @exit(i32 0)
unreachable
}
/* Type definitions */
typedef char const int32_t;

/* Variables and functions */
char *strchr(const char *s, int32_t c) {
  do {
    if (*s == c)
      return (char *)s;
  } while (*s++);
  return NULL;
}


x86 assembly (clang, -O0):
<strchr>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x10(%rbp)
mov    %al,-0x11(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
movsbl -0x11(%rbp),%ecx
cmp    %ecx,%eax
jne    112e <strchr+0x2e>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1153 <strchr+0x53>
jmp    1133 <strchr+0x33>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
cmpb   $0x0,(%rax)
jne    110e <strchr+0xe>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strchr>:
mov    %rdi,%rax
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movzbl (%rax),%ecx
cmp    %sil,%cl
je     1122 <strchr+0x22>
add    $0x1,%rax
test   %cl,%cl
jne    1110 <strchr+0x10>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i8* @strchr(i8* %0, i8 signext %1) {
br label %3
3: ; preds = %7, %2
%4 = phi i8* [ %0, %2 ], [ %8, %7 ]
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, %1
br i1 %6, label %10, label %7
7: ; preds = %3
%8 = getelementptr inbounds i8, i8* %4, i64 1
%9 = icmp eq i8 %5, 0
br i1 %9, label %10, label %3
10: ; preds = %7, %3
%11 = phi i8* [ %4, %3 ], [ null, %7 ]
ret i8* %11
}
void ieee80211_debugfs_key_add(struct ieee80211_key *key) {}


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

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

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

LLVM IR (-O2):
%struct.ieee80211_key = type opaque
define void @ieee80211_debugfs_key_add(%struct.ieee80211_key* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
__attribute__((destructor)) void after_main() { printf("before main\n"); }


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

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

LLVM IR (-O0):
@.str = [13 x i8] c"before main\0A\00"
@llvm.global_dtors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @after_main, i8* null }]
define void @after_main() {
%1 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@llvm.global_dtors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @after_main, i8* null }]
@str = [12 x i8] c"before main\00"
define void @after_main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
ret void
}
/* Type definitions */
struct timezone {
  int dummy;
};
struct timeval {
  double tv_sec;
  scalar_t__ tv_usec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, struct timezone *);
double cclock_() {
  struct timeval tmp;
  double sec;
  gettimeofday(&tmp, (struct timezone *)0);
  sec = tmp.tv_sec + ((double)tmp.tv_usec) / 1000000.0;
  return sec;
}


x86 assembly (clang, -O0):
<cclock_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
movsd  -0x10(%rbp),%xmm0
cvtsi2sdq -0x8(%rbp),%xmm1
movsd  0xec8(%rip),%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cclock_>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
cvtsi2sdq 0x10(%rsp),%xmm0
divsd  0xed1(%rip),%xmm0
addsd  0x8(%rsp),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timeval = type { double, i64 }
%struct.timezone = type { i32 }
define double @cclock_() {
%1 = alloca %struct.timeval
%2 = alloca double
%3 = call i32 @gettimeofday(%struct.timeval* %1, %struct.timezone* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%5 = load double, double* %4
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%7 = load i64, i64* %6
%8 = sitofp i64 %7 to double
%9 = fdiv double %8, 1.000000e+06
%10 = fadd double %5, %9
store double %10, double* %2
%11 = load double, double* %2
ret double %11
}

LLVM IR (-O2):
%struct.timeval = type { double, i64 }
%struct.timezone = type { i32 }
define double @cclock_() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, %struct.timezone* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%5 = load double, double* %4
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%7 = load i64, i64* %6
%8 = sitofp i64 %7 to double
%9 = fdiv double %8, 1.000000e+06
%10 = fadd double %5, %9
ret double %10
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
scalar_t__ ntohl(int);
uint64_t _byteswap64bit(uint64_t val) {
  return ((uint64_t)ntohl(val >> 32)) | ((uint64_t)ntohl(val) << 32);
}


x86 assembly (clang, -O0):
<_byteswap64bit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x20,%ecx
sar    %cl,%edi
call   1030 <ntohl@plt>
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <ntohl@plt>
mov    %rax,%rcx
mov    -0x8(%rbp),%eax
mov    %ecx,%edx
mov    $0x20,%ecx
shl    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_byteswap64bit>:
push   %rbx
mov    %edi,%ebx
call   1030 <ntohl@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1030 <ntohl@plt>

LLVM IR (-O0):
define i32 @_byteswap64bit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = ashr i32 %3, 32
%5 = call i64 @ntohl(i32 %4)
%6 = trunc i64 %5 to i32
%7 = load i32, i32* %2
%8 = call i64 @ntohl(i32 %7)
%9 = trunc i64 %8 to i32
%10 = shl i32 %9, 32
%11 = or i32 %6, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @_byteswap64bit(i32 %0) {
%2 = tail call i64 @ntohl(i32 poison)
%3 = tail call i64 @ntohl(i32 %0)
ret i32 poison
}
char encode(char a) {
  if ((int)a == 255) {
    return a = 1;
  }
  return a + 1;
}


x86 assembly (clang, -O0):
<encode>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x2(%rbp)
movsbl -0x2(%rbp),%eax
cmp    $0xff,%eax
jne    1126 <encode+0x26>
movb   $0x1,-0x2(%rbp)
movb   $0x1,-0x1(%rbp)
jmp    1130 <encode+0x30>
movsbl -0x2(%rbp),%eax
add    $0x1,%eax
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define signext i8 @encode(i8 signext %0) {
%2 = add i8 %0, 1
ret i8 %2
}
/* Type definitions */
typedef int int32_t;

/* Variables and functions */
int /*<<< orphan*/ assert_or_panic(int);
void c_i32(int32_t x) { assert_or_panic(x == -3); }


x86 assembly (clang, -O0):
<c_i32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0xfffffffd,-0x4(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert_or_panic@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<c_i32>:
xor    %eax,%eax
cmp    $0xfffffffd,%edi
sete   %al
mov    %eax,%edi
jmp    1030 <assert_or_panic@plt>

LLVM IR (-O0):
define void @c_i32(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, -3
%5 = zext i1 %4 to i32
%6 = call i32 @assert_or_panic(i32 %5)
ret void
}

LLVM IR (-O2):
define void @c_i32(i32 %0) {
%2 = icmp eq i32 %0, -3
%3 = zext i1 %2 to i32
%4 = tail call i32 @assert_or_panic(i32 %3)
ret void
}
int test_imm_56int16_reg(short val) {
  return ((val) & (0x56 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_56int16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%edx
and    $0x56,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test_imm_56int16_reg(i16 signext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = sext i16 %3 to i32
%5 = and i32 %4, 86
%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_56int16_reg(i16 signext %0) {
%2 = and i16 %0, 86
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int *calloc(int, int);
int /*<<< orphan*/ free(int *);
int main() {
  int *val = calloc(1, sizeof(int));
  free(val);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x1,%edi
mov    $0x4,%esi
call   1040 <calloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32* @calloc(i32 1, i32 4)
%2 = tail call i32 @free(i32* %1)
ret i32 0
}
unsigned xrop3_4_0_1(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  stk2 = D | T;
  stk2 = ~stk2;
  stk1 = S & stk2;
  return (stk1 & S) | (stk1 & (~T)) | (T & (~S) & D);
}


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

x86 assembly (clang, -O2):
<xrop3_4_0_1>:
mov    %esi,%eax
not    %eax
and    %edi,%eax
shl    $0x8,%eax
not    %edi
and    %esi,%edi
or     %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @xrop3_4_0_1(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = zext i8 %1 to i32
%5 = xor i32 %4, -1
%6 = and i32 %5, %3
%7 = shl nuw nsw i32 %6, 8
%8 = xor i32 %3, -1
%9 = and i32 %8, %4
%10 = or i32 %7, %9
ret i32 %10
}
int c086(void) { return 0; }


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

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

LLVM IR (-O0):
define i32 @c086() {
ret i32 0
}

LLVM IR (-O2):
define i32 @c086() {
ret i32 0
}
int main() {
  int stack_val1 = 5;
  int stack_val2 = 10;
  int stack_val3 = 15;
  int stack_val4 = 20;
  int stack_val5 = 25;
  int stack_val6 = 30;
  scanf("%d, %d\n", &stack_val1, stack_val2);
  printf("%d, %d\n", &stack_val3, &stack_val4);
  unknown_extern(0, &stack_val5, &stack_val6);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x5,-0x8(%rbp)
movl   $0xa,-0xc(%rbp)
movl   $0xf,-0x10(%rbp)
movl   $0x14,-0x14(%rbp)
movl   $0x19,-0x18(%rbp)
movl   $0x1e,-0x1c(%rbp)
mov    -0xc(%rbp),%edx
lea    0xe8d(%rip),%rdi
lea    -0x8(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
lea    0xe7b(%rip),%rdi
lea    -0x10(%rbp),%rsi
lea    -0x14(%rbp),%rdx
mov    $0x0,%al
call   1030 <printf@plt>
xor    %edi,%edi
lea    -0x18(%rbp),%rsi
lea    -0x1c(%rbp),%rdx
mov    $0x0,%al
call   1050 <unknown_extern@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x20,%rsp
movl   $0x5,0x1c(%rsp)
movl   $0xf,0x18(%rsp)
movl   $0x14,0x14(%rsp)
movl   $0x19,0x10(%rsp)
movl   $0x1e,0xc(%rsp)
lea    0xe9c(%rip),%rbx
lea    0x1c(%rsp),%rsi
mov    %rbx,%rdi
mov    $0xa,%edx
xor    %eax,%eax
call   1040 <scanf@plt>
lea    0x18(%rsp),%rsi
lea    0x14(%rsp),%rdx
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0x10(%rsp),%rsi
lea    0xc(%rsp),%rdx
xor    %edi,%edi
xor    %eax,%eax
call   1050 <unknown_extern@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [8 x i8] c"%d, %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = bitcast i32* %1 to i8*
store i32 5, i32* %1
%7 = bitcast i32* %2 to i8*
store i32 15, i32* %2
%8 = bitcast i32* %3 to i8*
store i32 20, i32* %3
%9 = bitcast i32* %4 to i8*
store i32 25, i32* %4
%10 = bitcast i32* %5 to i8*
store i32 30, i32* %5
%11 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32* %1, i32 10)
%12 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32* %2, i32* %3)
%13 = call i32 (i32, i32*, i32*, ...) bitcast (i32 (...)* @unknown_extern to i32 (i32, i32*, i32*, ...)*)(i32 0, i32* %4, i32* %5)
ret i32 0
}
void g_main_context_new() {}


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

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

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

LLVM IR (-O2):
define void @g_main_context_new() {
ret void
}
/* Variables and functions */
int atoi(char *);
double loop_REAL(float *, int);
float *malloc(int);
int /*<<< orphan*/ printf(char *, char *, double);
int main(int argc, char *argv[]) {
  int n = atoi(argv[1]);
  float *A = malloc(sizeof(float) * n);
  printf("%s %f\n", "N", loop_REAL(A, n));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1050 <atoi@plt>
mov    %eax,-0x14(%rbp)
movslq -0x14(%rbp),%rax
shl    $0x2,%rax
mov    %eax,%edi
call   1040 <malloc@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1060 <loop_REAL@plt>
lea    0xe74(%rip),%rdi
lea    0xe74(%rip),%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    0x8(%rsi),%rdi
call   1050 <atoi@plt>
mov    %eax,%ebx
lea    0x0(,%rbx,4),%edi
call   1040 <malloc@plt>
mov    %rax,%rdi
mov    %ebx,%esi
call   1060 <loop_REAL@plt>
lea    0xe97(%rip),%rdi
lea    0xe97(%rip),%rsi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [7 x i8] c"%s %f\0A\00"
@.str.1 = [2 x i8] c"N\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca float*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = load i8**, i8*** %5
%9 = getelementptr inbounds i8*, i8** %8, i64 1
%10 = load i8*, i8** %9
%11 = call i32 @atoi(i8* %10)
store i32 %11, i32* %6
%12 = load i32, i32* %6
%13 = sext i32 %12 to i64
%14 = mul i64 4, %13
%15 = trunc i64 %14 to i32
%16 = call float* @malloc(i32 %15)
store float* %16, float** %7
%17 = load float*, float** %7
%18 = load i32, i32* %6
%19 = call double @loop_REAL(float* %17, i32 %18)
%20 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), double %19)
ret i32 0
}

LLVM IR (-O2):
@.str = [7 x i8] c"%s %f\0A\00"
@.str.1 = [2 x i8] c"N\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = load i8*, i8** %3
%5 = tail call i32 @atoi(i8* %4)
%6 = shl i32 %5, 2
%7 = tail call float* @malloc(i32 %6)
%8 = tail call double @loop_REAL(float* %7, i32 %5)
%9 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), double %8)
ret i32 0
}
void foo45() {}


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

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

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

LLVM IR (-O2):
define void @foo45() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ num;

/* Variables and functions */
int /*<<< orphan*/ SwapWord(char *, int);
unsigned long little2bigul(unsigned long num) {
  SwapWord((char *)&num, sizeof(num));
  return num;
}


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

x86 assembly (clang, -O2):
<little2bigul>:
push   %rax
mov    %rdi,(%rsp)
mov    %rsp,%rdi
mov    $0x8,%esi
call   1030 <SwapWord@plt>
mov    (%rsp),%rax
pop    %rcx
ret

LLVM IR (-O0):
define i64 @little2bigul(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = bitcast i64* %2 to i8*
%4 = call i32 @SwapWord(i8* %3, i32 8)
%5 = load i64, i64* %2
ret i64 %5
}

LLVM IR (-O2):
define i64 @little2bigul(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = bitcast i64* %2 to i8*
%4 = call i32 @SwapWord(i8* %3, i32 8)
%5 = load i64, i64* %2
ret i64 %5
}
void swap(void *num1, void *num2) {
  void *t;
  t = num1;
  num1 = num2;
  num2 = t;
}


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

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

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

LLVM IR (-O2):
define void @swap(i8* nocapture %0, i8* nocapture %1) {
ret void
}
/* Variables and functions */
double fmod(double, int);
double greenwich_to_local_time(double lon, double gw_time) {
  double loc_time;
  loc_time = gw_time + lon / (3.14159265358979323846264338327 * 2.);
  if ((loc_time = fmod(loc_time, 1.)) < 0.)
    loc_time += 1.;
  return loc_time;
}


x86 assembly (clang, -O0):
<greenwich_to_local_time>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm1
movsd  0xecc(%rip),%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
mov    $0x1,%edi
call   1030 <fmod@plt>
movaps %xmm0,%xmm1
movsd  %xmm1,-0x18(%rbp)
xorps  %xmm0,%xmm0
ucomisd %xmm1,%xmm0
jbe    1177 <greenwich_to_local_time+0x67>
movsd  0xe9b(%rip),%xmm0
addsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<greenwich_to_local_time>:
push   %rax
divsd  0xee7(%rip),%xmm0
addsd  %xmm1,%xmm0
mov    $0x1,%edi
call   1030 <fmod@plt>
movsd  0xed9(%rip),%xmm2
addsd  %xmm0,%xmm2
xorpd  %xmm3,%xmm3
movapd %xmm0,%xmm1
cmpltsd %xmm3,%xmm1
andpd  %xmm1,%xmm2
andnpd %xmm0,%xmm1
orpd   %xmm2,%xmm1
movapd %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @greenwich_to_local_time(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
store double %0, double* %3
store double %1, double* %4
%6 = load double, double* %4
%7 = load double, double* %3
%8 = fdiv double %7, 0x401921FB54442D18
%9 = fadd double %6, %8
store double %9, double* %5
%10 = load double, double* %5
%11 = call double @fmod(double %10, i32 1)
store double %11, double* %5
%12 = fcmp olt double %11, 0.000000e+00
br i1 %12, label %13, label %16
13: ; preds = %2
%14 = load double, double* %5
%15 = fadd double %14, 1.000000e+00
store double %15, double* %5
br label %16
16: ; preds = %13, %2
%17 = load double, double* %5
ret double %17
}

LLVM IR (-O2):
define double @greenwich_to_local_time(double %0, double %1) {
%3 = fdiv double %0, 0x401921FB54442D18
%4 = fadd double %3, %1
%5 = tail call double @fmod(double %4, i32 1)
%6 = fcmp olt double %5, 0.000000e+00
%7 = fadd double %5, 1.000000e+00
%8 = select i1 %6, double %7, double %5
ret double %8
}
short fn3(int p) { return (1 >> p) < 1 ? 1 : p; }


x86 assembly (clang, -O0):
<fn3>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
mov    $0x1,%eax
sar    %cl,%eax
cmp    $0x1,%eax
jge    1127 <fn3+0x27>
mov    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    112d <fn3+0x2d>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cwtl
pop    %rbp
ret

x86 assembly (clang, -O2):
<fn3>:
xor    %eax,%eax
test   %edi,%edi
setne  %al
ret

LLVM IR (-O0):
define signext i16 @fn3(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = ashr i32 1, %3
%5 = icmp slt i32 %4, 1
br i1 %5, label %6, label %7
6: ; preds = %1
br label %9
7: ; preds = %1
%8 = load i32, i32* %2
br label %9
9: ; preds = %7, %6
%10 = phi i32 [ 1, %6 ], [ %8, %7 ]
%11 = trunc i32 %10 to i16
ret i16 %11
}

LLVM IR (-O2):
define signext i16 @fn3(i32 %0) {
%2 = icmp ne i32 %0, 0
%3 = zext i1 %2 to i16
ret i16 %3
}
int rand_int(int max) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @rand_int(i32 %0) {
ret i32 0
}
int fignore(struct soap *soap, const char *tag) { return 0; }


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

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

LLVM IR (-O0):
%struct.soap = type opaque
define i32 @fignore(%struct.soap* %0, i8* %1) {
%3 = alloca %struct.soap*
%4 = alloca i8*
store %struct.soap* %0, %struct.soap** %3
store i8* %1, i8** %4
ret i32 0
}

LLVM IR (-O2):
%struct.soap = type opaque
define i32 @fignore(%struct.soap* nocapture readnone %0, i8* nocapture readnone %1) {
ret i32 0
}
int dosub(int a, int b) { return a - b; }


x86 assembly (clang, -O0):
<dosub>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
sub    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<dosub>:
mov    %edi,%eax
sub    %esi,%eax
ret

LLVM IR (-O0):
define i32 @dosub(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 nsw i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @dosub(i32 %0, i32 %1) {
%3 = sub nsw i32 %0, %1
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ sigset_t;

/* Variables and functions */
int /*<<< orphan*/ EINVAL;
int NSIG;
int /*<<< orphan*/ __sigdelset(int /*<<< orphan*/ *, int);
int /*<<< orphan*/ errno;
int sigdelset(sigset_t *set, int signo) {
  if (signo <= 0 || signo >= NSIG) {
    errno = EINVAL;
    return -1;
  }
  __sigdelset(set, signo);
  return (0);
}


x86 assembly (clang, -O0):
<sigdelset>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jle    113b <sigdelset+0x2b>
mov    -0x14(%rbp),%eax
mov    0x2e9d(%rip),%rcx
cmp    (%rcx),%eax
jl     1159 <sigdelset+0x49>
mov    0x2e96(%rip),%rax
mov    (%rax),%ecx
mov    0x2e95(%rip),%rax
mov    %ecx,(%rax)
movl   $0xffffffff,-0x4(%rbp)
jmp    116c <sigdelset+0x5c>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1030 <__sigdelset@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sigdelset>:
push   %rax
test   %esi,%esi
jle    1129 <sigdelset+0x19>
mov    0x2eb4(%rip),%rax
cmp    %esi,(%rax)
jle    1129 <sigdelset+0x19>
call   1030 <__sigdelset@plt>
xor    %eax,%eax
pop    %rcx
ret
mov    0x2ea8(%rip),%rax
mov    (%rax),%eax
mov    0x2ea7(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@NSIG = global i32 0
@EINVAL = global i32 0
@errno = global i32 0
define i32 @sigdelset(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* %5
%7 = icmp sle i32 %6, 0
br i1 %7, label %12, label %8
8: ; preds = %2
%9 = load i32, i32* %5
%10 = load i32, i32* @NSIG
%11 = icmp sge i32 %9, %10
br i1 %11, label %12, label %14
12: ; preds = %8, %2
%13 = load i32, i32* @EINVAL
store i32 %13, i32* @errno
store i32 -1, i32* %3
br label %18
14: ; preds = %8
%15 = load i32*, i32** %4
%16 = load i32, i32* %5
%17 = call i32 @__sigdelset(i32* %15, i32 %16)
store i32 0, i32* %3
br label %18
18: ; preds = %14, %12
%19 = load i32, i32* %3
ret i32 %19
}

LLVM IR (-O2):
@NSIG = global i32 0
@EINVAL = global i32 0
@errno = global i32 0
define i32 @sigdelset(i32* %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
%4 = load i32, i32* @NSIG
%5 = icmp sgt i32 %4, %1
%6 = select i1 %3, i1 %5, i1 false
br i1 %6, label %9, label %7
7: ; preds = %2
%8 = load i32, i32* @EINVAL
store i32 %8, i32* @errno
br label %11
9: ; preds = %2
%10 = tail call i32 @__sigdelset(i32* %0, i32 %1)
br label %11
11: ; preds = %9, %7
%12 = phi i32 [ -1, %7 ], [ 0, %9 ]
ret i32 %12
}
/* Variables and functions */
unsigned short io_inportw(unsigned short);
void io_inportsw(unsigned short port, unsigned char *data, int length) {
  for (int i = 0; i < length; i++) {
    ((unsigned short *)data)[i] = io_inportw(port);
  }
}


x86 assembly (clang, -O0):
<io_inportsw>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    115f <io_inportsw+0x4f>
movzwl -0x2(%rbp),%edi
call   1030 <io_inportw@plt>
mov    %ax,%dx
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
mov    %dx,(%rax,%rcx,2)
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    112d <io_inportsw+0x1d>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<io_inportsw>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
test   %edx,%edx
jle    1145 <io_inportsw+0x35>
mov    %rsi,%r14
mov    %edx,%r15d
xor    %ebx,%ebx
movzwl %di,%ebp
cs nopw 0x0(%rax,%rax,1)
mov    %ebp,%edi
call   1030 <io_inportw@plt>
mov    %ax,(%r14,%rbx,2)
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <io_inportsw+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define void @io_inportsw(i16 zeroext %0, i8* nocapture writeonly %1, i32 %2) {
%4 = icmp sgt i32 %2, 0
br i1 %4, label %5, label %8
5: ; preds = %3
%6 = bitcast i8* %1 to i16*
%7 = zext i32 %2 to i64
br label %9
8: ; preds = %9, %3
ret void
9: ; preds = %5, %9
%10 = phi i64 [ 0, %5 ], [ %13, %9 ]
%11 = tail call zeroext i16 @io_inportw(i16 zeroext %0)
%12 = getelementptr inbounds i16, i16* %6, i64 %10
store i16 %11, i16* %12
%13 = add nuw nsw i64 %10, 1
%14 = icmp eq i64 %13, %7
br i1 %14, label %8, label %9
}
int f_eq_mr1(float *a1, float a2) { return (((*a1) == (a2))); }


x86 assembly (clang, -O0):
<f_eq_mr1>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm0
ucomiss -0xc(%rbp),%xmm0
sete   %al
setnp  %cl
and    %cl,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f_eq_mr1>:
cmpeqss (%rdi),%xmm0
movd   %xmm0,%eax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @f_eq_mr1(float* %0, float %1) {
%3 = alloca float*
%4 = alloca float
store float* %0, float** %3
store float %1, float* %4
%5 = load float*, float** %3
%6 = load float, float* %5
%7 = load float, float* %4
%8 = fcmp oeq float %6, %7
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @f_eq_mr1(float* nocapture %0, float %1) {
%3 = load float, float* %0
%4 = fcmp oeq float %3, %1
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ CLIENT;

/* Variables and functions */
int /*<<< orphan*/ rt_kprintf(char *, char const *);
void clnt_perror(CLIENT *rpch, const char *s) {
  rt_kprintf("rpc client error:%s\n", s);
}


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

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

LLVM IR (-O0):
@.str = [21 x i8] c"rpc client error:%s\0A\00"
define void @clnt_perror(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 @rt_kprintf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* %5)
ret void
}

LLVM IR (-O2):
@.str = [21 x i8] c"rpc client error:%s\0A\00"
define void @clnt_perror(i32* nocapture readnone %0, i8* %1) {
%3 = tail call i32 @rt_kprintf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* %1)
ret void
}
int S3C2410_UFCON_RXC(int fcon) {
  if (fcon & (1 << 8))
    return 16;
  return ((fcon) & (15 << 0)) >> (0);
}


x86 assembly (clang, -O0):
<S3C2410_UFCON_RXC>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
and    $0x100,%eax
cmp    $0x0,%eax
je     1124 <S3C2410_UFCON_RXC+0x24>
movl   $0x10,-0x4(%rbp)
jmp    1130 <S3C2410_UFCON_RXC+0x30>
mov    -0x8(%rbp),%eax
and    $0xf,%eax
sar    $0x0,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<S3C2410_UFCON_RXC>:
mov    %edi,%ecx
and    $0xf,%ecx
test   $0x100,%edi
mov    $0x10,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @S3C2410_UFCON_RXC(i32 %0) {
%2 = and i32 %0, 256
%3 = icmp eq i32 %2, 0
%4 = and i32 %0, 15
%5 = select i1 %3, i32 %4, i32 16
ret i32 %5
}
const char *Process_Definition(void) {
  return "struct Process {\n"
         "  FILE* proc;\n"
         "};\n";
}


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

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

LLVM IR (-O0):
@.str = [35 x i8] c"struct Process {\0A FILE* proc;\0A};\0A\00"
define i8* @Process_Definition() {
ret i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [35 x i8] c"struct Process {\0A FILE* proc;\0A};\0A\00"
define i8* @Process_Definition() {
ret i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ foo(int, char *);
char *itos(int);
int main() {
  int x = -0x7fffffff + 3;
  int i;
  for (i = 0; i < 4; ++i) {
    char *p;
    --x;
    p = itos(x);
    foo(i, p);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x80000004,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x4,-0xc(%rbp)
jge    1176 <main+0x56>
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1040 <itos@plt>
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%edi
mov    -0x18(%rbp),%rsi
call   1030 <foo@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    113d <main+0x1d>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x80000003,%edi
call   1040 <itos@plt>
xor    %edi,%edi
mov    %rax,%rsi
call   1030 <foo@plt>
mov    $0x80000002,%edi
call   1040 <itos@plt>
mov    $0x1,%edi
mov    %rax,%rsi
call   1030 <foo@plt>
mov    $0x80000001,%edi
call   1040 <itos@plt>
mov    $0x2,%edi
mov    %rax,%rsi
call   1030 <foo@plt>
mov    $0x80000000,%edi
call   1040 <itos@plt>
mov    $0x3,%edi
mov    %rax,%rsi
call   1030 <foo@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i8* @itos(i32 -2147483645)
%2 = tail call i32 @foo(i32 0, i8* %1)
%3 = tail call i8* @itos(i32 -2147483646)
%4 = tail call i32 @foo(i32 1, i8* %3)
%5 = tail call i8* @itos(i32 -2147483647)
%6 = tail call i32 @foo(i32 2, i8* %5)
%7 = tail call i8* @itos(i32 -2147483648)
%8 = tail call i32 @foo(i32 3, i8* %7)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void help(int val) {
  int val1 = val + 1;
  printf("val is %d\n", val1);
}


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

x86 assembly (clang, -O2):
<help>:
lea    0x1(%rdi),%esi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [11 x i8] c"val is %d\0A\00"
define void @help(i32 %0) {
%2 = add nsw i32 %0, 1
%3 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_SUCCESS;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ init_shell();
int main(int argc, char *argv[]) {
  init_shell();
  exit(EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <init_shell@plt>
mov    0x2e9c(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <init_shell@plt>
mov    0x2eb1(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 (...) @init_shell()
%7 = load i32, i32* @EXIT_SUCCESS
%8 = call i32 @exit(i32 %7)
unreachable
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @init_shell()
%4 = load i32, i32* @EXIT_SUCCESS
%5 = tail call i32 @exit(i32 %4)
unreachable
}
/* Variables and functions */
void Default_EGU1_IRQHandler(void) {
  while (1)
    ;
}


x86 assembly (clang, -O0):
<Default_EGU1_IRQHandler>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <Default_EGU1_IRQHandler+0x9>
jmp    1109 <Default_EGU1_IRQHandler+0x9>

x86 assembly (clang, -O2):
<Default_EGU1_IRQHandler>:
jmp    1100 <Default_EGU1_IRQHandler>

LLVM IR (-O0):
define void @Default_EGU1_IRQHandler() {
br label %1
1: ; preds = %0, %1
br label %1
}

LLVM IR (-O2):
define void @Default_EGU1_IRQHandler() {
br label %1
1: ; preds = %0, %1
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ aloja_espacio_e_inicializa_matrices();
int /*<<< orphan*/ imprime_matrices();
int /*<<< orphan*/ imprime_matriz_resultado();
int /*<<< orphan*/ libera_espacio();
int /*<<< orphan*/ multiplica_matrices();
int main(void) {
  aloja_espacio_e_inicializa_matrices();
  imprime_matrices();
  multiplica_matrices();
  imprime_matriz_resultado();
  libera_espacio();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <aloja_espacio_e_inicializa_matrices@plt>
mov    $0x0,%al
call   1050 <imprime_matrices@plt>
mov    $0x0,%al
call   1070 <multiplica_matrices@plt>
mov    $0x0,%al
call   1040 <imprime_matriz_resultado@plt>
mov    $0x0,%al
call   1060 <libera_espacio@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <aloja_espacio_e_inicializa_matrices@plt>
xor    %eax,%eax
call   1050 <imprime_matrices@plt>
xor    %eax,%eax
call   1070 <multiplica_matrices@plt>
xor    %eax,%eax
call   1040 <imprime_matriz_resultado@plt>
xor    %eax,%eax
call   1060 <libera_espacio@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @aloja_espacio_e_inicializa_matrices()
%3 = call i32 (...) @imprime_matrices()
%4 = call i32 (...) @multiplica_matrices()
%5 = call i32 (...) @imprime_matriz_resultado()
%6 = call i32 (...) @libera_espacio()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @aloja_espacio_e_inicializa_matrices()
%2 = tail call i32 (...) @imprime_matrices()
%3 = tail call i32 (...) @multiplica_matrices()
%4 = tail call i32 (...) @imprime_matriz_resultado()
%5 = tail call i32 (...) @libera_espacio()
ret i32 0
}
int test_imm_71uint8_reg(unsigned char val) {
  return ((val) & (0x71 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_71uint8_reg(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = and i32 %4, 113
%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_71uint8_reg(i8 zeroext %0) {
%2 = and i8 %0, 113
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
void foo708() {}


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

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

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

LLVM IR (-O2):
define void @foo708() {
ret void
}
unsigned int russianPleasant(unsigned int a, unsigned int b) {
  int res = 0;
  while (b > 0) {
    if (b & 1) {
      res = res + a;
    }
    a = a << 1;
    b = b >> 1;
  }
  return res;
}


x86 assembly (clang, -O0):
<russianPleasant>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
jbe    114a <russianPleasant+0x4a>
mov    -0x8(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     1133 <russianPleasant+0x33>
mov    -0xc(%rbp),%eax
add    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
shr    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1111 <russianPleasant+0x11>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<russianPleasant>:
xor    %eax,%eax
test   %esi,%esi
je     1126 <russianPleasant+0x26>
mov    %esi,%ecx
nopl   0x0(%rax,%rax,1)
mov    %esi,%edx
and    $0x1,%edx
neg    %edx
and    %edi,%edx
add    %edx,%eax
add    %edi,%edi
shr    %ecx
cmp    $0x1,%esi
mov    %ecx,%esi
ja     1110 <russianPleasant+0x10>
ret

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

LLVM IR (-O2):
define i32 @russianPleasant(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %15, label %4
4: ; preds = %2, %4
%5 = phi i32 [ %11, %4 ], [ 0, %2 ]
%6 = phi i32 [ %13, %4 ], [ %1, %2 ]
%7 = phi i32 [ %12, %4 ], [ %0, %2 ]
%8 = and i32 %6, 1
%9 = icmp eq i32 %8, 0
%10 = select i1 %9, i32 0, i32 %7
%11 = add i32 %10, %5
%12 = shl i32 %7, 1
%13 = lshr i32 %6, 1
%14 = icmp ult i32 %6, 2
br i1 %14, label %15, label %4
15: ; preds = %4, %2
%16 = phi i32 [ 0, %2 ], [ %11, %4 ]
ret i32 %16
}
const char *Current_Brief(void) { return "Implicit Object"; }


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

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

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

LLVM IR (-O2):
@.str = [16 x i8] c"Implicit Object\00"
define i8* @Current_Brief() {
ret i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0)
}