xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ _assert_string_equal(char const *, char const *, char *,
                                        int);
scalar_t__ disemvowel(char *);
void test_empty_str(void) {
  _assert_string_equal(
      (const char *)"", (const char *)disemvowel(""),
      "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
      "2022-01-22/02-19-57/repos/UMM-CSci-3401-F13/Lab_3_starter/refs/heads/"
      "master/disemvowel/disemvowel_test.c",
      9);
}


x86 assembly (clang, -O0):
<test_empty_str>:
push   %rbp
mov    %rsp,%rbp
lea    0xf7d(%rip),%rdi
call   1030 <disemvowel@plt>
mov    %rax,%rsi
lea    0xf6e(%rip),%rdi
lea    0xebf(%rip),%rdx
mov    $0x9,%ecx
call   1040 <_assert_string_equal@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_empty_str>:
push   %rbx
lea    0xf80(%rip),%rbx
mov    %rbx,%rdi
call   1030 <disemvowel@plt>
lea    0xec9(%rip),%rdx
mov    %rbx,%rdi
mov    %rax,%rsi
mov    $0x9,%ecx
pop    %rbx
jmp    1040 <_assert_string_equal@plt>

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
@.str.1 = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/UMM-CSci-3401-F13/Lab_3_starter/refs/heads/master/disemvowel/disemvowel_test.c\00"
define void @test_empty_str() {
%1 = call i64 @disemvowel(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%2 = inttoptr i64 %1 to i8*
%3 = call i32 @_assert_string_equal(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8* %2, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str.1, i64 0, i64 0), i32 9)
ret void
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
@.str.1 = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/UMM-CSci-3401-F13/Lab_3_starter/refs/heads/master/disemvowel/disemvowel_test.c\00"
define void @test_empty_str() {
%1 = tail call i64 @disemvowel(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%2 = inttoptr i64 %1 to i8*
%3 = tail call i32 @_assert_string_equal(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8* %2, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str.1, i64 0, i64 0), i32 9)
ret void
}
/* Type definitions */
struct sqlConnection {
  int dummy;
};

/* Variables and functions */
char *stringFieldInSubmissionSource(struct sqlConnection *, int, char *);
char *visiGeneItemUrl(struct sqlConnection *conn, int id) {
  return stringFieldInSubmissionSource(conn, id, "itemUrl");
}


x86 assembly (clang, -O0):
<visiGeneItemUrl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
lea    0xed3(%rip),%rdx
call   1030 <stringFieldInSubmissionSource@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<visiGeneItemUrl>:
lea    0xee9(%rip),%rdx
jmp    1030 <stringFieldInSubmissionSource@plt>

LLVM IR (-O0):
%struct.sqlConnection = type { i32 }
@.str = [8 x i8] c"itemUrl\00"
define i8* @visiGeneItemUrl(%struct.sqlConnection* %0, i32 %1) {
%3 = alloca %struct.sqlConnection*
%4 = alloca i32
store %struct.sqlConnection* %0, %struct.sqlConnection** %3
store i32 %1, i32* %4
%5 = load %struct.sqlConnection*, %struct.sqlConnection** %3
%6 = load i32, i32* %4
%7 = call i8* @stringFieldInSubmissionSource(%struct.sqlConnection* %5, i32 %6, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i8* %7
}

LLVM IR (-O2):
%struct.sqlConnection = type { i32 }
@.str = [8 x i8] c"itemUrl\00"
define i8* @visiGeneItemUrl(%struct.sqlConnection* %0, i32 %1) {
%3 = tail call i8* @stringFieldInSubmissionSource(%struct.sqlConnection* %0, i32 %1, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i8* %3
}
int pc_serial_close(__attribute__((unused)) void *private) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @pc_serial_close(i8* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(void *, void *, int);
int __RSA_Passthrough(void *output, void *input, int size) {
  memcpy(output, input, size);
  return size;
}


x86 assembly (clang, -O0):
<__RSA_Passthrough>:
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
call   1030 <memcpy@plt>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__RSA_Passthrough>:
push   %rbx
mov    %edx,%ebx
call   1030 <memcpy@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @__RSA_Passthrough(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 @memcpy(i8* %7, i8* %8, i32 %9)
%11 = load i32, i32* %6
ret i32 %11
}

LLVM IR (-O2):
define i32 @__RSA_Passthrough(i8* %0, i8* %1, i32 returned %2) {
%4 = tail call i32 @memcpy(i8* %0, i8* %1, i32 %2)
ret i32 %2
}
/* Variables and functions */
int function_test(int);
int main(int argc, char **argv) { return function_test(1); }


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    $0x1,%edi
call   1030 <function_test@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
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 @function_test(i32 1)
ret i32 %6
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @function_test(i32 1)
ret i32 %3
}
/* Type definitions */
struct timespec {
  long tv_nsec;
  scalar_t__ tv_sec;
};

/* Variables and functions */
int /*<<< orphan*/ nanosleep(struct timespec *, int /*<<< orphan*/ *);
void sleep_ms(long ms) {
  struct timespec time;
  time.tv_sec = 0;
  time.tv_nsec = ms * 1000000;
  nanosleep(&time, NULL);
}


x86 assembly (clang, -O0):
<sleep_ms>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
imul   $0xf4240,-0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
lea    -0x18(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <nanosleep@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sleep_ms>:
sub    $0x18,%rsp
movq   $0x0,0x10(%rsp)
imul   $0xf4240,%rdi,%rax
mov    %rax,0x8(%rsp)
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <nanosleep@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timespec = type { i64, i64 }
define void @sleep_ms(i64 %0) {
%2 = alloca i64
%3 = alloca %struct.timespec
store i64 %0, i64* %2
%4 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i32 0, i32 1
store i64 0, i64* %4
%5 = load i64, i64* %2
%6 = mul nsw i64 %5, 1000000
%7 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i32 0, i32 0
store i64 %6, i64* %7
%8 = call i32 @nanosleep(%struct.timespec* %3, i32* null)
ret void
}

LLVM IR (-O2):
%struct.timespec = type { i64, i64 }
define void @sleep_ms(i64 %0) {
%2 = alloca %struct.timespec
%3 = bitcast %struct.timespec* %2 to i8*
%4 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i64 0, i32 1
store i64 0, i64* %4
%5 = mul nsw i64 %0, 1000000
%6 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i64 0, i32 0
store i64 %5, i64* %6
%7 = call i32 @nanosleep(%struct.timespec* %2, i32* null)
ret void
}
/* Variables and functions */
scalar_t__ malloc(size_t);
int /*<<< orphan*/ memcpy(char *, char const *, size_t);
int strlen(char const *);
__attribute__((__unused__)) char *rhmap__strdup(const char *str) {
  size_t full_len = strlen(str) + 1;
  char *dup_str = (char *)malloc(full_len);
  if (!dup_str)
    return NULL;
  memcpy(dup_str, str, full_len);
  return dup_str;
}


x86 assembly (clang, -O0):
<rhmap__strdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
add    $0x1,%eax
cltq
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1050 <malloc@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    1173 <rhmap__strdup+0x43>
movq   $0x0,-0x8(%rbp)
jmp    118c <rhmap__strdup+0x5c>
mov    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1040 <memcpy@plt>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rhmap__strdup>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
call   1030 <strlen@plt>
add    $0x1,%eax
movslq %eax,%r15
mov    %r15,%rdi
call   1050 <malloc@plt>
test   %rax,%rax
je     1163 <rhmap__strdup+0x33>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
call   1040 <memcpy@plt>
jmp    1165 <rhmap__strdup+0x35>
xor    %ebx,%ebx
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i8* @rhmap__strdup(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = add nsw i32 %2, 1
%4 = sext i32 %3 to i64
%5 = tail call i64 @malloc(i64 %4)
%6 = inttoptr i64 %5 to i8*
%7 = icmp eq i64 %5, 0
br i1 %7, label %10, label %8
8: ; preds = %1
%9 = tail call i32 @memcpy(i8* %6, i8* %0, i64 %4)
br label %10
10: ; preds = %1, %8
%11 = phi i8* [ %6, %8 ], [ null, %1 ]
ret i8* %11
}
/* Type definitions */
typedef scalar_t__ int64_t;

/* Variables and functions */
int /*<<< orphan*/ assert(int);
char *mp_store_u64(char *, scalar_t__);
char *mp_store_u8(char *, int);
char *mp_encode_int64(char *data, int64_t num) {
  assert(num < 0);
  data = mp_store_u8(data, 0xd3);
  return mp_store_u64(data, num);
}


x86 assembly (clang, -O0):
<mp_encode_int64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
setl   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x8(%rbp),%rdi
mov    $0xd3,%esi
call   1040 <mp_store_u8@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1050 <mp_store_u64@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mp_encode_int64>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
shr    $0x3f,%rdi
call   1030 <assert@plt>
mov    %r14,%rdi
mov    $0xd3,%esi
call   1040 <mp_store_u8@plt>
mov    %rax,%rdi
mov    %rbx,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1050 <mp_store_u64@plt>

LLVM IR (-O0):
define i8* @mp_encode_int64(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = icmp slt i64 %5, 0
%7 = zext i1 %6 to i32
%8 = call i32 @assert(i32 %7)
%9 = load i8*, i8** %3
%10 = call i8* @mp_store_u8(i8* %9, i32 211)
store i8* %10, i8** %3
%11 = load i8*, i8** %3
%12 = load i64, i64* %4
%13 = call i8* @mp_store_u64(i8* %11, i64 %12)
ret i8* %13
}

LLVM IR (-O2):
define i8* @mp_encode_int64(i8* %0, i64 %1) {
%3 = lshr i64 %1, 63
%4 = trunc i64 %3 to i32
%5 = tail call i32 @assert(i32 %4)
%6 = tail call i8* @mp_store_u8(i8* %0, i32 211)
%7 = tail call i8* @mp_store_u64(i8* %6, i64 %1)
ret i8* %7
}
void gtk_widget_hide_on_delete() {}


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

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

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

LLVM IR (-O2):
define void @gtk_widget_hide_on_delete() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isprint(int);
void t_isprint_0xb8() {
  Assert_real((isprint(184) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isprint.c",
              925, ("isprint should be 0 for 0xb8"));
}


x86 assembly (clang, -O0):
<t_isprint_0xb8>:
push   %rbp
mov    %rsp,%rbp
mov    $0xb8,%edi
call   1030 <isprint@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x39d,%edx
lea    0xf5b(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isprint_0xb8>:
push   %rax
mov    $0xb8,%edi
call   1030 <isprint@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x39d,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isprint.c\00"
@.str.1 = [29 x i8] c"isprint should be 0 for 0xb8\00"
define void @t_isprint_0xb8() {
%1 = call i64 @isprint(i32 184)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 925, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isprint.c\00"
@.str.1 = [29 x i8] c"isprint should be 0 for 0xb8\00"
define void @t_isprint_0xb8() {
%1 = tail call i64 @isprint(i32 184)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 925, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void sdram(void) { printf("In the sdram\n"); }


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

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

LLVM IR (-O0):
@.str = [14 x i8] c"In the sdram\0A\00"
define void @sdram() {
%1 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [13 x i8] c"In the sdram\00"
define void @sdram() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void c_free(void *ptr) { free((char *)ptr); }


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

LLVM IR (-O0):
define void @c_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 @c_free(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
unsigned long align_512(unsigned long v) { return ((v + 511) & ~511); }


x86 assembly (clang, -O0):
<align_512>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1ff,%rax
and    $0xfffffffffffffe00,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<align_512>:
lea    0x1ff(%rdi),%rax
and    $0xfffffffffffffe00,%rax
ret

LLVM IR (-O0):
define i64 @align_512(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = add i64 %3, 511
%5 = and i64 %4, -512
ret i64 %5
}

LLVM IR (-O2):
define i64 @align_512(i64 %0) {
%2 = add i64 %0, 511
%3 = and i64 %2, -512
ret i64 %3
}
/* Type definitions */
typedef int uint8_t;
typedef int uint32_t;

/* Variables and functions */
uint32_t colorTransform24To16bpp(uint8_t red, uint8_t green, uint8_t blue) {
  red = (red >> 3) & 0x1F;
  green = (green >> 2) & 0x3F;
  blue = (blue >> 3) & 0x1F;
  return (red << 11) | (green << 5) | blue;
}


x86 assembly (clang, -O0):
<colorTransform24To16bpp>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x3,%eax
and    $0x1f,%eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
sar    $0x2,%eax
and    $0x3f,%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
sar    $0x3,%eax
and    $0x1f,%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
shl    $0xb,%eax
mov    -0x8(%rbp),%ecx
shl    $0x5,%ecx
or     %ecx,%eax
or     -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<colorTransform24To16bpp>:
shr    $0x3,%edx
and    $0x1f,%edx
shl    $0x8,%edi
and    $0xf800,%edi
and    $0xfc,%esi
lea    (%rdi,%rsi,8),%eax
or     %edx,%eax
ret

LLVM IR (-O0):
define i32 @colorTransform24To16bpp(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = ashr i32 %7, 3
%9 = and i32 %8, 31
store i32 %9, i32* %4
%10 = load i32, i32* %5
%11 = ashr i32 %10, 2
%12 = and i32 %11, 63
store i32 %12, i32* %5
%13 = load i32, i32* %6
%14 = ashr i32 %13, 3
%15 = and i32 %14, 31
store i32 %15, i32* %6
%16 = load i32, i32* %4
%17 = shl i32 %16, 11
%18 = load i32, i32* %5
%19 = shl i32 %18, 5
%20 = or i32 %17, %19
%21 = load i32, i32* %6
%22 = or i32 %20, %21
ret i32 %22
}

LLVM IR (-O2):
define i32 @colorTransform24To16bpp(i32 %0, i32 %1, i32 %2) {
%4 = lshr i32 %2, 3
%5 = and i32 %4, 31
%6 = shl i32 %0, 8
%7 = and i32 %6, 63488
%8 = shl i32 %1, 3
%9 = and i32 %8, 2016
%10 = or i32 %9, %7
%11 = or i32 %10, %5
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ snprintf(char *, int, char *, int);
char *opt2str(int opt, char *buf, int buflen) {
  snprintf(buf, buflen, "OPT:%d", opt);
  return (buf);
}


x86 assembly (clang, -O0):
<opt2str>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0x4(%rbp),%ecx
lea    0xecd(%rip),%rdx
call   1030 <snprintf@plt>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<opt2str>:
push   %rbx
mov    %rsi,%rbx
mov    %edi,%ecx
lea    0xee3(%rip),%rax
mov    %rsi,%rdi
mov    %edx,%esi
mov    %rax,%rdx
call   1030 <snprintf@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [7 x i8] c"OPT:%d\00"
define i8* @opt2str(i32 %0, i8* returned %1, i32 %2) {
%4 = tail call i32 @snprintf(i8* %1, i32 %2, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %0)
ret i8* %1
}
/* Variables and functions */
char *malloc(int);
char *allocVectorChar(int size) {
  char *vector = malloc(size * sizeof(char));
  return vector;
}


x86 assembly (clang, -O0):
<allocVectorChar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movslq -0x4(%rbp),%rax
shl    $0x0,%rax
mov    %eax,%edi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<allocVectorChar>:
jmp    1030 <malloc@plt>

LLVM IR (-O0):
define i8* @allocVectorChar(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = sext i32 %4 to i64
%6 = mul i64 %5, 1
%7 = trunc i64 %6 to i32
%8 = call i8* @malloc(i32 %7)
store i8* %8, i8** %3
%9 = load i8*, i8** %3
ret i8* %9
}

LLVM IR (-O2):
define noalias i8* @allocVectorChar(i32 %0) {
%2 = tail call i8* @malloc(i32 %0)
ret i8* %2
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ *fopen(int /*<<< orphan*/, char *);
int /*<<< orphan*/ luaL_check_lstr(int, int /*<<< orphan*/ *);
int /*<<< orphan*/ setreturn(int /*<<< orphan*/ *, char *);
void io_appendto(void) {
  FILE *current = fopen((luaL_check_lstr((2), NULL)), "a");
  setreturn(current, "_OUTPUT");
}


x86 assembly (clang, -O0):
<io_appendto>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x2,%edi
xor    %eax,%eax
mov    %eax,%esi
call   1050 <luaL_check_lstr@plt>
mov    %eax,%edi
lea    0xeb1(%rip),%rsi
call   1040 <fopen@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xe9f(%rip),%rsi
call   1030 <setreturn@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<io_appendto>:
push   %rax
mov    $0x2,%edi
xor    %esi,%esi
call   1050 <luaL_check_lstr@plt>
lea    0xebc(%rip),%rsi
mov    %eax,%edi
call   1040 <fopen@plt>
lea    0xeb0(%rip),%rsi
mov    %rax,%rdi
pop    %rax
jmp    1030 <setreturn@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"a\00"
@.str.1 = [8 x i8] c"_OUTPUT\00"
define void @io_appendto() {
%1 = alloca i32*
%2 = call i32 @luaL_check_lstr(i32 2, i32* null)
%3 = call i32* @fopen(i32 %2, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32* %3, i32** %1
%4 = load i32*, i32** %1
%5 = call i32 @setreturn(i32* %4, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c"a\00"
@.str.1 = [8 x i8] c"_OUTPUT\00"
define void @io_appendto() {
%1 = tail call i32 @luaL_check_lstr(i32 2, i32* null)
%2 = tail call i32* @fopen(i32 %1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @setreturn(i32* %2, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
struct disk_util {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ disk_util_mod(struct disk_util *, int);
void disk_util_inc(struct disk_util *du) { disk_util_mod(du, 1); }


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

x86 assembly (clang, -O2):
<disk_util_inc>:
mov    $0x1,%esi
jmp    1030 <disk_util_mod@plt>

LLVM IR (-O0):
%struct.disk_util = type { i32 }
define void @disk_util_inc(%struct.disk_util* %0) {
%2 = alloca %struct.disk_util*
store %struct.disk_util* %0, %struct.disk_util** %2
%3 = load %struct.disk_util*, %struct.disk_util** %2
%4 = call i32 @disk_util_mod(%struct.disk_util* %3, i32 1)
ret void
}

LLVM IR (-O2):
%struct.disk_util = type { i32 }
define void @disk_util_inc(%struct.disk_util* %0) {
%2 = tail call i32 @disk_util_mod(%struct.disk_util* %0, i32 1)
ret void
}
void INT_Excep_SDHI_CDETI(void) {}


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

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

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

LLVM IR (-O2):
define void @INT_Excep_SDHI_CDETI() {
ret void
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
uint8_t get_bump(uint8_t s) {
  uint8_t i = 1;
  while (s > 10) {
    ++i;
    s /= 10;
  }
  return i;
}


x86 assembly (clang, -O0):
<get_bump>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
cmpl   $0xa,-0x4(%rbp)
jle    1134 <get_bump+0x34>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
jmp    110e <get_bump+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_bump>:
mov    $0x1,%eax
cmp    $0xb,%edi
jl     1134 <get_bump+0x34>
mov    $0x1,%eax
mov    $0xcccccccd,%ecx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
add    $0x1,%eax
mov    %edi,%edx
imul   %rcx,%rdx
shr    $0x23,%rdx
cmp    $0x6d,%edi
mov    %edx,%edi
ja     1120 <get_bump+0x20>
ret

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

LLVM IR (-O2):
define i32 @get_bump(i32 %0) {
%2 = icmp sgt i32 %0, 10
br i1 %2, label %3, label %9
3: ; preds = %1, %3
%4 = phi i32 [ %6, %3 ], [ 1, %1 ]
%5 = phi i32 [ %7, %3 ], [ %0, %1 ]
%6 = add nuw nsw i32 %4, 1
%7 = udiv i32 %5, 10
%8 = icmp ugt i32 %5, 109
br i1 %8, label %3, label %9
9: ; preds = %3, %1
%10 = phi i32 [ 1, %1 ], [ %6, %3 ]
ret i32 %10
}
unsigned long asm_bsr(unsigned long x) {
  asm("bsrq %0, %0" : "=r"(x) : "0"(x));
  return x;
}


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

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

LLVM IR (-O0):
define i64 @asm_bsr(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i64 asm "bsrq $0, $0", "=r,0,~{dirflag},~{fpsr},~{flags}"(i64 %3)
store i64 %4, i64* %2
%5 = load i64, i64* %2
ret i64 %5
}

LLVM IR (-O2):
define i64 @asm_bsr(i64 %0) {
%2 = tail call i64 asm "bsrq $0, $0", "=r,0,~{dirflag},~{fpsr},~{flags}"(i64 %0)
ret i64 %2
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
char *strchr(const char *src, int character) {
  const uint8_t *src_bytes = ((const uint8_t *)src);
  for (;; src_bytes++) {
    if (*src_bytes == character)
      return ((char *)src_bytes);
    if (!*src_bytes)
      return NULL;
  }
}


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
mov    (%rax),%eax
cmp    -0x14(%rbp),%eax
jne    112f <strchr+0x2f>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    115f <strchr+0x5f>
mov    -0x20(%rbp),%rax
cmpl   $0x0,(%rax)
jne    1149 <strchr+0x49>
movq   $0x0,-0x8(%rbp)
jmp    115f <strchr+0x5f>
jmp    114e <strchr+0x4e>
mov    -0x20(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x20(%rbp)
jmp    1113 <strchr+0x13>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strchr>:
mov    %rdi,%rax
mov    (%rdi),%ecx
cmp    %esi,%ecx
je     111f <strchr+0x1f>
nopl   0x0(%rax)
test   %ecx,%ecx
je     1120 <strchr+0x20>
mov    0x4(%rax),%ecx
add    $0x4,%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 i32*
store i8* %0, i8** %4
store i32 %1, i32* %5
%7 = load i8*, i8** %4
%8 = bitcast i8* %7 to i32*
store i32* %8, i32** %6
br label %9
9: ; preds = %23, %2
%10 = load i32*, i32** %6
%11 = load i32, i32* %10
%12 = load i32, i32* %5
%13 = icmp eq i32 %11, %12
br i1 %13, label %14, label %17
14: ; preds = %9
%15 = load i32*, i32** %6
%16 = bitcast i32* %15 to i8*
store i8* %16, i8** %3
br label %26
17: ; preds = %9
%18 = load i32*, i32** %6
%19 = load i32, i32* %18
%20 = icmp ne i32 %19, 0
br i1 %20, label %22, label %21
21: ; preds = %17
store i8* null, i8** %3
br label %26
22: ; preds = %17
br label %23
23: ; preds = %22
%24 = load i32*, i32** %6
%25 = getelementptr inbounds i32, i32* %24, i32 1
store i32* %25, i32** %6
br label %9
26: ; preds = %21, %14
%27 = load i8*, i8** %3
ret i8* %27
}

LLVM IR (-O2):
define i8* @strchr(i8* %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = icmp eq i32 %4, %1
br i1 %5, label %6, label %9
6: ; preds = %13, %2
%7 = phi i32* [ %3, %2 ], [ %14, %13 ]
%8 = bitcast i32* %7 to i8*
br label %17
9: ; preds = %2, %13
%10 = phi i32 [ %15, %13 ], [ %4, %2 ]
%11 = phi i32* [ %14, %13 ], [ %3, %2 ]
%12 = icmp eq i32 %10, 0
br i1 %12, label %17, label %13
13: ; preds = %9
%14 = getelementptr inbounds i32, i32* %11, i64 1
%15 = load i32, i32* %14
%16 = icmp eq i32 %15, %1
br i1 %16, label %6, label %9
17: ; preds = %9, %6
%18 = phi i8* [ %8, %6 ], [ null, %9 ]
ret i8* %18
}
/* Variables and functions */
int EINVAL;
int __reterr(void) { return -EINVAL; }


x86 assembly (clang, -O0):
<__reterr>:
push   %rbp
mov    %rsp,%rbp
xor    %eax,%eax
mov    0x2ed3(%rip),%rcx
sub    (%rcx),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@EINVAL = global i32 0
define i32 @__reterr() {
%1 = load i32, i32* @EINVAL
%2 = sub nsw i32 0, %1
ret i32 %2
}

LLVM IR (-O2):
@EINVAL = global i32 0
define i32 @__reterr() {
%1 = load i32, i32* @EINVAL
%2 = sub nsw i32 0, %1
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ atoi(char *);
int /*<<< orphan*/ errAbort(char *, char *);
int /*<<< orphan*/ isdigit(char);
int netMustConnect(char *, int /*<<< orphan*/);
int netMustConnectTo(char *hostName, char *portName) {
  if (!isdigit(portName[0]))
    errAbort("netConnectTo: ports must be numerical, not %s", portName);
  return netMustConnect(hostName, atoi(portName));
}


x86 assembly (clang, -O0):
<netMustConnectTo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%edi
call   1030 <isdigit@plt>
cmp    $0x0,%eax
jne    1175 <netMustConnectTo+0x35>
mov    -0x10(%rbp),%rsi
lea    0xe90(%rip),%rdi
call   1040 <errAbort@plt>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1060 <atoi@plt>
mov    -0x18(%rbp),%rdi
mov    %eax,%esi
call   1050 <netMustConnect@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<netMustConnectTo>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
movsbl (%rsi),%edi
call   1030 <isdigit@plt>
test   %eax,%eax
jne    1165 <netMustConnectTo+0x25>
lea    0xea3(%rip),%rdi
mov    %rbx,%rsi
call   1040 <errAbort@plt>
mov    %rbx,%rdi
call   1060 <atoi@plt>
mov    %r14,%rdi
mov    %eax,%esi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1050 <netMustConnect@plt>

LLVM IR (-O0):
@.str = [46 x i8] c"netConnectTo: ports must be numerical, not %s\00"
define i32 @netMustConnectTo(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = getelementptr inbounds i8, i8* %5, i64 0
%7 = load i8, i8* %6
%8 = call i32 @isdigit(i8 signext %7)
%9 = icmp ne i32 %8, 0
br i1 %9, label %13, label %10
10: ; preds = %2
%11 = load i8*, i8** %4
%12 = call i32 @errAbort(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0), i8* %11)
br label %13
13: ; preds = %10, %2
%14 = load i8*, i8** %3
%15 = load i8*, i8** %4
%16 = call i32 @atoi(i8* %15)
%17 = call i32 @netMustConnect(i8* %14, i32 %16)
ret i32 %17
}

LLVM IR (-O2):
@.str = [46 x i8] c"netConnectTo: ports must be numerical, not %s\00"
define i32 @netMustConnectTo(i8* %0, i8* %1) {
%3 = load i8, i8* %1
%4 = tail call i32 @isdigit(i8 signext %3)
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %2
%7 = tail call i32 @errAbort(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0), i8* %1)
br label %8
8: ; preds = %6, %2
%9 = tail call i32 @atoi(i8* %1)
%10 = tail call i32 @netMustConnect(i8* %0, i32 %9)
ret i32 %10
}
int fun1384() { return 1384; }


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

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

LLVM IR (-O0):
define i32 @fun1384() {
ret i32 1384
}

LLVM IR (-O2):
define i32 @fun1384() {
ret i32 1384
}
/* Type definitions */
struct Cyc_Absyn_Exp {
  int dummy;
};

/* Variables and functions */
struct Cyc_Absyn_Exp *Cyc_Tcutil_deep_copy_exp(int, struct Cyc_Absyn_Exp *);
struct Cyc_Absyn_Exp *Cyc_Lower_deep_copy(struct Cyc_Absyn_Exp *e) {
  struct Cyc_Absyn_Exp *_T0;
  _T0 = Cyc_Tcutil_deep_copy_exp(1, e);
  return _T0;
}


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

x86 assembly (clang, -O2):
<Cyc_Lower_deep_copy>:
mov    %rdi,%rsi
mov    $0x1,%edi
jmp    1030 <Cyc_Tcutil_deep_copy_exp@plt>

LLVM IR (-O0):
%struct.Cyc_Absyn_Exp = type { i32 }
define %struct.Cyc_Absyn_Exp* @Cyc_Lower_deep_copy(%struct.Cyc_Absyn_Exp* %0) {
%2 = alloca %struct.Cyc_Absyn_Exp*
%3 = alloca %struct.Cyc_Absyn_Exp*
store %struct.Cyc_Absyn_Exp* %0, %struct.Cyc_Absyn_Exp** %2
%4 = load %struct.Cyc_Absyn_Exp*, %struct.Cyc_Absyn_Exp** %2
%5 = call %struct.Cyc_Absyn_Exp* @Cyc_Tcutil_deep_copy_exp(i32 1, %struct.Cyc_Absyn_Exp* %4)
store %struct.Cyc_Absyn_Exp* %5, %struct.Cyc_Absyn_Exp** %3
%6 = load %struct.Cyc_Absyn_Exp*, %struct.Cyc_Absyn_Exp** %3
ret %struct.Cyc_Absyn_Exp* %6
}

LLVM IR (-O2):
%struct.Cyc_Absyn_Exp = type { i32 }
define %struct.Cyc_Absyn_Exp* @Cyc_Lower_deep_copy(%struct.Cyc_Absyn_Exp* %0) {
%2 = tail call %struct.Cyc_Absyn_Exp* @Cyc_Tcutil_deep_copy_exp(i32 1, %struct.Cyc_Absyn_Exp* %0)
ret %struct.Cyc_Absyn_Exp* %2
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char const *);
void usage(const char *progname) {
  printf("%s filename\n", progname);
  exit(EXIT_FAILURE);
}


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

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

LLVM IR (-O0):
@.str = [13 x i8] c"%s filename\0A\00"
@EXIT_FAILURE = global i32 0
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = load i32, i32* @EXIT_FAILURE
%6 = call i32 @exit(i32 %5)
unreachable
}

LLVM IR (-O2):
@.str = [13 x i8] c"%s filename\0A\00"
@EXIT_FAILURE = global i32 0
define void @usage(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = load i32, i32* @EXIT_FAILURE
%4 = tail call i32 @exit(i32 %3)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("Hello World!\n");
  printf("My name is Cat.\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>
lea    0xedc(%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>
lea    0xee9(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"Hello World!\0A\00"
@.str.1 = [17 x i8] c"My name is Cat.\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [13 x i8] c"Hello World!\00"
@str.2 = [16 x i8] c"My name is Cat.\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str.2, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int isxdigit(int);
char hextoc(int i) {
  assert(i >= 0);
  assert(i < 16);
  i += '0';
  if (i > '9')
    i += 7;
  assert(isxdigit(i));
  return i;
}


x86 assembly (clang, -O0):
<hextoc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
setge  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
cmpl   $0x10,-0x4(%rbp)
setl   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x4(%rbp),%eax
add    $0x30,%eax
mov    %eax,-0x4(%rbp)
cmpl   $0x39,-0x4(%rbp)
jle    1169 <hextoc+0x49>
mov    -0x4(%rbp),%eax
add    $0x7,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <isxdigit@plt>
mov    %eax,%edi
call   1030 <assert@plt>
mov    -0x4(%rbp),%eax
movsbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hextoc>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
not    %edi
shr    $0x1f,%edi
call   1030 <assert@plt>
xor    %edi,%edi
cmp    $0x10,%ebx
setl   %dil
call   1030 <assert@plt>
lea    0x30(%rbx),%eax
lea    0x37(%rbx),%ebp
cmp    $0xa,%ebx
cmovl  %eax,%ebp
mov    %ebp,%edi
call   1040 <isxdigit@plt>
mov    %eax,%edi
call   1030 <assert@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define signext i8 @hextoc(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 0
%5 = zext i1 %4 to i32
%6 = call i32 @assert(i32 %5)
%7 = load i32, i32* %2
%8 = icmp slt i32 %7, 16
%9 = zext i1 %8 to i32
%10 = call i32 @assert(i32 %9)
%11 = load i32, i32* %2
%12 = add nsw i32 %11, 48
store i32 %12, i32* %2
%13 = load i32, i32* %2
%14 = icmp sgt i32 %13, 57
br i1 %14, label %15, label %18
15: ; preds = %1
%16 = load i32, i32* %2
%17 = add nsw i32 %16, 7
store i32 %17, i32* %2
br label %18
18: ; preds = %15, %1
%19 = load i32, i32* %2
%20 = call i32 @isxdigit(i32 %19)
%21 = call i32 @assert(i32 %20)
%22 = load i32, i32* %2
%23 = trunc i32 %22 to i8
ret i8 %23
}

LLVM IR (-O2):
define signext i8 @hextoc(i32 %0) {
%2 = xor i32 %0, -1
%3 = lshr i32 %2, 31
%4 = tail call i32 @assert(i32 %3)
%5 = icmp slt i32 %0, 16
%6 = zext i1 %5 to i32
%7 = tail call i32 @assert(i32 %6)
%8 = icmp sgt i32 %0, 9
%9 = select i1 %8, i32 55, i32 48
%10 = add nsw i32 %9, %0
%11 = tail call i32 @isxdigit(i32 %10)
%12 = tail call i32 @assert(i32 %11)
%13 = trunc i32 %10 to i8
ret i8 %13
}
int isspace(int ch) { return ch == 0x20 || (ch >= 0x09 && ch <= 0x0D); }


x86 assembly (clang, -O0):
<isspace>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0x1,%al
cmpl   $0x20,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     1135 <isspace+0x35>
xor    %eax,%eax
cmpl   $0x9,-0x4(%rbp)
mov    %al,-0x6(%rbp)
jl     112f <isspace+0x2f>
cmpl   $0xd,-0x4(%rbp)
setle  %al
mov    %al,-0x6(%rbp)
mov    -0x6(%rbp),%al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isspace>:
cmp    $0x20,%edi
sete   %al
add    $0xfffffff7,%edi
cmp    $0x5,%edi
setb   %cl
or     %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @isspace(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 32
br i1 %4, label %13, label %5
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sge i32 %6, 9
br i1 %7, label %8, label %11
8: ; preds = %5
%9 = load i32, i32* %2
%10 = icmp sle i32 %9, 13
br label %11
11: ; preds = %8, %5
%12 = phi i1 [ false, %5 ], [ %10, %8 ]
br label %13
13: ; preds = %11, %1
%14 = phi i1 [ true, %1 ], [ %12, %11 ]
%15 = zext i1 %14 to i32
ret i32 %15
}

LLVM IR (-O2):
define i32 @isspace(i32 %0) {
%2 = icmp eq i32 %0, 32
%3 = add i32 %0, -9
%4 = icmp ult i32 %3, 5
%5 = or i1 %2, %4
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ gen_call(char *);
void gen_twos_complement(void) { gen_call("ccneg"); }


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

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

LLVM IR (-O0):
@.str = [6 x i8] c"ccneg\00"
define void @gen_twos_complement() {
%1 = call i32 @gen_call(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"ccneg\00"
define void @gen_twos_complement() {
%1 = tail call i32 @gen_call(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isxdigit(int);
void t_isxdigit_0x75() {
  Assert_real((isxdigit(117) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isxdigit.c",
              590, ("isxdigit should be 0 for u"));
}


x86 assembly (clang, -O0):
<t_isxdigit_0x75>:
push   %rbp
mov    %rsp,%rbp
mov    $0x75,%edi
call   1030 <isxdigit@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x24e,%edx
lea    0xf5c(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isxdigit_0x75>:
push   %rax
mov    $0x75,%edi
call   1030 <isxdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf67(%rip),%rcx
mov    $0x24e,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isxdigit.c\00"
@.str.1 = [27 x i8] c"isxdigit should be 0 for u\00"
define void @t_isxdigit_0x75() {
%1 = call i64 @isxdigit(i32 117)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 590, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isxdigit.c\00"
@.str.1 = [27 x i8] c"isxdigit should be 0 for u\00"
define void @t_isxdigit_0x75() {
%1 = tail call i64 @isxdigit(i32 117)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 590, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EVP_sha512();
unsigned char *HMAC(int /*<<< orphan*/, char const *, int /*<<< orphan*/,
                    unsigned char *, int /*<<< orphan*/, int /*<<< orphan*/ *,
                    int /*<<< orphan*/ *);
int /*<<< orphan*/ strlen(char const *);
unsigned char *generatekey(const char *key, const char *data) {
  return HMAC(EVP_sha512(), key, strlen(key), (unsigned char *)data,
              strlen(data), NULL, NULL);
}


x86 assembly (clang, -O0):
<generatekey>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <EVP_sha512@plt>
mov    %eax,-0x2c(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x2c(%rbp),%edi
mov    -0x28(%rbp),%rsi
mov    -0x1c(%rbp),%edx
mov    -0x18(%rbp),%rcx
mov    %eax,%r8d
xor    %eax,%eax
mov    %eax,%r9d
movq   $0x0,(%rsp)
call   1050 <HMAC@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<generatekey>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <EVP_sha512@plt>
mov    %eax,%r15d
mov    %rbx,%rdi
call   1040 <strlen@plt>
mov    %eax,%ebp
mov    %r14,%rdi
call   1040 <strlen@plt>
movq   $0x0,(%rsp)
mov    %r15d,%edi
mov    %rbx,%rsi
mov    %ebp,%edx
mov    %r14,%rcx
mov    %eax,%r8d
xor    %r9d,%r9d
call   1050 <HMAC@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i8* @generatekey(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = call i32 (...) @EVP_sha512()
%6 = load i8*, i8** %3
%7 = load i8*, i8** %3
%8 = call i32 @strlen(i8* %7)
%9 = load i8*, i8** %4
%10 = load i8*, i8** %4
%11 = call i32 @strlen(i8* %10)
%12 = call i8* @HMAC(i32 %5, i8* %6, i32 %8, i8* %9, i32 %11, i32* null, i32* null)
ret i8* %12
}

LLVM IR (-O2):
define i8* @generatekey(i8* %0, i8* %1) {
%3 = tail call i32 (...) @EVP_sha512()
%4 = tail call i32 @strlen(i8* %0)
%5 = tail call i32 @strlen(i8* %1)
%6 = tail call i8* @HMAC(i32 %3, i8* %0, i32 %4, i8* %1, i32 %5, i32* null, i32* null)
ret i8* %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char);
void printf_underscored(const char *string) {
  char c;
  while ((c = *string++) != '\0') {
    printf("%c", (c == ' ' ? '_' : c));
  }
}


x86 assembly (clang, -O0):
<printf_underscored>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
mov    (%rax),%al
mov    %al,-0x9(%rbp)
movsbl %al,%eax
cmp    $0x0,%eax
je     1174 <printf_underscored+0x64>
movsbl -0x9(%rbp),%eax
cmp    $0x20,%eax
jne    1156 <printf_underscored+0x46>
mov    $0x5f,%eax
mov    %eax,-0x10(%rbp)
jmp    115d <printf_underscored+0x4d>
movsbl -0x9(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
lea    0xe99(%rip),%rdi
movsbl %al,%esi
call   1030 <printf@plt>
jmp    111c <printf_underscored+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printf_underscored>:
push   %rbp
push   %r14
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     114e <printf_underscored+0x3e>
mov    %rdi,%rbx
add    $0x1,%rbx
mov    $0x5f,%ebp
lea    0xed3(%rip),%r14
nopl   (%rax)
cmp    $0x20,%al
movzbl %al,%eax
cmove  %ebp,%eax
movsbl %al,%esi
mov    %r14,%rdi
call   1030 <printf@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1130 <printf_underscored+0x20>
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%c\00"
define void @printf_underscored(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %13, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %11, %4 ], [ %2, %1 ]
%6 = phi i8* [ %7, %4 ], [ %0, %1 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = icmp eq i8 %5, 32
%9 = select i1 %8, i8 95, i8 %5
%10 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext %9)
%11 = load i8, i8* %7
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %4
13: ; preds = %4, %1
ret void
}