xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void dot_nodeid(int id) { printf("n%d", id); }


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"n%d\00"
define void @dot_nodeid(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
vbiqpk(pkg) char pkg[];
{}


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

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

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

LLVM IR (-O2):
define i32 @vbiqpk(i8* nocapture readnone %0) {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ ENOMEM;
scalar_t__ __syscall(int, int /*<<< orphan*/);
scalar_t__ __syscall_ret(int /*<<< orphan*/);
void *sbrk(intptr_t inc) {
  if (inc)
    return (void *)__syscall_ret(-ENOMEM);
  return (void *)__syscall(12, 0);
}


x86 assembly (clang, -O0):
<sbrk>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1150 <sbrk+0x30>
xor    %edi,%edi
mov    0x2ea0(%rip),%rax
sub    (%rax),%edi
call   1040 <__syscall_ret@plt>
mov    %rax,-0x8(%rbp)
jmp    1160 <sbrk+0x40>
mov    $0xc,%edi
xor    %esi,%esi
call   1030 <__syscall@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sbrk>:
push   %rax
test   %rdi,%rdi
je     1138 <sbrk+0x18>
mov    0x2eb3(%rip),%rax
xor    %edi,%edi
sub    (%rax),%edi
call   1040 <__syscall_ret@plt>
pop    %rcx
ret
mov    $0xc,%edi
xor    %esi,%esi
call   1030 <__syscall@plt>
pop    %rcx
ret

LLVM IR (-O0):
@ENOMEM = global i32 0
define i8* @sbrk(i64 %0) {
%2 = alloca i8*
%3 = alloca i64
store i64 %0, i64* %3
%4 = load i64, i64* %3
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %11
6: ; preds = %1
%7 = load i32, i32* @ENOMEM
%8 = sub nsw i32 0, %7
%9 = call i64 @__syscall_ret(i32 %8)
%10 = inttoptr i64 %9 to i8*
store i8* %10, i8** %2
br label %14
11: ; preds = %1
%12 = call i64 @__syscall(i32 12, i32 0)
%13 = inttoptr i64 %12 to i8*
store i8* %13, i8** %2
br label %14
14: ; preds = %11, %6
%15 = load i8*, i8** %2
ret i8* %15
}

LLVM IR (-O2):
@ENOMEM = global i32 0
define i8* @sbrk(i64 %0) {
%2 = icmp eq i64 %0, 0
br i1 %2, label %7, label %3
3: ; preds = %1
%4 = load i32, i32* @ENOMEM
%5 = sub nsw i32 0, %4
%6 = tail call i64 @__syscall_ret(i32 %5)
br label %9
7: ; preds = %1
%8 = tail call i64 @__syscall(i32 12, i32 0)
br label %9
9: ; preds = %7, %3
%10 = phi i64 [ %6, %3 ], [ %8, %7 ]
%11 = inttoptr i64 %10 to i8*
ret i8* %11
}
/* Variables and functions */
int /*<<< orphan*/ set_bridge_cfg_value(long, long);
long strtoul(char *, int /*<<< orphan*/, int);
int cli_br_fdelay(int argc, char **argv) {
  long value = 15L;
  value = strtoul(argv[1], 0, 10);
  set_bridge_cfg_value(value, (1L << 4));
  return 0;
}


x86 assembly (clang, -O0):
<cli_br_fdelay>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0xf,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
xor    %esi,%esi
mov    $0xa,%edx
call   1040 <strtoul@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    $0x10,%esi
call   1030 <set_bridge_cfg_value@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cli_br_fdelay>:
push   %rax
mov    0x8(%rsi),%rdi
xor    %esi,%esi
mov    $0xa,%edx
call   1040 <strtoul@plt>
mov    $0x10,%esi
mov    %rax,%rdi
call   1030 <set_bridge_cfg_value@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @cli_br_fdelay(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca i64
store i32 %0, i32* %3
store i8** %1, i8*** %4
store i64 15, i64* %5
%6 = load i8**, i8*** %4
%7 = getelementptr inbounds i8*, i8** %6, i64 1
%8 = load i8*, i8** %7
%9 = call i64 @strtoul(i8* %8, i32 0, i32 10)
store i64 %9, i64* %5
%10 = load i64, i64* %5
%11 = call i32 @set_bridge_cfg_value(i64 %10, i64 16)
ret i32 0
}

LLVM IR (-O2):
define i32 @cli_br_fdelay(i32 %0, i8** nocapture %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = load i8*, i8** %3
%5 = tail call i64 @strtoul(i8* %4, i32 0, i32 10)
%6 = tail call i32 @set_bridge_cfg_value(i64 %5, i64 16)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
extern void primFreeMemory(void *p) {
  if (!p)
    return;
  free(p);
}


x86 assembly (clang, -O0):
<primFreeMemory>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    112c <primFreeMemory+0x1c>
jmp    1135 <primFreeMemory+0x25>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<primFreeMemory>:
test   %rdi,%rdi
je     111a <primFreeMemory+0xa>
jmp    1030 <free@plt>
ret

LLVM IR (-O0):
define void @primFreeMemory(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp ne i8* %3, null
br i1 %4, label %6, label %5
5: ; preds = %1
br label %9
6: ; preds = %1
%7 = load i8*, i8** %2
%8 = call i32 @free(i8* %7)
br label %9
9: ; preds = %6, %5
ret void
}

LLVM IR (-O2):
define void @primFreeMemory(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @free(i8* %0)
br label %5
5: ; preds = %1, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ stdout;
void undraw(int len) {
  int i;
  for (i = 0; i < len; i++)
    fputs("\010 \010", stdout);
  fflush(stdout);
}


x86 assembly (clang, -O0):
<undraw>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1161 <undraw+0x41>
mov    0x2e9b(%rip),%rax
mov    (%rax),%esi
lea    0xeb2(%rip),%rdi
call   1030 <fputs@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1132 <undraw+0x12>
mov    0x2e78(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<undraw>:
push   %r15
push   %r14
push   %rbx
test   %edi,%edi
jle    1150 <undraw+0x30>
mov    %edi,%ebx
mov    0x2eae(%rip),%r15
lea    0xec7(%rip),%r14
nopl   0x0(%rax)
mov    (%r15),%esi
mov    %r14,%rdi
call   1030 <fputs@plt>
add    $0xffffffff,%ebx
jne    1140 <undraw+0x20>
mov    0x2e89(%rip),%rax
mov    (%rax),%edi
pop    %rbx
pop    %r14
pop    %r15
jmp    1040 <fflush@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"\08 \08\00"
@stdout = global i32 0
define void @undraw(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %9
3: ; preds = %1, %3
%4 = phi i32 [ %7, %3 ], [ 0, %1 ]
%5 = load i32, i32* @stdout
%6 = tail call i32 @fputs(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = add nuw nsw i32 %4, 1
%8 = icmp eq i32 %7, %0
br i1 %8, label %9, label %3
9: ; preds = %3, %1
%10 = load i32, i32* @stdout
%11 = tail call i32 @fflush(i32 %10)
ret void
}
int bitops_isset(unsigned char val, int bit) {
  return ((val & (1 << bit)) != 0);
}


x86 assembly (clang, -O0):
<bitops_isset>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %esi,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
mov    -0x8(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
and    %ecx,%eax
cmp    $0x0,%eax
setne  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bitops_isset>:
mov    %esi,%ecx
mov    %edi,%eax
shr    %cl,%eax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @bitops_isset(i8 zeroext %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 = zext i8 %5 to i32
%7 = load i32, i32* %4
%8 = shl i32 1, %7
%9 = and i32 %6, %8
%10 = icmp ne i32 %9, 0
%11 = zext i1 %10 to i32
ret i32 %11
}

LLVM IR (-O2):
define i32 @bitops_isset(i8 zeroext %0, i32 %1) {
%3 = zext i8 %0 to i32
%4 = lshr i32 %3, %1
%5 = and i32 %4, 1
ret i32 %5
}
/* Type definitions */
typedef int uint8_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ add_sentence(int *, int /*<<< orphan*/ *, int *, int);
void gen_st_depth(uint8_t *b, uint32_t *buflen) {
  uint8_t sentence[] = {0x00, 0xF2, 0x64, 0x00, 0x13};
  add_sentence(b, buflen, sentence, 5);
}


x86 assembly (clang, -O0):
<gen_st_depth>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0xed9(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xed6(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0xed4(%rip),%eax
mov    %eax,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
lea    -0x30(%rbp),%rdx
mov    $0x5,%ecx
call   1030 <add_sentence@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gen_st_depth>:
sub    $0x18,%rsp
mov    0xef6(%rip),%eax
mov    %eax,0x10(%rsp)
movaps 0xedb(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdx
mov    $0x5,%ecx
call   1030 <add_sentence@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.gen_st_depth.sentence = [5 x i32] [i32 0, i32 242, i32 100, i32 0, i32 19]
define void @gen_st_depth(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
%5 = alloca [5 x i32]
store i32* %0, i32** %3
store i32* %1, i32** %4
%6 = bitcast [5 x i32]* %5 to i8*
%7 = load i32*, i32** %3
%8 = load i32*, i32** %4
%9 = getelementptr inbounds [5 x i32], [5 x i32]* %5, i64 0, i64 0
%10 = call i32 @add_sentence(i32* %7, i32* %8, i32* %9, i32 5)
ret void
}

LLVM IR (-O2):
@__const.gen_st_depth.sentence = [5 x i32] [i32 0, i32 242, i32 100, i32 0, i32 19]
define void @gen_st_depth(i32* %0, i32* %1) {
%3 = alloca [5 x i32]
%4 = bitcast [5 x i32]* %3 to i8*
%5 = getelementptr inbounds [5 x i32], [5 x i32]* %3, i64 0, i64 0
%6 = call i32 @add_sentence(i32* %0, i32* %1, i32* %5, i32 5)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
void *malloc(size_t);
int /*<<< orphan*/ stderr;
void *xmalloc(size_t size) {
  void *v = malloc(size);
  if (v == 0) {
    fprintf(stderr, "virtual memory exhausted\n");
    abort();
  }
  return v;
}


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

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [26 x i8] c"virtual memory exhausted\0A\00"
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 eq i8* %6, null
br i1 %7, label %8, label %12
8: ; preds = %1
%9 = load i32, i32* @stderr
%10 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%11 = call i32 (...) @abort()
unreachable
12: ; preds = %1
%13 = load i8*, i8** %3
ret i8* %13
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [26 x i8] c"virtual memory exhausted\0A\00"
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 %8
4: ; preds = %1
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%7 = tail call i32 (...) @abort()
unreachable
8: ; preds = %1
ret i8* %2
}
/* Variables and functions */
int game(int, int);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *, int *);
int main() {
  int n = 0, k = 0;
  scanf("%d %d", &n, &k);
  printf("%d\n", game(n, k));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
lea    0xeac(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
call   1040 <scanf@plt>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1050 <game@plt>
mov    %eax,%esi
lea    0xe91(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0x0,0x4(%rsp)
movl   $0x0,(%rsp)
lea    0xeb9(%rip),%rdi
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
call   1040 <scanf@plt>
mov    0x4(%rsp),%edi
mov    (%rsp),%esi
call   1050 <game@plt>
lea    0xe9f(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [6 x i8] c"%d %d\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
store i32 0, i32* %1
%4 = bitcast i32* %2 to i8*
store i32 0, i32* %2
%5 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2)
%6 = load i32, i32* %1
%7 = load i32, i32* %2
%8 = call i32 @game(i32 %6, i32 %7)
%9 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %8)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;
struct cl_rhash {
  int dummy;
};

/* Variables and functions */
struct cl_rhash *cl_rhash_create(int /*<<< orphan*/, int);
struct cl_rhash *cl_rhash_create_set(uint16_t key_bytes) {
  return cl_rhash_create(key_bytes, false);
}


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

x86 assembly (clang, -O2):
<cl_rhash_create_set>:
xor    %esi,%esi
jmp    1030 <cl_rhash_create@plt>

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

LLVM IR (-O2):
%struct.cl_rhash = type { i32 }
define %struct.cl_rhash* @cl_rhash_create_set(i32 %0) {
%2 = tail call %struct.cl_rhash* @cl_rhash_create(i32 %0, i32 0)
ret %struct.cl_rhash* %2
}
/* Variables and functions */
int /*<<< orphan*/ alias2_OK();
int loop1_bad() {
  int k = 100;
  for (int i = 0; i < k; i++) {
    alias2_OK();
  }
  return 0;
}


x86 assembly (clang, -O0):
<loop1_bad>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x64,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1147 <loop1_bad+0x37>
mov    $0x0,%al
call   1030 <alias2_OK@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <loop1_bad+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<loop1_bad>:
push   %rbx
mov    $0x64,%ebx
cs nopw 0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <alias2_OK@plt>
add    $0xffffffff,%ebx
jne    1120 <loop1_bad+0x10>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @loop1_bad() {
%1 = alloca i32
%2 = alloca i32
store i32 100, i32* %1
store i32 0, i32* %2
br label %3
3: ; preds = %9, %0
%4 = load i32, i32* %2
%5 = load i32, i32* %1
%6 = icmp slt i32 %4, %5
br i1 %6, label %7, label %12
7: ; preds = %3
%8 = call i32 (...) @alias2_OK()
br label %9
9: ; preds = %7
%10 = load i32, i32* %2
%11 = add nsw i32 %10, 1
store i32 %11, i32* %2
br label %3
12: ; preds = %3
ret i32 0
}

LLVM IR (-O2):
define i32 @loop1_bad() {
br label %2
1: ; preds = %2
ret i32 0
2: ; preds = %0, %2
%3 = phi i32 [ 0, %0 ], [ %5, %2 ]
%4 = tail call i32 (...) @alias2_OK()
%5 = add nuw nsw i32 %3, 1
%6 = icmp eq i32 %5, 100
br i1 %6, label %1, label %2
}
/* Type definitions */
struct timeouts {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct timeouts *);
int /*<<< orphan*/ timeouts_reset(struct timeouts *);
void timeouts_close(struct timeouts *T) {
  timeouts_reset(T);
  free(T);
}


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

x86 assembly (clang, -O2):
<timeouts_close>:
push   %rbx
mov    %rdi,%rbx
call   1040 <timeouts_reset@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

LLVM IR (-O0):
%struct.timeouts = type { i32 }
define void @timeouts_close(%struct.timeouts* %0) {
%2 = alloca %struct.timeouts*
store %struct.timeouts* %0, %struct.timeouts** %2
%3 = load %struct.timeouts*, %struct.timeouts** %2
%4 = call i32 @timeouts_reset(%struct.timeouts* %3)
%5 = load %struct.timeouts*, %struct.timeouts** %2
%6 = call i32 @free(%struct.timeouts* %5)
ret void
}

LLVM IR (-O2):
%struct.timeouts = type { i32 }
define void @timeouts_close(%struct.timeouts* %0) {
%2 = tail call i32 @timeouts_reset(%struct.timeouts* %0)
%3 = tail call i32 @free(%struct.timeouts* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ log_destroy();
void safe_exit(int sig) {
  log_destroy();
  exit(1);
}


x86 assembly (clang, -O0):
<safe_exit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <log_destroy@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<safe_exit>:
push   %rax
xor    %eax,%eax
call   1030 <log_destroy@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define void @safe_exit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @log_destroy()
%4 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
define void @safe_exit(i32 %0) {
%2 = tail call i32 (...) @log_destroy()
%3 = tail call i32 @exit(i32 1)
unreachable
}
int atoi(char s[]) {
  int i, n;
  n = 0;
  for (i = 0; s[i] >= '0' && s[i] <= '9'; ++i)
    n = 10 * n + (s[i] - '0');
  return n;
}


x86 assembly (clang, -O0):
<atoi>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%ecx
xor    %eax,%eax
cmp    $0x30,%ecx
mov    %al,-0x11(%rbp)
jl     1145 <atoi+0x45>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x39,%eax
setle  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    1155 <atoi+0x55>
jmp    117b <atoi+0x7b>
imul   $0xa,-0x10(%rbp),%eax
mov    -0x8(%rbp),%rcx
movslq -0xc(%rbp),%rdx
movsbl (%rcx,%rdx,1),%ecx
sub    $0x30,%ecx
add    %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1116 <atoi+0x16>
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<atoi>:
mov    (%rdi),%cl
lea    -0x30(%rcx),%edx
xor    %eax,%eax
cmp    $0x9,%dl
ja     113b <atoi+0x3b>
add    $0x1,%rdi
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movzbl %cl,%ecx
lea    (%rax,%rax,4),%eax
lea    (%rcx,%rax,2),%eax
add    $0xffffffd0,%eax
movzbl (%rdi),%ecx
lea    -0x30(%rcx),%edx
add    $0x1,%rdi
cmp    $0xa,%dl
jb     1120 <atoi+0x20>
ret

LLVM IR (-O0):
define i32 @atoi(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %4
store i32 0, i32* %3
br label %5
5: ; preds = %34, %1
%6 = load i8*, i8** %2
%7 = load i32, i32* %3
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i8, i8* %6, i64 %8
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
%12 = icmp sge i32 %11, 48
br i1 %12, label %13, label %21
13: ; preds = %5
%14 = load i8*, i8** %2
%15 = load i32, i32* %3
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds i8, i8* %14, i64 %16
%18 = load i8, i8* %17
%19 = sext i8 %18 to i32
%20 = icmp sle i32 %19, 57
br label %21
21: ; preds = %13, %5
%22 = phi i1 [ false, %5 ], [ %20, %13 ]
br i1 %22, label %23, label %37
23: ; preds = %21
%24 = load i32, i32* %4
%25 = mul nsw i32 10, %24
%26 = load i8*, i8** %2
%27 = load i32, i32* %3
%28 = sext i32 %27 to i64
%29 = getelementptr inbounds i8, i8* %26, i64 %28
%30 = load i8, i8* %29
%31 = sext i8 %30 to i32
%32 = sub nsw i32 %31, 48
%33 = add nsw i32 %25, %32
store i32 %33, i32* %4
br label %34
34: ; preds = %23
%35 = load i32, i32* %3
%36 = add nsw i32 %35, 1
store i32 %36, i32* %3
br label %5
37: ; preds = %21
%38 = load i32, i32* %4
ret i32 %38
}

LLVM IR (-O2):
define i32 @atoi(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = add i8 %2, -48
%4 = icmp ult i8 %3, 10
br i1 %4, label %5, label %18
5: ; preds = %1, %5
%6 = phi i64 [ %13, %5 ], [ 0, %1 ]
%7 = phi i8 [ %15, %5 ], [ %2, %1 ]
%8 = phi i32 [ %12, %5 ], [ 0, %1 ]
%9 = zext i8 %7 to i32
%10 = mul nsw i32 %8, 10
%11 = add i32 %10, -48
%12 = add i32 %11, %9
%13 = add nuw nsw i64 %6, 1
%14 = getelementptr inbounds i8, i8* %0, i64 %13
%15 = load i8, i8* %14
%16 = add i8 %15, -48
%17 = icmp ult i8 %16, 10
br i1 %17, label %5, label %18
18: ; preds = %5, %1
%19 = phi i32 [ 0, %1 ], [ %12, %5 ]
ret i32 %19
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void func(void) { printf("func() from func_prod.c (Production) called.\n"); }


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

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

LLVM IR (-O0):
@.str = [46 x i8] c"func() from func_prod.c (Production) called.\0A\00"
define void @func() {
%1 = call i32 @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [45 x i8] c"func() from func_prod.c (Production) called.\00"
define void @func() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([45 x i8], [45 x i8]* @str, i64 0, i64 0))
ret void
}
int d_bun_mm2(double *a1, double *a2) {
  return !(__builtin_isunordered(*a1, *a2));
}


x86 assembly (clang, -O0):
<d_bun_mm2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x10(%rbp),%rax
ucomisd (%rax),%xmm0
setp   %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<d_bun_mm2>:
movsd  (%rdi),%xmm0
xor    %eax,%eax
ucomisd (%rsi),%xmm0
setnp  %al
ret

LLVM IR (-O0):
define i32 @d_bun_mm2(double* %0, double* %1) {
%3 = alloca double*
%4 = alloca double*
store double* %0, double** %3
store double* %1, double** %4
%5 = load double*, double** %3
%6 = load double, double* %5
%7 = load double*, double** %4
%8 = load double, double* %7
%9 = fcmp uno double %6, %8
%10 = xor i1 %9, true
%11 = zext i1 %10 to i32
ret i32 %11
}

LLVM IR (-O2):
define i32 @d_bun_mm2(double* nocapture %0, double* nocapture %1) {
%3 = load double, double* %0
%4 = load double, double* %1
%5 = fcmp ord double %3, %4
%6 = zext i1 %5 to i32
ret i32 %6
}
int sigma(int n) {
  int sum = 0;
  for (int i = 0; i <= n; i++)
    sum += i;
  return sum;
}


x86 assembly (clang, -O0):
<sigma>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x4(%rbp),%eax
jg     1138 <sigma+0x38>
mov    -0xc(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1115 <sigma+0x15>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sigma>:
mov    %edi,%eax
lea    -0x1(%rdi),%ecx
imul   %rax,%rcx
shr    %rcx
add    %edi,%ecx
xor    %eax,%eax
test   %edi,%edi
cmovns %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @sigma(i32 %0) {
%2 = icmp slt i32 %0, 0
%3 = zext i32 %0 to i33
%4 = add nsw i32 %0, -1
%5 = zext i32 %4 to i33
%6 = mul i33 %3, %5
%7 = lshr i33 %6, 1
%8 = trunc i33 %7 to i32
%9 = add i32 %8, %0
%10 = select i1 %2, i32 0, i32 %9
ret i32 %10
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128;

/* Variables and functions */
int _mm_cvtss_i32(int /*<<< orphan*/);
int test_mm_cvtss_i32(__m128 A) { return _mm_cvtss_i32(A); }


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

x86 assembly (clang, -O2):
<test_mm_cvtss_i32>:
jmp    1030 <_mm_cvtss_i32@plt>

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

LLVM IR (-O2):
define i32 @test_mm_cvtss_i32(i32 %0) {
%2 = tail call i32 @_mm_cvtss_i32(i32 %0)
ret i32 %2
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ gdb_send_text_packet(char *, unsigned int);
int util_str_len(char *);
void rpi2_gdb_log(char *ptr, uint32_t size, uint32_t fun) {
  int len;
  len = size;
  if (fun == 13) {
    len = util_str_len(ptr);
  }
  gdb_send_text_packet(ptr, (unsigned int)len);
}


x86 assembly (clang, -O0):
<rpi2_gdb_log>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
cmpl   $0xd,-0x10(%rbp)
jne    114e <rpi2_gdb_log+0x2e>
mov    -0x8(%rbp),%rdi
call   1030 <util_str_len@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1040 <gdb_send_text_packet@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rpi2_gdb_log>:
push   %rbx
mov    %rdi,%rbx
cmp    $0xd,%edx
jne    1133 <rpi2_gdb_log+0x13>
mov    %rbx,%rdi
call   1030 <util_str_len@plt>
mov    %eax,%esi
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <gdb_send_text_packet@plt>

LLVM IR (-O0):
define void @rpi2_gdb_log(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i32, i32* %5
store i32 %8, i32* %7
%9 = load i32, i32* %6
%10 = icmp eq i32 %9, 13
br i1 %10, label %11, label %14
11: ; preds = %3
%12 = load i8*, i8** %4
%13 = call i32 @util_str_len(i8* %12)
store i32 %13, i32* %7
br label %14
14: ; preds = %11, %3
%15 = load i8*, i8** %4
%16 = load i32, i32* %7
%17 = call i32 @gdb_send_text_packet(i8* %15, i32 %16)
ret void
}

LLVM IR (-O2):
define void @rpi2_gdb_log(i8* %0, i32 %1, i32 %2) {
%4 = icmp eq i32 %2, 13
br i1 %4, label %5, label %7
5: ; preds = %3
%6 = tail call i32 @util_str_len(i8* %0)
br label %7
7: ; preds = %5, %3
%8 = phi i32 [ %6, %5 ], [ %1, %3 ]
%9 = tail call i32 @gdb_send_text_packet(i8* %0, i32 %8)
ret void
}
int eid_vwr_verify_card(void *d) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @eid_vwr_verify_card(i8* nocapture readnone %0) {
ret i32 0
}
void *mapping(unsigned long page_addr) {
  void *result;
  if (page_addr < 0x80000) {
    result = (void *)(page_addr << 12);
  } else {
    unsigned long alias;
    alias = page_addr & 0x7FFFF;
    alias += 0x80000;
    result = (void *)(alias << 12);
  }
  return result;
}


x86 assembly (clang, -O0):
<mapping>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
cmpq   $0x80000,-0x8(%rbp)
jae    1127 <mapping+0x27>
mov    -0x8(%rbp),%rax
shl    $0xc,%rax
mov    %rax,-0x10(%rbp)
jmp    114f <mapping+0x4f>
mov    -0x8(%rbp),%rax
and    $0x7ffff,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x80000,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
shl    $0xc,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mapping>:
mov    %rdi,%rcx
shl    $0xc,%rcx
mov    %ecx,%eax
or     $0x80000000,%eax
cmp    $0x80000,%rdi
cmovb  %rcx,%rax
ret

LLVM IR (-O0):
define i8* @mapping(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
%4 = alloca i64
store i64 %0, i64* %2
%5 = load i64, i64* %2
%6 = icmp ult i64 %5, 524288
br i1 %6, label %7, label %11
7: ; preds = %1
%8 = load i64, i64* %2
%9 = shl i64 %8, 12
%10 = inttoptr i64 %9 to i8*
store i8* %10, i8** %3
br label %19
11: ; preds = %1
%12 = load i64, i64* %2
%13 = and i64 %12, 524287
store i64 %13, i64* %4
%14 = load i64, i64* %4
%15 = add i64 %14, 524288
store i64 %15, i64* %4
%16 = load i64, i64* %4
%17 = shl i64 %16, 12
%18 = inttoptr i64 %17 to i8*
store i8* %18, i8** %3
br label %19
19: ; preds = %11, %7
%20 = load i8*, i8** %3
ret i8* %20
}

LLVM IR (-O2):
define i8* @mapping(i64 %0) {
%2 = icmp ult i64 %0, 524288
%3 = shl i64 %0, 12
%4 = and i64 %3, 2147479552
%5 = or i64 %4, 2147483648
%6 = select i1 %2, i64 %3, i64 %5
%7 = inttoptr i64 %6 to i8*
ret i8* %7
}
/* Variables and functions */
int DigitSum(int);
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ puts(char *);
int main(int argc, char const *argv[]) {
  assert(DigitSum(1729) == 19);
  assert(DigitSum(19834) == 25);
  puts("All assertions correct - success!");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x6c1,%edi
call   1040 <DigitSum@plt>
cmp    $0x13,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
mov    $0x4d7a,%edi
call   1040 <DigitSum@plt>
cmp    $0x19,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
lea    0xe7f(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x6c1,%edi
call   1040 <DigitSum@plt>
xor    %edi,%edi
cmp    $0x13,%eax
sete   %dil
call   1050 <assert@plt>
mov    $0x4d7a,%edi
call   1040 <DigitSum@plt>
xor    %edi,%edi
cmp    $0x19,%eax
sete   %dil
call   1050 <assert@plt>
lea    0xe98(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [34 x i8] c"All assertions correct - success!\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @DigitSum(i32 1729)
%7 = icmp eq i32 %6, 19
%8 = zext i1 %7 to i32
%9 = call i32 @assert(i32 %8)
%10 = call i32 @DigitSum(i32 19834)
%11 = icmp eq i32 %10, 25
%12 = zext i1 %11 to i32
%13 = call i32 @assert(i32 %12)
%14 = call i32 @puts(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [34 x i8] c"All assertions correct - success!\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @DigitSum(i32 1729)
%4 = icmp eq i32 %3, 19
%5 = zext i1 %4 to i32
%6 = tail call i32 @assert(i32 %5)
%7 = tail call i32 @DigitSum(i32 19834)
%8 = icmp eq i32 %7, 25
%9 = zext i1 %8 to i32
%10 = tail call i32 @assert(i32 %9)
%11 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
scalar_t__ malloc(int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ read_line(char *, int);
int /*<<< orphan*/ strip(char *, int);
int remove_contact() {
  char *buffer = NULL;
  buffer = (char *)malloc(64 * sizeof(char));
  if (!buffer) {
    return 2;
  }
  printf("\n  Number (n): ");
  read_line(buffer, 16);
  strip(buffer, 16);
  free(buffer);
  return 0;
}


x86 assembly (clang, -O0):
<remove_contact>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movq   $0x0,-0x10(%rbp)
mov    $0x40,%edi
call   1060 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1185 <remove_contact+0x35>
movl   $0x2,-0x4(%rbp)
jmp    11bd <remove_contact+0x6d>
lea    0xe74(%rip),%rdi
call   1040 <printf@plt>
mov    -0x10(%rbp),%rdi
mov    $0x10,%esi
call   1070 <read_line@plt>
mov    -0x10(%rbp),%rdi
mov    $0x10,%esi
call   1050 <strip@plt>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<remove_contact>:
push   %rbx
mov    $0x40,%edi
call   1060 <malloc@plt>
test   %rax,%rax
je     1195 <remove_contact+0x45>
mov    %rax,%rbx
lea    0xe96(%rip),%rdi
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0x10,%esi
call   1070 <read_line@plt>
mov    %rbx,%rdi
mov    $0x10,%esi
call   1050 <strip@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
xor    %eax,%eax
pop    %rbx
ret
mov    $0x2,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [16 x i8] c"\0A Number (n): \00"
define i32 @remove_contact() {
%1 = alloca i32
%2 = alloca i8*
store i8* null, i8** %2
%3 = call i64 @malloc(i32 64)
%4 = inttoptr i64 %3 to i8*
store i8* %4, i8** %2
%5 = load i8*, i8** %2
%6 = icmp ne i8* %5, null
br i1 %6, label %8, label %7
7: ; preds = %0
store i32 2, i32* %1
br label %16
8: ; preds = %0
%9 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%10 = load i8*, i8** %2
%11 = call i32 @read_line(i8* %10, i32 16)
%12 = load i8*, i8** %2
%13 = call i32 @strip(i8* %12, i32 16)
%14 = load i8*, i8** %2
%15 = call i32 @free(i8* %14)
store i32 0, i32* %1
br label %16
16: ; preds = %8, %7
%17 = load i32, i32* %1
ret i32 %17
}

LLVM IR (-O2):
@.str = [16 x i8] c"\0A Number (n): \00"
define i32 @remove_contact() {
%1 = tail call i64 @malloc(i32 64)
%2 = inttoptr i64 %1 to i8*
%3 = icmp eq i64 %1, 0
br i1 %3, label %9, label %4
4: ; preds = %0
%5 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%6 = tail call i32 @read_line(i8* %2, i32 16)
%7 = tail call i32 @strip(i8* %2, i32 16)
%8 = tail call i32 @free(i8* %2)
br label %9
9: ; preds = %0, %4
%10 = phi i32 [ 0, %4 ], [ 2, %0 ]
ret i32 %10
}
/* Type definitions */
typedef int pid_t;

/* Variables and functions */
int /*<<< orphan*/ PF_INET;
int /*<<< orphan*/ SIOCATMARK;
int /*<<< orphan*/ SIOCSPGRP;
int /*<<< orphan*/ SOCK_DGRAM;
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ ioctl(int, int /*<<< orphan*/, int *);
int socket(int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/);
int main() {
  pid_t pid;
  int fd, atmark;
  fd = socket(PF_INET, SOCK_DGRAM, 0);
  ioctl(fd, SIOCSPGRP, &pid);
  ioctl(fd, SIOCATMARK, &atmark);
  close(fd);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2e8a(%rip),%rax
mov    (%rax),%edi
mov    0x2e99(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1050 <socket@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%edi
mov    0x2e63(%rip),%rax
mov    (%rax),%esi
lea    -0x8(%rbp),%rdx
call   1030 <ioctl@plt>
mov    -0xc(%rbp),%edi
mov    0x2e5e(%rip),%rax
mov    (%rax),%esi
lea    -0x10(%rbp),%rdx
call   1030 <ioctl@plt>
mov    -0xc(%rbp),%edi
call   1040 <close@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
mov    0x2e94(%rip),%rax
mov    (%rax),%edi
mov    0x2ea3(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1050 <socket@plt>
mov    %eax,%ebx
mov    0x2e71(%rip),%rax
mov    (%rax),%esi
lea    0xc(%rsp),%rdx
mov    %ebx,%edi
call   1030 <ioctl@plt>
mov    0x2e6c(%rip),%rax
mov    (%rax),%esi
lea    0x8(%rsp),%rdx
mov    %ebx,%edi
call   1030 <ioctl@plt>
mov    %ebx,%edi
call   1040 <close@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@PF_INET = global i32 0
@SOCK_DGRAM = global i32 0
@SIOCSPGRP = global i32 0
@SIOCATMARK = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
%5 = load i32, i32* @PF_INET
%6 = load i32, i32* @SOCK_DGRAM
%7 = call i32 @socket(i32 %5, i32 %6, i32 0)
store i32 %7, i32* %3
%8 = load i32, i32* %3
%9 = load i32, i32* @SIOCSPGRP
%10 = call i32 @ioctl(i32 %8, i32 %9, i32* %2)
%11 = load i32, i32* %3
%12 = load i32, i32* @SIOCATMARK
%13 = call i32 @ioctl(i32 %11, i32 %12, i32* %4)
%14 = load i32, i32* %3
%15 = call i32 @close(i32 %14)
ret i32 0
}

LLVM IR (-O2):
@PF_INET = global i32 0
@SOCK_DGRAM = global i32 0
@SIOCSPGRP = global i32 0
@SIOCATMARK = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = load i32, i32* @PF_INET
%6 = load i32, i32* @SOCK_DGRAM
%7 = tail call i32 @socket(i32 %5, i32 %6, i32 0)
%8 = load i32, i32* @SIOCSPGRP
%9 = call i32 @ioctl(i32 %7, i32 %8, i32* %1)
%10 = load i32, i32* @SIOCATMARK
%11 = call i32 @ioctl(i32 %7, i32 %10, i32* %2)
%12 = call i32 @close(i32 %7)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ freeze_gpio_out();
int /*<<< orphan*/ freeze_spi_out();
void operation_spi_stop() {
  freeze_spi_out();
  freeze_gpio_out();
}


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

x86 assembly (clang, -O2):
<operation_spi_stop>:
push   %rax
xor    %eax,%eax
call   1030 <freeze_spi_out@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <freeze_gpio_out@plt>

LLVM IR (-O0):
define void @operation_spi_stop() {
%1 = call i32 (...) @freeze_spi_out()
%2 = call i32 (...) @freeze_gpio_out()
ret void
}

LLVM IR (-O2):
define void @operation_spi_stop() {
%1 = tail call i32 (...) @freeze_spi_out()
%2 = tail call i32 (...) @freeze_gpio_out()
ret void
}
unsigned long long int strtoull(nptr, endptr, base) const char *nptr;
char **endptr;
int base;
{ return __strtoull_internal(nptr, endptr, base, 0); }


x86 assembly (clang, -O0):
<strtoull>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
xor    %ecx,%ecx
mov    $0x0,%al
call   1030 <__strtoull_internal@plt>
cltq
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strtoull>:
push   %rax
xor    %ecx,%ecx
xor    %eax,%eax
call   1030 <__strtoull_internal@plt>
cltq
pop    %rcx
ret

LLVM IR (-O0):
define i64 @strtoull(i8* %0, i8** %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8**
%6 = alloca i32
store i8* %0, i8** %4
store i8** %1, i8*** %5
store i32 %2, i32* %6
%7 = load i8*, i8** %4
%8 = load i8**, i8*** %5
%9 = load i32, i32* %6
%10 = call i32 (i8*, i8**, i32, i32, ...) bitcast (i32 (...)* @__strtoull_internal to i32 (i8*, i8**, i32, i32, ...)*)(i8* %7, i8** %8, i32 %9, i32 0)
%11 = sext i32 %10 to i64
ret i64 %11
}

LLVM IR (-O2):
define i64 @strtoull(i8* %0, i8** %1, i32 %2) {
%4 = tail call i32 (i8*, i8**, i32, i32, ...) bitcast (i32 (...)* @__strtoull_internal to i32 (i8*, i8**, i32, i32, ...)*)(i8* %0, i8** %1, i32 %2, i32 0)
%5 = sext i32 %4 to i64
ret i64 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void affiche_entier(int n) { printf("%d\n", n); }


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define void @affiche_entier(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
char *strchr(const char *s, int c) {
  const char *p = s;
  while (*p)
    if (*p++ == c)
      return (char *)p;
  return 0;
}


x86 assembly (clang, -O0):
<strchr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
cmpb   $0x0,(%rax)
je     114d <strchr+0x4d>
mov    -0x20(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x20(%rbp)
movsbl (%rax),%eax
cmp    -0x14(%rbp),%eax
jne    1148 <strchr+0x48>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1155 <strchr+0x55>
jmp    1113 <strchr+0x13>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strchr>:
mov    %rdi,%rax
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movsbl (%rax),%ecx
test   %ecx,%ecx
je     1120 <strchr+0x20>
add    $0x1,%rax
cmp    %esi,%ecx
jne    1110 <strchr+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i8* @strchr(i8* %0, i32 %1) {
br label %3
3: ; preds = %7, %2
%4 = phi i8* [ %0, %2 ], [ %8, %7 ]
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
br i1 %6, label %11, label %7
7: ; preds = %3
%8 = getelementptr inbounds i8, i8* %4, i64 1
%9 = sext i8 %5 to i32
%10 = icmp eq i32 %9, %1
br i1 %10, label %11, label %3
11: ; preds = %3, %7
%12 = phi i8* [ %8, %7 ], [ null, %3 ]
ret i8* %12
}
/* Variables and functions */
int fact(int);
int /*<<< orphan*/ printf(char *, int);
void main(int n) {
  int result;
  result = fact(n);
  printf("%d\n", result);
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
call   1040 <fact@plt>
lea    0xed3(%rip),%rdi
mov    %eax,%esi
pop    %rax
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define void @main(i32 %0) {
%2 = tail call i32 @fact(i32 %0)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ getch();
int /*<<< orphan*/ printf(char *, int);
main() {
  int a = 3;
  int b = 4;
  printf("%d", (a * b));
  getch();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x3,-0x4(%rbp)
movl   $0x4,-0x8(%rbp)
mov    -0x4(%rbp),%esi
imul   -0x8(%rbp),%esi
lea    0xebc(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <getch@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 12)
%2 = tail call i32 (...) @getch()
ret i32 0
}
int SNDDummyReset(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @SNDDummyReset() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int, int, int, int);
int main(void) {
  printf("\nSIZE OF HOST SYSTEM TYPES:\n"
         "CHAR:\t%d\n"
         "SHORT:\t%d\n"
         "INT:\t%d\n"
         "FLOAT:\t%d\n"
         "DOUBLE:\t%d\n\n",
         sizeof(char), sizeof(short), sizeof(int), sizeof(float),
         sizeof(double));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
mov    $0x1,%esi
mov    $0x2,%edx
mov    $0x4,%r8d
mov    $0x8,%r9d
mov    %r8d,%ecx
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [78 x i8] c"\0ASIZE OF HOST SYSTEM TYPES:\0ACHAR:\09%d\0ASHORT:\09%d\0AINT:\09%d\0AFLOAT:\09%d\0ADOUBLE:\09%d\0A\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([78 x i8], [78 x i8]* @.str, i64 0, i64 0), i32 1, i32 2, i32 4, i32 4, i32 8)
ret i32 0
}

LLVM IR (-O2):
@.str = [78 x i8] c"\0ASIZE OF HOST SYSTEM TYPES:\0ACHAR:\09%d\0ASHORT:\09%d\0AINT:\09%d\0AFLOAT:\09%d\0ADOUBLE:\09%d\0A\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([78 x i8], [78 x i8]* @.str, i64 0, i64 0), i32 1, i32 2, i32 4, i32 4, i32 8)
ret i32 0
}