xunge/DecIR huggingface dataset:
/* Variables and functions */
char *getenv(char const *);
int /*<<< orphan*/ snprintf(char *, size_t, char *, char const *);
int getenv_m(const char *nam, char *dest, size_t destsz) {
  const char *v = getenv(nam);
  if (!v)
    return -1;
  snprintf(dest, destsz, "%s", v);
  return 0;
}


x86 assembly (clang, -O0):
<getenv_m>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <getenv@plt>
mov    %rax,-0x28(%rbp)
cmpq   $0x0,-0x28(%rbp)
jne    1158 <getenv_m+0x38>
movl   $0xffffffff,-0x4(%rbp)
jmp    1177 <getenv_m+0x57>
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    -0x28(%rbp),%rcx
lea    0xe95(%rip),%rdx
call   1040 <snprintf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getenv_m>:
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rsi,%rbx
call   1030 <getenv@plt>
test   %rax,%rax
je     114d <getenv_m+0x2d>
lea    0xec5(%rip),%rdx
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %rax,%rcx
call   1040 <snprintf@plt>
xor    %eax,%eax
jmp    1152 <getenv_m+0x32>
mov    $0xffffffff,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
define i32 @getenv_m(i8* %0, i8* %1, i64 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i64
%8 = alloca i8*
store i8* %0, i8** %5
store i8* %1, i8** %6
store i64 %2, i64* %7
%9 = load i8*, i8** %5
%10 = call i8* @getenv(i8* %9)
store i8* %10, i8** %8
%11 = load i8*, i8** %8
%12 = icmp ne i8* %11, null
br i1 %12, label %14, label %13
13: ; preds = %3
store i32 -1, i32* %4
br label %19
14: ; preds = %3
%15 = load i8*, i8** %6
%16 = load i64, i64* %7
%17 = load i8*, i8** %8
%18 = call i32 @snprintf(i8* %15, i64 %16, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %17)
store i32 0, i32* %4
br label %19
19: ; preds = %14, %13
%20 = load i32, i32* %4
ret i32 %20
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define i32 @getenv_m(i8* nocapture %0, i8* %1, i64 %2) {
%4 = tail call i8* @getenv(i8* %0)
%5 = icmp eq i8* %4, null
br i1 %5, label %8, label %6
6: ; preds = %3
%7 = tail call i32 @snprintf(i8* %1, i64 %2, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %4)
br label %8
8: ; preds = %3, %6
%9 = phi i32 [ 0, %6 ], [ -1, %3 ]
ret i32 %9
}
int test_imm_93uint64_midword_mem(unsigned long long *val) {
  return ((*val >> 16) & (0x93 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_93uint64_midword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 9633792
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
int fun2(int i) {
  printf("in file [%s] func [%s]  : %d\n",
         "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
         "2022-01-22/02-19-57/repos/blackerliu/c.lang.kata/refs/heads/master/"
         "liborder/fun2.c",
         __FUNCTION__, i);
  return 0;
}


x86 assembly (clang, -O0):
<fun2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
lea    0xedb(%rip),%rdi
lea    0xef2(%rip),%rsi
lea    0xf7e(%rip),%rdx
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fun2>:
push   %rax
mov    %edi,%ecx
lea    0xee6(%rip),%rdi
lea    0xefd(%rip),%rsi
lea    0xf89(%rip),%rdx
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [30 x i8] c"in file [%s] func [%s] : %d\0A\00"
@.str.1 = [147 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/blackerliu/c.lang.kata/refs/heads/master/liborder/fun2.c\00"
@__FUNCTION__.fun2 = [5 x i8] c"fun2\00"
define i32 @fun2(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([147 x i8], [147 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @__FUNCTION__.fun2, i64 0, i64 0), i32 %3)
ret i32 0
}

LLVM IR (-O2):
@.str = [30 x i8] c"in file [%s] func [%s] : %d\0A\00"
@.str.1 = [147 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/blackerliu/c.lang.kata/refs/heads/master/liborder/fun2.c\00"
@__FUNCTION__.fun2 = [5 x i8] c"fun2\00"
define i32 @fun2(i32 %0) {
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([147 x i8], [147 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @__FUNCTION__.fun2, i64 0, i64 0), i32 %0)
ret i32 0
}
/* Variables and functions */
int ssds_get_gen_num(int, char *, char *, char *);
int ssds_get_class_num(int pcfd, char *class_def) {
  return ssds_get_gen_num(pcfd, class_def, "gc", "c_num");
}


x86 assembly (clang, -O0):
<ssds_get_class_num>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
lea    0xed3(%rip),%rdx
lea    0xecf(%rip),%rcx
call   1030 <ssds_get_gen_num@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ssds_get_class_num>:
lea    0xee9(%rip),%rdx
lea    0xee5(%rip),%rcx
jmp    1030 <ssds_get_gen_num@plt>

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

LLVM IR (-O2):
@.str = [3 x i8] c"gc\00"
@.str.1 = [6 x i8] c"c_num\00"
define i32 @ssds_get_class_num(i32 %0, i8* %1) {
%3 = tail call i32 @ssds_get_gen_num(i32 %0, i8* %1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
int main(int argc, char *argv[]) {
  char buffer[100];
  strcpy(buffer, argv[1]);
  printf("buffer: [%s].\n", buffer);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x80(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
call   1030 <strcpy@plt>
lea    -0x80(%rbp),%rsi
lea    0xeab(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x70,%rsp
mov    0x8(%rsi),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1030 <strcpy@plt>
lea    0xec5(%rip),%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [15 x i8] c"buffer: [%s].\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [100 x i8]
%4 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = call i32 @strcpy(i8* %4, i8* %6)
%8 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %4)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ write_string(char const *);
void send_error(const char *error, const char *command) {
  write_string("Error (");
  write_string(error);
  write_string("): ");
  write_string(command);
  write_string("\n");
}


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

x86 assembly (clang, -O2):
<send_error>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
lea    0xedf(%rip),%rdi
call   1030 <write_string@plt>
mov    %rbx,%rdi
call   1030 <write_string@plt>
lea    0xed3(%rip),%rdi
call   1030 <write_string@plt>
mov    %r14,%rdi
call   1030 <write_string@plt>
lea    0xec3(%rip),%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <write_string@plt>

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

LLVM IR (-O2):
@.str = [8 x i8] c"Error (\00"
@.str.1 = [4 x i8] c"): \00"
@.str.2 = [2 x i8] c"\0A\00"
define void @send_error(i8* %0, i8* %1) {
%3 = tail call i32 @write_string(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @write_string(i8* %0)
%5 = tail call i32 @write_string(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%6 = tail call i32 @write_string(i8* %1)
%7 = tail call i32 @write_string(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *, int, int, int);
void intarrcb(const char *l, char s, int *v) {
  printf("Callback [int[]]: %s %d [0: %d, 1: %d]\n", l, (int)s, v[0], v[1]);
}


x86 assembly (clang, -O0):
<intarrcb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rsi
movsbl -0x9(%rbp),%edx
mov    -0x18(%rbp),%rax
mov    (%rax),%ecx
mov    -0x18(%rbp),%rax
mov    0x4(%rax),%r8d
lea    0xebd(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<intarrcb>:
mov    %esi,%eax
mov    %rdi,%rsi
mov    (%rdx),%ecx
mov    0x4(%rdx),%r8d
lea    0xede(%rip),%rdi
mov    %eax,%edx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [40 x i8] c"Callback [int[]]: %s %d [0: %d, 1: %d]\0A\00"
define void @intarrcb(i8* %0, i8 signext %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 = sext i8 %8 to i32
%10 = load i32*, i32** %6
%11 = getelementptr inbounds i32, i32* %10, i64 0
%12 = load i32, i32* %11
%13 = load i32*, i32** %6
%14 = getelementptr inbounds i32, i32* %13, i64 1
%15 = load i32, i32* %14
%16 = call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0), i8* %7, i32 %9, i32 %12, i32 %15)
ret void
}

LLVM IR (-O2):
@.str = [40 x i8] c"Callback [int[]]: %s %d [0: %d, 1: %d]\0A\00"
define void @intarrcb(i8* %0, i8 signext %1, i32* nocapture %2) {
%4 = sext i8 %1 to i32
%5 = load i32, i32* %2
%6 = getelementptr inbounds i32, i32* %2, i64 1
%7 = load i32, i32* %6
%8 = tail call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %4, i32 %5, i32 %7)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int, int);
int /*<<< orphan*/ scanf(char *, int *, int *, int *);
int main() {
  int day, month, year;
  scanf("%d-%d-%d", &day, &month, &year);
  printf("%d %d %d", day, month, year);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
lea    0xed5(%rip),%rdi
lea    0x14(%rsp),%rsi
lea    0x10(%rsp),%rdx
lea    0xc(%rsp),%rcx
call   1040 <scanf@plt>
mov    0x14(%rsp),%esi
mov    0x10(%rsp),%edx
mov    0xc(%rsp),%ecx
lea    0xeb7(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

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

LLVM IR (-O2):
@.str = [9 x i8] c"%d-%d-%d\00"
@.str.1 = [9 x i8] c"%d %d %d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = bitcast i32* %1 to i8*
%5 = bitcast i32* %2 to i8*
%6 = bitcast i32* %3 to i8*
%7 = call i32 @scanf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2, i32* %3)
%8 = load i32, i32* %1
%9 = load i32, i32* %2
%10 = load i32, i32* %3
%11 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32 %8, i32 %9, i32 %10)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ fatal(char *);
void *malloc(size_t);
void *xmalloc(size_t z) {
  void *p = malloc(z);
  if (!p)
    fatal("out of memory");
  return p;
}


x86 assembly (clang, -O0):
<xmalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1150 <xmalloc+0x30>
lea    0xeb5(%rip),%rdi
call   1040 <fatal@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmalloc>:
push   %rbx
call   1030 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    113a <xmalloc+0x1a>
lea    0xecb(%rip),%rdi
call   1040 <fatal@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"out of memory\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 ne i8* %6, null
br i1 %7, label %10, label %8
8: ; preds = %1
%9 = call i32 @fatal(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %8, %1
%11 = load i8*, i8** %3
ret i8* %11
}

LLVM IR (-O2):
@.str = [14 x i8] c"out of memory\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 %6
4: ; preds = %1
%5 = tail call i32 @fatal(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %1
ret i8* %2
}
unsigned int DMTimerIntEnableGet(unsigned int baseAdd) {
  return ((*((volatile unsigned int *)(baseAdd + (0x2C)))));
}


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

x86 assembly (clang, -O2):
<DMTimerIntEnableGet>:
add    $0x2c,%edi
mov    (%rdi),%eax
ret

LLVM IR (-O0):
define i32 @DMTimerIntEnableGet(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add i32 %3, 44
%5 = zext i32 %4 to i64
%6 = inttoptr i64 %5 to i32*
%7 = load volatile i32, i32* %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @DMTimerIntEnableGet(i32 %0) {
%2 = add i32 %0, 44
%3 = zext i32 %2 to i64
%4 = inttoptr i64 %3 to i32*
%5 = load volatile i32, i32* %4
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void vector_only_slot_free(void *slot) { (free(slot)); }


x86 assembly (clang, -O0):
<vector_only_slot_free>:
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):
<vector_only_slot_free>:
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @vector_only_slot_free(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 @vector_only_slot_free(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
int getStringLength(char *str) {
  int result = 0;
  for (int index = 0; str[index]; index++) {
    ++result;
  }
  return result;
}


x86 assembly (clang, -O0):
<getStringLength>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
cmpb   $0x0,(%rax,%rcx,1)
je     113f <getStringLength+0x3f>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1116 <getStringLength+0x16>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getStringLength>:
cmpb   $0x0,(%rdi)
je     111c <getStringLength+0x1c>
xor    %eax,%eax
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,0x1(%rdi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <getStringLength+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @getStringLength(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %6, label %8
4: ; preds = %8
%5 = trunc i64 %10 to i32
br label %6
6: ; preds = %4, %1
%7 = phi i32 [ 0, %1 ], [ %5, %4 ]
ret i32 %7
8: ; preds = %1, %8
%9 = phi i64 [ %10, %8 ], [ 0, %1 ]
%10 = add nuw nsw i64 %9, 1
%11 = getelementptr inbounds i8, i8* %0, i64 %10
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 0
br i1 %13, label %4, label %8
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
scalar_t__ memcmp(int /*<<< orphan*/ const *, char *, int);
int check_elf_magic(const uint8_t *buf) {
  if (memcmp(buf, "\177ELF", 4) && memcmp(buf, "\177OLF", 4))
    return -1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<check_elf_magic>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xed9(%rip),%rsi
mov    $0x4,%edx
call   1030 <memcmp@plt>
cmp    $0x0,%rax
je     1166 <check_elf_magic+0x56>
mov    -0x10(%rbp),%rdi
lea    0xebf(%rip),%rsi
mov    $0x4,%edx
call   1030 <memcmp@plt>
cmp    $0x0,%rax
je     1166 <check_elf_magic+0x56>
movl   $0xffffffff,-0x4(%rbp)
jmp    116d <check_elf_magic+0x5d>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_elf_magic>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rsi
mov    $0x4,%edx
call   1030 <memcmp@plt>
test   %rax,%rax
je     114d <check_elf_magic+0x3d>
lea    0xed4(%rip),%rsi
mov    %rbx,%rdi
mov    $0x4,%edx
call   1030 <memcmp@plt>
mov    %rax,%rcx
mov    $0xffffffff,%eax
test   %rcx,%rcx
je     114d <check_elf_magic+0x3d>
pop    %rbx
ret
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"\7FELF\00"
@.str.1 = [5 x i8] c"\7FOLF\00"
define i32 @check_elf_magic(i32* %0) {
%2 = alloca i32
%3 = alloca i32*
store i32* %0, i32** %3
%4 = load i32*, i32** %3
%5 = call i64 @memcmp(i32* %4, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 4)
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %12
7: ; preds = %1
%8 = load i32*, i32** %3
%9 = call i64 @memcmp(i32* %8, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 4)
%10 = icmp ne i64 %9, 0
br i1 %10, label %11, label %12
11: ; preds = %7
store i32 -1, i32* %2
br label %13
12: ; preds = %7, %1
store i32 0, i32* %2
br label %13
13: ; preds = %12, %11
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
@.str = [5 x i8] c"\7FELF\00"
@.str.1 = [5 x i8] c"\7FOLF\00"
define i32 @check_elf_magic(i32* %0) {
%2 = tail call i64 @memcmp(i32* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 4)
%3 = icmp eq i64 %2, 0
br i1 %3, label %7, label %4
4: ; preds = %1
%5 = tail call i64 @memcmp(i32* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 4)
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %4, %1
br label %8
8: ; preds = %4, %7
%9 = phi i32 [ 0, %7 ], [ -1, %4 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ getScreenBuf();
int /*<<< orphan*/ printStringToBuffer(int /*<<< orphan*/, char *, unsigned int,
                                       unsigned int, unsigned int,
                                       unsigned int);
void drawString(char *str, unsigned int x, unsigned int y, unsigned int bgcolor,
                unsigned int color) {
  printStringToBuffer(getScreenBuf(), str, x, y, bgcolor, color);
}


x86 assembly (clang, -O0):
<drawString>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8d,-0x18(%rbp)
mov    $0x0,%al
call   1030 <getScreenBuf@plt>
mov    %eax,%edi
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
mov    -0x14(%rbp),%r8d
mov    -0x18(%rbp),%r9d
call   1040 <printStringToBuffer@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<drawString>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %r8d,%r14d
mov    %ecx,%r15d
mov    %edx,%r12d
mov    %esi,%ebp
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <getScreenBuf@plt>
mov    %eax,%edi
mov    %rbx,%rsi
mov    %ebp,%edx
mov    %r12d,%ecx
mov    %r15d,%r8d
mov    %r14d,%r9d
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <printStringToBuffer@plt>

LLVM IR (-O0):
define void @drawString(i8* %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i8* %0, i8** %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i32 %4, i32* %10
%11 = call i32 (...) @getScreenBuf()
%12 = load i8*, i8** %6
%13 = load i32, i32* %7
%14 = load i32, i32* %8
%15 = load i32, i32* %9
%16 = load i32, i32* %10
%17 = call i32 @printStringToBuffer(i32 %11, i8* %12, i32 %13, i32 %14, i32 %15, i32 %16)
ret void
}

LLVM IR (-O2):
define void @drawString(i8* %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = tail call i32 (...) @getScreenBuf()
%7 = tail call i32 @printStringToBuffer(i32 %6, i8* %0, i32 %1, i32 %2, i32 %3, i32 %4)
ret void
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
uint8_t squarewave8(uint8_t in, uint8_t pulsewidth) {
  if (in < pulsewidth || (pulsewidth == 255)) {
    return 255;
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<squarewave8>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jl     1123 <squarewave8+0x23>
cmpl   $0xff,-0xc(%rbp)
jne    112f <squarewave8+0x2f>
movl   $0xff,-0x4(%rbp)
jmp    1136 <squarewave8+0x36>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<squarewave8>:
xor    %ecx,%ecx
cmp    $0xff,%esi
cmove  %esi,%ecx
cmp    %esi,%edi
mov    $0xff,%eax
cmovge %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @squarewave8(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, %1
%4 = icmp eq i32 %1, 255
%5 = or i1 %3, %4
%6 = select i1 %5, i32 255, i32 0
ret i32 %6
}
void back_mouse_up(double x, double y) {
  (void)x;
  (void)y;
}


x86 assembly (clang, -O0):
<back_mouse_up>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @back_mouse_up(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* %4
ret void
}

LLVM IR (-O2):
define void @back_mouse_up(double %0, double %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char *argv[]) {
  printf("This is a stub driver for the Memory Management package.\n");
  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)
lea    0xed3(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [58 x i8] c"This is a stub driver for the Memory Management package.\0A\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 @printf(i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [57 x i8] c"This is a stub driver for the Memory Management package.\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([57 x i8], [57 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ FOURCC(char, char, char, char);
int /*<<< orphan*/ NodeUnRegisterClass(int /*<<< orphan*/);
void WAV_Done() {
  NodeUnRegisterClass(FOURCC('R', 'A', 'I', 'F'));
  NodeUnRegisterClass(FOURCC('R', 'W', 'A', 'V'));
}


x86 assembly (clang, -O0):
<WAV_Done>:
push   %rbp
mov    %rsp,%rbp
mov    $0x52,%edi
mov    $0x41,%esi
mov    $0x49,%edx
mov    $0x46,%ecx
call   1030 <FOURCC@plt>
mov    %eax,%edi
call   1040 <NodeUnRegisterClass@plt>
mov    $0x52,%edi
mov    $0x57,%esi
mov    $0x41,%edx
mov    $0x56,%ecx
call   1030 <FOURCC@plt>
mov    %eax,%edi
call   1040 <NodeUnRegisterClass@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<WAV_Done>:
push   %rax
mov    $0x52,%edi
mov    $0x41,%esi
mov    $0x49,%edx
mov    $0x46,%ecx
call   1030 <FOURCC@plt>
mov    %eax,%edi
call   1040 <NodeUnRegisterClass@plt>
mov    $0x52,%edi
mov    $0x57,%esi
mov    $0x41,%edx
mov    $0x56,%ecx
call   1030 <FOURCC@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <NodeUnRegisterClass@plt>

LLVM IR (-O0):
define void @WAV_Done() {
%1 = call i32 @FOURCC(i8 signext 82, i8 signext 65, i8 signext 73, i8 signext 70)
%2 = call i32 @NodeUnRegisterClass(i32 %1)
%3 = call i32 @FOURCC(i8 signext 82, i8 signext 87, i8 signext 65, i8 signext 86)
%4 = call i32 @NodeUnRegisterClass(i32 %3)
ret void
}

LLVM IR (-O2):
define void @WAV_Done() {
%1 = tail call i32 @FOURCC(i8 signext 82, i8 signext 65, i8 signext 73, i8 signext 70)
%2 = tail call i32 @NodeUnRegisterClass(i32 %1)
%3 = tail call i32 @FOURCC(i8 signext 82, i8 signext 87, i8 signext 65, i8 signext 86)
%4 = tail call i32 @NodeUnRegisterClass(i32 %3)
ret void
}
void XtCvtStringToGravity() {}


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

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

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

LLVM IR (-O2):
define void @XtCvtStringToGravity() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void h_playcard() {
  printf("\t\tEnter the index of the card to play or -1 to have the computer "
         "pick.");
}


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

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

LLVM IR (-O0):
@.str = [71 x i8] c"\09\09Enter the index of the card to play or -1 to have the computer pick.\00"
define void @h_playcard() {
%1 = call i32 @printf(i8* getelementptr inbounds ([71 x i8], [71 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [71 x i8] c"\09\09Enter the index of the card to play or -1 to have the computer pick.\00"
define void @h_playcard() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([71 x i8], [71 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_usage() {
  printf("-b - run in the background\n");
  printf("-v [level] - verbose mode\n");
  printf("-a [addr] - address to connect to (defaults to 127.0.0.1)\n");
  printf("-p [port] - port to connect to (default to 1030)\n");
}


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

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

LLVM IR (-O0):
@.str = [28 x i8] c"-b - run in the background\0A\00"
@.str.1 = [27 x i8] c"-v [level] - verbose mode\0A\00"
@.str.2 = [59 x i8] c"-a [addr] - address to connect to (defaults to 127.0.0.1)\0A\00"
@.str.3 = [50 x i8] c"-p [port] - port to connect to (default to 1030)\0A\00"
define void @print_usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [27 x i8] c"-b - run in the background\00"
@str.4 = [26 x i8] c"-v [level] - verbose mode\00"
@str.5 = [58 x i8] c"-a [addr] - address to connect to (defaults to 127.0.0.1)\00"
@str.6 = [49 x i8] c"-p [port] - port to connect to (default to 1030)\00"
define void @print_usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str.4, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([58 x i8], [58 x i8]* @str.5, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([49 x i8], [49 x i8]* @str.6, i64 0, i64 0))
ret void
}
void gtk_ui_manager_ensure_update() {}


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

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

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

LLVM IR (-O2):
define void @gtk_ui_manager_ensure_update() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(void) {
  printf("I'm mega-mega prog!\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [21 x i8] c"I'm mega-mega prog!\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [20 x i8] c"I'm mega-mega prog!\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ free(void *);
void cleanup_client_accepter(void *args) {
  int serverfd = *((int *)args);
  close(serverfd);
  free(args);
}


x86 assembly (clang, -O0):
<cleanup_client_accepter>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%edi
call   1040 <close@plt>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @cleanup_client_accepter(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = bitcast i8* %4 to i32*
%6 = load i32, i32* %5
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = call i32 @close(i32 %7)
%9 = load i8*, i8** %2
%10 = call i32 @free(i8* %9)
ret void
}

LLVM IR (-O2):
define void @cleanup_client_accepter(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
%4 = tail call i32 @close(i32 %3)
%5 = tail call i32 @free(i8* %0)
ret void
}
AR0I1(r0, r1, x0, x1, p0, p1) short r0, r1;
short *p0, *p1;
{ (p0[10000000]) = 33; }


x86 assembly (clang, -O0):
<AR0I1>:
push   %rbp
mov    %rsp,%rbp
mov    %esi,%eax
mov    %di,%si
mov    %si,-0x6(%rbp)
mov    %ax,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8,-0x18(%rbp)
mov    %r9,-0x20(%rbp)
mov    -0x18(%rbp),%rax
movw   $0x21,0x1312d00(%rax)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<AR0I1>:
movw   $0x21,0x1312d00(%r8)
ret

LLVM IR (-O0):
define i32 @AR0I1(i32 %0, i32 %1, i32 %2, i32 %3, i16* %4, i16* %5) {
%7 = alloca i32
%8 = alloca i16
%9 = alloca i16
%10 = alloca i32
%11 = alloca i32
%12 = alloca i16*
%13 = alloca i16*
%14 = trunc i32 %0 to i16
%15 = trunc i32 %1 to i16
store i16 %14, i16* %8
store i16 %15, i16* %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store i16* %4, i16** %12
store i16* %5, i16** %13
%16 = load i16*, i16** %12
%17 = getelementptr inbounds i16, i16* %16, i64 10000000
store i16 33, i16* %17
%18 = load i32, i32* %7
ret i32 %18
}

LLVM IR (-O2):
define i32 @AR0I1(i32 %0, i32 %1, i32 %2, i32 %3, i16* nocapture writeonly %4, i16* nocapture readnone %5) {
%7 = getelementptr inbounds i16, i16* %4, i64 10000000
store i16 33, i16* %7
ret i32 undef
}
void CrashLog_LogStacktrace(char *buffer) {
  (void)buffer;
  ;
}


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

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

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

LLVM IR (-O2):
define void @CrashLog_LogStacktrace(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int inp_emulate(int);
char TOSH_READ_RADIO_CCA_PIN() { return 0x01 & (inp_emulate(-5) >> 0); }


x86 assembly (clang, -O0):
<TOSH_READ_RADIO_CCA_PIN>:
push   %rbp
mov    %rsp,%rbp
mov    $0xfffffffb,%edi
call   1030 <inp_emulate@plt>
sar    $0x0,%eax
and    $0x1,%eax
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<TOSH_READ_RADIO_CCA_PIN>:
push   %rax
mov    $0xfffffffb,%edi
call   1030 <inp_emulate@plt>
and    $0x1,%al
pop    %rcx
ret

LLVM IR (-O0):
define signext i8 @TOSH_READ_RADIO_CCA_PIN() {
%1 = call i32 @inp_emulate(i32 -5)
%2 = ashr i32 %1, 0
%3 = and i32 1, %2
%4 = trunc i32 %3 to i8
ret i8 %4
}

LLVM IR (-O2):
define signext i8 @TOSH_READ_RADIO_CCA_PIN() {
%1 = tail call i32 @inp_emulate(i32 -5)
%2 = trunc i32 %1 to i8
%3 = and i8 %2, 1
ret i8 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void presentar(int a) { printf("La respuesta es %d.\n", a); }


x86 assembly (clang, -O0):
<presentar>:
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):
<presentar>:
mov    %edi,%esi
lea    0xee7(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [21 x i8] c"La respuesta es %d.\0A\00"
define void @presentar(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void print_int(int data, void *extra_data) { printf("%d ", data); }


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d \00"
define void @print_int(i32 %0, i8* nocapture readnone %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ incr_thread_count();
int /*<<< orphan*/ noreturn();
void *thread_entry(void *unused) {
  incr_thread_count();
  noreturn();
}


x86 assembly (clang, -O0):
<thread_entry>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <incr_thread_count@plt>
mov    $0x0,%al
call   1040 <noreturn@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i8* @thread_entry(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %3
%4 = call i32 (...) @incr_thread_count()
%5 = call i32 (...) @noreturn()
%6 = load i8*, i8** %2
ret i8* %6
}

LLVM IR (-O2):
define noalias i8* @thread_entry(i8* nocapture readnone %0) {
%2 = tail call i32 (...) @incr_thread_count()
%3 = tail call i32 (...) @noreturn()
ret i8* undef
}
char rev(const char c) {
  switch (c) {
  case 'A':
  case 'a':
    return 'T';
  case 'C':
  case 'c':
    return 'G';
  case 'G':
  case 'g':
    return 'C';
  case 'T':
  case 't':
    return 'A';
  default:
    return 'N';
  }
}


x86 assembly (clang, -O0):
<rev>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x2(%rbp)
movsbl -0x2(%rbp),%eax
add    $0xffffffbf,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0x33,%eax
ja     1158 <rev+0x58>
mov    -0x10(%rbp),%rax
lea    0xed5(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movb   $0x54,-0x1(%rbp)
jmp    115c <rev+0x5c>
movb   $0x47,-0x1(%rbp)
jmp    115c <rev+0x5c>
movb   $0x43,-0x1(%rbp)
jmp    115c <rev+0x5c>
movb   $0x41,-0x1(%rbp)
jmp    115c <rev+0x5c>
movb   $0x4e,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rev>:
add    $0xffffffbf,%edi
cmp    $0x33,%edi
ja     1123 <rev+0x23>
mov    $0x54,%al
lea    0xeef(%rip),%rcx
movslq (%rcx,%rdi,4),%rdx
add    %rcx,%rdx
jmp    *%rdx
mov    $0x47,%al
ret
mov    $0x43,%al
ret
mov    $0x41,%al
ret
mov    $0x4e,%al
ret

LLVM IR (-O0):
define signext i8 @rev(i8 signext %0) {
%2 = alloca i8
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
switch i32 %5, label %10 [
i32 65, label %6
i32 97, label %6
i32 67, label %7
i32 99, label %7
i32 71, label %8
i32 103, label %8
i32 84, label %9
i32 116, label %9
]
6: ; preds = %1, %1
store i8 84, i8* %2
br label %11
7: ; preds = %1, %1
store i8 71, i8* %2
br label %11
8: ; preds = %1, %1
store i8 67, i8* %2
br label %11
9: ; preds = %1, %1
store i8 65, i8* %2
br label %11
10: ; preds = %1
store i8 78, i8* %2
br label %11
11: ; preds = %10, %9, %8, %7, %6
%12 = load i8, i8* %2
ret i8 %12
}

LLVM IR (-O2):
define signext i8 @rev(i8 signext %0) {
%2 = sext i8 %0 to i32
switch i32 %2, label %6 [
i32 65, label %7
i32 97, label %7
i32 67, label %3
i32 99, label %3
i32 71, label %4
i32 103, label %4
i32 84, label %5
i32 116, label %5
]
3: ; preds = %1, %1
br label %7
4: ; preds = %1, %1
br label %7
5: ; preds = %1, %1
br label %7
6: ; preds = %1
br label %7
7: ; preds = %1, %1, %6, %5, %4, %3
%8 = phi i8 [ 78, %6 ], [ 65, %5 ], [ 67, %4 ], [ 71, %3 ], [ 84, %1 ], [ 84, %1 ]
ret i8 %8
}
int increment_overflow(ip, j)
int *const ip;
int j;
{
  register int const i = *ip;
  if ((i >= 0) ? (j > 0x7fffffff - i) : (j < (-0x7fffffff - 1) - i))
    return 1;
  *ip += j;
  return 0;
}


x86 assembly (clang, -O0):
<increment_overflow>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x18(%rbp)
cmpl   $0x0,-0x18(%rbp)
jl     1136 <increment_overflow+0x36>
mov    -0x14(%rbp),%eax
mov    $0x7fffffff,%ecx
sub    -0x18(%rbp),%ecx
cmp    %ecx,%eax
jg     1149 <increment_overflow+0x49>
jmp    1155 <increment_overflow+0x55>
mov    -0x14(%rbp),%eax
mov    $0x80000000,%ecx
sub    -0x18(%rbp),%ecx
cmp    %ecx,%eax
jge    1155 <increment_overflow+0x55>
movl   $0x1,-0x4(%rbp)
jmp    1167 <increment_overflow+0x67>
mov    -0x14(%rbp),%ecx
mov    -0x10(%rbp),%rax
add    (%rax),%ecx
mov    %ecx,(%rax)
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<increment_overflow>:
mov    (%rdi),%ecx
test   %ecx,%ecx
js     111d <increment_overflow+0x1d>
mov    $0x7fffffff,%edx
sub    %ecx,%edx
mov    $0x1,%eax
cmp    %esi,%edx
jl     111c <increment_overflow+0x1c>
add    %esi,%ecx
mov    %ecx,(%rdi)
xor    %eax,%eax
ret
mov    $0x80000000,%edx
sub    %ecx,%edx
mov    $0x1,%eax
cmp    %esi,%edx
jle    1116 <increment_overflow+0x16>
jmp    111c <increment_overflow+0x1c>

LLVM IR (-O0):
define i32 @increment_overflow(i32* %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
store i32* %0, i32** %4
store i32 %1, i32* %5
%7 = load i32*, i32** %4
%8 = load i32, i32* %7
store i32 %8, i32* %6
%9 = load i32, i32* %6
%10 = icmp sge i32 %9, 0
br i1 %10, label %11, label %16
11: ; preds = %2
%12 = load i32, i32* %5
%13 = load i32, i32* %6
%14 = sub nsw i32 2147483647, %13
%15 = icmp sgt i32 %12, %14
br i1 %15, label %21, label %22
16: ; preds = %2
%17 = load i32, i32* %5
%18 = load i32, i32* %6
%19 = sub nsw i32 -2147483648, %18
%20 = icmp slt i32 %17, %19
br i1 %20, label %21, label %22
21: ; preds = %16, %11
store i32 1, i32* %3
br label %27
22: ; preds = %16, %11
%23 = load i32, i32* %5
%24 = load i32*, i32** %4
%25 = load i32, i32* %24
%26 = add nsw i32 %25, %23
store i32 %26, i32* %24
store i32 0, i32* %3
br label %27
27: ; preds = %22, %21
%28 = load i32, i32* %3
ret i32 %28
}

LLVM IR (-O2):
define i32 @increment_overflow(i32* nocapture %0, i32 %1) {
%3 = load i32, i32* %0
%4 = icmp sgt i32 %3, -1
br i1 %4, label %5, label %8
5: ; preds = %2
%6 = sub nuw nsw i32 2147483647, %3
%7 = icmp slt i32 %6, %1
br i1 %7, label %13, label %11
8: ; preds = %2
%9 = sub nsw i32 -2147483648, %3
%10 = icmp sgt i32 %9, %1
br i1 %10, label %13, label %11
11: ; preds = %8, %5
%12 = add nsw i32 %3, %1
store i32 %12, i32* %0
br label %13
13: ; preds = %5, %8, %11
%14 = phi i32 [ 0, %11 ], [ 1, %8 ], [ 1, %5 ]
ret i32 %14
}
const char *IoTHubClient_GetVersionString(void) { return "1.1.29"; }


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

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

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

LLVM IR (-O2):
@.str = [7 x i8] c"1.1.29\00"
define i8* @IoTHubClient_GetVersionString() {
ret i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0)
}