xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ checkPalindrome();
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int main(void) {
  int isChecking = 1;
  while (isChecking) {
    checkPalindrome();
    printf("Check a New Phrase (1 = Yes, 0 = No)? ");
    scanf(" %d", &isChecking);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1178 <main+0x48>
mov    $0x0,%al
call   1030 <checkPalindrome@plt>
lea    0xea2(%rip),%rdi
call   1040 <printf@plt>
lea    0xebd(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
jmp    1146 <main+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
movl   $0x1,0xc(%rsp)
lea    0xeb8(%rip),%r14
lea    0xed8(%rip),%r15
lea    0xc(%rsp),%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
xor    %eax,%eax
call   1030 <checkPalindrome@plt>
mov    %r14,%rdi
call   1040 <printf@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
call   1050 <scanf@plt>
cmpl   $0x0,0xc(%rsp)
jne    1160 <main+0x30>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [39 x i8] c"Check a New Phrase (1 = Yes, 0 = No)? \00"
@.str.1 = [4 x i8] c" %d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 1, i32* %2
br label %3
3: ; preds = %6, %0
%4 = load i32, i32* %2
%5 = icmp ne i32 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %3
%7 = call i32 (...) @checkPalindrome()
%8 = call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0))
%9 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32* %2)
br label %3
10: ; preds = %3
ret i32 0
}

LLVM IR (-O2):
@.str = [39 x i8] c"Check a New Phrase (1 = Yes, 0 = No)? \00"
@.str.1 = [4 x i8] c" %d\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 1, i32* %1
br label %3
3: ; preds = %0, %3
%4 = call i32 (...) @checkPalindrome()
%5 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%7 = load i32, i32* %1
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %3
9: ; preds = %3
ret i32 0
}
void __attribute__((weak)) fsmc_isr() { debug_handler(__FUNCTION__); }


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

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

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

LLVM IR (-O2):
@__FUNCTION__.fsmc_isr = [9 x i8] c"fsmc_isr\00"
define weak void @fsmc_isr() {
%1 = tail call i32 (i8*, ...) bitcast (i32 (...)* @debug_handler to i32 (i8*, ...)*)(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @__FUNCTION__.fsmc_isr, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ baz(int /*<<< orphan*/, int);
void taz() { baz(0, 2); }


x86 assembly (clang, -O0):
<taz>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
mov    $0x2,%esi
call   1030 <baz@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<taz>:
xor    %edi,%edi
mov    $0x2,%esi
jmp    1030 <baz@plt>

LLVM IR (-O0):
define void @taz() {
%1 = call i32 @baz(i32 0, i32 2)
ret void
}

LLVM IR (-O2):
define void @taz() {
%1 = tail call i32 @baz(i32 0, i32 2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void our_exit2(void) { printf("second exit handler\n"); }


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

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

LLVM IR (-O0):
@.str = [21 x i8] c"second exit handler\0A\00"
define void @our_exit2() {
%1 = 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"second exit handler\00"
define void @our_exit2() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
ret void
}
void crStrcpy(char *dest, const char *src) {
  while ((*dest++ = *src++))
    ;
}


x86 assembly (clang, -O0):
<crStrcpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%al
mov    -0x8(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %al,(%rcx)
cmp    $0x0,%al
je     113b <crStrcpy+0x3b>
jmp    110c <crStrcpy+0xc>
pop    %rbp
ret

x86 assembly (clang, -O2):
<crStrcpy>:
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movzbl (%rsi,%rax,1),%ecx
mov    %cl,(%rdi,%rax,1)
add    $0x1,%rax
test   %cl,%cl
jne    1110 <crStrcpy+0x10>
ret

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

LLVM IR (-O2):
define void @crStrcpy(i8* nocapture writeonly %0, i8* nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %0, %2 ], [ %8, %3 ]
%5 = phi i8* [ %1, %2 ], [ %6, %3 ]
%6 = getelementptr inbounds i8, i8* %5, i64 1
%7 = load i8, i8* %5
%8 = getelementptr inbounds i8, i8* %4, i64 1
store i8 %7, i8* %4
%9 = icmp eq i8 %7, 0
br i1 %9, label %10, label %3
10: ; preds = %3
ret void
}
const char *mobi_version(void) { return "0.1"; }


x86 assembly (clang, -O0):
<mobi_version>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mobi_version>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [4 x i8] c"0.1\00"
define i8* @mobi_version() {
ret i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [4 x i8] c"0.1\00"
define i8* @mobi_version() {
ret i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0)
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ ts_get_unitstart(int /*<<< orphan*/ *);
int /*<<< orphan*/ *ts_payload(int /*<<< orphan*/ *);
uint8_t *ts_section(uint8_t *p_ts) {
  if (!ts_get_unitstart(p_ts))
    return ts_payload(p_ts);
  return ts_payload(p_ts) + 1;
}


x86 assembly (clang, -O0):
<ts_section>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <ts_get_unitstart@plt>
cmp    $0x0,%eax
jne    1150 <ts_section+0x30>
mov    -0x10(%rbp),%rdi
call   1030 <ts_payload@plt>
mov    %rax,-0x8(%rbp)
jmp    1161 <ts_section+0x41>
mov    -0x10(%rbp),%rdi
call   1030 <ts_payload@plt>
add    $0x4,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ts_section>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <ts_get_unitstart@plt>
xor    %ebx,%ebx
test   %eax,%eax
setne  %bl
mov    %r14,%rdi
call   1030 <ts_payload@plt>
lea    (%rax,%rbx,4),%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i32* @ts_section(i32* %0) {
%2 = tail call i32 @ts_get_unitstart(i32* %0)
%3 = icmp ne i32 %2, 0
%4 = tail call i32* @ts_payload(i32* %0)
%5 = zext i1 %3 to i64
%6 = getelementptr i32, i32* %4, i64 %5
ret i32* %6
}
/* Variables and functions */
int /*<<< orphan*/ px_free(char *);
char *px_strlstrip(char *);
char *px_strrstrip(char *);
char *px_strstrip(char *string) {
  char *tmp = px_strrstrip(string);
  string = px_strlstrip(tmp);
  px_free(tmp);
  return string;
}


x86 assembly (clang, -O0):
<px_strstrip>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <px_strrstrip@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <px_strlstrip@plt>
mov    %rax,-0x8(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <px_free@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<px_strstrip>:
push   %r14
push   %rbx
push   %rax
call   1050 <px_strrstrip@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1040 <px_strlstrip@plt>
mov    %rax,%r14
mov    %rbx,%rdi
call   1030 <px_free@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @px_strstrip(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i8* @px_strrstrip(i8* %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = call i8* @px_strlstrip(i8* %6)
store i8* %7, i8** %2
%8 = load i8*, i8** %3
%9 = call i32 @px_free(i8* %8)
%10 = load i8*, i8** %2
ret i8* %10
}

LLVM IR (-O2):
define i8* @px_strstrip(i8* %0) {
%2 = tail call i8* @px_strrstrip(i8* %0)
%3 = tail call i8* @px_strlstrip(i8* %2)
%4 = tail call i32 @px_free(i8* %2)
ret i8* %3
}
int test_imm_19int16_mem(short *val) {
  return ((*val) & (0x19 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_19int16_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movswl (%rax),%edx
and    $0x19,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test_imm_19int16_mem(i16* %0) {
%2 = alloca i16*
store i16* %0, i16** %2
%3 = load i16*, i16** %2
%4 = load i16, i16* %3
%5 = sext i16 %4 to i32
%6 = and i32 %5, 25
%7 = icmp ne i32 %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_19int16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, 25
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
void write_signature(void) { *((unsigned int *)0x0040) = 0x05B1; }


x86 assembly (clang, -O0):
<write_signature>:
push   %rbp
mov    %rsp,%rbp
mov    $0x40,%eax
movl   $0x5b1,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_signature>:
movl   $0x5b1,0x40
ret

LLVM IR (-O0):
define void @write_signature() {
store i32 1457, i32* inttoptr (i64 64 to i32*)
ret void
}

LLVM IR (-O2):
define void @write_signature() {
store i32 1457, i32* inttoptr (i64 64 to i32*)
ret void
}
/* Variables and functions */
void *memchr(const void *s, int c, size_t n) {
  const char *p = (const char *)s;
  while (n--) {
    if (*p == c) {
      return (void *)p;
    }
    p++;
  }
  return NULL;
}


x86 assembly (clang, -O0):
<memchr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,%rcx
add    $0xffffffffffffffff,%rcx
mov    %rcx,-0x20(%rbp)
cmp    $0x0,%rax
je     115e <memchr+0x5e>
mov    -0x28(%rbp),%rax
movsbl (%rax),%eax
cmp    -0x14(%rbp),%eax
jne    114d <memchr+0x4d>
mov    -0x28(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1166 <memchr+0x66>
mov    -0x28(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x28(%rbp)
jmp    1117 <memchr+0x17>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<memchr>:
test   %rdx,%rdx
je     1124 <memchr+0x24>
mov    %rdi,%rax
nopl   0x0(%rax,%rax,1)
movsbl (%rax),%ecx
cmp    %esi,%ecx
je     1126 <memchr+0x26>
add    $0xffffffffffffffff,%rdx
add    $0x1,%rax
test   %rdx,%rdx
jne    1110 <memchr+0x10>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i8* @memchr(i8* %0, i32 %1, i64 %2) {
%4 = icmp eq i64 %2, 0
br i1 %4, label %15, label %5
5: ; preds = %3, %12
%6 = phi i64 [ %8, %12 ], [ %2, %3 ]
%7 = phi i8* [ %13, %12 ], [ %0, %3 ]
%8 = add i64 %6, -1
%9 = load i8, i8* %7
%10 = sext i8 %9 to i32
%11 = icmp eq i32 %10, %1
br i1 %11, label %15, label %12
12: ; preds = %5
%13 = getelementptr inbounds i8, i8* %7, i64 1
%14 = icmp eq i64 %8, 0
br i1 %14, label %15, label %5
15: ; preds = %5, %12, %3
%16 = phi i8* [ null, %3 ], [ null, %12 ], [ %7, %5 ]
ret i8* %16
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  fprintf(
      stderr,
      " usage:\n"
      "    ./server [-p portnum] [-b backlog_conns] [-t numthreads]\n"
      "       -p  portnum:        use portnum as the listen port for server\n"
      "       -b: backlog_conns   the number of backlog connections\n"
      "       -t: numthreads      the number of execution threads\n"
      "       -h:                 print out this help message\n"
      "\n");
}


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

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [315 x i8] c" usage:\0A ./server [-p portnum] [-b backlog_conns] [-t numthreads]\0A -p portnum: use portnum as the listen port for server\0A -b: backlog_conns the number of backlog connections\0A -t: numthreads the number of execution threads\0A -h: print out this help message\0A\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([315 x i8], [315 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [315 x i8] c" usage:\0A ./server [-p portnum] [-b backlog_conns] [-t numthreads]\0A -p portnum: use portnum as the listen port for server\0A -b: backlog_conns the number of backlog connections\0A -t: numthreads the number of execution threads\0A -h: print out this help message\0A\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([315 x i8], [315 x i8]* @.str, i64 0, i64 0))
ret void
}
int is_space(const char c) {
  return c == ' ' || c == '\t' || c == '\n' || c == '\v' || c == '\f' ||
         c == '\r';
}


x86 assembly (clang, -O0):
<is_space>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x20,%ecx
mov    %al,-0x2(%rbp)
je     1171 <is_space+0x71>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x9,%ecx
mov    %al,-0x2(%rbp)
je     1171 <is_space+0x71>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0xa,%ecx
mov    %al,-0x2(%rbp)
je     1171 <is_space+0x71>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0xb,%ecx
mov    %al,-0x2(%rbp)
je     1171 <is_space+0x71>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0xc,%ecx
mov    %al,-0x2(%rbp)
je     1171 <is_space+0x71>
movsbl -0x1(%rbp),%eax
cmp    $0xd,%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_space>:
mov    $0x1,%eax
lea    -0x9(%rdi),%ecx
cmp    $0x4,%cl
jae    110e <is_space+0xe>
ret
cmp    $0x20,%dil
je     110d <is_space+0xd>
xor    %eax,%eax
cmp    $0xd,%dil
sete   %al
ret

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

LLVM IR (-O2):
define i32 @is_space(i8 signext %0) {
switch i8 %0, label %2 [
i8 32, label %5
i8 12, label %5
i8 11, label %5
i8 10, label %5
i8 9, label %5
]
2: ; preds = %1
%3 = icmp eq i8 %0, 13
%4 = zext i1 %3 to i32
br label %5
5: ; preds = %1, %1, %1, %1, %1, %2
%6 = phi i32 [ 1, %1 ], [ %4, %2 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ]
ret i32 %6
}
int emacs_spell_insert_func(const struct cmd_info *ci) { return 1; }


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

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

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

LLVM IR (-O2):
%struct.cmd_info = type opaque
define i32 @emacs_spell_insert_func(%struct.cmd_info* nocapture readnone %0) {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ gsm_hex_from_byte(char *, int);
void gsm_hex_from_short(char *hex, int val) {
  gsm_hex_from_byte(hex, (val >> 8));
  gsm_hex_from_byte(hex + 2, val);
}


x86 assembly (clang, -O0):
<gsm_hex_from_short>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
sar    $0x8,%esi
call   1030 <gsm_hex_from_byte@plt>
mov    -0x8(%rbp),%rdi
add    $0x2,%rdi
mov    -0xc(%rbp),%esi
call   1030 <gsm_hex_from_byte@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gsm_hex_from_short>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
sar    $0x8,%esi
call   1030 <gsm_hex_from_byte@plt>
add    $0x2,%rbx
mov    %rbx,%rdi
mov    %ebp,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <gsm_hex_from_byte@plt>

LLVM IR (-O0):
define void @gsm_hex_from_short(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = load i32, i32* %4
%7 = ashr i32 %6, 8
%8 = call i32 @gsm_hex_from_byte(i8* %5, i32 %7)
%9 = load i8*, i8** %3
%10 = getelementptr inbounds i8, i8* %9, i64 2
%11 = load i32, i32* %4
%12 = call i32 @gsm_hex_from_byte(i8* %10, i32 %11)
ret void
}

LLVM IR (-O2):
define void @gsm_hex_from_short(i8* %0, i32 %1) {
%3 = ashr i32 %1, 8
%4 = tail call i32 @gsm_hex_from_byte(i8* %0, i32 %3)
%5 = getelementptr inbounds i8, i8* %0, i64 2
%6 = tail call i32 @gsm_hex_from_byte(i8* %5, i32 %1)
ret void
}
/* Variables and functions */
char const *gu_str_advance(char const *, int);
const char *gu_str_table_rows_begin(const char *str, size_t n) {
  return gu_str_advance(str, 3 + n);
}


x86 assembly (clang, -O0):
<gu_str_table_rows_begin>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rax
add    $0x3,%rax
mov    %eax,%esi
call   1030 <gu_str_advance@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gu_str_table_rows_begin>:
add    $0x3,%esi
jmp    1030 <gu_str_advance@plt>

LLVM IR (-O0):
define i8* @gu_str_table_rows_begin(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i8*, i8** %3
%6 = load i64, i64* %4
%7 = add i64 3, %6
%8 = trunc i64 %7 to i32
%9 = call i8* @gu_str_advance(i8* %5, i32 %8)
ret i8* %9
}

LLVM IR (-O2):
define i8* @gu_str_table_rows_begin(i8* %0, i64 %1) {
%3 = trunc i64 %1 to i32
%4 = add i32 %3, 3
%5 = tail call i8* @gu_str_advance(i8* %0, i32 %4)
ret i8* %5
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
uint8_t signum_fun_uint8_t(uint8_t a) { return (a > 0); }


x86 assembly (clang, -O0):
<signum_fun_uint8_t>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
setg   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<signum_fun_uint8_t>:
xor    %eax,%eax
test   %edi,%edi
setg   %al
ret

LLVM IR (-O0):
define i32 @signum_fun_uint8_t(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sgt i32 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @signum_fun_uint8_t(i32 %0) {
%2 = icmp sgt i32 %0, 0
%3 = zext i1 %2 to i32
ret i32 %3
}
void updateDisplay(int displayMode) {}


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

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

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

LLVM IR (-O2):
define void @updateDisplay(i32 %0) {
ret void
}
int power(n) { return power_helper(n, n, n); }


x86 assembly (clang, -O0):
<power>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x4(%rbp),%esi
mov    -0x4(%rbp),%edx
mov    $0x0,%al
call   1030 <power_helper@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<power>:
mov    %edi,%esi
mov    %edi,%edx
xor    %eax,%eax
jmp    1030 <power_helper@plt>

LLVM IR (-O0):
define i32 @power(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* %2
%5 = load i32, i32* %2
%6 = call i32 (i32, i32, i32, ...) bitcast (i32 (...)* @power_helper to i32 (i32, i32, i32, ...)*)(i32 %3, i32 %4, i32 %5)
ret i32 %6
}

LLVM IR (-O2):
define i32 @power(i32 %0) {
%2 = tail call i32 (i32, i32, i32, ...) bitcast (i32 (...)* @power_helper to i32 (i32, i32, i32, ...)*)(i32 %0, i32 %0, i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int st_in_debug() {
  printf("st_in_debug\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [13 x i8] c"st_in_debug\0A\00"
define i32 @st_in_debug() {
%1 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [12 x i8] c"st_in_debug\00"
define i32 @st_in_debug() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ const int64_t;

/* Variables and functions */
int64_t copy_int64_t(const int64_t _val) { return _val; }


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

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

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

LLVM IR (-O2):
define i32 @copy_int64_t(i32 returned %0) {
ret i32 %0
}
void nseel_asm_tan_end(void) {}


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

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

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

LLVM IR (-O2):
define void @nseel_asm_tan_end() {
ret void
}
int main() {
  int not ;
  int and;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
void EnableIntP0() {}


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

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

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

LLVM IR (-O2):
define void @EnableIntP0() {
ret void
}
/* Variables and functions */
int strlen(char *);
void cut_tail(char *s) {
  int i;
  for (i = strlen(s) - 1; i >= 0 && ' ' == s[i]; i--)
    s[i] = 0;
}


x86 assembly (clang, -O0):
<cut_tail>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
sub    $0x1,%eax
mov    %eax,-0xc(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0xc(%rbp)
mov    %al,-0xd(%rbp)
jl     1153 <cut_tail+0x43>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%ecx
mov    $0x20,%eax
cmp    %ecx,%eax
sete   %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
test   $0x1,%al
jne    1163 <cut_tail+0x53>
jmp    117d <cut_tail+0x6d>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
jmp    112b <cut_tail+0x1b>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cut_tail>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
test   %eax,%eax
jle    1147 <cut_tail+0x37>
mov    %eax,%eax
add    $0x1,%rax
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
lea    -0x2(%rax),%ecx
cmpb   $0x20,(%rbx,%rcx,1)
jne    1147 <cut_tail+0x37>
movb   $0x0,(%rbx,%rcx,1)
add    $0xffffffffffffffff,%rax
cmp    $0x1,%rax
ja     1130 <cut_tail+0x20>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @cut_tail(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = icmp sgt i32 %2, 0
br i1 %3, label %4, label %15
4: ; preds = %1
%5 = zext i32 %2 to i64
br label %6
6: ; preds = %4, %13
%7 = phi i64 [ %5, %4 ], [ %8, %13 ]
%8 = add nsw i64 %7, -1
%9 = and i64 %8, 4294967295
%10 = getelementptr inbounds i8, i8* %0, i64 %9
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 32
br i1 %12, label %13, label %15
13: ; preds = %6
store i8 0, i8* %10
%14 = icmp ugt i64 %7, 1
br i1 %14, label %6, label %15
15: ; preds = %6, %13, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
char *subString(char *, int, int);
int main() {
  char *sub = subString("I love C !", 2, 4);
  printf("%s", sub);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
mov    $0x2,%esi
mov    $0x4,%edx
call   1040 <subString@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
lea    0xeb7(%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
mov    $0x2,%esi
mov    $0x4,%edx
call   1040 <subString@plt>
lea    0xecd(%rip),%rdi
mov    %rax,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [11 x i8] c"I love C !\00"
@.str.1 = [3 x i8] c"%s\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
store i32 0, i32* %1
%3 = call i8* @subString(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 2, i32 4)
store i8* %3, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %4)
ret i32 0
}

LLVM IR (-O2):
@.str = [11 x i8] c"I love C !\00"
@.str.1 = [3 x i8] c"%s\00"
define i32 @main() {
%1 = tail call i8* @subString(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 2, i32 4)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ UPnPResponse_RenderingControl_GetGreenVideoGain(void *, int);
int /*<<< orphan*/ printf(char *, unsigned int);
void UPnPRenderingControl_GetGreenVideoGain(void *upnptoken,
                                            unsigned int InstanceID) {
  printf("Invoke: UPnPRenderingControl_GetGreenVideoGain(%u);\r\n", InstanceID);
  UPnPResponse_RenderingControl_GetGreenVideoGain(upnptoken, 250);
}


x86 assembly (clang, -O0):
<UPnPRenderingControl_GetGreenVideoGain>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%esi
lea    0xec7(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rdi
mov    $0xfa,%esi
call   1040 <UPnPResponse_RenderingControl_GetGreenVideoGain@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [54 x i8] c"Invoke: UPnPRenderingControl_GetGreenVideoGain(%u);\0D\0A\00"
define void @UPnPRenderingControl_GetGreenVideoGain(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = call i32 @printf(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = load i8*, i8** %3
%8 = call i32 @UPnPResponse_RenderingControl_GetGreenVideoGain(i8* %7, i32 250)
ret void
}

LLVM IR (-O2):
@.str = [54 x i8] c"Invoke: UPnPRenderingControl_GetGreenVideoGain(%u);\0D\0A\00"
define void @UPnPRenderingControl_GetGreenVideoGain(i8* %0, i32 %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str, i64 0, i64 0), i32 %1)
%4 = tail call i32 @UPnPResponse_RenderingControl_GetGreenVideoGain(i8* %0, i32 250)
ret void
}
/* Variables and functions */
int Scl_ConGetInSlew_(int /*<<< orphan*/, int);
int /*<<< orphan*/ Scl_ConReadMan();
int Scl_ConGetInSlew(int i) { return Scl_ConGetInSlew_(Scl_ConReadMan(), i); }


x86 assembly (clang, -O0):
<Scl_ConGetInSlew>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <Scl_ConReadMan@plt>
mov    %eax,%edi
mov    -0x4(%rbp),%esi
call   1040 <Scl_ConGetInSlew_@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Scl_ConGetInSlew>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <Scl_ConReadMan@plt>
mov    %eax,%edi
mov    %ebx,%esi
pop    %rbx
jmp    1040 <Scl_ConGetInSlew_@plt>

LLVM IR (-O0):
define i32 @Scl_ConGetInSlew(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @Scl_ConReadMan()
%4 = load i32, i32* %2
%5 = call i32 @Scl_ConGetInSlew_(i32 %3, i32 %4)
ret i32 %5
}

LLVM IR (-O2):
define i32 @Scl_ConGetInSlew(i32 %0) {
%2 = tail call i32 (...) @Scl_ConReadMan()
%3 = tail call i32 @Scl_ConGetInSlew_(i32 %2, i32 %0)
ret i32 %3
}
int test_imm_53uint8_mem(unsigned char *val) {
  return ((*val) & (0x53 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_53uint8_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%edx
and    $0x53,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test_imm_53uint8_mem(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = zext i8 %4 to i32
%6 = and i32 %5, 83
%7 = icmp ne i32 %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_53uint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, 83
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
unsetcmd(argc, argv) char **argv;
{
  char **ap;
  for (ap = argv + 1; *ap; ap++) {
    unsetfunc(*ap);
    unsetvar(*ap);
  }
  return 0;
}


x86 assembly (clang, -O0):
<unsetcmd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmpq   $0x0,(%rax)
je     1176 <unsetcmd+0x56>
mov    -0x18(%rbp),%rax
mov    (%rax),%rdi
mov    $0x0,%al
call   1040 <unsetfunc@plt>
mov    -0x18(%rbp),%rax
mov    (%rax),%rdi
mov    $0x0,%al
call   1030 <unsetvar@plt>
mov    -0x18(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x18(%rbp)
jmp    113b <unsetcmd+0x1b>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<unsetcmd>:
push   %rbx
mov    0x8(%rsi),%rdi
test   %rdi,%rdi
je     115e <unsetcmd+0x3e>
mov    %rsi,%rbx
add    $0x10,%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1040 <unsetfunc@plt>
mov    -0x8(%rbx),%rdi
xor    %eax,%eax
call   1030 <unsetvar@plt>
mov    (%rbx),%rdi
add    $0x8,%rbx
test   %rdi,%rdi
jne    1140 <unsetcmd+0x20>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @unsetcmd(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%6 = load i8**, i8*** %4
%7 = getelementptr inbounds i8*, i8** %6, i64 1
store i8** %7, i8*** %5
br label %8
8: ; preds = %19, %2
%9 = load i8**, i8*** %5
%10 = load i8*, i8** %9
%11 = icmp ne i8* %10, null
br i1 %11, label %12, label %22
12: ; preds = %8
%13 = load i8**, i8*** %5
%14 = load i8*, i8** %13
%15 = call i32 (i8*, ...) bitcast (i32 (...)* @unsetfunc to i32 (i8*, ...)*)(i8* %14)
%16 = load i8**, i8*** %5
%17 = load i8*, i8** %16
%18 = call i32 (i8*, ...) bitcast (i32 (...)* @unsetvar to i32 (i8*, ...)*)(i8* %17)
br label %19
19: ; preds = %12
%20 = load i8**, i8*** %5
%21 = getelementptr inbounds i8*, i8** %20, i32 1
store i8** %21, i8*** %5
br label %8
22: ; preds = %8
ret i32 0
}

LLVM IR (-O2):
define i32 @unsetcmd(i32 %0, i8** nocapture %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = load i8*, i8** %3
%5 = icmp eq i8* %4, null
br i1 %5, label %15, label %6
6: ; preds = %2, %6
%7 = phi i8* [ %13, %6 ], [ %4, %2 ]
%8 = phi i8** [ %12, %6 ], [ %3, %2 ]
%9 = tail call i32 (i8*, ...) bitcast (i32 (...)* @unsetfunc to i32 (i8*, ...)*)(i8* %7)
%10 = load i8*, i8** %8
%11 = tail call i32 (i8*, ...) bitcast (i32 (...)* @unsetvar to i32 (i8*, ...)*)(i8* %10)
%12 = getelementptr inbounds i8*, i8** %8, i64 1
%13 = load i8*, i8** %12
%14 = icmp eq i8* %13, null
br i1 %14, label %15, label %6
15: ; preds = %6, %2
ret i32 0
}
void add_attribute(id) int id;
{}


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

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

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

LLVM IR (-O2):
define void @add_attribute(i32 %0) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ GLint;
typedef int /*<<< orphan*/ GLenum;

/* Variables and functions */
int /*<<< orphan*/ glPixelStorei(int /*<<< orphan*/, int /*<<< orphan*/);
void PixelStorei(GLenum pname, GLint param) { glPixelStorei(pname, param); }


x86 assembly (clang, -O0):
<PixelStorei>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <glPixelStorei@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PixelStorei>:
jmp    1030 <glPixelStorei@plt>

LLVM IR (-O0):
define void @PixelStorei(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 = call i32 @glPixelStorei(i32 %5, i32 %6)
ret void
}

LLVM IR (-O2):
define void @PixelStorei(i32 %0, i32 %1) {
%3 = tail call i32 @glPixelStorei(i32 %0, i32 %1)
ret void
}
unsigned long DCSMZone1ECSLSecurityStatus(void) {
  unsigned long status;
  status = (*((volatile unsigned long *)(0x400FB400 + 0x00000080)));
  if ((status & 0x1000) && ((status & 0x0400) || (status & 0x0100))) {
    return (0);
  } else {
    return (1);
  }
}


x86 assembly (clang, -O0):
<DCSMZone1ECSLSecurityStatus>:
push   %rbp
mov    %rsp,%rbp
mov    $0x400fb480,%eax
mov    (%rax),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
and    $0x1000,%rax
cmp    $0x0,%rax
je     1159 <DCSMZone1ECSLSecurityStatus+0x59>
mov    -0x10(%rbp),%rax
and    $0x400,%rax
cmp    $0x0,%rax
jne    114c <DCSMZone1ECSLSecurityStatus+0x4c>
mov    -0x10(%rbp),%rax
and    $0x100,%rax
cmp    $0x0,%rax
je     1159 <DCSMZone1ECSLSecurityStatus+0x59>
movq   $0x0,-0x8(%rbp)
jmp    1161 <DCSMZone1ECSLSecurityStatus+0x61>
movq   $0x1,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<DCSMZone1ECSLSecurityStatus>:
mov    0x400fb480,%rax
40
test   $0x1000,%eax
sete   %cl
test   $0x500,%eax
sete   %al
or     %cl,%al
movzbl %al,%eax
ret

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

LLVM IR (-O2):
define i64 @DCSMZone1ECSLSecurityStatus() {
%1 = load volatile i64, i64* inttoptr (i64 1074771072 to i64*)
%2 = and i64 %1, 4096
%3 = icmp eq i64 %2, 0
%4 = and i64 %1, 1280
%5 = icmp eq i64 %4, 0
%6 = or i1 %3, %5
%7 = zext i1 %6 to i64
ret i64 %7
}
/* Variables and functions */
unsigned long htons(unsigned long);
unsigned long c_htons(unsigned long val) { return htons(val); }


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

x86 assembly (clang, -O2):
<c_htons>:
jmp    1030 <htons@plt>

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

LLVM IR (-O2):
define i64 @c_htons(i64 %0) {
%2 = tail call i64 @htons(i64 %0)
ret i64 %2
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  unsigned long time;
};
struct TYPE_4__ {
  TYPE_1__ xproperty;
};
typedef TYPE_2__ XEvent;

/* Variables and functions */
void set_XEvent_xproperty_time(void *_p, unsigned long _v) {
  ((XEvent *)_p)->xproperty.time = (unsigned long)_v;
}


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

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

LLVM IR (-O0):
%struct.TYPE_4__ = type { %struct.TYPE_3__ }
%struct.TYPE_3__ = type { i64 }
define void @set_XEvent_xproperty_time(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to %struct.TYPE_4__*
%8 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %7, i32 0, i32 0
%9 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %8, i32 0, i32 0
store i64 %5, i64* %9
ret void
}

LLVM IR (-O2):
define void @set_XEvent_xproperty_time(i8* nocapture writeonly %0, i64 %1) {
%3 = bitcast i8* %0 to i64*
store i64 %1, i64* %3
ret void
}
int seq_engine_check_key_split_range(int mode, int note) {
  switch (mode) {
  case 1:
    if (note < 60) {
      return 1;
    }
    return 0;
  case 2:
    if (note >= 60) {
      return 1;
    }
    return 0;
  case 0:
  default:
    return 1;
  }
}


x86 assembly (clang, -O0):
<seq_engine_check_key_split_range>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
test   %eax,%eax
je     1183 <seq_engine_check_key_split_range+0x83>
jmp    111d <seq_engine_check_key_split_range+0x1d>
mov    -0x10(%rbp),%eax
sub    $0x1,%eax
je     113f <seq_engine_check_key_split_range+0x3f>
jmp    112e <seq_engine_check_key_split_range+0x2e>
mov    -0x10(%rbp),%eax
sub    $0x2,%eax
je     1161 <seq_engine_check_key_split_range+0x61>
jmp    1188 <seq_engine_check_key_split_range+0x88>
cmpl   $0x3c,-0xc(%rbp)
jge    1155 <seq_engine_check_key_split_range+0x55>
movl   $0x1,-0x4(%rbp)
jmp    118f <seq_engine_check_key_split_range+0x8f>
movl   $0x0,-0x4(%rbp)
jmp    118f <seq_engine_check_key_split_range+0x8f>
cmpl   $0x3c,-0xc(%rbp)
jl     1177 <seq_engine_check_key_split_range+0x77>
movl   $0x1,-0x4(%rbp)
jmp    118f <seq_engine_check_key_split_range+0x8f>
movl   $0x0,-0x4(%rbp)
jmp    118f <seq_engine_check_key_split_range+0x8f>
jmp    1188 <seq_engine_check_key_split_range+0x88>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<seq_engine_check_key_split_range>:
cmp    $0x2,%edi
je     1116 <seq_engine_check_key_split_range+0x16>
mov    $0x1,%al
cmp    $0x1,%edi
jne    111c <seq_engine_check_key_split_range+0x1c>
cmp    $0x3c,%esi
setl   %al
movzbl %al,%eax
ret
cmp    $0x3c,%esi
setge  %al
movzbl %al,%eax
ret

LLVM IR (-O0):
define i32 @seq_engine_check_key_split_range(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
switch i32 %6, label %18 [
i32 1, label %7
i32 2, label %12
i32 0, label %17
]
7: ; preds = %2
%8 = load i32, i32* %5
%9 = icmp slt i32 %8, 60
br i1 %9, label %10, label %11
10: ; preds = %7
store i32 1, i32* %3
br label %19
11: ; preds = %7
store i32 0, i32* %3
br label %19
12: ; preds = %2
%13 = load i32, i32* %5
%14 = icmp sge i32 %13, 60
br i1 %14, label %15, label %16
15: ; preds = %12
store i32 1, i32* %3
br label %19
16: ; preds = %12
store i32 0, i32* %3
br label %19
17: ; preds = %2
br label %18
18: ; preds = %2, %17
store i32 1, i32* %3
br label %19
19: ; preds = %18, %16, %15, %11, %10
%20 = load i32, i32* %3
ret i32 %20
}

LLVM IR (-O2):
define i32 @seq_engine_check_key_split_range(i32 %0, i32 %1) {
switch i32 %0, label %7 [
i32 1, label %3
i32 2, label %5
]
3: ; preds = %2
%4 = icmp slt i32 %1, 60
br label %7
5: ; preds = %2
%6 = icmp sgt i32 %1, 59
br label %7
7: ; preds = %2, %5, %3
%8 = phi i1 [ %4, %3 ], [ %6, %5 ], [ true, %2 ]
%9 = zext i1 %8 to i32
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ do_csi(char *, int);
int /*<<< orphan*/ padding(int);
int decic(int pn) {
  do_csi("%d'}", pn);
  padding(10 * pn);
  return 1;
}


x86 assembly (clang, -O0):
<decic>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xecb(%rip),%rdi
call   1030 <do_csi@plt>
imul   $0xa,-0x4(%rbp),%edi
call   1040 <padding@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<decic>:
push   %rbx
mov    %edi,%ebx
lea    0xed6(%rip),%rdi
mov    %ebx,%esi
call   1030 <do_csi@plt>
add    %ebx,%ebx
lea    (%rbx,%rbx,4),%edi
call   1040 <padding@plt>
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"%d'}\00"
define i32 @decic(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @do_csi(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = load i32, i32* %2
%6 = mul nsw i32 10, %5
%7 = call i32 @padding(i32 %6)
ret i32 1
}

LLVM IR (-O2):
@.str = [5 x i8] c"%d'}\00"
define i32 @decic(i32 %0) {
%2 = tail call i32 @do_csi(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %0)
%3 = mul nsw i32 %0, 10
%4 = tail call i32 @padding(i32 %3)
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ buffer_rewind(int /*<<< orphan*/);
void _ensure_buffer_rewind_copes_with_null_buffer(void) { buffer_rewind(0); }


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

x86 assembly (clang, -O2):
<_ensure_buffer_rewind_copes_with_null_buffer>:
xor    %edi,%edi
jmp    1030 <buffer_rewind@plt>

LLVM IR (-O0):
define void @_ensure_buffer_rewind_copes_with_null_buffer() {
%1 = call i32 @buffer_rewind(i32 0)
ret void
}

LLVM IR (-O2):
define void @_ensure_buffer_rewind_copes_with_null_buffer() {
%1 = tail call i32 @buffer_rewind(i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ pollen_interfaces_Gpio_set__E();
void pollen_parts_Led_on__E() {
  { pollen_interfaces_Gpio_set__E(); }
}


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

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

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

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