xunge/DecIR huggingface dataset:
char *cnv_help(void) { return "Syntax: unspecform infile outfile"; }


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

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

LLVM IR (-O0):
@.str = [34 x i8] c"Syntax: unspecform infile outfile\00"
define i8* @cnv_help() {
ret i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [34 x i8] c"Syntax: unspecform infile outfile\00"
define i8* @cnv_help() {
ret i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ error(int);
int /*<<< orphan*/ printf(char *);
int main() {
  int err = 0;
  printf("This is"
         "ver 0");
  error(err);
  error(err);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%edi
call   1040 <error@plt>
mov    -0x8(%rbp),%edi
call   1040 <error@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [13 x i8] c"This isver 0\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* %2
%5 = call i32 @error(i32 %4)
%6 = load i32, i32* %2
%7 = call i32 @error(i32 %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [13 x i8] c"This isver 0\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @error(i32 0)
%3 = tail call i32 @error(i32 0)
ret i32 0
}
int main() {
  int cookie1;
  int cookie2;
  int cookie3;
  int rv = 1;
  if (cookie1 == 0x41424344) {
    if (cookie2 == 0x45464748) {
      if (cookie3 == 0x00ABCDEF) {
        rv = 0;
      }
    }
  }
  return rv;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x14(%rbp)
cmpl   $0x41424344,-0x8(%rbp)
jne    114a <main+0x4a>
cmpl   $0x45464748,-0xc(%rbp)
jne    1145 <main+0x45>
cmpl   $0xabcdef,-0x10(%rbp)
jne    1140 <main+0x40>
movl   $0x0,-0x14(%rbp)
jmp    1145 <main+0x45>
jmp    114a <main+0x4a>
mov    -0x14(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 1
}
void PKCS7_ISSUER_AND_SERIAL_free(void) {}


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

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

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

LLVM IR (-O2):
define void @PKCS7_ISSUER_AND_SERIAL_free() {
ret void
}
void handler_sigint(int sig) { sig = sig; }


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

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

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

LLVM IR (-O2):
define void @handler_sigint(i32 %0) {
ret void
}
/* Variables and functions */
int read(int, float *, int);
int read_float4(int f, float *x) {
  if (read(f, x, 4) == 4) {
    return 1;
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<read_float4>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    $0x4,%edx
call   1030 <read@plt>
cmp    $0x4,%eax
jne    1145 <read_float4+0x35>
movl   $0x1,-0x4(%rbp)
jmp    114c <read_float4+0x3c>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @read_float4(i32 %0, float* nocapture %1) {
%3 = tail call i32 @read(i32 %0, float* %1, i32 4)
%4 = icmp eq i32 %3, 4
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
void memset(void) {}


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

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

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

LLVM IR (-O2):
define void @memset() {
ret void
}
indreg0adrreg1_set(r0, r1, x0, x1, p0, p1) int r0, r1;
int *p0, *p1;
{ (*p0) = (p1[1111111 / 4]); }


x86 assembly (clang, -O0):
<indreg0adrreg1_set>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8,-0x20(%rbp)
mov    %r9,-0x28(%rbp)
mov    -0x28(%rbp),%rax
mov    0x10f444(%rax),%ecx
mov    -0x20(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<indreg0adrreg1_set>:
mov    0x10f444(%r9),%eax
mov    %eax,(%r8)
ret

LLVM IR (-O0):
define i32 @indreg0adrreg1_set(i32 %0, i32 %1, i32 %2, i32 %3, i32* %4, i32* %5) {
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32*
%13 = alloca i32*
store i32 %0, i32* %8
store i32 %1, i32* %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store i32* %4, i32** %12
store i32* %5, i32** %13
%14 = load i32*, i32** %13
%15 = getelementptr inbounds i32, i32* %14, i64 277777
%16 = load i32, i32* %15
%17 = load i32*, i32** %12
store i32 %16, i32* %17
%18 = load i32, i32* %7
ret i32 %18
}

LLVM IR (-O2):
define i32 @indreg0adrreg1_set(i32 %0, i32 %1, i32 %2, i32 %3, i32* nocapture writeonly %4, i32* nocapture %5) {
%7 = getelementptr inbounds i32, i32* %5, i64 277777
%8 = load i32, i32* %7
store i32 %8, i32* %4
ret i32 undef
}
int sys$enter(struct _fab *fab, void *err, void *suc) {
  return ({
    unsigned long resultvar;
    register long int _a3 asm("rdx") = (long)(suc);
    register long int _a2 asm("rsi") = (long)(err);
    register long int _a1 asm("rdi") = (long)(fab);
    asm volatile("movq %1, %%rax\n\t"
                 "int $0x82\n\t"
                 : "=a"(resultvar)
                 : "i"(7), "r"(_a1), "r"(_a2), "r"(_a3)
                 : "memory", "cc", "r11", "cx");
    (long)resultvar;
  });
}


x86 assembly (clang, -O0):
<sys$enter>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x38(%rbp),%rdi
mov    -0x30(%rbp),%rsi
mov    -0x28(%rbp),%rdx
mov    $0x7,%rax
int    $0x82
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x40(%rbp)
mov    -0x40(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sys$enter>:
mov    $0x7,%rax
int    $0x82
ret

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

LLVM IR (-O2):
%struct._fab = type opaque
define i32 @"sys$enter"(%struct._fab* %0, i8* %1, i8* %2) {
%4 = ptrtoint i8* %2 to i64
%5 = ptrtoint i8* %1 to i64
%6 = ptrtoint %struct._fab* %0 to i64
%7 = tail call i64 asm sideeffect "movq $1, %rax\0A\09int $$0x82\0A\09", "={ax},i,{rdi},{rsi},{rdx},~{memory},~{cc},~{r11},~{cx},~{dirflag},~{fpsr},~{flags}"(i32 7, i64 %6, i64 %5, i64 %4)
%8 = trunc i64 %7 to i32
ret i32 %8
}
int zero_or_ten(int ten) {
  if (ten) {
    return 10;
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<zero_or_ten>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     111d <zero_or_ten+0x1d>
movl   $0xa,-0x4(%rbp)
jmp    1124 <zero_or_ten+0x24>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<zero_or_ten>:
test   %edi,%edi
mov    $0xa,%eax
cmove  %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @zero_or_ten(i32 %0) {
%2 = icmp eq i32 %0, 0
%3 = select i1 %2, i32 0, i32 10
ret i32 %3
}
/* Variables and functions */
char *mempcpy(char *, int /*<<< orphan*/, int);
int /*<<< orphan*/ uint_to_string_2_digits(unsigned int);
char *append_two_digits(char *p, unsigned int digits) {
  return mempcpy(p, uint_to_string_2_digits(digits), 2);
}


x86 assembly (clang, -O0):
<append_two_digits>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%edi
call   1040 <uint_to_string_2_digits@plt>
mov    -0x18(%rbp),%rdi
mov    %eax,%esi
mov    $0x2,%edx
call   1030 <mempcpy@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<append_two_digits>:
push   %rbx
mov    %rdi,%rbx
mov    %esi,%edi
call   1040 <uint_to_string_2_digits@plt>
mov    %rbx,%rdi
mov    %eax,%esi
mov    $0x2,%edx
pop    %rbx
jmp    1030 <mempcpy@plt>

LLVM IR (-O0):
define i8* @append_two_digits(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = load i32, i32* %4
%7 = call i32 @uint_to_string_2_digits(i32 %6)
%8 = call i8* @mempcpy(i8* %5, i32 %7, i32 2)
ret i8* %8
}

LLVM IR (-O2):
define i8* @append_two_digits(i8* %0, i32 %1) {
%3 = tail call i32 @uint_to_string_2_digits(i32 %1)
%4 = tail call i8* @mempcpy(i8* %0, i32 %3, i32 2)
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ UpnpResponse_RemoteIOClient_RemoteIO_SetPeerOverride(void *);
int /*<<< orphan*/ printf(char *, char *);
void UpnpRemoteIOClient_RemoteIO_SetPeerOverride(void *upnptoken,
                                                 char *PeerConnection) {
  printf("Invoke: UpnpRemoteIOClient_RemoteIO_SetPeerOverride(%s);\r\n",
         PeerConnection);
  UpnpResponse_RemoteIOClient_RemoteIO_SetPeerOverride(upnptoken);
}


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

x86 assembly (clang, -O2):
<UpnpRemoteIOClient_RemoteIO_SetPeerOverride>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rdi
call   1040 <printf@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <UpnpResponse_RemoteIOClient_RemoteIO_SetPeerOverride@plt>

LLVM IR (-O0):
@.str = [59 x i8] c"Invoke: UpnpRemoteIOClient_RemoteIO_SetPeerOverride(%s);\0D\0A\00"
define void @UpnpRemoteIOClient_RemoteIO_SetPeerOverride(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = call i32 @printf(i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str, i64 0, i64 0), i8* %5)
%7 = load i8*, i8** %3
%8 = call i32 @UpnpResponse_RemoteIOClient_RemoteIO_SetPeerOverride(i8* %7)
ret void
}

LLVM IR (-O2):
@.str = [59 x i8] c"Invoke: UpnpRemoteIOClient_RemoteIO_SetPeerOverride(%s);\0D\0A\00"
define void @UpnpRemoteIOClient_RemoteIO_SetPeerOverride(i8* %0, i8* %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str, i64 0, i64 0), i8* %1)
%4 = tail call i32 @UpnpResponse_RemoteIOClient_RemoteIO_SetPeerOverride(i8* %0)
ret void
}
void fc152(int n) {
  {
    typedef int(*b)[n];
    {
      typedef int(*c)[n];
      0;
    }
    {
      typedef int(*d)[n];
      0;
    };
    typedef int(*e)[n];
    0;
  };
  {
    typedef int(*f)[n];
  a:
    goto a;
    {
      typedef int(*g)[n];
      0;
    };
    {
      typedef int(*h)[n];
      0;
    };
    ;
    typedef int(*i)[n];
    0;
  };
  ;
  typedef int(*j)[n];
  0;
}


x86 assembly (clang, -O0):
<fc152>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
jmp    1107 <fc152+0x7>

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

LLVM IR (-O0):
define void @fc152(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = zext i32 %3 to i64
%5 = load i32, i32* %2
%6 = zext i32 %5 to i64
%7 = load i32, i32* %2
%8 = zext i32 %7 to i64
%9 = load i32, i32* %2
%10 = zext i32 %9 to i64
%11 = load i32, i32* %2
%12 = zext i32 %11 to i64
br label %13
13: ; preds = %13, %1
br label %13
14: ; No predecessors!
%15 = load i32, i32* %2
%16 = zext i32 %15 to i64
%17 = load i32, i32* %2
%18 = zext i32 %17 to i64
%19 = load i32, i32* %2
%20 = zext i32 %19 to i64
%21 = load i32, i32* %2
%22 = zext i32 %21 to i64
ret void
}

LLVM IR (-O2):
define void @fc152(i32 %0) {
br label %2
2: ; preds = %2, %1
br label %2
}
/* Variables and functions */
unsigned int __perfctr_mk_cstatus(unsigned int, unsigned int, unsigned int,
                                  unsigned int);
unsigned int perfctr_mk_cstatus(unsigned int tsc_on, unsigned int nractrs,
                                unsigned int nrictrs) {
  return __perfctr_mk_cstatus(tsc_on, nrictrs, nrictrs, nractrs);
}


x86 assembly (clang, -O0):
<perfctr_mk_cstatus>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    -0xc(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x8(%rbp),%ecx
call   1030 <__perfctr_mk_cstatus@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<perfctr_mk_cstatus>:
mov    %esi,%ecx
mov    %edx,%esi
jmp    1030 <__perfctr_mk_cstatus@plt>

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

LLVM IR (-O2):
define i32 @perfctr_mk_cstatus(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @__perfctr_mk_cstatus(i32 %0, i32 %2, i32 %2, i32 %1)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ evil_exception(char *, int);
int /*<<< orphan*/ finish_exception();
void do_fiq(void) {
  evil_exception("fast interrupt request", 6);
  finish_exception();
}


x86 assembly (clang, -O0):
<do_fiq>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
mov    $0x6,%esi
call   1030 <evil_exception@plt>
mov    $0x0,%al
call   1040 <finish_exception@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_fiq>:
push   %rax
lea    0xed8(%rip),%rdi
mov    $0x6,%esi
call   1030 <evil_exception@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <finish_exception@plt>

LLVM IR (-O0):
@.str = [23 x i8] c"fast interrupt request\00"
define void @do_fiq() {
%1 = call i32 @evil_exception(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 6)
%2 = call i32 (...) @finish_exception()
ret void
}

LLVM IR (-O2):
@.str = [23 x i8] c"fast interrupt request\00"
define void @do_fiq() {
%1 = tail call i32 @evil_exception(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 6)
%2 = tail call i32 (...) @finish_exception()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ SSL_CTX;

/* Variables and functions */
int /*<<< orphan*/ *SSL_CTX_new(int /*<<< orphan*/);
int /*<<< orphan*/ SSLv23_server_method();
SSL_CTX *zopenssl_create_SSL_CTX_server(void) {
  return SSL_CTX_new(SSLv23_server_method());
}


x86 assembly (clang, -O0):
<zopenssl_create_SSL_CTX_server>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <SSLv23_server_method@plt>
mov    %eax,%edi
call   1040 <SSL_CTX_new@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<zopenssl_create_SSL_CTX_server>:
push   %rax
xor    %eax,%eax
call   1030 <SSLv23_server_method@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <SSL_CTX_new@plt>

LLVM IR (-O0):
define i32* @zopenssl_create_SSL_CTX_server() {
%1 = call i32 (...) @SSLv23_server_method()
%2 = call i32* @SSL_CTX_new(i32 %1)
ret i32* %2
}

LLVM IR (-O2):
define i32* @zopenssl_create_SSL_CTX_server() {
%1 = tail call i32 (...) @SSLv23_server_method()
%2 = tail call i32* @SSL_CTX_new(i32 %1)
ret i32* %2
}
/* Variables and functions */
int /*<<< orphan*/ abort();
char *begfield(char, char *, char *, int, int);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
main() {
  char *s = ":ab";
  char *lim = s + 3;
  if (begfield(':', s, lim, 1, 1) != s + 2)
    abort();
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x3,%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    $0x3a,%edi
mov    $0x1,%r8d
mov    %r8d,%ecx
call   1040 <begfield@plt>
mov    -0x10(%rbp),%rcx
add    $0x2,%rcx
cmp    %rcx,%rax
je     1189 <main+0x59>
mov    $0x0,%al
call   1030 <abort@plt>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rsi
lea    0xec4(%rip),%rdx
mov    $0x3a,%edi
mov    $0x1,%ecx
mov    $0x1,%r8d
call   1040 <begfield@plt>
lea    0xea7(%rip),%rcx
cmp    %rcx,%rax
jne    1167 <main+0x37>
xor    %edi,%edi
call   1050 <exit@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@.str = [4 x i8] c":ab\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
%3 = alloca i8*
store i32 0, i32* %1
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8** %2
%4 = load i8*, i8** %2
%5 = getelementptr inbounds i8, i8* %4, i64 3
store i8* %5, i8** %3
%6 = load i8*, i8** %2
%7 = load i8*, i8** %3
%8 = call i8* @begfield(i8 signext 58, i8* %6, i8* %7, i32 1, i32 1)
%9 = load i8*, i8** %2
%10 = getelementptr inbounds i8, i8* %9, i64 2
%11 = icmp ne i8* %8, %10
br i1 %11, label %12, label %14
12: ; preds = %0
%13 = call i32 (...) @abort()
unreachable
14: ; preds = %0
%15 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [4 x i8] c":ab\00"
define i32 @main() {
%1 = tail call i8* @begfield(i8 signext 58, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 3), i32 1, i32 1)
%2 = icmp eq i8* %1, getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 2)
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 (...) @abort()
unreachable
5: ; preds = %0
%6 = tail call i32 @exit(i32 0)
unreachable
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
void setbit(void *v, int p) { ((uint32_t *)v)[p >> 5] |= 1 << (p & 31); }


x86 assembly (clang, -O0):
<setbit>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
and    $0x1f,%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
sar    $0x5,%ecx
movslq %ecx,%rcx
or     (%rax,%rcx,4),%edx
mov    %edx,(%rax,%rcx,4)
pop    %rbp
ret

x86 assembly (clang, -O2):
<setbit>:
mov    %esi,%ecx
mov    $0x1,%eax
shl    %cl,%eax
sar    $0x5,%ecx
movslq %ecx,%rcx
or     %eax,(%rdi,%rcx,4)
ret

LLVM IR (-O0):
define void @setbit(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = and i32 %5, 31
%7 = shl i32 1, %6
%8 = load i8*, i8** %3
%9 = bitcast i8* %8 to i32*
%10 = load i32, i32* %4
%11 = ashr i32 %10, 5
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds i32, i32* %9, i64 %12
%14 = load i32, i32* %13
%15 = or i32 %14, %7
store i32 %15, i32* %13
ret void
}

LLVM IR (-O2):
define void @setbit(i8* nocapture %0, i32 %1) {
%3 = and i32 %1, 31
%4 = shl nuw i32 1, %3
%5 = bitcast i8* %0 to i32*
%6 = ashr i32 %1, 5
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds i32, i32* %5, i64 %7
%9 = load i32, i32* %8
%10 = or i32 %9, %4
store i32 %10, i32* %8
ret void
}
int isnewline(int c) {
  return c == 0xA || c == 0xD || c == 0x2028 || c == 0x2029;
}


x86 assembly (clang, -O0):
<isnewline>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0x1,%al
cmpl   $0xa,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     1144 <isnewline+0x44>
mov    $0x1,%al
cmpl   $0xd,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     1144 <isnewline+0x44>
mov    $0x1,%al
cmpl   $0x2028,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     1144 <isnewline+0x44>
cmpl   $0x2029,-0x4(%rbp)
sete   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isnewline>:
mov    $0x1,%eax
cmp    $0xa,%edi
je     1122 <isnewline+0x22>
cmp    $0xd,%edi
je     1122 <isnewline+0x22>
cmp    $0x2028,%edi
je     1122 <isnewline+0x22>
xor    %eax,%eax
cmp    $0x2029,%edi
sete   %al
ret

LLVM IR (-O0):
define i32 @isnewline(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 10
br i1 %4, label %14, label %5
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp eq i32 %6, 13
br i1 %7, label %14, label %8
8: ; preds = %5
%9 = load i32, i32* %2
%10 = icmp eq i32 %9, 8232
br i1 %10, label %14, label %11
11: ; preds = %8
%12 = load i32, i32* %2
%13 = icmp eq i32 %12, 8233
br label %14
14: ; preds = %11, %8, %5, %1
%15 = phi i1 [ true, %8 ], [ true, %5 ], [ true, %1 ], [ %13, %11 ]
%16 = zext i1 %15 to i32
ret i32 %16
}

LLVM IR (-O2):
define i32 @isnewline(i32 %0) {
switch i32 %0, label %2 [
i32 8232, label %5
i32 13, label %5
i32 10, label %5
]
2: ; preds = %1
%3 = icmp eq i32 %0, 8233
%4 = zext i1 %3 to i32
br label %5
5: ; preds = %1, %1, %1, %2
%6 = phi i32 [ 1, %1 ], [ %4, %2 ], [ 1, %1 ], [ 1, %1 ]
ret i32 %6
}
/* Variables and functions */
int nthUglyNumber(int);
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char const *argv[]) {
  printf("%d\n", nthUglyNumber(6));
  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    $0x6,%edi
call   1040 <nthUglyNumber@plt>
mov    %eax,%esi
lea    0xeb7(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main(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 @nthUglyNumber(i32 6)
%7 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @nthUglyNumber(i32 6)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 0
}
int do_392() { return 392; }


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

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

LLVM IR (-O0):
define i32 @do_392() {
ret i32 392
}

LLVM IR (-O2):
define i32 @do_392() {
ret i32 392
}
/* Variables and functions */
scalar_t__ SIG_ERR;
int /*<<< orphan*/ die(char *);
scalar_t__ signal(int, void (*)(int));
void install_signal_handler(int sig, void (*handler)(int)) {
  if (signal(sig, handler) == SIG_ERR) {
    die("Could not install signal handler");
  }
}


x86 assembly (clang, -O0):
<install_signal_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <signal@plt>
mov    0x2e9e(%rip),%rcx
cmp    (%rcx),%rax
jne    1157 <install_signal_handler+0x37>
lea    0xeae(%rip),%rdi
call   1040 <die@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<install_signal_handler>:
push   %rax
call   1030 <signal@plt>
mov    0x2eb3(%rip),%rcx
cmp    (%rcx),%rax
jne    113f <install_signal_handler+0x1f>
lea    0xec7(%rip),%rdi
pop    %rax
jmp    1040 <die@plt>
pop    %rax
ret

LLVM IR (-O0):
@SIG_ERR = global i64 0
@.str = [33 x i8] c"Could not install signal handler\00"
define void @install_signal_handler(i32 %0, void (i32)* %1) {
%3 = alloca i32
%4 = alloca void (i32)*
store i32 %0, i32* %3
store void (i32)* %1, void (i32)** %4
%5 = load i32, i32* %3
%6 = load void (i32)*, void (i32)** %4
%7 = call i64 @signal(i32 %5, void (i32)* %6)
%8 = load i64, i64* @SIG_ERR
%9 = icmp eq i64 %7, %8
br i1 %9, label %10, label %12
10: ; preds = %2
%11 = call i32 @die(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
br label %12
12: ; preds = %10, %2
ret void
}

LLVM IR (-O2):
@SIG_ERR = global i64 0
@.str = [33 x i8] c"Could not install signal handler\00"
define void @install_signal_handler(i32 %0, void (i32)* %1) {
%3 = tail call i64 @signal(i32 %0, void (i32)* %1)
%4 = load i64, i64* @SIG_ERR
%5 = icmp eq i64 %3, %4
br i1 %5, label %6, label %8
6: ; preds = %2
%7 = tail call i32 @die(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %2
ret void
}
/* Variables and functions */
long double atanh(double);
__attribute__((weak)) long double atanhl(long double x) {
  return atanh((double)x);
}


x86 assembly (clang, -O0):
<atanhl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
fstpl  -0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
call   1030 <atanh@plt>
fld    %st(0)
fstp   %st(0)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<atanhl>:
fldt   0x8(%rsp)
fstpl  -0x8(%rsp)
movsd  -0x8(%rsp),%xmm0
jmp    1030 <atanh@plt>

LLVM IR (-O0):
define weak x86_fp80 @atanhl(x86_fp80 %0) {
%2 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %2
%3 = load x86_fp80, x86_fp80* %2
%4 = fptrunc x86_fp80 %3 to double
%5 = call x86_fp80 @atanh(double %4)
ret x86_fp80 %5
}

LLVM IR (-O2):
define weak x86_fp80 @atanhl(x86_fp80 %0) {
%2 = fptrunc x86_fp80 %0 to double
%3 = tail call x86_fp80 @atanh(double %2)
ret x86_fp80 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, char *, char *, int);
void setbooltype(char *tname, char *fname, int num, FILE *fp) {
  fprintf(fp, "define(STR_%s_%s%d)\n", tname, fname, num);
}


x86 assembly (clang, -O0):
<setbooltype>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
mov    -0x14(%rbp),%r8d
lea    0xec2(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<setbooltype>:
mov    %edx,%r8d
mov    %rsi,%rax
mov    %rdi,%rdx
lea    0xee0(%rip),%rsi
mov    %rcx,%rdi
mov    %rax,%rcx
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@.str = [21 x i8] c"define(STR_%s_%s%d)\0A\00"
define void @setbooltype(i8* %0, i8* %1, i32 %2, i32* %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i32*
store i8* %0, i8** %5
store i8* %1, i8** %6
store i32 %2, i32* %7
store i32* %3, i32** %8
%9 = load i32*, i32** %8
%10 = load i8*, i8** %5
%11 = load i8*, i8** %6
%12 = load i32, i32* %7
%13 = call i32 @fprintf(i32* %9, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* %10, i8* %11, i32 %12)
ret void
}

LLVM IR (-O2):
@.str = [21 x i8] c"define(STR_%s_%s%d)\0A\00"
define void @setbooltype(i8* %0, i8* %1, i32 %2, i32* nocapture %3) {
%5 = tail call i32 @fprintf(i32* %3, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1, i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
void blink(char on) { printf("%c[%dm", 0x1B, on != 0 ? 5 : 25); }


x86 assembly (clang, -O0):
<blink>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
mov    $0x19,%edx
mov    $0x5,%eax
cmp    $0x0,%ecx
cmovne %eax,%edx
lea    0xec7(%rip),%rdi
mov    $0x1b,%esi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<blink>:
test   %dil,%dil
mov    $0x19,%eax
mov    $0x5,%edx
cmove  %eax,%edx
lea    0xed9(%rip),%rdi
mov    $0x1b,%esi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"%c[%dm\00"
define void @blink(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp ne i32 %4, 0
%6 = zext i1 %5 to i64
%7 = select i1 %5, i32 5, i32 25
%8 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 27, i32 %7)
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"%c[%dm\00"
define void @blink(i8 signext %0) {
%2 = icmp eq i8 %0, 0
%3 = select i1 %2, i32 25, i32 5
%4 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 27, i32 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int main(int argc, const char *argv[]) {
  if (argc > 1) {
    printf("Hello %s, World!\n", argv[1]);
  } else {
    printf("Hello, World!\n");
  }
  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)
cmpl   $0x1,-0x8(%rbp)
jle    114b <main+0x3b>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
lea    0xec1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1159 <main+0x49>
lea    0xec0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
cmp    $0x2,%edi
jl     113a <main+0x1a>
mov    0x8(%rsi),%rsi
lea    0xecf(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
jmp    1146 <main+0x26>
lea    0xed1(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [18 x i8] c"Hello %s, World!\0A\00"
@.str.1 = [15 x i8] c"Hello, World!\0A\00"
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 = load i32, i32* %4
%7 = icmp sgt i32 %6, 1
br i1 %7, label %8, label %13
8: ; preds = %2
%9 = load i8**, i8*** %5
%10 = getelementptr inbounds i8*, i8** %9, i64 1
%11 = load i8*, i8** %10
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %11)
br label %15
13: ; preds = %2
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
br label %15
15: ; preds = %13, %8
ret i32 0
}

LLVM IR (-O2):
@.str = [18 x i8] c"Hello %s, World!\0A\00"
@str = [14 x i8] c"Hello, World!\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 1
br i1 %3, label %4, label %8
4: ; preds = %2
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %6)
br label %10
8: ; preds = %2
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
br label %10
10: ; preds = %8, %4
ret i32 0
}
int test_imm_10int8_mem(signed char *val) {
  return ((*val) & (0x10 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_10int8_mem(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = and i32 %5, 16
%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_10int8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, 16
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ msh_cleanup();
int /*<<< orphan*/ msh_load_config();
int /*<<< orphan*/ msh_loop();
int main(int argc, char **argv) {
  msh_load_config();
  msh_loop();
  msh_cleanup();
  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   1040 <msh_load_config@plt>
mov    $0x0,%al
call   1050 <msh_loop@plt>
mov    $0x0,%al
call   1030 <msh_cleanup@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <msh_load_config@plt>
xor    %eax,%eax
call   1050 <msh_loop@plt>
xor    %eax,%eax
call   1030 <msh_cleanup@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 (...) @msh_load_config()
%7 = call i32 (...) @msh_loop()
%8 = call i32 (...) @msh_cleanup()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @msh_load_config()
%4 = tail call i32 (...) @msh_loop()
%5 = tail call i32 (...) @msh_cleanup()
ret i32 0
}
/* Variables and functions */
char *dirname(char *);
char *sys_dirname(char *path) { return dirname(path); }


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

x86 assembly (clang, -O2):
<sys_dirname>:
jmp    1030 <dirname@plt>

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

LLVM IR (-O2):
define i8* @sys_dirname(i8* %0) {
%2 = tail call i8* @dirname(i8* %0)
ret i8* %2
}
void foo101(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo101(i32 %0) {
ret void
}
/* Variables and functions */
int rand();
int genInt() { return rand() % 1000; }


x86 assembly (clang, -O0):
<genInt>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <rand@plt>
mov    $0x3e8,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<genInt>:
push   %rax
xor    %eax,%eax
call   1030 <rand@plt>
cltq
imul   $0x10624dd3,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x26,%rcx
add    %edx,%ecx
imul   $0x3e8,%ecx,%ecx
sub    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @genInt() {
%1 = call i32 (...) @rand()
%2 = srem i32 %1, 1000
ret i32 %2
}

LLVM IR (-O2):
define i32 @genInt() {
%1 = tail call i32 (...) @rand()
%2 = srem i32 %1, 1000
ret i32 %2
}
void _Block_object_assign(void *dst, void *src, int flag) {}


x86 assembly (clang, -O0):
<_Block_object_assign>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @_Block_object_assign(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
ret void
}

LLVM IR (-O2):
define void @_Block_object_assign(i8* nocapture %0, i8* nocapture %1, i32 %2) {
ret void
}
void gtk_image_get_pixel_size() {}


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

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

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

LLVM IR (-O2):
define void @gtk_image_get_pixel_size() {
ret void
}
int uniphier_pro5_umc_init(const struct uniphier_board_data *bd) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.uniphier_board_data = type opaque
define i32 @uniphier_pro5_umc_init(%struct.uniphier_board_data* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exoPal_setCik(char *);
void exosite_setCIK(char *pCIK) {
  exoPal_setCik((char *)pCIK);
  return;
}


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

x86 assembly (clang, -O2):
<exosite_setCIK>:
jmp    1030 <exoPal_setCik@plt>

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

LLVM IR (-O2):
define void @exosite_setCIK(i8* %0) {
%2 = tail call i32 @exoPal_setCik(i8* %0)
ret void
}
/* Type definitions */
typedef int uint8_t;
typedef int uint32_t;

/* Variables and functions */
void rtp_set_int_ssrc(uint8_t *p_rtp, uint32_t i_ssrc) {
  p_rtp[8] = (i_ssrc >> 24) & 0xff;
  p_rtp[9] = (i_ssrc >> 16) & 0xff;
  p_rtp[10] = (i_ssrc >> 8) & 0xff;
  p_rtp[11] = i_ssrc & 0xff;
}


x86 assembly (clang, -O0):
<rtp_set_int_ssrc>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
sar    $0x18,%ecx
and    $0xff,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x20(%rax)
mov    -0xc(%rbp),%ecx
sar    $0x10,%ecx
and    $0xff,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x24(%rax)
mov    -0xc(%rbp),%ecx
sar    $0x8,%ecx
and    $0xff,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x28(%rax)
mov    -0xc(%rbp),%ecx
and    $0xff,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x2c(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rtp_set_int_ssrc>:
mov    %esi,%eax
mov    %esi,%ecx
movzbl %ah,%edx
movzbl %al,%esi
shr    $0x18,%eax
mov    %eax,0x20(%rdi)
shr    $0x10,%ecx
movzbl %cl,%eax
mov    %eax,0x24(%rdi)
mov    %edx,0x28(%rdi)
mov    %esi,0x2c(%rdi)
ret

LLVM IR (-O0):
define void @rtp_set_int_ssrc(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 = ashr i32 %5, 24
%7 = and i32 %6, 255
%8 = load i32*, i32** %3
%9 = getelementptr inbounds i32, i32* %8, i64 8
store i32 %7, i32* %9
%10 = load i32, i32* %4
%11 = ashr i32 %10, 16
%12 = and i32 %11, 255
%13 = load i32*, i32** %3
%14 = getelementptr inbounds i32, i32* %13, i64 9
store i32 %12, i32* %14
%15 = load i32, i32* %4
%16 = ashr i32 %15, 8
%17 = and i32 %16, 255
%18 = load i32*, i32** %3
%19 = getelementptr inbounds i32, i32* %18, i64 10
store i32 %17, i32* %19
%20 = load i32, i32* %4
%21 = and i32 %20, 255
%22 = load i32*, i32** %3
%23 = getelementptr inbounds i32, i32* %22, i64 11
store i32 %21, i32* %23
ret void
}

LLVM IR (-O2):
define void @rtp_set_int_ssrc(i32* nocapture writeonly %0, i32 %1) {
%3 = lshr i32 %1, 24
%4 = getelementptr inbounds i32, i32* %0, i64 8
store i32 %3, i32* %4
%5 = lshr i32 %1, 16
%6 = and i32 %5, 255
%7 = getelementptr inbounds i32, i32* %0, i64 9
store i32 %6, i32* %7
%8 = lshr i32 %1, 8
%9 = and i32 %8, 255
%10 = getelementptr inbounds i32, i32* %0, i64 10
store i32 %9, i32* %10
%11 = and i32 %1, 255
%12 = getelementptr inbounds i32, i32* %0, i64 11
store i32 %11, i32* %12
ret void
}
void RGBAToYRow_NEON() {}


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

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

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

LLVM IR (-O2):
define void @RGBAToYRow_NEON() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ commit_creds(int /*<<< orphan*/);
int /*<<< orphan*/ prepare_kernel_cred(int /*<<< orphan*/);
void get_root_payload(void) { commit_creds(prepare_kernel_cred(0)); }


x86 assembly (clang, -O0):
<get_root_payload>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <prepare_kernel_cred@plt>
mov    %eax,%edi
call   1040 <commit_creds@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_root_payload>:
push   %rax
xor    %edi,%edi
call   1030 <prepare_kernel_cred@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <commit_creds@plt>

LLVM IR (-O0):
define void @get_root_payload() {
%1 = call i32 @prepare_kernel_cred(i32 0)
%2 = call i32 @commit_creds(i32 %1)
ret void
}

LLVM IR (-O2):
define void @get_root_payload() {
%1 = tail call i32 @prepare_kernel_cred(i32 0)
%2 = tail call i32 @commit_creds(i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _my_log(char *, int, char *, char *, int, char const *);
void log_err(const char *errstr) {
  do {
    _my_log("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
            "2022-01-22/02-19-57/repos/zhongliangkang/twemproxy41/refs/heads/"
            "master/migrate/migrate.c",
            376, "[ ERROR ] at %s:%d ,err info: %s\n",
            "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
            "2022-01-22/02-19-57/repos/zhongliangkang/twemproxy41/refs/heads/"
            "master/migrate/migrate.c",
            376, errstr);
  } while (0);
}


x86 assembly (clang, -O0):
<log_err>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%r9
lea    0xed9(%rip),%rcx
mov    $0x178,%r8d
lea    0xf65(%rip),%rdx
mov    %rcx,%rdi
mov    %r8d,%esi
call   1030 <_my_log@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<log_err>:
mov    %rdi,%r9
lea    0xf7f(%rip),%rdx
lea    0xedf(%rip),%rcx
mov    %rcx,%rdi
mov    $0x178,%esi
mov    $0x178,%r8d
jmp    1030 <_my_log@plt>

LLVM IR (-O0):
@.str = [153 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/zhongliangkang/twemproxy41/refs/heads/master/migrate/migrate.c\00"
@.str.1 = [34 x i8] c"[ ERROR ] at %s:%d ,err info: %s\0A\00"
define void @log_err(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %1
%4 = load i8*, i8** %2
%5 = call i32 @_my_log(i8* getelementptr inbounds ([153 x i8], [153 x i8]* @.str, i64 0, i64 0), i32 376, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([153 x i8], [153 x i8]* @.str, i64 0, i64 0), i32 376, i8* %4)
br label %6
6: ; preds = %3
ret void
}

LLVM IR (-O2):
@.str = [153 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/zhongliangkang/twemproxy41/refs/heads/master/migrate/migrate.c\00"
@.str.1 = [34 x i8] c"[ ERROR ] at %s:%d ,err info: %s\0A\00"
define void @log_err(i8* %0) {
%2 = tail call i32 @_my_log(i8* getelementptr inbounds ([153 x i8], [153 x i8]* @.str, i64 0, i64 0), i32 376, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([153 x i8], [153 x i8]* @.str, i64 0, i64 0), i32 376, i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void smixer_print_help(void) {
  printf("\nsmixer commands:\n"
         "\nvol [name] [value|-|+]\n"
         "  'vol' sets the volume for a specific input or output device\n"
         "  'name' is the name of the device, do smixer -p to get a list\n"
         "  'value' is the percentage volume (no %%)\n"
         "    or \"-\" to decrease 5%% or \"+\" to increase 5%%\n"
         "\nrecsrc [name]\n"
         "  sets the recording source to a specific input device\n"
         "  'name' is the name of the device, do smixer -p to get a list\n"
         "\nshow\n"
         "  prints the same list as 'smixer -p' does\n"
         "\nhelp|?\n"
         "  gets help\n"
         "\nend|exit|quit|q\n"
         "  exits\n");
  return;
}


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

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

LLVM IR (-O0):
@.str = [488 x i8] c"\0Asmixer commands:\0A\0Avol [name] [value|-|+]\0A 'vol' sets the volume for a specific input or output device\0A 'name' is the name of the device, do smixer -p to get a list\0A 'value' is the percentage volume (no %%)\0A or \22-\22 to decrease 5%% or \22+\22 to increase 5%%\0A\0Arecsrc [name]\0A sets the recording source to a specific input device\0A 'name' is the name of the device, do smixer -p to get a list\0A\0Ashow\0A prints the same list as 'smixer -p' does\0A\0Ahelp|?\0A gets help\0A\0Aend|exit|quit|q\0A exits\0A\00"
define void @smixer_print_help() {
%1 = call i32 @printf(i8* getelementptr inbounds ([488 x i8], [488 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [488 x i8] c"\0Asmixer commands:\0A\0Avol [name] [value|-|+]\0A 'vol' sets the volume for a specific input or output device\0A 'name' is the name of the device, do smixer -p to get a list\0A 'value' is the percentage volume (no %%)\0A or \22-\22 to decrease 5%% or \22+\22 to increase 5%%\0A\0Arecsrc [name]\0A sets the recording source to a specific input device\0A 'name' is the name of the device, do smixer -p to get a list\0A\0Ashow\0A prints the same list as 'smixer -p' does\0A\0Ahelp|?\0A gets help\0A\0Aend|exit|quit|q\0A exits\0A\00"
define void @smixer_print_help() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([488 x i8], [488 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ help();
void invalpar() { help(); }


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

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

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

LLVM IR (-O2):
define void @invalpar() {
%1 = tail call i32 (...) @help()
ret void
}