xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void printb(uint64_t x) {
  int i;
  for (i = 63; i >= 0; i--) {
    printf("%d", (int)((x >> i) & 1));
  }
}


x86 assembly (clang, -O0):
<printb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x3f,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jl     1151 <printb+0x41>
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%ecx
sar    %cl,%esi
and    $0x1,%esi
lea    0xec2(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
jmp    1122 <printb+0x12>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printb>:
push   %rbp
push   %r14
push   %rbx
mov    %edi,%ebx
mov    $0x3f,%ebp
lea    0xede(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %ebx,%esi
mov    %ebp,%ecx
shr    %cl,%esi
and    $0x1,%esi
mov    %r14,%rdi
call   1030 <printf@plt>
add    $0xffffffff,%ebp
jb     1130 <printb+0x20>
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define void @printb(i32 %0) {
br label %2
2: ; preds = %1, %2
%3 = phi i32 [ 63, %1 ], [ %7, %2 ]
%4 = lshr i32 %0, %3
%5 = and i32 %4, 1
%6 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = add nsw i32 %3, -1
%8 = icmp eq i32 %3, 0
br i1 %8, label %9, label %2
9: ; preds = %2
ret void
}
double getpix1(image, bitpix, w, h, bzero, dirale, x, y)
char *image;
int bitpix;
int w;
int h;
double bzero;
double dirale;
int x;
int y;
{ return (getpix(image, bitpix, w, h, bzero, dirale, x - 1, y - 1)); }


x86 assembly (clang, -O0):
<getpix1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
movsd  %xmm0,-0x20(%rbp)
movsd  %xmm1,-0x28(%rbp)
mov    %r8d,-0x2c(%rbp)
mov    %r9d,-0x30(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x14(%rbp),%ecx
movsd  -0x20(%rbp),%xmm0
movsd  -0x28(%rbp),%xmm1
mov    -0x2c(%rbp),%r8d
sub    $0x1,%r8d
mov    -0x30(%rbp),%r9d
sub    $0x1,%r9d
mov    $0x2,%al
call   1030 <getpix@plt>
cvtsi2sd %eax,%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getpix1>:
push   %rax
add    $0xffffffff,%r8d
add    $0xffffffff,%r9d
mov    $0x2,%al
call   1030 <getpix@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @getpix1(i8* %0, i32 %1, i32 %2, i32 %3, double %4, double %5, i32 %6, i32 %7) {
%9 = alloca i8*
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca double
%14 = alloca double
%15 = alloca i32
%16 = alloca i32
store i8* %0, i8** %9
store i32 %1, i32* %10
store i32 %2, i32* %11
store i32 %3, i32* %12
store double %4, double* %13
store double %5, double* %14
store i32 %6, i32* %15
store i32 %7, i32* %16
%17 = load i8*, i8** %9
%18 = load i32, i32* %10
%19 = load i32, i32* %11
%20 = load i32, i32* %12
%21 = load double, double* %13
%22 = load double, double* %14
%23 = load i32, i32* %15
%24 = sub nsw i32 %23, 1
%25 = load i32, i32* %16
%26 = sub nsw i32 %25, 1
%27 = call i32 (i8*, i32, i32, i32, double, double, i32, i32, ...) bitcast (i32 (...)* @getpix to i32 (i8*, i32, i32, i32, double, double, i32, i32, ...)*)(i8* %17, i32 %18, i32 %19, i32 %20, double %21, double %22, i32 %24, i32 %26)
%28 = sitofp i32 %27 to double
ret double %28
}

LLVM IR (-O2):
define double @getpix1(i8* %0, i32 %1, i32 %2, i32 %3, double %4, double %5, i32 %6, i32 %7) {
%9 = add nsw i32 %6, -1
%10 = add nsw i32 %7, -1
%11 = tail call i32 (i8*, i32, i32, i32, double, double, i32, i32, ...) bitcast (i32 (...)* @getpix to i32 (i8*, i32, i32, i32, double, double, i32, i32, ...)*)(i8* %0, i32 %1, i32 %2, i32 %3, double %4, double %5, i32 %9, i32 %10)
%12 = sitofp i32 %11 to double
ret double %12
}
/* Type definitions */
typedef int uint64_t;
typedef int uint32_t;

/* Variables and functions */
int UINT32_C(int);
void fiat_p256_mulx_u32(uint32_t *out1, uint32_t *out2, uint32_t arg1,
                        uint32_t arg2) {
  uint64_t x1;
  uint32_t x2;
  uint32_t x3;
  x1 = ((uint64_t)arg1 * arg2);
  x2 = (uint32_t)(x1 & UINT32_C(0xffffffff));
  x3 = (uint32_t)(x1 >> 32);
  *out1 = x2;
  *out2 = x3;
}


x86 assembly (clang, -O0):
<fiat_p256_mulx_u32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    -0x14(%rbp),%eax
imul   -0x18(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
mov    %eax,-0x28(%rbp)
mov    $0xffffffff,%edi
call   1030 <UINT32_C@plt>
mov    %eax,%ecx
mov    -0x28(%rbp),%eax
and    %ecx,%eax
mov    %eax,-0x20(%rbp)
mov    -0x1c(%rbp),%eax
mov    $0x20,%ecx
sar    %cl,%eax
mov    %eax,-0x24(%rbp)
mov    -0x20(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x24(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fiat_p256_mulx_u32>:
push   %r14
push   %rbx
push   %rax
mov    %edx,%ebx
mov    %rdi,%r14
imul   %ecx,%ebx
mov    $0xffffffff,%edi
call   1030 <UINT32_C@plt>
and    %ebx,%eax
mov    %eax,(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @fiat_p256_mulx_u32(i32* %0, i32* %1, i32 %2, i32 %3) {
%5 = alloca i32*
%6 = alloca i32*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
store i32* %0, i32** %5
store i32* %1, i32** %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%12 = load i32, i32* %7
%13 = load i32, i32* %8
%14 = mul nsw i32 %12, %13
store i32 %14, i32* %9
%15 = load i32, i32* %9
%16 = call i32 @UINT32_C(i32 -1)
%17 = and i32 %15, %16
store i32 %17, i32* %10
%18 = load i32, i32* %9
%19 = ashr i32 %18, 32
store i32 %19, i32* %11
%20 = load i32, i32* %10
%21 = load i32*, i32** %5
store i32 %20, i32* %21
%22 = load i32, i32* %11
%23 = load i32*, i32** %6
store i32 %22, i32* %23
ret void
}

LLVM IR (-O2):
define void @fiat_p256_mulx_u32(i32* nocapture writeonly %0, i32* nocapture readnone %1, i32 %2, i32 %3) {
%5 = mul nsw i32 %3, %2
%6 = tail call i32 @UINT32_C(i32 -1)
%7 = and i32 %6, %5
store i32 %7, i32* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ strdel(char *, char *);
void trunchex(char *s) {
  if (s[0] == '0' && s[1] == 'x')
    strdel(s, s + 2);
}


x86 assembly (clang, -O0):
<trunchex>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x30,%eax
jne    114e <trunchex+0x3e>
mov    -0x8(%rbp),%rax
movsbl 0x1(%rax),%eax
cmp    $0x78,%eax
jne    114e <trunchex+0x3e>
mov    -0x8(%rbp),%rdi
mov    -0x8(%rbp),%rsi
add    $0x2,%rsi
call   1030 <strdel@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<trunchex>:
cmpb   $0x30,(%rdi)
jne    1124 <trunchex+0x14>
cmpb   $0x78,0x1(%rdi)
jne    1124 <trunchex+0x14>
lea    0x2(%rdi),%rsi
jmp    1030 <strdel@plt>
ret

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

LLVM IR (-O2):
define void @trunchex(i8* %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 48
br i1 %3, label %4, label %11
4: ; preds = %1
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 120
br i1 %7, label %8, label %11
8: ; preds = %4
%9 = getelementptr inbounds i8, i8* %0, i64 2
%10 = tail call i32 @strdel(i8* %0, i8* %9)
br label %11
11: ; preds = %8, %4, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ stdout;
void proxy_usage(int status) {
  fputs("HELLO\n\n", stdout);
  exit(1);
}


x86 assembly (clang, -O0):
<proxy_usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2eae(%rip),%rax
mov    (%rax),%esi
lea    0xec5(%rip),%rdi
call   1030 <fputs@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<proxy_usage>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%esi
lea    0xecf(%rip),%rdi
call   1030 <fputs@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"HELLO\0A\0A\00"
@stdout = global i32 0
define void @proxy_usage(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @stdout
%4 = call i32 @fputs(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [8 x i8] c"HELLO\0A\0A\00"
@stdout = global i32 0
define void @proxy_usage(i32 %0) {
%2 = load i32, i32* @stdout
%3 = tail call i32 @fputs(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %2)
%4 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ TIOCMBIC;
int /*<<< orphan*/ TIOCMBIS;
int /*<<< orphan*/ TIOCM_RTS;
int /*<<< orphan*/ modem_ioctl(int /*<<< orphan*/, int /*<<< orphan*/);
void tty_rts(int on) { modem_ioctl(on ? TIOCMBIS : TIOCMBIC, TIOCM_RTS); }


x86 assembly (clang, -O0):
<tty_rts>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1136 <tty_rts+0x26>
mov    0x2eac(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x8(%rbp)
jmp    1142 <tty_rts+0x32>
mov    0x2e93(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
mov    0x2e9c(%rip),%rax
mov    (%rax),%esi
call   1030 <modem_ioctl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tty_rts>:
test   %edi,%edi
jne    111d <tty_rts+0xd>
mov    0x2eb5(%rip),%rax
jmp    1124 <tty_rts+0x14>
mov    0x2eb4(%rip),%rax
mov    (%rax),%edi
mov    0x2ebb(%rip),%rax
mov    (%rax),%esi
jmp    1030 <modem_ioctl@plt>

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

LLVM IR (-O2):
@TIOCMBIS = global i32 0
@TIOCMBIC = global i32 0
@TIOCM_RTS = global i32 0
define void @tty_rts(i32 %0) {
%2 = icmp eq i32 %0, 0
%3 = load i32, i32* @TIOCMBIS
%4 = load i32, i32* @TIOCMBIC
%5 = select i1 %2, i32 %4, i32 %3
%6 = load i32, i32* @TIOCM_RTS
%7 = tail call i32 @modem_ioctl(i32 %5, i32 %6)
ret void
}
/* Type definitions */
struct timespec {
  scalar_t__ tv_nsec;
  scalar_t__ tv_sec;
};

/* Variables and functions */
double utils_timediff(struct timespec end_time, struct timespec start_time) {
  double diff =
      ((double)(end_time.tv_sec - start_time.tv_sec)) +
      ((double)(end_time.tv_nsec - start_time.tv_nsec) / 1000000000.0);
  return diff;
}


x86 assembly (clang, -O0):
<utils_timediff>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x8(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
sub    -0x18(%rbp),%rax
cvtsi2sd %rax,%xmm0
mov    -0x10(%rbp),%rax
sub    -0x20(%rbp),%rax
cvtsi2sd %rax,%xmm1
movsd  0xeca(%rip),%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x28(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<utils_timediff>:
sub    %rcx,%rsi
cvtsi2sd %rsi,%xmm1
sub    %rdx,%rdi
cvtsi2sd %rdi,%xmm0
divsd  0xee8(%rip),%xmm0
addsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
%struct.timespec = type { i64, i64 }
define double @utils_timediff(i64 %0, i64 %1, i64 %2, i64 %3) {
%5 = alloca %struct.timespec
%6 = alloca %struct.timespec
%7 = alloca double
%8 = bitcast %struct.timespec* %5 to { i64, i64 }*
%9 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %8, i32 0, i32 0
store i64 %0, i64* %9
%10 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %8, i32 0, i32 1
store i64 %1, i64* %10
%11 = bitcast %struct.timespec* %6 to { i64, i64 }*
%12 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %11, i32 0, i32 0
store i64 %2, i64* %12
%13 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %11, i32 0, i32 1
store i64 %3, i64* %13
%14 = getelementptr inbounds %struct.timespec, %struct.timespec* %5, i32 0, i32 1
%15 = load i64, i64* %14
%16 = getelementptr inbounds %struct.timespec, %struct.timespec* %6, i32 0, i32 1
%17 = load i64, i64* %16
%18 = sub nsw i64 %15, %17
%19 = sitofp i64 %18 to double
%20 = getelementptr inbounds %struct.timespec, %struct.timespec* %5, i32 0, i32 0
%21 = load i64, i64* %20
%22 = getelementptr inbounds %struct.timespec, %struct.timespec* %6, i32 0, i32 0
%23 = load i64, i64* %22
%24 = sub nsw i64 %21, %23
%25 = sitofp i64 %24 to double
%26 = fdiv double %25, 1.000000e+09
%27 = fadd double %19, %26
store double %27, double* %7
%28 = load double, double* %7
ret double %28
}

LLVM IR (-O2):
define double @utils_timediff(i64 %0, i64 %1, i64 %2, i64 %3) {
%5 = sub nsw i64 %1, %3
%6 = sitofp i64 %5 to double
%7 = sub nsw i64 %0, %2
%8 = sitofp i64 %7 to double
%9 = fdiv double %8, 1.000000e+09
%10 = fadd double %9, %6
ret double %10
}
char *strlower(char *str) {
  char c;
  char *ptr;
  for (ptr = str; (c = *ptr); ++ptr) {
    if (c >= 'A' && c <= 'Z')
      *ptr = c | 0x20;
  }
  return str;
}


x86 assembly (clang, -O0):
<strlower>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x9(%rbp)
cmp    $0x0,%al
je     1160 <strlower+0x60>
movsbl -0x9(%rbp),%eax
cmp    $0x41,%eax
jl     114a <strlower+0x4a>
movsbl -0x9(%rbp),%eax
cmp    $0x5a,%eax
jg     114a <strlower+0x4a>
movsbl -0x9(%rbp),%eax
or     $0x20,%eax
mov    %al,%cl
mov    -0x18(%rbp),%rax
mov    %cl,(%rax)
jmp    114f <strlower+0x4f>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1110 <strlower+0x10>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlower>:
mov    %rdi,%rax
mov    (%rdi),%cl
test   %cl,%cl
je     112c <strlower+0x2c>
lea    0x1(%rax),%rdx
jmp    111b <strlower+0x1b>
nop
movzbl (%rdx),%ecx
add    $0x1,%rdx
test   %cl,%cl
je     112c <strlower+0x2c>
lea    -0x41(%rcx),%esi
cmp    $0x19,%sil
ja     1110 <strlower+0x10>
or     $0x20,%cl
mov    %cl,-0x1(%rdx)
jmp    1110 <strlower+0x10>
ret

LLVM IR (-O0):
define i8* @strlower(i8* %0) {
%2 = alloca i8*
%3 = alloca i8
%4 = alloca i8*
store i8* %0, i8** %2
%5 = load i8*, i8** %2
store i8* %5, i8** %4
br label %6
6: ; preds = %25, %1
%7 = load i8*, i8** %4
%8 = load i8, i8* %7
store i8 %8, i8* %3
%9 = icmp ne i8 %8, 0
br i1 %9, label %10, label %28
10: ; preds = %6
%11 = load i8, i8* %3
%12 = sext i8 %11 to i32
%13 = icmp sge i32 %12, 65
br i1 %13, label %14, label %24
14: ; preds = %10
%15 = load i8, i8* %3
%16 = sext i8 %15 to i32
%17 = icmp sle i32 %16, 90
br i1 %17, label %18, label %24
18: ; preds = %14
%19 = load i8, i8* %3
%20 = sext i8 %19 to i32
%21 = or i32 %20, 32
%22 = trunc i32 %21 to i8
%23 = load i8*, i8** %4
store i8 %22, i8* %23
br label %24
24: ; preds = %18, %14, %10
br label %25
25: ; preds = %24
%26 = load i8*, i8** %4
%27 = getelementptr inbounds i8, i8* %26, i32 1
store i8* %27, i8** %4
br label %6
28: ; preds = %6
%29 = load i8*, i8** %2
ret i8* %29
}

LLVM IR (-O2):
define i8* @strlower(i8* returned %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %15, label %4
4: ; preds = %1, %11
%5 = phi i8 [ %13, %11 ], [ %2, %1 ]
%6 = phi i8* [ %12, %11 ], [ %0, %1 ]
%7 = add i8 %5, -65
%8 = icmp ult i8 %7, 26
br i1 %8, label %9, label %11
9: ; preds = %4
%10 = or i8 %5, 32
store i8 %10, i8* %6
br label %11
11: ; preds = %4, %9
%12 = getelementptr inbounds i8, i8* %6, i64 1
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %4
15: ; preds = %11, %1
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, unsigned long long);
int /*<<< orphan*/ scanf(char *, unsigned long long *, unsigned long long *);
int main(void) {
  unsigned long long int A, B;
  scanf("%llu %llu", &A, &B);
  printf("%d\n", (A + B) * (B - A + 1) / 2);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x10(%rbp),%rsi
lea    -0x18(%rbp),%rdx
call   1040 <scanf@plt>
mov    -0x10(%rbp),%rsi
add    -0x18(%rbp),%rsi
mov    -0x18(%rbp),%rax
sub    -0x10(%rbp),%rax
add    $0x1,%rax
imul   %rax,%rsi
shr    $0x1,%rsi
lea    0xea4(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
lea    0xed5(%rip),%rdi
lea    0x10(%rsp),%rsi
lea    0x8(%rsp),%rdx
call   1040 <scanf@plt>
mov    0x10(%rsp),%rax
mov    0x8(%rsp),%rsi
lea    (%rsi,%rax,1),%rcx
sub    %rax,%rsi
add    $0x1,%rsi
imul   %rcx,%rsi
shr    %rsi
lea    0xead(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [10 x i8] c"%llu %llu\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i64
%3 = alloca i64
store i32 0, i32* %1
%4 = call i32 @scanf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i64* %2, i64* %3)
%5 = load i64, i64* %2
%6 = load i64, i64* %3
%7 = add i64 %5, %6
%8 = load i64, i64* %3
%9 = load i64, i64* %2
%10 = sub i64 %8, %9
%11 = add i64 %10, 1
%12 = mul i64 %7, %11
%13 = udiv i64 %12, 2
%14 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i64 %13)
ret i32 0
}

LLVM IR (-O2):
@.str = [10 x i8] c"%llu %llu\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i64
%2 = alloca i64
%3 = bitcast i64* %1 to i8*
%4 = bitcast i64* %2 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i64* %1, i64* %2)
%6 = load i64, i64* %1
%7 = load i64, i64* %2
%8 = add i64 %7, %6
%9 = sub i64 1, %6
%10 = add i64 %9, %7
%11 = mul i64 %8, %10
%12 = lshr i64 %11, 1
%13 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i64 %12)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ x;

/* Variables and functions */
char *largestNumber(int *, int);
int /*<<< orphan*/ printf(char *, char *);
int main(void) {
  int x[] = {824, 938, 1399, 5607, 6973, 5703, 9609, 4398, 8247};
  printf("%s\n", largestNumber(x, sizeof(x) / sizeof(int)));
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x30(%rbp),%rdi
lea    0xeb6(%rip),%rsi
mov    $0x24,%edx
call   1040 <memcpy@plt>
lea    -0x30(%rbp),%rdi
mov    $0x9,%esi
call   1050 <largestNumber@plt>
mov    %rax,%rsi
lea    0xeb8(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
mov    0xef6(%rip),%eax
mov    %eax,0x20(%rsp)
movaps 0xedb(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xebf(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
mov    $0x9,%esi
call   1040 <largestNumber@plt>
lea    0xecb(%rip),%rdi
mov    %rax,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
@__const.main.x = [9 x i32] [i32 824, i32 938, i32 1399, i32 5607, i32 6973, i32 5703, i32 9609, i32 4398, i32 8247]
@.str = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [9 x i32]
store i32 0, i32* %1
%3 = bitcast [9 x i32]* %2 to i8*
%4 = getelementptr inbounds [9 x i32], [9 x i32]* %2, i64 0, i64 0
%5 = call i8* @largestNumber(i32* %4, i32 9)
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %5)
ret i32 0
}

LLVM IR (-O2):
@__const.main.x = [9 x i32] [i32 824, i32 938, i32 1399, i32 5607, i32 6973, i32 5703, i32 9609, i32 4398, i32 8247]
@.str = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca [9 x i32]
%2 = bitcast [9 x i32]* %1 to i8*
%3 = getelementptr inbounds [9 x i32], [9 x i32]* %1, i64 0, i64 0
%4 = call i8* @largestNumber(i32* %3, i32 9)
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %4)
ret i32 0
}
/* Variables and functions */
int strlen(char *);
int get_lines_needed(char *string, int terminal_width) {
  if (string)
    return (strlen(string) + terminal_width - 1) / terminal_width;
  else
    return 1;
}


x86 assembly (clang, -O0):
<get_lines_needed>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1145 <get_lines_needed+0x35>
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
add    -0x14(%rbp),%eax
sub    $0x1,%eax
cltd
idivl  -0x14(%rbp)
mov    %eax,-0x4(%rbp)
jmp    114c <get_lines_needed+0x3c>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_lines_needed>:
test   %rdi,%rdi
je     1127 <get_lines_needed+0x17>
push   %rbx
mov    %esi,%ebx
call   1030 <strlen@plt>
add    %ebx,%eax
add    $0xffffffff,%eax
cltd
idiv   %ebx
pop    %rbx
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @get_lines_needed(i8* %0, i32 %1) {
%3 = icmp eq i8* %0, null
br i1 %3, label %9, label %4
4: ; preds = %2
%5 = tail call i32 @strlen(i8* %0)
%6 = add i32 %1, -1
%7 = add i32 %6, %5
%8 = sdiv i32 %7, %1
br label %9
9: ; preds = %2, %4
%10 = phi i32 [ %8, %4 ], [ 1, %2 ]
ret i32 %10
}
void BIO_dump_indent(void) {}


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

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

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

LLVM IR (-O2):
define void @BIO_dump_indent() {
ret void
}
int test_imm_C9int16_reg(short val) {
  return ((val) & (-0xC9 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_C9int16_reg(i16 signext %0) {
%2 = and i16 %0, -201
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
scalar_t__ LONG_MAX;
unsigned long ulong_add_capped(unsigned long const, unsigned long const,
                               unsigned long);
unsigned long ulong_add_capped_long(const unsigned long x,
                                    const unsigned long y) {
  return ulong_add_capped(x, y, (unsigned long)LONG_MAX);
}


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

x86 assembly (clang, -O2):
<ulong_add_capped_long>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%rdx
jmp    1030 <ulong_add_capped@plt>

LLVM IR (-O0):
@LONG_MAX = global i64 0
define i64 @ulong_add_capped_long(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = load i64, i64* %4
%7 = load i64, i64* @LONG_MAX
%8 = call i64 @ulong_add_capped(i64 %5, i64 %6, i64 %7)
ret i64 %8
}

LLVM IR (-O2):
@LONG_MAX = global i64 0
define i64 @ulong_add_capped_long(i64 %0, i64 %1) {
%3 = load i64, i64* @LONG_MAX
%4 = tail call i64 @ulong_add_capped(i64 %0, i64 %1, i64 %3)
ret i64 %4
}
void __SLIC_fun_free_irq_call(unsigned int __SLIC_arg_1, void *__SLIC_arg_2) {
  { return; }
}


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

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

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

LLVM IR (-O2):
define void @__SLIC_fun_free_irq_call(i32 %0, i8* nocapture %1) {
ret void
}
/* Type definitions */
typedef int int64_t;

/* Variables and functions */
scalar_t__ doubleToRawLongBits(double);
double const longBitsToDouble(scalar_t__);
__attribute__((always_)) const double ldexp3k(double d, int e) {
  return longBitsToDouble(doubleToRawLongBits(d) + (((int64_t)e) << 52));
}


x86 assembly (clang, -O0):
<ldexp3k>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    %edi,-0xc(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1040 <doubleToRawLongBits@plt>
mov    %rax,%rdi
mov    -0xc(%rbp),%eax
mov    $0x34,%ecx
shl    %cl,%eax
cltq
add    %rax,%rdi
call   1030 <longBitsToDouble@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ldexp3k>:
push   %rax
call   1040 <doubleToRawLongBits@plt>
pop    %rax
jmp    1030 <longBitsToDouble@plt>

LLVM IR (-O0):
define double @ldexp3k(double %0, i32 %1) {
%3 = alloca double
%4 = alloca i32
store double %0, double* %3
store i32 %1, i32* %4
%5 = load double, double* %3
%6 = call i64 @doubleToRawLongBits(double %5)
%7 = load i32, i32* %4
%8 = shl i32 %7, 52
%9 = sext i32 %8 to i64
%10 = add nsw i64 %6, %9
%11 = call double @longBitsToDouble(i64 %10)
ret double %11
}

LLVM IR (-O2):
define double @ldexp3k(double %0, i32 %1) {
%3 = tail call i64 @doubleToRawLongBits(double %0)
%4 = tail call double @longBitsToDouble(i64 poison)
ret double %4
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
uint8_t mem_read(uint16_t addr) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @mem_read(i32 %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ dup(int);
int open_rdonly(char *);
int execute_dup() {
  int fd = open_rdonly("syscalls.txt");
  dup(fd);
  close(fd);
  dup(fd);
  return 0;
}


x86 assembly (clang, -O0):
<execute_dup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
call   1030 <open_rdonly@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <dup@plt>
mov    -0x4(%rbp),%edi
call   1050 <close@plt>
mov    -0x4(%rbp),%edi
call   1040 <dup@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<execute_dup>:
push   %rbx
lea    0xec8(%rip),%rdi
call   1030 <open_rdonly@plt>
mov    %eax,%ebx
mov    %eax,%edi
call   1040 <dup@plt>
mov    %ebx,%edi
call   1050 <close@plt>
mov    %ebx,%edi
call   1040 <dup@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [13 x i8] c"syscalls.txt\00"
define i32 @execute_dup() {
%1 = alloca i32
%2 = call i32 @open_rdonly(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = call i32 @dup(i32 %3)
%5 = load i32, i32* %1
%6 = call i32 @close(i32 %5)
%7 = load i32, i32* %1
%8 = call i32 @dup(i32 %7)
ret i32 0
}

LLVM IR (-O2):
@.str = [13 x i8] c"syscalls.txt\00"
define i32 @execute_dup() {
%1 = tail call i32 @open_rdonly(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @dup(i32 %1)
%3 = tail call i32 @close(i32 %1)
%4 = tail call i32 @dup(i32 %1)
ret i32 0
}
/* Variables and functions */
int getlongcode();
int getdictionary(int d0) {
  if (d0 >= 0x1a)
    return getlongcode();
  else
    return d0 + 0x61;
}


x86 assembly (clang, -O0):
<getdictionary>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x1a,-0x8(%rbp)
jl     1134 <getdictionary+0x24>
mov    $0x0,%al
call   1030 <getlongcode@plt>
mov    %eax,-0x4(%rbp)
jmp    113d <getdictionary+0x2d>
mov    -0x8(%rbp),%eax
add    $0x61,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getdictionary>:
cmp    $0x1a,%edi
jl     111c <getdictionary+0xc>
xor    %eax,%eax
jmp    1030 <getlongcode@plt>
add    $0x61,%edi
mov    %edi,%eax
ret

LLVM IR (-O0):
define i32 @getdictionary(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp sge i32 %4, 26
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = call i32 (...) @getlongcode()
store i32 %7, i32* %2
br label %11
8: ; preds = %1
%9 = load i32, i32* %3
%10 = add nsw i32 %9, 97
store i32 %10, i32* %2
br label %11
11: ; preds = %8, %6
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
define i32 @getdictionary(i32 %0) {
%2 = icmp sgt i32 %0, 25
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 (...) @getlongcode()
br label %7
5: ; preds = %1
%6 = add nsw i32 %0, 97
br label %7
7: ; preds = %5, %3
%8 = phi i32 [ %4, %3 ], [ %6, %5 ]
ret i32 %8
}
/* Variables and functions */
scalar_t__ malloc(size_t);
int /*<<< orphan*/ nrerror(char *);
unsigned short *usvector(long nl, long nh) {
  unsigned short *v;
  v = (unsigned short *)malloc(
      (size_t)((nh - nl + 1 + 1) * sizeof(unsigned short)));
  if (!v)
    nrerror("allocation failure in usvector()");
  return v - nl + 1;
}


x86 assembly (clang, -O0):
<usvector>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
sub    -0x8(%rbp),%rdi
add    $0x1,%rdi
add    $0x1,%rdi
shl    $0x1,%rdi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1164 <usvector+0x44>
lea    0xea1(%rip),%rdi
call   1030 <nrerror@plt>
mov    -0x18(%rbp),%rax
xor    %ecx,%ecx
sub    -0x8(%rbp),%rcx
shl    $0x1,%rcx
add    %rcx,%rax
add    $0x2,%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usvector>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
sub    %rdi,%rsi
lea    (%rsi,%rsi,1),%rdi
add    $0x4,%rdi
call   1040 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    114b <usvector+0x2b>
lea    0xeba(%rip),%rdi
call   1030 <nrerror@plt>
add    %r14,%r14
sub    %r14,%rbx
add    $0x2,%rbx
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [33 x i8] c"allocation failure in usvector()\00"
define i16* @usvector(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i16*
store i64 %0, i64* %3
store i64 %1, i64* %4
%6 = load i64, i64* %4
%7 = load i64, i64* %3
%8 = sub nsw i64 %6, %7
%9 = add nsw i64 %8, 1
%10 = add nsw i64 %9, 1
%11 = mul i64 %10, 2
%12 = call i64 @malloc(i64 %11)
%13 = inttoptr i64 %12 to i16*
store i16* %13, i16** %5
%14 = load i16*, i16** %5
%15 = icmp ne i16* %14, null
br i1 %15, label %18, label %16
16: ; preds = %2
%17 = call i32 @nrerror(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
br label %18
18: ; preds = %16, %2
%19 = load i16*, i16** %5
%20 = load i64, i64* %3
%21 = sub i64 0, %20
%22 = getelementptr inbounds i16, i16* %19, i64 %21
%23 = getelementptr inbounds i16, i16* %22, i64 1
ret i16* %23
}

LLVM IR (-O2):
@.str = [33 x i8] c"allocation failure in usvector()\00"
define i16* @usvector(i64 %0, i64 %1) {
%3 = sub nsw i64 %1, %0
%4 = shl i64 %3, 1
%5 = add i64 %4, 4
%6 = tail call i64 @malloc(i64 %5)
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = tail call i32 @nrerror(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %8, %2
%11 = inttoptr i64 %6 to i16*
%12 = sub i64 0, %0
%13 = getelementptr inbounds i16, i16* %11, i64 %12
%14 = getelementptr inbounds i16, i16* %13, i64 1
ret i16* %14
}
void rtc_dev_del_device(struct rtc_device *rtc) {}


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

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

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

LLVM IR (-O2):
%struct.rtc_device = type opaque
define void @rtc_dev_del_device(%struct.rtc_device* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ initialize();
int main(int argc, char *argv[]) {
  initialize();
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <initialize@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 (...) @initialize()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @initialize()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void report_error(char *s) {
  fprintf(stderr, "%s\n", s);
  exit(-1);
}


x86 assembly (clang, -O0):
<report_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<report_error>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [4 x i8] c"%s\0A\00"
define void @report_error(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @exit(i32 -1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [4 x i8] c"%s\0A\00"
define void @report_error(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 -1)
unreachable
}
int wordslen(const char *s, char c) {
  int len;
  len = 0;
  while (*s != c && *s != '\0') {
    len++;
    s++;
  }
  return (len);
}


x86 assembly (clang, -O0):
<wordslen>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
movsbl -0x9(%rbp),%edx
xor    %eax,%eax
cmp    %edx,%ecx
mov    %al,-0x11(%rbp)
je     113d <wordslen+0x3d>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
setne  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    114d <wordslen+0x4d>
jmp    1167 <wordslen+0x67>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1115 <wordslen+0x15>
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<wordslen>:
mov    (%rdi),%cl
xor    %eax,%eax
cmp    %sil,%cl
je     1122 <wordslen+0x22>
test   %cl,%cl
je     1122 <wordslen+0x22>
xor    %eax,%eax
nop
movzbl 0x1(%rdi,%rax,1),%ecx
add    $0x1,%rax
cmp    %sil,%cl
je     1122 <wordslen+0x22>
test   %cl,%cl
jne    1110 <wordslen+0x10>
ret

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

LLVM IR (-O2):
define i32 @wordslen(i8* nocapture %0, i8 signext %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, %1
%5 = icmp eq i8 %3, 0
%6 = or i1 %4, %5
br i1 %6, label %16, label %7
7: ; preds = %2, %7
%8 = phi i32 [ %10, %7 ], [ 0, %2 ]
%9 = phi i8* [ %11, %7 ], [ %0, %2 ]
%10 = add nuw nsw i32 %8, 1
%11 = getelementptr inbounds i8, i8* %9, i64 1
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, %1
%14 = icmp eq i8 %12, 0
%15 = or i1 %13, %14
br i1 %15, label %16, label %7
16: ; preds = %7, %2
%17 = phi i32 [ 0, %2 ], [ %10, %7 ]
ret i32 %17
}
void ff_hevc_put_hevc_bi_w_pel_pixels8_12_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_bi_w_pel_pixels8_12_sse4() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
int /*<<< orphan*/ get_mem();
scalar_t__ malloc(int);
int main(void) {
  int i;
  char *ptr1, *ptr2;
  ptr1 = (char *)malloc(512);
  ptr2 = (char *)malloc(512);
  ptr2 = ptr1;
  free(ptr2);
  free(ptr1);
  for (i = 0; i < 512; i++) {
    get_mem();
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x200,%edi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    $0x200,%edi
call   1050 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
movl   $0x0,-0x8(%rbp)
cmpl   $0x200,-0x8(%rbp)
jge    119e <main+0x6e>
mov    $0x0,%al
call   1040 <get_mem@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    117c <main+0x4c>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
mov    $0x200,%ebp
mov    $0x200,%edi
call   1050 <malloc@plt>
mov    %rax,%rbx
mov    $0x200,%edi
call   1050 <malloc@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
nop
xor    %eax,%eax
call   1040 <get_mem@plt>
add    $0xffffffff,%ebp
jne    1160 <main+0x30>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i8*
store i32 0, i32* %1
%5 = call i64 @malloc(i32 512)
%6 = inttoptr i64 %5 to i8*
store i8* %6, i8** %3
%7 = call i64 @malloc(i32 512)
%8 = inttoptr i64 %7 to i8*
store i8* %8, i8** %4
%9 = load i8*, i8** %3
store i8* %9, i8** %4
%10 = load i8*, i8** %4
%11 = call i32 @free(i8* %10)
%12 = load i8*, i8** %3
%13 = call i32 @free(i8* %12)
store i32 0, i32* %2
br label %14
14: ; preds = %19, %0
%15 = load i32, i32* %2
%16 = icmp slt i32 %15, 512
br i1 %16, label %17, label %22
17: ; preds = %14
%18 = call i32 (...) @get_mem()
br label %19
19: ; preds = %17
%20 = load i32, i32* %2
%21 = add nsw i32 %20, 1
store i32 %21, i32* %2
br label %14
22: ; preds = %14
%23 = load i32, i32* %1
ret i32 %23
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i64 @malloc(i32 512)
%2 = inttoptr i64 %1 to i8*
%3 = tail call i64 @malloc(i32 512)
%4 = tail call i32 @free(i8* %2)
%5 = tail call i32 @free(i8* %2)
br label %6
6: ; preds = %0, %6
%7 = phi i32 [ 0, %0 ], [ %9, %6 ]
%8 = tail call i32 (...) @get_mem()
%9 = add nuw nsw i32 %7, 1
%10 = icmp eq i32 %9, 512
br i1 %10, label %11, label %6
11: ; preds = %6
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  fprintf(stderr, "Usage: sort [options] [+pos1 [-pos2]] ... [file ...]\n");
  fprintf(stderr, "Options: [-mubdfinr] [-tx] [-T directory] [-o name]\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    0x2ea0(%rip),%rax
mov    (%rax),%edi
lea    0xeed(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [54 x i8] c"Usage: sort [options] [+pos1 [-pos2]] ... [file ...]\0A\00"
@.str.1 = [53 x i8] c"Options: [-mubdfinr] [-tx] [-T directory] [-o name]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stderr
%4 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.1, i64 0, i64 0))
%5 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [54 x i8] c"Usage: sort [options] [+pos1 [-pos2]] ... [file ...]\0A\00"
@.str.1 = [53 x i8] c"Options: [-mubdfinr] [-tx] [-T directory] [-o name]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.1, i64 0, i64 0))
%5 = tail call i32 @exit(i32 1)
unreachable
}
int libetpan_get_version_minor(void) { return 1; }


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

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

LLVM IR (-O0):
define i32 @libetpan_get_version_minor() {
ret i32 1
}

LLVM IR (-O2):
define i32 @libetpan_get_version_minor() {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int main(int argc, char **argv) {
  char *msg = "Hello, world!";
  printf("%s\n", msg);
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [14 x i8] c"Hello, world!\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8** %6
%7 = load i8*, i8** %6
%8 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %7)
ret i32 0
}

LLVM IR (-O2):
@.str = [14 x i8] c"Hello, world!\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int waitpid(int, int *, int /*<<< orphan*/);
int pcloseNoStderr(int pid, FILE *out) {
  int rc, status;
  fclose(out);
  rc = waitpid(pid, &status, 0);
  return status;
}


x86 assembly (clang, -O0):
<pcloseNoStderr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <fclose@plt>
mov    -0x4(%rbp),%edi
lea    -0x18(%rbp),%rsi
xor    %edx,%edx
call   1040 <waitpid@plt>
mov    %eax,-0x14(%rbp)
mov    -0x18(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pcloseNoStderr>:
push   %rbx
sub    $0x10,%rsp
mov    %edi,%ebx
mov    %rsi,%rdi
call   1030 <fclose@plt>
lea    0xc(%rsp),%rsi
mov    %ebx,%edi
xor    %edx,%edx
call   1040 <waitpid@plt>
mov    0xc(%rsp),%eax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @pcloseNoStderr(i32 %0, i32* nocapture %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = tail call i32 @fclose(i32* %1)
%6 = call i32 @waitpid(i32 %0, i32* %3, i32 0)
%7 = load i32, i32* %3
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ sync();
void smp_io_sync() { sync(); }


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

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

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

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