xunge/DecIR huggingface dataset:
/* Variables and functions */
void Default_EGU0_IRQHandler(void) {
  while (1)
    ;
}


x86 assembly (clang, -O0):
<Default_EGU0_IRQHandler>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <Default_EGU0_IRQHandler+0x9>
jmp    1109 <Default_EGU0_IRQHandler+0x9>

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

LLVM IR (-O0):
define void @Default_EGU0_IRQHandler() {
br label %1
1: ; preds = %0, %1
br label %1
}

LLVM IR (-O2):
define void @Default_EGU0_IRQHandler() {
br label %1
1: ; preds = %0, %1
br label %1
}
double opr_eps0(struct lifo *stack) { return 8.85418781761E-12; }


x86 assembly (clang, -O0):
<opr_eps0>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movsd  0xef0(%rip),%xmm0
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.lifo = type opaque
define double @opr_eps0(%struct.lifo* %0) {
%2 = alloca %struct.lifo*
store %struct.lifo* %0, %struct.lifo** %2
ret double 0x3DA37876F14DD411
}

LLVM IR (-O2):
%struct.lifo = type opaque
define double @opr_eps0(%struct.lifo* nocapture readnone %0) {
ret double 0x3DA37876F14DD411
}
/* Type definitions */
typedef int /*<<< orphan*/ BIGNUM;

/* Variables and functions */
int BN_hex2bn(int /*<<< orphan*/ **, char const *);
int parseBN(BIGNUM **out, const char *in) {
  *out = NULL;
  return BN_hex2bn(out, in);
}


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

x86 assembly (clang, -O2):
<parseBN>:
movq   $0x0,(%rdi)
jmp    1030 <BN_hex2bn@plt>

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

LLVM IR (-O2):
define i32 @parseBN(i32** %0, i8* %1) {
store i32* null, i32** %0
%3 = tail call i32 @BN_hex2bn(i32** %0, i8* %1)
ret i32 %3
}
void deleteProc(clientData) char *clientData;
{ printf("Deleting command with clientData \"%s\".\n", clientData); }


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

x86 assembly (clang, -O2):
<deleteProc>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
xor    %eax,%eax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [40 x i8] c"Deleting command with clientData \22%s\22.\0A\00"
define void @deleteProc(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [40 x i8] c"Deleting command with clientData \22%s\22.\0A\00"
define void @deleteProc(i8* %0) {
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
void noop(void) {}


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

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

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

LLVM IR (-O2):
define void @noop() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ UPnPResponse_RenderingControl_SetBlueVideoGain(void *);
int /*<<< orphan*/ printf(char *, unsigned int, unsigned short);
void UPnPRenderingControl_SetBlueVideoGain(
    void *upnptoken, unsigned int InstanceID,
    unsigned short DesiredBlueVideoGain) {
  printf("Invoke: UPnPRenderingControl_SetBlueVideoGain(%u,%u);\r\n",
         InstanceID, DesiredBlueVideoGain);
  UPnPResponse_RenderingControl_SetBlueVideoGain(upnptoken);
}


x86 assembly (clang, -O0):
<UPnPRenderingControl_SetBlueVideoGain>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dx,%ax
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %ax,-0xe(%rbp)
mov    -0xc(%rbp),%esi
lea    0xec0(%rip),%rdi
movzwl -0xe(%rbp),%edx
call   1040 <printf@plt>
mov    -0x8(%rbp),%rdi
call   1030 <UPnPResponse_RenderingControl_SetBlueVideoGain@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [56 x i8] c"Invoke: UPnPRenderingControl_SetBlueVideoGain(%u,%u);\0D\0A\00"
define void @UPnPRenderingControl_SetBlueVideoGain(i8* %0, i32 %1, i16 zeroext %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i16
store i8* %0, i8** %4
store i32 %1, i32* %5
store i16 %2, i16* %6
%7 = load i32, i32* %5
%8 = load i16, i16* %6
%9 = call i32 @printf(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str, i64 0, i64 0), i32 %7, i16 zeroext %8)
%10 = load i8*, i8** %4
%11 = call i32 @UPnPResponse_RenderingControl_SetBlueVideoGain(i8* %10)
ret void
}

LLVM IR (-O2):
@.str = [56 x i8] c"Invoke: UPnPRenderingControl_SetBlueVideoGain(%u,%u);\0D\0A\00"
define void @UPnPRenderingControl_SetBlueVideoGain(i8* %0, i32 %1, i16 zeroext %2) {
%4 = tail call i32 @printf(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str, i64 0, i64 0), i32 %1, i16 zeroext %2)
%5 = tail call i32 @UPnPResponse_RenderingControl_SetBlueVideoGain(i8* %0)
ret void
}
void scrobsub_relay(int state) {}


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

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

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

LLVM IR (-O2):
define void @scrobsub_relay(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ stdout;
void showProgressEnd(int reportMode) {
  if (reportMode == 0) {
    printf("\n");
    fflush(stdout);
  }
}


x86 assembly (clang, -O0):
<showProgressEnd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    114f <showProgressEnd+0x2f>
lea    0xec4(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e98(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<showProgressEnd>:
test   %edi,%edi
je     1125 <showProgressEnd+0x5>
ret
push   %rax
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    0x2ea9(%rip),%rax
mov    (%rax),%edi
pop    %rax
jmp    1040 <fflush@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"\0A\00"
@stdout = global i32 0
define void @showProgressEnd(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %9
5: ; preds = %1
%6 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%7 = load i32, i32* @stdout
%8 = call i32 @fflush(i32 %7)
br label %9
9: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
define void @showProgressEnd(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %3, label %7
3: ; preds = %1
%4 = tail call i32 @putchar(i32 10)
%5 = load i32, i32* @stdout
%6 = tail call i32 @fflush(i32 %5)
br label %7
7: ; preds = %3, %1
ret void
}
/* Type definitions */
struct timeval {
  int tv_sec;
  int tv_usec;
};

/* Variables and functions */
int setTimeValue(struct timeval *tRet, int iSecond, int iMicroSecond) {
  tRet->tv_sec = iSecond;
  tRet->tv_usec = iMicroSecond;
  return 0;
}


x86 assembly (clang, -O0):
<setTimeValue>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x10(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x4(%rax)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<setTimeValue>:
mov    %esi,(%rdi)
mov    %edx,0x4(%rdi)
xor    %eax,%eax
ret

LLVM IR (-O0):
%struct.timeval = type { i32, i32 }
define i32 @setTimeValue(%struct.timeval* %0, i32 %1, i32 %2) {
%4 = alloca %struct.timeval*
%5 = alloca i32
%6 = alloca i32
store %struct.timeval* %0, %struct.timeval** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %5
%8 = load %struct.timeval*, %struct.timeval** %4
%9 = getelementptr inbounds %struct.timeval, %struct.timeval* %8, i32 0, i32 0
store i32 %7, i32* %9
%10 = load i32, i32* %6
%11 = load %struct.timeval*, %struct.timeval** %4
%12 = getelementptr inbounds %struct.timeval, %struct.timeval* %11, i32 0, i32 1
store i32 %10, i32* %12
ret i32 0
}

LLVM IR (-O2):
%struct.timeval = type { i32, i32 }
define i32 @setTimeValue(%struct.timeval* nocapture writeonly %0, i32 %1, i32 %2) {
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %0, i64 0, i32 0
store i32 %1, i32* %4
%5 = getelementptr inbounds %struct.timeval, %struct.timeval* %0, i64 0, i32 1
store i32 %2, i32* %5
ret i32 0
}
/* Variables and functions */
int EINVAL;
__attribute__((visibility("default"))) int
sd_session_get_remote_host(const char *session, char **remote_host) {
  return -EINVAL;
}


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

x86 assembly (clang, -O2):
<sd_session_get_remote_host>:
mov    0x2ed9(%rip),%rcx
xor    %eax,%eax
sub    (%rcx),%eax
ret

LLVM IR (-O0):
@EINVAL = global i32 0
define i32 @sd_session_get_remote_host(i8* %0, i8** %1) {
%3 = alloca i8*
%4 = alloca i8**
store i8* %0, i8** %3
store i8** %1, i8*** %4
%5 = load i32, i32* @EINVAL
%6 = sub nsw i32 0, %5
ret i32 %6
}

LLVM IR (-O2):
@EINVAL = global i32 0
define i32 @sd_session_get_remote_host(i8* nocapture readnone %0, i8** nocapture readnone %1) {
%3 = load i32, i32* @EINVAL
%4 = sub nsw i32 0, %3
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ value;
typedef int /*<<< orphan*/ eventfd_t;

/* Variables and functions */
int write(int, int /*<<< orphan*/ *, int);
int eventfd_write(int fd, eventfd_t value) {
  return write(fd, &value, sizeof(value)) == sizeof(value) ? 0 : -1;
}


x86 assembly (clang, -O0):
<eventfd_write>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x8(%rbp),%rsi
mov    $0x4,%edx
call   1030 <write@plt>
movslq %eax,%rdx
mov    $0xffffffff,%eax
xor    %ecx,%ecx
cmp    $0x4,%rdx
cmove  %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<eventfd_write>:
push   %rax
mov    %esi,0x4(%rsp)
lea    0x4(%rsp),%rsi
mov    $0x4,%edx
call   1030 <write@plt>
xor    %ecx,%ecx
cmp    $0x4,%eax
setne  %cl
neg    %ecx
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @eventfd_write(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = call i32 @write(i32 %5, i32* %4, i32 4)
%7 = sext i32 %6 to i64
%8 = icmp eq i64 %7, 4
%9 = zext i1 %8 to i64
%10 = select i1 %8, i32 0, i32 -1
ret i32 %10
}

LLVM IR (-O2):
define i32 @eventfd_write(i32 %0, i32 %1) {
%3 = alloca i32
store i32 %1, i32* %3
%4 = call i32 @write(i32 %0, i32* %3, i32 4)
%5 = icmp ne i32 %4, 4
%6 = sext i1 %5 to i32
ret i32 %6
}
long gcd(long a, long b) {
  long c;
  b = ((b) >= 0 ? (b) : -(b));
  if (b > a)
    c = a, a = b, b = c;
  while (b != 0) {
    c = a % b;
    a = b;
    b = c;
  }
  return a;
}


x86 assembly (clang, -O0):
<gcd>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jl     1124 <gcd+0x24>
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
jmp    112e <gcd+0x2e>
xor    %eax,%eax
sub    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x8(%rbp),%rax
jle    115c <gcd+0x5c>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x10(%rbp)
jmp    1161 <gcd+0x61>
cmpq   $0x0,-0x10(%rbp)
je     118f <gcd+0x8f>
mov    -0x8(%rbp),%rax
cqto
idivq  -0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x10(%rbp)
jmp    1161 <gcd+0x61>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<gcd>:
mov    %rsi,%rdx
neg    %rdx
cmovs  %rsi,%rdx
cmp    %rdi,%rdx
mov    %rdi,%rax
cmovg  %rdx,%rax
cmovg  %rdi,%rdx
test   %rdx,%rdx
jne    112d <gcd+0x2d>
ret
xchg   %ax,%ax
cqto
idiv   %rcx
mov    %rcx,%rax
test   %rdx,%rdx
je     1142 <gcd+0x42>
mov    %rdx,%rcx
mov    %rax,%rdx
or     %rcx,%rdx
shr    $0x20,%rdx
jne    1120 <gcd+0x20>
xor    %edx,%edx
div    %ecx
jmp    1125 <gcd+0x25>
mov    %rcx,%rax
ret

LLVM IR (-O0):
define i64 @gcd(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%6 = load i64, i64* %4
%7 = icmp sge i64 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i64, i64* %4
br label %13
10: ; preds = %2
%11 = load i64, i64* %4
%12 = sub nsw i64 0, %11
br label %13
13: ; preds = %10, %8
%14 = phi i64 [ %9, %8 ], [ %12, %10 ]
store i64 %14, i64* %4
%15 = load i64, i64* %4
%16 = load i64, i64* %3
%17 = icmp sgt i64 %15, %16
br i1 %17, label %18, label %22
18: ; preds = %13
%19 = load i64, i64* %3
store i64 %19, i64* %5
%20 = load i64, i64* %4
store i64 %20, i64* %3
%21 = load i64, i64* %5
store i64 %21, i64* %4
br label %22
22: ; preds = %18, %13
br label %23
23: ; preds = %26, %22
%24 = load i64, i64* %4
%25 = icmp ne i64 %24, 0
br i1 %25, label %26, label %32
26: ; preds = %23
%27 = load i64, i64* %3
%28 = load i64, i64* %4
%29 = srem i64 %27, %28
store i64 %29, i64* %5
%30 = load i64, i64* %4
store i64 %30, i64* %3
%31 = load i64, i64* %5
store i64 %31, i64* %4
br label %23
32: ; preds = %23
%33 = load i64, i64* %3
ret i64 %33
}

LLVM IR (-O2):
define i64 @gcd(i64 %0, i64 %1) {
%3 = tail call i64 @llvm.abs.i64(i64 %1, i1 true)
%4 = icmp sgt i64 %3, %0
%5 = select i1 %4, i64 %3, i64 %0
%6 = select i1 %4, i64 %0, i64 %3
%7 = icmp eq i64 %6, 0
br i1 %7, label %13, label %8
8: ; preds = %2, %8
%9 = phi i64 [ %11, %8 ], [ %6, %2 ]
%10 = phi i64 [ %9, %8 ], [ %5, %2 ]
%11 = srem i64 %10, %9
%12 = icmp eq i64 %11, 0
br i1 %12, label %13, label %8
13: ; preds = %8, %2
%14 = phi i64 [ %5, %2 ], [ %9, %8 ]
ret i64 %14
}
/* Variables and functions */
int /*<<< orphan*/ errx(int, char *);
void *realloc(void *, size_t);
void *xrealloc(void *pt, size_t sz) {
  void *ret = realloc(pt, sz);
  if (!ret)
    errx(1, "Malloc failed");
  return ret;
}


x86 assembly (clang, -O0):
<xrealloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <realloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    115d <xrealloc+0x3d>
mov    $0x1,%edi
lea    0xea8(%rip),%rsi
call   1030 <errx@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrealloc>:
push   %rbx
call   1040 <realloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    113f <xrealloc+0x1f>
lea    0xecb(%rip),%rsi
mov    $0x1,%edi
call   1030 <errx@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [14 x i8] c"Malloc failed\00"
define noalias i8* @xrealloc(i8* nocapture %0, i64 %1) {
%3 = tail call i8* @realloc(i8* %0, i64 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @errx(i32 1, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %2
ret i8* %3
}
/* Variables and functions */
bool SHAREMIND_MAP_KEY_LESS_unsigned_short(unsigned short const k1,
                                           unsigned short const k2) {
  return k1 < k2;
}


x86 assembly (clang, -O0):
<SHAREMIND_MAP_KEY_LESS_unsigned_short>:
push   %rbp
mov    %rsp,%rbp
mov    %si,%ax
mov    %di,%cx
mov    %cx,-0x2(%rbp)
mov    %ax,-0x4(%rbp)
movzwl -0x2(%rbp),%eax
movzwl -0x4(%rbp),%ecx
cmp    %ecx,%eax
setl   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<SHAREMIND_MAP_KEY_LESS_unsigned_short>:
xor    %eax,%eax
cmp    %si,%di
setb   %al
ret

LLVM IR (-O0):
define i32 @SHAREMIND_MAP_KEY_LESS_unsigned_short(i16 zeroext %0, i16 zeroext %1) {
%3 = alloca i16
%4 = alloca i16
store i16 %0, i16* %3
store i16 %1, i16* %4
%5 = load i16, i16* %3
%6 = zext i16 %5 to i32
%7 = load i16, i16* %4
%8 = zext i16 %7 to i32
%9 = icmp slt i32 %6, %8
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @SHAREMIND_MAP_KEY_LESS_unsigned_short(i16 zeroext %0, i16 zeroext %1) {
%3 = icmp ult i16 %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
int t2(float *f, int i, void (*f1)(double), void (*f2)(float, float),
       void (*f3)(float)) {
  f3(6.0f);
  f1(3.0);
  f[i] = f[i + 1];
  f2(2.5f, 3.5f);
}


x86 assembly (clang, -O0):
<t2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    %r8,-0x30(%rbp)
movss  0xee5(%rip),%xmm0
call   *-0x30(%rbp)
movsd  0xee2(%rip),%xmm0
call   *-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movss  (%rax,%rcx,4),%xmm0
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movss  %xmm0,(%rax,%rcx,4)
movss  0xea8(%rip),%xmm0
movss  0xea4(%rip),%xmm1
call   *-0x28(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<t2>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rcx,%r15
mov    %rdx,%rbx
mov    %esi,%r14d
mov    %rdi,%rbp
movss  0xee5(%rip),%xmm0
call   *%r8
movsd  0xeea(%rip),%xmm0
call   *%rbx
movslq %r14d,%rax
movss  0x4(%rbp,%rax,4),%xmm0
movss  %xmm0,0x0(%rbp,%rax,4)
movss  0xec5(%rip),%xmm0
movss  0xec1(%rip),%xmm1
mov    %r15,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    *%rax

LLVM IR (-O0):
define i32 @t2(float* %0, i32 %1, void (double)* %2, void (float, float)* %3, void (float)* %4) {
%6 = alloca i32
%7 = alloca float*
%8 = alloca i32
%9 = alloca void (double)*
%10 = alloca void (float, float)*
%11 = alloca void (float)*
store float* %0, float** %7
store i32 %1, i32* %8
store void (double)* %2, void (double)** %9
store void (float, float)* %3, void (float, float)** %10
store void (float)* %4, void (float)** %11
%12 = load void (float)*, void (float)** %11
%13 = load void (double)*, void (double)** %9
%14 = load float*, float** %7
%15 = load i32, i32* %8
%16 = add nsw i32 %15, 1
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds float, float* %14, i64 %17
%19 = load float, float* %18
%20 = load float*, float** %7
%21 = load i32, i32* %8
%22 = sext i32 %21 to i64
%23 = getelementptr inbounds float, float* %20, i64 %22
store float %19, float* %23
%24 = load void (float, float)*, void (float, float)** %10
%25 = load i32, i32* %6
ret i32 %25
}

LLVM IR (-O2):
define i32 @t2(float* nocapture %0, i32 %1, void (double)* nocapture %2, void (float, float)* nocapture %3, void (float)* nocapture %4) {
tail call void %4(float 6.000000e+00)
tail call void %2(double 3.000000e+00)
%6 = add nsw i32 %1, 1
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds float, float* %0, i64 %7
%9 = load float, float* %8
%10 = sext i32 %1 to i64
%11 = getelementptr inbounds float, float* %0, i64 %10
store float %9, float* %11
tail call void %3(float 2.500000e+00, float 3.500000e+00)
ret i32 undef
}
/* Variables and functions */
scalar_t__ _syscall5(int, void *, void *, void *, void *, void *);
int errno;
int dup2(int oldfd, int newfd) {
  int ret = (int)_syscall5(19, (void *)oldfd, (void *)newfd, ((void *)0),
                           ((void *)0), ((void *)0));
  if (ret < 0) {
    errno = -ret;
    return -1;
  }
  return ret;
}


x86 assembly (clang, -O0):
<dup2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movslq -0x8(%rbp),%rsi
movslq -0xc(%rbp),%rdx
mov    $0x13,%edi
xor    %eax,%eax
mov    %eax,%r9d
mov    %r9,%rcx
mov    %r9,%r8
call   1030 <_syscall5@plt>
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
jge    1162 <dup2+0x52>
xor    %ecx,%ecx
sub    -0x10(%rbp),%ecx
mov    0x2e8c(%rip),%rax
mov    %ecx,(%rax)
movl   $0xffffffff,-0x4(%rbp)
jmp    1168 <dup2+0x58>
mov    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dup2>:
push   %rax
movslq %edi,%rax
movslq %esi,%rdx
mov    $0x13,%edi
mov    %rax,%rsi
xor    %ecx,%ecx
xor    %r8d,%r8d
xor    %r9d,%r9d
call   1030 <_syscall5@plt>
test   %eax,%eax
js     1132 <dup2+0x22>
pop    %rcx
ret
neg    %eax
mov    0x2ea5(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@errno = global i32 0
define i32 @dup2(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%7 = load i32, i32* %4
%8 = sext i32 %7 to i64
%9 = inttoptr i64 %8 to i8*
%10 = load i32, i32* %5
%11 = sext i32 %10 to i64
%12 = inttoptr i64 %11 to i8*
%13 = call i64 @_syscall5(i32 19, i8* %9, i8* %12, i8* null, i8* null, i8* null)
%14 = trunc i64 %13 to i32
store i32 %14, i32* %6
%15 = load i32, i32* %6
%16 = icmp slt i32 %15, 0
br i1 %16, label %17, label %20
17: ; preds = %2
%18 = load i32, i32* %6
%19 = sub nsw i32 0, %18
store i32 %19, i32* @errno
store i32 -1, i32* %3
br label %22
20: ; preds = %2
%21 = load i32, i32* %6
store i32 %21, i32* %3
br label %22
22: ; preds = %20, %17
%23 = load i32, i32* %3
ret i32 %23
}

LLVM IR (-O2):
@errno = global i32 0
define i32 @dup2(i32 %0, i32 %1) {
%3 = sext i32 %0 to i64
%4 = inttoptr i64 %3 to i8*
%5 = sext i32 %1 to i64
%6 = inttoptr i64 %5 to i8*
%7 = tail call i64 @_syscall5(i32 19, i8* %4, i8* %6, i8* null, i8* null, i8* null)
%8 = trunc i64 %7 to i32
%9 = icmp slt i32 %8, 0
br i1 %9, label %10, label %12
10: ; preds = %2
%11 = sub nsw i32 0, %8
store i32 %11, i32* @errno
br label %12
12: ; preds = %2, %10
%13 = phi i32 [ -1, %10 ], [ %8, %2 ]
ret i32 %13
}
/* Type definitions */
struct s {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ s_catn(struct s *, char const *, int /*<<< orphan*/);
int /*<<< orphan*/ slen(char const *);
void s_catz(struct s *sa, const char *s) { s_catn(sa, s, slen(s)); }


x86 assembly (clang, -O0):
<s_catz>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <slen@plt>
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    %eax,%edx
call   1040 <s_catn@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<s_catz>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1030 <slen@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %eax,%edx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <s_catn@plt>

LLVM IR (-O0):
%struct.s = type { i32 }
define void @s_catz(%struct.s* %0, i8* %1) {
%3 = alloca %struct.s*
%4 = alloca i8*
store %struct.s* %0, %struct.s** %3
store i8* %1, i8** %4
%5 = load %struct.s*, %struct.s** %3
%6 = load i8*, i8** %4
%7 = load i8*, i8** %4
%8 = call i32 @slen(i8* %7)
%9 = call i32 @s_catn(%struct.s* %5, i8* %6, i32 %8)
ret void
}

LLVM IR (-O2):
%struct.s = type { i32 }
define void @s_catz(%struct.s* %0, i8* %1) {
%3 = tail call i32 @slen(i8* %1)
%4 = tail call i32 @s_catn(%struct.s* %0, i8* %1, i32 %3)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
int /*<<< orphan*/ SIGINT;
int /*<<< orphan*/ getpid();
int /*<<< orphan*/ kill(int /*<<< orphan*/, int /*<<< orphan*/);
void wdctl_stop(int fd) {
  pid_t pid;
  pid = getpid();
  kill(pid, SIGINT);
}


x86 assembly (clang, -O0):
<wdctl_stop>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <getpid@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
mov    0x2ea9(%rip),%rax
mov    (%rax),%esi
call   1040 <kill@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wdctl_stop>:
push   %rax
xor    %eax,%eax
call   1030 <getpid@plt>
mov    0x2eb9(%rip),%rcx
mov    (%rcx),%esi
mov    %eax,%edi
pop    %rax
jmp    1040 <kill@plt>

LLVM IR (-O0):
@SIGINT = global i32 0
define void @wdctl_stop(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = call i32 (...) @getpid()
store i32 %4, i32* %3
%5 = load i32, i32* %3
%6 = load i32, i32* @SIGINT
%7 = call i32 @kill(i32 %5, i32 %6)
ret void
}

LLVM IR (-O2):
@SIGINT = global i32 0
define void @wdctl_stop(i32 %0) {
%2 = tail call i32 (...) @getpid()
%3 = load i32, i32* @SIGINT
%4 = tail call i32 @kill(i32 %2, i32 %3)
ret void
}
char *ConvertIntTo4ByteChar(int value) {
  char buf[4];
  buf[0] = value & 0xff;
  buf[1] = (value >> 8) & 0xff;
  buf[2] = (value >> 16) & 0xff;
  buf[3] = (value >> 24) & 0xff;
  return buf;
}


x86 assembly (clang, -O0):
<ConvertIntTo4ByteChar>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xff,%eax
mov    %al,-0x8(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x8,%eax
and    $0xff,%eax
mov    %al,-0x7(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x10,%eax
and    $0xff,%eax
mov    %al,-0x6(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x18,%eax
and    $0xff,%eax
mov    %al,-0x5(%rbp)
lea    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ConvertIntTo4ByteChar>:
lea    -0x4(%rsp),%rax
ret

LLVM IR (-O0):
define i8* @ConvertIntTo4ByteChar(i32 %0) {
%2 = alloca i32
%3 = alloca [4 x i8]
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = and i32 %4, 255
%6 = trunc i32 %5 to i8
%7 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 0
store i8 %6, i8* %7
%8 = load i32, i32* %2
%9 = ashr i32 %8, 8
%10 = and i32 %9, 255
%11 = trunc i32 %10 to i8
%12 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 1
store i8 %11, i8* %12
%13 = load i32, i32* %2
%14 = ashr i32 %13, 16
%15 = and i32 %14, 255
%16 = trunc i32 %15 to i8
%17 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 2
store i8 %16, i8* %17
%18 = load i32, i32* %2
%19 = ashr i32 %18, 24
%20 = and i32 %19, 255
%21 = trunc i32 %20 to i8
%22 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 3
store i8 %21, i8* %22
%23 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 0
ret i8* %23
}

LLVM IR (-O2):
define noalias i8* @ConvertIntTo4ByteChar(i32 %0) {
%2 = alloca [4 x i8]
%3 = getelementptr inbounds [4 x i8], [4 x i8]* %2, i64 0, i64 0
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ ddd();
void ccc(void) { ddd(); }


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

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

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

LLVM IR (-O2):
define void @ccc() {
%1 = tail call i32 (...) @ddd()
ret void
}
void *C_find(void *h, const char *fn_name) { return 0; }


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

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

LLVM IR (-O0):
define i8* @C_find(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @C_find(i8* nocapture readnone %0, i8* nocapture readnone %1) {
ret i8* null
}
/* Variables and functions */
int /*<<< orphan*/ usleep(int);
int foo(void) { usleep(1); }


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

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

LLVM IR (-O0):
define i32 @foo() {
%1 = alloca i32
%2 = call i32 @usleep(i32 1)
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
define i32 @foo() {
%1 = tail call i32 @usleep(i32 1)
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ greet(int /*<<< orphan*/);
int /*<<< orphan*/ recursive_b(int);
int /*<<< orphan*/ scanf(char *, char *);
void greet_b(int i) {
  char c = 'c';
  scanf("%c", &c);
  greet(0);
  recursive_b(i);
}


x86 assembly (clang, -O0):
<greet_b>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movb   $0x63,-0x5(%rbp)
lea    0xeba(%rip),%rdi
lea    -0x5(%rbp),%rsi
call   1050 <scanf@plt>
xor    %edi,%edi
call   1040 <greet@plt>
mov    -0x4(%rbp),%edi
call   1030 <recursive_b@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<greet_b>:
push   %rbx
sub    $0x10,%rsp
mov    %edi,%ebx
movb   $0x63,0xf(%rsp)
lea    0xebd(%rip),%rdi
lea    0xf(%rsp),%rsi
call   1050 <scanf@plt>
xor    %edi,%edi
call   1040 <greet@plt>
mov    %ebx,%edi
call   1030 <recursive_b@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%c\00"
define void @greet_b(i32 %0) {
%2 = alloca i32
%3 = alloca i8
store i32 %0, i32* %2
store i8 99, i8* %3
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = call i32 @greet(i32 0)
%6 = load i32, i32* %2
%7 = call i32 @recursive_b(i32 %6)
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%c\00"
define void @greet_b(i32 %0) {
%2 = alloca i8
store i8 99, i8* %2
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = call i32 @greet(i32 0)
%5 = call i32 @recursive_b(i32 %0)
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void printHex(uint32_t x) {
  printf("%x\n", x);
  return;
}


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

x86 assembly (clang, -O2):
<printHex>:
mov    %edi,%esi
lea    0xee7(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%x\0A\00"
define void @printHex(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
void restore_signals() {}


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

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

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

LLVM IR (-O2):
define void @restore_signals() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ calculate_sec(int, int *, int *, int *);
void test3(void) {
  int input_sec = 3700;
  int sec, min, hr;
  calculate_sec(input_sec, &sec, &min, &hr);
  assert(hr == 1);
  assert(min == 1);
  assert(sec == 40);
}


x86 assembly (clang, -O0):
<test3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0xe74,-0x4(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
lea    -0x10(%rbp),%rcx
call   1030 <calculate_sec@plt>
cmpl   $0x1,-0x10(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
cmpl   $0x1,-0xc(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
cmpl   $0x28,-0x8(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test3>:
sub    $0x18,%rsp
lea    0x14(%rsp),%rsi
lea    0x10(%rsp),%rdx
lea    0xc(%rsp),%rcx
mov    $0xe74,%edi
call   1030 <calculate_sec@plt>
xor    %edi,%edi
cmpl   $0x1,0xc(%rsp)
sete   %dil
call   1040 <assert@plt>
xor    %edi,%edi
cmpl   $0x1,0x10(%rsp)
sete   %dil
call   1040 <assert@plt>
xor    %edi,%edi
cmpl   $0x28,0x14(%rsp)
sete   %dil
call   1040 <assert@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
define void @test3() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 3700, i32* %1
%5 = load i32, i32* %1
%6 = call i32 @calculate_sec(i32 %5, i32* %2, i32* %3, i32* %4)
%7 = load i32, i32* %4
%8 = icmp eq i32 %7, 1
%9 = zext i1 %8 to i32
%10 = call i32 @assert(i32 %9)
%11 = load i32, i32* %3
%12 = icmp eq i32 %11, 1
%13 = zext i1 %12 to i32
%14 = call i32 @assert(i32 %13)
%15 = load i32, i32* %2
%16 = icmp eq i32 %15, 40
%17 = zext i1 %16 to i32
%18 = call i32 @assert(i32 %17)
ret void
}

LLVM IR (-O2):
define void @test3() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = bitcast i32* %1 to i8*
%5 = bitcast i32* %2 to i8*
%6 = bitcast i32* %3 to i8*
%7 = call i32 @calculate_sec(i32 3700, i32* %1, i32* %2, i32* %3)
%8 = load i32, i32* %3
%9 = icmp eq i32 %8, 1
%10 = zext i1 %9 to i32
%11 = call i32 @assert(i32 %10)
%12 = load i32, i32* %2
%13 = icmp eq i32 %12, 1
%14 = zext i1 %13 to i32
%15 = call i32 @assert(i32 %14)
%16 = load i32, i32* %1
%17 = icmp eq i32 %16, 40
%18 = zext i1 %17 to i32
%19 = call i32 @assert(i32 %18)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  fprintf(stderr, "Usage: ip xfrm XFRM_OBJECT { COMMAND | help }\n"
                  "where  XFRM_OBJECT := { state | policy | monitor }\n");
  exit(-1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [98 x i8] c"Usage: ip xfrm XFRM_OBJECT { COMMAND | help }\0Awhere XFRM_OBJECT := { state | policy | monitor }\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([98 x i8], [98 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 -1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [98 x i8] c"Usage: ip xfrm XFRM_OBJECT { COMMAND | help }\0Awhere XFRM_OBJECT := { state | policy | monitor }\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([98 x i8], [98 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 -1)
unreachable
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
void USB_EndPoint12(uint32_t event) {}


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

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

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

LLVM IR (-O2):
define void @USB_EndPoint12(i32 %0) {
ret void
}
/* Type definitions */
struct psauxDevice {
  int dummy;
};
struct device {
  int dummy;
};
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ writeDevice(int /*<<< orphan*/ *, struct device *);
void psauxWriteDevice(FILE *file, struct psauxDevice *dev) {
  writeDevice(file, (struct device *)dev);
}


x86 assembly (clang, -O0):
<psauxWriteDevice>:
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 <writeDevice@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<psauxWriteDevice>:
jmp    1030 <writeDevice@plt>

LLVM IR (-O0):
%struct.psauxDevice = type { i32 }
%struct.device = type { i32 }
define void @psauxWriteDevice(i32* %0, %struct.psauxDevice* %1) {
%3 = alloca i32*
%4 = alloca %struct.psauxDevice*
store i32* %0, i32** %3
store %struct.psauxDevice* %1, %struct.psauxDevice** %4
%5 = load i32*, i32** %3
%6 = load %struct.psauxDevice*, %struct.psauxDevice** %4
%7 = bitcast %struct.psauxDevice* %6 to %struct.device*
%8 = call i32 @writeDevice(i32* %5, %struct.device* %7)
ret void
}

LLVM IR (-O2):
%struct.psauxDevice = type { i32 }
%struct.device = type { i32 }
define void @psauxWriteDevice(i32* %0, %struct.psauxDevice* %1) {
%3 = bitcast %struct.psauxDevice* %1 to %struct.device*
%4 = tail call i32 @writeDevice(i32* %0, %struct.device* %3)
ret void
}
void __attribute__((weak)) tamper_stamp_isr() { debug_handler(__FUNCTION__); }


x86 assembly (clang, -O0):
<tamper_stamp_isr>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x0,%al
call   1030 <debug_handler@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<tamper_stamp_isr>:
lea    0xee9(%rip),%rdi
xor    %eax,%eax
jmp    1030 <debug_handler@plt>

LLVM IR (-O0):
@__FUNCTION__.tamper_stamp_isr = [17 x i8] c"tamper_stamp_isr\00"
define weak void @tamper_stamp_isr() {
%1 = call i32 (i8*, ...) bitcast (i32 (...)* @debug_handler to i32 (i8*, ...)*)(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @__FUNCTION__.tamper_stamp_isr, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@__FUNCTION__.tamper_stamp_isr = [17 x i8] c"tamper_stamp_isr\00"
define weak void @tamper_stamp_isr() {
%1 = tail call i32 (i8*, ...) bitcast (i32 (...)* @debug_handler to i32 (i8*, ...)*)(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @__FUNCTION__.tamper_stamp_isr, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("Programar es divertido.\n");
  printf("Y programar en C es incluso mas divertido.\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [25 x i8] c"Programar es divertido.\0A\00"
@.str.1 = [44 x i8] c"Y programar en C es incluso mas divertido.\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [24 x i8] c"Programar es divertido.\00"
@str.2 = [43 x i8] c"Y programar en C es incluso mas divertido.\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @str.2, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
scalar_t__ isnan(float);
float fmaxf(float x, float y) {
  if (isnan(x))
    return y;
  if (isnan(y))
    return x;
  return x < y ? y : x;
}


x86 assembly (clang, -O0):
<fmaxf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x8(%rbp)
movss  %xmm1,-0xc(%rbp)
movss  -0x8(%rbp),%xmm0
call   1030 <isnan@plt>
cmp    $0x0,%rax
je     1145 <fmaxf+0x35>
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    119e <fmaxf+0x8e>
movss  -0xc(%rbp),%xmm0
call   1030 <isnan@plt>
cmp    $0x0,%rax
je     1168 <fmaxf+0x58>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    119e <fmaxf+0x8e>
movss  -0x8(%rbp),%xmm1
movss  -0xc(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jbe    118a <fmaxf+0x7a>
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
jmp    1194 <fmaxf+0x84>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x10(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fmaxf>:
push   %rax
movss  %xmm1,(%rsp)
movss  %xmm0,0x4(%rsp)
call   1030 <isnan@plt>
test   %rax,%rax
je     112d <fmaxf+0x1d>
movss  (%rsp),%xmm0
pop    %rax
ret
movss  (%rsp),%xmm0
call   1030 <isnan@plt>
test   %rax,%rax
je     1144 <fmaxf+0x34>
movss  0x4(%rsp),%xmm0
pop    %rax
ret
movss  (%rsp),%xmm0
maxss  0x4(%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @fmaxf(float %0, float %1) {
%3 = alloca float
%4 = alloca float
%5 = alloca float
store float %0, float* %4
store float %1, float* %5
%6 = load float, float* %4
%7 = call i64 @isnan(float %6)
%8 = icmp ne i64 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = load float, float* %5
store float %10, float* %3
br label %27
11: ; preds = %2
%12 = load float, float* %5
%13 = call i64 @isnan(float %12)
%14 = icmp ne i64 %13, 0
br i1 %14, label %15, label %17
15: ; preds = %11
%16 = load float, float* %4
store float %16, float* %3
br label %27
17: ; preds = %11
%18 = load float, float* %4
%19 = load float, float* %5
%20 = fcmp olt float %18, %19
br i1 %20, label %21, label %23
21: ; preds = %17
%22 = load float, float* %5
br label %25
23: ; preds = %17
%24 = load float, float* %4
br label %25
25: ; preds = %23, %21
%26 = phi float [ %22, %21 ], [ %24, %23 ]
store float %26, float* %3
br label %27
27: ; preds = %25, %15, %9
%28 = load float, float* %3
ret float %28
}

LLVM IR (-O2):
define float @fmaxf(float %0, float %1) {
%3 = tail call i64 @isnan(float %0)
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %11
5: ; preds = %2
%6 = tail call i64 @isnan(float %1)
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %11
8: ; preds = %5
%9 = fcmp olt float %0, %1
%10 = select i1 %9, float %1, float %0
br label %11
11: ; preds = %5, %2, %8
%12 = phi float [ %10, %8 ], [ %1, %2 ], [ %0, %5 ]
ret float %12
}
/* Variables and functions */
int /*<<< orphan*/ _PROCEDURE_LINKAGE_TABLE_();
void write() {
  _PROCEDURE_LINKAGE_TABLE_();
  return;
}


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

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

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

LLVM IR (-O2):
define void @write() {
%1 = tail call i32 (...) @_PROCEDURE_LINKAGE_TABLE_()
ret void
}
/* Variables and functions */
char *strrchr(char const *, char);
__attribute__((__returns_nonnull__)) __attribute__((__nonnull__)) const char *
path_basename(const char *filename) {
  const char *slash = strrchr(filename, '/');
  return slash ? slash + 1 : filename;
}


x86 assembly (clang, -O0):
<path_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 <path_basename+0x3a>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1152 <path_basename+0x42>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<path_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* @path_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* @path_basename(i8* %0) {
%2 = tail call i8* @strrchr(i8* %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 openssl_get_fork_id(void) { return 0; }


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

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

LLVM IR (-O0):
define i32 @openssl_get_fork_id() {
ret i32 0
}

LLVM IR (-O2):
define i32 @openssl_get_fork_id() {
ret i32 0
}
void idc(void *p) {
  if (p)
    ;
}


x86 assembly (clang, -O0):
<idc>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1118 <idc+0x18>
jmp    1118 <idc+0x18>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @idc(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 %6
5: ; preds = %1
br label %6
6: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
define void @idc(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ xfree(void *);
void s_free(void *p) {
  if (p)
    xfree(p);
}


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

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

LLVM IR (-O0):
define void @s_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 @xfree(i8* %6)
br label %8
8: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
define void @s_free(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @xfree(i8* %0)
br label %5
5: ; preds = %3, %1
ret void
}
void do_divide_error(void *x) {
  do {
    kprintf("Unsupport Now...[%s]\n", __FUNCTION__);
    while (1)
      ;
  } while (0);
  ;
}


x86 assembly (clang, -O0):
<do_divide_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rdi
lea    0xeec(%rip),%rsi
mov    $0x0,%al
call   1030 <kprintf@plt>
jmp    1131 <do_divide_error+0x21>

x86 assembly (clang, -O2):
<do_divide_error>:
push   %rax
lea    0xee8(%rip),%rdi
lea    0xef7(%rip),%rsi
xor    %eax,%eax
call   1030 <kprintf@plt>
cs nopw 0x0(%rax,%rax,1)
jmp    1130 <do_divide_error+0x20>

LLVM IR (-O0):
@.str = [22 x i8] c"Unsupport Now...[%s]\0A\00"
@__FUNCTION__.do_divide_error = [16 x i8] c"do_divide_error\00"
define void @do_divide_error(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %1
%4 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @kprintf to i32 (i8*, i8*, ...)*)(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([16 x i8], [16 x i8]* @__FUNCTION__.do_divide_error, i64 0, i64 0))
br label %5
5: ; preds = %3, %5
br label %5
6: ; No predecessors!
ret void
}

LLVM IR (-O2):
@.str = [22 x i8] c"Unsupport Now...[%s]\0A\00"
@__FUNCTION__.do_divide_error = [16 x i8] c"do_divide_error\00"
define void @do_divide_error(i8* nocapture readnone %0) {
%2 = tail call i32 (i8*, i8*, ...) bitcast (i32 (...)* @kprintf to i32 (i8*, i8*, ...)*)(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([16 x i8], [16 x i8]* @__FUNCTION__.do_divide_error, i64 0, i64 0))
br label %3
3: ; preds = %1, %3
br label %3
}