xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ dst_on_comm(int *, int *, void *, int *, void *, int *,
                               int /*<<< orphan*/);
void dist_on_comm0_(int *comm, int *typesize, void *inbuf, int *ninbuf,
                    void *outbuf, int *noutbuf) {
  dst_on_comm(comm, typesize, inbuf, ninbuf, outbuf, noutbuf, 0);
}


x86 assembly (clang, -O0):
<dist_on_comm0_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r8
mov    -0x30(%rbp),%r9
xor    %eax,%eax
movl   $0x0,(%rsp)
call   1030 <dst_on_comm@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dist_on_comm0_>:
push   %rax
movl   $0x0,(%rsp)
call   1030 <dst_on_comm@plt>
pop    %rax
ret

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

LLVM IR (-O2):
define void @dist_on_comm0_(i32* %0, i32* %1, i8* %2, i32* %3, i8* %4, i32* %5) {
%7 = tail call i32 @dst_on_comm(i32* %0, i32* %1, i8* %2, i32* %3, i8* %4, i32* %5, i32 0)
ret void
}
void eapol_sm_notify_ctrl_response(struct eapol_sm *sm) {}


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

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

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

LLVM IR (-O2):
%struct.eapol_sm = type opaque
define void @eapol_sm_notify_ctrl_response(%struct.eapol_sm* nocapture %0) {
ret void
}
/* Variables and functions */
int getcns(int);
int cmd_rssi(int argc, char **argv) { return getcns(0x1001); }


x86 assembly (clang, -O0):
<cmd_rssi>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x1001,%edi
call   1030 <getcns@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmd_rssi>:
mov    $0x1001,%edi
jmp    1030 <getcns@plt>

LLVM IR (-O0):
define i32 @cmd_rssi(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = call i32 @getcns(i32 4097)
ret i32 %5
}

LLVM IR (-O2):
define i32 @cmd_rssi(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @getcns(i32 4097)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ ft_strcmp(char const *, char const *);
int ft_strequ(const char *s1, const char *s2) { return (!ft_strcmp(s1, s2)); }


x86 assembly (clang, -O0):
<ft_strequ>:
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 <ft_strcmp@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_strequ>:
push   %rax
call   1030 <ft_strcmp@plt>
xor    %ecx,%ecx
test   %eax,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @ft_strequ(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 = call i32 @ft_strcmp(i8* %5, i8* %6)
%8 = icmp ne i32 %7, 0
%9 = xor i1 %8, true
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @ft_strequ(i8* %0, i8* %1) {
%3 = tail call i32 @ft_strcmp(i8* %0, i8* %1)
%4 = icmp eq i32 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ gameresource_test();
int /*<<< orphan*/ hankaku_test();
int main() {
  gameresource_test();
  hankaku_test();
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @gameresource_test()
%3 = call i32 (...) @hankaku_test()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @gameresource_test()
%2 = tail call i32 (...) @hankaku_test()
ret i32 0
}
/* Variables and functions */
size_t cag_int_hash(const int key, const size_t len) {
  (void)len;
  return key;
}


x86 assembly (clang, -O0):
<cag_int_hash>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movslq -0x4(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cag_int_hash>:
movslq %edi,%rax
ret

LLVM IR (-O0):
define i64 @cag_int_hash(i32 %0, i64 %1) {
%3 = alloca i32
%4 = alloca i64
store i32 %0, i32* %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = load i32, i32* %3
%7 = sext i32 %6 to i64
ret i64 %7
}

LLVM IR (-O2):
define i64 @cag_int_hash(i32 %0, i64 %1) {
%3 = sext i32 %0 to i64
ret i64 %3
}
/* Variables and functions */
char *strrchr(char *, char);
const char *files_basename(char *path) {
  const char *base = strrchr(path, '/');
  return base ? base + 1 : path;
}


x86 assembly (clang, -O0):
<files_basename>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x2f,%esi
call   1030 <strrchr@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     114a <files_basename+0x3a>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1152 <files_basename+0x42>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<files_basename>:
push   %rbx
mov    %rdi,%rbx
mov    $0x2f,%esi
call   1030 <strrchr@plt>
lea    0x1(%rax),%rcx
test   %rax,%rax
cmove  %rbx,%rcx
mov    %rcx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @files_basename(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i8* @strrchr(i8* %4, i8 signext 47)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %8, label %11
8: ; preds = %1
%9 = load i8*, i8** %3
%10 = getelementptr inbounds i8, i8* %9, i64 1
br label %13
11: ; preds = %1
%12 = load i8*, i8** %2
br label %13
13: ; preds = %11, %8
%14 = phi i8* [ %10, %8 ], [ %12, %11 ]
ret i8* %14
}

LLVM IR (-O2):
define i8* @files_basename(i8* %0) {
%2 = tail call i8* @strrchr(i8* dereferenceable(1) %0, i8 signext 47)
%3 = icmp eq i8* %2, null
%4 = getelementptr inbounds i8, i8* %2, i64 1
%5 = select i1 %3, i8* %0, i8* %4
ret i8* %5
}
int compareInt(void *v1, void *v2) {
  int *i1 = (int *)v1;
  int *i2 = (int *)v2;
  if (*i1 <= *i2) {
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<compareInt>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rax
mov    (%rax),%eax
mov    -0x28(%rbp),%rcx
cmp    (%rcx),%eax
jg     113a <compareInt+0x3a>
movl   $0x1,-0x4(%rbp)
jmp    1141 <compareInt+0x41>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<compareInt>:
mov    (%rdi),%ecx
xor    %eax,%eax
cmp    (%rsi),%ecx
setle  %al
ret

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

LLVM IR (-O2):
define i32 @compareInt(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = bitcast i8* %1 to i32*
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = icmp sle i32 %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ sleep(int);
int main(void) {
  for (;;) {
    puts("Hello World!");
    sleep(1);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1040 <sleep@plt>
jmp    112f <main+0xf>

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xed8(%rip),%rbx
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1040 <sleep@plt>
jmp    1130 <main+0x10>

LLVM IR (-O0):
@.str = [13 x i8] c"Hello World!\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %2, %0
%3 = call i32 @puts(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @sleep(i32 1)
br label %2
}

LLVM IR (-O2):
@.str = [13 x i8] c"Hello World!\00"
define i32 @main() {
br label %1
1: ; preds = %1, %0
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @sleep(i32 1)
br label %1
}
unsigned xrop3_100_0_0(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  unsigned stk3;
  stk3 = T | S;
  stk2 = D & stk3;
  stk1 = S ^ stk2;
  return stk1;
}


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

x86 assembly (clang, -O2):
mov    %edi,%eax
shl    $0x8,%eax
or     %edi,%eax
or     %edi,%esi
xor    %esi,%eax
ret

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

LLVM IR (-O2):
define i32 @xrop3_100_0_0(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = mul nuw nsw i32 %3, 257
%5 = or i8 %1, %0
%6 = zext i8 %5 to i32
%7 = xor i32 %4, %6
ret i32 %7
}
char _jstime_isleapyear(int year) {
  return ((((year % 4 == 0) && (year % 100 != 0)) || (year % 400 == 0)) ? 1
                                                                        : 0);
}


x86 assembly (clang, -O0):
<_jstime_isleapyear>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1134 <_jstime_isleapyear+0x34>
mov    -0x4(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
mov    $0x1,%al
cmp    $0x0,%edx
mov    %al,-0x5(%rbp)
jne    1148 <_jstime_isleapyear+0x48>
mov    -0x4(%rbp),%eax
mov    $0x190,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
sete   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%dl
xor    %eax,%eax
mov    $0x1,%ecx
test   $0x1,%dl
cmovne %ecx,%eax
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_jstime_isleapyear>:
test   $0x3,%dil
jne    1129 <_jstime_isleapyear+0x29>
movslq %edi,%rax
imul   $0x51eb851f,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x25,%rax
add    %ecx,%eax
imul   $0x64,%eax,%ecx
mov    %edi,%edx
mov    $0x1,%al
sub    %ecx,%edx
je     1129 <_jstime_isleapyear+0x29>
ret
imul   $0xc28f5c29,%edi,%eax
add    $0x51eb850,%eax
ror    $0x4,%eax
cmp    $0xa3d70b,%eax
setb   %al
ret

LLVM IR (-O0):
define signext i8 @_jstime_isleapyear(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = srem i32 %3, 4
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i32, i32* %2
%8 = srem i32 %7, 100
%9 = icmp ne i32 %8, 0
br i1 %9, label %14, label %10
10: ; preds = %6, %1
%11 = load i32, i32* %2
%12 = srem i32 %11, 400
%13 = icmp eq i32 %12, 0
br label %14
14: ; preds = %10, %6
%15 = phi i1 [ true, %6 ], [ %13, %10 ]
%16 = zext i1 %15 to i64
%17 = select i1 %15, i32 1, i32 0
%18 = trunc i32 %17 to i8
ret i8 %18
}

LLVM IR (-O2):
define signext i8 @_jstime_isleapyear(i32 %0) {
%2 = and i32 %0, 3
%3 = icmp ne i32 %2, 0
%4 = srem i32 %0, 100
%5 = icmp eq i32 %4, 0
%6 = or i1 %3, %5
br i1 %6, label %7, label %11
7: ; preds = %1
%8 = srem i32 %0, 400
%9 = icmp eq i32 %8, 0
%10 = zext i1 %9 to i8
br label %11
11: ; preds = %1, %7
%12 = phi i8 [ %10, %7 ], [ 1, %1 ]
ret i8 %12
}
void av_mod_i() {}


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

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

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

LLVM IR (-O2):
define void @av_mod_i() {
ret void
}
extern int tig_not(int x) { return !x; }


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

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

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

LLVM IR (-O2):
define i32 @tig_not(i32 %0) {
%2 = icmp eq i32 %0, 0
%3 = zext i1 %2 to i32
ret i32 %3
}
void gdk_x11_drawable_get_xdisplay() {}


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

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

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

LLVM IR (-O2):
define void @gdk_x11_drawable_get_xdisplay() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ outb(int, int);
void WriteDma(void) {
  outb(0x0a, 0x06);
  outb(0x0b, 0x5A);
  outb(0x0a, 0x02);
}


x86 assembly (clang, -O0):
<WriteDma>:
push   %rbp
mov    %rsp,%rbp
mov    $0xa,%edi
mov    $0x6,%esi
call   1030 <outb@plt>
mov    $0xb,%edi
mov    $0x5a,%esi
call   1030 <outb@plt>
mov    $0xa,%edi
mov    $0x2,%esi
call   1030 <outb@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<WriteDma>:
push   %rax
mov    $0xa,%edi
mov    $0x6,%esi
call   1030 <outb@plt>
mov    $0xb,%edi
mov    $0x5a,%esi
call   1030 <outb@plt>
mov    $0xa,%edi
mov    $0x2,%esi
pop    %rax
jmp    1030 <outb@plt>

LLVM IR (-O0):
define void @WriteDma() {
%1 = call i32 @outb(i32 10, i32 6)
%2 = call i32 @outb(i32 11, i32 90)
%3 = call i32 @outb(i32 10, i32 2)
ret void
}

LLVM IR (-O2):
define void @WriteDma() {
%1 = tail call i32 @outb(i32 10, i32 6)
%2 = tail call i32 @outb(i32 11, i32 90)
%3 = tail call i32 @outb(i32 10, i32 2)
ret void
}
void X509v3_get_ext_by_critical(void) {}


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

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

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

LLVM IR (-O2):
define void @X509v3_get_ext_by_critical() {
ret void
}
/* Variables and functions */
char *malloc(size_t);
int /*<<< orphan*/ memcpy(char *, char const *, size_t);
size_t strlen(char const *);
char *strdup(const char *s) {
  size_t len = strlen(s);
  char *new = malloc(len + 1);
  if (!new)
    return 0;
  memcpy(new, s, len);
  new[len] = '\0';
  return new;
}


x86 assembly (clang, -O0):
<strdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
add    $0x1,%rdi
call   1050 <malloc@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    1172 <strdup+0x42>
movq   $0x0,-0x8(%rbp)
jmp    1197 <strdup+0x67>
mov    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1040 <memcpy@plt>
mov    -0x20(%rbp),%rax
mov    -0x18(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strdup>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
call   1030 <strlen@plt>
mov    %rax,%r15
lea    0x1(%rax),%rdi
call   1050 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
je     1164 <strdup+0x34>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
call   1040 <memcpy@plt>
movb   $0x0,(%rbx,%r15,1)
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i8* @strdup(i8* %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add i64 %2, 1
%4 = tail call i8* @malloc(i64 %3)
%5 = icmp eq i8* %4, null
br i1 %5, label %9, label %6
6: ; preds = %1
%7 = tail call i32 @memcpy(i8* %4, i8* %0, i64 %2)
%8 = getelementptr inbounds i8, i8* %4, i64 %2
store i8 0, i8* %8
br label %9
9: ; preds = %1, %6
ret i8* %4
}
/* Type definitions */
struct _stor_fwrite_rsp {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ osapi_free(struct _stor_fwrite_rsp *);
void stor_fwrite_rsp_free(struct _stor_fwrite_rsp *ptr) { osapi_free(ptr); }


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

x86 assembly (clang, -O2):
<stor_fwrite_rsp_free>:
jmp    1030 <osapi_free@plt>

LLVM IR (-O0):
%struct._stor_fwrite_rsp = type { i32 }
define void @stor_fwrite_rsp_free(%struct._stor_fwrite_rsp* %0) {
%2 = alloca %struct._stor_fwrite_rsp*
store %struct._stor_fwrite_rsp* %0, %struct._stor_fwrite_rsp** %2
%3 = load %struct._stor_fwrite_rsp*, %struct._stor_fwrite_rsp** %2
%4 = call i32 @osapi_free(%struct._stor_fwrite_rsp* %3)
ret void
}

LLVM IR (-O2):
%struct._stor_fwrite_rsp = type { i32 }
define void @stor_fwrite_rsp_free(%struct._stor_fwrite_rsp* %0) {
%2 = tail call i32 @osapi_free(%struct._stor_fwrite_rsp* %0)
ret void
}
/* Variables and functions */
int fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ print_file_get();
int print_indent(int /*<<< orphan*/);
int print_wrap(void) {
  int rc;
  rc = fputs("\n", print_file_get());
  if (rc < 0) {
    return (rc);
  }
  return (print_indent(0));
}


x86 assembly (clang, -O0):
<print_wrap>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <print_file_get@plt>
mov    %eax,%esi
lea    0xeb8(%rip),%rdi
call   1050 <fputs@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    1165 <print_wrap+0x35>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    116f <print_wrap+0x3f>
xor    %edi,%edi
call   1030 <print_indent@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_wrap>:
push   %rax
xor    %eax,%eax
call   1040 <print_file_get@plt>
lea    0xec1(%rip),%rdi
mov    %eax,%esi
call   1050 <fputs@plt>
test   %eax,%eax
js     1152 <print_wrap+0x22>
xor    %edi,%edi
pop    %rax
jmp    1030 <print_indent@plt>
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [2 x i8] c"\0A\00"
define i32 @print_wrap() {
%1 = tail call i32 (...) @print_file_get()
%2 = tail call i32 @fputs(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = icmp slt i32 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %0
%5 = tail call i32 @print_indent(i32 0)
br label %6
6: ; preds = %0, %4
%7 = phi i32 [ %5, %4 ], [ %2, %0 ]
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void n() {
  static int s = 0;
  printf("%d\n", s++);
  printf("%d\n", ++s);
}


x86 assembly (clang, -O0):
<n>:
push   %rbp
mov    %rsp,%rbp
mov    0x2f12(%rip),%esi
mov    %esi,%eax
add    $0x1,%eax
mov    %eax,0x2f07(%rip)
lea    0xed4(%rip),%rdi
call   1030 <printf@plt>
mov    0x2ef5(%rip),%esi
add    $0x1,%esi
mov    %esi,0x2eec(%rip)
lea    0xeb9(%rip),%rdi
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<n>:
push   %rbx
mov    0x2f15(%rip),%esi
lea    0x1(%rsi),%eax
mov    %eax,0x2f0c(%rip)
lea    0xed9(%rip),%rbx
mov    %rbx,%rdi
call   1030 <printf@plt>
mov    0x2ef7(%rip),%esi
add    $0x1,%esi
mov    %esi,0x2eee(%rip)
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@n.s = internal unnamed_addr global i32 0
@.str = [4 x i8] c"%d\0A\00"
define void @n() {
%1 = load i32, i32* @n.s
%2 = add nsw i32 %1, 1
store i32 %2, i32* @n.s
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
%4 = load i32, i32* @n.s
%5 = add nsw i32 %4, 1
store i32 %5, i32* @n.s
%6 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %5)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void mem_free(void *p) {
  if (p)
    free(p);
}


x86 assembly (clang, -O0):
<mem_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1130 <mem_free+0x20>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mem_free>:
test   %rdi,%rdi
je     111a <mem_free+0xa>
jmp    1030 <free@plt>
ret

LLVM IR (-O0):
define void @mem_free(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp ne i8* %3, null
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i8*, i8** %2
%7 = call i32 @free(i8* %6)
br label %8
8: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
define void @mem_free(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @free(i8* %0)
br label %5
5: ; preds = %3, %1
ret void
}
double topocentric_local_hour_angle(double h, double delta_alpha) {
  return h - delta_alpha;
}


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

x86 assembly (clang, -O2):
<topocentric_local_hour_angle>:
subsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @topocentric_local_hour_angle(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = fsub double %5, %6
ret double %7
}

LLVM IR (-O2):
define double @topocentric_local_hour_angle(double %0, double %1) {
%3 = fsub double %0, %1
ret double %3
}
/* Variables and functions */
int flog_get_level();
int flog_is_warn_enabled() { return 3 >= flog_get_level(); }


x86 assembly (clang, -O0):
<flog_is_warn_enabled>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <flog_get_level@plt>
mov    %eax,%ecx
mov    $0x3,%eax
cmp    %ecx,%eax
setge  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<flog_is_warn_enabled>:
push   %rax
xor    %eax,%eax
call   1030 <flog_get_level@plt>
xor    %ecx,%ecx
cmp    $0x4,%eax
setl   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @flog_is_warn_enabled() {
%1 = call i32 (...) @flog_get_level()
%2 = icmp sge i32 3, %1
%3 = zext i1 %2 to i32
ret i32 %3
}

LLVM IR (-O2):
define i32 @flog_is_warn_enabled() {
%1 = tail call i32 (...) @flog_get_level()
%2 = icmp slt i32 %1, 4
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
__attribute__((visibility("default"))) void *
sd_resolve_query_get_userdata(void *q) {
  return NULL;
}


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

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

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

LLVM IR (-O2):
define noalias i8* @sd_resolve_query_get_userdata(i8* nocapture readnone %0) {
ret i8* null
}
/* Variables and functions */
int *malloc(int);
void foo(int size) { int *data = malloc(sizeof(int) * size); }


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movslq -0x4(%rbp),%rax
shl    $0x2,%rax
mov    %eax,%edi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
shl    $0x2,%edi
jmp    1030 <malloc@plt>

LLVM IR (-O0):
define void @foo(i32 %0) {
%2 = alloca i32
%3 = alloca i32*
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = sext i32 %4 to i64
%6 = mul i64 4, %5
%7 = trunc i64 %6 to i32
%8 = call i32* @malloc(i32 %7)
store i32* %8, i32** %3
ret void
}

LLVM IR (-O2):
define void @foo(i32 %0) {
%2 = shl i32 %0, 2
%3 = tail call i32* @malloc(i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ editor_cleanup();
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ klog(char *);
void segfault_signal() {
  klog("SEGFAULT - cleaning up and exiting...");
  editor_cleanup();
  exit(1);
}


x86 assembly (clang, -O0):
<segfault_signal>:
push   %rbp
mov    %rsp,%rbp
lea    0xec5(%rip),%rdi
call   1030 <klog@plt>
mov    $0x0,%al
call   1050 <editor_cleanup@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<segfault_signal>:
push   %rax
lea    0xec8(%rip),%rdi
call   1030 <klog@plt>
xor    %eax,%eax
call   1050 <editor_cleanup@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [38 x i8] c"SEGFAULT - cleaning up and exiting...\00"
define void @segfault_signal() {
%1 = call i32 @klog(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (...) @editor_cleanup()
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [38 x i8] c"SEGFAULT - cleaning up and exiting...\00"
define void @segfault_signal() {
%1 = tail call i32 @klog(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (...) @editor_cleanup()
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ permute(char *, int /*<<< orphan*/, int);
int /*<<< orphan*/ scanf(char *, char *);
int strlen(char *);
int main() {
  char str[500];
  scanf("%s", str);
  int l = strlen(str) - 1;
  permute(str, 0, strlen(str) - 1);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x210,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x200(%rbp),%rsi
lea    0xeb0(%rip),%rdi
call   1050 <scanf@plt>
lea    -0x200(%rbp),%rdi
call   1040 <strlen@plt>
sub    $0x1,%eax
mov    %eax,-0x204(%rbp)
lea    -0x200(%rbp),%rax
mov    %rax,-0x210(%rbp)
lea    -0x200(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x210(%rbp),%rdi
mov    %eax,%edx
sub    $0x1,%edx
xor    %esi,%esi
call   1030 <permute@plt>
xor    %eax,%eax
add    $0x210,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x200,%rsp
lea    0xec1(%rip),%rdi
mov    %rsp,%rbx
mov    %rbx,%rsi
call   1050 <scanf@plt>
mov    %rbx,%rdi
call   1040 <strlen@plt>
mov    %rbx,%rdi
call   1040 <strlen@plt>
lea    -0x1(%rax),%edx
mov    %rbx,%rdi
xor    %esi,%esi
call   1030 <permute@plt>
xor    %eax,%eax
add    $0x200,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [500 x i8]
%3 = alloca i32
store i32 0, i32* %1
%4 = getelementptr inbounds [500 x i8], [500 x i8]* %2, i64 0, i64 0
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = getelementptr inbounds [500 x i8], [500 x i8]* %2, i64 0, i64 0
%7 = call i32 @strlen(i8* %6)
%8 = sub nsw i32 %7, 1
store i32 %8, i32* %3
%9 = getelementptr inbounds [500 x i8], [500 x i8]* %2, i64 0, i64 0
%10 = getelementptr inbounds [500 x i8], [500 x i8]* %2, i64 0, i64 0
%11 = call i32 @strlen(i8* %10)
%12 = sub nsw i32 %11, 1
%13 = call i32 @permute(i8* %9, i32 0, i32 %12)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define i32 @main() {
%1 = alloca [500 x i8]
%2 = getelementptr inbounds [500 x i8], [500 x i8]* %1, i64 0, i64 0
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = call i32 @strlen(i8* %2)
%5 = call i32 @strlen(i8* %2)
%6 = add nsw i32 %5, -1
%7 = call i32 @permute(i8* %2, i32 0, i32 %6)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ puts(char *);
void test_value_copy() {
  printf("testing binn value copy... ");
  puts("TODO!!!");
}


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

x86 assembly (clang, -O2):
<test_value_copy>:
push   %rax
lea    0xed8(%rip),%rdi
call   1040 <printf@plt>
lea    0xee8(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [28 x i8] c"testing binn value copy... \00"
@.str.1 = [8 x i8] c"TODO!!!\00"
define void @test_value_copy() {
%1 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @puts(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [28 x i8] c"testing binn value copy... \00"
@.str.1 = [8 x i8] c"TODO!!!\00"
define void @test_value_copy() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void Com_Crash_f(void) { *(volatile int *)0 = 0x12345678; }


x86 assembly (clang, -O0):
<Com_Crash_f>:
push   %rbp
mov    %rsp,%rbp
xor    %eax,%eax
movl   $0x12345678,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<Com_Crash_f>:
movl   $0x12345678,0x0
78 56 34 12
ret

LLVM IR (-O0):
define void @Com_Crash_f() {
store volatile i32 305419896, i32* null
ret void
}

LLVM IR (-O2):
define void @Com_Crash_f() {
store volatile i32 305419896, i32* null
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int func3(int a, int b) {
  int c = a + b;
  printf("c = %d\n", c);
  return a + b;
}


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

x86 assembly (clang, -O2):
<func3>:
push   %rbx
lea    (%rsi,%rdi,1),%ebx
lea    0xee5(%rip),%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [8 x i8] c"c = %d\0A\00"
define i32 @func3(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 = add nsw i32 %6, %7
store i32 %8, i32* %5
%9 = load i32, i32* %5
%10 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = load i32, i32* %3
%12 = load i32, i32* %4
%13 = add nsw i32 %11, %12
ret i32 %13
}

LLVM IR (-O2):
@.str = [8 x i8] c"c = %d\0A\00"
define i32 @func3(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
%4 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 %3
}
/* Type definitions */
struct class {
  int dummy;
};

/* Variables and functions */
long IS_ERR(void const *);
int /*<<< orphan*/ class_unregister(struct class *);
void class_destroy(struct class *cls) {
  long tmp;
  if ((unsigned int)cls == (unsigned int)((void *)0)) {
    return;
  } else {
    tmp = IS_ERR((void const *)cls);
    if (tmp) {
      return;
    }
  }
  class_unregister(cls);
  return;
}


x86 assembly (clang, -O0):
<class_destroy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmp    $0x0,%eax
jne    113e <class_destroy+0x1e>
jmp    1169 <class_destroy+0x49>
mov    -0x8(%rbp),%rdi
call   1040 <IS_ERR@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     115b <class_destroy+0x3b>
jmp    1169 <class_destroy+0x49>
jmp    1160 <class_destroy+0x40>
mov    -0x8(%rbp),%rdi
call   1030 <class_unregister@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<class_destroy>:
push   %rbx
mov    %rdi,%rbx
test   %ebx,%ebx
je     1135 <class_destroy+0x15>
mov    %rbx,%rdi
call   1040 <IS_ERR@plt>
test   %rax,%rax
je     1137 <class_destroy+0x17>
pop    %rbx
ret
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <class_unregister@plt>

LLVM IR (-O0):
%struct.class = type { i32 }
define void @class_destroy(%struct.class* %0) {
%2 = alloca %struct.class*
%3 = alloca i64
store %struct.class* %0, %struct.class** %2
%4 = load %struct.class*, %struct.class** %2
%5 = ptrtoint %struct.class* %4 to i32
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %1
br label %19
8: ; preds = %1
%9 = load %struct.class*, %struct.class** %2
%10 = bitcast %struct.class* %9 to i8*
%11 = call i64 @IS_ERR(i8* %10)
store i64 %11, i64* %3
%12 = load i64, i64* %3
%13 = icmp ne i64 %12, 0
br i1 %13, label %14, label %15
14: ; preds = %8
br label %19
15: ; preds = %8
br label %16
16: ; preds = %15
%17 = load %struct.class*, %struct.class** %2
%18 = call i32 @class_unregister(%struct.class* %17)
br label %19
19: ; preds = %16, %14, %7
ret void
}

LLVM IR (-O2):
%struct.class = type { i32 }
define void @class_destroy(%struct.class* %0) {
%2 = ptrtoint %struct.class* %0 to i64
%3 = trunc i64 %2 to i32
%4 = icmp eq i32 %3, 0
br i1 %4, label %11, label %5
5: ; preds = %1
%6 = bitcast %struct.class* %0 to i8*
%7 = tail call i64 @IS_ERR(i8* %6)
%8 = icmp eq i64 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %5
%10 = tail call i32 @class_unregister(%struct.class* %0)
br label %11
11: ; preds = %5, %1, %9
ret void
}
/* Variables and functions */
int EOF;
int getchar();
void purge_stdin(void) {
  int c = 0;
  while ((c = getchar()) != '\n' && c != EOF)
    ;
}


x86 assembly (clang, -O0):
<purge_stdin>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <getchar@plt>
mov    %eax,%ecx
mov    %ecx,-0x4(%rbp)
xor    %eax,%eax
cmp    $0xa,%ecx
mov    %al,-0x5(%rbp)
je     114b <purge_stdin+0x3b>
mov    -0x4(%rbp),%eax
mov    0x2ea5(%rip),%rcx
cmp    (%rcx),%eax
setne  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
test   $0x1,%al
jne    115b <purge_stdin+0x4b>
jmp    1160 <purge_stdin+0x50>
jmp    111f <purge_stdin+0xf>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<purge_stdin>:
push   %rbx
mov    0x2ed0(%rip),%rbx
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <getchar@plt>
cmp    $0xa,%eax
je     1130 <purge_stdin+0x20>
cmp    (%rbx),%eax
jne    1120 <purge_stdin+0x10>
pop    %rbx
ret

LLVM IR (-O0):
@EOF = global i32 0
define void @purge_stdin() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %11, %0
%3 = call i32 (...) @getchar()
store i32 %3, i32* %1
%4 = icmp ne i32 %3, 10
br i1 %4, label %5, label %9
5: ; preds = %2
%6 = load i32, i32* %1
%7 = load i32, i32* @EOF
%8 = icmp ne i32 %6, %7
br label %9
9: ; preds = %5, %2
%10 = phi i1 [ false, %2 ], [ %8, %5 ]
br i1 %10, label %11, label %12
11: ; preds = %9
br label %2
12: ; preds = %9
ret void
}

LLVM IR (-O2):
@EOF = global i32 0
define void @purge_stdin() {
br label %1
1: ; preds = %1, %0
%2 = tail call i32 (...) @getchar()
%3 = icmp ne i32 %2, 10
%4 = load i32, i32* @EOF
%5 = icmp ne i32 %2, %4
%6 = select i1 %3, i1 %5, i1 false
br i1 %6, label %1, label %7
7: ; preds = %1
ret void
}
int fn2(int a, int b) {
  int tem1 = b | a;
  int tem2 = a & b;
  return tem1 - tem2;
}


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

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

LLVM IR (-O0):
define i32 @fn2(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%7 = load i32, i32* %4
%8 = load i32, i32* %3
%9 = or i32 %7, %8
store i32 %9, i32* %5
%10 = load i32, i32* %3
%11 = load i32, i32* %4
%12 = and i32 %10, %11
store i32 %12, i32* %6
%13 = load i32, i32* %5
%14 = load i32, i32* %6
%15 = sub nsw i32 %13, %14
ret i32 %15
}

LLVM IR (-O2):
define i32 @fn2(i32 %0, i32 %1) {
%3 = xor i32 %1, %0
ret i32 %3
}
/* Variables and functions */
extern int strlen(const char *str) {
  int len = 0;
  while (*str) {
    len++;
    str++;
  }
  return len;
}


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

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

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

LLVM IR (-O2):
define i32 @strlen(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i32 [ %7, %4 ], [ 0, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = add nuw nsw i32 %5, 1
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
%12 = phi i32 [ 0, %1 ], [ %7, %4 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
char *str_lstrip(int /*<<< orphan*/);
int /*<<< orphan*/ str_rstrip(char *);
char *str_trim(char *str) {
  assert(str != NULL);
  return str_lstrip(str_rstrip(str));
}


x86 assembly (clang, -O0):
<str_trim>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    -0x8(%rbp),%rdi
call   1050 <str_rstrip@plt>
mov    %eax,%edi
call   1030 <str_lstrip@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<str_trim>:
push   %rbx
mov    %rdi,%rbx
xor    %edi,%edi
test   %rbx,%rbx
setne  %dil
call   1040 <assert@plt>
mov    %rbx,%rdi
call   1050 <str_rstrip@plt>
mov    %eax,%edi
pop    %rbx
jmp    1030 <str_lstrip@plt>

LLVM IR (-O0):
define i8* @str_trim(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp ne i8* %3, null
%5 = zext i1 %4 to i32
%6 = call i32 @assert(i32 %5)
%7 = load i8*, i8** %2
%8 = call i32 @str_rstrip(i8* %7)
%9 = call i8* @str_lstrip(i32 %8)
ret i8* %9
}

LLVM IR (-O2):
define i8* @str_trim(i8* %0) {
%2 = icmp ne i8* %0, null
%3 = zext i1 %2 to i32
%4 = tail call i32 @assert(i32 %3)
%5 = tail call i32 @str_rstrip(i8* %0)
%6 = tail call i8* @str_lstrip(i32 %5)
ret i8* %6
}
/* Variables and functions */
int /*<<< orphan*/ Report(char *);
int astGScales(float *alpha, float *beta) {
  Report("astGScales");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [11 x i8] c"astGScales\00"
define i32 @astGScales(float* %0, float* %1) {
%3 = alloca float*
%4 = alloca float*
store float* %0, float** %3
store float* %1, float** %4
%5 = call i32 @Report(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [11 x i8] c"astGScales\00"
define i32 @astGScales(float* nocapture readnone %0, float* nocapture readnone %1) {
%3 = tail call i32 @Report(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
void cdiDefAdditionalKey(const char *name) { (void)name; }


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

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

LLVM IR (-O0):
define void @cdiDefAdditionalKey(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
ret void
}

LLVM IR (-O2):
define void @cdiDefAdditionalKey(i8* nocapture %0) {
ret void
}
int ima_file_mmap(struct file *file, unsigned long prot) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.file = type opaque
define i32 @ima_file_mmap(%struct.file* nocapture readnone %0, i64 %1) {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ xcb_window_t;
typedef int /*<<< orphan*/ xcb_connection_t;

/* Variables and functions */
int /*<<< orphan*/ xembed_message_send(int /*<<< orphan*/ *, int /*<<< orphan*/,
                                       int, long, int /*<<< orphan*/,
                                       int /*<<< orphan*/);
void xembed_focus_in(xcb_connection_t *c, xcb_window_t client,
                     long focus_type) {
  xembed_message_send(c, client, 4, focus_type, 0, 0);
}


x86 assembly (clang, -O0):
<xembed_focus_in>:
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    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rcx
mov    $0x4,%edx
xor    %r9d,%r9d
mov    %r9d,%r8d
call   1030 <xembed_message_send@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xembed_focus_in>:
mov    %rdx,%rcx
mov    $0x4,%edx
xor    %r8d,%r8d
xor    %r9d,%r9d
jmp    1030 <xembed_message_send@plt>

LLVM IR (-O0):
define void @xembed_focus_in(i32* %0, i32 %1, i64 %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i64
store i32* %0, i32** %4
store i32 %1, i32* %5
store i64 %2, i64* %6
%7 = load i32*, i32** %4
%8 = load i32, i32* %5
%9 = load i64, i64* %6
%10 = call i32 @xembed_message_send(i32* %7, i32 %8, i32 4, i64 %9, i32 0, i32 0)
ret void
}

LLVM IR (-O2):
define void @xembed_focus_in(i32* %0, i32 %1, i64 %2) {
%4 = tail call i32 @xembed_message_send(i32* %0, i32 %1, i32 4, i64 %2, i32 0, i32 0)
ret void
}
int shr2_local(x) { return 2 * x; }


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

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

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

LLVM IR (-O2):
define i32 @shr2_local(i32 %0) {
%2 = shl nsw i32 %0, 1
ret i32 %2
}
void time_statisic_begin(void) {}


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

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

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

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