xunge/DecIR huggingface dataset:
void pred_constant_copy(const struct XCSF *xcsf, struct Cl *dest,
                        const struct Cl *src) {
  (void)xcsf;
  (void)dest;
  (void)src;
}


x86 assembly (clang, -O0):
<pred_constant_copy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.XCSF = type opaque
%struct.Cl = type opaque
define void @pred_constant_copy(%struct.XCSF* %0, %struct.Cl* %1, %struct.Cl* %2) {
%4 = alloca %struct.XCSF*
%5 = alloca %struct.Cl*
%6 = alloca %struct.Cl*
store %struct.XCSF* %0, %struct.XCSF** %4
store %struct.Cl* %1, %struct.Cl** %5
store %struct.Cl* %2, %struct.Cl** %6
%7 = load %struct.XCSF*, %struct.XCSF** %4
%8 = load %struct.Cl*, %struct.Cl** %5
%9 = load %struct.Cl*, %struct.Cl** %6
ret void
}

LLVM IR (-O2):
%struct.XCSF = type opaque
%struct.Cl = type opaque
define void @pred_constant_copy(%struct.XCSF* nocapture %0, %struct.Cl* nocapture %1, %struct.Cl* nocapture %2) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int listen(int, int);
int /*<<< orphan*/ printf(char *);
int Listen(int des, int backlog) {
  int temp;
  temp = listen(des, backlog);
  if (temp < 0) {
    printf("Error listening......\n");
    exit(1);
  }
  return temp;
}


x86 assembly (clang, -O0):
<Listen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1040 <listen@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jge    116c <Listen+0x3c>
lea    0xea3(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Listen>:
push   %rax
call   1040 <listen@plt>
test   %eax,%eax
js     113c <Listen+0xc>
pop    %rcx
ret
lea    0xebd(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [23 x i8] c"Error listening......\0A\00"
define i32 @Listen(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = load i32, i32* %4
%8 = call i32 @listen(i32 %6, i32 %7)
store i32 %8, i32* %5
%9 = load i32, i32* %5
%10 = icmp slt i32 %9, 0
br i1 %10, label %11, label %14
11: ; preds = %2
%12 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%13 = call i32 @exit(i32 1)
unreachable
14: ; preds = %2
%15 = load i32, i32* %5
ret i32 %15
}

LLVM IR (-O2):
@str = [22 x i8] c"Error listening......\00"
define i32 @Listen(i32 %0, i32 %1) {
%3 = tail call i32 @listen(i32 %0, i32 %1)
%4 = icmp slt i32 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %2
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str, i64 0, i64 0))
%7 = tail call i32 @exit(i32 1)
unreachable
8: ; preds = %2
ret i32 %3
}
/* Variables and functions */
void *calloc(int, int);
int /*<<< orphan*/ fatalError();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void *allocWithErr(int size) {
  void *mem;
  mem = calloc(1, size);
  if (mem == NULL) {
    fprintf(stderr, "Out of memory\n");
    fatalError();
  }
  return mem;
}


x86 assembly (clang, -O0):
<allocWithErr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
mov    $0x1,%edi
call   1030 <calloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1173 <allocWithErr+0x43>
mov    0x2e82(%rip),%rax
mov    (%rax),%edi
lea    0xe99(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x0,%al
call   1050 <fatalError@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<allocWithErr>:
push   %rbx
mov    %edi,%esi
mov    $0x1,%edi
call   1030 <calloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1161 <allocWithErr+0x31>
mov    0x2e94(%rip),%rax
mov    (%rax),%edi
lea    0xeab(%rip),%rsi
call   1040 <fprintf@plt>
xor    %eax,%eax
call   1050 <fatalError@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [15 x i8] c"Out of memory\0A\00"
define i8* @allocWithErr(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i8* @calloc(i32 1, i32 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp eq i8* %6, null
br i1 %7, label %8, label %12
8: ; preds = %1
%9 = load i32, i32* @stderr
%10 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%11 = call i32 (...) @fatalError()
br label %12
12: ; preds = %8, %1
%13 = load i8*, i8** %3
ret i8* %13
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [15 x i8] c"Out of memory\0A\00"
define noalias i8* @allocWithErr(i32 %0) {
%2 = tail call i8* @calloc(i32 1, i32 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%7 = tail call i32 (...) @fatalError()
br label %8
8: ; preds = %4, %1
ret i8* %2
}
/* Type definitions */
typedef int speed_t;

/* Variables and functions */
int B1200;
int B19200;
int B9600;
speed_t get_posix_serial_speed(int speed) {
  switch (speed) {
  case 1200:
    return B1200;
  case 9600:
    return B9600;
  case 19200:
    return B19200;
  default:
    return -1;
  }
}


x86 assembly (clang, -O0):
<get_posix_serial_speed>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
sub    $0x4b0,%eax
je     1143 <get_posix_serial_speed+0x43>
jmp    111d <get_posix_serial_speed+0x1d>
mov    -0xc(%rbp),%eax
sub    $0x2580,%eax
je     1154 <get_posix_serial_speed+0x54>
jmp    1130 <get_posix_serial_speed+0x30>
mov    -0xc(%rbp),%eax
sub    $0x4b00,%eax
je     1165 <get_posix_serial_speed+0x65>
jmp    1176 <get_posix_serial_speed+0x76>
mov    0x2e86(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    117d <get_posix_serial_speed+0x7d>
mov    0x2e85(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    117d <get_posix_serial_speed+0x7d>
mov    0x2e84(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    117d <get_posix_serial_speed+0x7d>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_posix_serial_speed>:
cmp    $0x4b00,%edi
je     1126 <get_posix_serial_speed+0x26>
cmp    $0x2580,%edi
je     112f <get_posix_serial_speed+0x2f>
mov    $0xffffffff,%eax
cmp    $0x4b0,%edi
jne    1138 <get_posix_serial_speed+0x38>
mov    0x2eac(%rip),%rax
jmp    1136 <get_posix_serial_speed+0x36>
mov    0x2ec3(%rip),%rax
jmp    1136 <get_posix_serial_speed+0x36>
mov    0x2eaa(%rip),%rax
mov    (%rax),%eax
ret

LLVM IR (-O0):
@B1200 = global i32 0
@B9600 = global i32 0
@B19200 = global i32 0
define i32 @get_posix_serial_speed(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %11 [
i32 1200, label %5
i32 9600, label %7
i32 19200, label %9
]
5: ; preds = %1
%6 = load i32, i32* @B1200
store i32 %6, i32* %2
br label %12
7: ; preds = %1
%8 = load i32, i32* @B9600
store i32 %8, i32* %2
br label %12
9: ; preds = %1
%10 = load i32, i32* @B19200
store i32 %10, i32* %2
br label %12
11: ; preds = %1
store i32 -1, i32* %2
br label %12
12: ; preds = %11, %9, %7, %5
%13 = load i32, i32* %2
ret i32 %13
}

LLVM IR (-O2):
@B1200 = global i32 0
@B9600 = global i32 0
@B19200 = global i32 0
define i32 @get_posix_serial_speed(i32 %0) {
switch i32 %0, label %8 [
i32 1200, label %2
i32 9600, label %4
i32 19200, label %6
]
2: ; preds = %1
%3 = load i32, i32* @B1200
br label %8
4: ; preds = %1
%5 = load i32, i32* @B9600
br label %8
6: ; preds = %1
%7 = load i32, i32* @B19200
br label %8
8: ; preds = %1, %6, %4, %2
%9 = phi i32 [ %7, %6 ], [ %5, %4 ], [ %3, %2 ], [ -1, %1 ]
ret i32 %9
}
int is_identifier(char c) {
  if (c >= 'a' && c <= 'e')
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<is_identifier>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x61,%eax
jl     1130 <is_identifier+0x30>
movsbl -0x5(%rbp),%eax
cmp    $0x65,%eax
jg     1130 <is_identifier+0x30>
movl   $0x1,-0x4(%rbp)
jmp    1137 <is_identifier+0x37>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_identifier>:
add    $0x9f,%dil
xor    %eax,%eax
cmp    $0x5,%dil
setb   %al
ret

LLVM IR (-O0):
define i32 @is_identifier(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 sge i32 %5, 97
br i1 %6, label %7, label %12
7: ; preds = %1
%8 = load i8, i8* %3
%9 = sext i8 %8 to i32
%10 = icmp sle i32 %9, 101
br i1 %10, label %11, label %12
11: ; preds = %7
store i32 1, i32* %2
br label %13
12: ; preds = %7, %1
store i32 0, i32* %2
br label %13
13: ; preds = %12, %11
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
define i32 @is_identifier(i8 signext %0) {
%2 = add i8 %0, -97
%3 = icmp ult i8 %2, 5
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ arm_arith_cmn(int /*<<< orphan*/);
int /*<<< orphan*/ arm_data_regr_op();
void arm_cmn_regr() { arm_arith_cmn(arm_data_regr_op()); }


x86 assembly (clang, -O0):
<arm_cmn_regr>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <arm_data_regr_op@plt>
mov    %eax,%edi
call   1030 <arm_arith_cmn@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<arm_cmn_regr>:
push   %rax
xor    %eax,%eax
call   1040 <arm_data_regr_op@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <arm_arith_cmn@plt>

LLVM IR (-O0):
define void @arm_cmn_regr() {
%1 = call i32 (...) @arm_data_regr_op()
%2 = call i32 @arm_arith_cmn(i32 %1)
ret void
}

LLVM IR (-O2):
define void @arm_cmn_regr() {
%1 = tail call i32 (...) @arm_data_regr_op()
%2 = tail call i32 @arm_arith_cmn(i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ sleep(int);
void do_regular_work() {
  printf("SuperSleep version 1.0 Running-Licensed Software\n");
  sleep(10);
}


x86 assembly (clang, -O0):
<do_regular_work>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0xa,%edi
call   1040 <sleep@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_regular_work>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
mov    $0xa,%edi
pop    %rax
jmp    1040 <sleep@plt>

LLVM IR (-O0):
@.str = [50 x i8] c"SuperSleep version 1.0 Running-Licensed Software\0A\00"
define void @do_regular_work() {
%1 = call i32 @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @sleep(i32 10)
ret void
}

LLVM IR (-O2):
@str = [49 x i8] c"SuperSleep version 1.0 Running-Licensed Software\00"
define void @do_regular_work() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([49 x i8], [49 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @sleep(i32 10)
ret void
}
long tegra114_emc_round_rate(unsigned long rate) { return 0; }


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

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

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

LLVM IR (-O2):
define i64 @tegra114_emc_round_rate(i64 %0) {
ret i64 0
}
/* Variables and functions */
int yahoo_M1ObfuscatedTableCommon(int, int, unsigned char *);
int yahoo_f01_4b(int Salt, int Parameter) {
  static unsigned char LUT[32] = {
      0x12, 0x18, 0x0E, 0x08, 0x16, 0x05, 0x06, 0x00, 0x11, 0x17, 0x15,
      0x1B, 0x14, 0x01, 0x1F, 0x19, 0x04, 0x0D, 0x0A, 0x0F, 0x10, 0x07,
      0x1D, 0x03, 0x0B, 0x13, 0x0C, 0x09, 0x1E, 0x02, 0x1A, 0x1C,
  };
  return yahoo_M1ObfuscatedTableCommon(Salt, Parameter, LUT);
}


x86 assembly (clang, -O0):
<yahoo_f01_4b>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
lea    0x2f05(%rip),%rdx
call   1030 <yahoo_M1ObfuscatedTableCommon@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<yahoo_f01_4b>:
lea    0x2f19(%rip),%rdx
jmp    1030 <yahoo_M1ObfuscatedTableCommon@plt>

LLVM IR (-O0):
@yahoo_f01_4b.LUT = internal global [32 x i8] c"\12\18\0E\08\16\05\06\00\11\17\15\1B\14\01\1F\19\04\0D\0A\0F\10\07\1D\03\0B\13\0C\09\1E\02\1A\1C"
define i32 @yahoo_f01_4b(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = call i32 @yahoo_M1ObfuscatedTableCommon(i32 %5, i32 %6, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @yahoo_f01_4b.LUT, i64 0, i64 0))
ret i32 %7
}

LLVM IR (-O2):
@yahoo_f01_4b.LUT = internal global [32 x i8] c"\12\18\0E\08\16\05\06\00\11\17\15\1B\14\01\1F\19\04\0D\0A\0F\10\07\1D\03\0B\13\0C\09\1E\02\1A\1C"
define i32 @yahoo_f01_4b(i32 %0, i32 %1) {
%3 = tail call i32 @yahoo_M1ObfuscatedTableCommon(i32 %0, i32 %1, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @yahoo_f01_4b.LUT, i64 0, i64 0))
ret i32 %3
}
char *find_char_or_comment(const char *s, char c) {
  while (*s && *s != c && *s != ';')
    s++;
  return (char *)s;
}


x86 assembly (clang, -O0):
<find_char_or_comment>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0xa(%rbp)
je     114b <find_char_or_comment+0x4b>
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
movsbl -0x9(%rbp),%edx
xor    %eax,%eax
cmp    %edx,%ecx
mov    %al,-0xa(%rbp)
je     114b <find_char_or_comment+0x4b>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x3b,%eax
setne  %al
mov    %al,-0xa(%rbp)
mov    -0xa(%rbp),%al
test   $0x1,%al
jne    115b <find_char_or_comment+0x5b>
jmp    116c <find_char_or_comment+0x6c>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    110e <find_char_or_comment+0xe>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<find_char_or_comment>:
mov    %rdi,%rax
mov    (%rdi),%cl
cmp    %sil,%cl
je     1126 <find_char_or_comment+0x26>
nopw   0x0(%rax,%rax,1)
test   %cl,%cl
je     1126 <find_char_or_comment+0x26>
cmp    $0x3b,%cl
je     1126 <find_char_or_comment+0x26>
movzbl 0x1(%rax),%ecx
add    $0x1,%rax
cmp    %sil,%cl
jne    1110 <find_char_or_comment+0x10>
ret

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

LLVM IR (-O2):
define i8* @find_char_or_comment(i8* %0, i8 signext %1) {
%3 = load i8, i8* %0
%4 = freeze i8 %3
%5 = icmp eq i8 %4, %1
br i1 %5, label %14, label %6
6: ; preds = %2, %9
%7 = phi i8 [ %12, %9 ], [ %4, %2 ]
%8 = phi i8* [ %10, %9 ], [ %0, %2 ]
switch i8 %7, label %9 [
i8 59, label %14
i8 0, label %14
]
9: ; preds = %6
%10 = getelementptr inbounds i8, i8* %8, i64 1
%11 = load i8, i8* %10
%12 = freeze i8 %11
%13 = icmp eq i8 %12, %1
br i1 %13, label %14, label %6
14: ; preds = %9, %6, %6, %2
%15 = phi i8* [ %0, %2 ], [ %8, %6 ], [ %8, %6 ], [ %10, %9 ]
ret i8* %15
}
/* Type definitions */
struct flag {
  int dummy;
};
struct copt {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ copt_register_option(struct copt *, struct flag *);
struct flag *new_bool_flag(char const *);
void copt_bool_option(struct copt *slf, const char *optstr) {
  struct flag *f = new_bool_flag(optstr);
  copt_register_option(slf, f);
}


x86 assembly (clang, -O0):
<copt_bool_option>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <new_bool_flag@plt>
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <copt_register_option@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<copt_bool_option>:
push   %rbx
mov    %rdi,%rbx
mov    %rsi,%rdi
call   1030 <new_bool_flag@plt>
mov    %rbx,%rdi
mov    %rax,%rsi
pop    %rbx
jmp    1040 <copt_register_option@plt>

LLVM IR (-O0):
%struct.copt = type { i32 }
%struct.flag = type { i32 }
define void @copt_bool_option(%struct.copt* %0, i8* %1) {
%3 = alloca %struct.copt*
%4 = alloca i8*
%5 = alloca %struct.flag*
store %struct.copt* %0, %struct.copt** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %4
%7 = call %struct.flag* @new_bool_flag(i8* %6)
store %struct.flag* %7, %struct.flag** %5
%8 = load %struct.copt*, %struct.copt** %3
%9 = load %struct.flag*, %struct.flag** %5
%10 = call i32 @copt_register_option(%struct.copt* %8, %struct.flag* %9)
ret void
}

LLVM IR (-O2):
%struct.copt = type { i32 }
%struct.flag = type { i32 }
define void @copt_bool_option(%struct.copt* %0, i8* %1) {
%3 = tail call %struct.flag* @new_bool_flag(i8* %1)
%4 = tail call i32 @copt_register_option(%struct.copt* %0, %struct.flag* %3)
ret void
}
/* Variables and functions */
int mygetline(char *, int);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ trim(char *);
int main(int argc, char *argv[]) {
  int len;
  char line[1000];
  while ((len = mygetline(line, 1000)) > 0) {
    trim(line);
    printf("%s\n", line);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x400,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x400(%rbp),%rdi
mov    $0x3e8,%esi
call   1050 <mygetline@plt>
mov    %eax,-0x14(%rbp)
cmp    $0x0,%eax
jle    118a <main+0x5a>
lea    -0x400(%rbp),%rdi
call   1040 <trim@plt>
lea    -0x400(%rbp),%rsi
lea    0xe80(%rip),%rdi
call   1030 <printf@plt>
jmp    1149 <main+0x19>
xor    %eax,%eax
add    $0x400,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x3e8,%rsp
mov    %rsp,%rdi
mov    $0x3e8,%esi
call   1050 <mygetline@plt>
test   %eax,%eax
jle    1184 <main+0x54>
mov    %rsp,%rbx
lea    0xeab(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nop
mov    %rbx,%rdi
call   1040 <trim@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x3e8,%esi
call   1050 <mygetline@plt>
test   %eax,%eax
jg     1160 <main+0x30>
xor    %eax,%eax
add    $0x3e8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%s\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca [1000 x i8]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
br label %8
8: ; preds = %12, %2
%9 = getelementptr inbounds [1000 x i8], [1000 x i8]* %7, i64 0, i64 0
%10 = call i32 @mygetline(i8* %9, i32 1000)
store i32 %10, i32* %6
%11 = icmp sgt i32 %10, 0
br i1 %11, label %12, label %17
12: ; preds = %8
%13 = getelementptr inbounds [1000 x i8], [1000 x i8]* %7, i64 0, i64 0
%14 = call i32 @trim(i8* %13)
%15 = getelementptr inbounds [1000 x i8], [1000 x i8]* %7, i64 0, i64 0
%16 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %15)
br label %8
17: ; preds = %8
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [1000 x i8]
%4 = getelementptr inbounds [1000 x i8], [1000 x i8]* %3, i64 0, i64 0
%5 = call i32 @mygetline(i8* %4, i32 1000)
%6 = icmp sgt i32 %5, 0
br i1 %6, label %7, label %12
7: ; preds = %2, %7
%8 = call i32 @trim(i8* %4)
%9 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %4)
%10 = call i32 @mygetline(i8* %4, i32 1000)
%11 = icmp sgt i32 %10, 0
br i1 %11, label %7, label %12
12: ; preds = %7, %2
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
int isqrt(int);
void t_sqrt_113() {
  Assert_real((isqrt(113) == 10),
              "/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/stdlib/isqrt.c",
              570, ("Integer square root of 113 should be 10"));
}


x86 assembly (clang, -O0):
<t_sqrt_113>:
push   %rbp
mov    %rsp,%rbp
mov    $0x71,%edi
call   1030 <isqrt@plt>
cmp    $0xa,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xec0(%rip),%rsi
mov    $0x23a,%edx
lea    0xf56(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_sqrt_113>:
push   %rax
mov    $0x71,%edi
call   1030 <isqrt@plt>
xor    %edi,%edi
cmp    $0xa,%eax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf60(%rip),%rcx
mov    $0x23a,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [162 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/stdlib/isqrt.c\00"
@.str.1 = [40 x i8] c"Integer square root of 113 should be 10\00"
define void @t_sqrt_113() {
%1 = call i32 @isqrt(i32 113)
%2 = icmp eq i32 %1, 10
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str, i64 0, i64 0), i32 570, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [162 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/stdlib/isqrt.c\00"
@.str.1 = [40 x i8] c"Integer square root of 113 should be 10\00"
define void @t_sqrt_113() {
%1 = tail call i32 @isqrt(i32 113)
%2 = icmp eq i32 %1, 10
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str, i64 0, i64 0), i32 570, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void escape_quotes(char *target, const char *src) {
  for (; *src; src++, target++) {
    if (*src == '"')
      *target++ = '\\';
    *target = *src;
  }
  *target = '\0';
}


x86 assembly (clang, -O0):
<escape_quotes>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1164 <escape_quotes+0x64>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x22,%eax
jne    113b <escape_quotes+0x3b>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movb   $0x5c,(%rax)
mov    -0x10(%rbp),%rax
mov    (%rax),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    110c <escape_quotes+0xc>
mov    -0x8(%rbp),%rax
movb   $0x0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<escape_quotes>:
jmp    1124 <escape_quotes+0x24>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movb   $0x5c,(%rdi)
add    $0x1,%rdi
movzbl (%rsi),%eax
mov    %al,(%rdi)
add    $0x1,%rsi
add    $0x1,%rdi
movzbl (%rsi),%eax
cmp    $0x22,%al
je     1110 <escape_quotes+0x10>
test   %al,%al
jne    111a <escape_quotes+0x1a>
movb   $0x0,(%rdi)
ret

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

LLVM IR (-O2):
define void @escape_quotes(i8* nocapture writeonly %0, i8* nocapture %1) {
br label %3
3: ; preds = %10, %2
%4 = phi i8* [ %0, %2 ], [ %14, %10 ]
%5 = phi i8* [ %1, %2 ], [ %13, %10 ]
%6 = load i8, i8* %5
switch i8 %6, label %10 [
i8 0, label %15
i8 34, label %7
]
7: ; preds = %3
%8 = getelementptr inbounds i8, i8* %4, i64 1
store i8 92, i8* %4
%9 = load i8, i8* %5
br label %10
10: ; preds = %3, %7
%11 = phi i8 [ %9, %7 ], [ %6, %3 ]
%12 = phi i8* [ %8, %7 ], [ %4, %3 ]
store i8 %11, i8* %12
%13 = getelementptr inbounds i8, i8* %5, i64 1
%14 = getelementptr inbounds i8, i8* %12, i64 1
br label %3
15: ; preds = %3
store i8 0, i8* %4
ret void
}
double(creal)(double _Complex x) { return __builtin_creal(x); }


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

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

LLVM IR (-O0):
define double @creal(double %0, double %1) {
%3 = alloca { double, double }
%4 = getelementptr inbounds { double, double }, { double, double }* %3, i32 0, i32 0
store double %0, double* %4
%5 = getelementptr inbounds { double, double }, { double, double }* %3, i32 0, i32 1
store double %1, double* %5
%6 = getelementptr inbounds { double, double }, { double, double }* %3, i32 0, i32 0
%7 = load double, double* %6
%8 = getelementptr inbounds { double, double }, { double, double }* %3, i32 0, i32 1
%9 = load double, double* %8
ret double %7
}

LLVM IR (-O2):
define double @creal(double returned %0, double %1) {
ret double %0
}
/* Variables and functions */
int rom_present(char *);
int tgui9400cxi_available() {
  return rom_present(L"roms/video/tgui9440/9400CXI.vbi");
}


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

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

LLVM IR (-O0):
@.str = [32 x i32] [i32 114, i32 111, i32 109, i32 115, i32 47, i32 118, i32 105, i32 100, i32 101, i32 111, i32 47, i32 116, i32 103, i32 117, i32 105, i32 57, i32 52, i32 52, i32 48, i32 47, i32 57, i32 52, i32 48, i32 48, i32 67, i32 88, i32 73, i32 46, i32 118, i32 98, i32 105, i32 0]
define i32 @tgui9400cxi_available() {
%1 = call i32 @rom_present(i8* bitcast ([32 x i32]* @.str to i8*))
ret i32 %1
}

LLVM IR (-O2):
@.str = [32 x i32] [i32 114, i32 111, i32 109, i32 115, i32 47, i32 118, i32 105, i32 100, i32 101, i32 111, i32 47, i32 116, i32 103, i32 117, i32 105, i32 57, i32 52, i32 52, i32 48, i32 47, i32 57, i32 52, i32 48, i32 48, i32 67, i32 88, i32 73, i32 46, i32 118, i32 98, i32 105, i32 0]
define i32 @tgui9400cxi_available() {
%1 = tail call i32 @rom_present(i8* bitcast ([32 x i32]* @.str to i8*))
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *, int, char *);
int /*<<< orphan*/ goodbye();
int /*<<< orphan*/ stderr;
void badassertion(char *string, char *file, int line) {
  fprintf(stderr, "\"%s\", line %d: Assertion failed \"%s\"\n", file, line,
          string);
  goodbye();
}


x86 assembly (clang, -O0):
<badassertion>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    0x2ea6(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rdx
mov    -0x14(%rbp),%ecx
mov    -0x8(%rbp),%r8
lea    0xeb2(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x0,%al
call   1040 <goodbye@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<badassertion>:
push   %rax
mov    %edx,%ecx
mov    %rsi,%rdx
mov    %rdi,%r8
mov    0x2eb0(%rip),%rax
mov    (%rax),%edi
lea    0xec7(%rip),%rsi
call   1030 <fprintf@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <goodbye@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [38 x i8] c"\22%s\22, line %d: Assertion failed \22%s\22\0A\00"
define void @badassertion(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 i32, i32* @stderr
%8 = load i8*, i8** %5
%9 = load i32, i32* %6
%10 = load i8*, i8** %4
%11 = call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), i8* %8, i32 %9, i8* %10)
%12 = call i32 (...) @goodbye()
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [38 x i8] c"\22%s\22, line %d: Assertion failed \22%s\22\0A\00"
define void @badassertion(i8* %0, i8* %1, i32 %2) {
%4 = load i32, i32* @stderr
%5 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), i8* %1, i32 %2, i8* %0)
%6 = tail call i32 (...) @goodbye()
ret void
}
int main() {
  int cookie;
  char buf[80];
  printf("buf: %08x cookie: %08x\n", &buf, &cookie);
  gets(buf);
  if (cookie == 0x000a0d00)
    printf("you lose!\n");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x60(%rbp),%rsi
lea    -0x8(%rbp),%rdx
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x60(%rbp),%rdi
mov    $0x0,%al
call   1040 <gets@plt>
cmpl   $0xa0d00,-0x8(%rbp)
jne    116b <main+0x4b>
lea    0xeb4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x60,%rsp
lea    0xec4(%rip),%rdi
lea    0x10(%rsp),%rbx
lea    0xc(%rsp),%rdx
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <gets@plt>
cmpl   $0xa0d00,0xc(%rsp)
jne    1170 <main+0x40>
lea    0xead(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x60,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [24 x i8] c"buf: %08x cookie: %08x\0A\00"
@.str.1 = [11 x i8] c"you lose!\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [80 x i8]
store i32 0, i32* %1
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), [80 x i8]* %3, i32* %2)
%5 = getelementptr inbounds [80 x i8], [80 x i8]* %3, i64 0, i64 0
%6 = call i32 (i8*, ...) bitcast (i32 (...)* @gets to i32 (i8*, ...)*)(i8* %5)
%7 = load i32, i32* %2
%8 = icmp eq i32 %7, 658688
br i1 %8, label %9, label %11
9: ; preds = %0
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
br label %11
11: ; preds = %9, %0
%12 = load i32, i32* %1
ret i32 %12
}

LLVM IR (-O2):
@.str = [24 x i8] c"buf: %08x cookie: %08x\0A\00"
@str = [10 x i8] c"you lose!\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [80 x i8]
%3 = bitcast i32* %1 to i8*
%4 = getelementptr inbounds [80 x i8], [80 x i8]* %2, i64 0, i64 0
%5 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), [80 x i8]* %2, i32* %1)
%6 = call i32 (i8*, ...) bitcast (i32 (...)* @gets to i32 (i8*, ...)*)(i8* %4)
%7 = load i32, i32* %1
%8 = icmp eq i32 %7, 658688
br i1 %8, label %9, label %11
9: ; preds = %0
%10 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @str, i64 0, i64 0))
br label %11
11: ; preds = %9, %0
ret i32 0
}
int digitlen(int i) {
  int len = 0;
  do {
    ++len;
    i /= 10;
  } while (i);
  return len;
}


x86 assembly (clang, -O0):
<digitlen>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
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)
cmpl   $0x0,-0x4(%rbp)
jne    110e <digitlen+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<digitlen>:
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
add    $0x1,%eax
movslq %edi,%rcx
imul   $0x66666667,%rcx,%rdi
mov    %rdi,%rdx
shr    $0x3f,%rdx
sar    $0x22,%rdi
add    %edx,%edi
add    $0x9,%ecx
cmp    $0x12,%ecx
ja     1110 <digitlen+0x10>
ret

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

LLVM IR (-O2):
define i32 @digitlen(i32 %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i32 [ %0, %1 ], [ %6, %2 ]
%4 = phi i32 [ 0, %1 ], [ %5, %2 ]
%5 = add nuw nsw i32 %4, 1
%6 = sdiv i32 %3, 10
%7 = add i32 %3, 9
%8 = icmp ult i32 %7, 19
br i1 %8, label %9, label %2
9: ; preds = %2
ret i32 %5
}
int calculaResto(int soma) {
  int digitoVerificador;
  int resto = 0;
  resto = soma % 11;
  if (resto < 2)
    digitoVerificador = 0;
  else
    digitoVerificador = 11 - resto;
  return digitoVerificador;
}


x86 assembly (clang, -O0):
<calculaResto>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xb,%ecx
cltd
idiv   %ecx
mov    %edx,-0xc(%rbp)
cmpl   $0x2,-0xc(%rbp)
jge    1132 <calculaResto+0x32>
movl   $0x0,-0x8(%rbp)
jmp    113d <calculaResto+0x3d>
mov    $0xb,%eax
sub    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<calculaResto>:
movslq %edi,%rcx
imul   $0x2e8ba2e9,%rcx,%rax
mov    %rax,%rdx
shr    $0x3f,%rdx
sar    $0x21,%rax
add    %edx,%eax
lea    (%rax,%rax,4),%edx
lea    (%rax,%rdx,2),%eax
sub    %eax,%ecx
mov    $0xb,%edx
sub    %ecx,%edx
xor    %eax,%eax
cmp    $0x2,%ecx
cmovge %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @calculaResto(i32 %0) {
%2 = srem i32 %0, 11
%3 = icmp slt i32 %2, 2
%4 = sub nsw i32 11, %2
%5 = select i1 %3, i32 0, i32 %4
ret i32 %5
}
void doSomething(int *ptr) {
  int total = 3000 + 30;
  *ptr = total;
}


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

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

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

LLVM IR (-O2):
define void @doSomething(i32* nocapture writeonly %0) {
store i32 3030, i32* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void SOIL_free_image_data(unsigned char *img_data) { free((void *)img_data); }


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

LLVM IR (-O0):
define void @SOIL_free_image_data(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 @SOIL_free_image_data(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void fred() {
  printf("In fred()\n");
  goto done;
  printf("In middle\n");
done:
  printf("At end\n");
}


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

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

LLVM IR (-O0):
@.str = [11 x i8] c"In fred()\0A\00"
@.str.1 = [8 x i8] c"At end\0A\00"
define void @fred() {
%1 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
br label %2
2: ; preds = %0
%3 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [10 x i8] c"In fred()\00"
@str.2 = [7 x i8] c"At end\00"
define void @fred() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str.2, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ send_load();
int main() { send_load(); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <send_load@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <send_load@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 (...) @send_load()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @send_load()
ret i32 0
}
void free_mat(m, nrl, nrh) char **m;
int nrl, nrh;
{ free((char *)(m)); }


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

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

LLVM IR (-O0):
define void @free_mat(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 = bitcast i8** %7 to i8*
ret void
}

LLVM IR (-O2):
define void @free_mat(i8** nocapture %0, i32 %1, i32 %2) {
%4 = bitcast i8** %0 to i8*
tail call void @free(i8* %4)
ret void
}
/* Variables and functions */
scalar_t__ resources_get_int(char *, int *);
int get_true_drive_emulation_state(void) {
  int value;
  if (resources_get_int("DriveTrueEmulation", &value) < 0)
    return 0;
  return value;
}


x86 assembly (clang, -O0):
<get_true_drive_emulation_state>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1030 <resources_get_int@plt>
cmp    $0x0,%rax
jge    113e <get_true_drive_emulation_state+0x2e>
movl   $0x0,-0x4(%rbp)
jmp    1144 <get_true_drive_emulation_state+0x34>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_true_drive_emulation_state>:
push   %rax
lea    0xee8(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1030 <resources_get_int@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
js     1130 <get_true_drive_emulation_state+0x20>
mov    0x4(%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [19 x i8] c"DriveTrueEmulation\00"
define i32 @get_true_drive_emulation_state() {
%1 = alloca i32
%2 = alloca i32
%3 = call i64 @resources_get_int(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32* %2)
%4 = icmp slt i64 %3, 0
br i1 %4, label %5, label %6
5: ; preds = %0
store i32 0, i32* %1
br label %8
6: ; preds = %0
%7 = load i32, i32* %2
store i32 %7, i32* %1
br label %8
8: ; preds = %6, %5
%9 = load i32, i32* %1
ret i32 %9
}

LLVM IR (-O2):
@.str = [19 x i8] c"DriveTrueEmulation\00"
define i32 @get_true_drive_emulation_state() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i64 @resources_get_int(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = icmp slt i64 %3, 0
%5 = load i32, i32* %1
%6 = select i1 %4, i32 0, i32 %5
ret i32 %6
}
unsigned char CheckId_FUJITSU(void) { return 0; }


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

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

LLVM IR (-O0):
define zeroext i8 @CheckId_FUJITSU() {
ret i8 0
}

LLVM IR (-O2):
define zeroext i8 @CheckId_FUJITSU() {
ret i8 0
}
/* Type definitions */
struct timespec {
  int tv_sec;
  int tv_nsec;
};

/* Variables and functions */
int bot_timespec_milliseconds(struct timespec *a) {
  return a->tv_sec * 1000 + a->tv_nsec / 1000000;
}


x86 assembly (clang, -O0):
<bot_timespec_milliseconds>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
imul   $0x3e8,(%rax),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%eax
mov    $0xf4240,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bot_timespec_milliseconds>:
imul   $0x3e8,(%rdi),%ecx
movslq 0x4(%rdi),%rax
imul   $0x431bde83,%rax,%rax
mov    %rax,%rdx
shr    $0x3f,%rdx
sar    $0x32,%rax
add    %edx,%eax
add    %ecx,%eax
ret

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

LLVM IR (-O2):
%struct.timespec = type { i32, i32 }
define i32 @bot_timespec_milliseconds(%struct.timespec* nocapture %0) {
%2 = getelementptr inbounds %struct.timespec, %struct.timespec* %0, i64 0, i32 0
%3 = load i32, i32* %2
%4 = mul nsw i32 %3, 1000
%5 = getelementptr inbounds %struct.timespec, %struct.timespec* %0, i64 0, i32 1
%6 = load i32, i32* %5
%7 = sdiv i32 %6, 1000000
%8 = add nsw i32 %7, %4
ret i32 %8
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
FILE *setmntent(const char *filename __attribute__((unused)),
                const char *type __attribute__((unused))) {
  return NULL;
}


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

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

LLVM IR (-O0):
define i32* @setmntent(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
ret i32* null
}

LLVM IR (-O2):
define noalias i32* @setmntent(i8* nocapture readnone %0, i8* nocapture readnone %1) {
ret i32* null
}
void set_check(__attribute__((unused)) int do_it) {}


x86 assembly (clang, -O0):
<set_check>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @set_check(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printString(char *);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ reverseOneWord(char *);
int /*<<< orphan*/ scanf(char *, char *);
int main(void) {
  char string[100];
  printf("Enter a message: ");
  scanf("%[^\n]s", string);
  reverseOneWord(string);
  printString(string);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeaa(%rip),%rdi
call   1030 <printf@plt>
lea    -0x70(%rbp),%rsi
lea    0xeac(%rip),%rdi
call   1060 <scanf@plt>
lea    -0x70(%rbp),%rdi
call   1050 <reverseOneWord@plt>
lea    -0x70(%rbp),%rdi
call   1040 <printString@plt>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x70,%rsp
lea    0xeb4(%rip),%rdi
call   1030 <printf@plt>
lea    0xeba(%rip),%rdi
mov    %rsp,%rbx
mov    %rbx,%rsi
call   1060 <scanf@plt>
mov    %rbx,%rdi
call   1050 <reverseOneWord@plt>
mov    %rbx,%rdi
call   1040 <printString@plt>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [18 x i8] c"Enter a message: \00"
@.str.1 = [7 x i8] c"%[^\0A]s\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [100 x i8]
store i32 0, i32* %1
%3 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%4 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%5 = call i32 @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* %4)
%6 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%7 = call i32 @reverseOneWord(i8* %6)
%8 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%9 = call i32 @printString(i8* %8)
ret i32 0
}

LLVM IR (-O2):
@.str = [18 x i8] c"Enter a message: \00"
@.str.1 = [7 x i8] c"%[^\0A]s\00"
define i32 @main() {
%1 = alloca [100 x i8]
%2 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* %2)
%5 = call i32 @reverseOneWord(i8* %2)
%6 = call i32 @printString(i8* %2)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ opt;

/* Variables and functions */
int /*<<< orphan*/ SOL_SOCKET;
int /*<<< orphan*/ SO_REUSEPORT;
int setsockopt(int, int /*<<< orphan*/, int /*<<< orphan*/, int *, int);
int setreuseport(int socket) {
  int opt = 1;
  return setsockopt(socket, SOL_SOCKET, SO_REUSEPORT, &opt, sizeof(opt));
}


x86 assembly (clang, -O0):
<setreuseport>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2ebc(%rip),%rax
mov    (%rax),%esi
mov    0x2eab(%rip),%rax
mov    (%rax),%edx
lea    -0x8(%rbp),%rcx
mov    $0x4,%r8d
call   1030 <setsockopt@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<setreuseport>:
push   %rax
movl   $0x1,0x4(%rsp)
mov    0x2ec8(%rip),%rax
mov    (%rax),%esi
mov    0x2eb7(%rip),%rax
mov    (%rax),%edx
lea    0x4(%rsp),%rcx
mov    $0x4,%r8d
call   1030 <setsockopt@plt>
pop    %rcx
ret

LLVM IR (-O0):
@SOL_SOCKET = global i32 0
@SO_REUSEPORT = global i32 0
define i32 @setreuseport(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 1, i32* %3
%4 = load i32, i32* %2
%5 = load i32, i32* @SOL_SOCKET
%6 = load i32, i32* @SO_REUSEPORT
%7 = call i32 @setsockopt(i32 %4, i32 %5, i32 %6, i32* %3, i32 4)
ret i32 %7
}

LLVM IR (-O2):
@SOL_SOCKET = global i32 0
@SO_REUSEPORT = global i32 0
define i32 @setreuseport(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
store i32 1, i32* %2
%4 = load i32, i32* @SOL_SOCKET
%5 = load i32, i32* @SO_REUSEPORT
%6 = call i32 @setsockopt(i32 %0, i32 %4, i32 %5, i32* %2, i32 4)
ret i32 %6
}