xunge/DecIR huggingface dataset:
char HttpStatus_isInformational(int code) {
  return (code >= 100 && code < 200);
}


x86 assembly (clang, -O0):
<HttpStatus_isInformational>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x64,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jl     1123 <HttpStatus_isInformational+0x23>
cmpl   $0xc8,-0x4(%rbp)
setl   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<HttpStatus_isInformational>:
add    $0xffffff9c,%edi
cmp    $0x64,%edi
setb   %al
ret

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

LLVM IR (-O2):
define signext i8 @HttpStatus_isInformational(i32 %0) {
%2 = add i32 %0, -100
%3 = icmp ult i32 %2, 100
%4 = zext i1 %3 to i8
ret i8 %4
}
long hashmap_hash_cstring(void *in_context, void *in_key) {
  unsigned long hash = 5381;
  unsigned char *key = (unsigned char *)in_key;
  int c;
  while ((c = *(key++))) {
    hash = ((hash << 5) + hash) + c;
  }
  return hash;
}


x86 assembly (clang, -O0):
<hashmap_hash_cstring>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x1505,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x20(%rbp)
movzbl (%rax),%eax
mov    %eax,-0x24(%rbp)
cmp    $0x0,%eax
je     1156 <hashmap_hash_cstring+0x56>
mov    -0x18(%rbp),%rax
shl    $0x5,%rax
add    -0x18(%rbp),%rax
movslq -0x24(%rbp),%rcx
add    %rcx,%rax
mov    %rax,-0x18(%rbp)
jmp    111c <hashmap_hash_cstring+0x1c>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hashmap_hash_cstring>:
mov    (%rsi),%cl
test   %cl,%cl
je     112c <hashmap_hash_cstring+0x2c>
add    $0x1,%rsi
mov    $0x1505,%eax
nop
mov    %rax,%rdx
shl    $0x5,%rdx
add    %rax,%rdx
movzbl %cl,%eax
add    %rdx,%rax
movzbl (%rsi),%ecx
add    $0x1,%rsi
test   %cl,%cl
jne    1110 <hashmap_hash_cstring+0x10>
ret
mov    $0x1505,%eax
ret

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

LLVM IR (-O2):
define i64 @hashmap_hash_cstring(i8* nocapture readnone %0, i8* nocapture %1) {
%3 = load i8, i8* %1
%4 = icmp eq i8 %3, 0
br i1 %4, label %15, label %5
5: ; preds = %2, %5
%6 = phi i8 [ %13, %5 ], [ %3, %2 ]
%7 = phi i64 [ %12, %5 ], [ 5381, %2 ]
%8 = phi i8* [ %9, %5 ], [ %1, %2 ]
%9 = getelementptr inbounds i8, i8* %8, i64 1
%10 = mul i64 %7, 33
%11 = zext i8 %6 to i64
%12 = add i64 %10, %11
%13 = load i8, i8* %9
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %5
15: ; preds = %5, %2
%16 = phi i64 [ 5381, %2 ], [ %12, %5 ]
ret i64 %16
}
/* Variables and functions */
int /*<<< orphan*/ lcdc_enable();
int /*<<< orphan*/ lcdc_init();
int /*<<< orphan*/ xpm_init();
void lcddisplay_init() {
  lcdc_init();
  lcdc_enable();
  xpm_init();
}


x86 assembly (clang, -O0):
<lcddisplay_init>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <lcdc_init@plt>
mov    $0x0,%al
call   1050 <lcdc_enable@plt>
mov    $0x0,%al
call   1040 <xpm_init@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<lcddisplay_init>:
push   %rax
xor    %eax,%eax
call   1030 <lcdc_init@plt>
xor    %eax,%eax
call   1050 <lcdc_enable@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <xpm_init@plt>

LLVM IR (-O0):
define void @lcddisplay_init() {
%1 = call i32 (...) @lcdc_init()
%2 = call i32 (...) @lcdc_enable()
%3 = call i32 (...) @xpm_init()
ret void
}

LLVM IR (-O2):
define void @lcddisplay_init() {
%1 = tail call i32 (...) @lcdc_init()
%2 = tail call i32 (...) @lcdc_enable()
%3 = tail call i32 (...) @xpm_init()
ret void
}
int ether_line(const char *l, struct ether_addr *e, char *hostname) {
  return -1;
}


x86 assembly (clang, -O0):
<ether_line>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ether_line>:
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
%struct.ether_addr = type opaque
define i32 @ether_line(i8* %0, %struct.ether_addr* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca %struct.ether_addr*
%6 = alloca i8*
store i8* %0, i8** %4
store %struct.ether_addr* %1, %struct.ether_addr** %5
store i8* %2, i8** %6
ret i32 -1
}

LLVM IR (-O2):
%struct.ether_addr = type opaque
define i32 @ether_line(i8* nocapture readnone %0, %struct.ether_addr* nocapture readnone %1, i8* nocapture readnone %2) {
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ a();
void b(void) { a(); }


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

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

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

LLVM IR (-O2):
define void @b() {
%1 = tail call i32 (...) @a()
ret void
}
int test_imm_92int16_mem(short *val) {
  return ((*val) & (-0x92 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_92int16_mem>:
movzwl (%rdi),%eax
test   $0xff6e,%eax
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_92int16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, -146
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
int fibo(int f) {
  if (f == 1 || f == 2) {
    return 1;
  }
  return fibo(f - 1) + fibo(f - 2);
}


x86 assembly (clang, -O0):
<fibo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
je     112f <fibo+0x1f>
cmpl   $0x2,-0x8(%rbp)
jne    113b <fibo+0x2b>
movl   $0x1,-0x4(%rbp)
jmp    115e <fibo+0x4e>
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
call   1030 <fibo@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
sub    $0x2,%edi
call   1030 <fibo@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fibo>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebp
add    $0xffffffff,%ebp
mov    $0x1,%ebx
cmp    $0x2,%ebp
jb     1144 <fibo+0x34>
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %ebp,%edi
call   1030 <fibo@plt>
add    %eax,%ebx
add    $0xfffffffe,%ebp
cmp    $0x1,%ebp
ja     1130 <fibo+0x20>
add    $0x1,%ebx
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @fibo(i32 %0) {
%2 = add i32 %0, -1
%3 = icmp ult i32 %2, 2
br i1 %3, label %15, label %4
4: ; preds = %1, %4
%5 = phi i32 [ %11, %4 ], [ %2, %1 ]
%6 = phi i32 [ %9, %4 ], [ %0, %1 ]
%7 = phi i32 [ %10, %4 ], [ 0, %1 ]
%8 = tail call i32 @fibo(i32 %5)
%9 = add nsw i32 %6, -2
%10 = add nsw i32 %8, %7
%11 = add i32 %6, -3
%12 = icmp ult i32 %11, 2
br i1 %12, label %13, label %4
13: ; preds = %4
%14 = add i32 %10, 1
br label %15
15: ; preds = %13, %1
%16 = phi i32 [ 1, %1 ], [ %14, %13 ]
ret i32 %16
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ logData(int /*<<< orphan*/ *, char *, char *);
int /*<<< orphan*/ system(char *);
void command(FILE *log, int sock, char *action) {
  logData(log, "executing command: %s", &action[1]);
  system(&action[1]);
}


x86 assembly (clang, -O0):
<command>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rdx
add    $0x1,%rdx
lea    0xeba(%rip),%rsi
call   1030 <logData@plt>
mov    -0x18(%rbp),%rdi
add    $0x1,%rdi
call   1040 <system@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<command>:
push   %rbx
lea    0x1(%rdx),%rbx
lea    0xed4(%rip),%rsi
mov    %rbx,%rdx
call   1030 <logData@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <system@plt>

LLVM IR (-O0):
@.str = [22 x i8] c"executing command: %s\00"
define void @command(i32* %0, i32 %1, i8* %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i8*
store i32* %0, i32** %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%7 = load i32*, i32** %4
%8 = load i8*, i8** %6
%9 = getelementptr inbounds i8, i8* %8, i64 1
%10 = call i32 @logData(i32* %7, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* %9)
%11 = load i8*, i8** %6
%12 = getelementptr inbounds i8, i8* %11, i64 1
%13 = call i32 @system(i8* %12)
ret void
}

LLVM IR (-O2):
@.str = [22 x i8] c"executing command: %s\00"
define void @command(i32* %0, i32 %1, i8* %2) {
%4 = getelementptr inbounds i8, i8* %2, i64 1
%5 = tail call i32 @logData(i32* %0, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = tail call i32 @system(i8* %4)
ret void
}
int isupper(int c) { return (64 < c && c < 91); }


x86 assembly (clang, -O0):
<isupper>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
mov    $0x40,%ecx
cmp    -0x4(%rbp),%ecx
mov    %al,-0x5(%rbp)
jge    1124 <isupper+0x24>
cmpl   $0x5b,-0x4(%rbp)
setl   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isupper>:
add    $0xffffffbf,%edi
xor    %eax,%eax
cmp    $0x1a,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @isupper(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp slt i32 64, %3
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp slt i32 %6, 91
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ false, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @isupper(i32 %0) {
%2 = add i32 %0, -65
%3 = icmp ult i32 %2, 26
%4 = zext i1 %3 to i32
ret i32 %4
}
unsigned char IsWeaponShield(unsigned int weapon_id) {
  if (weapon_id / 100000 == 14 || weapon_id / 100000 == 15 ||
      weapon_id / 100000 == 90) {
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<IsWeaponShield>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x186a0,%ecx
xor    %edx,%edx
div    %ecx
cmp    $0xe,%eax
je     1146 <IsWeaponShield+0x46>
mov    -0x8(%rbp),%eax
mov    $0x186a0,%ecx
xor    %edx,%edx
div    %ecx
cmp    $0xf,%eax
je     1146 <IsWeaponShield+0x46>
mov    -0x8(%rbp),%eax
mov    $0x186a0,%ecx
xor    %edx,%edx
div    %ecx
cmp    $0x5a,%eax
jne    114f <IsWeaponShield+0x4f>
movb   $0x1,-0x1(%rbp)
jmp    1153 <IsWeaponShield+0x53>
movb   $0x0,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<IsWeaponShield>:
lea    -0x155cc0(%rdi),%eax
cmp    $0x30d40,%eax
setb   %cl
add    $0xff76abc0,%edi
cmp    $0x186a0,%edi
setb   %al
or     %cl,%al
ret

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

LLVM IR (-O2):
define zeroext i8 @IsWeaponShield(i32 %0) {
%2 = add i32 %0, -1400000
%3 = icmp ult i32 %2, 200000
%4 = add i32 %0, -9000000
%5 = icmp ult i32 %4, 100000
%6 = or i1 %3, %5
%7 = zext i1 %6 to i8
ret i8 %7
}
/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ errno;
int symlink(const char *file, const char *linkpath) {
  errno = ENOSYS;
  return -1;
}


x86 assembly (clang, -O0):
<symlink>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2ed5(%rip),%rax
mov    (%rax),%ecx
mov    0x2ebc(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<symlink>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%eax
mov    0x2ec8(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @symlink(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i32, i32* @ENOSYS
store i32 %5, i32* @errno
ret i32 -1
}

LLVM IR (-O2):
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @symlink(i8* nocapture readnone %0, i8* nocapture readnone %1) {
%3 = load i32, i32* @ENOSYS
store i32 %3, i32* @errno
ret i32 -1
}
int hashtbl_direct_equals(const void *a, const void *b) { return a == b; }


x86 assembly (clang, -O0):
<hashtbl_direct_equals>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hashtbl_direct_equals>:
xor    %eax,%eax
cmp    %rsi,%rdi
sete   %al
ret

LLVM IR (-O0):
define i32 @hashtbl_direct_equals(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = icmp eq i8* %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @hashtbl_direct_equals(i8* readnone %0, i8* readnone %1) {
%3 = icmp eq i8* %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ ETH_CheckLinkUp();
void Network_WaitForLink(void) {
  while (!ETH_CheckLinkUp())
    ;
}


x86 assembly (clang, -O0):
<Network_WaitForLink>:
push   %rbp
mov    %rsp,%rbp
jmp    1119 <Network_WaitForLink+0x9>
mov    $0x0,%al
call   1030 <ETH_CheckLinkUp@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    1135 <Network_WaitForLink+0x25>
jmp    113a <Network_WaitForLink+0x2a>
jmp    1119 <Network_WaitForLink+0x9>
pop    %rbp
ret

x86 assembly (clang, -O2):
<Network_WaitForLink>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <ETH_CheckLinkUp@plt>
test   %eax,%eax
je     1120 <Network_WaitForLink+0x10>
pop    %rax
ret

LLVM IR (-O0):
define void @Network_WaitForLink() {
br label %1
1: ; preds = %5, %0
%2 = call i32 (...) @ETH_CheckLinkUp()
%3 = icmp ne i32 %2, 0
%4 = xor i1 %3, true
br i1 %4, label %5, label %6
5: ; preds = %1
br label %1
6: ; preds = %1
ret void
}

LLVM IR (-O2):
define void @Network_WaitForLink() {
br label %1
1: ; preds = %1, %0
%2 = tail call i32 (...) @ETH_CheckLinkUp()
%3 = icmp eq i32 %2, 0
br i1 %3, label %1, label %4
4: ; preds = %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ titi();
int main() { titi(); }


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <titi@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 (...) @titi()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @titi()
ret i32 0
}
double atan2(double y, double x) { return 4; }


x86 assembly (clang, -O0):
<atan2>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  0xeea(%rip),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<atan2>:
movsd  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define double @atan2(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
ret double 4.000000e+00
}

LLVM IR (-O2):
define double @atan2(double %0, double %1) {
ret double 4.000000e+00
}
/* Variables and functions */
int /*<<< orphan*/ do_stuff(int);
int /*<<< orphan*/ do_stuff2(int);
int foo(int, int);
int bar(int p, int q) {
  if (q > 0)
    do_stuff(q);
  else
    do_stuff(-q);
  if (q % 2)
    do_stuff2(2 * q);
  else
    do_stuff2(2 * (q + 1));
  return foo(4, p);
}


x86 assembly (clang, -O0):
<bar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jle    1155 <bar+0x25>
mov    -0x8(%rbp),%edi
call   1050 <do_stuff@plt>
jmp    115f <bar+0x2f>
xor    %edi,%edi
sub    -0x8(%rbp),%edi
call   1050 <do_stuff@plt>
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
je     1183 <bar+0x53>
mov    -0x8(%rbp),%edi
shl    $0x1,%edi
call   1040 <do_stuff2@plt>
jmp    1191 <bar+0x61>
mov    -0x8(%rbp),%edi
add    $0x1,%edi
shl    $0x1,%edi
call   1040 <do_stuff2@plt>
mov    -0x4(%rbp),%esi
mov    $0x4,%edi
call   1030 <foo@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bar>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
mov    %esi,%edi
neg    %edi
cmovs  %esi,%edi
call   1050 <do_stuff@plt>
lea    (%rbx,%rbx,1),%eax
test   $0x1,%bl
lea    0x2(%rbx,%rbx,1),%edi
cmovne %eax,%edi
call   1040 <do_stuff2@plt>
mov    $0x4,%edi
mov    %ebp,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <foo@plt>

LLVM IR (-O0):
define i32 @bar(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = icmp sgt i32 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %2
%8 = load i32, i32* %4
%9 = call i32 @do_stuff(i32 %8)
br label %14
10: ; preds = %2
%11 = load i32, i32* %4
%12 = sub nsw i32 0, %11
%13 = call i32 @do_stuff(i32 %12)
br label %14
14: ; preds = %10, %7
%15 = load i32, i32* %4
%16 = srem i32 %15, 2
%17 = icmp ne i32 %16, 0
br i1 %17, label %18, label %22
18: ; preds = %14
%19 = load i32, i32* %4
%20 = mul nsw i32 2, %19
%21 = call i32 @do_stuff2(i32 %20)
br label %27
22: ; preds = %14
%23 = load i32, i32* %4
%24 = add nsw i32 %23, 1
%25 = mul nsw i32 2, %24
%26 = call i32 @do_stuff2(i32 %25)
br label %27
27: ; preds = %22, %18
%28 = load i32, i32* %3
%29 = call i32 @foo(i32 4, i32 %28)
ret i32 %29
}

LLVM IR (-O2):
define i32 @bar(i32 %0, i32 %1) {
%3 = call i32 @llvm.abs.i32(i32 %1, i1 true)
%4 = tail call i32 @do_stuff(i32 %3)
%5 = and i32 %1, 1
%6 = icmp eq i32 %5, 0
%7 = shl i32 %1, 1
%8 = add i32 %7, 2
%9 = shl nsw i32 %1, 1
%10 = select i1 %6, i32 %8, i32 %9
%11 = tail call i32 @do_stuff2(i32 %10)
%12 = tail call i32 @foo(i32 4, i32 %0)
ret i32 %12
}
/* Type definitions */
struct usergetkey_args_info {
  int dummy;
};

/* Variables and functions */
int EXIT_SUCCESS;
int usergetkey_cmdline_parser_required(struct usergetkey_args_info *args_info,
                                       const char *prog_name) {
  (void)(args_info);
  (void)(prog_name);
  return EXIT_SUCCESS;
}


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

x86 assembly (clang, -O2):
<usergetkey_cmdline_parser_required>:
mov    0x2ed9(%rip),%rax
mov    (%rax),%eax
ret

LLVM IR (-O0):
%struct.usergetkey_args_info = type { i32 }
@EXIT_SUCCESS = global i32 0
define i32 @usergetkey_cmdline_parser_required(%struct.usergetkey_args_info* %0, i8* %1) {
%3 = alloca %struct.usergetkey_args_info*
%4 = alloca i8*
store %struct.usergetkey_args_info* %0, %struct.usergetkey_args_info** %3
store i8* %1, i8** %4
%5 = load %struct.usergetkey_args_info*, %struct.usergetkey_args_info** %3
%6 = load i8*, i8** %4
%7 = load i32, i32* @EXIT_SUCCESS
ret i32 %7
}

LLVM IR (-O2):
%struct.usergetkey_args_info = type { i32 }
@EXIT_SUCCESS = global i32 0
define i32 @usergetkey_cmdline_parser_required(%struct.usergetkey_args_info* nocapture readnone %0, i8* nocapture readnone %1) {
%3 = load i32, i32* @EXIT_SUCCESS
ret i32 %3
}
void remove_space(char *s) {
  char *p = s;
  do {
    while (*p == ' ') {
      p++;
    }
  } while ((*s++ = *p++));
}


x86 assembly (clang, -O0):
<remove_space>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
jmp    1115 <remove_space+0x15>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x20,%eax
jne    1136 <remove_space+0x36>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1115 <remove_space+0x15>
jmp    113b <remove_space+0x3b>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%al
mov    -0x8(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %al,(%rcx)
cmp    $0x0,%al
jne    1110 <remove_space+0x10>
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @remove_space(i8* nocapture %0) {
br label %2
2: ; preds = %10, %1
%3 = phi i8* [ %0, %1 ], [ %11, %10 ]
%4 = phi i8* [ %0, %1 ], [ %9, %10 ]
br label %5
5: ; preds = %5, %2
%6 = phi i8* [ %4, %2 ], [ %9, %5 ]
%7 = load i8, i8* %6
%8 = icmp eq i8 %7, 32
%9 = getelementptr inbounds i8, i8* %6, i64 1
br i1 %8, label %5, label %10
10: ; preds = %5
%11 = getelementptr inbounds i8, i8* %3, i64 1
store i8 %7, i8* %3
%12 = icmp eq i8 %7, 0
br i1 %12, label %13, label %2
13: ; preds = %10
ret void
}
double area(int r) { return 3.1415926 * r * r; }


x86 assembly (clang, -O0):
<area>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cvtsi2sdl -0x4(%rbp),%xmm1
movsd  0xeec(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvtsi2sdl -0x4(%rbp),%xmm1
mulsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<area>:
cvtsi2sd %edi,%xmm1
movsd  0xef4(%rip),%xmm0
mulsd  %xmm1,%xmm0
mulsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @area(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sitofp i32 %3 to double
%5 = fmul double 0x400921FB4D12D84A, %4
%6 = load i32, i32* %2
%7 = sitofp i32 %6 to double
%8 = fmul double %5, %7
ret double %8
}

LLVM IR (-O2):
define double @area(i32 %0) {
%2 = sitofp i32 %0 to double
%3 = fmul double %2, 0x400921FB4D12D84A
%4 = fmul double %3, %2
ret double %4
}
TMK_TEST(rcu_test_create_reg) { TMK_ASSERT_NOT_NULL(rcu_cre_test_reg("r1")); }


x86 assembly (clang, -O0):
<TMK_TEST>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
lea    0xece(%rip),%rdi
mov    $0x0,%al
call   1030 <rcu_cre_test_reg@plt>
mov    %eax,%edi
mov    $0x0,%al
call   1040 <TMK_ASSERT_NOT_NULL@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<TMK_TEST>:
push   %rax
lea    0xed8(%rip),%rdi
xor    %eax,%eax
call   1030 <rcu_cre_test_reg@plt>
mov    %eax,%edi
xor    %eax,%eax
pop    %rcx
jmp    1040 <TMK_ASSERT_NOT_NULL@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"r1\00"
define i32 @TMK_TEST(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = call i32 (i8*, ...) bitcast (i32 (...)* @rcu_cre_test_reg to i32 (i8*, ...)*)(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%5 = call i32 (i32, ...) bitcast (i32 (...)* @TMK_ASSERT_NOT_NULL to i32 (i32, ...)*)(i32 %4)
%6 = load i32, i32* %2
ret i32 %6
}

LLVM IR (-O2):
@.str = [3 x i8] c"r1\00"
define i32 @TMK_TEST(i32 %0) {
%2 = tail call i32 (i8*, ...) bitcast (i32 (...)* @rcu_cre_test_reg to i32 (i8*, ...)*)(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (i32, ...) bitcast (i32 (...)* @TMK_ASSERT_NOT_NULL to i32 (i32, ...)*)(i32 %2)
ret i32 undef
}
/* Variables and functions */
char *malloc(size_t);
int /*<<< orphan*/ strncpy(char *, char const *, size_t);
char *strndup(const char *s, size_t len) {
  char *s2 = malloc(len + 1);
  strncpy(s2, s, len);
  s2[len] = '\0';
  return s2;
}


x86 assembly (clang, -O0):
<strndup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
add    $0x1,%rdi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
call   1030 <strncpy@plt>
mov    -0x18(%rbp),%rax
mov    -0x10(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strndup>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r15
mov    %rdi,%r14
lea    0x1(%rsi),%rdi
call   1040 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
call   1030 <strncpy@plt>
movb   $0x0,(%rbx,%r15,1)
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @strndup(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i8*
store i8* %0, i8** %3
store i64 %1, i64* %4
%6 = load i64, i64* %4
%7 = add i64 %6, 1
%8 = call i8* @malloc(i64 %7)
store i8* %8, i8** %5
%9 = load i8*, i8** %5
%10 = load i8*, i8** %3
%11 = load i64, i64* %4
%12 = call i32 @strncpy(i8* %9, i8* %10, i64 %11)
%13 = load i8*, i8** %5
%14 = load i64, i64* %4
%15 = getelementptr inbounds i8, i8* %13, i64 %14
store i8 0, i8* %15
%16 = load i8*, i8** %5
ret i8* %16
}

LLVM IR (-O2):
define i8* @strndup(i8* %0, i64 %1) {
%3 = add i64 %1, 1
%4 = tail call i8* @malloc(i64 %3)
%5 = tail call i32 @strncpy(i8* %4, i8* %0, i64 %1)
%6 = getelementptr inbounds i8, i8* %4, i64 %1
store i8 0, i8* %6
ret i8* %4
}
int round_up(const int x) { return (x + 31) >> 5; }


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

x86 assembly (clang, -O2):
<round_up>:
lea    0x1f(%rdi),%eax
sar    $0x5,%eax
ret

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

LLVM IR (-O2):
define i32 @round_up(i32 %0) {
%2 = add nsw i32 %0, 31
%3 = ashr i32 %2, 5
ret i32 %3
}
/* Type definitions */
typedef int fpu_control_t;

/* Variables and functions */
int /*<<< orphan*/ _FPU_GETCW(int);
int fegetround(void) {
  fpu_control_t cw;
  _FPU_GETCW(cw);
  return cw & 0x1;
}


x86 assembly (clang, -O0):
<fegetround>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    -0x4(%rbp),%edi
call   1030 <_FPU_GETCW@plt>
mov    -0x4(%rbp),%eax
and    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fegetround>:
push   %rax
call   1030 <_FPU_GETCW@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @fegetround() {
%1 = alloca i32
%2 = load i32, i32* %1
%3 = call i32 @_FPU_GETCW(i32 %2)
%4 = load i32, i32* %1
%5 = and i32 %4, 1
ret i32 %5
}

LLVM IR (-O2):
define i32 @fegetround() {
%1 = tail call i32 @_FPU_GETCW(i32 undef)
ret i32 0
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ display;
};
typedef TYPE_1__ XFocusInEvent;

/* Variables and functions */
void *get_XFocusInEvent_display(void *_p) {
  return (void *)((XFocusInEvent *)_p)->display;
}


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

x86 assembly (clang, -O2):
<get_XFocusInEvent_display>:
mov    (%rdi),%rax
ret

LLVM IR (-O0):
%struct.TYPE_2__ = type { i64 }
define i8* @get_XFocusInEvent_display(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.TYPE_2__*
%5 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %4, i32 0, i32 0
%6 = load i64, i64* %5
%7 = inttoptr i64 %6 to i8*
ret i8* %7
}

LLVM IR (-O2):
define i8* @get_XFocusInEvent_display(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = inttoptr i64 %3 to i8*
ret i8* %4
}
/* Variables and functions */
int f(int);
int main(void) {
  int x = 5;
  int a[f(x)];
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x5,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <f@plt>
mov    %eax,%eax
mov    %rsp,%rcx
mov    %rcx,-0x10(%rbp)
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rsp
xor    %eax,%eax
mov    %rbp,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
%3 = alloca i64
store i32 5, i32* %1
%4 = load i32, i32* %1
%5 = call i32 @f(i32 %4)
%6 = zext i32 %5 to i64
%7 = call i8* @llvm.stacksave()
store i8* %7, i8** %2
%8 = alloca i32, i64 %6
store i64 %6, i64* %3
%9 = load i8*, i8** %2
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @f(i32 5)
ret i32 0
}
int cstrstructcmp(key, datum) const void *key, *datum;
{ return strcasecmp((char *)key, *(char **)datum); }


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

x86 assembly (clang, -O2):
<cstrstructcmp>:
mov    (%rsi),%rsi
jmp    1030 <strcasecmp@plt>

LLVM IR (-O0):
define i32 @cstrstructcmp(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = bitcast i8* %6 to i8**
%8 = load i8*, i8** %7
%9 = call i32 @strcasecmp(i8* %5, i8* %8)
ret i32 %9
}

LLVM IR (-O2):
define i32 @cstrstructcmp(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %1 to i8**
%4 = load i8*, i8** %3
%5 = tail call i32 @strcasecmp(i8* %0, i8* %4)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ can_rx(int);
void CAN2_RX0_IRQ_Handler(void) { can_rx(1); }


x86 assembly (clang, -O0):
<CAN2_RX0_IRQ_Handler>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1030 <can_rx@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<CAN2_RX0_IRQ_Handler>:
mov    $0x1,%edi
jmp    1030 <can_rx@plt>

LLVM IR (-O0):
define void @CAN2_RX0_IRQ_Handler() {
%1 = call i32 @can_rx(i32 1)
ret void
}

LLVM IR (-O2):
define void @CAN2_RX0_IRQ_Handler() {
%1 = tail call i32 @can_rx(i32 1)
ret void
}
int do_660() { return 660; }


x86 assembly (clang, -O0):
<do_660>:
push   %rbp
mov    %rsp,%rbp
mov    $0x294,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_660>:
mov    $0x294,%eax
ret

LLVM IR (-O0):
define i32 @do_660() {
ret i32 660
}

LLVM IR (-O2):
define i32 @do_660() {
ret i32 660
}
/* Variables and functions */
int fn_sq_ch_67_ch_108_ch_97_ch_115_ch_115(char const *);
int fn_al_sq_ch_67_ch_108_ch_97_ch_115_ch_115(const char *text) {
  int pos = 0;
  pos = fn_sq_ch_67_ch_108_ch_97_ch_115_ch_115(text);
  if (pos != -1)
    return pos;
  return -1;
}


x86 assembly (clang, -O0):
<fn_al_sq_ch_67_ch_108_ch_97_ch_115_ch_115>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <fn_sq_ch_67_ch_108_ch_97_ch_115_ch_115@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0xffffffff,-0x14(%rbp)
je     1144 <fn_al_sq_ch_67_ch_108_ch_97_ch_115_ch_115+0x34>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    114b <fn_al_sq_ch_67_ch_108_ch_97_ch_115_ch_115+0x3b>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fn_al_sq_ch_67_ch_108_ch_97_ch_115_ch_115>:
jmp    1030 <fn_sq_ch_67_ch_108_ch_97_ch_115_ch_115@plt>

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

LLVM IR (-O2):
define i32 @fn_al_sq_ch_67_ch_108_ch_97_ch_115_ch_115(i8* %0) {
%2 = tail call i32 @fn_sq_ch_67_ch_108_ch_97_ch_115_ch_115(i8* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ out52(char);
int /*<<< orphan*/ write(int, char *, int);
void out52n(char c, char n) {
  out52(c);
  write(1, &n, 1);
}


x86 assembly (clang, -O0):
<out52n>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movsbl -0x1(%rbp),%edi
call   1030 <out52@plt>
mov    $0x1,%edx
lea    -0x2(%rbp),%rsi
mov    %edx,%edi
call   1040 <write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<out52n>:
push   %rax
mov    %sil,0x7(%rsp)
call   1030 <out52@plt>
lea    0x7(%rsp),%rsi
mov    $0x1,%edi
mov    $0x1,%edx
call   1040 <write@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @out52n(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 = call i32 @out52(i8 signext %5)
%7 = call i32 @write(i32 1, i8* %4, i32 1)
ret void
}

LLVM IR (-O2):
define void @out52n(i8 signext %0, i8 signext %1) {
%3 = alloca i8
store i8 %1, i8* %3
%4 = tail call i32 @out52(i8 signext %0)
%5 = call i32 @write(i32 1, i8* %3, i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ matrix_multiply();
int main(int argc, char **argv) {
  matrix_multiply();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <matrix_multiply@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <matrix_multiply@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 (...) @matrix_multiply()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @matrix_multiply()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ reveNota();
int main(void) { reveNota(); }


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <reveNota@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 (...) @reveNota()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @reveNota()
ret i32 0
}
/* Type definitions */
typedef int uint8_t;
typedef int uint32_t;

/* Variables and functions */
uint32_t get32bit(const uint8_t **ptr) {
  uint32_t t32;
  t32 = ((*ptr)[3] + 256 * ((*ptr)[2] + 256 * ((*ptr)[1] + 256 * (*ptr)[0])));
  (*ptr) += 4;
  return t32;
}


x86 assembly (clang, -O0):
<get32bit>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    0xc(%rax),%eax
mov    -0x8(%rbp),%rcx
mov    (%rcx),%rcx
mov    0x8(%rcx),%ecx
mov    -0x8(%rbp),%rdx
mov    (%rdx),%rdx
mov    0x4(%rdx),%edx
mov    -0x8(%rbp),%rsi
mov    (%rsi),%rsi
mov    (%rsi),%esi
shl    $0x8,%esi
add    %esi,%edx
shl    $0x8,%edx
add    %edx,%ecx
shl    $0x8,%ecx
add    %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
add    $0x10,%rcx
mov    %rcx,(%rax)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get32bit>:
mov    (%rdi),%rcx
mov    (%rcx),%eax
shl    $0x8,%eax
add    0x4(%rcx),%eax
shl    $0x8,%eax
add    0x8(%rcx),%eax
shl    $0x8,%eax
add    0xc(%rcx),%eax
add    $0x10,%rcx
mov    %rcx,(%rdi)
ret

LLVM IR (-O0):
define i32 @get32bit(i32** %0) {
%2 = alloca i32**
%3 = alloca i32
store i32** %0, i32*** %2
%4 = load i32**, i32*** %2
%5 = load i32*, i32** %4
%6 = getelementptr inbounds i32, i32* %5, i64 3
%7 = load i32, i32* %6
%8 = load i32**, i32*** %2
%9 = load i32*, i32** %8
%10 = getelementptr inbounds i32, i32* %9, i64 2
%11 = load i32, i32* %10
%12 = load i32**, i32*** %2
%13 = load i32*, i32** %12
%14 = getelementptr inbounds i32, i32* %13, i64 1
%15 = load i32, i32* %14
%16 = load i32**, i32*** %2
%17 = load i32*, i32** %16
%18 = getelementptr inbounds i32, i32* %17, i64 0
%19 = load i32, i32* %18
%20 = mul nsw i32 256, %19
%21 = add nsw i32 %15, %20
%22 = mul nsw i32 256, %21
%23 = add nsw i32 %11, %22
%24 = mul nsw i32 256, %23
%25 = add nsw i32 %7, %24
store i32 %25, i32* %3
%26 = load i32**, i32*** %2
%27 = load i32*, i32** %26
%28 = getelementptr inbounds i32, i32* %27, i64 4
store i32* %28, i32** %26
%29 = load i32, i32* %3
ret i32 %29
}

LLVM IR (-O2):
define i32 @get32bit(i32** nocapture %0) {
%2 = load i32*, i32** %0
%3 = getelementptr inbounds i32, i32* %2, i64 3
%4 = load i32, i32* %3
%5 = getelementptr inbounds i32, i32* %2, i64 2
%6 = load i32, i32* %5
%7 = getelementptr inbounds i32, i32* %2, i64 1
%8 = load i32, i32* %7
%9 = load i32, i32* %2
%10 = shl nsw i32 %9, 8
%11 = add nsw i32 %10, %8
%12 = shl nsw i32 %11, 8
%13 = add nsw i32 %12, %6
%14 = shl nsw i32 %13, 8
%15 = add nsw i32 %14, %4
%16 = getelementptr inbounds i32, i32* %2, i64 4
store i32* %16, i32** %0
ret i32 %15
}
int f(int a) {
  if (a == 0)
    return 0;
  do
    if (a & 128)
      return 1;
  while (f(0));
  return 0;
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1131 <f+0x21>
movl   $0x0,-0x4(%rbp)
jmp    116f <f+0x5f>
jmp    1136 <f+0x26>
mov    -0x8(%rbp),%eax
and    $0x80,%eax
cmp    $0x0,%eax
je     1153 <f+0x43>
movl   $0x1,-0x4(%rbp)
jmp    116f <f+0x5f>
jmp    1158 <f+0x48>
xor    %edi,%edi
call   1030 <f@plt>
cmp    $0x0,%eax
jne    1136 <f+0x26>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
mov    %edi,%eax
shr    $0x7,%eax
and    $0x1,%eax
test   %edi,%edi
cmove  %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @f(i32 %0) {
%2 = icmp eq i32 %0, 0
%3 = lshr i32 %0, 7
%4 = and i32 %3, 1
%5 = select i1 %2, i32 0, i32 %4
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ apply_gamma(unsigned int **);
int /*<<< orphan*/ apply_pi(unsigned int **);
int /*<<< orphan*/ apply_theta(unsigned int **);
void apply_comb(unsigned m[8][8]) {
  apply_gamma(m);
  apply_pi(m);
  apply_theta(m);
}


x86 assembly (clang, -O0):
<apply_comb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <apply_gamma@plt>
mov    -0x8(%rbp),%rdi
call   1030 <apply_pi@plt>
mov    -0x8(%rbp),%rdi
call   1050 <apply_theta@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<apply_comb>:
push   %rbx
mov    %rdi,%rbx
call   1040 <apply_gamma@plt>
mov    %rbx,%rdi
call   1030 <apply_pi@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1050 <apply_theta@plt>

LLVM IR (-O0):
define void @apply_comb([8 x i32]* %0) {
%2 = alloca [8 x i32]*
store [8 x i32]* %0, [8 x i32]** %2
%3 = load [8 x i32]*, [8 x i32]** %2
%4 = bitcast [8 x i32]* %3 to i32**
%5 = call i32 @apply_gamma(i32** %4)
%6 = load [8 x i32]*, [8 x i32]** %2
%7 = bitcast [8 x i32]* %6 to i32**
%8 = call i32 @apply_pi(i32** %7)
%9 = load [8 x i32]*, [8 x i32]** %2
%10 = bitcast [8 x i32]* %9 to i32**
%11 = call i32 @apply_theta(i32** %10)
ret void
}

LLVM IR (-O2):
define void @apply_comb([8 x i32]* %0) {
%2 = bitcast [8 x i32]* %0 to i32**
%3 = tail call i32 @apply_gamma(i32** %2)
%4 = tail call i32 @apply_pi(i32** %2)
%5 = tail call i32 @apply_theta(i32** %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ I2C1_Start();
int /*<<< orphan*/ I2C1_Stop();
int /*<<< orphan*/ I2C1_Wr(unsigned char);
void RTC_Write(unsigned char ADD, unsigned char DATA) {
  I2C1_Start();
  I2C1_Wr(0b11010000);
  I2C1_Wr(ADD);
  I2C1_Wr(DATA);
  I2C1_Stop();
}


x86 assembly (clang, -O0):
<RTC_Write>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
mov    $0x0,%al
call   1050 <I2C1_Start@plt>
mov    $0xd0,%edi
call   1040 <I2C1_Wr@plt>
movzbl -0x1(%rbp),%edi
call   1040 <I2C1_Wr@plt>
movzbl -0x2(%rbp),%edi
call   1040 <I2C1_Wr@plt>
mov    $0x0,%al
call   1030 <I2C1_Stop@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<RTC_Write>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
xor    %eax,%eax
call   1050 <I2C1_Start@plt>
mov    $0xd0,%edi
call   1040 <I2C1_Wr@plt>
mov    %ebp,%edi
call   1040 <I2C1_Wr@plt>
mov    %ebx,%edi
call   1040 <I2C1_Wr@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <I2C1_Stop@plt>

LLVM IR (-O0):
define void @RTC_Write(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
store i8 %0, i8* %3
store i8 %1, i8* %4
%5 = call i32 (...) @I2C1_Start()
%6 = call i32 @I2C1_Wr(i8 zeroext -48)
%7 = load i8, i8* %3
%8 = call i32 @I2C1_Wr(i8 zeroext %7)
%9 = load i8, i8* %4
%10 = call i32 @I2C1_Wr(i8 zeroext %9)
%11 = call i32 (...) @I2C1_Stop()
ret void
}

LLVM IR (-O2):
define void @RTC_Write(i8 zeroext %0, i8 zeroext %1) {
%3 = tail call i32 (...) @I2C1_Start()
%4 = tail call i32 @I2C1_Wr(i8 zeroext -48)
%5 = tail call i32 @I2C1_Wr(i8 zeroext %0)
%6 = tail call i32 @I2C1_Wr(i8 zeroext %1)
%7 = tail call i32 (...) @I2C1_Stop()
ret void
}
int *rShiftTable(void) {
  static int theTable[17] = {0, 5, 4, 0, 3, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 1};
  return theTable;
}


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

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

LLVM IR (-O0):
@rShiftTable.theTable = internal global [17 x i32] [i32 0, i32 5, i32 4, i32 0, i32 3, i32 0, i32 0, i32 0, i32 2, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 1]
define i32* @rShiftTable() {
ret i32* getelementptr inbounds ([17 x i32], [17 x i32]* @rShiftTable.theTable, i64 0, i64 0)
}

LLVM IR (-O2):
@rShiftTable.theTable = internal global [17 x i32] [i32 0, i32 5, i32 4, i32 0, i32 3, i32 0, i32 0, i32 0, i32 2, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 1]
define i32* @rShiftTable() {
ret i32* getelementptr inbounds ([17 x i32], [17 x i32]* @rShiftTable.theTable, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, float);
void main() {
  int y, z;
  int x = y = z = 10;
  int f = x;
  float ans = 0.0;
  f = x * y;
  ans = x / 3.0 + y / 3;
  printf("%d,%.2f", f, ans);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0xa,-0x8(%rbp)
movl   $0xa,-0x4(%rbp)
movl   $0xa,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x14(%rbp)
mov    -0xc(%rbp),%eax
imul   -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
cvtsi2sdl -0xc(%rbp),%xmm0
movsd  0xeae(%rip),%xmm1
divsd  %xmm1,%xmm0
mov    -0x4(%rbp),%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
cvtsi2sd %eax,%xmm1
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x14(%rbp)
mov    -0x10(%rbp),%esi
movss  -0x14(%rbp),%xmm0
lea    0xe87(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
lea    0xeed(%rip),%rdi
movss  0xee1(%rip),%xmm0
mov    $0x64,%esi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"%d,%.2f\00"
define void @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca float
store i32 10, i32* %2
store i32 10, i32* %1
store i32 10, i32* %3
%6 = load i32, i32* %3
store i32 %6, i32* %4
store float 0.000000e+00, float* %5
%7 = load i32, i32* %3
%8 = load i32, i32* %1
%9 = mul nsw i32 %7, %8
store i32 %9, i32* %4
%10 = load i32, i32* %3
%11 = sitofp i32 %10 to double
%12 = fdiv double %11, 3.000000e+00
%13 = load i32, i32* %1
%14 = sdiv i32 %13, 3
%15 = sitofp i32 %14 to double
%16 = fadd double %12, %15
%17 = fptrunc double %16 to float
store float %17, float* %5
%18 = load i32, i32* %4
%19 = load float, float* %5
%20 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %18, float %19)
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"%d,%.2f\00"
define void @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 100, float 0x4019555560000000)
ret void
}