xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void yyRuI5free(void *ptr) { free((char *)ptr); }


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

x86 assembly (clang, -O2):
<yyRuI5free>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @yyRuI5free(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
extern void clearSet(unsigned int *set) { *set = 0; }


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

x86 assembly (clang, -O2):
<clearSet>:
movl   $0x0,(%rdi)
ret

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

LLVM IR (-O2):
define void @clearSet(i32* nocapture writeonly %0) {
store i32 0, i32* %0
ret void
}
/* Variables and functions */
int IPC_CREAT;
int /*<<< orphan*/ IPC_PRIVATE;
int /*<<< orphan*/ exit(int);
int msgget(int /*<<< orphan*/, int);
int /*<<< orphan*/ perror(char *);
int main() {
  int queue;
  queue = msgget(IPC_PRIVATE, IPC_CREAT | 0600);
  if (queue == -1) {
    perror("msgget:");
    exit(-1);
  }
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2ea2(%rip),%rax
mov    (%rax),%edi
mov    0x2e89(%rip),%rax
mov    (%rax),%esi
or     $0x180,%esi
call   1030 <msgget@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0xffffffff,-0x8(%rbp)
jne    117f <main+0x4f>
lea    0xe90(%rip),%rdi
call   1040 <perror@plt>
mov    $0xffffffff,%edi
call   1050 <exit@plt>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2eb0(%rip),%rax
mov    (%rax),%edi
mov    0x2e97(%rip),%rax
mov    $0x180,%esi
or     (%rax),%esi
call   1030 <msgget@plt>
cmp    $0xffffffff,%eax
jne    1168 <main+0x38>
lea    0xea7(%rip),%rdi
call   1040 <perror@plt>
mov    $0xffffffff,%edi
call   1050 <exit@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@IPC_PRIVATE = global i32 0
@IPC_CREAT = global i32 0
@.str = [8 x i8] c"msgget:\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = load i32, i32* @IPC_PRIVATE
%4 = load i32, i32* @IPC_CREAT
%5 = or i32 %4, 384
%6 = call i32 @msgget(i32 %3, i32 %5)
store i32 %6, i32* %2
%7 = load i32, i32* %2
%8 = icmp eq i32 %7, -1
br i1 %8, label %9, label %12
9: ; preds = %0
%10 = call i32 @perror(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%11 = call i32 @exit(i32 -1)
unreachable
12: ; preds = %0
%13 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@IPC_PRIVATE = global i32 0
@IPC_CREAT = global i32 0
@.str = [8 x i8] c"msgget:\00"
define i32 @main() {
%1 = load i32, i32* @IPC_PRIVATE
%2 = load i32, i32* @IPC_CREAT
%3 = or i32 %2, 384
%4 = tail call i32 @msgget(i32 %1, i32 %3)
%5 = icmp eq i32 %4, -1
br i1 %5, label %6, label %9
6: ; preds = %0
%7 = tail call i32 @perror(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%8 = tail call i32 @exit(i32 -1)
unreachable
9: ; preds = %0
%10 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ show_stackframe();
void usage(char *prog) {
  show_stackframe();
  printf("usage: %s [-h] [ -i file]\n", prog);
  printf("-i file\t\t\tthe input file\n");
  printf("-h \t\t\thelp\n");
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1040 <show_stackframe@plt>
mov    -0x8(%rbp),%rsi
lea    0xec2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xecf(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xedb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1050 <show_stackframe@plt>
lea    0xebe(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xec8(%rip),%rdi
call   1030 <puts@plt>
lea    0xed5(%rip),%rdi
pop    %rbx
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [27 x i8] c"usage: %s [-h] [ -i file]\0A\00"
@.str.1 = [26 x i8] c"-i file\09\09\09the input file\0A\00"
@.str.2 = [12 x i8] c"-h \09\09\09help\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (...) @show_stackframe()
%4 = load i8*, i8** %2
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [27 x i8] c"usage: %s [-h] [ -i file]\0A\00"
@str = [25 x i8] c"-i file\09\09\09the input file\00"
@str.3 = [11 x i8] c"-h \09\09\09help\00"
define void @usage(i8* %0) {
%2 = tail call i32 (...) @show_stackframe()
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str, i64 0, i64 0))
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str.3, i64 0, i64 0))
ret void
}
int constant_test_bit(int nr, const volatile unsigned long *addr) {
  return ((1UL << (nr & 31)) & (addr[nr >> 5])) != 0;
}


x86 assembly (clang, -O0):
<constant_test_bit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
and    $0x1f,%eax
mov    %eax,%eax
mov    %eax,%ecx
mov    $0x1,%eax
shl    %cl,%rax
mov    -0x10(%rbp),%rcx
mov    -0x4(%rbp),%edx
sar    $0x5,%edx
movslq %edx,%rdx
mov    (%rcx,%rdx,8),%rcx
and    %rcx,%rax
cmp    $0x0,%rax
setne  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<constant_test_bit>:
mov    %edi,%eax
sar    $0x5,%eax
cltq
mov    (%rsi,%rax,8),%rcx
xor    %eax,%eax
bt     %edi,%ecx
setb   %al
ret

LLVM IR (-O0):
define i32 @constant_test_bit(i32 %0, i64* %1) {
%3 = alloca i32
%4 = alloca i64*
store i32 %0, i32* %3
store i64* %1, i64** %4
%5 = load i32, i32* %3
%6 = and i32 %5, 31
%7 = zext i32 %6 to i64
%8 = shl i64 1, %7
%9 = load i64*, i64** %4
%10 = load i32, i32* %3
%11 = ashr i32 %10, 5
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds i64, i64* %9, i64 %12
%14 = load volatile i64, i64* %13
%15 = and i64 %8, %14
%16 = icmp ne i64 %15, 0
%17 = zext i1 %16 to i32
ret i32 %17
}

LLVM IR (-O2):
define i32 @constant_test_bit(i32 %0, i64* %1) {
%3 = and i32 %0, 31
%4 = zext i32 %3 to i64
%5 = shl nuw nsw i64 1, %4
%6 = ashr i32 %0, 5
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds i64, i64* %1, i64 %7
%9 = load volatile i64, i64* %8
%10 = and i64 %9, %5
%11 = icmp ne i64 %10, 0
%12 = zext i1 %11 to i32
ret i32 %12
}
int main() { int a = 0; }


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

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ value_to_integer(char *, char *, int);
void quantity_to_integer(char qty[], char integer[]) {
  value_to_integer(qty, integer, 8);
}


x86 assembly (clang, -O0):
<quantity_to_integer>:
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    $0x8,%edx
call   1030 <value_to_integer@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<quantity_to_integer>:
mov    $0x8,%edx
jmp    1030 <value_to_integer@plt>

LLVM IR (-O0):
define void @quantity_to_integer(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 = load i8*, i8** %4
%7 = call i32 @value_to_integer(i8* %5, i8* %6, i32 8)
ret void
}

LLVM IR (-O2):
define void @quantity_to_integer(i8* %0, i8* %1) {
%3 = tail call i32 @value_to_integer(i8* %0, i8* %1, i32 8)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ cbmyfatal(char *);
void cbstdiobin(void) {
  if ((0) == -1 || (0) == -1 || (0) == -1)
    cbmyfatal("setmode failed");
}


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

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

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

LLVM IR (-O2):
define void @cbstdiobin() {
ret void
}
/* Type definitions */
struct timeval {
  int tv_sec;
  scalar_t__ tv_usec;
};
struct event {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ event_add(struct event *, struct timeval *);
int /*<<< orphan*/ printf(char *);
void onTime(int sock, short event, void *arg) {
  printf("Hello, world!\n");
  struct timeval tv;
  tv.tv_sec = 1;
  tv.tv_usec = 0;
  event_add((struct event *)arg, &tv);
}


x86 assembly (clang, -O0):
<onTime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %si,%ax
mov    %edi,-0x4(%rbp)
mov    %ax,-0x6(%rbp)
mov    %rdx,-0x10(%rbp)
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
movl   $0x1,-0x20(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x20(%rbp),%rsi
call   1040 <event_add@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<onTime>:
push   %rbx
sub    $0x10,%rsp
mov    %rdx,%rbx
lea    0xed1(%rip),%rdi
call   1030 <puts@plt>
movl   $0x1,(%rsp)
movq   $0x0,0x8(%rsp)
mov    %rsp,%rsi
mov    %rbx,%rdi
call   1040 <event_add@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.timeval = type { i32, i64 }
%struct.event = type { i32 }
@.str = [15 x i8] c"Hello, world!\0A\00"
define void @onTime(i32 %0, i16 signext %1, i8* %2) {
%4 = alloca i32
%5 = alloca i16
%6 = alloca i8*
%7 = alloca %struct.timeval
store i32 %0, i32* %4
store i16 %1, i16* %5
store i8* %2, i8** %6
%8 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%9 = getelementptr inbounds %struct.timeval, %struct.timeval* %7, i32 0, i32 0
store i32 1, i32* %9
%10 = getelementptr inbounds %struct.timeval, %struct.timeval* %7, i32 0, i32 1
store i64 0, i64* %10
%11 = load i8*, i8** %6
%12 = bitcast i8* %11 to %struct.event*
%13 = call i32 @event_add(%struct.event* %12, %struct.timeval* %7)
ret void
}

LLVM IR (-O2):
%struct.timeval = type { i32, i64 }
%struct.event = type { i32 }
@str = [14 x i8] c"Hello, world!\00"
define void @onTime(i32 %0, i16 signext %1, i8* %2) {
%4 = alloca %struct.timeval
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
%6 = bitcast %struct.timeval* %4 to i8*
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %4, i64 0, i32 0
store i32 1, i32* %7
%8 = getelementptr inbounds %struct.timeval, %struct.timeval* %4, i64 0, i32 1
store i64 0, i64* %8
%9 = bitcast i8* %2 to %struct.event*
%10 = call i32 @event_add(%struct.event* %9, %struct.timeval* %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
h() {
  int y[3] = {};
  if (y[0] || y[1] || y[2])
    abort();
}


x86 assembly (clang, -O0):
<h>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x10(%rbp),%rdi
xor    %esi,%esi
mov    $0xc,%edx
call   1040 <memset@plt>
cmpl   $0x0,-0x10(%rbp)
jne    1156 <h+0x36>
cmpl   $0x0,-0xc(%rbp)
jne    1156 <h+0x36>
cmpl   $0x0,-0x8(%rbp)
je     115d <h+0x3d>
mov    $0x0,%al
call   1030 <abort@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @h() {
ret i32 undef
}
void sranddev(void) {}


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

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

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

LLVM IR (-O2):
define void @sranddev() {
ret void
}
/* Variables and functions */
int foo();
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char **argv) { printf("%d\n", foo()); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1040 <foo@plt>
mov    %eax,%esi
lea    0xec1(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <foo@plt>
lea    0xed1(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @foo()
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 0
}
double ull2d(u)
unsigned long long int u;
{ return u; }


x86 assembly (clang, -O0):
<ull2d>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movaps 0xef1(%rip),%xmm1
movq   -0x8(%rbp),%xmm0
punpckldq %xmm1,%xmm0
movapd 0xef0(%rip),%xmm1
subpd  %xmm1,%xmm0
movaps %xmm0,%xmm1
unpckhpd %xmm0,%xmm0
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<ull2d>:
movq   %rdi,%xmm1
punpckldq 0xef3(%rip),%xmm1
subpd  0xefb(%rip),%xmm1
movapd %xmm1,%xmm0
unpckhpd %xmm1,%xmm0
addsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @ull2d(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = uitofp i64 %3 to double
ret double %4
}

LLVM IR (-O2):
define double @ull2d(i64 %0) {
%2 = uitofp i64 %0 to double
ret double %2
}
/* Type definitions */
struct lm {
  int dummy;
};

/* Variables and functions */
struct lm *lmGuts(int, void *);
struct lm *lmInitWMem(void *mem, int blockSize) {
  return lmGuts(blockSize, mem);
}


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

x86 assembly (clang, -O2):
<lmInitWMem>:
mov    %rdi,%rax
mov    %esi,%edi
mov    %rax,%rsi
jmp    1030 <lmGuts@plt>

LLVM IR (-O0):
%struct.lm = type { i32 }
define %struct.lm* @lmInitWMem(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 %struct.lm* @lmGuts(i32 %5, i8* %6)
ret %struct.lm* %7
}

LLVM IR (-O2):
%struct.lm = type { i32 }
define %struct.lm* @lmInitWMem(i8* %0, i32 %1) {
%3 = tail call %struct.lm* @lmGuts(i32 %1, i8* %0)
ret %struct.lm* %3
}
int add_2(int m, int n) {
  int c1 = m + n;
  c1 = m + n;
  int c2 = m + n;
  return c1;
}


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

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

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

LLVM IR (-O2):
define i32 @add_2(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
ret i32 %3
}
/* Type definitions */
struct cart {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ _cartVarDbName(char *, char *);
int cartBoolean(struct cart *, int /*<<< orphan*/);
int cartBooleanDb(struct cart *cart, char *db, char *var) {
  return cartBoolean(cart, _cartVarDbName(db, var));
}


x86 assembly (clang, -O0):
<cartBooleanDb>:
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,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <_cartVarDbName@plt>
mov    -0x20(%rbp),%rdi
mov    %eax,%esi
call   1040 <cartBoolean@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cartBooleanDb>:
push   %rbx
mov    %rdi,%rbx
mov    %rsi,%rdi
mov    %rdx,%rsi
call   1030 <_cartVarDbName@plt>
mov    %rbx,%rdi
mov    %eax,%esi
pop    %rbx
jmp    1040 <cartBoolean@plt>

LLVM IR (-O0):
%struct.cart = type { i32 }
define i32 @cartBooleanDb(%struct.cart* %0, i8* %1, i8* %2) {
%4 = alloca %struct.cart*
%5 = alloca i8*
%6 = alloca i8*
store %struct.cart* %0, %struct.cart** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load %struct.cart*, %struct.cart** %4
%8 = load i8*, i8** %5
%9 = load i8*, i8** %6
%10 = call i32 @_cartVarDbName(i8* %8, i8* %9)
%11 = call i32 @cartBoolean(%struct.cart* %7, i32 %10)
ret i32 %11
}

LLVM IR (-O2):
%struct.cart = type { i32 }
define i32 @cartBooleanDb(%struct.cart* %0, i8* %1, i8* %2) {
%4 = tail call i32 @_cartVarDbName(i8* %1, i8* %2)
%5 = tail call i32 @cartBoolean(%struct.cart* %0, i32 %4)
ret i32 %5
}
void ResExit(void) {}


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

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

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

LLVM IR (-O2):
define void @ResExit() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ O_RDWR;
int open(char *, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int unifi_cfg_init(char *device) {
  int fd;
  fd = open(device, O_RDWR);
  if (fd < 0) {
    printf("Failed to open device\n");
  }
  return fd;
}


x86 assembly (clang, -O0):
<unifi_cfg_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2eb1(%rip),%rax
mov    (%rax),%esi
call   1040 <open@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jge    1157 <unifi_cfg_init+0x37>
lea    0xeae(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<unifi_cfg_init>:
push   %rbx
mov    0x2ec0(%rip),%rax
mov    (%rax),%esi
call   1040 <open@plt>
mov    %eax,%ebx
test   %eax,%eax
jns    1141 <unifi_cfg_init+0x21>
lea    0xec4(%rip),%rdi
call   1030 <puts@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@O_RDWR = global i32 0
@.str = [23 x i8] c"Failed to open device\0A\00"
define i32 @unifi_cfg_init(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = load i32, i32* @O_RDWR
%6 = call i32 @open(i8* %4, i32 %5)
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = icmp slt i32 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %1
%10 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
br label %11
11: ; preds = %9, %1
%12 = load i32, i32* %3
ret i32 %12
}

LLVM IR (-O2):
@O_RDWR = global i32 0
@str = [22 x i8] c"Failed to open device\00"
define i32 @unifi_cfg_init(i8* nocapture %0) {
%2 = load i32, i32* @O_RDWR
%3 = tail call i32 @open(i8* %0, i32 %2)
%4 = icmp slt i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str, i64 0, i64 0))
br label %7
7: ; preds = %5, %1
ret i32 %3
}
void WebPInitUpsamplersSSE41(void) {}


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

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

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

LLVM IR (-O2):
define void @WebPInitUpsamplersSSE41() {
ret void
}
/* Variables and functions */
int lcd_send_cmd(int);
int lcd_init() { return lcd_send_cmd(0x01); }


x86 assembly (clang, -O0):
<lcd_init>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1030 <lcd_send_cmd@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<lcd_init>:
mov    $0x1,%edi
jmp    1030 <lcd_send_cmd@plt>

LLVM IR (-O0):
define i32 @lcd_init() {
%1 = call i32 @lcd_send_cmd(i32 1)
ret i32 %1
}

LLVM IR (-O2):
define i32 @lcd_init() {
%1 = tail call i32 @lcd_send_cmd(i32 1)
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
void main() {
  int x = 0;
  int n;
  while (x < n) {
    x++;
  }
  if (n > 0)
    assert(x <= n);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1139 <main+0x29>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    111f <main+0xf>
cmpl   $0x0,-0x8(%rbp)
jle    1156 <main+0x46>
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
setle  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
br label %3
3: ; preds = %7, %0
%4 = load i32, i32* %1
%5 = load i32, i32* %2
%6 = icmp slt i32 %4, %5
br i1 %6, label %7, label %10
7: ; preds = %3
%8 = load i32, i32* %1
%9 = add nsw i32 %8, 1
store i32 %9, i32* %1
br label %3
10: ; preds = %3
%11 = load i32, i32* %2
%12 = icmp sgt i32 %11, 0
br i1 %12, label %13, label %19
13: ; preds = %10
%14 = load i32, i32* %1
%15 = load i32, i32* %2
%16 = icmp sle i32 %14, %15
%17 = zext i1 %16 to i32
%18 = call i32 @assert(i32 %17)
br label %19
19: ; preds = %13, %10
ret void
}

LLVM IR (-O2):
define void @main() {
ret void
}
int tbump_up(int input) {
  if ((input % 2) == 1) {
    input++;
  }
  return input;
}


x86 assembly (clang, -O0):
<tbump_up>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x1,%edx
jne    1124 <tbump_up+0x24>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<tbump_up>:
mov    %edi,%eax
shr    $0x1f,%eax
add    %edi,%eax
and    $0xfffffffe,%eax
mov    %edi,%ecx
sub    %eax,%ecx
xor    %eax,%eax
cmp    $0x1,%ecx
sete   %al
add    %edi,%eax
ret

LLVM IR (-O0):
define i32 @tbump_up(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = srem i32 %3, 2
%5 = icmp eq i32 %4, 1
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load i32, i32* %2
%8 = add nsw i32 %7, 1
store i32 %8, i32* %2
br label %9
9: ; preds = %6, %1
%10 = load i32, i32* %2
ret i32 %10
}

LLVM IR (-O2):
define i32 @tbump_up(i32 %0) {
%2 = srem i32 %0, 2
%3 = icmp eq i32 %2, 1
%4 = zext i1 %3 to i32
%5 = add nsw i32 %4, %0
ret i32 %5
}
int test_imm_23int64_lowword_reg(long long val) {
  return ((val) & (0x23 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_23int64_lowword_reg(i64 %0) {
%2 = and i64 %0, 35
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
#define DNS_ERR_SERVERFAILED 130
#define DNS_ERR_TIMEOUT 129
#define DNS_ERR_TRUNCATED 128
int evdns_err_is_transient(int err) {
  switch (err) {
  case DNS_ERR_SERVERFAILED:
  case DNS_ERR_TRUNCATED:
  case DNS_ERR_TIMEOUT:
    return 1;
  default:
    return 0;
  }
}


x86 assembly (clang, -O0):
<evdns_err_is_transient>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0xffffff80,%eax
sub    $0x2,%eax
ja     1127 <evdns_err_is_transient+0x27>
jmp    111b <evdns_err_is_transient+0x1b>
movl   $0x1,-0x4(%rbp)
jmp    112e <evdns_err_is_transient+0x2e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<evdns_err_is_transient>:
add    $0xffffff80,%edi
xor    %eax,%eax
cmp    $0x3,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @evdns_err_is_transient(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %6 [
i32 130, label %5
i32 128, label %5
i32 129, label %5
]
5: ; preds = %1, %1, %1
store i32 1, i32* %2
br label %7
6: ; preds = %1
store i32 0, i32* %2
br label %7
7: ; preds = %6, %5
%8 = load i32, i32* %2
ret i32 %8
}

LLVM IR (-O2):
define i32 @evdns_err_is_transient(i32 %0) {
%2 = add i32 %0, -128
%3 = icmp ult i32 %2, 3
%4 = zext i1 %3 to i32
ret i32 %4
}
void I422ToRGBARow_C() {}


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

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

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

LLVM IR (-O2):
define void @I422ToRGBARow_C() {
ret void
}
void inNsr2inNsrUnit() {}


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

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

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

LLVM IR (-O2):
define void @inNsr2inNsrUnit() {
ret void
}
/* Variables and functions */
scalar_t__ foo(int);
int bar(int n) {
  int i;
  int ret = 0;
  for (i = 1; i <= n; i++) {
    ret += foo(i);
  }
  return ret;
}


x86 assembly (clang, -O0):
<bar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x1,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jg     1158 <bar+0x48>
mov    -0x8(%rbp),%edi
call   1030 <foo@plt>
mov    %rax,%rcx
movslq -0xc(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1129 <bar+0x19>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bar>:
push   %rbp
push   %r14
push   %rbx
test   %edi,%edi
jle    114e <bar+0x3e>
mov    %edi,%r14d
neg    %r14d
mov    $0x1,%ebx
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nop
mov    %ebx,%edi
call   1030 <foo@plt>
add    %eax,%ebp
lea    (%r14,%rbx,1),%eax
add    $0x1,%eax
mov    %ebx,%ecx
add    $0x1,%ecx
mov    %ecx,%ebx
cmp    $0x1,%eax
jne    1130 <bar+0x20>
jmp    1150 <bar+0x40>
xor    %ebp,%ebp
mov    %ebp,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @bar(i32 %0) {
%2 = icmp slt i32 %0, 1
br i1 %2, label %11, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %8, %3 ], [ 0, %1 ]
%5 = phi i32 [ %9, %3 ], [ 1, %1 ]
%6 = tail call i64 @foo(i32 %5)
%7 = trunc i64 %6 to i32
%8 = add i32 %4, %7
%9 = add nuw i32 %5, 1
%10 = icmp eq i32 %5, %0
br i1 %10, label %11, label %3
11: ; preds = %3, %1
%12 = phi i32 [ 0, %1 ], [ %8, %3 ]
ret i32 %12
}
f() {
  int (*p)();
  p();
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   *-0x10(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
LLVM IR (-O0):
define i32 @f() {
%1 = alloca i32
%2 = alloca i32 (...)*
%3 = load i32 (...)*, i32 (...)** %2
%4 = call i32 (...) %3()
%5 = load i32, i32* %1
ret i32 %5
}

LLVM IR (-O2):
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ testAtoi();
int /*<<< orphan*/ testStrtol();
int main() {
  testAtoi();
  testStrtol();
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <testAtoi@plt>
mov    $0x0,%al
call   1040 <testStrtol@plt>
mov    0x2e9c(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <testAtoi@plt>
xor    %eax,%eax
call   1040 <testStrtol@plt>
mov    0x2eaa(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @testAtoi()
%3 = call i32 (...) @testStrtol()
%4 = load i32, i32* @EXIT_SUCCESS
ret i32 %4
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = tail call i32 (...) @testAtoi()
%2 = tail call i32 (...) @testStrtol()
%3 = load i32, i32* @EXIT_SUCCESS
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ lfmm2geno(char *, char *, int *, int *);
int /*<<< orphan*/ print_convert(int, int);
void R_lfmm2geno(char **R_input_file, char **R_output_file, int *N, int *M) {
  lfmm2geno(*R_input_file, *R_output_file, N, M);
  print_convert(*N, *M);
}


x86 assembly (clang, -O0):
<R_lfmm2geno>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
call   1040 <lfmm2geno@plt>
mov    -0x18(%rbp),%rax
mov    (%rax),%edi
mov    -0x20(%rbp),%rax
mov    (%rax),%esi
call   1030 <print_convert@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<R_lfmm2geno>:
push   %r14
push   %rbx
push   %rax
mov    %rcx,%r14
mov    %rdx,%rbx
mov    (%rdi),%rdi
mov    (%rsi),%rsi
call   1040 <lfmm2geno@plt>
mov    (%rbx),%edi
mov    (%r14),%esi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <print_convert@plt>

LLVM IR (-O0):
define void @R_lfmm2geno(i8** %0, i8** %1, i32* %2, i32* %3) {
%5 = alloca i8**
%6 = alloca i8**
%7 = alloca i32*
%8 = alloca i32*
store i8** %0, i8*** %5
store i8** %1, i8*** %6
store i32* %2, i32** %7
store i32* %3, i32** %8
%9 = load i8**, i8*** %5
%10 = load i8*, i8** %9
%11 = load i8**, i8*** %6
%12 = load i8*, i8** %11
%13 = load i32*, i32** %7
%14 = load i32*, i32** %8
%15 = call i32 @lfmm2geno(i8* %10, i8* %12, i32* %13, i32* %14)
%16 = load i32*, i32** %7
%17 = load i32, i32* %16
%18 = load i32*, i32** %8
%19 = load i32, i32* %18
%20 = call i32 @print_convert(i32 %17, i32 %19)
ret void
}

LLVM IR (-O2):
define void @R_lfmm2geno(i8** nocapture %0, i8** nocapture %1, i32* %2, i32* %3) {
%5 = load i8*, i8** %0
%6 = load i8*, i8** %1
%7 = tail call i32 @lfmm2geno(i8* %5, i8* %6, i32* %2, i32* %3)
%8 = load i32, i32* %2
%9 = load i32, i32* %3
%10 = tail call i32 @print_convert(i32 %8, i32 %9)
ret void
}
void f5(void) {
#pragma omp declare reduction (+: struct S: omp_out.s += omp_in.s) initializer (omp_priv)
#pragma omp declare reduction (+: struct T: omp_out.t += omp_in.t) initializer (omp_priv ())
}


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

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

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

LLVM IR (-O2):
define void @f5() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ sprintf(char *, char *, int);
int strlen(char *);
void stdiolog1int(char *format, int num) {
  char str[39];
  if (strlen(format) + 6 > 32)
    return;
  sprintf(str, format, num);
  puts(str);
}


x86 assembly (clang, -O0):
<stdiolog1int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
add    $0x6,%eax
cmp    $0x20,%eax
jle    1159 <stdiolog1int+0x29>
jmp    1172 <stdiolog1int+0x42>
lea    -0x40(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
call   1050 <sprintf@plt>
lea    -0x40(%rbp),%rdi
call   1030 <puts@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stdiolog1int>:
push   %rbp
push   %r14
push   %rbx
sub    $0x30,%rsp
mov    %esi,%ebp
mov    %rdi,%rbx
call   1040 <strlen@plt>
cmp    $0x1a,%eax
jg     115f <stdiolog1int+0x2f>
mov    %rsp,%r14
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %ebp,%edx
call   1050 <sprintf@plt>
mov    %r14,%rdi
call   1030 <puts@plt>
add    $0x30,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define void @stdiolog1int(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca [39 x i8]
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i8*, i8** %3
%7 = call i32 @strlen(i8* %6)
%8 = add nsw i32 %7, 6
%9 = icmp sgt i32 %8, 32
br i1 %9, label %10, label %11
10: ; preds = %2
br label %18
11: ; preds = %2
%12 = getelementptr inbounds [39 x i8], [39 x i8]* %5, i64 0, i64 0
%13 = load i8*, i8** %3
%14 = load i32, i32* %4
%15 = call i32 @sprintf(i8* %12, i8* %13, i32 %14)
%16 = getelementptr inbounds [39 x i8], [39 x i8]* %5, i64 0, i64 0
%17 = call i32 @puts(i8* %16)
br label %18
18: ; preds = %11, %10
ret void
}

LLVM IR (-O2):
define void @stdiolog1int(i8* %0, i32 %1) {
%3 = alloca [39 x i8]
%4 = getelementptr inbounds [39 x i8], [39 x i8]* %3, i64 0, i64 0
%5 = tail call i32 @strlen(i8* %0)
%6 = icmp sgt i32 %5, 26
br i1 %6, label %10, label %7
7: ; preds = %2
%8 = call i32 @sprintf(i8* %4, i8* dereferenceable(1) %0, i32 %1)
%9 = call i32 @puts(i8* %4)
br label %10
10: ; preds = %2, %7
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_version(void) {
  printf("ucdisasm version 1.0 - 02/04/2013.\n");
  printf("Written by Vanya Sergeev - <vsergeev@gmail.com>\n");
}


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

x86 assembly (clang, -O2):
<print_version>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xeff(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [36 x i8] c"ucdisasm version 1.0 - 02/04/2013.\0A\00"
@.str.1 = [49 x i8] c"Written by Vanya Sergeev - <vsergeev@gmail.com>\0A\00"
define void @print_version() {
%1 = call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [35 x i8] c"ucdisasm version 1.0 - 02/04/2013.\00"
@str.2 = [48 x i8] c"Written by Vanya Sergeev - <vsergeev@gmail.com>\00"
define void @print_version() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([48 x i8], [48 x i8]* @str.2, i64 0, i64 0))
ret void
}
int test_imm_1Eint64_lowword_mem(long long *val) {
  return ((*val) & (0x1E << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_1Eint64_lowword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = and i64 %4, 30
%6 = icmp ne i64 %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_1Eint64_lowword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 30
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
int isBinDigit(const char digito) { return digito >= '0' && digito <= '1'; }


x86 assembly (clang, -O0):
<isBinDigit>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
xor    %eax,%eax
cmp    $0x30,%ecx
mov    %al,-0x2(%rbp)
jl     1129 <isBinDigit+0x29>
movsbl -0x1(%rbp),%eax
cmp    $0x31,%eax
setle  %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isBinDigit>:
and    $0xfe,%dil
xor    %eax,%eax
cmp    $0x30,%dil
sete   %al
ret

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

LLVM IR (-O2):
define i32 @isBinDigit(i8 signext %0) {
%2 = and i8 %0, -2
%3 = icmp eq i8 %2, 48
%4 = zext i1 %3 to i32
ret i32 %4
}
int main(void) {
  int var;
  var = 0;
  var = (var + 1);
  var = (var - 0);
  var = (var * 10);
  var = (var / 1);
  var = (var % 9);
  var = (var & 10);
  var = (var | 10);
  var = (var ^ 1000);
  var = (var == var);
  var = (var != 50);
  var = (var > 1000);
  var = (var < 1000);
  var = (var >= 9);
  var = (var <= 10);
  var = ((var + 10), 9);
  return var;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
sub    $0x0,%eax
mov    %eax,-0x8(%rbp)
imul   $0xa,-0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x1,%ecx
cltd
idiv   %ecx
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x9,%ecx
cltd
idiv   %ecx
mov    %edx,-0x8(%rbp)
mov    -0x8(%rbp),%eax
and    $0xa,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
or     $0xa,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
xor    $0x3e8,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x8(%rbp),%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x32,-0x8(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x3e8,-0x8(%rbp)
setg   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x3e8,-0x8(%rbp)
setl   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x9,-0x8(%rbp)
setge  %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
setle  %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x8(%rbp)
movl   $0x9,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
%3 = load i32, i32* %2
%4 = add nsw i32 %3, 1
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = sub nsw i32 %5, 0
store i32 %6, i32* %2
%7 = load i32, i32* %2
%8 = mul nsw i32 %7, 10
store i32 %8, i32* %2
%9 = load i32, i32* %2
%10 = sdiv i32 %9, 1
store i32 %10, i32* %2
%11 = load i32, i32* %2
%12 = srem i32 %11, 9
store i32 %12, i32* %2
%13 = load i32, i32* %2
%14 = and i32 %13, 10
store i32 %14, i32* %2
%15 = load i32, i32* %2
%16 = or i32 %15, 10
store i32 %16, i32* %2
%17 = load i32, i32* %2
%18 = xor i32 %17, 1000
store i32 %18, i32* %2
%19 = load i32, i32* %2
%20 = load i32, i32* %2
%21 = icmp eq i32 %19, %20
%22 = zext i1 %21 to i32
store i32 %22, i32* %2
%23 = load i32, i32* %2
%24 = icmp ne i32 %23, 50
%25 = zext i1 %24 to i32
store i32 %25, i32* %2
%26 = load i32, i32* %2
%27 = icmp sgt i32 %26, 1000
%28 = zext i1 %27 to i32
store i32 %28, i32* %2
%29 = load i32, i32* %2
%30 = icmp slt i32 %29, 1000
%31 = zext i1 %30 to i32
store i32 %31, i32* %2
%32 = load i32, i32* %2
%33 = icmp sge i32 %32, 9
%34 = zext i1 %33 to i32
store i32 %34, i32* %2
%35 = load i32, i32* %2
%36 = icmp sle i32 %35, 10
%37 = zext i1 %36 to i32
store i32 %37, i32* %2
%38 = load i32, i32* %2
%39 = add nsw i32 %38, 10
store i32 9, i32* %2
%40 = load i32, i32* %2
ret i32 %40
}

LLVM IR (-O2):
define i32 @main() {
ret i32 9
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
void goto_xy(int x, int y) { printf("\033[%d;%dH", x, y); }


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

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

LLVM IR (-O0):
@.str = [9 x i8] c"\1B[%d;%dH\00"
define void @goto_xy(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 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %5, i32 %6)
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"\1B[%d;%dH\00"
define void @goto_xy(i32 %0, i32 %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1)
ret void
}
/* Variables and functions */
int keynote_remove_assertion(int, int, int /*<<< orphan*/);
int keynote_sremove_assertion(int sessid, int assertid) {
  return keynote_remove_assertion(sessid, assertid, 0);
}


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

x86 assembly (clang, -O2):
<keynote_sremove_assertion>:
xor    %edx,%edx
jmp    1030 <keynote_remove_assertion@plt>

LLVM IR (-O0):
define i32 @keynote_sremove_assertion(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 @keynote_remove_assertion(i32 %5, i32 %6, i32 0)
ret i32 %7
}

LLVM IR (-O2):
define i32 @keynote_sremove_assertion(i32 %0, i32 %1) {
%3 = tail call i32 @keynote_remove_assertion(i32 %0, i32 %1, i32 0)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ scanf(char *, char *);
void getCard(char *message, char *card_name) {
  puts(message);
  scanf("%2s", card_name);
}


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

x86 assembly (clang, -O2):
<getCard>:
push   %rbx
mov    %rsi,%rbx
call   1030 <puts@plt>
lea    0xed0(%rip),%rdi
mov    %rbx,%rsi
pop    %rbx
jmp    1040 <scanf@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%2s\00"
define void @getCard(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 @puts(i8* %5)
%7 = load i8*, i8** %4
%8 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %7)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%2s\00"
define void @getCard(i8* nocapture %0, i8* %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) %0)
%4 = tail call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ debug(char *, ...);
int M73_f(char *s) {
  debug("M73_f(const char *s) is not yet implemented!\n");
  debug("%s\n", s);
  return 1;
}


x86 assembly (clang, -O0):
<M73_f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    -0x8(%rbp),%rsi
lea    0xef9(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<M73_f>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rdi
xor    %eax,%eax
call   1030 <debug@plt>
lea    0xf05(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <debug@plt>
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [46 x i8] c"M73_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @M73_f(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %4)
ret i32 1
}

LLVM IR (-O2):
@.str = [46 x i8] c"M73_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @M73_f(i8* %0) {
%2 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret i32 1
}
int spod_in(char c, char *set) {
  if (!set)
    return 1;
  if (c == set[0])
    return 0;
  else
    spod_in(c, set + 1);
}


x86 assembly (clang, -O0):
<spod_in>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x5(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1139 <spod_in+0x29>
movl   $0x1,-0x4(%rbp)
jmp    116b <spod_in+0x5b>
movsbl -0x5(%rbp),%eax
mov    -0x10(%rbp),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
jne    1158 <spod_in+0x48>
movl   $0x0,-0x4(%rbp)
jmp    116b <spod_in+0x5b>
mov    -0x5(%rbp),%al
mov    -0x10(%rbp),%rsi
add    $0x1,%rsi
movsbl %al,%edi
call   1030 <spod_in@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<spod_in>:
test   %rsi,%rsi
je     111d <spod_in+0x1d>
xor    %eax,%eax
cmp    %dil,(%rsi)
je     111c <spod_in+0x1c>
add    $0x1,%rsi
lea    0x1(%rsi),%rcx
cmp    %dil,(%rsi)
mov    %rcx,%rsi
jne    1110 <spod_in+0x10>
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @spod_in(i8 signext %0, i8* %1) {
%3 = icmp eq i8* %1, null
br i1 %3, label %12, label %4
4: ; preds = %2
%5 = load i8, i8* %1
%6 = icmp eq i8 %5, %0
br i1 %6, label %12, label %7
7: ; preds = %4, %7
%8 = phi i8* [ %9, %7 ], [ %1, %4 ]
%9 = getelementptr inbounds i8, i8* %8, i64 1
%10 = load i8, i8* %9
%11 = icmp eq i8 %10, %0
br i1 %11, label %12, label %7
12: ; preds = %7, %4, %2
%13 = phi i32 [ 1, %2 ], [ 0, %4 ], [ 0, %7 ]
ret i32 %13
}