xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ stderr;
void helpcb(const char *l, char s) {
  fprintf(stderr, "HelpCB: %s %c\n", l, s);
  fprintf(stderr, "\n");
}


x86 assembly (clang, -O0):
<helpcb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    0x2eb7(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
movsbl -0x9(%rbp),%ecx
lea    0xec6(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2e98(%rip),%rax
mov    (%rax),%edi
lea    0xebc(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<helpcb>:
push   %rbx
mov    %esi,%ecx
mov    %rdi,%rdx
mov    0x2ec3(%rip),%rbx
mov    (%rbx),%edi
lea    0xeda(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xed7(%rip),%rsi
xor    %eax,%eax
pop    %rbx
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [15 x i8] c"HelpCB: %s %c\0A\00"
@.str.1 = [2 x i8] c"\0A\00"
define void @helpcb(i8* %0, i8 signext %1) {
%3 = alloca i8*
%4 = alloca i8
store i8* %0, i8** %3
store i8 %1, i8* %4
%5 = load i32, i32* @stderr
%6 = load i8*, i8** %3
%7 = load i8, i8* %4
%8 = sext i8 %7 to i32
%9 = call i32 (i32, i8*, ...) @fprintf(i32 %5, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %6, i32 %8)
%10 = load i32, i32* @stderr
%11 = call i32 (i32, i8*, ...) @fprintf(i32 %10, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [15 x i8] c"HelpCB: %s %c\0A\00"
@.str.1 = [2 x i8] c"\0A\00"
define void @helpcb(i8* %0, i8 signext %1) {
%3 = load i32, i32* @stderr
%4 = sext i8 %1 to i32
%5 = tail call i32 (i32, i8*, ...) @fprintf(i32 %3, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %4)
%6 = load i32, i32* @stderr
%7 = tail call i32 (i32, i8*, ...) @fprintf(i32 %6, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
struct stat {
  int /*<<< orphan*/ st_size;
};
struct FTW {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int /*<<< orphan*/, char const *);
int list(const char *fpath, const struct stat *sb, int typeflag,
         struct FTW *ftwbuf) {
  printf("%#08x %8zu %-80s\n", typeflag, sb->st_size, fpath);
  (void)ftwbuf;
  return 0;
}


x86 assembly (clang, -O0):
<list>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x14(%rbp),%esi
mov    -0x10(%rbp),%rax
mov    (%rax),%edx
mov    -0x8(%rbp),%rcx
lea    0xec5(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<list>:
push   %rax
mov    %rdi,%rcx
mov    (%rsi),%eax
lea    0xee3(%rip),%rdi
mov    %edx,%esi
mov    %eax,%edx
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
%struct.FTW = type { i32 }
@.str = [18 x i8] c"%x %8zu %-80s\0A\00"
define i32 @list(i8* %0, %struct.stat* %1, i32 %2, %struct.FTW* %3) {
%5 = alloca i8*
%6 = alloca %struct.stat*
%7 = alloca i32
%8 = alloca %struct.FTW*
store i8* %0, i8** %5
store %struct.stat* %1, %struct.stat** %6
store i32 %2, i32* %7
store %struct.FTW* %3, %struct.FTW** %8
%9 = load i32, i32* %7
%10 = load %struct.stat*, %struct.stat** %6
%11 = getelementptr inbounds %struct.stat, %struct.stat* %10, i32 0, i32 0
%12 = load i32, i32* %11
%13 = load i8*, i8** %5
%14 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %9, i32 %12, i8* %13)
%15 = load %struct.FTW*, %struct.FTW** %8
ret i32 0
}

LLVM IR (-O2):
%struct.stat = type { i32 }
%struct.FTW = type { i32 }
@.str = [18 x i8] c"%x %8zu %-80s\0A\00"
define i32 @list(i8* %0, %struct.stat* nocapture %1, i32 %2, %struct.FTW* nocapture readnone %3) {
%5 = getelementptr inbounds %struct.stat, %struct.stat* %1, i64 0, i32 0
%6 = load i32, i32* %5
%7 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %2, i32 %6, i8* %0)
ret i32 0
}
/* Variables and functions */
int __builtin_rx_sat(int);
int saturate_add(int arg1, int arg2) {
  arg1 += arg2;
  return __builtin_rx_sat(arg1);
}


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

x86 assembly (clang, -O2):
<saturate_add>:
add    %esi,%edi
jmp    1030 <__builtin_rx_sat@plt>

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

LLVM IR (-O2):
define i32 @saturate_add(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
%4 = tail call i32 @__builtin_rx_sat(i32 %3)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ prerror(char *, char const *);
void internal_error(const char *message) {
  prerror("Internal programming error: %s\n", message);
  exit(1);
}


x86 assembly (clang, -O0):
<internal_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec9(%rip),%rdi
call   1030 <prerror@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<internal_error>:
push   %rax
mov    %rdi,%rsi
lea    0xed5(%rip),%rdi
call   1030 <prerror@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [32 x i8] c"Internal programming error: %s\0A\00"
define void @internal_error(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @prerror(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [32 x i8] c"Internal programming error: %s\0A\00"
define void @internal_error(i8* %0) {
%2 = tail call i32 @prerror(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @exit(i32 1)
unreachable
}
unsigned xrop3_99_0_0(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;
  unsigned stk3;
  stk3 = ~T;
  stk2 = D | stk3;
  stk1 = S ^ stk2;
  return stk1;
}


x86 assembly (clang, -O0):
<xrop3_99_0_0>:
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
xor    $0xffffffff,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%eax
or     -0x1c(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
xor    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_99_0_0>:
mov    %edi,%eax
shl    $0x8,%eax
or     %edi,%eax
shl    $0x8,%esi
xor    %esi,%eax
not    %eax
ret

LLVM IR (-O0):
define i32 @xrop3_99_0_0(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
%10 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
store i32 255, i32* %5
%11 = load i8, i8* %3
%12 = zext i8 %11 to i32
%13 = shl i32 %12, 8
%14 = load i8, i8* %3
%15 = zext i8 %14 to i32
%16 = or i32 %13, %15
store i32 %16, i32* %6
%17 = load i8, i8* %4
%18 = zext i8 %17 to i32
%19 = shl i32 %18, 8
%20 = load i8, i8* %4
%21 = zext i8 %20 to i32
%22 = or i32 %19, %21
store i32 %22, i32* %7
%23 = load i32, i32* %7
%24 = xor i32 %23, -1
store i32 %24, i32* %10
%25 = load i32, i32* %5
%26 = load i32, i32* %10
%27 = or i32 %25, %26
store i32 %27, i32* %9
%28 = load i32, i32* %6
%29 = load i32, i32* %9
%30 = xor i32 %28, %29
store i32 %30, i32* %8
%31 = load i32, i32* %8
ret i32 %31
}

LLVM IR (-O2):
define i32 @xrop3_99_0_0(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = mul nuw nsw i32 %3, 257
%5 = zext i8 %1 to i32
%6 = shl nuw nsw i32 %5, 8
%7 = xor i32 %4, %6
%8 = xor i32 %7, -1
ret i32 %8
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int EOF;
int fgetc(int /*<<< orphan*/ *);
int /*<<< orphan*/ printf(char *, char);
int main(int argc, char *argv[]) {
  int c;
  FILE *stream;
  c = fgetc(stream);
  if (c == EOF)
    ;
  else
    printf("c=%c\n", (char)c);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x20(%rbp),%rdi
call   1040 <fgetc@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    0x2e9c(%rip),%rcx
cmp    (%rcx),%eax
jne    1159 <main+0x39>
jmp    116b <main+0x4b>
mov    -0x14(%rbp),%eax
lea    0xe9d(%rip),%rdi
movsbl %al,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
call   1040 <fgetc@plt>
mov    0x2ebb(%rip),%rcx
cmp    (%rcx),%eax
je     1140 <main+0x20>
movsbl %al,%esi
lea    0xec5(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@EOF = global i32 0
@.str = [6 x i8] c"c=%c\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @fgetc(i32* undef)
%4 = load i32, i32* @EOF
%5 = icmp eq i32 %3, %4
br i1 %5, label %9, label %6
6: ; preds = %2
%7 = trunc i32 %3 to i8
%8 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8 signext %7)
br label %9
9: ; preds = %2, %6
ret i32 0
}
int IsLeft(char c) { return c == '('; }


x86 assembly (clang, -O0):
<IsLeft>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x28,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<IsLeft>:
xor    %eax,%eax
cmp    $0x28,%dil
sete   %al
ret

LLVM IR (-O0):
define i32 @IsLeft(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, 40
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @IsLeft(i8 signext %0) {
%2 = icmp eq i8 %0, 40
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ usleep(int);
void iop_usleep(int usec) { usleep(usec); }


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

x86 assembly (clang, -O2):
<iop_usleep>:
jmp    1030 <usleep@plt>

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

LLVM IR (-O2):
define void @iop_usleep(i32 %0) {
%2 = tail call i32 @usleep(i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Com_Printf(char *, char const *);
void CL_GameModule_Print(const char *msg) { Com_Printf("%s", msg); }


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

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

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
define void @CL_GameModule_Print(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @Com_Printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define void @CL_GameModule_Print(i8* %0) {
%2 = tail call i32 @Com_Printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
__attribute__((no, noclone)) int foo(int x) {
  if (x == -216 || x == -132 || x == -218 || x == -146)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0xffffff28,-0x8(%rbp)
je     113b <foo+0x3b>
cmpl   $0xffffff7c,-0x8(%rbp)
je     113b <foo+0x3b>
cmpl   $0xffffff26,-0x8(%rbp)
je     113b <foo+0x3b>
cmpl   $0xffffff6e,-0x8(%rbp)
jne    1147 <foo+0x47>
movl   $0x1,-0x4(%rbp)
jmp    114e <foo+0x4e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
mov    $0x1,%eax
cmp    $0xffffff6d,%edi
jg     111e <foo+0x1e>
cmp    $0xffffff26,%edi
je     111d <foo+0x1d>
cmp    $0xffffff28,%edi
jne    112e <foo+0x2e>
ret
cmp    $0xffffff6e,%edi
je     111d <foo+0x1d>
cmp    $0xffffff7c,%edi
je     111d <foo+0x1d>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @foo(i32 %0) {
switch i32 %0, label %2 [
i32 -132, label %3
i32 -146, label %3
i32 -216, label %3
i32 -218, label %3
]
2: ; preds = %1
br label %3
3: ; preds = %1, %1, %1, %1, %2
%4 = phi i32 [ 0, %2 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ]
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ matNd_mult_matNd_new(double *, double const *,
                                        double const *, int);
void mat3d_mult_mat3d_new(double result[9], const double matA[9],
                          const double matB[9]) {
  matNd_mult_matNd_new(result, matA, matB, 3);
}


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

x86 assembly (clang, -O2):
<mat3d_mult_mat3d_new>:
mov    $0x3,%ecx
jmp    1030 <matNd_mult_matNd_new@plt>

LLVM IR (-O0):
define void @mat3d_mult_mat3d_new(double* %0, double* %1, double* %2) {
%4 = alloca double*
%5 = alloca double*
%6 = alloca double*
store double* %0, double** %4
store double* %1, double** %5
store double* %2, double** %6
%7 = load double*, double** %4
%8 = load double*, double** %5
%9 = load double*, double** %6
%10 = call i32 @matNd_mult_matNd_new(double* %7, double* %8, double* %9, i32 3)
ret void
}

LLVM IR (-O2):
define void @mat3d_mult_mat3d_new(double* %0, double* %1, double* %2) {
%4 = tail call i32 @matNd_mult_matNd_new(double* %0, double* %1, double* %2, i32 3)
ret void
}
/* Variables and functions */
unsigned int __sw_hweight8(unsigned int w) {
  unsigned int res = w - ((w >> 1) & 0x55);
  res = (res & 0x33) + ((res >> 2) & 0x33);
  return (res + (res >> 4)) & 0x0F;
}


x86 assembly (clang, -O0):
<__sw_hweight8>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
shr    $0x1,%ecx
and    $0x55,%ecx
sub    %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
and    $0x33,%eax
mov    -0x8(%rbp),%ecx
shr    $0x2,%ecx
and    $0x33,%ecx
add    %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    -0x8(%rbp),%ecx
shr    $0x4,%ecx
add    %ecx,%eax
and    $0xf,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__sw_hweight8>:
mov    %edi,%eax
shr    %eax
and    $0x55,%eax
sub    %eax,%edi
mov    %edi,%ecx
and    $0x33,%ecx
shr    $0x2,%edi
and    $0x33,%edi
add    %edi,%ecx
mov    %ecx,%eax
shr    $0x4,%eax
add    %ecx,%eax
and    $0xf,%eax
ret

LLVM IR (-O0):
define i32 @__sw_hweight8(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = load i32, i32* %2
%6 = lshr i32 %5, 1
%7 = and i32 %6, 85
%8 = sub i32 %4, %7
store i32 %8, i32* %3
%9 = load i32, i32* %3
%10 = and i32 %9, 51
%11 = load i32, i32* %3
%12 = lshr i32 %11, 2
%13 = and i32 %12, 51
%14 = add i32 %10, %13
store i32 %14, i32* %3
%15 = load i32, i32* %3
%16 = load i32, i32* %3
%17 = lshr i32 %16, 4
%18 = add i32 %15, %17
%19 = and i32 %18, 15
ret i32 %19
}

LLVM IR (-O2):
define i32 @__sw_hweight8(i32 %0) {
%2 = lshr i32 %0, 1
%3 = and i32 %2, 85
%4 = sub i32 %0, %3
%5 = and i32 %4, 51
%6 = lshr i32 %4, 2
%7 = and i32 %6, 51
%8 = add nuw nsw i32 %7, %5
%9 = lshr i32 %8, 4
%10 = add nuw nsw i32 %9, %8
%11 = and i32 %10, 15
ret i32 %11
}
int busca_sequencial(int vetor[], int tamanho, int chave) {
  int i;
  for (i = 0; i < tamanho; i++)
    if (vetor[i] == chave)
      return i;
  return -1;
}


x86 assembly (clang, -O0):
<busca_sequencial>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    1153 <busca_sequencial+0x53>
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
cmp    -0x18(%rbp),%eax
jne    1140 <busca_sequencial+0x40>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    115a <busca_sequencial+0x5a>
jmp    1145 <busca_sequencial+0x45>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1115 <busca_sequencial+0x15>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<busca_sequencial>:
mov    $0xffffffff,%eax
test   %esi,%esi
jle    111e <busca_sequencial+0x1e>
mov    %esi,%esi
xor    %ecx,%ecx
nopl   (%rax)
cmp    %edx,(%rdi,%rcx,4)
je     111f <busca_sequencial+0x1f>
add    $0x1,%rcx
cmp    %rcx,%rsi
jne    1110 <busca_sequencial+0x10>
ret
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @busca_sequencial(i32* nocapture %0, i32 %1, i32 %2) {
%4 = icmp sgt i32 %1, 0
br i1 %4, label %5, label %17
5: ; preds = %3
%6 = zext i32 %1 to i64
br label %7
7: ; preds = %5, %12
%8 = phi i64 [ 0, %5 ], [ %13, %12 ]
%9 = getelementptr inbounds i32, i32* %0, i64 %8
%10 = load i32, i32* %9
%11 = icmp eq i32 %10, %2
br i1 %11, label %15, label %12
12: ; preds = %7
%13 = add nuw nsw i64 %8, 1
%14 = icmp eq i64 %13, %6
br i1 %14, label %17, label %7
15: ; preds = %7
%16 = trunc i64 %8 to i32
br label %17
17: ; preds = %12, %15, %3
%18 = phi i32 [ -1, %3 ], [ %16, %15 ], [ -1, %12 ]
ret i32 %18
}
/* Variables and functions */
void *malloc(size_t);
void *safe_malloc(size_t num, size_t size) {
  size_t alloc_size = num * size;
  if (alloc_size / num != size) {
    return NULL;
  }
  return malloc(alloc_size);
}


x86 assembly (clang, -O0):
<safe_malloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
imul   -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
xor    %ecx,%ecx
mov    %ecx,%edx
divq   -0x10(%rbp)
cmp    -0x18(%rbp),%rax
je     1150 <safe_malloc+0x40>
movq   $0x0,-0x8(%rbp)
jmp    115d <safe_malloc+0x4d>
mov    -0x20(%rbp),%rdi
call   1030 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<safe_malloc>:
mov    %rdi,%rax
mul    %rsi
jno    111b <safe_malloc+0xb>
xor    %eax,%eax
ret
mov    %rax,%rdi
jmp    1030 <malloc@plt>

LLVM IR (-O0):
define i8* @safe_malloc(i64 %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
store i64 %0, i64* %4
store i64 %1, i64* %5
%7 = load i64, i64* %4
%8 = load i64, i64* %5
%9 = mul i64 %7, %8
store i64 %9, i64* %6
%10 = load i64, i64* %6
%11 = load i64, i64* %4
%12 = udiv i64 %10, %11
%13 = load i64, i64* %5
%14 = icmp ne i64 %12, %13
br i1 %14, label %15, label %16
15: ; preds = %2
store i8* null, i8** %3
br label %19
16: ; preds = %2
%17 = load i64, i64* %6
%18 = call i8* @malloc(i64 %17)
store i8* %18, i8** %3
br label %19
19: ; preds = %16, %15
%20 = load i8*, i8** %3
ret i8* %20
}

LLVM IR (-O2):
define noalias i8* @safe_malloc(i64 %0, i64 %1) {
%3 = tail call { i64, i1 } @llvm.umul.with.overflow.i64(i64 %0, i64 %1)
%4 = extractvalue { i64, i1 } %3, 1
br i1 %4, label %8, label %5
5: ; preds = %2
%6 = extractvalue { i64, i1 } %3, 0
%7 = tail call i8* @malloc(i64 %6)
br label %8
8: ; preds = %2, %5
%9 = phi i8* [ %7, %5 ], [ null, %2 ]
ret i8* %9
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t USBDMANumChannels(uint32_t ui32Base) {
  ;
  return ((*((volatile uint32_t *)(ui32Base + 0x00000079))) >> 4);
}


x86 assembly (clang, -O0):
<USBDMANumChannels>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x79,%eax
cltq
mov    (%rax),%eax
sar    $0x4,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<USBDMANumChannels>:
movslq %edi,%rax
mov    0x79(%rax),%eax
sar    $0x4,%eax
ret

LLVM IR (-O0):
define i32 @USBDMANumChannels(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add nsw i32 %3, 121
%5 = sext i32 %4 to i64
%6 = inttoptr i64 %5 to i32*
%7 = load volatile i32, i32* %6
%8 = ashr i32 %7, 4
ret i32 %8
}

LLVM IR (-O2):
define i32 @USBDMANumChannels(i32 %0) {
%2 = add nsw i32 %0, 121
%3 = sext i32 %2 to i64
%4 = inttoptr i64 %3 to i32*
%5 = load volatile i32, i32* %4
%6 = ashr i32 %5, 4
ret i32 %6
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int EINVAL;
__attribute__((visibility("default"))) int
sd_bus_get_owner_creds(void *bus, uint64_t mask, void **ret) {
  return -EINVAL;
}


x86 assembly (clang, -O0):
<sd_bus_get_owner_creds>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
xor    %eax,%eax
mov    0x2ec8(%rip),%rcx
sub    (%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sd_bus_get_owner_creds>:
mov    0x2ed9(%rip),%rcx
xor    %eax,%eax
sub    (%rcx),%eax
ret

LLVM IR (-O0):
@EINVAL = global i32 0
define i32 @sd_bus_get_owner_creds(i8* %0, i32 %1, i8** %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i8**
store i8* %0, i8** %4
store i32 %1, i32* %5
store i8** %2, i8*** %6
%7 = load i32, i32* @EINVAL
%8 = sub nsw i32 0, %7
ret i32 %8
}

LLVM IR (-O2):
@EINVAL = global i32 0
define i32 @sd_bus_get_owner_creds(i8* nocapture readnone %0, i32 %1, i8** nocapture readnone %2) {
%4 = load i32, i32* @EINVAL
%5 = sub nsw i32 0, %4
ret i32 %5
}
int test_cmp(const void *x, const void *y) {
  return (*(const int *)x - *(const int *)y);
}


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

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

LLVM IR (-O0):
define i32 @test_cmp(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 = bitcast i8* %5 to i32*
%7 = load i32, i32* %6
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i32*
%10 = load i32, i32* %9
%11 = sub nsw i32 %7, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @test_cmp(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = sub nsw i32 %4, %6
ret i32 %7
}
/* Type definitions */
typedef int uid_t;

/* Variables and functions */
uid_t geteuid(void) { return 15001; }


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

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

LLVM IR (-O0):
define i32 @geteuid() {
ret i32 15001
}

LLVM IR (-O2):
define i32 @geteuid() {
ret i32 15001
}
unsigned int symbol_hash(char *symbol) {
  unsigned int hashval;
  for (hashval = 0; *symbol != '\0'; symbol++) {
    hashval = *symbol + 31 * hashval;
  }
  return hashval % 42;
}


x86 assembly (clang, -O0):
<symbol_hash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1140 <symbol_hash+0x40>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
imul   $0x1f,-0xc(%rbp),%ecx
add    %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    110f <symbol_hash+0xf>
mov    -0xc(%rbp),%eax
mov    $0x2a,%ecx
xor    %edx,%edx
div    %ecx
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<symbol_hash>:
mov    (%rdi),%cl
test   %cl,%cl
je     113e <symbol_hash+0x3e>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
movsbl %cl,%ecx
mov    %eax,%edx
shl    $0x5,%edx
sub    %eax,%edx
mov    %edx,%eax
add    %ecx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <symbol_hash+0x10>
mov    %eax,%ecx
shr    %ecx
imul   $0x30c30c31,%rcx,%rcx
shr    $0x22,%rcx
imul   $0x2a,%ecx,%ecx
sub    %ecx,%eax
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @symbol_hash(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %3
br label %4
4: ; preds = %16, %1
%5 = load i8*, i8** %2
%6 = load i8, i8* %5
%7 = sext i8 %6 to i32
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %19
9: ; preds = %4
%10 = load i8*, i8** %2
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
%13 = load i32, i32* %3
%14 = mul i32 31, %13
%15 = add i32 %12, %14
store i32 %15, i32* %3
br label %16
16: ; preds = %9
%17 = load i8*, i8** %2
%18 = getelementptr inbounds i8, i8* %17, i32 1
store i8* %18, i8** %2
br label %4
19: ; preds = %4
%20 = load i32, i32* %3
%21 = urem i32 %20, 42
ret i32 %21
}

LLVM IR (-O2):
define i32 @symbol_hash(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %16, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i32 [ %10, %4 ], [ 0, %1 ]
%7 = phi i8* [ %11, %4 ], [ %0, %1 ]
%8 = sext i8 %5 to i32
%9 = mul i32 %6, 31
%10 = add i32 %9, %8
%11 = getelementptr inbounds i8, i8* %7, i64 1
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4
%15 = urem i32 %10, 42
br label %16
16: ; preds = %14, %1
%17 = phi i32 [ 0, %1 ], [ %15, %14 ]
ret i32 %17
}
int fun1254() { return 1254; }


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

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

LLVM IR (-O0):
define i32 @fun1254() {
ret i32 1254
}

LLVM IR (-O2):
define i32 @fun1254() {
ret i32 1254
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int main(int argc, char *argv[]) {
  int a, b;
  printf("%d %d\n", a, b);
  b = 2;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x14(%rbp),%esi
mov    -0x18(%rbp),%edx
lea    0xecd(%rip),%rdi
call   1030 <printf@plt>
movl   $0x2,-0x18(%rbp)
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [7 x i8] c"%d %d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 undef, i32 2)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ GLsizei;
typedef int /*<<< orphan*/ GLdouble;

/* Variables and functions */
int /*<<< orphan*/ GL_PROJECTION;
int /*<<< orphan*/ glLoadIdentity();
int /*<<< orphan*/ glMatrixMode(int /*<<< orphan*/);
int /*<<< orphan*/ glViewport(int /*<<< orphan*/, int /*<<< orphan*/,
                              int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ gluOrtho2D(double, int /*<<< orphan*/, double,
                              int /*<<< orphan*/);
void polys_reshape(int w, int h) {
  glViewport(0, 0, (GLsizei)w, (GLsizei)h);
  glMatrixMode(GL_PROJECTION);
  glLoadIdentity();
  gluOrtho2D(0.0, (GLdouble)w, 0.0, (GLdouble)h);
}


x86 assembly (clang, -O0):
<polys_reshape>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edx
mov    -0x8(%rbp),%ecx
xor    %esi,%esi
mov    %esi,%edi
call   1060 <glViewport@plt>
mov    0x2e7c(%rip),%rax
mov    (%rax),%edi
call   1030 <glMatrixMode@plt>
mov    $0x0,%al
call   1040 <glLoadIdentity@plt>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
xorps  %xmm1,%xmm1
movaps %xmm1,%xmm0
call   1050 <gluOrtho2D@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<polys_reshape>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
xor    %edi,%edi
xor    %esi,%esi
mov    %ebp,%edx
mov    %ebx,%ecx
call   1060 <glViewport@plt>
mov    0x2e85(%rip),%rax
mov    (%rax),%edi
call   1030 <glMatrixMode@plt>
xor    %eax,%eax
call   1040 <glLoadIdentity@plt>
xorps  %xmm0,%xmm0
xorps  %xmm1,%xmm1
mov    %ebp,%edi
mov    %ebx,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1050 <gluOrtho2D@plt>

LLVM IR (-O0):
@GL_PROJECTION = global i32 0
define void @polys_reshape(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 @glViewport(i32 0, i32 0, i32 %5, i32 %6)
%8 = load i32, i32* @GL_PROJECTION
%9 = call i32 @glMatrixMode(i32 %8)
%10 = call i32 (...) @glLoadIdentity()
%11 = load i32, i32* %3
%12 = load i32, i32* %4
%13 = call i32 @gluOrtho2D(double 0.000000e+00, i32 %11, double 0.000000e+00, i32 %12)
ret void
}

LLVM IR (-O2):
@GL_PROJECTION = global i32 0
define void @polys_reshape(i32 %0, i32 %1) {
%3 = tail call i32 @glViewport(i32 0, i32 0, i32 %0, i32 %1)
%4 = load i32, i32* @GL_PROJECTION
%5 = tail call i32 @glMatrixMode(i32 %4)
%6 = tail call i32 (...) @glLoadIdentity()
%7 = tail call i32 @gluOrtho2D(double 0.000000e+00, i32 %0, double 0.000000e+00, i32 %1)
ret void
}
int main(int argc, char const *argv[]) {
  int i = 0;
  int j;
  int nGroups = 6;
  int inUse16[16];
  while (i < 16) {
    inUse16[i] = 0;
    j = 0;
    i++;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x6,-0x1c(%rbp)
cmpl   $0x10,-0x14(%rbp)
jge    114b <main+0x4b>
movslq -0x14(%rbp),%rax
movl   $0x0,-0x60(%rbp,%rax,4)
movl   $0x0,-0x18(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1120 <main+0x20>
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int parse_uint8_base(char const *, int /*<<< orphan*/ *, int);
int parse_uint8_hex(const char *arg, uint8_t *ret) {
  return parse_uint8_base(arg, ret, 16);
}


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

x86 assembly (clang, -O2):
<parse_uint8_hex>:
mov    $0x10,%edx
jmp    1030 <parse_uint8_base@plt>

LLVM IR (-O0):
define i32 @parse_uint8_hex(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 = call i32 @parse_uint8_base(i8* %5, i32* %6, i32 16)
ret i32 %7
}

LLVM IR (-O2):
define i32 @parse_uint8_hex(i8* %0, i32* %1) {
%3 = tail call i32 @parse_uint8_base(i8* %0, i32* %1, i32 16)
ret i32 %3
}
unsigned int g(unsigned int a) { return a & 31; }


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

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

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

LLVM IR (-O2):
define i32 @g(i32 %0) {
%2 = and i32 %0, 31
ret i32 %2
}
void swiotlb_free(void) {}


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

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

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

LLVM IR (-O2):
define void @swiotlb_free() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ putchar(char);
void seqprint(unsigned char *s, int len) {
  int i;
  for (i = 0; i < len; ++s, ++i)
    putchar(*s ? '1' : '0');
  putchar('\n');
}


x86 assembly (clang, -O0):
<seqprint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    116b <seqprint+0x5b>
mov    -0x8(%rbp),%rax
movzbl (%rax),%edx
mov    $0x30,%eax
mov    $0x31,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
movsbl %al,%edi
call   1030 <putchar@plt>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <seqprint+0x16>
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<seqprint>:
push   %r15
push   %r14
push   %rbx
test   %esi,%esi
jle    114b <seqprint+0x3b>
mov    %rdi,%r14
mov    %esi,%r15d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
cmpb   $0x1,(%r14,%rbx,1)
mov    $0x31,%edi
sbb    $0x0,%edi
call   1030 <putchar@plt>
add    $0x1,%rbx
cmp    %ebx,%r15d
jne    1130 <seqprint+0x20>
mov    $0xa,%edi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <putchar@plt>

LLVM IR (-O0):
define void @seqprint(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
store i32 0, i32* %5
br label %6
6: ; preds = %19, %2
%7 = load i32, i32* %5
%8 = load i32, i32* %4
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %24
10: ; preds = %6
%11 = load i8*, i8** %3
%12 = load i8, i8* %11
%13 = zext i8 %12 to i32
%14 = icmp ne i32 %13, 0
%15 = zext i1 %14 to i64
%16 = select i1 %14, i32 49, i32 48
%17 = trunc i32 %16 to i8
%18 = call i32 @putchar(i8 signext %17)
br label %19
19: ; preds = %10
%20 = load i8*, i8** %3
%21 = getelementptr inbounds i8, i8* %20, i32 1
store i8* %21, i8** %3
%22 = load i32, i32* %5
%23 = add nsw i32 %22, 1
store i32 %23, i32* %5
br label %6
24: ; preds = %6
%25 = call i32 @putchar(i8 signext 10)
ret void
}

LLVM IR (-O2):
define void @seqprint(i8* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %14
4: ; preds = %2, %4
%5 = phi i32 [ %12, %4 ], [ 0, %2 ]
%6 = phi i8* [ %11, %4 ], [ %0, %2 ]
%7 = load i8, i8* %6
%8 = icmp eq i8 %7, 0
%9 = select i1 %8, i8 48, i8 49
%10 = tail call i32 @putchar(i8 signext %9)
%11 = getelementptr inbounds i8, i8* %6, i64 1
%12 = add nuw nsw i32 %5, 1
%13 = icmp eq i32 %12, %1
br i1 %13, label %14, label %4
14: ; preds = %4, %2
%15 = tail call i32 @putchar(i8 signext 10)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, double);
void Void_0_io_1_printLine_2_Double(double value) { printf("%f\n", value); }


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%f\0A\00"
define void @Void_0_io_1_printLine_2_Double(double %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sqlite3OsSleep(int);
int sqliteDefaultBusyCallback(void *Timeout, int count) {
  int timeout = (int)Timeout;
  if ((count + 1) * 1000 > timeout) {
    return 0;
  }
  sqlite3OsSleep(1000);
  return 1;
}


x86 assembly (clang, -O0):
<sqliteDefaultBusyCallback>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
imul   $0x3e8,%eax,%eax
cmp    -0x18(%rbp),%eax
jle    1147 <sqliteDefaultBusyCallback+0x37>
movl   $0x0,-0x4(%rbp)
jmp    1158 <sqliteDefaultBusyCallback+0x48>
mov    $0x3e8,%edi
call   1030 <sqlite3OsSleep@plt>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sqliteDefaultBusyCallback>:
imul   $0x3e8,%esi,%ecx
add    $0x3e8,%ecx
xor    %eax,%eax
cmp    %edi,%ecx
jg     1136 <sqliteDefaultBusyCallback+0x26>
push   %rax
mov    $0x3e8,%edi
call   1030 <sqlite3OsSleep@plt>
mov    $0x1,%eax
add    $0x8,%rsp
ret

LLVM IR (-O0):
define i32 @sqliteDefaultBusyCallback(i8* %0, i32 %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
%7 = load i8*, i8** %4
%8 = ptrtoint i8* %7 to i32
store i32 %8, i32* %6
%9 = load i32, i32* %5
%10 = add nsw i32 %9, 1
%11 = mul nsw i32 %10, 1000
%12 = load i32, i32* %6
%13 = icmp sgt i32 %11, %12
br i1 %13, label %14, label %15
14: ; preds = %2
store i32 0, i32* %3
br label %17
15: ; preds = %2
%16 = call i32 @sqlite3OsSleep(i32 1000)
store i32 1, i32* %3
br label %17
17: ; preds = %15, %14
%18 = load i32, i32* %3
ret i32 %18
}

LLVM IR (-O2):
define i32 @sqliteDefaultBusyCallback(i8* %0, i32 %1) {
%3 = ptrtoint i8* %0 to i64
%4 = trunc i64 %3 to i32
%5 = mul i32 %1, 1000
%6 = add i32 %5, 1000
%7 = icmp sgt i32 %6, %4
br i1 %7, label %10, label %8
8: ; preds = %2
%9 = tail call i32 @sqlite3OsSleep(i32 1000)
br label %10
10: ; preds = %2, %8
%11 = phi i32 [ 1, %8 ], [ 0, %2 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
void *malloc(size_t);
int /*<<< orphan*/ stderr;
void *xmalloc(size_t size) {
  void *p = malloc(size);
  if (!p) {
    fprintf(stderr, "malloc failed\n");
    exit(EXIT_FAILURE);
  }
  return p;
}


x86 assembly (clang, -O0):
<xmalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1177 <xmalloc+0x47>
mov    0x2e85(%rip),%rax
mov    (%rax),%edi
lea    0xe9c(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e68(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmalloc>:
push   %rax
call   1040 <malloc@plt>
test   %rax,%rax
je     113d <xmalloc+0xd>
pop    %rcx
ret
mov    0x2e9c(%rip),%rax
mov    (%rax),%edi
lea    0xeb3(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e7f(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [15 x i8] c"malloc failed\0A\00"
@EXIT_FAILURE = global i32 0
define i8* @xmalloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %13, label %8
8: ; preds = %1
%9 = load i32, i32* @stderr
%10 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%11 = load i32, i32* @EXIT_FAILURE
%12 = call i32 @exit(i32 %11)
unreachable
13: ; preds = %1
%14 = load i8*, i8** %3
ret i8* %14
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [15 x i8] c"malloc failed\0A\00"
@EXIT_FAILURE = global i32 0
define noalias i8* @xmalloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %9
4: ; preds = %1
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%7 = load i32, i32* @EXIT_FAILURE
%8 = tail call i32 @exit(i32 %7)
unreachable
9: ; preds = %1
ret i8* %2
}
/* Variables and functions */
int rand();
int /*<<< orphan*/ srand(unsigned int);
scalar_t__ time(int /*<<< orphan*/ *);
int getRandom() {
  srand((unsigned)time(NULL));
  int r = rand();
  return r;
}


x86 assembly (clang, -O0):
<getRandom>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xor    %eax,%eax
mov    %eax,%edi
call   1040 <time@plt>
mov    %eax,%edi
call   1030 <srand@plt>
mov    $0x0,%al
call   1050 <rand@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getRandom>:
push   %rax
xor    %edi,%edi
call   1040 <time@plt>
mov    %eax,%edi
call   1030 <srand@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <rand@plt>

LLVM IR (-O0):
define i32 @getRandom() {
%1 = alloca i32
%2 = call i64 @time(i32* null)
%3 = trunc i64 %2 to i32
%4 = call i32 @srand(i32 %3)
%5 = call i32 (...) @rand()
store i32 %5, i32* %1
%6 = load i32, i32* %1
ret i32 %6
}

LLVM IR (-O2):
define i32 @getRandom() {
%1 = tail call i64 @time(i32* null)
%2 = trunc i64 %1 to i32
%3 = tail call i32 @srand(i32 %2)
%4 = tail call i32 (...) @rand()
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ read(int, void *, size_t);
int file_fetchchar(void *fd, size_t count, void *c) {
  return !(read(*(int *)fd, c, count));
}


x86 assembly (clang, -O0):
<file_fetchchar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
mov    -0x18(%rbp),%rsi
mov    -0x10(%rbp),%rdx
call   1030 <read@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<file_fetchchar>:
push   %rax
mov    %rsi,%rax
mov    (%rdi),%edi
mov    %rdx,%rsi
mov    %rax,%rdx
call   1030 <read@plt>
xor    %ecx,%ecx
test   %eax,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @file_fetchchar(i8* %0, i64 %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i8*
store i8* %0, i8** %4
store i64 %1, i64* %5
store i8* %2, i8** %6
%7 = load i8*, i8** %4
%8 = bitcast i8* %7 to i32*
%9 = load i32, i32* %8
%10 = load i8*, i8** %6
%11 = load i64, i64* %5
%12 = call i32 @read(i32 %9, i8* %10, i64 %11)
%13 = icmp ne i32 %12, 0
%14 = xor i1 %13, true
%15 = zext i1 %14 to i32
ret i32 %15
}

LLVM IR (-O2):
define i32 @file_fetchchar(i8* nocapture %0, i64 %1, i8* nocapture %2) {
%4 = bitcast i8* %0 to i32*
%5 = load i32, i32* %4
%6 = tail call i32 @read(i32 %5, i8* %2, i64 %1)
%7 = icmp eq i32 %6, 0
%8 = zext i1 %7 to i32
ret i32 %8
}
void fa68(void) {
P0A:
  goto P0A;
  ({
    P01A:
      goto P01A;
      ({
        P012A:
          goto P012A;
          0;
      });
    P01B:
      goto P01B;
      ({
        p013A:
          goto p013A;
          goto a;
        P013A:
          goto P013A;
          0;
      });
    P01C:
      goto P01C;
      0;
  });
P0B:
  goto P0B;
  ({
    P02A:
      goto P02A;
      ({
        P024A:
          goto P024A;
          0;
      });
    P02B:
      goto P02B;
      ({
        P025A:
          goto P025A;
          0;
      });
    P02C:
      goto P02C;
      0;
  });
a:
  0;
P0D:
  goto P0D;
}


x86 assembly (clang, -O0):
<fa68>:
push   %rbp
mov    %rsp,%rbp
jmp    1104 <fa68+0x4>

x86 assembly (clang, -O2):
<fa68>:
jmp    1100 <fa68>

LLVM IR (-O0):
define void @fa68() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
br label %7
7: ; preds = %7, %0
br label %7
8: ; No predecessors!
br label %9
9: ; preds = %9, %8
br label %9
10: ; No predecessors!
br label %11
11: ; preds = %11, %10
br label %11
12: ; preds = %12
br label %12
13: ; No predecessors!
br label %14
14: ; preds = %14, %13
br label %14
15: ; preds = %15
br label %15
16: ; preds = %16
br label %16
17: ; preds = %17
br label %17
18: ; No predecessors!
br label %19
19: ; preds = %19, %18
br label %19
20: ; No predecessors!
br label %21
21: ; preds = %21, %20
br label %21
22: ; preds = %22
br label %22
23: ; No predecessors!
br label %24
24: ; preds = %24, %23
br label %24
25: ; preds = %25
br label %25
26: ; No predecessors!
br label %27
27: ; preds = %27, %26
br label %27
}

LLVM IR (-O2):
define void @fa68() {
br label %1
1: ; preds = %1, %0
br label %1
}