xunge/DecIR huggingface dataset:
char *get_build_date() { return "Mar 18 2022"; }


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

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

LLVM IR (-O0):
@.str = [12 x i8] c"Mar 18 2022\00"
define i8* @get_build_date() {
ret i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [12 x i8] c"Mar 18 2022\00"
define i8* @get_build_date() {
ret i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0)
}
int main(void) {
  int a = 15;
  int z = 20;
  int *b = &a;
  int *q = &z;
  int **c;
  c = &b;
  **c = 77;
  printf("b = %d\n", b);
  printf("c = %d\n", *c);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xf,-0x8(%rbp)
movl   $0x14,-0xc(%rbp)
lea    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
lea    -0xc(%rbp),%rax
mov    %rax,-0x20(%rbp)
lea    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
mov    (%rax),%rax
movl   $0x4d,(%rax)
mov    -0x18(%rbp),%rsi
lea    0xea3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x28(%rbp),%rax
mov    (%rax),%rsi
lea    0xe96(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
movl   $0x4d,0xc(%rsp)
lea    0xedc(%rip),%rdi
lea    0xc(%rsp),%rbx
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xece(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [8 x i8] c"b = %d\0A\00"
@.str.1 = [8 x i8] c"c = %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 77, i32* %1
%3 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i32* %1)
ret i32 0
}
int test_imm_6Duint64_highword_mem(unsigned long long *val) {
  return ((*val >> 32) & (0x6D << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_6Duint64_highword_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, 32
%6 = and i64 %5, 109
%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_6Duint64_highword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 468151435264
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
char *malloc(int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ rev(char *);
int /*<<< orphan*/ scanf(char *, char *);
int main() {
  char *str = malloc(255);
  scanf("%s", str);
  rev(str);
  printf("\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0xff,%edi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
lea    0xe98(%rip),%rdi
call   1060 <scanf@plt>
mov    -0x10(%rbp),%rdi
call   1030 <rev@plt>
lea    0xe86(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0xff,%edi
call   1050 <malloc@plt>
mov    %rax,%rbx
lea    0xeab(%rip),%rdi
mov    %rax,%rsi
call   1060 <scanf@plt>
mov    %rbx,%rdi
call   1040 <rev@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define i32 @main() {
%1 = tail call dereferenceable_or_null(255) i8* @malloc(i32 255)
%2 = tail call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %1)
%3 = tail call i32 @rev(i8* %1)
%4 = tail call i32 @putchar(i32 10)
ret i32 0
}
int sub4(int i) { return i + (5 - i); }


x86 assembly (clang, -O0):
<sub4>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x5,%ecx
sub    -0x4(%rbp),%ecx
add    %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @sub4(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* %2
%5 = sub nsw i32 5, %4
%6 = add nsw i32 %3, %5
ret i32 %6
}

LLVM IR (-O2):
define i32 @sub4(i32 %0) {
ret i32 5
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isupper(int);
void t_isupper_0xd8() {
  Assert_real((isupper(216) == 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_isupper.c",
              1085, ("isupper should be 0 for 0xd8"));
}


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

x86 assembly (clang, -O2):
<t_isupper_0xd8>:
push   %rax
mov    $0xd8,%edi
call   1030 <isupper@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x43d,%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_isupper.c\00"
@.str.1 = [29 x i8] c"isupper should be 0 for 0xd8\00"
define void @t_isupper_0xd8() {
%1 = call i64 @isupper(i32 216)
%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 1085, 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_isupper.c\00"
@.str.1 = [29 x i8] c"isupper should be 0 for 0xd8\00"
define void @t_isupper_0xd8() {
%1 = tail call i64 @isupper(i32 216)
%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 1085, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int squareVisited(int (*visited)[25 / 2], int row, int col) {
  return visited[row][col];
}


x86 assembly (clang, -O0):
<squareVisited>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
imul   $0x30,%rcx,%rcx
add    %rcx,%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<squareVisited>:
movslq %esi,%rax
movslq %edx,%rcx
lea    (%rax,%rax,2),%rax
shl    $0x4,%rax
add    %rdi,%rax
mov    (%rax,%rcx,4),%eax
ret

LLVM IR (-O0):
define i32 @squareVisited([12 x i32]* %0, i32 %1, i32 %2) {
%4 = alloca [12 x i32]*
%5 = alloca i32
%6 = alloca i32
store [12 x i32]* %0, [12 x i32]** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load [12 x i32]*, [12 x i32]** %4
%8 = load i32, i32* %5
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds [12 x i32], [12 x i32]* %7, i64 %9
%11 = load i32, i32* %6
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds [12 x i32], [12 x i32]* %10, i64 0, i64 %12
%14 = load i32, i32* %13
ret i32 %14
}

LLVM IR (-O2):
define i32 @squareVisited([12 x i32]* nocapture %0, i32 %1, i32 %2) {
%4 = sext i32 %1 to i64
%5 = sext i32 %2 to i64
%6 = getelementptr inbounds [12 x i32], [12 x i32]* %0, i64 %4, i64 %5
%7 = load i32, i32* %6
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void foo() { printf("TEST1\n"); }


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

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

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

LLVM IR (-O2):
@str = [6 x i8] c"TEST1\00"
define void @foo() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0))
ret void
}
void mpgdecoder_init(void *ctx) {}


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

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

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

LLVM IR (-O2):
define void @mpgdecoder_init(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort_crypto_lib(char *);
void check_valid_asymmetric_key_item_size(int size) {
  if (size != 1 + 2048)
    abort_crypto_lib("Illegal size for asymmetric key item");
}


x86 assembly (clang, -O0):
<check_valid_asymmetric_key_item_size>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x801,-0x4(%rbp)
je     1134 <check_valid_asymmetric_key_item_size+0x24>
lea    0xed1(%rip),%rdi
call   1030 <abort_crypto_lib@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_valid_asymmetric_key_item_size>:
cmp    $0x801,%edi
jne    1119 <check_valid_asymmetric_key_item_size+0x9>
ret
lea    0xee0(%rip),%rdi
jmp    1030 <abort_crypto_lib@plt>

LLVM IR (-O0):
@.str = [37 x i8] c"Illegal size for asymmetric key item\00"
define void @check_valid_asymmetric_key_item_size(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ne i32 %3, 2049
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = call i32 @abort_crypto_lib(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
@.str = [37 x i8] c"Illegal size for asymmetric key item\00"
define void @check_valid_asymmetric_key_item_size(i32 %0) {
%2 = icmp eq i32 %0, 2049
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @abort_crypto_lib(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
br label %5
5: ; preds = %3, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ RemoveFile(char *);
void command_rm(char *file_name) { RemoveFile(file_name); }


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

x86 assembly (clang, -O2):
<command_rm>:
jmp    1030 <RemoveFile@plt>

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

LLVM IR (-O2):
define void @command_rm(i8* %0) {
%2 = tail call i32 @RemoveFile(i8* %0)
ret void
}
unsigned b64_enc_len(unsigned len) { return ((len + 2) / 3 * 4); }


x86 assembly (clang, -O0):
<b64_enc_len>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x2,%eax
mov    $0x3,%ecx
xor    %edx,%edx
div    %ecx
shl    $0x2,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<b64_enc_len>:
lea    0x2(%rdi),%ecx
mov    $0xaaaaaaab,%eax
imul   %rcx,%rax
shr    $0x20,%rax
add    %eax,%eax
and    $0xfffffffc,%eax
ret

LLVM IR (-O0):
define i32 @b64_enc_len(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add i32 %3, 2
%5 = udiv i32 %4, 3
%6 = mul i32 %5, 4
ret i32 %6
}

LLVM IR (-O2):
define i32 @b64_enc_len(i32 %0) {
%2 = add i32 %0, 2
%3 = udiv i32 %2, 3
%4 = shl i32 %3, 2
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ const wchar_t;

/* Variables and functions */
int /*<<< orphan*/ wcscat(int /*<<< orphan*/ const *,
                          int /*<<< orphan*/ const *const);
void uninitvar_wcscat(wchar_t *dest, const wchar_t *const source) {
  wchar_t *deststr_1, *deststr_2;
  wchar_t *srcstr_1, *srcstr_2;
  (void)wcscat(deststr_1, srcstr_1);
  (void)wcscat(dest, srcstr_2);
  (void)wcscat(deststr_2, source);
  (void)wcscat(dest, source);
}


x86 assembly (clang, -O0):
<uninitvar_wcscat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x28(%rbp),%rsi
call   1030 <wcscat@plt>
mov    -0x8(%rbp),%rdi
mov    -0x30(%rbp),%rsi
call   1030 <wcscat@plt>
mov    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <wcscat@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <wcscat@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uninitvar_wcscat>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <wcscat@plt>
mov    %rbx,%rdi
call   1030 <wcscat@plt>
mov    %r14,%rsi
call   1030 <wcscat@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <wcscat@plt>

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

LLVM IR (-O2):
define void @uninitvar_wcscat(i32* %0, i32* %1) {
%3 = tail call i32 @wcscat(i32* undef, i32* undef)
%4 = tail call i32 @wcscat(i32* %0, i32* undef)
%5 = tail call i32 @wcscat(i32* undef, i32* %1)
%6 = tail call i32 @wcscat(i32* %0, i32* %1)
ret void
}
/* Variables and functions */
double exp(double);
int snprintf(char *, int, char *, double);
int senFunc4(char *s, int n, int a) {
  return snprintf(s, n, "Force: %lf grams",
                  9.29319 * exp(0.6222 * a * 0.00488));
}


x86 assembly (clang, -O0):
<senFunc4>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
cvtsi2sdl -0x10(%rbp),%xmm1
movsd  0xec3(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  0xeaf(%rip),%xmm1
mulsd  %xmm1,%xmm0
call   1040 <exp@plt>
mov    -0x20(%rbp),%rdi
mov    -0x14(%rbp),%esi
movaps %xmm0,%xmm1
movsd  0xe8c(%rip),%xmm0
mulsd  %xmm1,%xmm0
lea    0xe99(%rip),%rdx
call   1030 <snprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<senFunc4>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
cvtsi2sd %edx,%xmm0
mulsd  0xecc(%rip),%xmm0
mulsd  0xecc(%rip),%xmm0
call   1040 <exp@plt>
mulsd  0xec7(%rip),%xmm0
lea    0xec8(%rip),%rdx
mov    %rbx,%rdi
mov    %ebp,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <snprintf@plt>

LLVM IR (-O0):
@.str = [17 x i8] c"Force: %lf grams\00"
define i32 @senFunc4(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i8*, i8** %4
%8 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = sitofp i32 %9 to double
%11 = fmul double 6.222000e-01, %10
%12 = fmul double %11, 4.880000e-03
%13 = call double @exp(double %12)
%14 = fmul double 0x4022961CFFEB074A, %13
%15 = call i32 @snprintf(i8* %7, i32 %8, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), double %14)
ret i32 %15
}

LLVM IR (-O2):
@.str = [17 x i8] c"Force: %lf grams\00"
define i32 @senFunc4(i8* %0, i32 %1, i32 %2) {
%4 = sitofp i32 %2 to double
%5 = fmul double %4, 6.222000e-01
%6 = fmul double %5, 4.880000e-03
%7 = tail call double @exp(double %6)
%8 = fmul double %7, 0x4022961CFFEB074A
%9 = tail call i32 @snprintf(i8* %0, i32 %1, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), double %8)
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void menu_print_main(void) {
  printf("\n"
         "ABC Inventory menu\n"
         "-----------------------------\n"
         "1. New Item\n"
         "2. Edit Existing item\n"
         "3. View Existing item\n"
         "4. Delete Existing item\n"
         "5. List all items in inventory\n"
         "Q. Quit Program\n");
}


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

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

LLVM IR (-O0):
@.str = [178 x i8] c"\0AABC Inventory menu\0A-----------------------------\0A1. New Item\0A2. Edit Existing item\0A3. View Existing item\0A4. Delete Existing item\0A5. List all items in inventory\0AQ. Quit Program\0A\00"
define void @menu_print_main() {
%1 = call i32 @printf(i8* getelementptr inbounds ([178 x i8], [178 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [177 x i8] c"\0AABC Inventory menu\0A-----------------------------\0A1. New Item\0A2. Edit Existing item\0A3. View Existing item\0A4. Delete Existing item\0A5. List all items in inventory\0AQ. Quit Program\00"
define void @menu_print_main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([177 x i8], [177 x i8]* @str, i64 0, i64 0))
ret void
}
int todigit(char c) {
  if (c <= 9)
    return (c + '0');
  return (c + 'a' - 10);
}


x86 assembly (clang, -O0):
<todigit>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x9,%eax
jg     1126 <todigit+0x26>
movsbl -0x5(%rbp),%eax
add    $0x30,%eax
mov    %eax,-0x4(%rbp)
jmp    1133 <todigit+0x33>
movsbl -0x5(%rbp),%eax
add    $0x61,%eax
sub    $0xa,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<todigit>:
lea    0x57(%rdi),%ecx
lea    0x30(%rdi),%eax
cmp    $0xa,%dil
cmovge %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @todigit(i8 signext %0) {
%2 = sext i8 %0 to i32
%3 = icmp slt i8 %0, 10
%4 = select i1 %3, i32 48, i32 87
%5 = add nsw i32 %4, %2
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void ap() { printf("%s\n", "b.c"); }


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [4 x i8] c"b.c\00"
define void @ap() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int cycle_is_refresh(unsigned int flags) {
  return (flags & 0x00000e00) == 0x00000200;
}


x86 assembly (clang, -O0):
<cycle_is_refresh>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xe00,%eax
cmp    $0x200,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cycle_is_refresh>:
and    $0xe00,%edi
xor    %eax,%eax
cmp    $0x200,%edi
sete   %al
ret

LLVM IR (-O0):
define i32 @cycle_is_refresh(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 3584
%5 = icmp eq i32 %4, 512
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @cycle_is_refresh(i32 %0) {
%2 = and i32 %0, 3584
%3 = icmp eq i32 %2, 512
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, char *);
int system(char *);
int open_uri(char *uri) {
  if (system("xset -q > /dev/null 2>&1"))
    return 1;
  char command[256];
  sprintf(command, "xdg-open %s > /dev/null 2>&1", uri);
  return system(command);
}


x86 assembly (clang, -O0):
<open_uri>:
push   %rbp
mov    %rsp,%rbp
sub    $0x110,%rsp
mov    %rdi,-0x10(%rbp)
lea    0xeca(%rip),%rdi
call   1030 <system@plt>
cmp    $0x0,%eax
je     1150 <open_uri+0x30>
movl   $0x1,-0x4(%rbp)
jmp    1176 <open_uri+0x56>
lea    -0x110(%rbp),%rdi
mov    -0x10(%rbp),%rdx
lea    0xeb7(%rip),%rsi
call   1040 <sprintf@plt>
lea    -0x110(%rbp),%rdi
call   1030 <system@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x110,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<open_uri>:
push   %r14
push   %rbx
sub    $0x108,%rsp
mov    %rdi,%rbx
lea    0xecc(%rip),%rdi
call   1030 <system@plt>
mov    %eax,%ecx
mov    $0x1,%eax
test   %ecx,%ecx
jne    1161 <open_uri+0x41>
lea    0xece(%rip),%rsi
mov    %rsp,%r14
mov    %r14,%rdi
mov    %rbx,%rdx
call   1040 <sprintf@plt>
mov    %r14,%rdi
call   1030 <system@plt>
add    $0x108,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [25 x i8] c"xset -q > /dev/null 2>&1\00"
@.str.1 = [29 x i8] c"xdg-open %s > /dev/null 2>&1\00"
define i32 @open_uri(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca [256 x i8]
store i8* %0, i8** %3
%5 = call i32 @system(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 1, i32* %2
br label %14
8: ; preds = %1
%9 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 0
%10 = load i8*, i8** %3
%11 = call i32 @sprintf(i8* %9, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0), i8* %10)
%12 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 0
%13 = call i32 @system(i8* %12)
store i32 %13, i32* %2
br label %14
14: ; preds = %8, %7
%15 = load i32, i32* %2
ret i32 %15
}

LLVM IR (-O2):
@.str = [25 x i8] c"xset -q > /dev/null 2>&1\00"
@.str.1 = [29 x i8] c"xdg-open %s > /dev/null 2>&1\00"
define i32 @open_uri(i8* %0) {
%2 = alloca [256 x i8]
%3 = tail call i32 @system(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %9
5: ; preds = %1
%6 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 0
%7 = call i32 @sprintf(i8* %6, i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0), i8* %0)
%8 = call i32 @system(i8* %6)
br label %9
9: ; preds = %1, %5
%10 = phi i32 [ %8, %5 ], [ 1, %1 ]
ret i32 %10
}
/* Type definitions */
struct timeval {
  int tv_sec;
  int tv_usec;
};

/* Variables and functions */
int /*<<< orphan*/ select(int /*<<< orphan*/, int /*<<< orphan*/,
                          int /*<<< orphan*/, int /*<<< orphan*/,
                          struct timeval *);
void fb_Delay(int msecs) {
  struct timeval tv;
  tv.tv_sec = msecs / 1000;
  tv.tv_usec = (msecs % 1000) * 1000;
  select(0, 0, 0, 0, &tv);
}


x86 assembly (clang, -O0):
<fb_Delay>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x3e8,%ecx
cltd
idiv   %ecx
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x3e8,%ecx
cltd
idiv   %ecx
imul   $0x3e8,%edx,%eax
mov    %eax,-0xc(%rbp)
xor    %ecx,%ecx
lea    -0x10(%rbp),%r8
mov    %ecx,%edi
mov    %ecx,%esi
mov    %ecx,%edx
call   1030 <select@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fb_Delay>:
push   %rax
movslq %edi,%rax
imul   $0x10624dd3,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x26,%rcx
add    %edx,%ecx
mov    %ecx,(%rsp)
imul   $0x3e8,%ecx,%ecx
sub    %ecx,%eax
imul   $0x3e8,%eax,%eax
mov    %eax,0x4(%rsp)
mov    %rsp,%r8
xor    %edi,%edi
xor    %esi,%esi
xor    %edx,%edx
xor    %ecx,%ecx
call   1030 <select@plt>
pop    %rax
ret

LLVM IR (-O0):
%struct.timeval = type { i32, i32 }
define void @fb_Delay(i32 %0) {
%2 = alloca i32
%3 = alloca %struct.timeval
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = sdiv i32 %4, 1000
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %3, i32 0, i32 0
store i32 %5, i32* %6
%7 = load i32, i32* %2
%8 = srem i32 %7, 1000
%9 = mul nsw i32 %8, 1000
%10 = getelementptr inbounds %struct.timeval, %struct.timeval* %3, i32 0, i32 1
store i32 %9, i32* %10
%11 = call i32 @select(i32 0, i32 0, i32 0, i32 0, %struct.timeval* %3)
ret void
}

LLVM IR (-O2):
%struct.timeval = type { i32, i32 }
define void @fb_Delay(i32 %0) {
%2 = alloca %struct.timeval
%3 = bitcast %struct.timeval* %2 to i8*
%4 = sdiv i32 %0, 1000
%5 = getelementptr inbounds %struct.timeval, %struct.timeval* %2, i64 0, i32 0
store i32 %4, i32* %5
%6 = srem i32 %0, 1000
%7 = mul nsw i32 %6, 1000
%8 = getelementptr inbounds %struct.timeval, %struct.timeval* %2, i64 0, i32 1
store i32 %7, i32* %8
%9 = call i32 @select(i32 0, i32 0, i32 0, i32 0, %struct.timeval* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int checkCPUendian() {
  int num = 1;
  if (*((char *)&num) == 1) {
    printf("Little-endian\n");
    return 0;
  } else {
    printf("Big-endian\n");
    return 1;
  }
}


x86 assembly (clang, -O0):
<checkCPUendian>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x1,-0x8(%rbp)
movsbl -0x8(%rbp),%eax
cmp    $0x1,%eax
jne    1144 <checkCPUendian+0x34>
lea    0xecd(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    1157 <checkCPUendian+0x47>
lea    0xec4(%rip),%rdi
call   1030 <printf@plt>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [15 x i8] c"Little-endian\0A\00"
@.str.1 = [12 x i8] c"Big-endian\0A\00"
define i32 @checkCPUendian() {
%1 = alloca i32
%2 = alloca i32
store i32 1, i32* %2
%3 = bitcast i32* %2 to i8*
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = icmp eq i32 %5, 1
br i1 %6, label %7, label %9
7: ; preds = %0
%8 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %1
br label %11
9: ; preds = %0
%10 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
store i32 1, i32* %1
br label %11
11: ; preds = %9, %7
%12 = load i32, i32* %1
ret i32 %12
}

LLVM IR (-O2):
@str = [14 x i8] c"Little-endian\00"
define i32 @checkCPUendian() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ scanf(char *, int *);
int /*<<< orphan*/ search(int **, int, int, int);
int main() {
  int mat[4][4] = {
      {10, 20, 30, 40},
      {15, 25, 35, 45},
      {27, 29, 37, 48},
      {32, 33, 39, 50},
  };
  int input;
  scanf("%d", &input);
  search(mat, 4, 4, input);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x50(%rbp),%rdi
lea    0xeb6(%rip),%rsi
mov    $0x40,%edx
call   1040 <memcpy@plt>
lea    0xee5(%rip),%rdi
lea    -0x54(%rbp),%rsi
call   1050 <scanf@plt>
lea    -0x50(%rbp),%rdi
mov    -0x54(%rbp),%ecx
mov    $0x4,%edx
mov    %edx,%esi
call   1030 <search@plt>
xor    %eax,%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x58,%rsp
movaps 0xf05(%rip),%xmm0
movaps %xmm0,0x40(%rsp)
movaps 0xee9(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
movaps 0xecd(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xeb1(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
lea    0xee5(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1040 <scanf@plt>
mov    0xc(%rsp),%ecx
lea    0x10(%rsp),%rdi
mov    $0x4,%esi
mov    $0x4,%edx
call   1030 <search@plt>
xor    %eax,%eax
add    $0x58,%rsp
ret

LLVM IR (-O0):
@__const.main.mat = [4 x [4 x i32]] [[4 x i32] [i32 10, i32 20, i32 30, i32 40], [4 x i32] [i32 15, i32 25, i32 35, i32 45], [4 x i32] [i32 27, i32 29, i32 37, i32 48], [4 x i32] [i32 32, i32 33, i32 39, i32 50]]
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [4 x [4 x i32]]
%3 = alloca i32
store i32 0, i32* %1
%4 = bitcast [4 x [4 x i32]]* %2 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %3)
%6 = getelementptr inbounds [4 x [4 x i32]], [4 x [4 x i32]]* %2, i64 0, i64 0
%7 = bitcast [4 x i32]* %6 to i32**
%8 = load i32, i32* %3
%9 = call i32 @search(i32** %7, i32 4, i32 4, i32 %8)
ret i32 0
}

LLVM IR (-O2):
@__const.main.mat = [4 x [4 x i32]] [[4 x i32] [i32 10, i32 20, i32 30, i32 40], [4 x i32] [i32 15, i32 25, i32 35, i32 45], [4 x i32] [i32 27, i32 29, i32 37, i32 48], [4 x i32] [i32 32, i32 33, i32 39, i32 50]]
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca [4 x [4 x i32]]
%2 = alloca i32
%3 = bitcast [4 x [4 x i32]]* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%6 = bitcast [4 x [4 x i32]]* %1 to i32**
%7 = load i32, i32* %2
%8 = call i32 @search(i32** %6, i32 4, i32 4, i32 %7)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ ft_putstr(char *);
int ft_error(void) {
  ft_putstr("map error\n");
  exit(1);
}


x86 assembly (clang, -O0):
<ft_error>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <ft_putstr@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

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

LLVM IR (-O0):
@.str = [11 x i8] c"map error\0A\00"
define i32 @ft_error() {
%1 = call i32 @ft_putstr(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [11 x i8] c"map error\0A\00"
define i32 @ft_error() {
%1 = tail call i32 @ft_putstr(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int restar(int a, int b) {
  a -= b;
  printf("\nLa resta es: %d\n", a);
  return 0;
}


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

x86 assembly (clang, -O2):
<restar>:
push   %rax
mov    %edi,%eax
sub    %esi,%eax
lea    0xee4(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [18 x i8] c"\0ALa resta es: %d\0A\00"
define i32 @restar(i32 %0, i32 %1) {
%3 = sub nsw i32 %0, %1
%4 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 0
}
void adc_cleanup(struct adc_channel *channel) {}


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

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

LLVM IR (-O0):
%struct.adc_channel = type opaque
define void @adc_cleanup(%struct.adc_channel* %0) {
%2 = alloca %struct.adc_channel*
store %struct.adc_channel* %0, %struct.adc_channel** %2
ret void
}

LLVM IR (-O2):
%struct.adc_channel = type opaque
define void @adc_cleanup(%struct.adc_channel* nocapture %0) {
ret void
}
/* Variables and functions */
int open(char *, int);
int /*<<< orphan*/ printf(char *, int);
int main() {
  int fd = open("/tmp/b", 010000000);
  printf("%d", fd);
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [7 x i8] c"/tmp/b\00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = tail call i32 @open(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 2097152)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ ispunct(int);
void t_ispunct_0xf4() {
  Assert_real((ispunct(244) == 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_ispunct.c",
              1225, ("ispunct should be 0 for 0xf4"));
}


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

x86 assembly (clang, -O2):
<t_ispunct_0xf4>:
push   %rax
mov    $0xf4,%edi
call   1030 <ispunct@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x4c9,%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_ispunct.c\00"
@.str.1 = [29 x i8] c"ispunct should be 0 for 0xf4\00"
define void @t_ispunct_0xf4() {
%1 = call i64 @ispunct(i32 244)
%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 1225, 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_ispunct.c\00"
@.str.1 = [29 x i8] c"ispunct should be 0 for 0xf4\00"
define void @t_ispunct_0xf4() {
%1 = tail call i64 @ispunct(i32 244)
%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 1225, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
unsigned char *chacha20_decrypt(unsigned char *, size_t *,
                                unsigned char const *, size_t,
                                unsigned char const *, unsigned char const *);
unsigned char *crypt_decrypt_chacha20(unsigned char *out, size_t *out_len,
                                      const unsigned char *in, size_t in_len,
                                      const unsigned char *nonce,
                                      const unsigned char *key) {
  return chacha20_decrypt(out, out_len, in, in_len, nonce, key);
}


x86 assembly (clang, -O0):
<crypt_decrypt_chacha20>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r8
mov    -0x30(%rbp),%r9
call   1030 <chacha20_decrypt@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<crypt_decrypt_chacha20>:
jmp    1030 <chacha20_decrypt@plt>

LLVM IR (-O0):
define i8* @crypt_decrypt_chacha20(i8* %0, i64* %1, i8* %2, i64 %3, i8* %4, i8* %5) {
%7 = alloca i8*
%8 = alloca i64*
%9 = alloca i8*
%10 = alloca i64
%11 = alloca i8*
%12 = alloca i8*
store i8* %0, i8** %7
store i64* %1, i64** %8
store i8* %2, i8** %9
store i64 %3, i64* %10
store i8* %4, i8** %11
store i8* %5, i8** %12
%13 = load i8*, i8** %7
%14 = load i64*, i64** %8
%15 = load i8*, i8** %9
%16 = load i64, i64* %10
%17 = load i8*, i8** %11
%18 = load i8*, i8** %12
%19 = call i8* @chacha20_decrypt(i8* %13, i64* %14, i8* %15, i64 %16, i8* %17, i8* %18)
ret i8* %19
}

LLVM IR (-O2):
define i8* @crypt_decrypt_chacha20(i8* %0, i64* %1, i8* %2, i64 %3, i8* %4, i8* %5) {
%7 = tail call i8* @chacha20_decrypt(i8* %0, i64* %1, i8* %2, i64 %3, i8* %4, i8* %5)
ret i8* %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void clear(void) { printf("\x1b[2J\x1b[H"); }


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

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

LLVM IR (-O0):
@.str = [8 x i8] c"\1B[2J\1B[H\00"
define void @clear() {
%1 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"\1B[2J\1B[H\00"
define void @clear() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ test_counter();
int /*<<< orphan*/ test_perm();
int /*<<< orphan*/ test_readme_example();
int /*<<< orphan*/ test_sudoku();
int /*<<< orphan*/ test_sudoku_duplicate_constraints();
int /*<<< orphan*/ test_sudoku_random_order();
int main() {
  test_sudoku();
  test_sudoku_duplicate_constraints();
  test_sudoku_random_order();
  test_counter();
  test_perm();
  test_readme_example();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1080 <test_sudoku@plt>
mov    $0x0,%al
call   1040 <test_sudoku_duplicate_constraints@plt>
mov    $0x0,%al
call   1050 <test_sudoku_random_order@plt>
mov    $0x0,%al
call   1030 <test_counter@plt>
mov    $0x0,%al
call   1070 <test_perm@plt>
mov    $0x0,%al
call   1060 <test_readme_example@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1080 <test_sudoku@plt>
xor    %eax,%eax
call   1040 <test_sudoku_duplicate_constraints@plt>
xor    %eax,%eax
call   1050 <test_sudoku_random_order@plt>
xor    %eax,%eax
call   1030 <test_counter@plt>
xor    %eax,%eax
call   1070 <test_perm@plt>
xor    %eax,%eax
call   1060 <test_readme_example@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @test_sudoku()
%3 = call i32 (...) @test_sudoku_duplicate_constraints()
%4 = call i32 (...) @test_sudoku_random_order()
%5 = call i32 (...) @test_counter()
%6 = call i32 (...) @test_perm()
%7 = call i32 (...) @test_readme_example()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @test_sudoku()
%2 = tail call i32 (...) @test_sudoku_duplicate_constraints()
%3 = tail call i32 (...) @test_sudoku_random_order()
%4 = tail call i32 (...) @test_counter()
%5 = tail call i32 (...) @test_perm()
%6 = tail call i32 (...) @test_readme_example()
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ fb_clear_row(int);
int /*<<< orphan*/ memmove(int /*<<< orphan*/ *, int /*<<< orphan*/ *, int);
void fb_shift_up() {
  uint16_t *fb = (uint16_t *)0x000B8000;
  ;
  memmove(fb, fb + 80, 80 * 2 * (25 * 2 - 1));
  fb_clear_row(25 - 1);
}


x86 assembly (clang, -O0):
<fb_shift_up>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0xb8000,%eax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x8(%rbp),%rsi
add    $0x140,%rsi
mov    $0x1ea0,%edx
call   1030 <memmove@plt>
mov    $0x18,%edi
call   1040 <fb_clear_row@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fb_shift_up>:
push   %rax
mov    $0xb8000,%edi
mov    $0xb8140,%esi
mov    $0x1ea0,%edx
call   1030 <memmove@plt>
mov    $0x18,%edi
pop    %rax
jmp    1040 <fb_clear_row@plt>

LLVM IR (-O0):
define void @fb_shift_up() {
%1 = alloca i32*
store i32* inttoptr (i64 753664 to i32*), i32** %1
%2 = load i32*, i32** %1
%3 = load i32*, i32** %1
%4 = getelementptr inbounds i32, i32* %3, i64 80
%5 = call i32 @memmove(i32* %2, i32* %4, i32 7840)
%6 = call i32 @fb_clear_row(i32 24)
ret void
}

LLVM IR (-O2):
define void @fb_shift_up() {
%1 = tail call i32 @memmove(i32* inttoptr (i64 753664 to i32*), i32* inttoptr (i64 753984 to i32*), i32 7840)
%2 = tail call i32 @fb_clear_row(i32 24)
ret void
}
char *strcpy(char *dest, const char *src) {
  char *save = dest;
  while (*src != 0) {
    *dest++ = *src++;
  }
  return save;
}


x86 assembly (clang, -O0):
<strcpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     114b <strcpy+0x4b>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%cl
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %cl,(%rax)
jmp    1114 <strcpy+0x14>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcpy>:
mov    %rdi,%rax
mov    (%rsi),%cl
test   %cl,%cl
je     1120 <strcpy+0x20>
xor    %edx,%edx
nopl   0x0(%rax,%rax,1)
mov    %cl,(%rax,%rdx,1)
movzbl 0x1(%rsi,%rdx,1),%ecx
add    $0x1,%rdx
test   %cl,%cl
jne    1110 <strcpy+0x10>
ret

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

LLVM IR (-O2):
define i8* @strcpy(i8* returned writeonly %0, i8* nocapture %1) {
%3 = load i8, i8* %1
%4 = icmp eq i8 %3, 0
br i1 %4, label %13, label %5
5: ; preds = %2, %5
%6 = phi i8 [ %11, %5 ], [ %3, %2 ]
%7 = phi i8* [ %10, %5 ], [ %0, %2 ]
%8 = phi i8* [ %9, %5 ], [ %1, %2 ]
%9 = getelementptr inbounds i8, i8* %8, i64 1
%10 = getelementptr inbounds i8, i8* %7, i64 1
store i8 %6, i8* %7
%11 = load i8, i8* %9
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %5
13: ; preds = %5, %2
ret i8* %0
}
/* Type definitions */
struct timespec {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ CLOCK_MONOTONIC;
int /*<<< orphan*/ clock_gettime(int /*<<< orphan*/, struct timespec *);
void rtutils_get_now(struct timespec *n) { clock_gettime(CLOCK_MONOTONIC, n); }


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

x86 assembly (clang, -O2):
<rtutils_get_now>:
mov    %rdi,%rsi
mov    0x2ece(%rip),%rax
mov    (%rax),%edi
jmp    1030 <clock_gettime@plt>

LLVM IR (-O0):
%struct.timespec = type { i32 }
@CLOCK_MONOTONIC = global i32 0
define void @rtutils_get_now(%struct.timespec* %0) {
%2 = alloca %struct.timespec*
store %struct.timespec* %0, %struct.timespec** %2
%3 = load i32, i32* @CLOCK_MONOTONIC
%4 = load %struct.timespec*, %struct.timespec** %2
%5 = call i32 @clock_gettime(i32 %3, %struct.timespec* %4)
ret void
}

LLVM IR (-O2):
%struct.timespec = type { i32 }
@CLOCK_MONOTONIC = global i32 0
define void @rtutils_get_now(%struct.timespec* %0) {
%2 = load i32, i32* @CLOCK_MONOTONIC
%3 = tail call i32 @clock_gettime(i32 %2, %struct.timespec* %0)
ret void
}