xunge/DecIR huggingface dataset:
isdigit(c) register int c;
{ return ('0' <= c && c <= '9'); }


x86 assembly (clang, -O0):
<isdigit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
mov    $0x30,%ecx
cmp    -0x4(%rbp),%ecx
mov    %al,-0x5(%rbp)
jg     1124 <isdigit+0x24>
cmpl   $0x39,-0x4(%rbp)
setle  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isdigit>:
add    $0xffffffd0,%edi
xor    %eax,%eax
cmp    $0xa,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @isdigit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sle i32 48, %3
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 57
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ false, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @isdigit(i32 %0) {
%2 = add i32 %0, -48
%3 = icmp ult i32 %2, 10
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ itoa(int, char *);
int /*<<< orphan*/ printf(char *, char *);
int main(void) {
  int n = -1234;
  char s[1000];
  itoa(n, s);
  printf("%s\n", s);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x3f0,%rsp
movl   $0xfffffb2e,-0x4(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x3f0(%rbp),%rsi
call   1040 <itoa@plt>
lea    -0x3f0(%rbp),%rsi
lea    0xeb1(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x3f0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x3f0,%rsp
mov    %rsp,%rbx
mov    $0xfffffb2e,%edi
mov    %rbx,%rsi
call   1040 <itoa@plt>
lea    0xec1(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x3f0,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca [1000 x i8]
%2 = getelementptr inbounds [1000 x i8], [1000 x i8]* %1, i64 0, i64 0
%3 = call i32 @itoa(i32 -1234, i8* %2)
%4 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %2)
ret i32 0
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
scalar_t__ islittleendian();
uint32_t ntohl(uint32_t netlong) {
  if (islittleendian())
    return ((netlong & 0x000000FF) << 24) | ((netlong & 0x0000FF00) << 8) |
           ((netlong & 0x00FF0000) >> 8) | ((netlong & 0xFF000000) >> 24);
  else
    return netlong;
}


x86 assembly (clang, -O0):
<ntohl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <islittleendian@plt>
cmp    $0x0,%rax
je     1169 <ntohl+0x59>
mov    -0x8(%rbp),%eax
and    $0xff,%eax
shl    $0x18,%eax
mov    -0x8(%rbp),%ecx
and    $0xff00,%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%ecx
and    $0xff0000,%ecx
sar    $0x8,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%ecx
and    $0xff000000,%ecx
shr    $0x18,%ecx
or     %ecx,%eax
mov    %eax,-0x4(%rbp)
jmp    116f <ntohl+0x5f>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ntohl>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <islittleendian@plt>
test   %rax,%rax
mov    %ebx,%eax
bswap  %eax
cmove  %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @ntohl(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = call i64 (...) @islittleendian()
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %22
6: ; preds = %1
%7 = load i32, i32* %3
%8 = and i32 %7, 255
%9 = shl i32 %8, 24
%10 = load i32, i32* %3
%11 = and i32 %10, 65280
%12 = shl i32 %11, 8
%13 = or i32 %9, %12
%14 = load i32, i32* %3
%15 = and i32 %14, 16711680
%16 = ashr i32 %15, 8
%17 = or i32 %13, %16
%18 = load i32, i32* %3
%19 = and i32 %18, -16777216
%20 = lshr i32 %19, 24
%21 = or i32 %17, %20
store i32 %21, i32* %2
br label %24
22: ; preds = %1
%23 = load i32, i32* %3
store i32 %23, i32* %2
br label %24
24: ; preds = %22, %6
%25 = load i32, i32* %2
ret i32 %25
}

LLVM IR (-O2):
define i32 @ntohl(i32 %0) {
%2 = tail call i64 (...) @islittleendian()
%3 = icmp eq i64 %2, 0
%4 = tail call i32 @llvm.bswap.i32(i32 %0)
%5 = select i1 %3, i32 %0, i32 %4
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
void function(const char *argType, void *arg) { printf("1: %s\n", argType); }


x86 assembly (clang, -O0):
<function>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<function>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [7 x i8] c"1: %s\0A\00"
define void @function(i8* %0, i8* nocapture readnone %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
unsigned long floor_lg(unsigned long v) {
  return (64l - __builtin_clzl(v) - 1l);
}


x86 assembly (clang, -O0):
<floor_lg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
bsr    %rax,%rax
xor    $0x3f,%rax
movslq %eax,%rcx
mov    $0x40,%eax
sub    %rcx,%rax
sub    $0x1,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<floor_lg>:
bsr    %rdi,%rax
ret

LLVM IR (-O0):
define i64 @floor_lg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i64 @llvm.ctlz.i64(i64 %3, i1 true)
%5 = trunc i64 %4 to i32
%6 = sext i32 %5 to i64
%7 = sub nsw i64 64, %6
%8 = sub nsw i64 %7, 1
ret i64 %8
}

LLVM IR (-O2):
define i64 @floor_lg(i64 %0) {
%2 = tail call i64 @llvm.ctlz.i64(i64 %0, i1 true)
%3 = xor i64 %2, 63
ret i64 %3
}
signed long signedlong_ignoring_signedlonglongint(signed long x,
                                                  signed long long int y) {
  return x;
}


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

x86 assembly (clang, -O2):
<signedlong_ignoring_signedlonglongint>:
mov    %rdi,%rax
ret

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

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

/* Variables and functions */
char EOF;
int /*<<< orphan*/ feof(int /*<<< orphan*/ *);
char getc(int /*<<< orphan*/ *);
int /*<<< orphan*/ perrordie(char *);
char safe_getc(FILE *f) {
  char c = getc(f);
  if (c == EOF && !feof(f))
    perrordie("getc");
  return c;
}


x86 assembly (clang, -O0):
<safe_getc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <getc@plt>
mov    %al,-0x9(%rbp)
movsbl -0x9(%rbp),%eax
mov    0x2e95(%rip),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
jne    117c <safe_getc+0x4c>
mov    -0x8(%rbp),%rdi
call   1030 <feof@plt>
cmp    $0x0,%eax
jne    117c <safe_getc+0x4c>
lea    0xe89(%rip),%rdi
call   1040 <perrordie@plt>
movsbl -0x9(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<safe_getc>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1050 <getc@plt>
mov    %eax,%ebp
mov    0x2ea4(%rip),%rax
cmp    (%rax),%bpl
jne    1161 <safe_getc+0x31>
mov    %rbx,%rdi
call   1030 <feof@plt>
test   %eax,%eax
jne    1161 <safe_getc+0x31>
lea    0xea4(%rip),%rdi
call   1040 <perrordie@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@EOF = global i8 0
@.str = [5 x i8] c"getc\00"
define signext i8 @safe_getc(i32* %0) {
%2 = alloca i32*
%3 = alloca i8
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = call signext i8 @getc(i32* %4)
store i8 %5, i8* %3
%6 = load i8, i8* %3
%7 = sext i8 %6 to i32
%8 = load i8, i8* @EOF
%9 = sext i8 %8 to i32
%10 = icmp eq i32 %7, %9
br i1 %10, label %11, label %17
11: ; preds = %1
%12 = load i32*, i32** %2
%13 = call i32 @feof(i32* %12)
%14 = icmp ne i32 %13, 0
br i1 %14, label %17, label %15
15: ; preds = %11
%16 = call i32 @perrordie(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
br label %17
17: ; preds = %15, %11, %1
%18 = load i8, i8* %3
ret i8 %18
}

LLVM IR (-O2):
@EOF = global i8 0
@.str = [5 x i8] c"getc\00"
define signext i8 @safe_getc(i32* nocapture %0) {
%2 = tail call signext i8 @getc(i32* %0)
%3 = load i8, i8* @EOF
%4 = icmp eq i8 %2, %3
br i1 %4, label %5, label %10
5: ; preds = %1
%6 = tail call i32 @feof(i32* %0)
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %5
%9 = tail call i32 @perrordie(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %8, %5, %1
ret i8 %2
}
int mpui_list_length(void *list) {
  void **l = list;
  int n = 0;
  while (*l++)
    n++;
  return n;
}


x86 assembly (clang, -O0):
<mpui_list_length>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x10(%rbp)
cmpq   $0x0,(%rax)
je     113e <mpui_list_length+0x3e>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1117 <mpui_list_length+0x17>
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mpui_list_length>:
cmpq   $0x0,(%rdi)
je     111d <mpui_list_length+0x1d>
xor    %eax,%eax
nopl   0x0(%rax,%rax,1)
cmpq   $0x0,0x8(%rdi,%rax,8)
lea    0x1(%rax),%rax
jne    1110 <mpui_list_length+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @mpui_list_length(i8* nocapture %0) {
%2 = bitcast i8* %0 to i8**
%3 = load i8*, i8** %2
%4 = icmp eq i8* %3, null
br i1 %4, label %12, label %5
5: ; preds = %1, %5
%6 = phi i32 [ %9, %5 ], [ 0, %1 ]
%7 = phi i8** [ %8, %5 ], [ %2, %1 ]
%8 = getelementptr inbounds i8*, i8** %7, i64 1
%9 = add nuw nsw i32 %6, 1
%10 = load i8*, i8** %8
%11 = icmp eq i8* %10, null
br i1 %11, label %12, label %5
12: ; preds = %5, %1
%13 = phi i32 [ 0, %1 ], [ %9, %5 ]
ret i32 %13
}
/* Variables and functions */
int CHAR_MAX;
int strtol(char const *, int /*<<< orphan*/ *, int);
char cnv(const char *str) {
  int i = strtol(str, NULL, 10);
  if (i == -1)
    i = CHAR_MAX;
  return ((char)i);
}


x86 assembly (clang, -O0):
<cnv>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
mov    $0xa,%edx
call   1030 <strtol@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0xffffffff,-0xc(%rbp)
jne    1147 <cnv+0x37>
mov    0x2ea6(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
movsbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cnv>:
push   %rax
xor    %esi,%esi
mov    $0xa,%edx
call   1030 <strtol@plt>
cmp    $0xffffffff,%eax
jne    112b <cnv+0x1b>
mov    0x2ebf(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
@CHAR_MAX = global i32 0
define signext i8 @cnv(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @strtol(i8* %4, i32* null, i32 10)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = icmp eq i32 %6, -1
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = load i32, i32* @CHAR_MAX
store i32 %9, i32* %3
br label %10
10: ; preds = %8, %1
%11 = load i32, i32* %3
%12 = trunc i32 %11 to i8
ret i8 %12
}

LLVM IR (-O2):
@CHAR_MAX = global i32 0
define signext i8 @cnv(i8* nocapture %0) {
%2 = tail call i32 @strtol(i8* nocapture %0, i32* null, i32 10)
%3 = icmp eq i32 %2, -1
%4 = load i32, i32* @CHAR_MAX
%5 = select i1 %3, i32 %4, i32 %2
%6 = trunc i32 %5 to i8
ret i8 %6
}
/* Variables and functions */
int /*<<< orphan*/ bf_add(int, int);
int /*<<< orphan*/ bf_clean(int);
int bf_mov(int obj, int number) {
  bf_clean(obj);
  bf_add(obj, number);
  return 0;
}


x86 assembly (clang, -O0):
<bf_mov>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <bf_clean@plt>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <bf_add@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bf_mov>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
call   1040 <bf_clean@plt>
mov    %ebp,%edi
mov    %ebx,%esi
call   1030 <bf_add@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @bf_mov(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 = call i32 @bf_clean(i32 %5)
%7 = load i32, i32* %3
%8 = load i32, i32* %4
%9 = call i32 @bf_add(i32 %7, i32 %8)
ret i32 0
}

LLVM IR (-O2):
define i32 @bf_mov(i32 %0, i32 %1) {
%3 = tail call i32 @bf_clean(i32 %0)
%4 = tail call i32 @bf_add(i32 %0, i32 %1)
ret i32 0
}
int gen_comb_rep_lex_init(unsigned int *vector, const unsigned int n,
                          const unsigned int k) {
  int j;
  if (n == 0 || k == 0)
    return (2);
  for (j = 0; j < k; j++)
    vector[j] = 0;
  return (0);
}


x86 assembly (clang, -O0):
<gen_comb_rep_lex_init>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
cmpl   $0x0,-0x14(%rbp)
je     1122 <gen_comb_rep_lex_init+0x22>
cmpl   $0x0,-0x18(%rbp)
jne    112e <gen_comb_rep_lex_init+0x2e>
movl   $0x2,-0x4(%rbp)
jmp    1165 <gen_comb_rep_lex_init+0x65>
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x18(%rbp),%eax
jae    115e <gen_comb_rep_lex_init+0x5e>
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movl   $0x0,(%rax,%rcx,4)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1135 <gen_comb_rep_lex_init+0x35>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<gen_comb_rep_lex_init>:
push   %rbx
mov    $0x2,%ebx
test   %esi,%esi
je     112d <gen_comb_rep_lex_init+0x1d>
test   %edx,%edx
je     112d <gen_comb_rep_lex_init+0x1d>
mov    %edx,%edx
shl    $0x2,%rdx
xor    %ebx,%ebx
xor    %esi,%esi
call   1030 <memset@plt>
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @gen_comb_rep_lex_init(i32* nocapture writeonly %0, i32 %1, i32 %2) {
%4 = icmp eq i32 %1, 0
%5 = icmp eq i32 %2, 0
%6 = or i1 %4, %5
br i1 %6, label %11, label %7
7: ; preds = %3
%8 = bitcast i32* %0 to i8*
%9 = zext i32 %2 to i64
%10 = shl nuw nsw i64 %9, 2
br label %11
11: ; preds = %7, %3
%12 = phi i32 [ 2, %3 ], [ 0, %7 ]
ret i32 %12
}
/* Variables and functions */
float average(int, int, int, ...);
int /*<<< orphan*/ printf(char *, float);
int main(void) {
  float i;
  i = average(2, 10, 20);
  printf("Avg: %.2f\n", i);
  i = average(6, 1, 2, 3, 4, 5, 6);
  printf("Avg: %.2f\n", i);
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x2,%edi
mov    $0xa,%esi
mov    $0x14,%edx
mov    $0x0,%al
call   1040 <average@plt>
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
lea    0xeaa(%rip),%rdi
call   1030 <printf@plt>
mov    $0x6,%edi
mov    $0x1,%esi
mov    $0x2,%edx
mov    $0x3,%ecx
mov    $0x4,%r8d
mov    $0x5,%r9d
movl   $0x6,(%rsp)
mov    $0x0,%al
call   1040 <average@plt>
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
lea    0xe66(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
mov    $0x2,%edi
mov    $0xa,%esi
mov    $0x14,%edx
xor    %eax,%eax
call   1040 <average@plt>
lea    0xebe(%rip),%rbx
mov    %rbx,%rdi
call   1030 <printf@plt>
movl   $0x6,(%rsp)
mov    $0x6,%edi
mov    $0x1,%esi
mov    $0x2,%edx
mov    $0x3,%ecx
mov    $0x4,%r8d
mov    $0x5,%r9d
xor    %eax,%eax
call   1040 <average@plt>
mov    %rbx,%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [11 x i8] c"Avg: %.2f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
store i32 0, i32* %1
%3 = call float (i32, i32, i32, ...) @average(i32 2, i32 10, i32 20)
store float %3, float* %2
%4 = load float, float* %2
%5 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), float %4)
%6 = call float (i32, i32, i32, ...) @average(i32 6, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6)
store float %6, float* %2
%7 = load float, float* %2
%8 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), float %7)
ret i32 0
}

LLVM IR (-O2):
@.str = [11 x i8] c"Avg: %.2f\0A\00"
define i32 @main() {
%1 = tail call float (i32, i32, i32, ...) @average(i32 2, i32 10, i32 20)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), float %1)
%3 = tail call float (i32, i32, i32, ...) @average(i32 6, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), float %3)
ret i32 0
}
unsigned xrop3_234_1_1(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  stk2 = T & S;
  stk1 = D | stk2;
  return (stk1 & (~S) & (~T)) | (D & S) | (D & T);
}


x86 assembly (clang, -O0):
<xrop3_234_1_1>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xff,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
movzbl -0x2(%rbp),%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
and    -0xc(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%eax
or     -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0xc(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x10(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%ecx
and    -0xc(%rbp),%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%ecx
and    -0x10(%rbp),%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_234_1_1>:
mov    %esi,%eax
shl    $0x8,%eax
or     %esi,%eax
or     %edi,%esi
mov    %edi,%ecx
not    %cl
movzbl %cl,%ecx
not    %eax
and    %ecx,%eax
or     %esi,%eax
ret

LLVM IR (-O0):
define i32 @xrop3_234_1_1(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
store i32 255, i32* %5
%10 = load i8, i8* %3
%11 = zext i8 %10 to i32
%12 = shl i32 %11, 8
%13 = load i8, i8* %3
%14 = zext i8 %13 to i32
%15 = or i32 %12, %14
store i32 %15, i32* %6
%16 = load i8, i8* %4
%17 = zext i8 %16 to i32
%18 = shl i32 %17, 8
%19 = load i8, i8* %4
%20 = zext i8 %19 to i32
%21 = or i32 %18, %20
store i32 %21, i32* %7
%22 = load i32, i32* %7
%23 = load i32, i32* %6
%24 = and i32 %22, %23
store i32 %24, i32* %9
%25 = load i32, i32* %5
%26 = load i32, i32* %9
%27 = or i32 %25, %26
store i32 %27, i32* %8
%28 = load i32, i32* %8
%29 = load i32, i32* %6
%30 = xor i32 %29, -1
%31 = and i32 %28, %30
%32 = load i32, i32* %7
%33 = xor i32 %32, -1
%34 = and i32 %31, %33
%35 = load i32, i32* %5
%36 = load i32, i32* %6
%37 = and i32 %35, %36
%38 = or i32 %34, %37
%39 = load i32, i32* %5
%40 = load i32, i32* %7
%41 = and i32 %39, %40
%42 = or i32 %38, %41
ret i32 %42
}

LLVM IR (-O2):
define i32 @xrop3_234_1_1(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %1 to i32
%4 = mul nuw nsw i32 %3, 257
%5 = xor i8 %0, -1
%6 = zext i8 %5 to i32
%7 = xor i32 %4, -1
%8 = and i32 %6, %7
%9 = or i8 %1, %0
%10 = zext i8 %9 to i32
%11 = or i32 %8, %10
ret i32 %11
}
const char *dtls_package_version() { return "0.8.1"; }


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

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

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

LLVM IR (-O2):
@.str = [6 x i8] c"0.8.1\00"
define i8* @dtls_package_version() {
ret i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ RTLD_LAZY;
void *dlopen(char *, int /*<<< orphan*/);
void *iwinfo_open(void) { return dlopen("/usr/lib/libiwinfo.so", RTLD_LAZY); }


x86 assembly (clang, -O0):
<iwinfo_open>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%esi
lea    0xedc(%rip),%rdi
call   1030 <dlopen@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<iwinfo_open>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%esi
lea    0xee0(%rip),%rdi
jmp    1030 <dlopen@plt>

LLVM IR (-O0):
@.str = [22 x i8] c"/usr/lib/libiwinfo.so\00"
@RTLD_LAZY = global i32 0
define i8* @iwinfo_open() {
%1 = load i32, i32* @RTLD_LAZY
%2 = call i8* @dlopen(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i8* %2
}

LLVM IR (-O2):
@.str = [22 x i8] c"/usr/lib/libiwinfo.so\00"
@RTLD_LAZY = global i32 0
define i8* @iwinfo_open() {
%1 = load i32, i32* @RTLD_LAZY
%2 = tail call i8* @dlopen(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i8* %2
}
/* Type definitions */
struct tms {
  int dummy;
};
typedef int /*<<< orphan*/ clock_t;

/* Variables and functions */
int /*<<< orphan*/ __syscall(int, struct tms *);
clock_t times(struct tms *tms) { return __syscall(43, tms); }


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

x86 assembly (clang, -O2):
<times>:
mov    %rdi,%rsi
mov    $0x2b,%edi
jmp    1030 <__syscall@plt>

LLVM IR (-O0):
%struct.tms = type { i32 }
define i32 @times(%struct.tms* %0) {
%2 = alloca %struct.tms*
store %struct.tms* %0, %struct.tms** %2
%3 = load %struct.tms*, %struct.tms** %2
%4 = call i32 @__syscall(i32 43, %struct.tms* %3)
ret i32 %4
}

LLVM IR (-O2):
%struct.tms = type { i32 }
define i32 @times(%struct.tms* %0) {
%2 = tail call i32 @__syscall(i32 43, %struct.tms* %0)
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
void bswap16(uint8_t *buf) { (void)buf; }


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

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

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

LLVM IR (-O2):
define void @bswap16(i32* nocapture %0) {
ret void
}
int ti_marketfi_start(double const *options) {
  (void)options;
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @ti_marketfi_start(double* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ _exit(int);
int geti();
int /*<<< orphan*/ printf(char *, ...);
int exit() {
  int exitValue;
  printf("Exit value? ");
  exitValue = geti();
  printf("Entering kernel to die with exit value=%d\n", exitValue);
  _exit(exitValue);
}


x86 assembly (clang, -O0):
<exit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0x0,%al
call   1050 <geti@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xeb3(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x4(%rbp),%edi
call   1030 <_exit@plt>

x86 assembly (clang, -O2):
<exit>:
push   %rbx
lea    0xec8(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
call   1050 <geti@plt>
mov    %eax,%ebx
lea    0xebe(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %ebx,%edi
call   1030 <_exit@plt>

LLVM IR (-O0):
@.str = [13 x i8] c"Exit value? \00"
@.str.1 = [43 x i8] c"Entering kernel to die with exit value=%d\0A\00"
define i32 @exit() {
%1 = alloca i32
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (...) @geti()
store i32 %3, i32* %1
%4 = load i32, i32* %1
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.1, i64 0, i64 0), i32 %4)
%6 = load i32, i32* %1
%7 = call i32 @_exit(i32 %6)
unreachable
}

LLVM IR (-O2):
@.str = [13 x i8] c"Exit value? \00"
@.str.1 = [43 x i8] c"Entering kernel to die with exit value=%d\0A\00"
define i32 @exit() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (...) @geti()
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @.str.1, i64 0, i64 0), i32 %2)
%4 = tail call i32 @_exit(i32 %2)
unreachable
}
/* Variables and functions */
scalar_t__ isspace(int);
char *rev_strnspc(const char *stop, const char *start) {
  for (; start > stop; start--) {
    if (isspace((int)*start)) {
      return (char *)start;
    }
  }
  return NULL;
}


x86 assembly (clang, -O0):
<rev_strnspc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x10(%rbp),%rax
jbe    1167 <rev_strnspc+0x57>
mov    -0x18(%rbp),%rax
movsbl (%rax),%edi
call   1030 <isspace@plt>
cmp    $0x0,%rax
je     1151 <rev_strnspc+0x41>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    116f <rev_strnspc+0x5f>
jmp    1156 <rev_strnspc+0x46>
mov    -0x18(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x18(%rbp)
jmp    1120 <rev_strnspc+0x10>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rev_strnspc>:
push   %r14
push   %rbx
push   %rax
cmp    %rdi,%rsi
jbe    1136 <rev_strnspc+0x26>
mov    %rsi,%rbx
mov    %rdi,%r14
nop
movsbl (%rbx),%edi
call   1030 <isspace@plt>
test   %rax,%rax
jne    1138 <rev_strnspc+0x28>
add    $0xffffffffffffffff,%rbx
cmp    %r14,%rbx
ja     1120 <rev_strnspc+0x10>
xor    %ebx,%ebx
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @rev_strnspc(i8* readnone %0, i8* %1) {
%3 = icmp ugt i8* %1, %0
br i1 %3, label %4, label %13
4: ; preds = %2, %10
%5 = phi i8* [ %11, %10 ], [ %1, %2 ]
%6 = load i8, i8* %5
%7 = sext i8 %6 to i32
%8 = tail call i64 @isspace(i32 %7)
%9 = icmp eq i64 %8, 0
br i1 %9, label %10, label %13
10: ; preds = %4
%11 = getelementptr inbounds i8, i8* %5, i64 -1
%12 = icmp ugt i8* %11, %0
br i1 %12, label %4, label %13
13: ; preds = %4, %10, %2
%14 = phi i8* [ null, %2 ], [ null, %10 ], [ %5, %4 ]
ret i8* %14
}
void Uns_TYPE_dummy__() { ; }


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

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

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

LLVM IR (-O2):
define void @Uns_TYPE_dummy__() {
ret void
}
int execute_truncate() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @execute_truncate() {
ret i32 0
}
int test_imm_7Cuint16_reg(unsigned short val) {
  return ((val) & (0x7C << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_7Cuint16_reg>:
test   $0x7c,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_7Cuint16_reg(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = zext i16 %3 to i32
%5 = and i32 %4, 124
%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_7Cuint16_reg(i16 zeroext %0) {
%2 = and i16 %0, 124
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int d28(int);
int d29(int a) { return d28(d28(a)); }


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

x86 assembly (clang, -O2):
<d29>:
push   %rax
call   1030 <d28@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <d28@plt>

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

LLVM IR (-O2):
define i32 @d29(i32 %0) {
%2 = tail call i32 @d28(i32 %0)
%3 = tail call i32 @d28(i32 %2)
ret i32 %3
}
void replace_char(char *str, char old_char, char new_char) {
  if (!str) {
    return;
  }
  while (*str) {
    if (*str == old_char) {
      *str = new_char;
    }
    str++;
  }
}


x86 assembly (clang, -O0):
<replace_char>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1123 <replace_char+0x23>
jmp    1162 <replace_char+0x62>
jmp    1128 <replace_char+0x28>
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1162 <replace_char+0x62>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
movsbl -0x9(%rbp),%ecx
cmp    %ecx,%eax
jne    1151 <replace_char+0x51>
mov    -0xa(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1128 <replace_char+0x28>
pop    %rbp
ret

x86 assembly (clang, -O2):
<replace_char>:
test   %rdi,%rdi
je     1135 <replace_char+0x35>
mov    (%rdi),%al
test   %al,%al
je     1135 <replace_char+0x35>
add    $0x1,%rdi
jmp    112b <replace_char+0x2b>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movzbl (%rdi),%eax
add    $0x1,%rdi
test   %al,%al
je     1135 <replace_char+0x35>
cmp    %sil,%al
jne    1120 <replace_char+0x20>
mov    %dl,-0x1(%rdi)
jmp    1120 <replace_char+0x20>
ret

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

LLVM IR (-O2):
define void @replace_char(i8* %0, i8 signext %1, i8 signext %2) {
%4 = icmp eq i8* %0, null
br i1 %4, label %17, label %5
5: ; preds = %3
%6 = load i8, i8* %0
%7 = icmp eq i8 %6, 0
br i1 %7, label %17, label %8
8: ; preds = %5, %13
%9 = phi i8 [ %15, %13 ], [ %6, %5 ]
%10 = phi i8* [ %14, %13 ], [ %0, %5 ]
%11 = icmp eq i8 %9, %1
br i1 %11, label %12, label %13
12: ; preds = %8
store i8 %2, i8* %10
br label %13
13: ; preds = %12, %8
%14 = getelementptr inbounds i8, i8* %10, i64 1
%15 = load i8, i8* %14
%16 = icmp eq i8 %15, 0
br i1 %16, label %17, label %8
17: ; preds = %13, %5, %3
ret void
}
int meta_data_close(void) { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @meta_data_close() {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ SG_byte_to_VDP_data(unsigned char);
void SG_setTile(unsigned char tile) { SG_byte_to_VDP_data(tile); }


x86 assembly (clang, -O0):
<SG_setTile>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%edi
call   1030 <SG_byte_to_VDP_data@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SG_setTile>:
jmp    1030 <SG_byte_to_VDP_data@plt>

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

LLVM IR (-O2):
define void @SG_setTile(i8 zeroext %0) {
%2 = tail call i32 @SG_byte_to_VDP_data(i8 zeroext %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ uart_puts(char *);
void handle_und(void) {
  uart_puts("\nUndefined Instruction");
  while (1)
    ;
  return;
}


x86 assembly (clang, -O0):
<handle_und>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <uart_puts@plt>
jmp    1120 <handle_und+0x10>

x86 assembly (clang, -O2):
<handle_und>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <uart_puts@plt>
nopl   (%rax)
jmp    1120 <handle_und+0x10>

LLVM IR (-O0):
@.str = [23 x i8] c"\0AUndefined Instruction\00"
define void @handle_und() {
%1 = call i32 @uart_puts(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
br label %2
2: ; preds = %0, %2
br label %2
}

LLVM IR (-O2):
@.str = [23 x i8] c"\0AUndefined Instruction\00"
define void @handle_und() {
%1 = tail call i32 @uart_puts(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
br label %2
2: ; preds = %0, %2
br label %2
}
void l1_instruction_write(void) {
  int *i = (void *)0xffa10000;
  *i = 0;
}


x86 assembly (clang, -O0):
<l1_instruction_write>:
push   %rbp
mov    %rsp,%rbp
mov    $0xffa10000,%eax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movl   $0x0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<l1_instruction_write>:
mov    $0xffa10000,%eax
movl   $0x0,(%rax)
ret

LLVM IR (-O0):
define void @l1_instruction_write() {
%1 = alloca i32*
store i32* inttoptr (i64 4288741376 to i32*), i32** %1
%2 = load i32*, i32** %1
store i32 0, i32* %2
ret void
}

LLVM IR (-O2):
define void @l1_instruction_write() {
store i32 0, i32* inttoptr (i64 4288741376 to i32*)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
int setpgid(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ unix_error(char *);
void Setpgid(pid_t pid, pid_t pgid) {
  int rc;
  if ((rc = setpgid(pid, pgid)) < 0)
    unix_error("Setpgid error");
  return;
}


x86 assembly (clang, -O0):
<Setpgid>:
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   1040 <setpgid@plt>
mov    %eax,-0xc(%rbp)
cmp    $0x0,%eax
jge    1151 <Setpgid+0x31>
lea    0xeb4(%rip),%rdi
call   1030 <unix_error@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [14 x i8] c"Setpgid error\00"
define void @Setpgid(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 @setpgid(i32 %6, i32 %7)
store i32 %8, i32* %5
%9 = icmp slt i32 %8, 0
br i1 %9, label %10, label %12
10: ; preds = %2
%11 = call i32 @unix_error(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %12
12: ; preds = %10, %2
ret void
}

LLVM IR (-O2):
@.str = [14 x i8] c"Setpgid error\00"
define void @Setpgid(i32 %0, i32 %1) {
%3 = tail call i32 @setpgid(i32 %0, i32 %1)
%4 = icmp slt i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @unix_error(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %2
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, char *);
int svg_comment(char *Message, FILE *f) {
  fprintf(f, "<!-- %s -->\n", Message);
  return 0;
}


x86 assembly (clang, -O0):
<svg_comment>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rdx
lea    0xed1(%rip),%rsi
call   1030 <fprintf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<svg_comment>:
push   %rax
mov    %rsi,%rax
mov    %rdi,%rdx
lea    0xee2(%rip),%rsi
mov    %rax,%rdi
call   1030 <fprintf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [13 x i8] c"<!-- %s -->\0A\00"
define i32 @svg_comment(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 = load i8*, i8** %3
%7 = call i32 @fprintf(i32* %5, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [13 x i8] c"<!-- %s -->\0A\00"
define i32 @svg_comment(i8* %0, i32* nocapture %1) {
%3 = tail call i32 @fprintf(i32* %1, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %0)
ret i32 0
}
/* Type definitions */
typedef scalar_t__ uint8_t;
typedef int uint16_t;

/* Variables and functions */
uint16_t make_vga_entry(char c, uint8_t color) {
  return (uint16_t)c | (uint16_t)color << 8;
}


x86 assembly (clang, -O0):
<make_vga_entry>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %rsi,-0x10(%rbp)
movsbl -0x1(%rbp),%eax
mov    -0x10(%rbp),%rcx
shl    $0x8,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<make_vga_entry>:
mov    %rsi,%rax
shl    $0x8,%eax
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @make_vga_entry(i8 signext %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 = sext i8 %5 to i32
%7 = load i64, i64* %4
%8 = trunc i64 %7 to i32
%9 = shl i32 %8, 8
%10 = or i32 %6, %9
ret i32 %10
}

LLVM IR (-O2):
define i32 @make_vga_entry(i8 signext %0, i64 %1) {
%3 = sext i8 %0 to i32
%4 = trunc i64 %1 to i32
%5 = shl i32 %4, 8
%6 = or i32 %5, %3
ret i32 %6
}
void svm_struct_classify_api_exit() {}


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

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

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

LLVM IR (-O2):
define void @svm_struct_classify_api_exit() {
ret void
}
void my_swap(char *a, char *b) {
  int tmp;
  tmp = *a;
  *a = *b;
  *b = tmp;
}


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

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

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

LLVM IR (-O2):
define void @my_swap(i8* nocapture %0, i8* nocapture %1) {
%3 = load i8, i8* %0
%4 = load i8, i8* %1
store i8 %4, i8* %0
store i8 %3, i8* %1
ret void
}
/* Variables and functions */
int pow(double, int);
double fp(double x) { return (3 * pow(x, 2) - 10 * x + 7); }


x86 assembly (clang, -O0):
<fp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
mov    $0x2,%edi
call   1030 <pow@plt>
imul   $0x3,%eax,%eax
cvtsi2sd %eax,%xmm1
movsd  -0x8(%rbp),%xmm0
movsd  0xec8(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  0xeb0(%rip),%xmm1
addsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fp>:
push   %rax
movsd  %xmm0,(%rsp)
mov    $0x2,%edi
call   1030 <pow@plt>
lea    (%rax,%rax,2),%eax
cvtsi2sd %eax,%xmm1
movsd  (%rsp),%xmm0
mulsd  0xecc(%rip),%xmm0
addsd  %xmm1,%xmm0
addsd  0xec8(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @fp(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call i32 @pow(double %3, i32 2)
%5 = mul nsw i32 3, %4
%6 = sitofp i32 %5 to double
%7 = load double, double* %2
%8 = call double @llvm.fmuladd.f64(double -1.000000e+01, double %7, double %6)
%9 = fadd double %8, 7.000000e+00
ret double %9
}

LLVM IR (-O2):
define double @fp(double %0) {
%2 = tail call i32 @pow(double %0, i32 2)
%3 = mul nsw i32 %2, 3
%4 = sitofp i32 %3 to double
%5 = tail call double @llvm.fmuladd.f64(double %0, double -1.000000e+01, double %4)
%6 = fadd double %5, 7.000000e+00
ret double %6
}
void ADC1_2_IRQHandler(void) {}


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

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

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

LLVM IR (-O2):
define void @ADC1_2_IRQHandler() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ strlen(char *);
void c_append(char *s, char c) {
  s += strlen(s);
  s[0] = c;
  s[1] = 0;
}


x86 assembly (clang, -O0):
<c_append>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x8(%rbp)
mov    -0x9(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
movb   $0x0,0x1(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<c_append>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
call   1030 <strlen@plt>
cltq
mov    %bpl,(%rbx,%rax,1)
movb   $0x0,0x1(%rbx,%rax,1)
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define void @c_append(i8* %0, i8 signext %1) {
%3 = alloca i8*
%4 = alloca i8
store i8* %0, i8** %3
store i8 %1, i8* %4
%5 = load i8*, i8** %3
%6 = call i32 @strlen(i8* %5)
%7 = load i8*, i8** %3
%8 = sext i32 %6 to i64
%9 = getelementptr inbounds i8, i8* %7, i64 %8
store i8* %9, i8** %3
%10 = load i8, i8* %4
%11 = load i8*, i8** %3
%12 = getelementptr inbounds i8, i8* %11, i64 0
store i8 %10, i8* %12
%13 = load i8*, i8** %3
%14 = getelementptr inbounds i8, i8* %13, i64 1
store i8 0, i8* %14
ret void
}

LLVM IR (-O2):
define void @c_append(i8* %0, i8 signext %1) {
%3 = tail call i32 @strlen(i8* %0)
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 %4
store i8 %1, i8* %5
%6 = getelementptr inbounds i8, i8* %5, i64 1
store i8 0, i8* %6
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ _HibernateWriteComplete();
void HibernateCounterMode(uint32_t ui32Config) {
  (*((volatile uint32_t *)(0x400FC300))) = ui32Config;
  _HibernateWriteComplete();
}


x86 assembly (clang, -O0):
<HibernateCounterMode>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
mov    $0x400fc300,%eax
mov    %ecx,(%rax)
mov    $0x0,%al
call   1030 <_HibernateWriteComplete@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<HibernateCounterMode>:
mov    %edi,0x400fc300
xor    %eax,%eax
jmp    1030 <_HibernateWriteComplete@plt>

LLVM IR (-O0):
define void @HibernateCounterMode(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
store volatile i32 %3, i32* inttoptr (i64 1074774784 to i32*)
%4 = call i32 (...) @_HibernateWriteComplete()
ret void
}

LLVM IR (-O2):
define void @HibernateCounterMode(i32 %0) {
store volatile i32 %0, i32* inttoptr (i64 1074774784 to i32*)
%2 = tail call i32 (...) @_HibernateWriteComplete()
ret void
}
int XProtocolVersion() {}


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

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

LLVM IR (-O0):
define i32 @XProtocolVersion() {
%1 = alloca i32
%2 = load i32, i32* %1
ret i32 %2
}

LLVM IR (-O2):
define i32 @XProtocolVersion() {
ret i32 undef
}