xunge/DecIR huggingface dataset:
int main() {
  int price;
  printf("Input Price\n");
  scanf("%d", &price);
  printf("Price including tax %d\n", (int)((price) * (1.00 + 0.05)));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xed2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xed1(%rip),%rdi
lea    -0x8(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
cvtsi2sdl -0x8(%rbp),%xmm0
movsd  0xea4(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%esi
lea    0xead(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xeeb(%rip),%rdi
call   1030 <puts@plt>
lea    0xec4(%rip),%rdi
lea    0x4(%rsp),%rsi
xor    %eax,%eax
call   1050 <scanf@plt>
cvtsi2sdl 0x4(%rsp),%xmm0
mulsd  0xea2(%rip),%xmm0
cvttsd2si %xmm0,%esi
lea    0xea2(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [13 x i8] c"Input Price\0A\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [24 x i8] c"Price including tax %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%4 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%5 = load i32, i32* %2
%6 = sitofp i32 %5 to double
%7 = fmul double %6, 1.050000e+00
%8 = fptosi double %7 to i32
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0), i32 %8)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [24 x i8] c"Price including tax %d\0A\00"
@str = [12 x i8] c"Input Price\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
%4 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = sitofp i32 %5 to double
%7 = fmul double %6, 1.050000e+00
%8 = fptosi double %7 to i32
%9 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0), i32 %8)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isupper(int);
void t_isupper_0x85() {
  Assert_real((isupper(133) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isupper.c",
              670, ("isupper should be 0 for 0x85"));
}


x86 assembly (clang, -O0):
<t_isupper_0x85>:
push   %rbp
mov    %rsp,%rbp
mov    $0x85,%edi
call   1030 <isupper@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x29e,%edx
lea    0xf5b(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isupper_0x85>:
push   %rax
mov    $0x85,%edi
call   1030 <isupper@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x29e,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isupper.c\00"
@.str.1 = [29 x i8] c"isupper should be 0 for 0x85\00"
define void @t_isupper_0x85() {
%1 = call i64 @isupper(i32 133)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 670, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isupper.c\00"
@.str.1 = [29 x i8] c"isupper should be 0 for 0x85\00"
define void @t_isupper_0x85() {
%1 = tail call i64 @isupper(i32 133)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 670, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ X509_REQ;
typedef int /*<<< orphan*/ BIO;

/* Variables and functions */
int /*<<< orphan*/ X509_FLAG_COMPAT;
int X509_REQ_print_ex(int /*<<< orphan*/ *, int /*<<< orphan*/ *,
                      int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ XN_FLAG_COMPAT;
int X509_REQ_print(BIO *bio, X509_REQ *req) {
  return X509_REQ_print_ex(bio, req, XN_FLAG_COMPAT, X509_FLAG_COMPAT);
}


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

x86 assembly (clang, -O2):
<X509_REQ_print>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edx
mov    0x2ec8(%rip),%rax
mov    (%rax),%ecx
jmp    1030 <X509_REQ_print_ex@plt>

LLVM IR (-O0):
@XN_FLAG_COMPAT = global i32 0
@X509_FLAG_COMPAT = global i32 0
define i32 @X509_REQ_print(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 = load i32, i32* @XN_FLAG_COMPAT
%8 = load i32, i32* @X509_FLAG_COMPAT
%9 = call i32 @X509_REQ_print_ex(i32* %5, i32* %6, i32 %7, i32 %8)
ret i32 %9
}

LLVM IR (-O2):
@XN_FLAG_COMPAT = global i32 0
@X509_FLAG_COMPAT = global i32 0
define i32 @X509_REQ_print(i32* %0, i32* %1) {
%3 = load i32, i32* @XN_FLAG_COMPAT
%4 = load i32, i32* @X509_FLAG_COMPAT
%5 = tail call i32 @X509_REQ_print_ex(i32* %0, i32* %1, i32 %3, i32 %4)
ret i32 %5
}
int fun760() { return 760; }


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

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

LLVM IR (-O0):
define i32 @fun760() {
ret i32 760
}

LLVM IR (-O2):
define i32 @fun760() {
ret i32 760
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
void OneWireDataGet(uint32_t ui32Base, uint32_t *pui32Data) {
  ;
  ;
  while ((*((volatile uint32_t *)(ui32Base + 0x00000000))) & 0x00000100) {
  }
  *pui32Data = (*((volatile uint32_t *)(ui32Base + 0x0000000C)));
}


x86 assembly (clang, -O0):
<OneWireDataGet>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
add    $0x0,%eax
cltq
mov    (%rax),%eax
and    $0x100,%eax
cmp    $0x0,%eax
je     1128 <OneWireDataGet+0x28>
jmp    110b <OneWireDataGet+0xb>
mov    -0x4(%rbp),%eax
add    $0xc,%eax
cltq
mov    (%rax),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<OneWireDataGet>:
movslq %edi,%rax
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
testl  $0x100,(%rax)
jne    1110 <OneWireDataGet+0x10>
mov    0xc(%rax),%eax
mov    %eax,(%rsi)
ret

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

LLVM IR (-O2):
define void @OneWireDataGet(i32 %0, i32* nocapture writeonly %1) {
%3 = sext i32 %0 to i64
%4 = inttoptr i64 %3 to i32*
br label %5
5: ; preds = %5, %2
%6 = load volatile i32, i32* %4
%7 = and i32 %6, 256
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %5
9: ; preds = %5
%10 = add nsw i32 %0, 12
%11 = sext i32 %10 to i64
%12 = inttoptr i64 %11 to i32*
%13 = load volatile i32, i32* %12
store i32 %13, i32* %1
ret void
}
int DB_WriteFileNum_Native(int filenum, unsigned char *filedata,
                           int sz_filedata, void *db) {
  return 0;
}


x86 assembly (clang, -O0):
<DB_WriteFileNum_Native>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @DB_WriteFileNum_Native(i32 %0, i8* nocapture readnone %1, i32 %2, i8* nocapture readnone %3) {
ret i32 0
}
/* Type definitions */
struct eembed_log {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ eembed_fprintf_context(struct eembed_log *);
int /*<<< orphan*/ eembed_stream_eol(int /*<<< orphan*/);
void eembed_fprintf_append_eol(struct eembed_log *log) {
  eembed_stream_eol(eembed_fprintf_context(log));
}


x86 assembly (clang, -O0):
<eembed_fprintf_append_eol>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <eembed_fprintf_context@plt>
mov    %eax,%edi
call   1040 <eembed_stream_eol@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<eembed_fprintf_append_eol>:
push   %rax
call   1030 <eembed_fprintf_context@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <eembed_stream_eol@plt>

LLVM IR (-O0):
%struct.eembed_log = type { i32 }
define void @eembed_fprintf_append_eol(%struct.eembed_log* %0) {
%2 = alloca %struct.eembed_log*
store %struct.eembed_log* %0, %struct.eembed_log** %2
%3 = load %struct.eembed_log*, %struct.eembed_log** %2
%4 = call i32 @eembed_fprintf_context(%struct.eembed_log* %3)
%5 = call i32 @eembed_stream_eol(i32 %4)
ret void
}

LLVM IR (-O2):
%struct.eembed_log = type { i32 }
define void @eembed_fprintf_append_eol(%struct.eembed_log* %0) {
%2 = tail call i32 @eembed_fprintf_context(%struct.eembed_log* %0)
%3 = tail call i32 @eembed_stream_eol(i32 %2)
ret void
}
void rop3_156_1_1(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  unsigned char stk3;
  stk3 = ~*D;
  stk2 = T & stk3;
  stk1 = S ^ stk2;
  *D = (stk1 & (~S) & (~T)) | (*D & S) | (*D & T);
}


x86 assembly (clang, -O0):
<rop3_156_1_1>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
xor    $0xffffffff,%eax
mov    %al,-0xd(%rbp)
movzbl -0xa(%rbp),%eax
movzbl -0xd(%rbp),%ecx
and    %ecx,%eax
mov    %al,-0xc(%rbp)
movzbl -0x9(%rbp),%eax
movzbl -0xc(%rbp),%ecx
xor    %ecx,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
movzbl -0x9(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
movzbl -0xa(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
movzbl -0x9(%rbp),%edx
and    %edx,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
movzbl -0xa(%rbp),%edx
and    %edx,%ecx
or     %ecx,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rop3_156_1_1>:
or     %edx,%esi
and    %sil,(%rdi)
ret

LLVM IR (-O0):
define void @rop3_156_1_1(i8* %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
%9 = alloca i8
store i8* %0, i8** %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%10 = load i8*, i8** %4
%11 = load i8, i8* %10
%12 = zext i8 %11 to i32
%13 = xor i32 %12, -1
%14 = trunc i32 %13 to i8
store i8 %14, i8* %9
%15 = load i8, i8* %6
%16 = zext i8 %15 to i32
%17 = load i8, i8* %9
%18 = zext i8 %17 to i32
%19 = and i32 %16, %18
%20 = trunc i32 %19 to i8
store i8 %20, i8* %8
%21 = load i8, i8* %5
%22 = zext i8 %21 to i32
%23 = load i8, i8* %8
%24 = zext i8 %23 to i32
%25 = xor i32 %22, %24
%26 = trunc i32 %25 to i8
store i8 %26, i8* %7
%27 = load i8, i8* %7
%28 = zext i8 %27 to i32
%29 = load i8, i8* %5
%30 = zext i8 %29 to i32
%31 = xor i32 %30, -1
%32 = and i32 %28, %31
%33 = load i8, i8* %6
%34 = zext i8 %33 to i32
%35 = xor i32 %34, -1
%36 = and i32 %32, %35
%37 = load i8*, i8** %4
%38 = load i8, i8* %37
%39 = zext i8 %38 to i32
%40 = load i8, i8* %5
%41 = zext i8 %40 to i32
%42 = and i32 %39, %41
%43 = or i32 %36, %42
%44 = load i8*, i8** %4
%45 = load i8, i8* %44
%46 = zext i8 %45 to i32
%47 = load i8, i8* %6
%48 = zext i8 %47 to i32
%49 = and i32 %46, %48
%50 = or i32 %43, %49
%51 = trunc i32 %50 to i8
%52 = load i8*, i8** %4
store i8 %51, i8* %52
ret void
}

LLVM IR (-O2):
define void @rop3_156_1_1(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = load i8, i8* %0
%5 = or i8 %2, %1
%6 = and i8 %4, %5
store i8 %6, i8* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void say_hello() { printf("I am the plugin BBBB."); }


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

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

LLVM IR (-O0):
@.str = [22 x i8] c"I am the plugin BBBB.\00"
define void @say_hello() {
%1 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [22 x i8] c"I am the plugin BBBB.\00"
define void @say_hello() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ __udivmodsi4(int /*<<< orphan*/, int /*<<< orphan*/,
                                int /*<<< orphan*/ *);
uint32_t __umodsi3(uint32_t num, uint32_t den) {
  uint32_t v;
  (void)__udivmodsi4(num, den, &v);
  return v;
}


x86 assembly (clang, -O0):
<__umodsi3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
lea    -0xc(%rbp),%rdx
call   1030 <__udivmodsi4@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__umodsi3>:
push   %rax
lea    0x4(%rsp),%rdx
call   1030 <__udivmodsi4@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @__umodsi3(i32 %0, i32 %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = call i32 @__udivmodsi4(i32 %0, i32 %1, i32* %3)
%6 = load i32, i32* %3
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(void) {
  printf("Hello from prog3.c\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>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@str = [19 x i8] c"Hello from prog3.c\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void print_test(const unsigned char *data, int len) {
  while (len--)
    printf("\\x%02X", *data++);
  printf("\n");
}


x86 assembly (clang, -O0):
<print_test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0xc(%rbp)
cmp    $0x0,%eax
je     1158 <print_test+0x48>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movzbl (%rax),%esi
lea    0xeb4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    111f <print_test+0xf>
lea    0xea8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_test>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
je     1158 <print_test+0x38>
mov    %rdi,%r15
mov    %esi,%r12d
lea    0xec7(%rip),%r14
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
movzbl (%r15,%rbx,1),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%rbx
cmp    %ebx,%r12d
jne    1140 <print_test+0x20>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
@.str = [7 x i8] c"\\x%02X\00"
define void @print_test(i8* nocapture %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %13, label %4
4: ; preds = %2, %4
%5 = phi i32 [ %7, %4 ], [ %1, %2 ]
%6 = phi i8* [ %8, %4 ], [ %0, %2 ]
%7 = add nsw i32 %5, -1
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = load i8, i8* %6
%10 = zext i8 %9 to i32
%11 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %10)
%12 = icmp eq i32 %7, 0
br i1 %12, label %13, label %4
13: ; preds = %4, %2
%14 = tail call i32 @putchar(i32 10)
ret void
}
/* Type definitions */
struct Trie {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct Trie *);
int /*<<< orphan*/ *trie_root(struct Trie *);
int /*<<< orphan*/ trienode_free(int /*<<< orphan*/ *);
void trie_free(struct Trie *trie) {
  if (trie_root(trie) != NULL)
    trienode_free(trie_root(trie));
  free(trie);
}


x86 assembly (clang, -O0):
<trie_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <trie_root@plt>
cmp    $0x0,%rax
je     1160 <trie_free+0x30>
mov    -0x8(%rbp),%rdi
call   1050 <trie_root@plt>
mov    %rax,%rdi
call   1030 <trienode_free@plt>
mov    -0x8(%rbp),%rdi
call   1040 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<trie_free>:
push   %rbx
mov    %rdi,%rbx
call   1050 <trie_root@plt>
test   %rax,%rax
je     114e <trie_free+0x1e>
mov    %rbx,%rdi
call   1050 <trie_root@plt>
mov    %rax,%rdi
call   1030 <trienode_free@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <free@plt>

LLVM IR (-O0):
%struct.Trie = type { i32 }
define void @trie_free(%struct.Trie* %0) {
%2 = alloca %struct.Trie*
store %struct.Trie* %0, %struct.Trie** %2
%3 = load %struct.Trie*, %struct.Trie** %2
%4 = call i32* @trie_root(%struct.Trie* %3)
%5 = icmp ne i32* %4, null
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load %struct.Trie*, %struct.Trie** %2
%8 = call i32* @trie_root(%struct.Trie* %7)
%9 = call i32 @trienode_free(i32* %8)
br label %10
10: ; preds = %6, %1
%11 = load %struct.Trie*, %struct.Trie** %2
%12 = call i32 @free(%struct.Trie* %11)
ret void
}

LLVM IR (-O2):
%struct.Trie = type { i32 }
define void @trie_free(%struct.Trie* %0) {
%2 = tail call i32* @trie_root(%struct.Trie* %0)
%3 = icmp eq i32* %2, null
br i1 %3, label %7, label %4
4: ; preds = %1
%5 = tail call i32* @trie_root(%struct.Trie* %0)
%6 = tail call i32 @trienode_free(i32* %5)
br label %7
7: ; preds = %4, %1
%8 = tail call i32 @free(%struct.Trie* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ do_compare(int, int);
int /*<<< orphan*/ expect(int, int /*<<< orphan*/);
int main(int argc, char *argv[]) {
  expect(0xff000000, do_compare(0x12345678, 0x12000000));
  expect(0x00ffffff, do_compare(0x12345678, 0x00345678));
  expect(0x000000ff, do_compare(0x00000078, 0x12345678));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x12345678,%edi
mov    $0x12000000,%esi
call   1030 <do_compare@plt>
mov    %eax,%esi
mov    $0xff000000,%edi
call   1040 <expect@plt>
mov    $0x12345678,%edi
mov    $0x345678,%esi
call   1030 <do_compare@plt>
mov    %eax,%esi
mov    $0xffffff,%edi
call   1040 <expect@plt>
mov    $0x78,%edi
mov    $0x12345678,%esi
call   1030 <do_compare@plt>
mov    %eax,%esi
mov    $0xff,%edi
call   1040 <expect@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x12345678,%edi
mov    $0x12000000,%esi
call   1030 <do_compare@plt>
mov    $0xff000000,%edi
mov    %eax,%esi
call   1040 <expect@plt>
mov    $0x12345678,%edi
mov    $0x345678,%esi
call   1030 <do_compare@plt>
mov    $0xffffff,%edi
mov    %eax,%esi
call   1040 <expect@plt>
mov    $0x78,%edi
mov    $0x12345678,%esi
call   1030 <do_compare@plt>
mov    $0xff,%edi
mov    %eax,%esi
call   1040 <expect@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = call i32 @do_compare(i32 305419896, i32 301989888)
%6 = call i32 @expect(i32 -16777216, i32 %5)
%7 = call i32 @do_compare(i32 305419896, i32 3430008)
%8 = call i32 @expect(i32 16777215, i32 %7)
%9 = call i32 @do_compare(i32 120, i32 305419896)
%10 = call i32 @expect(i32 255, i32 %9)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @do_compare(i32 305419896, i32 301989888)
%4 = tail call i32 @expect(i32 -16777216, i32 %3)
%5 = tail call i32 @do_compare(i32 305419896, i32 3430008)
%6 = tail call i32 @expect(i32 16777215, i32 %5)
%7 = tail call i32 @do_compare(i32 120, i32 305419896)
%8 = tail call i32 @expect(i32 255, i32 %7)
ret i32 0
}
/* Type definitions */
struct stat {
  int /*<<< orphan*/ st_mode;
};

/* Variables and functions */
scalar_t__ S_ISREG(int /*<<< orphan*/);
scalar_t__ stat(char *, struct stat *);
int flott_file_exists(char *filename) {
  int ret_val = 0;
  struct stat info;
  if (stat(filename, &info) == 0 && S_ISREG(info.st_mode)) {
    ret_val = 1;
  }
  return ret_val;
}


x86 assembly (clang, -O0):
<flott_file_exists>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x10(%rbp),%rsi
call   1030 <stat@plt>
cmp    $0x0,%rax
jne    1163 <flott_file_exists+0x43>
mov    -0x10(%rbp),%edi
call   1040 <S_ISREG@plt>
cmp    $0x0,%rax
je     1163 <flott_file_exists+0x43>
movl   $0x1,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @flott_file_exists(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 %12
6: ; preds = %1
%7 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%8 = load i32, i32* %7
%9 = call i64 @S_ISREG(i32 %8)
%10 = icmp ne i64 %9, 0
%11 = zext i1 %10 to i32
br label %12
12: ; preds = %6, %1
%13 = phi i32 [ 0, %1 ], [ %11, %6 ]
ret i32 %13
}
void vbiqpk() {}


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

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

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

LLVM IR (-O2):
define void @vbiqpk() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int /*<<< orphan*/ LCDPort_ClearCE();
int /*<<< orphan*/ LCDPort_ClearRS();
int /*<<< orphan*/ LCDPort_ClearRW();
int /*<<< orphan*/ LCDPort_Out8(int /*<<< orphan*/);
int /*<<< orphan*/ LCDPort_SetCE();
int /*<<< orphan*/ LCDPort_SetDirection_Input8();
int /*<<< orphan*/ LCDPort_SetDirection_Output8();
int /*<<< orphan*/ LCDPort_SetRW();
void writeInstruction_8BitIntf(int32_t instr) {
  LCDPort_ClearRS();
  LCDPort_ClearRW();
  LCDPort_SetCE();
  LCDPort_Out8(instr);
  LCDPort_SetDirection_Output8();
  LCDPort_ClearCE();
  LCDPort_SetDirection_Input8();
  LCDPort_SetRW();
}


x86 assembly (clang, -O0):
<writeInstruction_8BitIntf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1040 <LCDPort_ClearRS@plt>
mov    $0x0,%al
call   1050 <LCDPort_ClearRW@plt>
mov    $0x0,%al
call   1080 <LCDPort_SetCE@plt>
mov    -0x4(%rbp),%edi
call   1060 <LCDPort_Out8@plt>
mov    $0x0,%al
call   1090 <LCDPort_SetDirection_Output8@plt>
mov    $0x0,%al
call   1030 <LCDPort_ClearCE@plt>
mov    $0x0,%al
call   1070 <LCDPort_SetDirection_Input8@plt>
mov    $0x0,%al
call   10a0 <LCDPort_SetRW@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<writeInstruction_8BitIntf>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1040 <LCDPort_ClearRS@plt>
xor    %eax,%eax
call   1050 <LCDPort_ClearRW@plt>
xor    %eax,%eax
call   1080 <LCDPort_SetCE@plt>
mov    %ebx,%edi
call   1060 <LCDPort_Out8@plt>
xor    %eax,%eax
call   1090 <LCDPort_SetDirection_Output8@plt>
xor    %eax,%eax
call   1030 <LCDPort_ClearCE@plt>
xor    %eax,%eax
call   1070 <LCDPort_SetDirection_Input8@plt>
xor    %eax,%eax
pop    %rbx
jmp    10a0 <LCDPort_SetRW@plt>

LLVM IR (-O0):
define void @writeInstruction_8BitIntf(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @LCDPort_ClearRS()
%4 = call i32 (...) @LCDPort_ClearRW()
%5 = call i32 (...) @LCDPort_SetCE()
%6 = load i32, i32* %2
%7 = call i32 @LCDPort_Out8(i32 %6)
%8 = call i32 (...) @LCDPort_SetDirection_Output8()
%9 = call i32 (...) @LCDPort_ClearCE()
%10 = call i32 (...) @LCDPort_SetDirection_Input8()
%11 = call i32 (...) @LCDPort_SetRW()
ret void
}

LLVM IR (-O2):
define void @writeInstruction_8BitIntf(i32 %0) {
%2 = tail call i32 (...) @LCDPort_ClearRS()
%3 = tail call i32 (...) @LCDPort_ClearRW()
%4 = tail call i32 (...) @LCDPort_SetCE()
%5 = tail call i32 @LCDPort_Out8(i32 %0)
%6 = tail call i32 (...) @LCDPort_SetDirection_Output8()
%7 = tail call i32 (...) @LCDPort_ClearCE()
%8 = tail call i32 (...) @LCDPort_SetDirection_Input8()
%9 = tail call i32 (...) @LCDPort_SetRW()
ret void
}
int is_word_end(char c) {
  return (int)(c == 0 || c == ' ' || c == '\t' || c == '\r' || c == '\n');
}


x86 assembly (clang, -O0):
<is_word_end>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x0,%ecx
mov    %al,-0x2(%rbp)
je     115f <is_word_end+0x5f>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x20,%ecx
mov    %al,-0x2(%rbp)
je     115f <is_word_end+0x5f>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x9,%ecx
mov    %al,-0x2(%rbp)
je     115f <is_word_end+0x5f>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0xd,%ecx
mov    %al,-0x2(%rbp)
je     115f <is_word_end+0x5f>
movsbl -0x1(%rbp),%eax
cmp    $0xa,%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_word_end>:
cmp    $0x20,%dil
ja     1120 <is_word_end+0x20>
mov    $0x1,%eax
movzbl %dil,%ecx
movabs $0x100002201,%rdx
bt     %rcx,%rdx
jae    1120 <is_word_end+0x20>
ret
xor    %eax,%eax
cmp    $0xa,%dil
sete   %al
ret

LLVM IR (-O0):
define i32 @is_word_end(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, 0
br i1 %5, label %22, label %6
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp eq i32 %8, 32
br i1 %9, label %22, label %10
10: ; preds = %6
%11 = load i8, i8* %2
%12 = sext i8 %11 to i32
%13 = icmp eq i32 %12, 9
br i1 %13, label %22, label %14
14: ; preds = %10
%15 = load i8, i8* %2
%16 = sext i8 %15 to i32
%17 = icmp eq i32 %16, 13
br i1 %17, label %22, label %18
18: ; preds = %14
%19 = load i8, i8* %2
%20 = sext i8 %19 to i32
%21 = icmp eq i32 %20, 10
br label %22
22: ; preds = %18, %14, %10, %6, %1
%23 = phi i1 [ true, %14 ], [ true, %10 ], [ true, %6 ], [ true, %1 ], [ %21, %18 ]
%24 = zext i1 %23 to i32
ret i32 %24
}

LLVM IR (-O2):
define i32 @is_word_end(i8 signext %0) {
switch i8 %0, label %2 [
i8 32, label %5
i8 13, label %5
i8 9, label %5
i8 0, label %5
]
2: ; preds = %1
%3 = icmp eq i8 %0, 10
%4 = zext i1 %3 to i32
br label %5
5: ; preds = %1, %1, %1, %1, %2
%6 = phi i32 [ 1, %1 ], [ %4, %2 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ]
ret i32 %6
}
long long rthal_llmi(int i, int j) { return (long long)i * j; }


x86 assembly (clang, -O0):
<rthal_llmi>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movslq -0x4(%rbp),%rax
movslq -0x8(%rbp),%rcx
imul   %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rthal_llmi>:
movslq %edi,%rcx
movslq %esi,%rax
imul   %rcx,%rax
ret

LLVM IR (-O0):
define i64 @rthal_llmi(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 = sext i32 %5 to i64
%7 = load i32, i32* %4
%8 = sext i32 %7 to i64
%9 = mul nsw i64 %6, %8
ret i64 %9
}

LLVM IR (-O2):
define i64 @rthal_llmi(i32 %0, i32 %1) {
%3 = sext i32 %0 to i64
%4 = sext i32 %1 to i64
%5 = mul nsw i64 %4, %3
ret i64 %5
}
int CRYPTO_remove_all_info(void) { return (0); }


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

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

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

LLVM IR (-O2):
define i32 @CRYPTO_remove_all_info() {
ret i32 0
}
/* Type definitions */
typedef char uint8_t;

/* Variables and functions */
int read(int, char *, int);
int serialport_readbyte(int fd, uint8_t *b) {
  char rb[1];
  int n = read(fd, rb, 1);
  if (n == -1)
    return -1;
  *b = rb[0];
  return 0;
}


x86 assembly (clang, -O0):
<serialport_readbyte>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%edi
lea    -0x11(%rbp),%rsi
mov    $0x1,%edx
call   1030 <read@plt>
mov    %eax,-0x18(%rbp)
cmpl   $0xffffffff,-0x18(%rbp)
jne    1149 <serialport_readbyte+0x39>
movl   $0xffffffff,-0x4(%rbp)
jmp    1159 <serialport_readbyte+0x49>
mov    -0x11(%rbp),%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<serialport_readbyte>:
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%rbx
lea    0xf(%rsp),%rsi
mov    $0x1,%edx
call   1030 <read@plt>
cmp    $0xffffffff,%eax
je     1136 <serialport_readbyte+0x26>
mov    0xf(%rsp),%al
mov    %al,(%rbx)
xor    %eax,%eax
jmp    113b <serialport_readbyte+0x2b>
mov    $0xffffffff,%eax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @serialport_readbyte(i32 %0, i8* nocapture writeonly %1) {
%3 = alloca [1 x i8]
%4 = getelementptr inbounds [1 x i8], [1 x i8]* %3, i64 0, i64 0
%5 = call i32 @read(i32 %0, i8* %4, i32 1)
%6 = icmp eq i32 %5, -1
br i1 %6, label %9, label %7
7: ; preds = %2
%8 = load i8, i8* %4
store i8 %8, i8* %1
br label %9
9: ; preds = %2, %7
%10 = phi i32 [ 0, %7 ], [ -1, %2 ]
ret i32 %10
}
int main2() {
  int *arr2 = (int *)0x04000000;
  *(arr2 + 2) = 0;
  for (int i = 0; i <= 20; i++) {
    *(arr2 + 2) += i;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main2>:
push   %rbp
mov    %rsp,%rbp
mov    $0x4000000,%eax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movl   $0x0,0x8(%rax)
movl   $0x0,-0xc(%rbp)
cmpl   $0x14,-0xc(%rbp)
jg     1144 <main2+0x44>
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
add    0x8(%rax),%ecx
mov    %ecx,0x8(%rax)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    111f <main2+0x1f>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main2>:
movl   $0xd2,0x4000008
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @main2() {
%1 = alloca i32*
%2 = alloca i32
store i32* inttoptr (i64 67108864 to i32*), i32** %1
%3 = load i32*, i32** %1
%4 = getelementptr inbounds i32, i32* %3, i64 2
store i32 0, i32* %4
store i32 0, i32* %2
br label %5
5: ; preds = %14, %0
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 20
br i1 %7, label %8, label %17
8: ; preds = %5
%9 = load i32, i32* %2
%10 = load i32*, i32** %1
%11 = getelementptr inbounds i32, i32* %10, i64 2
%12 = load i32, i32* %11
%13 = add nsw i32 %12, %9
store i32 %13, i32* %11
br label %14
14: ; preds = %8
%15 = load i32, i32* %2
%16 = add nsw i32 %15, 1
store i32 %16, i32* %2
br label %5
17: ; preds = %5
ret i32 0
}

LLVM IR (-O2):
define i32 @main2() {
store i32 210, i32* inttoptr (i64 67108872 to i32*)
ret i32 0
}
int test_imm_02int8_reg(signed char val) {
  return ((val) & (-0x02 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_02int8_reg>:
cmp    $0x2,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmovb  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_02int8_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, -2
%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_02int8_reg(i8 signext %0) {
%2 = icmp ult i8 %0, 2
%3 = select i1 %2, i32 -40, i32 -20
ret i32 %3
}
void file5() { printf("Control in function %s\n", __func__); }


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

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

LLVM IR (-O0):
@.str = [24 x i8] c"Control in function %s\0A\00"
@__func__.file5 = [6 x i8] c"file5\00"
define void @file5() {
%1 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @__func__.file5, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [24 x i8] c"Control in function %s\0A\00"
@__func__.file5 = [6 x i8] c"file5\00"
define void @file5() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @__func__.file5, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ err_sys(char *);
int socketpair(int, int, int, int *);
void Socketpair(int family, int type, int protocol, int *fd) {
  int n;
  if ((n = socketpair(family, type, protocol, fd)) < 0)
    err_sys("socketpair error");
}


x86 assembly (clang, -O0):
<Socketpair>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %rcx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x18(%rbp),%rcx
call   1040 <socketpair@plt>
mov    %eax,-0x1c(%rbp)
cmp    $0x0,%eax
jge    115f <Socketpair+0x3f>
lea    0xea6(%rip),%rdi
call   1030 <err_sys@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Socketpair>:
push   %rax
call   1040 <socketpair@plt>
test   %eax,%eax
js     112c <Socketpair+0xc>
pop    %rax
ret
lea    0xecd(%rip),%rdi
pop    %rax
jmp    1030 <err_sys@plt>

LLVM IR (-O0):
@.str = [17 x i8] c"socketpair error\00"
define void @Socketpair(i32 %0, i32 %1, i32 %2, i32* %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32*
%9 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32* %3, i32** %8
%10 = load i32, i32* %5
%11 = load i32, i32* %6
%12 = load i32, i32* %7
%13 = load i32*, i32** %8
%14 = call i32 @socketpair(i32 %10, i32 %11, i32 %12, i32* %13)
store i32 %14, i32* %9
%15 = icmp slt i32 %14, 0
br i1 %15, label %16, label %18
16: ; preds = %4
%17 = call i32 @err_sys(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
br label %18
18: ; preds = %16, %4
ret void
}

LLVM IR (-O2):
@.str = [17 x i8] c"socketpair error\00"
define void @Socketpair(i32 %0, i32 %1, i32 %2, i32* %3) {
%5 = tail call i32 @socketpair(i32 %0, i32 %1, i32 %2, i32* %3)
%6 = icmp slt i32 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %4
%8 = tail call i32 @err_sys(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
br label %9
9: ; preds = %7, %4
ret void
}
int foo(int z0, unsigned z1) {
  int t0 = (z0 == 0);
  int t1 = (z1 == 0);
  int t2 = (t0 & t1);
  return t2;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
and    -0x10(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
xor    %eax,%eax
or     %esi,%edi
sete   %al
ret

LLVM IR (-O0):
define i32 @foo(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%8 = load i32, i32* %3
%9 = icmp eq i32 %8, 0
%10 = zext i1 %9 to i32
store i32 %10, i32* %5
%11 = load i32, i32* %4
%12 = icmp eq i32 %11, 0
%13 = zext i1 %12 to i32
store i32 %13, i32* %6
%14 = load i32, i32* %5
%15 = load i32, i32* %6
%16 = and i32 %14, %15
store i32 %16, i32* %7
%17 = load i32, i32* %7
ret i32 %17
}

LLVM IR (-O2):
define i32 @foo(i32 %0, i32 %1) {
%3 = or i32 %1, %0
%4 = icmp eq i32 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
unsigned int unsignedint_ignoring_unsignedint(unsigned int x, unsigned int y) {
  return x;
}


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

x86 assembly (clang, -O2):
<unsignedint_ignoring_unsignedint>:
mov    %edi,%eax
ret

LLVM IR (-O0):
define i32 @unsignedint_ignoring_unsignedint(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
ret i32 %5
}

LLVM IR (-O2):
define i32 @unsignedint_ignoring_unsignedint(i32 returned %0, i32 %1) {
ret i32 %0
}
/* Type definitions */
typedef int /*<<< orphan*/ X509;

/* Variables and functions */
char *X509_NAME_oneline(int /*<<< orphan*/, int /*<<< orphan*/ *,
                        int /*<<< orphan*/);
int /*<<< orphan*/ X509_get_subject_name(int /*<<< orphan*/ *);
char *ssl_x509_subject(X509 *crt) {
  return X509_NAME_oneline(X509_get_subject_name(crt), NULL, 0);
}


x86 assembly (clang, -O0):
<ssl_x509_subject>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <X509_get_subject_name@plt>
mov    %eax,%edi
xor    %eax,%eax
mov    %eax,%esi
xor    %edx,%edx
call   1030 <X509_NAME_oneline@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ssl_x509_subject>:
push   %rax
call   1040 <X509_get_subject_name@plt>
mov    %eax,%edi
xor    %esi,%esi
xor    %edx,%edx
pop    %rax
jmp    1030 <X509_NAME_oneline@plt>

LLVM IR (-O0):
define i8* @ssl_x509_subject(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @X509_get_subject_name(i32* %3)
%5 = call i8* @X509_NAME_oneline(i32 %4, i32* null, i32 0)
ret i8* %5
}

LLVM IR (-O2):
define i8* @ssl_x509_subject(i32* %0) {
%2 = tail call i32 @X509_get_subject_name(i32* %0)
%3 = tail call i8* @X509_NAME_oneline(i32 %2, i32* null, i32 0)
ret i8* %3
}
int small_leaf(int arg) { return arg * 2; }


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

x86 assembly (clang, -O2):
<small_leaf>:
lea    (%rdi,%rdi,1),%eax
ret

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

LLVM IR (-O2):
define i32 @small_leaf(i32 %0) {
%2 = shl nsw i32 %0, 1
ret i32 %2
}
double fm(double x, double y) { return x + y; }


x86 assembly (clang, -O0):
<fm>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
addsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<fm>:
addsd  %xmm1,%xmm0
ret

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

LLVM IR (-O2):
define double @fm(double %0, double %1) {
%3 = fadd double %0, %1
ret double %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
extern void shmem_collect64(void *target, const void *source, size_t nlong,
                            int PE_start, int logPE_stride, int PE_size,
                            long *pSync) {
  printf("\nOpenSHMEM Analyzer\n");
}


x86 assembly (clang, -O0):
<shmem_collect64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    0x10(%rbp),%rax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8d,-0x20(%rbp)
mov    %r9d,-0x24(%rbp)
lea    0xec6(%rip),%rdi
call   1030 <printf@plt>
add    $0x30,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [21 x i8] c"\0AOpenSHMEM Analyzer\0A\00"
define void @shmem_collect64(i8* %0, i8* %1, i64 %2, i32 %3, i32 %4, i32 %5, i64* %6) {
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca i64
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i64*
store i8* %0, i8** %8
store i8* %1, i8** %9
store i64 %2, i64* %10
store i32 %3, i32* %11
store i32 %4, i32* %12
store i32 %5, i32* %13
store i64* %6, i64** %14
%15 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [20 x i8] c"\0AOpenSHMEM Analyzer\00"
define void @shmem_collect64(i8* nocapture readnone %0, i8* nocapture readnone %1, i64 %2, i32 %3, i32 %4, i32 %5, i64* nocapture readnone %6) {
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
ret void
}
int *hop(int *elem) { return elem + (*elem); }


x86 assembly (clang, -O0):
<hop>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x8(%rbp),%rcx
movslq (%rcx),%rcx
shl    $0x2,%rcx
add    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hop>:
movslq (%rdi),%rax
lea    (%rdi,%rax,4),%rax
ret

LLVM IR (-O0):
define i32* @hop(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32*, i32** %2
%5 = load i32, i32* %4
%6 = sext i32 %5 to i64
%7 = getelementptr inbounds i32, i32* %3, i64 %6
ret i32* %7
}

LLVM IR (-O2):
define i32* @hop(i32* %0) {
%2 = load i32, i32* %0
%3 = sext i32 %2 to i64
%4 = getelementptr inbounds i32, i32* %0, i64 %3
ret i32* %4
}
/* Variables and functions */
int /*<<< orphan*/ itc_net_dup2_p_multiple_time();
int /*<<< orphan*/ itc_net_dup_p_multiple_time();
int itc_net_dup_main(void) {
  itc_net_dup_p_multiple_time();
  itc_net_dup2_p_multiple_time();
  return 0;
}


x86 assembly (clang, -O0):
<itc_net_dup_main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <itc_net_dup_p_multiple_time@plt>
mov    $0x0,%al
call   1040 <itc_net_dup2_p_multiple_time@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<itc_net_dup_main>:
push   %rax
xor    %eax,%eax
call   1030 <itc_net_dup_p_multiple_time@plt>
xor    %eax,%eax
call   1040 <itc_net_dup2_p_multiple_time@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @itc_net_dup_main() {
%1 = call i32 (...) @itc_net_dup_p_multiple_time()
%2 = call i32 (...) @itc_net_dup2_p_multiple_time()
ret i32 0
}

LLVM IR (-O2):
define i32 @itc_net_dup_main() {
%1 = tail call i32 (...) @itc_net_dup_p_multiple_time()
%2 = tail call i32 (...) @itc_net_dup2_p_multiple_time()
ret i32 0
}