xunge/DecIR huggingface dataset:
/* Type definitions */
struct flashrom_flashctx {
  int dummy;
};

/* Variables and functions */
int printlock_regspace2_uniform_64k(struct flashrom_flashctx *);
int printlock_w39v040a(struct flashrom_flashctx *);
int printlock_w39v040fa(struct flashrom_flashctx *flash) {
  int ret = 0;
  ret = printlock_w39v040a(flash);
  ret |= printlock_regspace2_uniform_64k(flash);
  return ret;
}


x86 assembly (clang, -O0):
<printlock_w39v040fa>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <printlock_w39v040a@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <printlock_regspace2_uniform_64k@plt>
or     -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printlock_w39v040fa>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1030 <printlock_w39v040a@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1040 <printlock_regspace2_uniform_64k@plt>
or     %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
%struct.flashrom_flashctx = type { i32 }
define i32 @printlock_w39v040fa(%struct.flashrom_flashctx* %0) {
%2 = alloca %struct.flashrom_flashctx*
%3 = alloca i32
store %struct.flashrom_flashctx* %0, %struct.flashrom_flashctx** %2
store i32 0, i32* %3
%4 = load %struct.flashrom_flashctx*, %struct.flashrom_flashctx** %2
%5 = call i32 @printlock_w39v040a(%struct.flashrom_flashctx* %4)
store i32 %5, i32* %3
%6 = load %struct.flashrom_flashctx*, %struct.flashrom_flashctx** %2
%7 = call i32 @printlock_regspace2_uniform_64k(%struct.flashrom_flashctx* %6)
%8 = load i32, i32* %3
%9 = or i32 %8, %7
store i32 %9, i32* %3
%10 = load i32, i32* %3
ret i32 %10
}

LLVM IR (-O2):
%struct.flashrom_flashctx = type { i32 }
define i32 @printlock_w39v040fa(%struct.flashrom_flashctx* %0) {
%2 = tail call i32 @printlock_w39v040a(%struct.flashrom_flashctx* %0)
%3 = tail call i32 @printlock_regspace2_uniform_64k(%struct.flashrom_flashctx* %0)
%4 = or i32 %3, %2
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("hello A");
  printf("\n");
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [8 x i8] c"hello A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @putchar(i32 10)
ret i32 0
}
void init_crypto_locks(void) {}


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

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

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

LLVM IR (-O2):
define void @init_crypto_locks() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ lreset();
int /*<<< orphan*/ lua_error(char *);
void lstop(void) {
  lreset();
  lua_error("interrupted!");
}


x86 assembly (clang, -O0):
<lstop>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <lreset@plt>
lea    0xece(%rip),%rdi
call   1030 <lua_error@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<lstop>:
push   %rax
xor    %eax,%eax
call   1040 <lreset@plt>
lea    0xed1(%rip),%rdi
pop    %rax
jmp    1030 <lua_error@plt>

LLVM IR (-O0):
@.str = [13 x i8] c"interrupted!\00"
define void @lstop() {
%1 = call i32 (...) @lreset()
%2 = call i32 @lua_error(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c"interrupted!\00"
define void @lstop() {
%1 = tail call i32 (...) @lreset()
%2 = tail call i32 @lua_error(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
float getRate(char);
float parkingCharge(char type, float hrs) { return hrs * getRate(type); }


x86 assembly (clang, -O0):
<parkingCharge>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
movsbl -0x1(%rbp),%edi
call   1030 <getRate@plt>
movaps %xmm0,%xmm1
movss  -0xc(%rbp),%xmm0
mulss  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parkingCharge>:
push   %rax
movss  %xmm0,0x4(%rsp)
call   1030 <getRate@plt>
mulss  0x4(%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @parkingCharge(i8 signext %0, float %1) {
%3 = alloca i8
%4 = alloca float
store i8 %0, i8* %3
store float %1, float* %4
%5 = load float, float* %4
%6 = load i8, i8* %3
%7 = call float @getRate(i8 signext %6)
%8 = fmul float %5, %7
ret float %8
}

LLVM IR (-O2):
define float @parkingCharge(i8 signext %0, float %1) {
%3 = tail call float @getRate(i8 signext %0)
%4 = fmul float %3, %1
ret float %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, unsigned long long);
int /*<<< orphan*/ sscanf(char *, char *, unsigned long long *);
main() {
  unsigned long long val;
  char test[100] = "12312323234234224398";
  sscanf(test, "%llu", &val);
  printf("%llu\n", val);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
lea    -0x70(%rbp),%rdi
lea    0xebd(%rip),%rsi
mov    $0x64,%edx
call   1040 <memcpy@plt>
lea    -0x70(%rbp),%rdi
lea    0xf0c(%rip),%rsi
lea    -0x8(%rbp),%rdx
call   1050 <sscanf@plt>
mov    -0x8(%rbp),%rsi
lea    0xefd(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x78,%rsp
movaps 0xf25(%rip),%xmm0
movaps %xmm0,0x60(%rsp)
movaps 0xf09(%rip),%xmm0
movaps %xmm0,0x50(%rsp)
movaps 0xeed(%rip),%xmm0
movaps %xmm0,0x40(%rsp)
movaps 0xed1(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
movaps 0xeb5(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xe99(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movl   $0x0,0x70(%rsp)
lea    0xee9(%rip),%rsi
lea    0x10(%rsp),%rdi
lea    0x8(%rsp),%rdx
call   1040 <sscanf@plt>
mov    0x8(%rsp),%rsi
lea    0xed3(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x78,%rsp
ret

LLVM IR (-O0):
@__const.main.test = [100 x i8] c"12312323234234224398\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00"
@.str = [5 x i8] c"%llu\00"
@.str.1 = [6 x i8] c"%llu\0A\00"
define i32 @main() {
%1 = alloca i64
%2 = alloca [100 x i8]
%3 = bitcast [100 x i8]* %2 to i8*
%4 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%5 = call i32 @sscanf(i8* %4, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64* %1)
%6 = load i64, i64* %1
%7 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i64 %6)
ret i32 0
}

LLVM IR (-O2):
@__const.main.test = [100 x i8] c"12312323234234224398\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00"
@.str = [5 x i8] c"%llu\00"
@.str.1 = [6 x i8] c"%llu\0A\00"
define i32 @main() {
%1 = alloca i64
%2 = alloca [100 x i8]
%3 = bitcast i64* %1 to i8*
%4 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%5 = call i32 @sscanf(i8* %4, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64* %1)
%6 = load i64, i64* %1
%7 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i64 %6)
ret i32 0
}
/* Variables and functions */
size_t CHAR_BIT;
size_t bytesizeFromBitLen(size_t bitlen) {
  size_t bytesiz = (1 + (bitlen) / CHAR_BIT);
  bytesiz = (3 + bytesiz) & ~3;
  return bytesiz;
}


x86 assembly (clang, -O0):
<bytesizeFromBitLen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x2ecd(%rip),%rcx
xor    %edx,%edx
divq   (%rcx)
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x3,%rax
and    $0xfffffffffffffffc,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bytesizeFromBitLen>:
mov    %rdi,%rax
mov    0x2ed6(%rip),%rcx
mov    (%rcx),%rcx
mov    %rdi,%rdx
or     %rcx,%rdx
shr    $0x20,%rdx
je     1120 <bytesizeFromBitLen+0x20>
xor    %edx,%edx
div    %rcx
jmp    1124 <bytesizeFromBitLen+0x24>
xor    %edx,%edx
div    %ecx
add    $0x4,%rax
and    $0xfffffffffffffffc,%rax
ret

LLVM IR (-O0):
@CHAR_BIT = global i64 0
define i64 @bytesizeFromBitLen(i64 %0) {
%2 = alloca i64
%3 = alloca i64
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = load i64, i64* @CHAR_BIT
%6 = udiv i64 %4, %5
%7 = add i64 1, %6
store i64 %7, i64* %3
%8 = load i64, i64* %3
%9 = add i64 3, %8
%10 = and i64 %9, -4
store i64 %10, i64* %3
%11 = load i64, i64* %3
ret i64 %11
}

LLVM IR (-O2):
@CHAR_BIT = global i64 0
define i64 @bytesizeFromBitLen(i64 %0) {
%2 = load i64, i64* @CHAR_BIT
%3 = udiv i64 %0, %2
%4 = add i64 %3, 4
%5 = and i64 %4, -4
ret i64 %5
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage() {
  fprintf(stderr, "usage: wrap_read_gpio GPIO_PIN\n"
                  "\tGPIO_PIN = 32 to 37,and 39\n"
                  "\nThese ports are present on the LPC connector.\n"
                  "Read the WRAP board manual for details.\n");
  exit(0);
}


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>
xor    %edi,%edi
call   1040 <exit@plt>

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [147 x i8] c"usage: wrap_read_gpio GPIO_PIN\0A\09GPIO_PIN = 32 to 37,and 39\0A\0AThese ports are present on the LPC connector.\0ARead the WRAP board manual for details.\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([147 x i8], [147 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [147 x i8] c"usage: wrap_read_gpio GPIO_PIN\0A\09GPIO_PIN = 32 to 37,and 39\0A\0AThese ports are present on the LPC connector.\0ARead the WRAP board manual for details.\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([147 x i8], [147 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 0)
unreachable
}
unsigned int bitcount(unsigned long a) {
  unsigned int i = 0;
  for (; a != 0; a >>= 1)
    if (a & 1)
      i++;
  return i;
}


x86 assembly (clang, -O0):
<bitcount>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     114b <bitcount+0x4b>
mov    -0x8(%rbp),%rax
and    $0x1,%rax
cmp    $0x0,%rax
je     1135 <bitcount+0x35>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    113a <bitcount+0x3a>
mov    -0x8(%rbp),%rax
shr    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    110f <bitcount+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bitcount>:
xor    %eax,%eax
test   %rdi,%rdi
je     1123 <bitcount+0x23>
mov    %rdi,%rcx
nopw   0x0(%rax,%rax,1)
mov    %edi,%edx
and    $0x1,%edx
add    %edx,%eax
shr    %rcx
cmp    $0x1,%rdi
mov    %rcx,%rdi
ja     1110 <bitcount+0x10>
ret

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

LLVM IR (-O2):
define i32 @bitcount(i64 %0) {
%2 = icmp eq i64 %0, 0
br i1 %2, label %11, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %8, %3 ], [ 0, %1 ]
%5 = phi i64 [ %9, %3 ], [ %0, %1 ]
%6 = trunc i64 %5 to i32
%7 = and i32 %6, 1
%8 = add i32 %7, %4
%9 = lshr i64 %5, 1
%10 = icmp ult i64 %5, 2
br i1 %10, label %11, label %3
11: ; preds = %3, %1
%12 = phi i32 [ 0, %1 ], [ %8, %3 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ quick(int *, int *, int /*<<< orphan*/, int);
int *quickSort(int *array, int *map, int num) {
  quick(array, map, 0, num - 1);
  return array;
}


x86 assembly (clang, -O0):
<quickSort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%ecx
sub    $0x1,%ecx
xor    %edx,%edx
call   1030 <quick@plt>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<quickSort>:
push   %rbx
mov    %rdi,%rbx
lea    -0x1(%rdx),%ecx
xor    %edx,%edx
call   1030 <quick@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32* @quickSort(i32* returned %0, i32* %1, i32 %2) {
%4 = add nsw i32 %2, -1
%5 = tail call i32 @quick(i32* %0, i32* %1, i32 0, i32 %4)
ret i32* %0
}
int vc0321_init(struct usb_spca50x *spca50x) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.usb_spca50x = type opaque
define i32 @vc0321_init(%struct.usb_spca50x* nocapture readnone %0) {
ret i32 0
}
int test_imm_C6int64_highword_mem(long long *val) {
  return ((*val >> 32) & (0xC6 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_C6int64_highword_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdx
sar    $0x20,%rdx
and    $0xc6,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test_imm_C6int64_highword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = ashr i64 %4, 32
%6 = and i64 %5, 198
%7 = icmp ne i64 %6, 0
%8 = zext i1 %7 to i64
%9 = select i1 %7, i32 -20, i32 -40
ret i32 %9
}

LLVM IR (-O2):
define i32 @test_imm_C6int64_highword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 850403524608
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
void rmblank(char *str) {
  if (!str)
    return;
  char *f = str;
  char *r = str;
  while ((*f = *r++, (*f) == ' ' ? *f : *f++) != '\0')
    ;
}


x86 assembly (clang, -O0):
<rmblank>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1118 <rmblank+0x18>
jmp    1184 <rmblank+0x84>
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x18(%rbp)
mov    (%rax),%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x20,%eax
jne    115e <rmblank+0x5e>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
mov    %eax,-0x1c(%rbp)
jmp    1173 <rmblank+0x73>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movsbl (%rax),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    $0x0,%eax
je     1184 <rmblank+0x84>
jmp    1128 <rmblank+0x28>
pop    %rbp
ret

x86 assembly (clang, -O2):
<rmblank>:
test   %rdi,%rdi
je     1128 <rmblank+0x28>
mov    %rdi,%rax
nopl   0x0(%rax,%rax,1)
movzbl (%rax),%ecx
add    $0x1,%rax
mov    %cl,(%rdi)
xor    %edx,%edx
cmp    $0x20,%cl
setne  %dl
add    %rdx,%rdi
test   %cl,%cl
jne    1110 <rmblank+0x10>
ret

LLVM IR (-O0):
define void @rmblank(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = icmp ne i8* %5, null
br i1 %6, label %8, label %7
7: ; preds = %1
br label %33
8: ; preds = %1
%9 = load i8*, i8** %2
store i8* %9, i8** %3
%10 = load i8*, i8** %2
store i8* %10, i8** %4
br label %11
11: ; preds = %32, %8
%12 = load i8*, i8** %4
%13 = getelementptr inbounds i8, i8* %12, i32 1
store i8* %13, i8** %4
%14 = load i8, i8* %12
%15 = load i8*, i8** %3
store i8 %14, i8* %15
%16 = load i8*, i8** %3
%17 = load i8, i8* %16
%18 = sext i8 %17 to i32
%19 = icmp eq i32 %18, 32
br i1 %19, label %20, label %24
20: ; preds = %11
%21 = load i8*, i8** %3
%22 = load i8, i8* %21
%23 = sext i8 %22 to i32
br label %29
24: ; preds = %11
%25 = load i8*, i8** %3
%26 = getelementptr inbounds i8, i8* %25, i32 1
store i8* %26, i8** %3
%27 = load i8, i8* %25
%28 = sext i8 %27 to i32
br label %29
29: ; preds = %24, %20
%30 = phi i32 [ %23, %20 ], [ %28, %24 ]
%31 = icmp ne i32 %30, 0
br i1 %31, label %32, label %33
32: ; preds = %29
br label %11
33: ; preds = %7, %29
ret void
}

LLVM IR (-O2):
define void @rmblank(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %12, label %3
3: ; preds = %1, %3
%4 = phi i8* [ %10, %3 ], [ %0, %1 ]
%5 = phi i8* [ %6, %3 ], [ %0, %1 ]
%6 = getelementptr inbounds i8, i8* %5, i64 1
%7 = load i8, i8* %5
store i8 %7, i8* %4
%8 = icmp ne i8 %7, 32
%9 = zext i1 %8 to i64
%10 = getelementptr i8, i8* %4, i64 %9
%11 = icmp eq i8 %7, 0
br i1 %11, label %12, label %3
12: ; preds = %3, %1
ret void
}
int area_of_square(int *var1) {
  int area_square;
  area_square = (*var1) * (*var1);
  return (area_square);
}


x86 assembly (clang, -O0):
<area_of_square>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    -0x8(%rbp),%rcx
imul   (%rcx),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<area_of_square>:
mov    (%rdi),%eax
imul   %eax,%eax
ret

LLVM IR (-O0):
define i32 @area_of_square(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = load i32, i32* %4
%6 = load i32*, i32** %2
%7 = load i32, i32* %6
%8 = mul nsw i32 %5, %7
store i32 %8, i32* %3
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
define i32 @area_of_square(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = mul nsw i32 %2, %2
ret i32 %3
}
int MediaSetFrameRate(int streamid, int value) {
  int retVal = 0;
  return retVal;
}


x86 assembly (clang, -O0):
<MediaSetFrameRate>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @MediaSetFrameRate(i32 %0, i32 %1) {
ret i32 0
}
/* Type definitions */
struct tm {
  int dummy;
};

/* Variables and functions */
size_t strftime(char *, size_t, char const *, struct tm const *);
__attribute__((__weak__, __always___)) size_t
softboundmpx_strftime(char *s, size_t max, const char *format,
                      const struct tm *tm) {
  return strftime(s, max, format, tm);
}


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

x86 assembly (clang, -O2):
<softboundmpx_strftime>:
jmp    1030 <strftime@plt>

LLVM IR (-O0):
%struct.tm = type { i32 }
define weak i64 @softboundmpx_strftime(i8* %0, i64 %1, i8* %2, %struct.tm* %3) {
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i8*
%8 = alloca %struct.tm*
store i8* %0, i8** %5
store i64 %1, i64* %6
store i8* %2, i8** %7
store %struct.tm* %3, %struct.tm** %8
%9 = load i8*, i8** %5
%10 = load i64, i64* %6
%11 = load i8*, i8** %7
%12 = load %struct.tm*, %struct.tm** %8
%13 = call i64 @strftime(i8* %9, i64 %10, i8* %11, %struct.tm* %12)
ret i64 %13
}

LLVM IR (-O2):
%struct.tm = type { i32 }
define weak i64 @softboundmpx_strftime(i8* %0, i64 %1, i8* %2, %struct.tm* %3) {
%5 = tail call i64 @strftime(i8* %0, i64 %1, i8* %2, %struct.tm* %3)
ret i64 %5
}
/* Type definitions */
typedef int int32_t;

/* Variables and functions */
const char *maskBooleanToStrU(int32_t value, int32_t mask) {
  return (value & mask) ? "true" : "false";
}


x86 assembly (clang, -O0):
<maskBooleanToStrU>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edx
and    -0x8(%rbp),%edx
lea    0xeee(%rip),%rax
lea    0xee2(%rip),%rcx
cmp    $0x0,%edx
cmovne %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<maskBooleanToStrU>:
test   %edi,%esi
lea    0xefc(%rip),%rcx
lea    0xef0(%rip),%rax
cmove  %rcx,%rax
ret

LLVM IR (-O0):
@.str = [5 x i8] c"true\00"
@.str.1 = [6 x i8] c"false\00"
define i8* @maskBooleanToStrU(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = and i32 %5, %6
%8 = icmp ne i32 %7, 0
%9 = zext i1 %8 to i64
%10 = select i1 %8, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0)
ret i8* %10
}

LLVM IR (-O2):
@.str = [5 x i8] c"true\00"
@.str.1 = [6 x i8] c"false\00"
define i8* @maskBooleanToStrU(i32 %0, i32 %1) {
%3 = and i32 %1, %0
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0)
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void notify(int msg) { printf("\nsigmail encountered %d\n", msg); }


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

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

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

LLVM IR (-O2):
@.str = [25 x i8] c"\0Asigmail encountered %d\0A\00"
define void @notify(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
void f4(long long i) {}


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

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

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

LLVM IR (-O2):
define void @f4(i64 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ insw(unsigned int, void *, unsigned long);
void nsp_multi_read_2(unsigned int BaseAddr, unsigned int Register, void *buf,
                      unsigned long count) {
  insw(BaseAddr + Register, buf, count);
}


x86 assembly (clang, -O0):
<nsp_multi_read_2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
add    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <insw@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nsp_multi_read_2>:
add    %esi,%edi
mov    %rdx,%rsi
mov    %rcx,%rdx
jmp    1030 <insw@plt>

LLVM IR (-O0):
define void @nsp_multi_read_2(i32 %0, i32 %1, i8* %2, i64 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i64
store i32 %0, i32* %5
store i32 %1, i32* %6
store i8* %2, i8** %7
store i64 %3, i64* %8
%9 = load i32, i32* %5
%10 = load i32, i32* %6
%11 = add i32 %9, %10
%12 = load i8*, i8** %7
%13 = load i64, i64* %8
%14 = call i32 @insw(i32 %11, i8* %12, i64 %13)
ret void
}

LLVM IR (-O2):
define void @nsp_multi_read_2(i32 %0, i32 %1, i8* %2, i64 %3) {
%5 = add i32 %1, %0
%6 = tail call i32 @insw(i32 %5, i8* %2, i64 %3)
ret void
}
/* Variables and functions */
int strtol(char *, char **, int /*<<< orphan*/);
int GETLPP() {
  int res;
  char *cp;
  extern char *getenv();
  cp = getenv("LPP");
  if (cp == NULL)
    res = 60;
  else {
    res = strtol(cp, (char **)NULL, 0);
    if (res < 0)
      res = 60;
  }
  return (res);
}


x86 assembly (clang, -O0):
<GETLPP>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
mov    $0x0,%al
call   1030 <getenv@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1151 <GETLPP+0x31>
movl   $0x3c,-0x4(%rbp)
jmp    1179 <GETLPP+0x59>
mov    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
xor    %edx,%edx
call   1040 <strtol@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    1174 <GETLPP+0x54>
movl   $0x3c,-0x4(%rbp)
jmp    1179 <GETLPP+0x59>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GETLPP>:
push   %rax
lea    0xed8(%rip),%rdi
xor    %eax,%eax
call   1030 <getenv@plt>
test   %rax,%rax
je     114e <GETLPP+0x2e>
mov    %rax,%rdi
xor    %esi,%esi
xor    %edx,%edx
call   1040 <strtol@plt>
mov    %eax,%ecx
test   %eax,%eax
mov    $0x3c,%eax
cmovns %ecx,%eax
pop    %rcx
ret
mov    $0x3c,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"LPP\00"
define i32 @GETLPP() {
%1 = alloca i32
%2 = alloca i8*
%3 = call i8* (i8*, ...) bitcast (i8* (...)* @getenv to i8* (i8*, ...)*)(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
store i8* %3, i8** %2
%4 = load i8*, i8** %2
%5 = icmp eq i8* %4, null
br i1 %5, label %6, label %7
6: ; preds = %0
store i32 60, i32* %1
br label %14
7: ; preds = %0
%8 = load i8*, i8** %2
%9 = call i32 @strtol(i8* %8, i8** null, i32 0)
store i32 %9, i32* %1
%10 = load i32, i32* %1
%11 = icmp slt i32 %10, 0
br i1 %11, label %12, label %13
12: ; preds = %7
store i32 60, i32* %1
br label %13
13: ; preds = %12, %7
br label %14
14: ; preds = %13, %6
%15 = load i32, i32* %1
ret i32 %15
}

LLVM IR (-O2):
@.str = [4 x i8] c"LPP\00"
define i32 @GETLPP() {
%1 = tail call i8* (i8*, ...) bitcast (i8* (...)* @getenv to i8* (i8*, ...)*)(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%2 = icmp eq i8* %1, null
br i1 %2, label %7, label %3
3: ; preds = %0
%4 = tail call i32 @strtol(i8* nocapture %1, i8** null, i32 0)
%5 = icmp slt i32 %4, 0
%6 = select i1 %5, i32 60, i32 %4
br label %7
7: ; preds = %0, %3
%8 = phi i32 [ %6, %3 ], [ 60, %0 ]
ret i32 %8
}
Swap(int *x, int *y) {
  int tmp = *x;
  *y = *x;
  *x = tmp;
}


x86 assembly (clang, -O0):
<Swap>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x1c(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Swap>:
mov    (%rdi),%eax
mov    %eax,(%rsi)
mov    %eax,(%rdi)
ret

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

LLVM IR (-O2):
define i32 @Swap(i32* nocapture %0, i32* nocapture writeonly %1) {
%3 = load i32, i32* %0
store i32 %3, i32* %1
store i32 %3, i32* %0
ret i32 undef
}
double JulianDayFromHijri(int year, int month, float day) {
  int alpha = (int)((11 * year + 3) / 30), beta = (int)(354 * year),
      gamma = (int)(30 * month) - (int)((month - 1) / 2);
  return alpha + beta + gamma + day + 1948440 - 385;
}


x86 assembly (clang, -O0):
<JulianDayFromHijri>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
imul   $0xb,-0x4(%rbp),%eax
add    $0x3,%eax
mov    $0x1e,%ecx
cltd
idiv   %ecx
mov    %eax,-0x10(%rbp)
imul   $0x162,-0x4(%rbp),%eax
mov    %eax,-0x14(%rbp)
imul   $0x1e,-0x8(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x1c(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%eax
add    -0x14(%rbp),%eax
add    -0x18(%rbp),%eax
cvtsi2ss %eax,%xmm0
addss  -0xc(%rbp),%xmm0
movss  0xea0(%rip),%xmm1
addss  %xmm1,%xmm0
movss  0xe90(%rip),%xmm1
subss  %xmm1,%xmm0
cvtss2sd %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<JulianDayFromHijri>:
lea    (%rdi,%rdi,4),%eax
lea    (%rdi,%rax,2),%ecx
lea    (%rdi,%rax,2),%eax
add    $0x3,%eax
cltq
imul   $0xffffffff88888889,%rax,%rax
shr    $0x20,%rax
add    %ecx,%eax
add    $0x3,%eax
mov    %eax,%ecx
shr    $0x1f,%ecx
sar    $0x4,%eax
add    %ecx,%eax
imul   $0x162,%edi,%ecx
mov    %esi,%edx
shl    $0x5,%edx
sub    %esi,%edx
sub    %esi,%edx
add    %ecx,%edx
add    %eax,%edx
mov    %esi,%eax
add    $0xffffffff,%eax
shr    $0x1f,%eax
add    %esi,%eax
add    $0xffffffff,%eax
sar    %eax
sub    %eax,%edx
cvtsi2ss %edx,%xmm1
addss  %xmm0,%xmm1
addss  0xea4(%rip),%xmm1
addss  0xea0(%rip),%xmm1
xorps  %xmm0,%xmm0
cvtss2sd %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @JulianDayFromHijri(i32 %0, i32 %1, float %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca float
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store float %2, float* %6
%10 = load i32, i32* %4
%11 = mul nsw i32 11, %10
%12 = add nsw i32 %11, 3
%13 = sdiv i32 %12, 30
store i32 %13, i32* %7
%14 = load i32, i32* %4
%15 = mul nsw i32 354, %14
store i32 %15, i32* %8
%16 = load i32, i32* %5
%17 = mul nsw i32 30, %16
%18 = load i32, i32* %5
%19 = sub nsw i32 %18, 1
%20 = sdiv i32 %19, 2
%21 = sub nsw i32 %17, %20
store i32 %21, i32* %9
%22 = load i32, i32* %7
%23 = load i32, i32* %8
%24 = add nsw i32 %22, %23
%25 = load i32, i32* %9
%26 = add nsw i32 %24, %25
%27 = sitofp i32 %26 to float
%28 = load float, float* %6
%29 = fadd float %27, %28
%30 = fadd float %29, 1.948440e+06
%31 = fsub float %30, 3.850000e+02
%32 = fpext float %31 to double
ret double %32
}

LLVM IR (-O2):
define double @JulianDayFromHijri(i32 %0, i32 %1, float %2) {
%4 = mul nsw i32 %0, 11
%5 = add nsw i32 %4, 3
%6 = sdiv i32 %5, 30
%7 = mul nsw i32 %0, 354
%8 = mul nsw i32 %1, 30
%9 = add nsw i32 %1, -1
%10 = sdiv i32 %9, -2
%11 = add i32 %8, %7
%12 = add i32 %11, %6
%13 = add i32 %12, %10
%14 = sitofp i32 %13 to float
%15 = fadd float %14, %2
%16 = fadd float %15, 1.948440e+06
%17 = fadd float %16, -3.850000e+02
%18 = fpext float %17 to double
ret double %18
}
/* Type definitions */
typedef char wchar_t;

/* Variables and functions */
int is_quote(wchar_t ch) { return ch == '\'' || ch == '"' || ch == '`'; }


x86 assembly (clang, -O0):
<is_quote>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x27,%ecx
mov    %al,-0x2(%rbp)
je     113b <is_quote+0x3b>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x22,%ecx
mov    %al,-0x2(%rbp)
je     113b <is_quote+0x3b>
movsbl -0x1(%rbp),%eax
cmp    $0x60,%eax
sete   %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_quote>:
mov    $0x1,%eax
cmp    $0x22,%dil
je     1111 <is_quote+0x11>
cmp    $0x27,%dil
jne    1112 <is_quote+0x12>
ret
xor    %eax,%eax
cmp    $0x60,%dil
sete   %al
ret

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

LLVM IR (-O2):
define i32 @is_quote(i8 signext %0) {
switch i8 %0, label %2 [
i8 39, label %5
i8 34, label %5
]
2: ; preds = %1
%3 = icmp eq i8 %0, 96
%4 = zext i1 %3 to i32
br label %5
5: ; preds = %1, %1, %2
%6 = phi i32 [ 1, %1 ], [ %4, %2 ], [ 1, %1 ]
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int find_or_insert(int);
void *process8(void *arg) {
  int val = 52;
  int found = find_or_insert(val);
  assert(found);
  return NULL;
}


x86 assembly (clang, -O0):
<process8>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x34,-0xc(%rbp)
mov    -0xc(%rbp),%edi
call   1040 <find_or_insert@plt>
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%edi
call   1030 <assert@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<process8>:
push   %rax
mov    $0x34,%edi
call   1040 <find_or_insert@plt>
mov    %eax,%edi
call   1030 <assert@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i8* @process8(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i32
store i8* %0, i8** %2
store i32 52, i32* %3
%5 = load i32, i32* %3
%6 = call i32 @find_or_insert(i32 %5)
store i32 %6, i32* %4
%7 = load i32, i32* %4
%8 = call i32 @assert(i32 %7)
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @process8(i8* nocapture readnone %0) {
%2 = tail call i32 @find_or_insert(i32 52)
%3 = tail call i32 @assert(i32 %2)
ret i8* null
}
int test_imm_87int8_reg(signed char val) {
  return ((val) & (-0x87 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_87int8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edx
and    $0xffffff79,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test_imm_87int8_reg(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = and i32 %4, -135
%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_87int8_reg(i8 signext %0) {
%2 = sext i8 %0 to i32
%3 = and i32 %2, -135
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Type definitions */
struct stat {
  int /*<<< orphan*/ st_mode;
};

/* Variables and functions */
int S_ISREG(int /*<<< orphan*/);
scalar_t__ stat(char *, struct stat *);
int unary_f(char *s) {
  struct stat buf;
  if (stat(s, &buf))
    return 0;
  return S_ISREG(buf.st_mode);
}


x86 assembly (clang, -O0):
<unary_f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1030 <stat@plt>
cmp    $0x0,%rax
je     114f <unary_f+0x2f>
movl   $0x0,-0x4(%rbp)
jmp    115a <unary_f+0x3a>
mov    -0x18(%rbp),%edi
call   1040 <S_ISREG@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<unary_f>:
push   %rax
mov    %rsp,%rsi
call   1030 <stat@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
je     1135 <unary_f+0x15>
pop    %rcx
ret
mov    (%rsp),%edi
call   1040 <S_ISREG@plt>
pop    %rcx
ret

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

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @unary_f(i8* %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i64 @stat(i8* %0, %struct.stat* %2)
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%8 = load i32, i32* %7
%9 = call i32 @S_ISREG(i32 %8)
br label %10
10: ; preds = %1, %6
%11 = phi i32 [ %9, %6 ], [ 0, %1 ]
ret i32 %11
}
char *iupStrReturnChecked(int check) {
  if (check == -1)
    return "NOTDEF";
  else if (check)
    return "ON";
  else
    return "OFF";
}


x86 assembly (clang, -O0):
<iupStrReturnChecked>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
cmpl   $0xffffffff,-0xc(%rbp)
jne    1121 <iupStrReturnChecked+0x21>
lea    0xee8(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1146 <iupStrReturnChecked+0x46>
cmpl   $0x0,-0xc(%rbp)
je     113b <iupStrReturnChecked+0x3b>
lea    0xed5(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1146 <iupStrReturnChecked+0x46>
lea    0xec8(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<iupStrReturnChecked>:
test   %edi,%edi
lea    0xf01(%rip),%rax
lea    0xef7(%rip),%rcx
cmove  %rax,%rcx
cmp    $0xffffffff,%edi
lea    0xee2(%rip),%rax
cmovne %rcx,%rax
ret

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

LLVM IR (-O2):
@.str = [7 x i8] c"NOTDEF\00"
@.str.1 = [3 x i8] c"ON\00"
@.str.2 = [4 x i8] c"OFF\00"
define i8* @iupStrReturnChecked(i32 %0) {
%2 = icmp eq i32 %0, 0
%3 = select i1 %2, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0)
%4 = icmp eq i32 %0, -1
%5 = select i1 %4, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %3
ret i8* %5
}
int mult(int p, int q) {
  int p1, p0, q1, q0;
  p1 = p / 10000;
  p0 = p % 10000;
  q1 = q / 10000;
  q0 = q % 10000;
  return ((p0 * q1 + p1 * q0) % 10000) * 10000 + p0 * q0;
}


x86 assembly (clang, -O0):
<mult>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x2710,%ecx
cltd
idiv   %ecx
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x2710,%ecx
cltd
idiv   %ecx
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x2710,%ecx
cltd
idiv   %ecx
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x2710,%ecx
cltd
idiv   %ecx
mov    %edx,-0x18(%rbp)
mov    -0x10(%rbp),%eax
imul   -0x14(%rbp),%eax
mov    -0xc(%rbp),%ecx
imul   -0x18(%rbp),%ecx
add    %ecx,%eax
mov    $0x2710,%ecx
cltd
idiv   %ecx
imul   $0x2710,%edx,%eax
mov    -0x10(%rbp),%ecx
imul   -0x18(%rbp),%ecx
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mult>:
movslq %edi,%rcx
imul   $0x68db8bad,%rcx,%rdx
mov    %rdx,%rax
shr    $0x3f,%rax
sar    $0x2c,%rdx
add    %eax,%edx
imul   $0x2710,%edx,%eax
sub    %eax,%ecx
movslq %esi,%rax
imul   $0x68db8bad,%rax,%rsi
mov    %rsi,%rdi
shr    $0x3f,%rdi
sar    $0x2c,%rsi
add    %edi,%esi
imul   $0x2710,%esi,%edi
sub    %edi,%eax
imul   %ecx,%esi
imul   %eax,%edx
add    %esi,%edx
movslq %edx,%rdx
imul   $0x68db8bad,%rdx,%rsi
mov    %rsi,%rdi
shr    $0x3f,%rdi
sar    $0x2c,%rsi
add    %edi,%esi
imul   $0x2710,%esi,%esi
sub    %esi,%edx
imul   $0x2710,%edx,%edx
imul   %ecx,%eax
add    %edx,%eax
ret

LLVM IR (-O0):
define i32 @mult(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%9 = load i32, i32* %3
%10 = sdiv i32 %9, 10000
store i32 %10, i32* %5
%11 = load i32, i32* %3
%12 = srem i32 %11, 10000
store i32 %12, i32* %6
%13 = load i32, i32* %4
%14 = sdiv i32 %13, 10000
store i32 %14, i32* %7
%15 = load i32, i32* %4
%16 = srem i32 %15, 10000
store i32 %16, i32* %8
%17 = load i32, i32* %6
%18 = load i32, i32* %7
%19 = mul nsw i32 %17, %18
%20 = load i32, i32* %5
%21 = load i32, i32* %8
%22 = mul nsw i32 %20, %21
%23 = add nsw i32 %19, %22
%24 = srem i32 %23, 10000
%25 = mul nsw i32 %24, 10000
%26 = load i32, i32* %6
%27 = load i32, i32* %8
%28 = mul nsw i32 %26, %27
%29 = add nsw i32 %25, %28
ret i32 %29
}

LLVM IR (-O2):
define i32 @mult(i32 %0, i32 %1) {
%3 = sdiv i32 %0, 10000
%4 = srem i32 %0, 10000
%5 = sdiv i32 %1, 10000
%6 = srem i32 %1, 10000
%7 = mul nsw i32 %5, %4
%8 = mul nsw i32 %6, %3
%9 = add nsw i32 %7, %8
%10 = srem i32 %9, 10000
%11 = mul nsw i32 %10, 10000
%12 = mul nsw i32 %6, %4
%13 = add nsw i32 %11, %12
ret i32 %13
}
/* Type definitions */
typedef int /*<<< orphan*/ PROXY_CERT_INFO_EXTENSION;
typedef int /*<<< orphan*/ ASN1_VALUE;

/* Variables and functions */
int ASN1_item_i2d(int /*<<< orphan*/ *, unsigned char **, int /*<<< orphan*/ *);
int /*<<< orphan*/ PROXY_CERT_INFO_EXTENSION_it;
int i2d_PROXY_CERT_INFO_EXTENSION(PROXY_CERT_INFO_EXTENSION *a,
                                  unsigned char **out) {
  return ASN1_item_i2d((ASN1_VALUE *)a, out, &PROXY_CERT_INFO_EXTENSION_it);
}


x86 assembly (clang, -O0):
<i2d_PROXY_CERT_INFO_EXTENSION>:
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    0x2eb9(%rip),%rdx
call   1030 <ASN1_item_i2d@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<i2d_PROXY_CERT_INFO_EXTENSION>:
mov    0x2ed1(%rip),%rdx
jmp    1030 <ASN1_item_i2d@plt>

LLVM IR (-O0):
@PROXY_CERT_INFO_EXTENSION_it = global i32 0
define i32 @i2d_PROXY_CERT_INFO_EXTENSION(i32* %0, i8** %1) {
%3 = alloca i32*
%4 = alloca i8**
store i32* %0, i32** %3
store i8** %1, i8*** %4
%5 = load i32*, i32** %3
%6 = load i8**, i8*** %4
%7 = call i32 @ASN1_item_i2d(i32* %5, i8** %6, i32* @PROXY_CERT_INFO_EXTENSION_it)
ret i32 %7
}

LLVM IR (-O2):
@PROXY_CERT_INFO_EXTENSION_it = global i32 0
define i32 @i2d_PROXY_CERT_INFO_EXTENSION(i32* %0, i8** %1) {
%3 = tail call i32 @ASN1_item_i2d(i32* %0, i8** %1, i32* @PROXY_CERT_INFO_EXTENSION_it)
ret i32 %3
}
int maxm(int p, int q) {
  if (p > q)
    return p;
  else if (q > p)
    return q;
  return 0;
}


x86 assembly (clang, -O0):
<maxm>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    1121 <maxm+0x21>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1144 <maxm+0x44>
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jle    1138 <maxm+0x38>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1144 <maxm+0x44>
jmp    113d <maxm+0x3d>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<maxm>:
xor    %eax,%eax
cmp    %edi,%esi
cmovg  %esi,%eax
cmovl  %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @maxm(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = icmp sgt i32 %1, %0
%5 = select i1 %4, i32 %1, i32 0
%6 = select i1 %3, i32 %0, i32 %5
ret i32 %6
}
/* Variables and functions */
char *_(int, int, char *);
int /*<<< orphan*/ printf(char *);
void print_full_header(void) {
  printf(_(4, 4, "\nSegment        Total           Name           Type\n"));
  printf("-------  ----------------  ------------  -------------\n");
}


x86 assembly (clang, -O0):
<print_full_header>:
push   %rbp
mov    %rsp,%rbp
mov    $0x4,%esi
lea    0xed0(%rip),%rdx
mov    %esi,%edi
call   1040 <_@plt>
mov    %rax,%rdi
call   1030 <printf@plt>
lea    0xeef(%rip),%rdi
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_full_header>:
push   %rax
lea    0xec8(%rip),%rdx
mov    $0x4,%edi
mov    $0x4,%esi
call   1050 <_@plt>
mov    %rax,%rdi
call   1040 <printf@plt>
lea    0xedf(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [53 x i8] c"\0ASegment Total Name Type\0A\00"
@.str.1 = [56 x i8] c"------- ---------------- ------------ -------------\0A\00"
define void @print_full_header() {
%1 = call i8* @_(i32 4, i32 4, i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* %1)
%3 = call i32 @printf(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [53 x i8] c"\0ASegment Total Name Type\0A\00"
@str = [55 x i8] c"------- ---------------- ------------ -------------\00"
define void @print_full_header() {
%1 = tail call i8* @_(i32 4, i32 4, i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @printf(i8* dereferenceable(1) %1)
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([55 x i8], [55 x i8]* @str, i64 0, i64 0))
ret void
}