xunge/DecIR huggingface dataset:
/* Variables and functions */
char *notImplemented();
char *serverModifyDocument(char *key, char *userId, char *change) {
  return notImplemented();
}


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

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

LLVM IR (-O0):
define i8* @serverModifyDocument(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = call i8* (...) @notImplemented()
ret i8* %7
}

LLVM IR (-O2):
define i8* @serverModifyDocument(i8* nocapture readnone %0, i8* nocapture readnone %1, i8* nocapture readnone %2) {
%4 = tail call i8* (...) @notImplemented()
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ abort();
void __f90_MAIN(void) { abort(); }


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

x86 assembly (clang, -O2):
<__f90_MAIN>:
push   %rax
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define void @__f90_MAIN() {
%1 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
define void @__f90_MAIN() {
%1 = tail call i32 (...) @abort()
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void test_func0() { printf("%d", 42); }


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

x86 assembly (clang, -O2):
<test_func0>:
lea    0xee9(%rip),%rdi
mov    $0x2a,%esi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
define void @test_func0() {
%1 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 42)
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define void @test_func0() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 42)
ret void
}
int ft_sqrt(int nb) {
  int i;
  int square;
  i = 0;
  square = 0;
  while (i < nb / 2) {
    square = i * i;
    if (square == nb)
      return (i);
    i++;
  }
  return (-1);
}


x86 assembly (clang, -O0):
<ft_sqrt>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x14(%rbp),%eax
cmp    %ecx,%eax
jge    1162 <ft_sqrt+0x62>
mov    -0xc(%rbp),%eax
imul   -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x8(%rbp),%eax
jne    1154 <ft_sqrt+0x54>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1169 <ft_sqrt+0x69>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1115 <ft_sqrt+0x15>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_sqrt>:
mov    $0xffffffff,%eax
cmp    $0x2,%edi
jl     1130 <ft_sqrt+0x30>
mov    %edi,%ecx
shr    $0x1f,%ecx
add    %edi,%ecx
sar    %ecx
xor    %edx,%edx
cs nopw 0x0(%rax,%rax,1)
nop
mov    %edx,%esi
imul   %edx,%esi
cmp    %edi,%esi
je     1131 <ft_sqrt+0x31>
add    $0x1,%edx
cmp    %edx,%ecx
jne    1120 <ft_sqrt+0x20>
ret
mov    %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @ft_sqrt(i32 %0) {
%2 = sdiv i32 %0, 2
%3 = icmp sgt i32 %0, 1
br i1 %3, label %4, label %11
4: ; preds = %1, %8
%5 = phi i32 [ %9, %8 ], [ 0, %1 ]
%6 = mul nsw i32 %5, %5
%7 = icmp eq i32 %6, %0
br i1 %7, label %11, label %8
8: ; preds = %4
%9 = add nuw nsw i32 %5, 1
%10 = icmp eq i32 %9, %2
br i1 %10, label %11, label %4
11: ; preds = %4, %8, %1
%12 = phi i32 [ -1, %1 ], [ -1, %8 ], [ %5, %4 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ Platform_Halt(int);
int errno;
scalar_t__ rename(char *, char *);
int Platform_Rename(unsigned char *o, long long o__len, unsigned char *n,
                    long long n__len) {
  int _o_result;
  if (rename((char *)o, (char *)n) < 0) {
    _o_result = errno;
    return _o_result;
  } else {
    _o_result = 0;
    return _o_result;
  }
__retchk:
  Platform_Halt(-3);
  return 0;
  ;
}


x86 assembly (clang, -O0):
<Platform_Rename>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1030 <rename@plt>
cmp    $0x0,%rax
jge    1156 <Platform_Rename+0x46>
mov    0x2e9a(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1163 <Platform_Rename+0x53>
movl   $0x0,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Platform_Rename>:
push   %rax
mov    %rdx,%rsi
call   1030 <rename@plt>
mov    0x2ec0(%rip),%rcx
sar    $0x3f,%rax
and    (%rcx),%eax
pop    %rcx
ret

LLVM IR (-O0):
@errno = global i32 0
define i32 @Platform_Rename(i8* %0, i64 %1, i8* %2, i64 %3) {
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i64
%8 = alloca i8*
%9 = alloca i64
%10 = alloca i32
store i8* %0, i8** %6
store i64 %1, i64* %7
store i8* %2, i8** %8
store i64 %3, i64* %9
%11 = load i8*, i8** %6
%12 = load i8*, i8** %8
%13 = call i64 @rename(i8* %11, i8* %12)
%14 = icmp slt i64 %13, 0
br i1 %14, label %15, label %18
15: ; preds = %4
%16 = load i32, i32* @errno
store i32 %16, i32* %10
%17 = load i32, i32* %10
store i32 %17, i32* %5
br label %22
18: ; preds = %4
store i32 0, i32* %10
%19 = load i32, i32* %10
store i32 %19, i32* %5
br label %22
20: ; No predecessors!
%21 = call i32 @Platform_Halt(i32 -3)
store i32 0, i32* %5
br label %22
22: ; preds = %20, %18, %15
%23 = load i32, i32* %5
ret i32 %23
}

LLVM IR (-O2):
@errno = global i32 0
define i32 @Platform_Rename(i8* nocapture %0, i64 %1, i8* nocapture %2, i64 %3) {
%5 = tail call i64 @rename(i8* %0, i8* %2)
%6 = icmp slt i64 %5, 0
%7 = load i32, i32* @errno
%8 = select i1 %6, i32 %7, i32 0
ret i32 %8
}
void RTAvloGCPhysGetBestFit(void) {}


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

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

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

LLVM IR (-O2):
define void @RTAvloGCPhysGetBestFit() {
ret void
}
int test_imm_C3int64_midword_mem(long long *val) {
  return ((*val >> 16) & (0xC3 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_C3int64_midword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 12779520
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
int count_bits(unsigned long i) {
  i = (i & 0x55555555) + (i >> 1 & 0x55555555);
  i = (i & 0x33333333) + (i >> 2 & 0x33333333);
  i = (i & 0x0f0f0f0f) + (i >> 4 & 0x0f0f0f0f);
  i = (i & 0x00ff00ff) + (i >> 8 & 0x00ff00ff);
  return (i & 0x0000ffff) + (i >> 16 & 0x0000ffff);
}


x86 assembly (clang, -O0):
<count_bits>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
and    $0x55555555,%rax
mov    -0x8(%rbp),%rcx
shr    $0x1,%rcx
and    $0x55555555,%rcx
add    %rcx,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
and    $0x33333333,%rax
mov    -0x8(%rbp),%rcx
shr    $0x2,%rcx
and    $0x33333333,%rcx
add    %rcx,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
and    $0xf0f0f0f,%rax
mov    -0x8(%rbp),%rcx
shr    $0x4,%rcx
and    $0xf0f0f0f,%rcx
add    %rcx,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
and    $0xff00ff,%rax
mov    -0x8(%rbp),%rcx
shr    $0x8,%rcx
and    $0xff00ff,%rcx
add    %rcx,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
and    $0xffff,%rax
mov    -0x8(%rbp),%rcx
shr    $0x10,%rcx
and    $0xffff,%rcx
add    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<count_bits>:
mov    %edi,%eax
and    $0x55555555,%eax
shr    %rdi
and    $0x55555555,%edi
add    %rdi,%rax
mov    %eax,%ecx
and    $0x33333333,%ecx
shr    $0x2,%rax
and    $0x33333333,%eax
add    %rcx,%rax
mov    %eax,%ecx
and    $0x7070707,%ecx
shr    $0x4,%rax
and    $0x7070707,%eax
add    %rcx,%rax
mov    %eax,%ecx
and    $0xf000f,%ecx
shr    $0x8,%rax
and    $0xf000f,%eax
add    %rcx,%rax
movzwl %ax,%ecx
shr    $0x10,%rax
add    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @count_bits(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = and i64 %3, 1431655765
%5 = load i64, i64* %2
%6 = lshr i64 %5, 1
%7 = and i64 %6, 1431655765
%8 = add i64 %4, %7
store i64 %8, i64* %2
%9 = load i64, i64* %2
%10 = and i64 %9, 858993459
%11 = load i64, i64* %2
%12 = lshr i64 %11, 2
%13 = and i64 %12, 858993459
%14 = add i64 %10, %13
store i64 %14, i64* %2
%15 = load i64, i64* %2
%16 = and i64 %15, 252645135
%17 = load i64, i64* %2
%18 = lshr i64 %17, 4
%19 = and i64 %18, 252645135
%20 = add i64 %16, %19
store i64 %20, i64* %2
%21 = load i64, i64* %2
%22 = and i64 %21, 16711935
%23 = load i64, i64* %2
%24 = lshr i64 %23, 8
%25 = and i64 %24, 16711935
%26 = add i64 %22, %25
store i64 %26, i64* %2
%27 = load i64, i64* %2
%28 = and i64 %27, 65535
%29 = load i64, i64* %2
%30 = lshr i64 %29, 16
%31 = and i64 %30, 65535
%32 = add i64 %28, %31
%33 = trunc i64 %32 to i32
ret i32 %33
}

LLVM IR (-O2):
define i32 @count_bits(i64 %0) {
%2 = and i64 %0, 1431655765
%3 = lshr i64 %0, 1
%4 = and i64 %3, 1431655765
%5 = add nuw nsw i64 %4, %2
%6 = and i64 %5, 858993459
%7 = lshr i64 %5, 2
%8 = and i64 %7, 858993459
%9 = add nuw nsw i64 %8, %6
%10 = and i64 %9, 117901063
%11 = lshr i64 %9, 4
%12 = and i64 %11, 117901063
%13 = add nuw nsw i64 %12, %10
%14 = and i64 %13, 983055
%15 = lshr i64 %13, 8
%16 = and i64 %15, 983055
%17 = add nuw nsw i64 %16, %14
%18 = and i64 %17, 31
%19 = lshr i64 %17, 16
%20 = add nuw nsw i64 %18, %19
%21 = trunc i64 %20 to i32
ret i32 %21
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, ...);
void print_help(char *cmd, int flag) {
  printf("Usage: %s <sz> <nservers>\n", cmd);
  printf("\tsz       : Size in GB\n");
  printf("\tnservers : Number of servers\n");
  if (flag)
    exit(0);
}


x86 assembly (clang, -O0):
<print_help>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xed3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xedd(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
cmpl   $0x0,-0xc(%rbp)
je     116e <print_help+0x4e>
xor    %edi,%edi
call   1040 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_help>:
push   %rbx
mov    %esi,%ebx
mov    %rdi,%rsi
lea    0xec3(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xed0(%rip),%rdi
call   1030 <puts@plt>
lea    0xedb(%rip),%rdi
call   1030 <puts@plt>
test   %ebx,%ebx
jne    1162 <print_help+0x32>
pop    %rbx
ret
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [27 x i8] c"Usage: %s <sz> <nservers>\0A\00"
@.str.1 = [24 x i8] c"\09sz : Size in GB\0A\00"
@.str.2 = [31 x i8] c"\09nservers : Number of servers\0A\00"
define void @print_help(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8* %5)
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0))
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.2, i64 0, i64 0))
%9 = load i32, i32* %4
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %13
11: ; preds = %2
%12 = call i32 @exit(i32 0)
unreachable
13: ; preds = %2
ret void
}

LLVM IR (-O2):
@.str = [27 x i8] c"Usage: %s <sz> <nservers>\0A\00"
@str = [23 x i8] c"\09sz : Size in GB\00"
@str.3 = [30 x i8] c"\09nservers : Number of servers\00"
define void @print_help(i8* %0, i32 %1) {
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str, i64 0, i64 0))
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str.3, i64 0, i64 0))
%6 = icmp eq i32 %1, 0
br i1 %6, label %9, label %7
7: ; preds = %2
%8 = tail call i32 @exit(i32 0)
unreachable
9: ; preds = %2
ret void
}
/* Variables and functions */
char *base64encode(char const *);
char *_ds_encode_base64(const char *body) { return base64encode(body); }


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

x86 assembly (clang, -O2):
<_ds_encode_base64>:
jmp    1030 <base64encode@plt>

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

LLVM IR (-O2):
define i8* @_ds_encode_base64(i8* %0) {
%2 = tail call i8* @base64encode(i8* %0)
ret i8* %2
}
/* Variables and functions */
void emu_32x_startup(void) {}


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

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

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

LLVM IR (-O2):
define void @emu_32x_startup() {
ret void
}
void ble_evt_attributes_value(
    const struct ble_msg_attributes_value_evt_t *msg) {}


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

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

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

LLVM IR (-O2):
%struct.ble_msg_attributes_value_evt_t = type opaque
define void @ble_evt_attributes_value(%struct.ble_msg_attributes_value_evt_t* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ sprintf(char *, char *, int, long);
int prova() {
  char buffer[80];
  int i = 1;
  long j = 2;
  sprintf(buffer, "Prova %d, %l\n", i, j);
  exit(0);
}


x86 assembly (clang, -O0):
<prova>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movl   $0x1,-0x54(%rbp)
movq   $0x2,-0x60(%rbp)
lea    -0x50(%rbp),%rdi
mov    -0x54(%rbp),%edx
mov    -0x60(%rbp),%rcx
lea    0xeb7(%rip),%rsi
call   1030 <sprintf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<prova>:
sub    $0x58,%rsp
lea    0xed5(%rip),%rsi
mov    %rsp,%rdi
mov    $0x2,%ecx
mov    $0x1,%edx
call   1030 <sprintf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"Prova %d, %l\0A\00"
define i32 @prova() {
%1 = alloca [80 x i8]
%2 = alloca i32
%3 = alloca i64
store i32 1, i32* %2
store i64 2, i64* %3
%4 = getelementptr inbounds [80 x i8], [80 x i8]* %1, i64 0, i64 0
%5 = load i32, i32* %2
%6 = load i64, i64* %3
%7 = call i32 @sprintf(i8* %4, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %5, i64 %6)
%8 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [14 x i8] c"Prova %d, %l\0A\00"
define i32 @prova() {
%1 = alloca [80 x i8]
%2 = getelementptr inbounds [80 x i8], [80 x i8]* %1, i64 0, i64 0
%3 = call i32 @sprintf(i8* %2, i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 1, i64 2)
%4 = tail call i32 @exit(i32 0)
unreachable
}
int test_imm_7Dint16_reg(short val) {
  return ((val) & (-0x7D << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_7Dint16_reg>:
test   $0xff83,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_7Dint16_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, -125
%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_7Dint16_reg(i16 signext %0) {
%2 = and i16 %0, -125
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ sigset_t;

/* Variables and functions */
int sigfillset(int /*<<< orphan*/ *);
int main(void) {
  sigset_t set;
  int status;
  status = sigfillset(&set);
  return status;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0x4(%rsp),%rdi
call   1030 <sigfillset@plt>
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @sigfillset(i32* %1)
ret i32 %3
}
/* Type definitions */
struct utmpx {
  int dummy;
};

/* Variables and functions */
scalar_t__ getutent();
struct utmpx *getutxent(void) {
  return (struct utmpx *)getutent();
}


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

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

LLVM IR (-O0):
%struct.utmpx = type { i32 }
define %struct.utmpx* @getutxent() {
%1 = call i64 (...) @getutent()
%2 = inttoptr i64 %1 to %struct.utmpx*
ret %struct.utmpx* %2
}

LLVM IR (-O2):
%struct.utmpx = type { i32 }
define %struct.utmpx* @getutxent() {
%1 = tail call i64 (...) @getutent()
%2 = inttoptr i64 %1 to %struct.utmpx*
ret %struct.utmpx* %2
}
void ADC_SAR_1_RestoreConfig(void) {}


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

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

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

LLVM IR (-O2):
define void @ADC_SAR_1_RestoreConfig() {
ret void
}
void EVP_DecryptFinal(void) {}


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

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

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

LLVM IR (-O2):
define void @EVP_DecryptFinal() {
ret void
}
int GCD(int i, int j) {
  int t;
  while (j != 0) {
    t;
    t = j;
    j = i % j;
    i = t;
  }
  return t;
}


x86 assembly (clang, -O0):
<GCD>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     112f <GCD+0x2f>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %edx,-0x8(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    110a <GCD+0xa>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<GCD>:
test   %esi,%esi
je     111e <GCD+0x1e>
mov    %esi,%edx
mov    %edi,%eax
nopl   0x0(%rax,%rax,1)
mov    %edx,%ecx
cltd
idiv   %ecx
mov    %ecx,%eax
test   %edx,%edx
jne    1110 <GCD+0x10>
mov    %ecx,%eax
ret
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @GCD(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %9, label %4
4: ; preds = %2, %4
%5 = phi i32 [ %7, %4 ], [ %1, %2 ]
%6 = phi i32 [ %5, %4 ], [ %0, %2 ]
%7 = srem i32 %6, %5
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %4
9: ; preds = %4, %2
%10 = phi i32 [ undef, %2 ], [ %5, %4 ]
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void Set_Config_PWM_Out_Param(int stPwmParam) {
  printf("This is Option 2.\n");
  return;
}


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

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

LLVM IR (-O0):
@.str = [19 x i8] c"This is Option 2.\0A\00"
define void @Set_Config_PWM_Out_Param(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [18 x i8] c"This is Option 2.\00"
define void @Set_Config_PWM_Out_Param(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str, i64 0, i64 0))
ret void
}
long sockShutdown() { return 0; }


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

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

LLVM IR (-O0):
define i64 @sockShutdown() {
ret i64 0
}

LLVM IR (-O2):
define i64 @sockShutdown() {
ret i64 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ yyparse();
main(void) {
  yyparse();
  printf("\nTerminé\n\n");
}


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

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

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

LLVM IR (-O2):
@str = [11 x i8] c"\0ATermin\C3\A9\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @yyparse()
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str, i64 0, i64 0))
ret i32 0
}
unsigned int autofs_type_any(unsigned int type) { return (type == 0U); }


x86 assembly (clang, -O0):
<autofs_type_any>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @autofs_type_any(i32 %0) {
%2 = icmp eq i32 %0, 0
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ putchar(char);
scalar_t__ random();
int /*<<< orphan*/ srandom(scalar_t__);
int main(void) {
  static int element;
  while (element++ < 10) {
    srandom(random());
    printf("%d ", (int)random());
  }
  putchar('\n');
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2eef(%rip),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,0x2ee4(%rip)
cmp    $0xa,%eax
jge    1192 <main+0x52>
mov    $0x0,%al
call   1060 <random@plt>
mov    %rax,%rdi
call   1040 <srandom@plt>
mov    $0x0,%al
call   1060 <random@plt>
mov    %eax,%esi
lea    0xe78(%rip),%rdi
call   1050 <printf@plt>
jmp    114f <main+0xf>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    0x2efd(%rip),%eax
lea    0x1(%rax),%ecx
mov    %ecx,0x2ef4(%rip)
cmp    $0x9,%eax
jg     1194 <main+0x54>
lea    0xea4(%rip),%rbx
nopl   0x0(%rax)
xor    %eax,%eax
call   1060 <random@plt>
mov    %rax,%rdi
call   1040 <srandom@plt>
xor    %eax,%eax
call   1060 <random@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1050 <printf@plt>
mov    0x2ebe(%rip),%eax
lea    0x1(%rax),%ecx
mov    %ecx,0x2eb5(%rip)
cmp    $0xa,%eax
jl     1160 <main+0x20>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@main.element = internal global i32 0
@.str = [4 x i8] c"%d \00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %6, %0
%3 = load i32, i32* @main.element
%4 = add nsw i32 %3, 1
store i32 %4, i32* @main.element
%5 = icmp slt i32 %3, 10
br i1 %5, label %6, label %12
6: ; preds = %2
%7 = call i64 (...) @random()
%8 = call i32 @srandom(i64 %7)
%9 = call i64 (...) @random()
%10 = trunc i64 %9 to i32
%11 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %10)
br label %2
12: ; preds = %2
%13 = call i32 @putchar(i8 signext 10)
ret i32 0
}

LLVM IR (-O2):
@main.element = internal unnamed_addr global i32 0
@.str = [4 x i8] c"%d \00"
define i32 @main() {
%1 = load i32, i32* @main.element
%2 = add nsw i32 %1, 1
store i32 %2, i32* @main.element
%3 = icmp slt i32 %1, 10
br i1 %3, label %4, label %13
4: ; preds = %0, %4
%5 = tail call i64 (...) @random()
%6 = tail call i32 @srandom(i64 %5)
%7 = tail call i64 (...) @random()
%8 = trunc i64 %7 to i32
%9 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %8)
%10 = load i32, i32* @main.element
%11 = add nsw i32 %10, 1
store i32 %11, i32* @main.element
%12 = icmp slt i32 %10, 10
br i1 %12, label %4, label %13
13: ; preds = %4, %0
%14 = tail call i32 @putchar(i8 signext 10)
ret i32 0
}
int isletter(char c) { return 'a' <= c && c <= 'z'; }


x86 assembly (clang, -O0):
<isletter>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edx
xor    %eax,%eax
mov    $0x61,%ecx
cmp    %edx,%ecx
mov    %al,-0x2(%rbp)
jg     112d <isletter+0x2d>
movsbl -0x1(%rbp),%eax
cmp    $0x7a,%eax
setle  %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isletter>:
add    $0x9f,%dil
xor    %eax,%eax
cmp    $0x1a,%dil
setb   %al
ret

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

LLVM IR (-O2):
define i32 @isletter(i8 signext %0) {
%2 = add i8 %0, -97
%3 = icmp ult i8 %2, 26
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ SEEK_SET;
int /*<<< orphan*/ exit(int);
int lseek(int, int, int /*<<< orphan*/);
int /*<<< orphan*/ perror(char *);
void do_lseek(int fd, int ofs) {
  int rc = lseek(fd, ofs, SEEK_SET);
  if (rc < 0) {
    perror("lseek");
    exit(1);
  }
}


x86 assembly (clang, -O0):
<do_lseek>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    0x2e95(%rip),%rax
mov    (%rax),%edx
call   1030 <lseek@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jge    1175 <do_lseek+0x45>
lea    0xe9a(%rip),%rdi
call   1040 <perror@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_lseek>:
push   %rax
mov    0x2ea8(%rip),%rax
mov    (%rax),%edx
call   1030 <lseek@plt>
test   %eax,%eax
js     1145 <do_lseek+0x15>
pop    %rax
ret
lea    0xeb4(%rip),%rdi
call   1040 <perror@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

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

LLVM IR (-O2):
@SEEK_SET = global i32 0
@.str = [6 x i8] c"lseek\00"
define void @do_lseek(i32 %0, i32 %1) {
%3 = load i32, i32* @SEEK_SET
%4 = tail call i32 @lseek(i32 %0, i32 %1, i32 %3)
%5 = icmp slt i32 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %2
%7 = tail call i32 @perror(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%8 = tail call i32 @exit(i32 1)
unreachable
9: ; preds = %2
ret void
}
/* Variables and functions */
int sprintf(char *, char *, int);
int GetHillFormulaIndexLength(int count) {
  char szCount[16];
  if (count > 1) {
    return sprintf(szCount, "%d", count);
  }
  return 0;
}


x86 assembly (clang, -O0):
<GetHillFormulaIndexLength>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
jle    1140 <GetHillFormulaIndexLength+0x30>
lea    -0x20(%rbp),%rdi
mov    -0x8(%rbp),%edx
lea    0xecd(%rip),%rsi
call   1030 <sprintf@plt>
mov    %eax,-0x4(%rbp)
jmp    1147 <GetHillFormulaIndexLength+0x37>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GetHillFormulaIndexLength>:
xor    %eax,%eax
cmp    $0x2,%edi
jl     1130 <GetHillFormulaIndexLength+0x20>
sub    $0x18,%rsp
mov    %edi,%edx
lea    0xedc(%rip),%rsi
mov    %rsp,%rdi
call   1030 <sprintf@plt>
add    $0x18,%rsp
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @GetHillFormulaIndexLength(i32 %0) {
%2 = alloca [16 x i8]
%3 = getelementptr inbounds [16 x i8], [16 x i8]* %2, i64 0, i64 0
%4 = icmp sgt i32 %0, 1
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = call i32 @sprintf(i8* %3, i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %0)
br label %7
7: ; preds = %1, %5
%8 = phi i32 [ %6, %5 ], [ 0, %1 ]
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ ReverseGPIOP__1__Out__toggle();
void LedsP__Led2__toggle(void) { ReverseGPIOP__1__Out__toggle(); }


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

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

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

LLVM IR (-O2):
define void @LedsP__Led2__toggle() {
%1 = tail call i32 (...) @ReverseGPIOP__1__Out__toggle()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(unsigned long);
int /*<<< orphan*/ printf(char *, int, unsigned long);
__attribute__((__noreturn__)) void exitfunc6(int status, void *arg) {
  printf("Executing exitfunc"
         "6"
         " (status=%d, arg=%lu)\n",
         status, (unsigned long)arg);
  exit((unsigned long)arg);
}


x86 assembly (clang, -O0):
<exitfunc6>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rdx
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%rdi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<exitfunc6>:
push   %rbx
mov    %rsi,%rbx
mov    %edi,%esi
lea    0xed3(%rip),%rdi
mov    %rbx,%rdx
call   1030 <printf@plt>
mov    %rbx,%rdi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [42 x i8] c"Executing exitfunc6 (status=%d, arg=%lu)\0A\00"
define void @exitfunc6(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i32, i32* %3
%6 = load i8*, i8** %4
%7 = ptrtoint i8* %6 to i64
%8 = call i32 @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0), i32 %5, i64 %7)
%9 = load i8*, i8** %4
%10 = ptrtoint i8* %9 to i64
%11 = call i32 @exit(i64 %10)
unreachable
}

LLVM IR (-O2):
@.str = [42 x i8] c"Executing exitfunc6 (status=%d, arg=%lu)\0A\00"
define void @exitfunc6(i32 %0, i8* %1) {
%3 = ptrtoint i8* %1 to i64
%4 = tail call i32 @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0), i32 %0, i64 %3)
%5 = tail call i32 @exit(i64 %3)
unreachable
}
/* Type definitions */
struct timespec {
  int dummy;
};

/* Variables and functions */
int nanosleep(struct timespec *, struct timespec *);
int os_nanosleep(struct timespec *Req, struct timespec *Rem) {
  return nanosleep(Req, Rem);
}


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

x86 assembly (clang, -O2):
<os_nanosleep>:
jmp    1030 <nanosleep@plt>

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

LLVM IR (-O2):
%struct.timespec = type { i32 }
define i32 @os_nanosleep(%struct.timespec* %0, %struct.timespec* %1) {
%3 = tail call i32 @nanosleep(%struct.timespec* %0, %struct.timespec* %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void setup_viewer(void) {
  printf("Sorry, can't do X viewing in this version.\n");
}


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

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

LLVM IR (-O0):
@.str = [44 x i8] c"Sorry, can't do X viewing in this version.\0A\00"
define void @setup_viewer() {
%1 = call i32 @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [43 x i8] c"Sorry, can't do X viewing in this version.\00"
define void @setup_viewer() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @str, i64 0, i64 0))
ret void
}
int testAuto(int initVal) {
  int sm;
  int tmp = sm;
  sm = initVal;
  return tmp;
}


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

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

LLVM IR (-O0):
define i32 @testAuto(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
%5 = load i32, i32* %3
store i32 %5, i32* %4
%6 = load i32, i32* %2
store i32 %6, i32* %3
%7 = load i32, i32* %4
ret i32 %7
}

LLVM IR (-O2):
define i32 @testAuto(i32 returned %0) {
ret i32 %0
}
/* Variables and functions */
int /*<<< orphan*/ beolv(char *, int *);
int /*<<< orphan*/ getBull();
int /*<<< orphan*/ kiir(char *, int /*<<< orphan*/);
int /*<<< orphan*/ setBull(int);
int bullmenu() {
  int l;
  kiir("Engedelyezed a BULLET TIME-ot?(1 - igen, 0 - nem)(Jelenleg %d): ",
       getBull());
  beolv("%d", &l);
  if (l >= 0 && l <= 1) {
    setBull(l);
  }
  return 1;
}


x86 assembly (clang, -O0):
<bullmenu>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <getBull@plt>
mov    %eax,%esi
lea    0xea8(%rip),%rdi
call   1030 <kiir@plt>
lea    0xedd(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1060 <beolv@plt>
cmpl   $0x0,-0x4(%rbp)
jl     1189 <bullmenu+0x49>
cmpl   $0x1,-0x4(%rbp)
jg     1189 <bullmenu+0x49>
mov    -0x4(%rbp),%edi
call   1050 <setBull@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bullmenu>:
push   %rax
xor    %eax,%eax
call   1040 <getBull@plt>
lea    0xeb1(%rip),%rdi
mov    %eax,%esi
call   1030 <kiir@plt>
lea    0xee4(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1060 <beolv@plt>
mov    0x4(%rsp),%edi
cmp    $0x1,%edi
ja     1175 <bullmenu+0x35>
call   1050 <setBull@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [65 x i8] c"Engedelyezed a BULLET TIME-ot?(1 - igen, 0 - nem)(Jelenleg %d): \00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @bullmenu() {
%1 = alloca i32
%2 = call i32 (...) @getBull()
%3 = call i32 @kiir(i8* getelementptr inbounds ([65 x i8], [65 x i8]* @.str, i64 0, i64 0), i32 %2)
%4 = call i32 @beolv(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = icmp sge i32 %5, 0
br i1 %6, label %7, label %13
7: ; preds = %0
%8 = load i32, i32* %1
%9 = icmp sle i32 %8, 1
br i1 %9, label %10, label %13
10: ; preds = %7
%11 = load i32, i32* %1
%12 = call i32 @setBull(i32 %11)
br label %13
13: ; preds = %10, %7, %0
ret i32 1
}

LLVM IR (-O2):
@.str = [65 x i8] c"Engedelyezed a BULLET TIME-ot?(1 - igen, 0 - nem)(Jelenleg %d): \00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @bullmenu() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 (...) @getBull()
%4 = tail call i32 @kiir(i8* getelementptr inbounds ([65 x i8], [65 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = call i32 @beolv(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%6 = load i32, i32* %1
%7 = icmp ult i32 %6, 2
br i1 %7, label %8, label %10
8: ; preds = %0
%9 = call i32 @setBull(i32 %6)
br label %10
10: ; preds = %8, %0
ret i32 1
}
void main(void) { asm("cpuid" ::: "eax", "ebx", "ecx", "edx"); }


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

x86 assembly (clang, -O2):
<main>:
push   %rbx
cpuid
pop    %rbx
ret

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

LLVM IR (-O2):
define void @main() {
tail call void asm sideeffect "cpuid", "~{eax},~{ebx},~{ecx},~{edx},~{dirflag},~{fpsr},~{flags}"()
ret void
}
int jac_chain_nm7_alloc(void **mem, const int *idata, const double *rdata) {
  if (mem)
    *mem = 0;
  (void)idata;
  (void)rdata;
  return 0;
}


x86 assembly (clang, -O0):
<jac_chain_nm7_alloc>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1126 <jac_chain_nm7_alloc+0x26>
mov    -0x8(%rbp),%rax
movq   $0x0,(%rax)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<jac_chain_nm7_alloc>:
test   %rdi,%rdi
je     110c <jac_chain_nm7_alloc+0xc>
movq   $0x0,(%rdi)
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @jac_chain_nm7_alloc(i8** writeonly %0, i32* nocapture readnone %1, double* nocapture readnone %2) {
%4 = icmp eq i8** %0, null
br i1 %4, label %6, label %5
5: ; preds = %3
store i8* null, i8** %0
br label %6
6: ; preds = %5, %3
ret i32 0
}
/* Variables and functions */
char *tokenParser(char *, char *, int, char *);
char *dbParser(char *header) { return tokenParser(header, "|", 3, "dbParser"); }


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

x86 assembly (clang, -O2):
<dbParser>:
lea    0xee9(%rip),%rsi
lea    0xee4(%rip),%rcx
mov    $0x3,%edx
jmp    1030 <tokenParser@plt>

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

LLVM IR (-O2):
@.str = [2 x i8] c"|\00"
@.str.1 = [9 x i8] c"dbParser\00"
define i8* @dbParser(i8* %0) {
%2 = tail call i8* @tokenParser(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 3, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ CSU_DriverIRQHandler();
__attribute__((weak)) void CSU_IRQHandler(void) { CSU_DriverIRQHandler(); }


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

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

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

LLVM IR (-O2):
define weak void @CSU_IRQHandler() {
%1 = tail call i32 (...) @CSU_DriverIRQHandler()
ret void
}
int sys$deltva(struct _va_range *inadr, struct _va_range *retadr,
               unsigned int acmode) {
  return ({
    unsigned long resultvar;
    register long int _a3 asm("rdx") = (long)(acmode);
    register long int _a2 asm("rsi") = (long)(retadr);
    register long int _a1 asm("rdi") = (long)(inadr);
    asm volatile("movq %1, %%rax\n\t"
                 "int $0x81\n\t"
                 : "=a"(resultvar)
                 : "i"(52), "r"(_a1), "r"(_a2), "r"(_a3)
                 : "memory", "cc", "r11", "cx");
    (long)resultvar;
  });
}


x86 assembly (clang, -O0):
<sys$deltva>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x38(%rbp),%rdi
mov    -0x30(%rbp),%rsi
mov    -0x28(%rbp),%rdx
mov    $0x34,%rax
int    $0x81
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x40(%rbp)
mov    -0x40(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sys$deltva>:
mov    %edx,%edx
mov    $0x34,%rax
int    $0x81
ret

LLVM IR (-O0):
%struct._va_range = type opaque
define i32 @"sys$deltva"(%struct._va_range* %0, %struct._va_range* %1, i32 %2) {
%4 = alloca %struct._va_range*
%5 = alloca %struct._va_range*
%6 = alloca i32
%7 = alloca i64
%8 = alloca i64
%9 = alloca i64
%10 = alloca i64
%11 = alloca i64
store %struct._va_range* %0, %struct._va_range** %4
store %struct._va_range* %1, %struct._va_range** %5
store i32 %2, i32* %6
%12 = load i32, i32* %6
%13 = zext i32 %12 to i64
store i64 %13, i64* %8
%14 = load %struct._va_range*, %struct._va_range** %5
%15 = ptrtoint %struct._va_range* %14 to i64
store i64 %15, i64* %9
%16 = load %struct._va_range*, %struct._va_range** %4
%17 = ptrtoint %struct._va_range* %16 to i64
store i64 %17, i64* %10
%18 = load i64, i64* %10
%19 = load i64, i64* %9
%20 = load i64, i64* %8
%21 = call i64 asm sideeffect "movq $1, %rax\0A\09int $$0x81\0A\09", "={ax},i,{rdi},{rsi},{rdx},~{memory},~{cc},~{r11},~{cx},~{dirflag},~{fpsr},~{flags}"(i32 52, i64 %18, i64 %19, i64 %20)
store i64 %21, i64* %7
%22 = load i64, i64* %7
store i64 %22, i64* %11
%23 = load i64, i64* %11
%24 = trunc i64 %23 to i32
ret i32 %24
}

LLVM IR (-O2):
%struct._va_range = type opaque
define i32 @"sys$deltva"(%struct._va_range* %0, %struct._va_range* %1, i32 %2) {
%4 = zext i32 %2 to i64
%5 = ptrtoint %struct._va_range* %1 to i64
%6 = ptrtoint %struct._va_range* %0 to i64
%7 = tail call i64 asm sideeffect "movq $1, %rax\0A\09int $$0x81\0A\09", "={ax},i,{rdi},{rsi},{rdx},~{memory},~{cc},~{r11},~{cx},~{dirflag},~{fpsr},~{flags}"(i32 52, i64 %6, i64 %5, i64 %4)
%8 = trunc i64 %7 to i32
ret i32 %8
}