xunge/DecIR huggingface dataset:
/* Variables and functions */
bool SHAREMIND_SET_KEY_LESS_THAN_int(int const k1, int const k2) {
  return k1 < k2;
}


x86 assembly (clang, -O0):
<SHAREMIND_SET_KEY_LESS_THAN_int>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
setl   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<SHAREMIND_SET_KEY_LESS_THAN_int>:
xor    %eax,%eax
cmp    %esi,%edi
setl   %al
ret

LLVM IR (-O0):
define i32 @SHAREMIND_SET_KEY_LESS_THAN_int(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 = icmp slt i32 %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @SHAREMIND_SET_KEY_LESS_THAN_int(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ strcpy(char *, char *);
int TestTargetCompileFlags(char *m) {
  strcpy(m, "CMAKE SET_TARGET_PROPERTIES COMPILE_FLAGS did not work");
  return 0;
  strcpy(m, "CMAKE SET_TARGET_PROPERTIES COMPILE_FLAGS worked");
  return 1;
}


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

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

LLVM IR (-O0):
@.str = [55 x i8] c"CMAKE SET_TARGET_PROPERTIES COMPILE_FLAGS did not work\00"
define i32 @TestTargetCompileFlags(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @strcpy(i8* %3, i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [55 x i8] c"CMAKE SET_TARGET_PROPERTIES COMPILE_FLAGS did not work\00"
define i32 @TestTargetCompileFlags(i8* %0) {
%2 = tail call i32 @strcpy(i8* %0, i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ i;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  long i = 10;
  int size = sizeof(i);
  printf("%d\n", size);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movq   $0xa,-0x8(%rbp)
movl   $0x8,-0xc(%rbp)
mov    -0xc(%rbp),%esi
lea    0xecf(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 8)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint;

/* Variables and functions */
int CLAMP(int, int, int);
char *_lltoa_internal(long long, char *, int /*<<< orphan*/);
char *_ulltoa_internal(unsigned long long, char *, int /*<<< orphan*/);
char *lltoa(long long value, char *str, int base) {
  base = CLAMP(base, 2, 32);
  if (base != 10) {
    return _ulltoa_internal((unsigned long long)value, str, (uint)base);
  } else {
    return _lltoa_internal(value, str, (uint)base);
  }
}


x86 assembly (clang, -O0):
<lltoa>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
mov    -0x1c(%rbp),%edi
mov    $0x2,%esi
mov    $0x20,%edx
call   1030 <CLAMP@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0xa,-0x1c(%rbp)
je     117b <lltoa+0x4b>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x1c(%rbp),%edx
call   1050 <_ulltoa_internal@plt>
mov    %rax,-0x8(%rbp)
jmp    118f <lltoa+0x5f>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x1c(%rbp),%edx
call   1040 <_lltoa_internal@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lltoa>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
mov    %edx,%edi
mov    $0x2,%esi
mov    $0x20,%edx
call   1030 <CLAMP@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
cmp    $0xa,%eax
jne    1167 <lltoa+0x37>
mov    $0xa,%edx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <_lltoa_internal@plt>
mov    %eax,%edx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1050 <_ulltoa_internal@plt>

LLVM IR (-O0):
define i8* @lltoa(i64 %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i8*
%7 = alloca i32
store i64 %0, i64* %5
store i8* %1, i8** %6
store i32 %2, i32* %7
%8 = load i32, i32* %7
%9 = call i32 @CLAMP(i32 %8, i32 2, i32 32)
store i32 %9, i32* %7
%10 = load i32, i32* %7
%11 = icmp ne i32 %10, 10
br i1 %11, label %12, label %17
12: ; preds = %3
%13 = load i64, i64* %5
%14 = load i8*, i8** %6
%15 = load i32, i32* %7
%16 = call i8* @_ulltoa_internal(i64 %13, i8* %14, i32 %15)
store i8* %16, i8** %4
br label %22
17: ; preds = %3
%18 = load i64, i64* %5
%19 = load i8*, i8** %6
%20 = load i32, i32* %7
%21 = call i8* @_lltoa_internal(i64 %18, i8* %19, i32 %20)
store i8* %21, i8** %4
br label %22
22: ; preds = %17, %12
%23 = load i8*, i8** %4
ret i8* %23
}

LLVM IR (-O2):
define i8* @lltoa(i64 %0, i8* %1, i32 %2) {
%4 = tail call i32 @CLAMP(i32 %2, i32 2, i32 32)
%5 = icmp eq i32 %4, 10
br i1 %5, label %8, label %6
6: ; preds = %3
%7 = tail call i8* @_ulltoa_internal(i64 %0, i8* %1, i32 %4)
br label %10
8: ; preds = %3
%9 = tail call i8* @_lltoa_internal(i64 %0, i8* %1, i32 10)
br label %10
10: ; preds = %8, %6
%11 = phi i8* [ %7, %6 ], [ %9, %8 ]
ret i8* %11
}
int supports_x86_sse42(void) {
  __builtin_cpu_init();
  return __builtin_cpu_supports("sse4.2");
}


x86 assembly (clang, -O0):
<supports_x86_sse42>:
push   %rbp
mov    %rsp,%rbp
call   1040 <__cpu_indicator_init>
mov    0x2ecd(%rip),%eax
and    $0x100,%eax
cmp    $0x100,%eax
sete   %al
and    $0x1,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<supports_x86_sse42>:
push   %rax
call   1040 <__cpu_indicator_init>
mov    0x2ed0(%rip),%eax
shr    $0x8,%eax
and    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@__cpu_model = external global { i32, i32, i32, [1 x i32] }
define i32 @supports_x86_sse42() {
%1 = load i32, i32* getelementptr inbounds ({ i32, i32, i32, [1 x i32] }, { i32, i32, i32, [1 x i32] }* @__cpu_model, i32 0, i32 3, i32 0)
%2 = and i32 %1, 256
%3 = icmp eq i32 %2, 256
%4 = and i1 true, %3
%5 = zext i1 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
@__cpu_model = external global { i32, i32, i32, [1 x i32] }
define i32 @supports_x86_sse42() {
tail call void @__cpu_indicator_init()
%1 = load i32, i32* getelementptr inbounds ({ i32, i32, i32, [1 x i32] }, { i32, i32, i32, [1 x i32] }* @__cpu_model, i64 0, i32 3, i64 0)
%2 = lshr i32 %1, 8
%3 = and i32 %2, 1
ret i32 %3
}
int is_match(char a, char b) {
  if (a >= 'A' && a <= 'Z')
    a = a - 'A' + 'a';
  if (b >= 'A' && b <= 'Z')
    b = b - 'A' + 'a';
  return a == b;
}


x86 assembly (clang, -O0):
<is_match>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x41,%eax
jl     1137 <is_match+0x37>
movsbl -0x1(%rbp),%eax
cmp    $0x5a,%eax
jg     1137 <is_match+0x37>
movsbl -0x1(%rbp),%eax
sub    $0x41,%eax
add    $0x61,%eax
mov    %al,-0x1(%rbp)
movsbl -0x2(%rbp),%eax
cmp    $0x41,%eax
jl     115e <is_match+0x5e>
movsbl -0x2(%rbp),%eax
cmp    $0x5a,%eax
jg     115e <is_match+0x5e>
movsbl -0x2(%rbp),%eax
sub    $0x41,%eax
add    $0x61,%eax
mov    %al,-0x2(%rbp)
movsbl -0x1(%rbp),%eax
movsbl -0x2(%rbp),%ecx
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_match>:
lea    -0x41(%rdi),%eax
lea    0x20(%rdi),%ecx
cmp    $0x1a,%al
movzbl %cl,%ecx
cmovae %edi,%ecx
lea    -0x41(%rsi),%eax
lea    0x20(%rsi),%edx
cmp    $0x1a,%al
movzbl %dl,%edx
cmovae %esi,%edx
xor    %eax,%eax
cmp    %dl,%cl
sete   %al
ret

LLVM IR (-O0):
define i32 @is_match(i8 signext %0, i8 signext %1) {
%3 = alloca i8
%4 = alloca i8
store i8 %0, i8* %3
store i8 %1, i8* %4
%5 = load i8, i8* %3
%6 = sext i8 %5 to i32
%7 = icmp sge i32 %6, 65
br i1 %7, label %8, label %18
8: ; preds = %2
%9 = load i8, i8* %3
%10 = sext i8 %9 to i32
%11 = icmp sle i32 %10, 90
br i1 %11, label %12, label %18
12: ; preds = %8
%13 = load i8, i8* %3
%14 = sext i8 %13 to i32
%15 = sub nsw i32 %14, 65
%16 = add nsw i32 %15, 97
%17 = trunc i32 %16 to i8
store i8 %17, i8* %3
br label %18
18: ; preds = %12, %8, %2
%19 = load i8, i8* %4
%20 = sext i8 %19 to i32
%21 = icmp sge i32 %20, 65
br i1 %21, label %22, label %32
22: ; preds = %18
%23 = load i8, i8* %4
%24 = sext i8 %23 to i32
%25 = icmp sle i32 %24, 90
br i1 %25, label %26, label %32
26: ; preds = %22
%27 = load i8, i8* %4
%28 = sext i8 %27 to i32
%29 = sub nsw i32 %28, 65
%30 = add nsw i32 %29, 97
%31 = trunc i32 %30 to i8
store i8 %31, i8* %4
br label %32
32: ; preds = %26, %22, %18
%33 = load i8, i8* %3
%34 = sext i8 %33 to i32
%35 = load i8, i8* %4
%36 = sext i8 %35 to i32
%37 = icmp eq i32 %34, %36
%38 = zext i1 %37 to i32
ret i32 %38
}

LLVM IR (-O2):
define i32 @is_match(i8 signext %0, i8 signext %1) {
%3 = add i8 %0, -65
%4 = icmp ult i8 %3, 26
%5 = add i8 %0, 32
%6 = select i1 %4, i8 %5, i8 %0
%7 = add i8 %1, -65
%8 = icmp ult i8 %7, 26
%9 = add i8 %1, 32
%10 = select i1 %8, i8 %9, i8 %1
%11 = icmp eq i8 %6, %10
%12 = zext i1 %11 to i32
ret i32 %12
}
/* Type definitions */
struct utsname {
  char *sysname;
  char *nodename;
  char *version;
  char *machine;
};

/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char *, char *, char *, char *);
int /*<<< orphan*/ uname(struct utsname *);
void main() {
  struct utsname ut;
  uname(&ut);
  printf("%s %s %s %s\n", ut.sysname, ut.nodename, ut.version, ut.machine);
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    -0x20(%rbp),%rdi
call   1040 <uname@plt>
mov    -0x20(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x10(%rbp),%rcx
mov    -0x8(%rbp),%r8
lea    0xea8(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
lea    0x8(%rsp),%rdi
call   1040 <uname@plt>
mov    0x8(%rsp),%rsi
mov    0x10(%rsp),%rdx
mov    0x18(%rsp),%rcx
mov    0x20(%rsp),%r8
lea    0xea7(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
%struct.utsname = type { i8*, i8*, i8*, i8* }
@.str = [13 x i8] c"%s %s %s %s\0A\00"
define void @main() {
%1 = alloca %struct.utsname
%2 = call i32 @uname(%struct.utsname* %1)
%3 = getelementptr inbounds %struct.utsname, %struct.utsname* %1, i32 0, i32 0
%4 = load i8*, i8** %3
%5 = getelementptr inbounds %struct.utsname, %struct.utsname* %1, i32 0, i32 1
%6 = load i8*, i8** %5
%7 = getelementptr inbounds %struct.utsname, %struct.utsname* %1, i32 0, i32 2
%8 = load i8*, i8** %7
%9 = getelementptr inbounds %struct.utsname, %struct.utsname* %1, i32 0, i32 3
%10 = load i8*, i8** %9
%11 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %4, i8* %6, i8* %8, i8* %10)
%12 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
%struct.utsname = type { i8*, i8*, i8*, i8* }
@.str = [13 x i8] c"%s %s %s %s\0A\00"
define void @main() {
%1 = alloca %struct.utsname
%2 = bitcast %struct.utsname* %1 to i8*
%3 = call i32 @uname(%struct.utsname* %1)
%4 = getelementptr inbounds %struct.utsname, %struct.utsname* %1, i64 0, i32 0
%5 = load i8*, i8** %4
%6 = getelementptr inbounds %struct.utsname, %struct.utsname* %1, i64 0, i32 1
%7 = load i8*, i8** %6
%8 = getelementptr inbounds %struct.utsname, %struct.utsname* %1, i64 0, i32 2
%9 = load i8*, i8** %8
%10 = getelementptr inbounds %struct.utsname, %struct.utsname* %1, i64 0, i32 3
%11 = load i8*, i8** %10
%12 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %5, i8* %7, i8* %9, i8* %11)
%13 = tail call i32 @exit(i32 0)
unreachable
}
void foo786(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo786(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ scanf(char *, int *);
int getValue(void) {
  int iTmp;
  scanf("%d", &iTmp);
  return iTmp;
}


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

x86 assembly (clang, -O2):
<getValue>:
push   %rax
lea    0xee8(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1030 <scanf@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @getValue() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
ret i32 %4
}
void GC_write(void) {}


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

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

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

LLVM IR (-O2):
define void @GC_write() {
ret void
}
/* Variables and functions */
int strtol(char const *, int /*<<< orphan*/ *, int);
int s_atoi(const char *s, int init) {
  if (s)
    return strtol(s, NULL, 10);
  return init;
}


x86 assembly (clang, -O0):
<s_atoi>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1144 <s_atoi+0x34>
mov    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
mov    $0xa,%edx
call   1030 <strtol@plt>
mov    %eax,-0x4(%rbp)
jmp    114a <s_atoi+0x3a>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<s_atoi>:
test   %rdi,%rdi
je     1121 <s_atoi+0x11>
xor    %esi,%esi
mov    $0xa,%edx
jmp    1030 <strtol@plt>
mov    %esi,%eax
ret

LLVM IR (-O0):
define i32 @s_atoi(i8* %0, i32 %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
%6 = load i8*, i8** %4
%7 = icmp ne i8* %6, null
br i1 %7, label %8, label %11
8: ; preds = %2
%9 = load i8*, i8** %4
%10 = call i32 @strtol(i8* %9, i32* null, i32 10)
store i32 %10, i32* %3
br label %13
11: ; preds = %2
%12 = load i32, i32* %5
store i32 %12, i32* %3
br label %13
13: ; preds = %11, %8
%14 = load i32, i32* %3
ret i32 %14
}

LLVM IR (-O2):
define i32 @s_atoi(i8* %0, i32 %1) {
%3 = icmp eq i8* %0, null
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i32 @strtol(i8* nocapture %0, i32* null, i32 10)
br label %6
6: ; preds = %2, %4
%7 = phi i32 [ %5, %4 ], [ %1, %2 ]
ret i32 %7
}
__attribute__((__const__)) float wrapf(float x, float max) {
  while (x < 0.0f)
    x += max;
  while (x >= max)
    x -= max;
  return x;
}


x86 assembly (clang, -O0):
<wrapf>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
xorps  %xmm0,%xmm0
ucomiss -0x4(%rbp),%xmm0
jbe    112f <wrapf+0x2f>
movss  -0x8(%rbp),%xmm0
addss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    110e <wrapf+0xe>
jmp    1134 <wrapf+0x34>
movss  -0x4(%rbp),%xmm0
ucomiss -0x8(%rbp),%xmm0
jb     115b <wrapf+0x5b>
movss  -0x8(%rbp),%xmm1
movss  -0x4(%rbp),%xmm0
subss  %xmm1,%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    1134 <wrapf+0x34>
movss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<wrapf>:
xorps  %xmm2,%xmm2
ucomiss %xmm0,%xmm2
jbe    1124 <wrapf+0x24>
nopl   0x0(%rax,%rax,1)
addss  %xmm1,%xmm0
ucomiss %xmm0,%xmm2
ja     1110 <wrapf+0x10>
jmp    1124 <wrapf+0x24>
nopl   0x0(%rax,%rax,1)
subss  %xmm1,%xmm0
ucomiss %xmm1,%xmm0
jae    1120 <wrapf+0x20>
ret

LLVM IR (-O0):
define float @wrapf(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
br label %5
5: ; preds = %8, %2
%6 = load float, float* %3
%7 = fcmp olt float %6, 0.000000e+00
br i1 %7, label %8, label %12
8: ; preds = %5
%9 = load float, float* %4
%10 = load float, float* %3
%11 = fadd float %10, %9
store float %11, float* %3
br label %5
12: ; preds = %5
br label %13
13: ; preds = %17, %12
%14 = load float, float* %3
%15 = load float, float* %4
%16 = fcmp oge float %14, %15
br i1 %16, label %17, label %21
17: ; preds = %13
%18 = load float, float* %4
%19 = load float, float* %3
%20 = fsub float %19, %18
store float %20, float* %3
br label %13
21: ; preds = %13
%22 = load float, float* %3
ret float %22
}

LLVM IR (-O2):
define float @wrapf(float %0, float %1) {
%3 = fcmp olt float %0, 0.000000e+00
br i1 %3, label %7, label %4
4: ; preds = %7, %2
%5 = phi float [ %0, %2 ], [ %9, %7 ]
%6 = fcmp ult float %5, %1
br i1 %6, label %15, label %11
7: ; preds = %2, %7
%8 = phi float [ %9, %7 ], [ %0, %2 ]
%9 = fadd float %8, %1
%10 = fcmp olt float %9, 0.000000e+00
br i1 %10, label %7, label %4
11: ; preds = %4, %11
%12 = phi float [ %13, %11 ], [ %5, %4 ]
%13 = fsub float %12, %1
%14 = fcmp ult float %13, %1
br i1 %14, label %15, label %11
15: ; preds = %11, %4
%16 = phi float [ %5, %4 ], [ %13, %11 ]
ret float %16
}
int f(_Bool x) {
  if (x != 0)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
and    $0x1,%al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
cmp    $0x0,%eax
je     1129 <f+0x29>
movl   $0x1,-0x4(%rbp)
jmp    1130 <f+0x30>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @f(i1 zeroext %0) {
%2 = alloca i32
%3 = alloca i8
%4 = zext i1 %0 to i8
store i8 %4, i8* %3
%5 = load i8, i8* %3
%6 = trunc i8 %5 to i1
%7 = zext i1 %6 to i32
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %10
9: ; preds = %1
store i32 1, i32* %2
br label %11
10: ; preds = %1
store i32 0, i32* %2
br label %11
11: ; preds = %10, %9
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
define i32 @f(i1 zeroext %0) {
%2 = zext i1 %0 to i32
ret i32 %2
}
void next(char **q) {
  char *p = *q;
  while (*p && *p != ' ')
    p++;
  while (*p == ' ')
    *p++ = 0;
  *q = p;
}


x86 assembly (clang, -O0):
<next>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x11(%rbp)
je     1138 <next+0x38>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x20,%eax
setne  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    1148 <next+0x48>
jmp    1159 <next+0x59>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1113 <next+0x13>
jmp    115e <next+0x5e>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x20,%eax
jne    1185 <next+0x85>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movb   $0x0,(%rax)
jmp    115e <next+0x5e>
mov    -0x10(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<next>:
mov    (%rdi),%rax
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movzbl (%rax),%ecx
test   %cl,%cl
je     1144 <next+0x44>
cmp    $0x20,%cl
je     1130 <next+0x30>
add    $0x1,%rax
jmp    1110 <next+0x10>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
lea    0x1(%rax),%rcx
movb   $0x0,(%rax)
cmpb   $0x20,0x1(%rax)
mov    %rcx,%rax
je     1130 <next+0x30>
mov    %rcx,(%rdi)
ret
mov    %rax,%rcx
mov    %rcx,(%rdi)
ret

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

LLVM IR (-O2):
define void @next(i8** nocapture %0) {
%2 = load i8*, i8** %0
br label %3
3: ; preds = %6, %1
%4 = phi i8* [ %2, %1 ], [ %7, %6 ]
%5 = load i8, i8* %4
switch i8 %5, label %6 [
i8 32, label %8
i8 0, label %13
]
6: ; preds = %3
%7 = getelementptr inbounds i8, i8* %4, i64 1
br label %3
8: ; preds = %3, %8
%9 = phi i8* [ %10, %8 ], [ %4, %3 ]
%10 = getelementptr inbounds i8, i8* %9, i64 1
store i8 0, i8* %9
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 32
br i1 %12, label %8, label %13
13: ; preds = %3, %8
%14 = phi i8* [ %10, %8 ], [ %4, %3 ]
store i8* %14, i8** %0
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
void psd_fclose(void *file) { fclose((FILE *)file); }


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

x86 assembly (clang, -O2):
<psd_fclose>:
jmp    1030 <fclose@plt>

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

LLVM IR (-O2):
define void @psd_fclose(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = tail call i32 @fclose(i32* %2)
ret void
}
/* Variables and functions */
char *memchr(char *s, int c, unsigned n) {
  c = (char)c;
  while (n--) {
    if (*s == c)
      return s;
    s++;
  }
  return 0;
}


x86 assembly (clang, -O0):
<memchr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
mov    -0x14(%rbp),%eax
movsbl %al,%eax
mov    %eax,-0x14(%rbp)
mov    -0x18(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x18(%rbp)
cmp    $0x0,%eax
je     1159 <memchr+0x59>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    -0x14(%rbp),%eax
jne    1148 <memchr+0x48>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1161 <memchr+0x61>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1117 <memchr+0x17>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<memchr>:
test   %edx,%edx
je     1122 <memchr+0x22>
mov    %rdi,%rax
movsbl %sil,%ecx
nopl   0x0(%rax,%rax,1)
movsbl (%rax),%esi
cmp    %esi,%ecx
je     1124 <memchr+0x24>
add    $0xffffffff,%edx
add    $0x1,%rax
test   %edx,%edx
jne    1110 <memchr+0x10>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i8* @memchr(i8* %0, i32 %1, i32 %2) {
%4 = shl i32 %1, 24
%5 = ashr exact i32 %4, 24
%6 = icmp eq i32 %2, 0
br i1 %6, label %17, label %7
7: ; preds = %3, %14
%8 = phi i32 [ %10, %14 ], [ %2, %3 ]
%9 = phi i8* [ %15, %14 ], [ %0, %3 ]
%10 = add i32 %8, -1
%11 = load i8, i8* %9
%12 = sext i8 %11 to i32
%13 = icmp eq i32 %5, %12
br i1 %13, label %17, label %14
14: ; preds = %7
%15 = getelementptr inbounds i8, i8* %9, i64 1
%16 = icmp eq i32 %10, 0
br i1 %16, label %17, label %7
17: ; preds = %7, %14, %3
%18 = phi i8* [ null, %3 ], [ null, %14 ], [ %9, %7 ]
ret i8* %18
}
/* Variables and functions */
int vprintf(char *, void **);
int printf(char *fmt, ...) {
  void **pp = &fmt;
  return vprintf(fmt, pp + 1);
}


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

x86 assembly (clang, -O2):
<printf>:
push   %rax
mov    %rdi,(%rsp)
lea    0x8(%rsp),%rsi
call   1030 <vprintf@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @printf(i8* %0, ...) {
%2 = alloca i8*
%3 = alloca i8**
store i8* %0, i8** %2
store i8** %2, i8*** %3
%4 = load i8*, i8** %2
%5 = load i8**, i8*** %3
%6 = getelementptr inbounds i8*, i8** %5, i64 1
%7 = call i32 @vprintf(i8* %4, i8** %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @printf(i8* %0, ...) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = getelementptr inbounds i8*, i8** %2, i64 1
%4 = call i32 @vprintf(i8* %0, i8** %3)
ret i32 %4
}
int f1(char i, char j) { return (i + j); }


x86 assembly (clang, -O0):
<f1>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movsbl -0x1(%rbp),%eax
movsbl -0x2(%rbp),%ecx
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f1>:
lea    (%rdi,%rsi,1),%eax
ret

LLVM IR (-O0):
define i32 @f1(i8 signext %0, i8 signext %1) {
%3 = alloca i8
%4 = alloca i8
store i8 %0, i8* %3
store i8 %1, i8* %4
%5 = load i8, i8* %3
%6 = sext i8 %5 to i32
%7 = load i8, i8* %4
%8 = sext i8 %7 to i32
%9 = add nsw i32 %6, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @f1(i8 signext %0, i8 signext %1) {
%3 = sext i8 %0 to i32
%4 = sext i8 %1 to i32
%5 = add nsw i32 %4, %3
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, char *, char *);
scalar_t__ strlen(char *);
char *xmalloc(scalar_t__);
char *build_fspath(char *docroot, char *urlpath) {
  char *path;
  path = xmalloc(strlen(docroot) + 1 + strlen(urlpath) + 1);
  sprintf(path, "%s/%s", docroot, urlpath);
  return path;
}


x86 assembly (clang, -O0):
<build_fspath>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x20(%rbp),%rdi
add    %rax,%rdi
add    $0x1,%rdi
call   1040 <xmalloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
lea    0xe7f(%rip),%rsi
call   1050 <sprintf@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<build_fspath>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%r12
call   1030 <strlen@plt>
mov    %rax,%r15
mov    %r14,%rdi
call   1030 <strlen@plt>
lea    (%r15,%rax,1),%rdi
add    $0x2,%rdi
call   1040 <xmalloc@plt>
mov    %rax,%rbx
lea    0xe9b(%rip),%rsi
mov    %rax,%rdi
mov    %r12,%rdx
mov    %r14,%rcx
call   1050 <sprintf@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [6 x i8] c"%s/%s\00"
define i8* @build_fspath(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
%7 = call i64 @strlen(i8* %6)
%8 = add nsw i64 %7, 1
%9 = load i8*, i8** %4
%10 = call i64 @strlen(i8* %9)
%11 = add nsw i64 %8, %10
%12 = add nsw i64 %11, 1
%13 = call i8* @xmalloc(i64 %12)
store i8* %13, i8** %5
%14 = load i8*, i8** %5
%15 = load i8*, i8** %3
%16 = load i8*, i8** %4
%17 = call i32 @sprintf(i8* %14, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %15, i8* %16)
%18 = load i8*, i8** %5
ret i8* %18
}

LLVM IR (-O2):
@.str = [6 x i8] c"%s/%s\00"
define i8* @build_fspath(i8* %0, i8* %1) {
%3 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%4 = tail call i64 @strlen(i8* dereferenceable(1) %1)
%5 = add i64 %3, 2
%6 = add i64 %5, %4
%7 = tail call i8* @xmalloc(i64 %6)
%8 = tail call i32 @sprintf(i8* dereferenceable(1) %7, i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1)
ret i8* %7
}
/* Variables and functions */
int /*<<< orphan*/ daemonize();
int /*<<< orphan*/ sleep(int);
int main(void) {
  daemonize();
  while (1) {
    sleep(1);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <daemonize@plt>
mov    $0x1,%edi
call   1040 <sleep@plt>
jmp    1136 <main+0x16>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <daemonize@plt>
nopl   0x0(%rax,%rax,1)
mov    $0x1,%edi
call   1040 <sleep@plt>
jmp    1130 <main+0x10>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @daemonize()
br label %3
3: ; preds = %0, %3
%4 = call i32 @sleep(i32 1)
br label %3
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @daemonize()
br label %2
2: ; preds = %0, %2
%3 = tail call i32 @sleep(i32 1)
br label %2
}
/* Type definitions */
typedef int ssize_t;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ stderr;
int writen(int, void *, int);
void send_object_block(int sockfd, void *content, ssize_t length) {
  ssize_t write_len;
  do {
    write_len = writen(sockfd, content, length);
    if (write_len == -1) {
      if (0)
        fprintf(stderr, "Error transmitting data\n");
    }
  } while (write_len == 0);
  if (0)
    fprintf(stderr, "Data: %d bytes sent\n", length);
}


x86 assembly (clang, -O0):
<send_object_block>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <writen@plt>
mov    %eax,-0x18(%rbp)
cmpl   $0xffffffff,-0x18(%rbp)
jne    1143 <send_object_block+0x33>
jmp    1143 <send_object_block+0x33>
jmp    1148 <send_object_block+0x38>
cmpl   $0x0,-0x18(%rbp)
je     1122 <send_object_block+0x12>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<send_object_block>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%r14d
mov    %rsi,%rbx
mov    %edi,%ebp
nopl   0x0(%rax)
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %r14d,%edx
call   1030 <writen@plt>
test   %eax,%eax
je     1120 <send_object_block+0x10>
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@stderr = global i32 0
define void @send_object_block(i32 %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %4
store i8* %1, i8** %5
store i32 %2, i32* %6
br label %8
8: ; preds = %17, %3
%9 = load i32, i32* %4
%10 = load i8*, i8** %5
%11 = load i32, i32* %6
%12 = call i32 @writen(i32 %9, i8* %10, i32 %11)
store i32 %12, i32* %7
%13 = load i32, i32* %7
%14 = icmp eq i32 %13, -1
br i1 %14, label %15, label %16
15: ; preds = %8
br label %16
16: ; preds = %15, %8
br label %17
17: ; preds = %16
%18 = load i32, i32* %7
%19 = icmp eq i32 %18, 0
br i1 %19, label %8, label %20
20: ; preds = %17
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
define void @send_object_block(i32 %0, i8* %1, i32 %2) {
br label %4
4: ; preds = %4, %3
%5 = tail call i32 @writen(i32 %0, i8* %1, i32 %2)
%6 = icmp eq i32 %5, 0
br i1 %6, label %4, label %7
7: ; preds = %4
ret void
}
/* Variables and functions */
long *calloc(int, int);
int main() {
  long *val = calloc(5, sizeof(long));
  val[4] = 123;
  return val[4];
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x5,%edi
mov    $0x8,%esi
call   1030 <calloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movq   $0x7b,0x20(%rax)
mov    -0x10(%rbp),%rax
mov    0x20(%rax),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x5,%edi
mov    $0x8,%esi
call   1030 <calloc@plt>
mov    $0x7b,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i64*
store i32 0, i32* %1
%3 = call i64* @calloc(i32 5, i32 8)
store i64* %3, i64** %2
%4 = load i64*, i64** %2
%5 = getelementptr inbounds i64, i64* %4, i64 4
store i64 123, i64* %5
%6 = load i64*, i64** %2
%7 = getelementptr inbounds i64, i64* %6, i64 4
%8 = load i64, i64* %7
%9 = trunc i64 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i64* @calloc(i32 5, i32 8)
ret i32 123
}
/* Variables and functions */
char *getcwd(char *, int);
char *getwd(char path[]) { return getcwd(path, 1024); }


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

x86 assembly (clang, -O2):
<getwd>:
mov    $0x400,%esi
jmp    1030 <getcwd@plt>

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

LLVM IR (-O2):
define i8* @getwd(i8* %0) {
%2 = tail call i8* @getcwd(i8* %0, i32 1024)
ret i8* %2
}
void __hlt_stackmap_init() {}


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

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

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

LLVM IR (-O2):
define void @__hlt_stackmap_init() {
ret void
}
void mdp4_dsi_video_vsync_ctrl(struct fb_info *info, int enable) {}


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

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

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

LLVM IR (-O2):
%struct.fb_info = type opaque
define void @mdp4_dsi_video_vsync_ctrl(%struct.fb_info* nocapture %0, i32 %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ FS460_image_request_freeze(int /*<<< orphan*/, int,
                                              int /*<<< orphan*/);
int /*<<< orphan*/ FS460_set_black_image();
void black_test(void) {
  static int mode = 0;
  switch (mode++) {
  default:
    mode = 1;
  case 0:
    FS460_set_black_image();
    break;
  case 1:
    FS460_image_request_freeze(0, 0x0002 | 0x0001, 0);
    break;
  }
}


x86 assembly (clang, -O0):
<black_test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2f06(%rip),%eax
mov    %eax,-0x4(%rbp)
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,0x2ef8(%rip)
test   %eax,%eax
je     1164 <black_test+0x44>
jmp    1149 <black_test+0x29>
mov    -0x4(%rbp),%eax
sub    $0x1,%eax
je     1170 <black_test+0x50>
jmp    115a <black_test+0x3a>
movl   $0x1,0x2ed0(%rip)
mov    $0x0,%al
call   1040 <FS460_set_black_image@plt>
jmp    117e <black_test+0x5e>
xor    %edx,%edx
mov    $0x3,%esi
mov    %edx,%edi
call   1030 <FS460_image_request_freeze@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<black_test>:
mov    0x2f0e(%rip),%eax
lea    0x1(%rax),%ecx
mov    %ecx,0x2f05(%rip)
test   %eax,%eax
je     1150 <black_test+0x30>
cmp    $0x1,%eax
jne    1146 <black_test+0x26>
xor    %edi,%edi
mov    $0x3,%esi
xor    %edx,%edx
jmp    1030 <FS460_image_request_freeze@plt>
movl   $0x1,0x2ee4(%rip)
xor    %eax,%eax
jmp    1040 <FS460_set_black_image@plt>

LLVM IR (-O0):
@black_test.mode = internal global i32 0
define void @black_test() {
%1 = load i32, i32* @black_test.mode
%2 = add nsw i32 %1, 1
store i32 %2, i32* @black_test.mode
switch i32 %1, label %3 [
i32 0, label %4
i32 1, label %6
]
3: ; preds = %0
store i32 1, i32* @black_test.mode
br label %4
4: ; preds = %0, %3
%5 = call i32 (...) @FS460_set_black_image()
br label %8
6: ; preds = %0
%7 = call i32 @FS460_image_request_freeze(i32 0, i32 3, i32 0)
br label %8
8: ; preds = %6, %4
ret void
}

LLVM IR (-O2):
@black_test.mode = internal unnamed_addr global i32 0
define void @black_test() {
%1 = load i32, i32* @black_test.mode
%2 = add nsw i32 %1, 1
store i32 %2, i32* @black_test.mode
switch i32 %1, label %3 [
i32 0, label %4
i32 1, label %6
]
3: ; preds = %0
store i32 1, i32* @black_test.mode
br label %4
4: ; preds = %0, %3
%5 = tail call i32 (...) @FS460_set_black_image()
br label %8
6: ; preds = %0
%7 = tail call i32 @FS460_image_request_freeze(i32 0, i32 3, i32 0)
br label %8
8: ; preds = %6, %4
ret void
}
/* Type definitions */
struct protocol_state {
  int dummy;
};

/* Variables and functions */
int write_bytes(struct protocol_state *, char *, int);
int write_delim(struct protocol_state *ps) { return write_bytes(ps, "\n", 1); }


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

x86 assembly (clang, -O2):
<write_delim>:
lea    0xee9(%rip),%rsi
mov    $0x1,%edx
jmp    1030 <write_bytes@plt>

LLVM IR (-O0):
%struct.protocol_state = type { i32 }
@.str = [2 x i8] c"\0A\00"
define i32 @write_delim(%struct.protocol_state* %0) {
%2 = alloca %struct.protocol_state*
store %struct.protocol_state* %0, %struct.protocol_state** %2
%3 = load %struct.protocol_state*, %struct.protocol_state** %2
%4 = call i32 @write_bytes(%struct.protocol_state* %3, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 1)
ret i32 %4
}

LLVM IR (-O2):
%struct.protocol_state = type { i32 }
@.str = [2 x i8] c"\0A\00"
define i32 @write_delim(%struct.protocol_state* %0) {
%2 = tail call i32 @write_bytes(%struct.protocol_state* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 1)
ret i32 %2
}
/* Variables and functions */
int SIGUSR1;
int SIGUSR2;
int /*<<< orphan*/ printf(char *);
void sig_usr(int signo) {
  if (signo == SIGUSR1)
    printf("catch signal SIGUSR1\n");
  if (signo == SIGUSR2)
    printf("catch signal SIGUSR2\n");
}


x86 assembly (clang, -O0):
<sig_usr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    0x2ec3(%rip),%rcx
cmp    (%rcx),%eax
jne    1139 <sig_usr+0x29>
lea    0xecc(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
mov    0x2e95(%rip),%rcx
cmp    (%rcx),%eax
jne    1157 <sig_usr+0x47>
lea    0xec4(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sig_usr>:
push   %rbx
mov    %edi,%ebx
mov    0x2ece(%rip),%rax
cmp    %edi,(%rax)
jne    112a <sig_usr+0x1a>
lea    0xef0(%rip),%rdi
call   1030 <puts@plt>
mov    0x2ea7(%rip),%rax
cmp    %ebx,(%rax)
jne    1142 <sig_usr+0x32>
lea    0xec4(%rip),%rdi
pop    %rbx
jmp    1030 <puts@plt>
pop    %rbx
ret

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

LLVM IR (-O2):
@SIGUSR1 = global i32 0
@SIGUSR2 = global i32 0
@str = [21 x i8] c"catch signal SIGUSR2\00"
@str.2 = [21 x i8] c"catch signal SIGUSR1\00"
define void @sig_usr(i32 %0) {
%2 = load i32, i32* @SIGUSR1
%3 = icmp eq i32 %2, %0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str.2, i64 0, i64 0))
br label %6
6: ; preds = %4, %1
%7 = load i32, i32* @SIGUSR2
%8 = icmp eq i32 %7, %0
br i1 %8, label %9, label %11
9: ; preds = %6
%10 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str, i64 0, i64 0))
br label %11
11: ; preds = %9, %6
ret void
}
int main() {
  int x = 128000;
  show_bytes(&x, sizeof(int));
  float y = 1.0;
  show_bytes(&y, sizeof(float));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1f400,-0x8(%rbp)
lea    -0x8(%rbp),%rdi
mov    $0x4,%esi
mov    $0x0,%al
call   1030 <show_bytes@plt>
movss  0xec2(%rip),%xmm0
movss  %xmm0,-0xc(%rbp)
lea    -0xc(%rbp),%rdi
mov    $0x4,%esi
mov    $0x0,%al
call   1030 <show_bytes@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0x1f400,0x4(%rsp)
lea    0x4(%rsp),%rdi
mov    $0x4,%esi
xor    %eax,%eax
call   1030 <show_bytes@plt>
movl   $0x3f800000,(%rsp)
mov    %rsp,%rdi
mov    $0x4,%esi
xor    %eax,%eax
call   1030 <show_bytes@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca float
store i32 0, i32* %1
store i32 128000, i32* %2
%4 = call i32 (i32*, i64, ...) bitcast (i32 (...)* @show_bytes to i32 (i32*, i64, ...)*)(i32* %2, i64 4)
store float 1.000000e+00, float* %3
%5 = call i32 (float*, i64, ...) bitcast (i32 (...)* @show_bytes to i32 (float*, i64, ...)*)(float* %3, i64 4)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = bitcast i32* %1 to i8*
store i32 128000, i32* %1
%4 = call i32 (i32*, i64, ...) bitcast (i32 (...)* @show_bytes to i32 (i32*, i64, ...)*)(i32* %1, i64 4)
%5 = bitcast float* %2 to i8*
store float 1.000000e+00, float* %2
%6 = call i32 (float*, i64, ...) bitcast (i32 (...)* @show_bytes to i32 (float*, i64, ...)*)(float* %2, i64 4)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ __u64;

/* Variables and functions */
int /*<<< orphan*/ hea_set_u64_bits(int /*<<< orphan*/, int /*<<< orphan*/, int,
                                    int);
void hea_cq_aer_eq_par_id_invalid_err_reset(__u64 *aer) {
  *aer = hea_set_u64_bits(*aer, 0, 9, 9);
}


x86 assembly (clang, -O0):
<hea_cq_aer_eq_par_id_invalid_err_reset>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
xor    %esi,%esi
mov    $0x9,%ecx
mov    %ecx,%edx
call   1030 <hea_set_u64_bits@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hea_cq_aer_eq_par_id_invalid_err_reset>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%edi
xor    %esi,%esi
mov    $0x9,%edx
mov    $0x9,%ecx
call   1030 <hea_set_u64_bits@plt>
mov    %eax,(%rbx)
pop    %rbx
ret

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

LLVM IR (-O2):
define void @hea_cq_aer_eq_par_id_invalid_err_reset(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = tail call i32 @hea_set_u64_bits(i32 %2, i32 0, i32 9, i32 9)
store i32 %3, i32* %0
ret void
}
int Bematech_FI_LeituraAliquotas(Var, Retorno) {
  return Formata("\x1b|26|\x1b", Var, Retorno);
}


x86 assembly (clang, -O0):
<Bematech_FI_LeituraAliquotas>:
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_LeituraAliquotas>:
mov    %esi,%edx
mov    %edi,%esi
lea    0xee5(%rip),%rdi
xor    %eax,%eax
jmp    1030 <Formata@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"\1B|26|\1B\00"
define i32 @Bematech_FI_LeituraAliquotas(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 ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %5, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
@.str = [7 x i8] c"\1B|26|\1B\00"
define i32 @Bematech_FI_LeituraAliquotas(i32 %0, i32 %1) {
%3 = tail call i32 (i8*, i32, i32, ...) bitcast (i32 (...)* @Formata to i32 (i8*, i32, i32, ...)*)(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1)
ret i32 %3
}
void rop3_22_0_0(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  unsigned char stk3;
  unsigned char stk4;
  stk4 = T & S;
  stk4 = ~stk4;
  stk3 = *D & stk4;
  stk2 = S ^ stk3;
  stk1 = T ^ stk2;
  *D = stk1;
}


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

x86 assembly (clang, -O2):
<rop3_22_0_0>:
mov    %edx,%eax
and    %sil,%al
not    %al
and    (%rdi),%al
xor    %sil,%dl
xor    %al,%dl
mov    %dl,(%rdi)
ret

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

LLVM IR (-O2):
define void @rop3_22_0_0(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = and i8 %2, %1
%5 = xor i8 %4, -1
%6 = load i8, i8* %0
%7 = and i8 %6, %5
%8 = xor i8 %2, %1
%9 = xor i8 %8, %7
store i8 %9, i8* %0
ret void
}