xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ __syscall(int, unsigned int, int /*<<< orphan*/,
                             int /*<<< orphan*/, int /*<<< orphan*/,
                             int /*<<< orphan*/, int /*<<< orphan*/);
void exit(int status) { __syscall(60, (unsigned)status & 0xFF, 0, 0, 0, 0, 0); }


x86 assembly (clang, -O0):
<exit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
and    $0xff,%esi
mov    $0x3c,%edi
xor    %r9d,%r9d
mov    %r9d,%edx
mov    %r9d,%ecx
mov    %r9d,%r8d
movl   $0x0,(%rsp)
call   1030 <__syscall@plt>

x86 assembly (clang, -O2):
<exit>:
push   %rax
movzbl %dil,%esi
movl   $0x0,(%rsp)
mov    $0x3c,%edi
xor    %edx,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
xor    %r9d,%r9d
call   1030 <__syscall@plt>

LLVM IR (-O0):
define void @exit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 255
%5 = call i32 @__syscall(i32 60, i32 %4, i32 0, i32 0, i32 0, i32 0, i32 0)
unreachable
}

LLVM IR (-O2):
define void @exit(i32 %0) {
%2 = and i32 %0, 255
%3 = tail call i32 @__syscall(i32 60, i32 %2, i32 0, i32 0, i32 0, i32 0, i32 0)
unreachable
}
unsigned long ipow(unsigned long base, int exp) {
  unsigned long result = 1;
  while (exp) {
    if (exp & 1)
      result *= base;
    exp >>= 1;
    base *= base;
  }
  return result;
}


x86 assembly (clang, -O0):
<ipow>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movq   $0x1,-0x18(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     1154 <ipow+0x54>
mov    -0xc(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     1139 <ipow+0x39>
mov    -0x8(%rbp),%rax
imul   -0x18(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
sar    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
imul   -0x8(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1113 <ipow+0x13>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ipow>:
test   %esi,%esi
je     113d <ipow+0x3d>
mov    $0x1,%r8d
mov    $0x1,%eax
mov    %esi,%edx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
test   $0x1,%sil
mov    %rdi,%rcx
cmove  %r8,%rcx
imul   %rcx,%rax
sar    %edx
imul   %rdi,%rdi
cmp    $0x1,%esi
mov    %edx,%esi
ja     1120 <ipow+0x20>
ret
mov    $0x1,%eax
ret

LLVM IR (-O0):
define i64 @ipow(i64 %0, i32 %1) {
%3 = alloca i64
%4 = alloca i32
%5 = alloca i64
store i64 %0, i64* %3
store i32 %1, i32* %4
store i64 1, i64* %5
br label %6
6: ; preds = %17, %2
%7 = load i32, i32* %4
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %23
9: ; preds = %6
%10 = load i32, i32* %4
%11 = and i32 %10, 1
%12 = icmp ne i32 %11, 0
br i1 %12, label %13, label %17
13: ; preds = %9
%14 = load i64, i64* %3
%15 = load i64, i64* %5
%16 = mul i64 %15, %14
store i64 %16, i64* %5
br label %17
17: ; preds = %13, %9
%18 = load i32, i32* %4
%19 = ashr i32 %18, 1
store i32 %19, i32* %4
%20 = load i64, i64* %3
%21 = load i64, i64* %3
%22 = mul i64 %21, %20
store i64 %22, i64* %3
br label %6
23: ; preds = %6
%24 = load i64, i64* %5
ret i64 %24
}

LLVM IR (-O2):
define i64 @ipow(i64 %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %15, label %4
4: ; preds = %2, %4
%5 = phi i64 [ %11, %4 ], [ 1, %2 ]
%6 = phi i32 [ %12, %4 ], [ %1, %2 ]
%7 = phi i64 [ %13, %4 ], [ %0, %2 ]
%8 = and i32 %6, 1
%9 = icmp eq i32 %8, 0
%10 = select i1 %9, i64 1, i64 %7
%11 = mul i64 %10, %5
%12 = ashr i32 %6, 1
%13 = mul i64 %7, %7
%14 = icmp ult i32 %6, 2
br i1 %14, label %15, label %4
15: ; preds = %4, %2
%16 = phi i64 [ 1, %2 ], [ %11, %4 ]
ret i64 %16
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void celt_free_scratch(void *ptr) { free(ptr); }


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

x86 assembly (clang, -O2):
<celt_free_scratch>:
jmp    1030 <free@plt>

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

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

/* Variables and functions */
void ClearSourceChainPtr(uint8_t *chain) { chain[0] = 0xff; }


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

x86 assembly (clang, -O2):
<ClearSourceChainPtr>:
movl   $0xff,(%rdi)
ret

LLVM IR (-O0):
define void @ClearSourceChainPtr(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 0
store i32 255, i32* %4
ret void
}

LLVM IR (-O2):
define void @ClearSourceChainPtr(i32* nocapture writeonly %0) {
store i32 255, i32* %0
ret void
}
/* Variables and functions */
double cosh(double);
double Double_cosh(double x) { return cosh(x); }


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

x86 assembly (clang, -O2):
<Double_cosh>:
jmp    1030 <cosh@plt>

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

LLVM IR (-O2):
define double @Double_cosh(double %0) {
%2 = tail call double @cosh(double %0)
ret double %2
}
int main(int argc, char **argv) {
  int x;
  double r = argc;
  if (0 == r) {
    x = 7;
  } else {
    x = 42;
  }
  return x;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cvtsi2sdl -0x8(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x20(%rbp),%xmm0
jne    113c <main+0x3c>
jp     113c <main+0x3c>
movl   $0x7,-0x14(%rbp)
jmp    1143 <main+0x43>
movl   $0x2a,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
test   %edi,%edi
mov    $0x7,%ecx
mov    $0x2a,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca double
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = load i32, i32* %4
%9 = sitofp i32 %8 to double
store double %9, double* %7
%10 = load double, double* %7
%11 = fcmp oeq double 0.000000e+00, %10
br i1 %11, label %12, label %13
12: ; preds = %2
store i32 7, i32* %6
br label %14
13: ; preds = %2
store i32 42, i32* %6
br label %14
14: ; preds = %13, %12
%15 = load i32, i32* %6
ret i32 %15
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = icmp eq i32 %0, 0
%4 = select i1 %3, i32 7, i32 42
ret i32 %4
}
void GENERAL_NAME_print(void) {}


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

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

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

LLVM IR (-O2):
define void @GENERAL_NAME_print() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
char int_to_hex(unsigned val) {
  assert(val < 16);
  if (val < 10) {
    return val + '0';
  } else {
    return val - 10 + 'a';
  }
}


x86 assembly (clang, -O0):
<int_to_hex>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x10,-0x8(%rbp)
setb   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
cmpl   $0xa,-0x8(%rbp)
jae    1144 <int_to_hex+0x34>
mov    -0x8(%rbp),%eax
add    $0x30,%eax
mov    %al,-0x1(%rbp)
jmp    1150 <int_to_hex+0x40>
mov    -0x8(%rbp),%eax
sub    $0xa,%eax
add    $0x61,%eax
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<int_to_hex>:
push   %rbx
mov    %edi,%ebx
xor    %edi,%edi
cmp    $0x10,%ebx
setb   %dil
call   1030 <assert@plt>
cmp    $0xa,%ebx
mov    $0x30,%ecx
mov    $0x57,%eax
cmovb  %ecx,%eax
add    %bl,%al
pop    %rbx
ret

LLVM IR (-O0):
define signext i8 @int_to_hex(i32 %0) {
%2 = alloca i8
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp ult i32 %4, 16
%6 = zext i1 %5 to i32
%7 = call i32 @assert(i32 %6)
%8 = load i32, i32* %3
%9 = icmp ult i32 %8, 10
br i1 %9, label %10, label %14
10: ; preds = %1
%11 = load i32, i32* %3
%12 = add i32 %11, 48
%13 = trunc i32 %12 to i8
store i8 %13, i8* %2
br label %19
14: ; preds = %1
%15 = load i32, i32* %3
%16 = sub i32 %15, 10
%17 = add i32 %16, 97
%18 = trunc i32 %17 to i8
store i8 %18, i8* %2
br label %19
19: ; preds = %14, %10
%20 = load i8, i8* %2
ret i8 %20
}

LLVM IR (-O2):
define signext i8 @int_to_hex(i32 %0) {
%2 = icmp ult i32 %0, 16
%3 = zext i1 %2 to i32
%4 = tail call i32 @assert(i32 %3)
%5 = icmp ult i32 %0, 10
%6 = trunc i32 %0 to i8
%7 = select i1 %5, i8 48, i8 87
%8 = add i8 %7, %6
ret i8 %8
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void print_help() {
  fprintf(stderr,
          "Usage: readenergy [-t PERIOD] [-o OUTFILE]\n\n"
          "Read Juno energy counters every PERIOD milliseconds, writing them\n"
          "to OUTFILE in CSV format either until SIGTERM is received OR\n"
          "till the specified duration elapsed.\n"
          "If OUTFILE is not specified, stdout will be used.\n\n"
          "Parameters:\n"
          "	PERIOD is the counter poll period in milliseconds.\n"
          "	       (Defaults to 100 milliseconds.)\n"
          "	DURATION is the duration before execution terminates.\n"
          "		(Defaults to 0 seconds, meaning run till user\n"
          "		terminates execution.\n"
          "	OUTFILE is the output file path\n");
}


x86 assembly (clang, -O0):
<print_help>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_help>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [524 x i8] c"Usage: readenergy [-t PERIOD] [-o OUTFILE]\0A\0ARead Juno energy counters every PERIOD milliseconds, writing them\0Ato OUTFILE in CSV format either until SIGTERM is received OR\0Atill the specified duration elapsed.\0AIf OUTFILE is not specified, stdout will be used.\0A\0AParameters:\0A\09PERIOD is the counter poll period in milliseconds.\0A\09 (Defaults to 100 milliseconds.)\0A\09DURATION is the duration before execution terminates.\0A\09\09(Defaults to 0 seconds, meaning run till user\0A\09\09terminates execution.\0A\09OUTFILE is the output file path\0A\00"
define void @print_help() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([524 x i8], [524 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [524 x i8] c"Usage: readenergy [-t PERIOD] [-o OUTFILE]\0A\0ARead Juno energy counters every PERIOD milliseconds, writing them\0Ato OUTFILE in CSV format either until SIGTERM is received OR\0Atill the specified duration elapsed.\0AIf OUTFILE is not specified, stdout will be used.\0A\0AParameters:\0A\09PERIOD is the counter poll period in milliseconds.\0A\09 (Defaults to 100 milliseconds.)\0A\09DURATION is the duration before execution terminates.\0A\09\09(Defaults to 0 seconds, meaning run till user\0A\09\09terminates execution.\0A\09OUTFILE is the output file path\0A\00"
define void @print_help() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([524 x i8], [524 x i8]* @.str, i64 0, i64 0))
ret void
}
int decr(int arg) { return arg - 1; }


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

x86 assembly (clang, -O2):
<decr>:
lea    -0x1(%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @decr(i32 %0) {
%2 = add nsw i32 %0, -1
ret i32 %2
}
void swap_byte(unsigned char *a, unsigned char *b) {
  unsigned char swapByte;
  swapByte = *a;
  *a = *b;
  *b = swapByte;
}


x86 assembly (clang, -O0):
<swap_byte>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x11(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x11(%rbp),%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<swap_byte>:
mov    (%rdi),%al
mov    (%rsi),%cl
mov    %cl,(%rdi)
mov    %al,(%rsi)
ret

LLVM IR (-O0):
define void @swap_byte(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
%7 = load i8, i8* %6
store i8 %7, i8* %5
%8 = load i8*, i8** %4
%9 = load i8, i8* %8
%10 = load i8*, i8** %3
store i8 %9, i8* %10
%11 = load i8, i8* %5
%12 = load i8*, i8** %4
store i8 %11, i8* %12
ret void
}

LLVM IR (-O2):
define void @swap_byte(i8* nocapture %0, i8* nocapture %1) {
%3 = load i8, i8* %0
%4 = load i8, i8* %1
store i8 %4, i8* %0
store i8 %3, i8* %1
ret void
}
int c095(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @c095() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ native_set_ldt(void *, int /*<<< orphan*/);
__attribute__((always_)) void clear_LDT(void) {
  native_set_ldt(((void *)0), 0);
}


x86 assembly (clang, -O0):
<clear_LDT>:
push   %rbp
mov    %rsp,%rbp
xor    %eax,%eax
mov    %eax,%edi
xor    %esi,%esi
call   1030 <native_set_ldt@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<clear_LDT>:
xor    %edi,%edi
xor    %esi,%esi
jmp    1030 <native_set_ldt@plt>

LLVM IR (-O0):
define void @clear_LDT() {
%1 = call i32 @native_set_ldt(i8* null, i32 0)
ret void
}

LLVM IR (-O2):
define void @clear_LDT() {
%1 = tail call i32 @native_set_ldt(i8* null, i32 0)
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
__attribute__((always_)) int is_branch(uint32_t op) {
  return !((op & 0x0E000000) ^ 0x0A000000);
}


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

x86 assembly (clang, -O2):
<is_branch>:
and    $0xe000000,%edi
xor    %eax,%eax
cmp    $0xa000000,%edi
sete   %al
ret

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

LLVM IR (-O2):
define i32 @is_branch(i32 %0) {
%2 = and i32 %0, 234881024
%3 = icmp eq i32 %2, 167772160
%4 = zext i1 %3 to i32
ret i32 %4
}
int picolcd_init_framebuffer(struct picolcd_data *data) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.picolcd_data = type opaque
define i32 @picolcd_init_framebuffer(%struct.picolcd_data* nocapture readnone %0) {
ret i32 0
}
void udelay(int t) {
  volatile int us = 100;
  while (t--) {
    us = 100;
    while (us--)
      ;
  }
}


x86 assembly (clang, -O0):
<udelay>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x64,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x4(%rbp)
cmp    $0x0,%eax
je     1147 <udelay+0x47>
movl   $0x64,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x8(%rbp)
cmp    $0x0,%eax
je     1142 <udelay+0x42>
jmp    1129 <udelay+0x29>
jmp    110e <udelay+0xe>
pop    %rbp
ret

x86 assembly (clang, -O2):
<udelay>:
movl   $0x64,-0x4(%rsp)
test   %edi,%edi
je     115c <udelay+0x5c>
mov    %edi,%eax
test   $0x1,%dil
je     112a <udelay+0x2a>
movl   $0x64,-0x4(%rsp)
nopl   0x0(%rax)
subl   $0x1,-0x4(%rsp)
jae    1120 <udelay+0x20>
lea    -0x1(%rdi),%eax
cmp    $0x1,%edi
je     115c <udelay+0x5c>
nop
movl   $0x64,-0x4(%rsp)
nopl   0x0(%rax,%rax,1)
subl   $0x1,-0x4(%rsp)
jae    1140 <udelay+0x40>
movl   $0x64,-0x4(%rsp)
nop
subl   $0x1,-0x4(%rsp)
jae    1150 <udelay+0x50>
add    $0xfffffffe,%eax
jne    1130 <udelay+0x30>
ret

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

LLVM IR (-O2):
define void @udelay(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
store volatile i32 100, i32* %2
%4 = icmp eq i32 %0, 0
br i1 %4, label %32, label %5
5: ; preds = %1
%6 = and i32 %0, 1
%7 = icmp eq i32 %6, 0
br i1 %7, label %15, label %8
8: ; preds = %5
store volatile i32 100, i32* %2
br label %9
9: ; preds = %9, %8
%10 = load volatile i32, i32* %2
%11 = add nsw i32 %10, -1
store volatile i32 %11, i32* %2
%12 = icmp eq i32 %10, 0
br i1 %12, label %13, label %9
13: ; preds = %9
%14 = add nsw i32 %0, -1
br label %15
15: ; preds = %13, %5
%16 = phi i32 [ %0, %5 ], [ %14, %13 ]
%17 = icmp eq i32 %0, 1
br i1 %17, label %32, label %26
18: ; preds = %28
store volatile i32 100, i32* %2
br label %19
19: ; preds = %19, %18
%20 = load volatile i32, i32* %2
%21 = add nsw i32 %20, -1
store volatile i32 %21, i32* %2
%22 = icmp eq i32 %20, 0
br i1 %22, label %23, label %19
23: ; preds = %19
%24 = add nsw i32 %27, -2
%25 = icmp eq i32 %24, 0
br i1 %25, label %32, label %26
26: ; preds = %15, %23
%27 = phi i32 [ %24, %23 ], [ %16, %15 ]
store volatile i32 100, i32* %2
br label %28
28: ; preds = %28, %26
%29 = load volatile i32, i32* %2
%30 = add nsw i32 %29, -1
store volatile i32 %30, i32* %2
%31 = icmp eq i32 %29, 0
br i1 %31, label %18, label %28
32: ; preds = %15, %23, %1
ret void
}
void marker(void) {
  int a = 0;
  int b = a;
  asm("    .global "
      "set_point"
      "\n"
      "set_point"
      ":\n"
      "    call "
      "func"
      "\n");
  asm("    .global "
      "after_set_point"
      "\n"
      "after_set_point"
      ":\n"
      "    call "
      "func"
      "\n");
}


x86 assembly (clang, -O0):
<marker>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)

x86 assembly (clang, -O2):
<marker>:
call   1030 <func@plt>

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

LLVM IR (-O2):
define void @marker() {
tail call void asm sideeffect " .global set_point\0Aset_point:\0A call func\0A", "~{dirflag},~{fpsr},~{flags}"()
tail call void asm sideeffect " .global after_set_point\0Aafter_set_point:\0A call func\0A", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
int au_br_whable(int brperm) { return brperm & (1 | (1 << 7)); }


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

x86 assembly (clang, -O2):
<au_br_whable>:
mov    %edi,%eax
and    $0x81,%eax
ret

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

LLVM IR (-O2):
define i32 @au_br_whable(i32 %0) {
%2 = and i32 %0, 129
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void imprime_uso() {
  printf("USAGE:\n"
         "tp1 -h\n"
         "tp1 -V\n"
         "tp1 [OPTIONS] file\n"
         "\n"
         "OPTIONS:\n"
         "-h, --help Prints usage information and quit\n"
         "-V, --version Prints version information and quit\n"
         "-i, --input Path to input file (-i - for stdin)\n");
}


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

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

LLVM IR (-O0):
@.str = [194 x i8] c"USAGE:\0Atp1 -h\0Atp1 -V\0Atp1 [OPTIONS] file\0A\0AOPTIONS:\0A-h, --help Prints usage information and quit\0A-V, --version Prints version information and quit\0A-i, --input Path to input file (-i - for stdin)\0A\00"
define void @imprime_uso() {
%1 = call i32 @printf(i8* getelementptr inbounds ([194 x i8], [194 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [193 x i8] c"USAGE:\0Atp1 -h\0Atp1 -V\0Atp1 [OPTIONS] file\0A\0AOPTIONS:\0A-h, --help Prints usage information and quit\0A-V, --version Prints version information and quit\0A-i, --input Path to input file (-i - for stdin)\00"
define void @imprime_uso() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([193 x i8], [193 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void f(bool b) {
  if (b)
    printf("true\n");
  else
    printf("false\n");
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1136 <f+0x26>
lea    0xed4(%rip),%rdi
call   1030 <printf@plt>
jmp    1142 <f+0x32>
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
test   %edi,%edi
lea    0xee7(%rip),%rax
lea    0xee6(%rip),%rdi
cmove  %rax,%rdi
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"true\0A\00"
@.str.1 = [7 x i8] c"false\0A\00"
define void @f(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 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
br label %9
7: ; preds = %1
%8 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
br label %9
9: ; preds = %7, %5
ret void
}

LLVM IR (-O2):
@str = [6 x i8] c"false\00"
@str.2 = [5 x i8] c"true\00"
define void @f(i32 %0) {
%2 = icmp eq i32 %0, 0
%3 = select i1 %2, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @str.2, i64 0, i64 0)
%4 = tail call i32 @puts(i8* dereferenceable(1) %3)
ret void
}
/* Variables and functions */
int check(char *);
int /*<<< orphan*/ printf(char *);
int main(int ac, char **av) {
  int ret;
  if (ac != 2)
    return -1;
  ret = check(av[1]);
  if (ret == 0)
    printf("Win\n");
  else
    printf("fail\n");
  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)
cmpl   $0x2,-0x8(%rbp)
je     114c <main+0x2c>
movl   $0xffffffff,-0x4(%rbp)
jmp    118a <main+0x6a>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1040 <check@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jne    1177 <main+0x57>
lea    0xe93(%rip),%rdi
call   1030 <printf@plt>
jmp    1183 <main+0x63>
lea    0xe87(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
mov    $0xffffffff,%eax
cmp    $0x2,%edi
jne    1153 <main+0x33>
push   %rax
mov    0x8(%rsi),%rdi
call   1040 <check@plt>
test   %eax,%eax
lea    0xec8(%rip),%rax
lea    0xebc(%rip),%rdi
cmove  %rax,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x8,%rsp
ret

LLVM IR (-O0):
@.str = [5 x i8] c"Win\0A\00"
@.str.1 = [6 x i8] c"fail\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = load i32, i32* %4
%8 = icmp ne i32 %7, 2
br i1 %8, label %9, label %10
9: ; preds = %2
store i32 -1, i32* %3
br label %22
10: ; preds = %2
%11 = load i8**, i8*** %5
%12 = getelementptr inbounds i8*, i8** %11, i64 1
%13 = load i8*, i8** %12
%14 = call i32 @check(i8* %13)
store i32 %14, i32* %6
%15 = load i32, i32* %6
%16 = icmp eq i32 %15, 0
br i1 %16, label %17, label %19
17: ; preds = %10
%18 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
br label %21
19: ; preds = %10
%20 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
br label %21
21: ; preds = %19, %17
store i32 0, i32* %3
br label %22
22: ; preds = %21, %9
%23 = load i32, i32* %3
ret i32 %23
}

LLVM IR (-O2):
@str = [5 x i8] c"fail\00"
@str.2 = [4 x i8] c"Win\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 2
br i1 %3, label %4, label %11
4: ; preds = %2
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = tail call i32 @check(i8* %6)
%8 = icmp eq i32 %7, 0
%9 = select i1 %8, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @str.2, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @str, i64 0, i64 0)
%10 = tail call i32 @puts(i8* dereferenceable(1) %9)
br label %11
11: ; preds = %4, %2
%12 = phi i32 [ -1, %2 ], [ 0, %4 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ debug(char *, ...);
int M2_f(char *s) {
  debug("M2_f(const char *s) is not yet implemented!\n");
  debug("%s\n", s);
  return 1;
}


x86 assembly (clang, -O0):
<M2_f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    -0x8(%rbp),%rsi
lea    0xef8(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<M2_f>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rdi
xor    %eax,%eax
call   1030 <debug@plt>
lea    0xf04(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <debug@plt>
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [45 x i8] c"M2_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @M2_f(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %4)
ret i32 1
}

LLVM IR (-O2):
@.str = [45 x i8] c"M2_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @M2_f(i8* %0) {
%2 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ wdctl_command(int);
void wdctl_del_trusted_iplist(void) { wdctl_command(25); }


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

x86 assembly (clang, -O2):
<wdctl_del_trusted_iplist>:
mov    $0x19,%edi
jmp    1030 <wdctl_command@plt>

LLVM IR (-O0):
define void @wdctl_del_trusted_iplist() {
%1 = call i32 @wdctl_command(i32 25)
ret void
}

LLVM IR (-O2):
define void @wdctl_del_trusted_iplist() {
%1 = tail call i32 @wdctl_command(i32 25)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, int, int /*<<< orphan*/, int /*<<< orphan*/);
void version() {
  printf("'ga_reads_summit_all' in genome analysis tools version: %d.%d.%d\n",
         1, 0, 0);
  exit(0);
}


x86 assembly (clang, -O0):
<version>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
mov    $0x1,%esi
xor    %ecx,%ecx
mov    %ecx,%edx
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<version>:
push   %rax
lea    0xed8(%rip),%rdi
mov    $0x1,%esi
xor    %edx,%edx
xor    %ecx,%ecx
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [66 x i8] c"'ga_reads_summit_all' in genome analysis tools version: %d.%d.%d\0A\00"
define void @version() {
%1 = call i32 @printf(i8* getelementptr inbounds ([66 x i8], [66 x i8]* @.str, i64 0, i64 0), i32 1, i32 0, i32 0)
%2 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [66 x i8] c"'ga_reads_summit_all' in genome analysis tools version: %d.%d.%d\0A\00"
define void @version() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([66 x i8], [66 x i8]* @.str, i64 0, i64 0), i32 1, i32 0, i32 0)
%2 = tail call i32 @exit(i32 0)
unreachable
}
/* Type definitions */
typedef scalar_t__ clock_t;

/* Variables and functions */
double CLOCKS_PER_SEC;
scalar_t__ clock();
int /*<<< orphan*/ printf(char *, double);
int main() {
  int num;
  clock_t start_stamp, end_stamp;
  start_stamp = clock();
  for (int i = 0; i < 10000000; i++)
    num = 1;
  end_stamp = clock();
  printf("%lf", (double)(end_stamp - start_stamp) / CLOCKS_PER_SEC);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <clock@plt>
mov    %rax,-0x10(%rbp)
movl   $0x0,-0x1c(%rbp)
cmpl   $0x989680,-0x1c(%rbp)
jge    1163 <main+0x43>
movl   $0x1,-0x8(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1141 <main+0x21>
mov    $0x0,%al
call   1030 <clock@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
sub    -0x10(%rbp),%rax
cvtsi2sd %rax,%xmm0
mov    0x2e66(%rip),%rax
divsd  (%rax),%xmm0
lea    0xe73(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1030 <clock@plt>
mov    %rax,%rbx
xor    %eax,%eax
call   1030 <clock@plt>
sub    %rbx,%rax
cvtsi2sd %rax,%xmm0
mov    0x2ea7(%rip),%rax
divsd  (%rax),%xmm0
lea    0xeb4(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%lf\00"
@CLOCKS_PER_SEC = global double 0.000000e+00
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i64
%4 = alloca i64
%5 = alloca i32
store i32 0, i32* %1
%6 = call i64 (...) @clock()
store i64 %6, i64* %3
store i32 0, i32* %5
br label %7
7: ; preds = %11, %0
%8 = load i32, i32* %5
%9 = icmp slt i32 %8, 10000000
br i1 %9, label %10, label %14
10: ; preds = %7
store i32 1, i32* %2
br label %11
11: ; preds = %10
%12 = load i32, i32* %5
%13 = add nsw i32 %12, 1
store i32 %13, i32* %5
br label %7
14: ; preds = %7
%15 = call i64 (...) @clock()
store i64 %15, i64* %4
%16 = load i64, i64* %4
%17 = load i64, i64* %3
%18 = sub nsw i64 %16, %17
%19 = sitofp i64 %18 to double
%20 = load double, double* @CLOCKS_PER_SEC
%21 = fdiv double %19, %20
%22 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double %21)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%lf\00"
@CLOCKS_PER_SEC = global double 0.000000e+00
define i32 @main() {
%1 = tail call i64 (...) @clock()
%2 = tail call i64 (...) @clock()
%3 = sub nsw i64 %2, %1
%4 = sitofp i64 %3 to double
%5 = load double, double* @CLOCKS_PER_SEC
%6 = fdiv double %4, %5
%7 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double %6)
ret i32 0
}
/* Variables and functions */
scalar_t__ ajMemFree(void **);
void tableDel(void **Pkey, void **Pvalue, void *cl) {
  ((void)(ajMemFree((void **)&*Pkey)));
  ((void)(ajMemFree((void **)&*Pvalue)));
  (void)cl;
  return;
}


x86 assembly (clang, -O0):
<tableDel>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <ajMemFree@plt>
mov    -0x10(%rbp),%rdi
call   1030 <ajMemFree@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tableDel>:
push   %rbx
mov    %rsi,%rbx
call   1030 <ajMemFree@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <ajMemFree@plt>

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

LLVM IR (-O2):
define void @tableDel(i8** %0, i8** %1, i8* nocapture readnone %2) {
%4 = tail call i64 @ajMemFree(i8** %0)
%5 = tail call i64 @ajMemFree(i8** %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ WsRelease();
int /*<<< orphan*/ WsSaveEeprom();
void WsDeInit(void) {
  WsSaveEeprom();
  WsRelease();
}


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

x86 assembly (clang, -O2):
<WsDeInit>:
push   %rax
xor    %eax,%eax
call   1040 <WsSaveEeprom@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <WsRelease@plt>

LLVM IR (-O0):
define void @WsDeInit() {
%1 = call i32 (...) @WsSaveEeprom()
%2 = call i32 (...) @WsRelease()
ret void
}

LLVM IR (-O2):
define void @WsDeInit() {
%1 = tail call i32 (...) @WsSaveEeprom()
%2 = tail call i32 (...) @WsRelease()
ret void
}
int c2dir(char c) {
  switch (c) {
  case 'w':
  case 'k':
  case 'A':
    return 0;
  case 's':
  case 'j':
  case 'B':
    return 1;
  case 'd':
  case 'l':
  case 'C':
    return 2;
  case 'a':
  case 'h':
  case 'D':
    return 3;
  default:
    return -1;
  }
}


x86 assembly (clang, -O0):
<c2dir>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
add    $0xffffffbf,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0x36,%eax
ja     1164 <c2dir+0x64>
mov    -0x10(%rbp),%rax
lea    0xed5(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movl   $0x0,-0x4(%rbp)
jmp    116b <c2dir+0x6b>
movl   $0x1,-0x4(%rbp)
jmp    116b <c2dir+0x6b>
movl   $0x2,-0x4(%rbp)
jmp    116b <c2dir+0x6b>
movl   $0x3,-0x4(%rbp)
jmp    116b <c2dir+0x6b>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<c2dir>:
add    $0xffffffbf,%edi
cmp    $0x36,%edi
ja     112c <c2dir+0x2c>
xor    %eax,%eax
lea    0xeef(%rip),%rcx
movslq (%rcx,%rdi,4),%rdx
add    %rcx,%rdx
jmp    *%rdx
mov    $0x1,%eax
ret
mov    $0x2,%eax
ret
mov    $0x3,%eax
ret
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
define i32 @c2dir(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
switch i32 %5, label %10 [
i32 119, label %6
i32 107, label %6
i32 65, label %6
i32 115, label %7
i32 106, label %7
i32 66, label %7
i32 100, label %8
i32 108, label %8
i32 67, label %8
i32 97, label %9
i32 104, label %9
i32 68, label %9
]
6: ; preds = %1, %1, %1
store i32 0, i32* %2
br label %11
7: ; preds = %1, %1, %1
store i32 1, i32* %2
br label %11
8: ; preds = %1, %1, %1
store i32 2, i32* %2
br label %11
9: ; preds = %1, %1, %1
store i32 3, i32* %2
br label %11
10: ; preds = %1
store i32 -1, i32* %2
br label %11
11: ; preds = %10, %9, %8, %7, %6
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
define i32 @c2dir(i8 signext %0) {
%2 = sext i8 %0 to i32
switch i32 %2, label %6 [
i32 119, label %7
i32 107, label %7
i32 65, label %7
i32 115, label %3
i32 106, label %3
i32 66, label %3
i32 100, label %4
i32 108, label %4
i32 67, label %4
i32 97, label %5
i32 104, label %5
i32 68, label %5
]
3: ; preds = %1, %1, %1
br label %7
4: ; preds = %1, %1, %1
br label %7
5: ; preds = %1, %1, %1
br label %7
6: ; preds = %1
br label %7
7: ; preds = %1, %1, %1, %6, %5, %4, %3
%8 = phi i32 [ -1, %6 ], [ 3, %5 ], [ 2, %4 ], [ 1, %3 ], [ 0, %1 ], [ 0, %1 ], [ 0, %1 ]
ret i32 %8
}
/* Type definitions */
struct APDSTATE {
  int dummy;
};

/* Variables and functions */
unsigned int aP_getbit(struct APDSTATE *);
unsigned int aP_getgamma(struct APDSTATE *ud) {
  unsigned int result = 1;
  do {
    result = (result << 1) + aP_getbit(ud);
  } while (aP_getbit(ud));
  return result;
}


x86 assembly (clang, -O0):
<aP_getgamma>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
mov    -0xc(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <aP_getbit@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <aP_getbit@plt>
cmp    $0x0,%eax
jne    1123 <aP_getgamma+0x13>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<aP_getgamma>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    $0x1,%ebx
nopl   0x0(%rax)
mov    %r14,%rdi
call   1030 <aP_getbit@plt>
lea    (%rax,%rbx,2),%ebx
mov    %r14,%rdi
call   1030 <aP_getbit@plt>
test   %eax,%eax
jne    1120 <aP_getgamma+0x10>
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.APDSTATE = type { i32 }
define i32 @aP_getgamma(%struct.APDSTATE* %0) {
%2 = alloca %struct.APDSTATE*
%3 = alloca i32
store %struct.APDSTATE* %0, %struct.APDSTATE** %2
store i32 1, i32* %3
br label %4
4: ; preds = %10, %1
%5 = load i32, i32* %3
%6 = shl i32 %5, 1
%7 = load %struct.APDSTATE*, %struct.APDSTATE** %2
%8 = call i32 @aP_getbit(%struct.APDSTATE* %7)
%9 = add i32 %6, %8
store i32 %9, i32* %3
br label %10
10: ; preds = %4
%11 = load %struct.APDSTATE*, %struct.APDSTATE** %2
%12 = call i32 @aP_getbit(%struct.APDSTATE* %11)
%13 = icmp ne i32 %12, 0
br i1 %13, label %4, label %14
14: ; preds = %10
%15 = load i32, i32* %3
ret i32 %15
}

LLVM IR (-O2):
%struct.APDSTATE = type { i32 }
define i32 @aP_getgamma(%struct.APDSTATE* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i32 [ 1, %1 ], [ %6, %2 ]
%4 = shl i32 %3, 1
%5 = tail call i32 @aP_getbit(%struct.APDSTATE* %0)
%6 = add i32 %4, %5
%7 = tail call i32 @aP_getbit(%struct.APDSTATE* %0)
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %2
9: ; preds = %2
ret i32 %6
}
void foo374(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo374(i32 %0) {
ret void
}
int comparator(const void *n1, const void *n2) {
  int l = *((int *)n1), r = *((int *)n2);
  return l > r ? 1 : l < r ? -1 : 0;
}


x86 assembly (clang, -O0):
<comparator>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x18(%rbp),%eax
jle    1137 <comparator+0x37>
mov    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    114c <comparator+0x4c>
mov    -0x14(%rbp),%edx
mov    -0x18(%rbp),%esi
xor    %eax,%eax
mov    $0xffffffff,%ecx
cmp    %esi,%edx
cmovl  %ecx,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<comparator>:
mov    (%rdi),%eax
mov    (%rsi),%ecx
xor    %edx,%edx
cmp    %ecx,%eax
setl   %dl
neg    %edx
cmp    %ecx,%eax
mov    $0x1,%eax
cmovle %edx,%eax
ret

LLVM IR (-O0):
define i32 @comparator(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = bitcast i8* %7 to i32*
%9 = load i32, i32* %8
store i32 %9, i32* %5
%10 = load i8*, i8** %4
%11 = bitcast i8* %10 to i32*
%12 = load i32, i32* %11
store i32 %12, i32* %6
%13 = load i32, i32* %5
%14 = load i32, i32* %6
%15 = icmp sgt i32 %13, %14
br i1 %15, label %16, label %17
16: ; preds = %2
br label %23
17: ; preds = %2
%18 = load i32, i32* %5
%19 = load i32, i32* %6
%20 = icmp slt i32 %18, %19
%21 = zext i1 %20 to i64
%22 = select i1 %20, i32 -1, i32 0
br label %23
23: ; preds = %17, %16
%24 = phi i32 [ 1, %16 ], [ %22, %17 ]
ret i32 %24
}

LLVM IR (-O2):
define i32 @comparator(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = icmp sgt i32 %4, %6
%8 = icmp slt i32 %4, %6
%9 = sext i1 %8 to i32
%10 = select i1 %7, i32 1, i32 %9
ret i32 %10
}
/* Variables and functions */
int branch_opcode(unsigned int);
int instr_is_branch_bform(unsigned int instr) {
  return branch_opcode(instr) == 16;
}


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

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

LLVM IR (-O0):
define i32 @instr_is_branch_bform(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @branch_opcode(i32 %3)
%5 = icmp eq i32 %4, 16
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @instr_is_branch_bform(i32 %0) {
%2 = tail call i32 @branch_opcode(i32 %0)
%3 = icmp eq i32 %2, 16
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
scalar_t__ strchr(char *, char);
int is_tc(char c) {
  if (c >= 32 && c <= 126) {
    return 1;
  } else if (c && strchr("\t\n\r", c)) {
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<is_tc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x20,%eax
jl     1144 <is_tc+0x34>
movsbl -0x5(%rbp),%eax
cmp    $0x7e,%eax
jg     1144 <is_tc+0x34>
movl   $0x1,-0x4(%rbp)
jmp    1183 <is_tc+0x73>
movsbl -0x5(%rbp),%eax
cmp    $0x0,%eax
je     1177 <is_tc+0x67>
lea    0xea8(%rip),%rdi
movsbl -0x5(%rbp),%esi
call   1030 <strchr@plt>
cmp    $0x0,%rax
je     1177 <is_tc+0x67>
movl   $0x1,-0x4(%rbp)
jmp    1183 <is_tc+0x73>
jmp    117c <is_tc+0x6c>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_tc>:
push   %rbx
lea    -0x20(%rdi),%eax
mov    $0x1,%ebx
cmp    $0x5f,%al
jb     1139 <is_tc+0x29>
test   %dil,%dil
je     1137 <is_tc+0x27>
movsbl %dil,%esi
lea    0xed3(%rip),%rdi
call   1030 <strchr@plt>
test   %rax,%rax
jne    1139 <is_tc+0x29>
xor    %ebx,%ebx
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"\09\0A\0D\00"
define i32 @is_tc(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = icmp sge i32 %5, 32
br i1 %6, label %7, label %12
7: ; preds = %1
%8 = load i8, i8* %3
%9 = sext i8 %8 to i32
%10 = icmp sle i32 %9, 126
br i1 %10, label %11, label %12
11: ; preds = %7
store i32 1, i32* %2
br label %23
12: ; preds = %7, %1
%13 = load i8, i8* %3
%14 = sext i8 %13 to i32
%15 = icmp ne i32 %14, 0
br i1 %15, label %16, label %21
16: ; preds = %12
%17 = load i8, i8* %3
%18 = call i64 @strchr(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8 signext %17)
%19 = icmp ne i64 %18, 0
br i1 %19, label %20, label %21
20: ; preds = %16
store i32 1, i32* %2
br label %23
21: ; preds = %16, %12
br label %22
22: ; preds = %21
store i32 0, i32* %2
br label %23
23: ; preds = %22, %20, %11
%24 = load i32, i32* %2
ret i32 %24
}

LLVM IR (-O2):
@.str = [4 x i8] c"\09\0A\0D\00"
define i32 @is_tc(i8 signext %0) {
%2 = add i8 %0, -32
%3 = icmp ult i8 %2, 95
br i1 %3, label %10, label %4
4: ; preds = %1
%5 = icmp eq i8 %0, 0
br i1 %5, label %9, label %6
6: ; preds = %4
%7 = tail call i64 @strchr(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8 signext %0)
%8 = icmp eq i64 %7, 0
br i1 %8, label %9, label %10
9: ; preds = %4, %6
br label %10
10: ; preds = %6, %1, %9
%11 = phi i32 [ 0, %9 ], [ 1, %1 ], [ 1, %6 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ gen(char *);
int /*<<< orphan*/ genlab(int);
int label();
int /*<<< orphan*/ lgen(char *, char *, int);
void cgbr(char *how, int n) {
  int lab = label();
  gen("orl\t%eax,%eax");
  lgen("%s\t%c%d", how, lab);
  lgen("%s\t%c%d", "jmp", n);
  genlab(lab);
}


x86 assembly (clang, -O0):
<cgbr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    $0x0,%al
call   1040 <label@plt>
mov    %eax,-0x10(%rbp)
lea    0xea0(%rip),%rdi
call   1060 <gen@plt>
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%edx
lea    0xe9b(%rip),%rdi
call   1030 <lgen@plt>
mov    -0xc(%rbp),%edx
lea    0xe8c(%rip),%rdi
lea    0xe8d(%rip),%rsi
call   1030 <lgen@plt>
mov    -0x10(%rbp),%edi
call   1050 <genlab@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cgbr>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %esi,%r14d
mov    %rdi,%rbx
xor    %eax,%eax
call   1040 <label@plt>
mov    %eax,%ebp
lea    0xea3(%rip),%rdi
call   1060 <gen@plt>
lea    0xea5(%rip),%r15
mov    %r15,%rdi
mov    %rbx,%rsi
mov    %ebp,%edx
call   1030 <lgen@plt>
lea    0xe99(%rip),%rsi
mov    %r15,%rdi
mov    %r14d,%edx
call   1030 <lgen@plt>
mov    %ebp,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1050 <genlab@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"orl\09%eax,%eax\00"
@.str.1 = [8 x i8] c"%s\09%c%d\00"
@.str.2 = [4 x i8] c"jmp\00"
define void @cgbr(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = call i32 (...) @label()
store i32 %6, i32* %5
%7 = call i32 @gen(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%8 = load i8*, i8** %3
%9 = load i32, i32* %5
%10 = call i32 @lgen(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* %8, i32 %9)
%11 = load i32, i32* %4
%12 = call i32 @lgen(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %11)
%13 = load i32, i32* %5
%14 = call i32 @genlab(i32 %13)
ret void
}

LLVM IR (-O2):
@.str = [14 x i8] c"orl\09%eax,%eax\00"
@.str.1 = [8 x i8] c"%s\09%c%d\00"
@.str.2 = [4 x i8] c"jmp\00"
define void @cgbr(i8* %0, i32 %1) {
%3 = tail call i32 (...) @label()
%4 = tail call i32 @gen(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%5 = tail call i32 @lgen(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* %0, i32 %3)
%6 = tail call i32 @lgen(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %1)
%7 = tail call i32 @genlab(i32 %3)
ret void
}
int defined_twice_b(void) { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @defined_twice_b() {
ret i32 1
}
/* Variables and functions */
scalar_t__ GLeeInit();
int /*<<< orphan*/ pglEndTransformFeedbackEXT();
void _Lazy_glEndTransformFeedbackEXT(void) {
  if (GLeeInit())
    pglEndTransformFeedbackEXT();
}


x86 assembly (clang, -O0):
<_Lazy_glEndTransformFeedbackEXT>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <GLeeInit@plt>
cmp    $0x0,%rax
je     113c <_Lazy_glEndTransformFeedbackEXT+0x1c>
mov    $0x0,%al
call   1030 <pglEndTransformFeedbackEXT@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<_Lazy_glEndTransformFeedbackEXT>:
push   %rax
xor    %eax,%eax
call   1040 <GLeeInit@plt>
test   %rax,%rax
je     1135 <_Lazy_glEndTransformFeedbackEXT+0x15>
xor    %eax,%eax
pop    %rcx
jmp    1030 <pglEndTransformFeedbackEXT@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @_Lazy_glEndTransformFeedbackEXT() {
%1 = call i64 (...) @GLeeInit()
%2 = icmp ne i64 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = call i32 (...) @pglEndTransformFeedbackEXT()
br label %5
5: ; preds = %3, %0
ret void
}

LLVM IR (-O2):
define void @_Lazy_glEndTransformFeedbackEXT() {
%1 = tail call i64 (...) @GLeeInit()
%2 = icmp eq i64 %1, 0
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 (...) @pglEndTransformFeedbackEXT()
br label %5
5: ; preds = %3, %0
ret void
}