xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, char *);
int assert(int testresult, char error_message[]) {
  static int test_number = 1;
  int result = 1;
  if (!testresult) {
    printf("%d test failed: %s\n", test_number, error_message);
    result = 0;
  }
  return result;
}


x86 assembly (clang, -O0):
<assert>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x1,-0x14(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    114d <assert+0x3d>
mov    0x2ef2(%rip),%esi
mov    -0x10(%rbp),%rdx
lea    0xebf(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<assert>:
mov    $0x1,%eax
test   %edi,%edi
je     111a <assert+0xa>
ret
push   %rax
mov    %rsi,%rdx
lea    0xedb(%rip),%rdi
mov    $0x1,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
ret

LLVM IR (-O0):
@assert.test_number = internal global i32 1
@.str = [20 x i8] c"%d test failed: %s\0A\00"
define i32 @assert(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i32
store i32 %0, i32* %3
store i8* %1, i8** %4
store i32 1, i32* %5
%6 = load i32, i32* %3
%7 = icmp ne i32 %6, 0
br i1 %7, label %12, label %8
8: ; preds = %2
%9 = load i32, i32* @assert.test_number
%10 = load i8*, i8** %4
%11 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %9, i8* %10)
store i32 0, i32* %5
br label %12
12: ; preds = %8, %2
%13 = load i32, i32* %5
ret i32 %13
}

LLVM IR (-O2):
@.str = [20 x i8] c"%d test failed: %s\0A\00"
define i32 @assert(i32 %0, i8* %1) {
%3 = icmp eq i32 %0, 0
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 1, i8* %1)
br label %6
6: ; preds = %4, %2
%7 = phi i32 [ 1, %2 ], [ 0, %4 ]
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
void die(const char *msg) {
  fprintf(stderr, "\nFATAL: %s\n", msg);
  abort();
}


x86 assembly (clang, -O0):
<die>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<die>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1040 <fprintf@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [12 x i8] c"\0AFATAL: %s\0A\00"
define void @die(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [12 x i8] c"\0AFATAL: %s\0A\00"
define void @die(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 (...) @abort()
unreachable
}
void init_uart(void) {}


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

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

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

LLVM IR (-O2):
define void @init_uart() {
ret void
}
int main(int argc, char **argv) {
  int arr[128];
  int i;
  for (i = 0; i < 129; i++)
    arr[i] = 0;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1a0,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x214(%rbp)
cmpl   $0x81,-0x214(%rbp)
jge    1159 <main+0x59>
movslq -0x214(%rbp),%rax
movl   $0x0,-0x210(%rbp,%rax,4)
mov    -0x214(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x214(%rbp)
jmp    1123 <main+0x23>
xor    %eax,%eax
add    $0x1a0,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
ret i32 0
}
int nlopt_stop_time_(double start, double maxtime) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @nlopt_stop_time_(double %0, double %1) {
ret i32 0
}
/* Variables and functions */
long __copy_tofrom_user(void *, void const *, long, void const *);
extern long copy_from_user(void *to, const void *from, long n) {
  return __copy_tofrom_user(to, from, n, from);
}


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

x86 assembly (clang, -O2):
<copy_from_user>:
mov    %rsi,%rcx
jmp    1030 <__copy_tofrom_user@plt>

LLVM IR (-O0):
define i64 @copy_from_user(i8* %0, i8* %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
store i8* %0, i8** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = load i64, i64* %6
%10 = load i8*, i8** %5
%11 = call i64 @__copy_tofrom_user(i8* %7, i8* %8, i64 %9, i8* %10)
ret i64 %11
}

LLVM IR (-O2):
define i64 @copy_from_user(i8* %0, i8* %1, i64 %2) {
%4 = tail call i64 @__copy_tofrom_user(i8* %0, i8* %1, i64 %2, i8* %1)
ret i64 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void print_usage(const char *program) {
  printf("Usage: %s [OPTIONS]\n", program);
  printf("-p, --port     The port to listen for messags on.\n");
  printf("-h, --help     Print this help message.\n");
  printf("-v, --verbose  Print more debugging information.\n");
}


x86 assembly (clang, -O0):
<print_usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xed9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xee0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf05(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf20(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_usage>:
push   %rax
mov    %rdi,%rsi
lea    0xed5(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xedc(%rip),%rdi
call   1030 <puts@plt>
lea    0xf02(%rip),%rdi
call   1030 <puts@plt>
lea    0xf1e(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [21 x i8] c"Usage: %s [OPTIONS]\0A\00"
@.str.1 = [51 x i8] c"-p, --port The port to listen for messags on.\0A\00"
@.str.2 = [41 x i8] c"-h, --help Print this help message.\0A\00"
@.str.3 = [50 x i8] c"-v, --verbose Print more debugging information.\0A\00"
define void @print_usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.1, i64 0, i64 0))
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.2, i64 0, i64 0))
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [21 x i8] c"Usage: %s [OPTIONS]\0A\00"
@str = [50 x i8] c"-p, --port The port to listen for messags on.\00"
@str.4 = [40 x i8] c"-h, --help Print this help message.\00"
@str.5 = [49 x i8] c"-v, --verbose Print more debugging information.\00"
define void @print_usage(i8* %0) {
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([50 x i8], [50 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @str.4, i64 0, i64 0))
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([49 x i8], [49 x i8]* @str.5, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ nrf24_ce_digitalWrite(int /*<<< orphan*/);
int /*<<< orphan*/ nrf24_csn_digitalWrite(int);
int /*<<< orphan*/ nrf24_setupPins();
void nrf24_init() {
  nrf24_setupPins();
  nrf24_ce_digitalWrite(0);
  nrf24_csn_digitalWrite(1);
}


x86 assembly (clang, -O0):
<nrf24_init>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <nrf24_setupPins@plt>
xor    %edi,%edi
call   1050 <nrf24_ce_digitalWrite@plt>
mov    $0x1,%edi
call   1030 <nrf24_csn_digitalWrite@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<nrf24_init>:
push   %rax
xor    %eax,%eax
call   1040 <nrf24_setupPins@plt>
xor    %edi,%edi
call   1050 <nrf24_ce_digitalWrite@plt>
mov    $0x1,%edi
pop    %rax
jmp    1030 <nrf24_csn_digitalWrite@plt>

LLVM IR (-O0):
define void @nrf24_init() {
%1 = call i32 (...) @nrf24_setupPins()
%2 = call i32 @nrf24_ce_digitalWrite(i32 0)
%3 = call i32 @nrf24_csn_digitalWrite(i32 1)
ret void
}

LLVM IR (-O2):
define void @nrf24_init() {
%1 = tail call i32 (...) @nrf24_setupPins()
%2 = tail call i32 @nrf24_ce_digitalWrite(i32 0)
%3 = tail call i32 @nrf24_csn_digitalWrite(i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ lcd_cmd_transmit(int);
void lcd_clear(void) {
  lcd_cmd_transmit(0x38);
  lcd_cmd_transmit(0x01);
  lcd_cmd_transmit(0x80);
  lcd_cmd_transmit(0x06);
}


x86 assembly (clang, -O0):
<lcd_clear>:
push   %rbp
mov    %rsp,%rbp
mov    $0x38,%edi
call   1030 <lcd_cmd_transmit@plt>
mov    $0x1,%edi
call   1030 <lcd_cmd_transmit@plt>
mov    $0x80,%edi
call   1030 <lcd_cmd_transmit@plt>
mov    $0x6,%edi
call   1030 <lcd_cmd_transmit@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<lcd_clear>:
push   %rax
mov    $0x38,%edi
call   1030 <lcd_cmd_transmit@plt>
mov    $0x1,%edi
call   1030 <lcd_cmd_transmit@plt>
mov    $0x80,%edi
call   1030 <lcd_cmd_transmit@plt>
mov    $0x6,%edi
pop    %rax
jmp    1030 <lcd_cmd_transmit@plt>

LLVM IR (-O0):
define void @lcd_clear() {
%1 = call i32 @lcd_cmd_transmit(i32 56)
%2 = call i32 @lcd_cmd_transmit(i32 1)
%3 = call i32 @lcd_cmd_transmit(i32 128)
%4 = call i32 @lcd_cmd_transmit(i32 6)
ret void
}

LLVM IR (-O2):
define void @lcd_clear() {
%1 = tail call i32 @lcd_cmd_transmit(i32 56)
%2 = tail call i32 @lcd_cmd_transmit(i32 1)
%3 = tail call i32 @lcd_cmd_transmit(i32 128)
%4 = tail call i32 @lcd_cmd_transmit(i32 6)
ret void
}
const char *rcsid(const char *p) {
  return rcsid(p = "@(#)$Id: softmagic.c 10 2006-07-10 18:22:27Z hyin $");
}


x86 assembly (clang, -O0):
<rcsid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rax
mov    %rax,-0x8(%rbp)
lea    0xed2(%rip),%rdi
call   1030 <rcsid@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rcsid>:
jmp    1100 <rcsid>

LLVM IR (-O0):
@.str = [52 x i8] c"@(#)$Id: softmagic.c 10 2006-07-10 18:22:27Z hyin $\00"
define i8* @rcsid(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
store i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0), i8** %2
%3 = call i8* @rcsid(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0))
ret i8* %3
}

LLVM IR (-O2):
define noalias i8* @rcsid(i8* nocapture readnone %0) {
br label %2
2: ; preds = %2, %1
br label %2
}
int PDC_set_cursor_mode(startrow, endrow)
int startrow;
int endrow;
{}


x86 assembly (clang, -O0):
<PDC_set_cursor_mode>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @PDC_set_cursor_mode(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = load i32, i32* %3
ret i32 %6
}

LLVM IR (-O2):
define i32 @PDC_set_cursor_mode(i32 %0, i32 %1) {
ret i32 undef
}
/* Variables and functions */
float getCortexBatteryLevel();
int getCortexBatteryStatus() {
  float cortexBatteryPercentage = getCortexBatteryLevel();
  if (cortexBatteryPercentage >= 106) {
    return 3;
  } else {
    if (cortexBatteryPercentage <= 50) {
      if (cortexBatteryPercentage <= 20) {
        return 2;
      } else {
        return 1;
      }
    } else {
      return 0;
    }
  }
}


x86 assembly (clang, -O0):
<getCortexBatteryStatus>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <getCortexBatteryLevel@plt>
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
movss  0xecf(%rip),%xmm1
ucomiss %xmm1,%xmm0
jb     1146 <getCortexBatteryStatus+0x36>
movl   $0x3,-0x4(%rbp)
jmp    1189 <getCortexBatteryStatus+0x79>
movss  0xeb6(%rip),%xmm0
ucomiss -0x8(%rbp),%xmm0
jb     1182 <getCortexBatteryStatus+0x72>
movss  0xea8(%rip),%xmm0
ucomiss -0x8(%rbp),%xmm0
jb     1176 <getCortexBatteryStatus+0x66>
movl   $0x2,-0x4(%rbp)
jmp    1189 <getCortexBatteryStatus+0x79>
movl   $0x1,-0x4(%rbp)
jmp    1189 <getCortexBatteryStatus+0x79>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getCortexBatteryStatus>:
push   %rax
xor    %eax,%eax
call   1030 <getCortexBatteryLevel@plt>
mov    $0x3,%eax
ucomiss 0xedc(%rip),%xmm0
jae    114b <getCortexBatteryStatus+0x3b>
movss  0xed6(%rip),%xmm1
ucomiss %xmm0,%xmm1
mov    $0x0,%eax
jb     114b <getCortexBatteryStatus+0x3b>
movss  0xec8(%rip),%xmm1
ucomiss %xmm0,%xmm1
mov    $0x2,%eax
sbb    $0x0,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @getCortexBatteryStatus() {
%1 = alloca i32
%2 = alloca float
%3 = call float (...) @getCortexBatteryLevel()
store float %3, float* %2
%4 = load float, float* %2
%5 = fcmp oge float %4, 1.060000e+02
br i1 %5, label %6, label %7
6: ; preds = %0
store i32 3, i32* %1
br label %16
7: ; preds = %0
%8 = load float, float* %2
%9 = fcmp ole float %8, 5.000000e+01
br i1 %9, label %10, label %15
10: ; preds = %7
%11 = load float, float* %2
%12 = fcmp ole float %11, 2.000000e+01
br i1 %12, label %13, label %14
13: ; preds = %10
store i32 2, i32* %1
br label %16
14: ; preds = %10
store i32 1, i32* %1
br label %16
15: ; preds = %7
store i32 0, i32* %1
br label %16
16: ; preds = %15, %14, %13, %6
%17 = load i32, i32* %1
ret i32 %17
}

LLVM IR (-O2):
define i32 @getCortexBatteryStatus() {
%1 = tail call float (...) @getCortexBatteryLevel()
%2 = fcmp ult float %1, 1.060000e+02
br i1 %2, label %3, label %8
3: ; preds = %0
%4 = fcmp ugt float %1, 5.000000e+01
br i1 %4, label %8, label %5
5: ; preds = %3
%6 = fcmp ugt float %1, 2.000000e+01
%7 = select i1 %6, i32 1, i32 2
br label %8
8: ; preds = %3, %5, %0
%9 = phi i32 [ 3, %0 ], [ %7, %5 ], [ 0, %3 ]
ret i32 %9
}
/* Variables and functions */
scalar_t__ EOF;
scalar_t__ getchar();
int /*<<< orphan*/ printf(char *, double);
main() {
  double nc;
  for (nc = 0; getchar() != EOF; ++nc)
    ;
  printf("%.0f\n", nc);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x10(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
mov    0x2ea3(%rip),%rcx
cmp    (%rcx),%rax
je     116a <main+0x4a>
jmp    1153 <main+0x33>
movsd  0xea5(%rip),%xmm0
addsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
jmp    1137 <main+0x17>
movsd  -0x10(%rbp),%xmm0
lea    0xe92(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
xor    %eax,%eax
call   1040 <getchar@plt>
mov    0x2eb5(%rip),%rbx
xorpd  %xmm0,%xmm0
cmp    (%rbx),%rax
je     1160 <main+0x40>
xorpd  %xmm0,%xmm0
addsd  0xeb8(%rip),%xmm0
movsd  %xmm0,0x8(%rsp)
xor    %eax,%eax
call   1040 <getchar@plt>
movsd  0x8(%rsp),%xmm0
cmp    (%rbx),%rax
jne    1140 <main+0x20>
lea    0xea1(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@EOF = global i64 0
@.str = [6 x i8] c"%.0f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
store i32 0, i32* %1
store double 0.000000e+00, double* %2
br label %3
3: ; preds = %8, %0
%4 = call i64 (...) @getchar()
%5 = load i64, i64* @EOF
%6 = icmp ne i64 %4, %5
br i1 %6, label %7, label %11
7: ; preds = %3
br label %8
8: ; preds = %7
%9 = load double, double* %2
%10 = fadd double %9, 1.000000e+00
store double %10, double* %2
br label %3
11: ; preds = %3
%12 = load double, double* %2
%13 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), double %12)
%14 = load i32, i32* %1
ret i32 %14
}

LLVM IR (-O2):
@EOF = global i64 0
@.str = [6 x i8] c"%.0f\0A\00"
define i32 @main() {
%1 = tail call i64 (...) @getchar()
%2 = load i64, i64* @EOF
%3 = icmp eq i64 %1, %2
br i1 %3, label %10, label %4
4: ; preds = %0, %4
%5 = phi double [ %6, %4 ], [ 0.000000e+00, %0 ]
%6 = fadd double %5, 1.000000e+00
%7 = tail call i64 (...) @getchar()
%8 = load i64, i64* @EOF
%9 = icmp eq i64 %7, %8
br i1 %9, label %10, label %4
10: ; preds = %4, %0
%11 = phi double [ 0.000000e+00, %0 ], [ %6, %4 ]
%12 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), double %11)
ret i32 0
}
void map_front(double x_in, double y_in, double *x_out, double *y_out,
               double *z_out) {
  *x_out = 1 - 2 * x_in;
  *y_out = -1;
  *z_out = 1 - 2 * y_in;
}


x86 assembly (clang, -O0):
<map_front>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
mov    %rdi,-0x18(%rbp)
mov    %rsi,-0x20(%rbp)
mov    %rdx,-0x28(%rbp)
movsd  -0x8(%rbp),%xmm1
addsd  %xmm1,%xmm1
movsd  0xed5(%rip),%xmm0
subsd  %xmm1,%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x20(%rbp),%rax
movsd  0xec5(%rip),%xmm0
movsd  %xmm0,(%rax)
movsd  -0x10(%rbp),%xmm1
addsd  %xmm1,%xmm1
movsd  0xea8(%rip),%xmm0
subsd  %xmm1,%xmm0
mov    -0x28(%rbp),%rax
movsd  %xmm0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<map_front>:
addsd  %xmm0,%xmm0
movsd  0xef4(%rip),%xmm2
movapd %xmm2,%xmm3
subsd  %xmm0,%xmm3
movsd  %xmm3,(%rdi)
movabs $0xbff0000000000000,%rax
mov    %rax,(%rsi)
addsd  %xmm1,%xmm1
subsd  %xmm1,%xmm2
movsd  %xmm2,(%rdx)
ret

LLVM IR (-O0):
define void @map_front(double %0, double %1, double* %2, double* %3, double* %4) {
%6 = alloca double
%7 = alloca double
%8 = alloca double*
%9 = alloca double*
%10 = alloca double*
store double %0, double* %6
store double %1, double* %7
store double* %2, double** %8
store double* %3, double** %9
store double* %4, double** %10
%11 = load double, double* %6
%12 = call double @llvm.fmuladd.f64(double -2.000000e+00, double %11, double 1.000000e+00)
%13 = load double*, double** %8
store double %12, double* %13
%14 = load double*, double** %9
store double -1.000000e+00, double* %14
%15 = load double, double* %7
%16 = call double @llvm.fmuladd.f64(double -2.000000e+00, double %15, double 1.000000e+00)
%17 = load double*, double** %10
store double %16, double* %17
ret void
}

LLVM IR (-O2):
define void @map_front(double %0, double %1, double* nocapture writeonly %2, double* nocapture writeonly %3, double* nocapture writeonly %4) {
%6 = tail call double @llvm.fmuladd.f64(double %0, double -2.000000e+00, double 1.000000e+00)
store double %6, double* %2
store double -1.000000e+00, double* %3
%7 = tail call double @llvm.fmuladd.f64(double %1, double -2.000000e+00, double 1.000000e+00)
store double %7, double* %4
ret void
}
void WeaponG3SG1_SecondaryFire(void) {}


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

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

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

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

/* Variables and functions */
int64_t av_compare_mod(uint64_t a, uint64_t b, uint64_t mod) {
  int64_t c = (a - b) & (mod - 1);
  if (c > (mod >> 1))
    c -= mod;
  return c;
}


x86 assembly (clang, -O0):
<av_compare_mod>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
sub    -0x8(%rbp),%eax
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
and    %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    -0xc(%rbp),%ecx
sar    $0x1,%ecx
cmp    %ecx,%eax
jle    113a <av_compare_mod+0x3a>
mov    -0xc(%rbp),%ecx
mov    -0x10(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<av_compare_mod>:
sub    %esi,%edi
lea    -0x1(%rdx),%eax
and    %edi,%eax
mov    %edx,%ecx
sar    %ecx
xor    %esi,%esi
cmp    %ecx,%eax
cmovg  %edx,%esi
sub    %esi,%eax
ret

LLVM IR (-O0):
define i32 @av_compare_mod(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i32, i32* %4
%9 = load i32, i32* %5
%10 = sub nsw i32 %8, %9
%11 = load i32, i32* %6
%12 = sub nsw i32 %11, 1
%13 = and i32 %10, %12
store i32 %13, i32* %7
%14 = load i32, i32* %7
%15 = load i32, i32* %6
%16 = ashr i32 %15, 1
%17 = icmp sgt i32 %14, %16
br i1 %17, label %18, label %22
18: ; preds = %3
%19 = load i32, i32* %6
%20 = load i32, i32* %7
%21 = sub nsw i32 %20, %19
store i32 %21, i32* %7
br label %22
22: ; preds = %18, %3
%23 = load i32, i32* %7
ret i32 %23
}

LLVM IR (-O2):
define i32 @av_compare_mod(i32 %0, i32 %1, i32 %2) {
%4 = sub nsw i32 %0, %1
%5 = add nsw i32 %2, -1
%6 = and i32 %5, %4
%7 = ashr i32 %2, 1
%8 = icmp sgt i32 %6, %7
%9 = select i1 %8, i32 %2, i32 0
%10 = sub nsw i32 %6, %9
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ add_extension(char *, char const *);
scalar_t__ file_exist(char *);
scalar_t__ strlen(char *);
int try_extension(char *filename, const char *ext) {
  int tend;
  tend = (int)strlen(filename);
  add_extension(filename, ext);
  if (file_exist(filename))
    return 1;
  filename[tend] = '\0';
  return 0;
}


x86 assembly (clang, -O0):
<try_extension>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <add_extension@plt>
mov    -0x10(%rbp),%rdi
call   1050 <file_exist@plt>
cmp    $0x0,%rax
je     1178 <try_extension+0x48>
movl   $0x1,-0x4(%rbp)
jmp    118b <try_extension+0x5b>
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<try_extension>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r15
mov    %rdi,%rbx
call   1030 <strlen@plt>
mov    %rax,%r14
mov    %rbx,%rdi
mov    %r15,%rsi
call   1040 <add_extension@plt>
mov    %rbx,%rdi
call   1050 <file_exist@plt>
mov    %rax,%rcx
mov    $0x1,%eax
test   %rcx,%rcx
jne    116c <try_extension+0x3c>
movslq %r14d,%rax
movb   $0x0,(%rbx,%rax,1)
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i32 @try_extension(i8* %0, i8* %1) {
%3 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%4 = tail call i32 @add_extension(i8* %0, i8* %1)
%5 = tail call i64 @file_exist(i8* %0)
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %11
7: ; preds = %2
%8 = shl i64 %3, 32
%9 = ashr exact i64 %8, 32
%10 = getelementptr inbounds i8, i8* %0, i64 %9
store i8 0, i8* %10
br label %11
11: ; preds = %2, %7
%12 = phi i32 [ 0, %7 ], [ 1, %2 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char);
void printing(char symbol, int howMany) {
  for (int i = 0; i < howMany; i++) {
    printf("%c", symbol);
  }
}


x86 assembly (clang, -O0):
<printing>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1152 <printing+0x42>
lea    0xec5(%rip),%rdi
movsbl -0x1(%rbp),%esi
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1128 <printing+0x18>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printing>:
push   %rbp
push   %r14
push   %rbx
test   %esi,%esi
jle    113f <printing+0x2f>
mov    %esi,%ebx
movsbl %dil,%ebp
lea    0xedb(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nop
mov    %r14,%rdi
mov    %ebp,%esi
call   1030 <printf@plt>
add    $0xffffffff,%ebx
jne    1130 <printing+0x20>
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%c\00"
define void @printing(i8 signext %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %5, label %4
4: ; preds = %5, %2
ret void
5: ; preds = %2, %5
%6 = phi i32 [ %8, %5 ], [ 0, %2 ]
%7 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext %0)
%8 = add nuw nsw i32 %6, 1
%9 = icmp eq i32 %8, %1
br i1 %9, label %4, label %5
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int main1() {
  int i;
  int ia[16];
  for (i = 0; i < 16; i++) {
    ia[i] = i;
  }
  for (i = 0; i < 16; i++) {
    if (ia[i] != i)
      abort();
  }
  return 0;
}


x86 assembly (clang, -O0):
<main1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
cmpl   $0x10,-0x4(%rbp)
jge    1142 <main1+0x32>
mov    -0x4(%rbp),%ecx
movslq -0x4(%rbp),%rax
mov    %ecx,-0x50(%rbp,%rax,4)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    111f <main1+0xf>
movl   $0x0,-0x4(%rbp)
cmpl   $0x10,-0x4(%rbp)
jge    117e <main1+0x6e>
movslq -0x4(%rbp),%rax
mov    -0x50(%rbp,%rax,4),%eax
cmp    -0x4(%rbp),%eax
je     116b <main1+0x5b>
mov    $0x0,%al
call   1030 <abort@plt>
jmp    1170 <main1+0x60>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1149 <main1+0x39>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main1() {
%1 = alloca i32
%2 = alloca [16 x i32]
store i32 0, i32* %1
br label %3
3: ; preds = %11, %0
%4 = load i32, i32* %1
%5 = icmp slt i32 %4, 16
br i1 %5, label %6, label %14
6: ; preds = %3
%7 = load i32, i32* %1
%8 = load i32, i32* %1
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds [16 x i32], [16 x i32]* %2, i64 0, i64 %9
store i32 %7, i32* %10
br label %11
11: ; preds = %6
%12 = load i32, i32* %1
%13 = add nsw i32 %12, 1
store i32 %13, i32* %1
br label %3
14: ; preds = %3
store i32 0, i32* %1
br label %15
15: ; preds = %28, %14
%16 = load i32, i32* %1
%17 = icmp slt i32 %16, 16
br i1 %17, label %18, label %31
18: ; preds = %15
%19 = load i32, i32* %1
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds [16 x i32], [16 x i32]* %2, i64 0, i64 %20
%22 = load i32, i32* %21
%23 = load i32, i32* %1
%24 = icmp ne i32 %22, %23
br i1 %24, label %25, label %27
25: ; preds = %18
%26 = call i32 (...) @abort()
unreachable
27: ; preds = %18
br label %28
28: ; preds = %27
%29 = load i32, i32* %1
%30 = add nsw i32 %29, 1
store i32 %30, i32* %1
br label %15
31: ; preds = %15
ret i32 0
}

LLVM IR (-O2):
define i32 @main1() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isxdigit(int);
void t_isxdigit_0xa8() {
  Assert_real((isxdigit(168) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isxdigit.c",
              845, ("isxdigit should be 0 for 0xa8"));
}


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

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

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

LLVM IR (-O2):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isxdigit.c\00"
@.str.1 = [30 x i8] c"isxdigit should be 0 for 0xa8\00"
define void @t_isxdigit_0xa8() {
%1 = tail call i64 @isxdigit(i32 168)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 845, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ add();
int /*<<< orphan*/ compute_rhs();
int /*<<< orphan*/ txinvr();
int /*<<< orphan*/ x_solve();
int /*<<< orphan*/ y_solve();
int /*<<< orphan*/ z_solve();
void adi(void) {
  compute_rhs();
  txinvr();
  x_solve();
  y_solve();
  z_solve();
  add();
}


x86 assembly (clang, -O0):
<adi>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <compute_rhs@plt>
mov    $0x0,%al
call   1060 <txinvr@plt>
mov    $0x0,%al
call   1070 <x_solve@plt>
mov    $0x0,%al
call   1050 <y_solve@plt>
mov    $0x0,%al
call   1080 <z_solve@plt>
mov    $0x0,%al
call   1030 <add@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<adi>:
push   %rax
xor    %eax,%eax
call   1040 <compute_rhs@plt>
xor    %eax,%eax
call   1060 <txinvr@plt>
xor    %eax,%eax
call   1070 <x_solve@plt>
xor    %eax,%eax
call   1050 <y_solve@plt>
xor    %eax,%eax
call   1080 <z_solve@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <add@plt>

LLVM IR (-O0):
define void @adi() {
%1 = call i32 (...) @compute_rhs()
%2 = call i32 (...) @txinvr()
%3 = call i32 (...) @x_solve()
%4 = call i32 (...) @y_solve()
%5 = call i32 (...) @z_solve()
%6 = call i32 (...) @add()
ret void
}

LLVM IR (-O2):
define void @adi() {
%1 = tail call i32 (...) @compute_rhs()
%2 = tail call i32 (...) @txinvr()
%3 = tail call i32 (...) @x_solve()
%4 = tail call i32 (...) @y_solve()
%5 = tail call i32 (...) @z_solve()
%6 = tail call i32 (...) @add()
ret void
}
/* Type definitions */
struct dyString {
  int dummy;
};

/* Variables and functions */
int receiveFtpReply(int, char *, struct dyString **, int *);
int /*<<< orphan*/ sendFtpCommandOnly(int, char *);
int sendFtpCommand(int sd, char *cmd, struct dyString **retReply,
                   int *retCode) {
  sendFtpCommandOnly(sd, cmd);
  return receiveFtpReply(sd, cmd, retReply, retCode);
}


x86 assembly (clang, -O0):
<sendFtpCommand>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1040 <sendFtpCommandOnly@plt>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
call   1030 <receiveFtpReply@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sendFtpCommand>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rcx,%r14
mov    %rdx,%r15
mov    %rsi,%rbx
mov    %edi,%ebp
call   1040 <sendFtpCommandOnly@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %r15,%rdx
mov    %r14,%rcx
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <receiveFtpReply@plt>

LLVM IR (-O0):
%struct.dyString = type { i32 }
define i32 @sendFtpCommand(i32 %0, i8* %1, %struct.dyString** %2, i32* %3) {
%5 = alloca i32
%6 = alloca i8*
%7 = alloca %struct.dyString**
%8 = alloca i32*
store i32 %0, i32* %5
store i8* %1, i8** %6
store %struct.dyString** %2, %struct.dyString*** %7
store i32* %3, i32** %8
%9 = load i32, i32* %5
%10 = load i8*, i8** %6
%11 = call i32 @sendFtpCommandOnly(i32 %9, i8* %10)
%12 = load i32, i32* %5
%13 = load i8*, i8** %6
%14 = load %struct.dyString**, %struct.dyString*** %7
%15 = load i32*, i32** %8
%16 = call i32 @receiveFtpReply(i32 %12, i8* %13, %struct.dyString** %14, i32* %15)
ret i32 %16
}

LLVM IR (-O2):
%struct.dyString = type { i32 }
define i32 @sendFtpCommand(i32 %0, i8* %1, %struct.dyString** %2, i32* %3) {
%5 = tail call i32 @sendFtpCommandOnly(i32 %0, i8* %1)
%6 = tail call i32 @receiveFtpReply(i32 %0, i8* %1, %struct.dyString** %2, i32* %3)
ret i32 %6
}
void enable_text(void) {}


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

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

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

LLVM IR (-O2):
define void @enable_text() {
ret void
}
void GetNotify(void *event) {
  __asm__ __volatile__("int $0x40" ::"a"(68), "b"(14), "c"(event));
}


x86 assembly (clang, -O0):
<GetNotify>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rcx
mov    $0x44,%eax
mov    $0xe,%ebx
int    $0x40
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<GetNotify>:
push   %rbx
mov    %rdi,%rcx
mov    $0x44,%eax
mov    $0xe,%ebx
int    $0x40
pop    %rbx
ret

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

LLVM IR (-O2):
define void @GetNotify(i8* %0) {
tail call void asm sideeffect "int $$0x40", "{ax},{bx},{cx},~{dirflag},~{fpsr},~{flags}"(i32 68, i32 14, i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ LOG_DAEMON;
int /*<<< orphan*/ LOG_NOTICE;
int /*<<< orphan*/ LOG_PID;
int /*<<< orphan*/ closelog();
int /*<<< orphan*/ openlog(char *, int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ syslog(int /*<<< orphan*/, char *, char *);
void puts_syslog(char *str) {
  openlog("kbdlog", LOG_PID, LOG_DAEMON);
  syslog(LOG_NOTICE, "%s", str);
  closelog();
}


x86 assembly (clang, -O0):
<puts_syslog>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2e95(%rip),%rax
mov    (%rax),%esi
mov    0x2e9c(%rip),%rax
mov    (%rax),%edx
lea    0xeab(%rip),%rdi
call   1050 <openlog@plt>
mov    0x2e6f(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xe99(%rip),%rsi
call   1040 <syslog@plt>
mov    $0x0,%al
call   1030 <closelog@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<puts_syslog>:
push   %rbx
mov    %rdi,%rbx
mov    0x2e9d(%rip),%rax
mov    (%rax),%esi
mov    0x2ea4(%rip),%rax
mov    (%rax),%edx
lea    0xeb3(%rip),%rdi
call   1050 <openlog@plt>
mov    0x2e77(%rip),%rax
mov    (%rax),%edi
lea    0xea5(%rip),%rsi
mov    %rbx,%rdx
call   1040 <syslog@plt>
xor    %eax,%eax
pop    %rbx
jmp    1030 <closelog@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"kbdlog\00"
@LOG_PID = global i32 0
@LOG_DAEMON = global i32 0
@LOG_NOTICE = global i32 0
@.str.1 = [3 x i8] c"%s\00"
define void @puts_syslog(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @LOG_PID
%4 = load i32, i32* @LOG_DAEMON
%5 = call i32 @openlog(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %3, i32 %4)
%6 = load i32, i32* @LOG_NOTICE
%7 = load i8*, i8** %2
%8 = call i32 @syslog(i32 %6, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %7)
%9 = call i32 (...) @closelog()
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"kbdlog\00"
@LOG_PID = global i32 0
@LOG_DAEMON = global i32 0
@LOG_NOTICE = global i32 0
@.str.1 = [3 x i8] c"%s\00"
define void @puts_syslog(i8* %0) {
%2 = load i32, i32* @LOG_PID
%3 = load i32, i32* @LOG_DAEMON
%4 = tail call i32 @openlog(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %2, i32 %3)
%5 = load i32, i32* @LOG_NOTICE
%6 = tail call i32 @syslog(i32 %5, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %0)
%7 = tail call i32 (...) @closelog()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(void) {
  volatile int i;
  printf("\nEntering the faulter program - I should die immediately\n");
  i = *(int *)0x40000000;
  printf("I didn't get killed!  Program has a bug\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [58 x i8] c"\0AEntering the faulter program - I should die immediately\0A\00"
@.str.1 = [41 x i8] c"I didn't get killed! Program has a bug\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @printf(i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* inttoptr (i64 1073741824 to i32*)
store volatile i32 %4, i32* %2
%5 = call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [57 x i8] c"\0AEntering the faulter program - I should die immediately\00"
@str.2 = [40 x i8] c"I didn't get killed! Program has a bug\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([57 x i8], [57 x i8]* @str, i64 0, i64 0))
%4 = load i32, i32* inttoptr (i64 1073741824 to i32*)
store volatile i32 %4, i32* %1
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @str.2, i64 0, i64 0))
ret i32 0
}
int main(void) {
  int a1 = 10;
  int b1 = 5;
  int c1 = 0;
  __asm__ __volatile__("imull %%ebx, %%eax\n" : "=a"(c1) : "a"(a1), "b"(b1));
  printf("wynik: %d\n", c1);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
sub    $0x18,%rsp
movl   $0x0,-0xc(%rbp)
movl   $0xa,-0x10(%rbp)
movl   $0x5,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x10(%rbp),%eax
mov    -0x14(%rbp),%ebx
imul   %ebx,%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%esi
lea    0xeb5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0xa,%eax
mov    $0x5,%ebx
imul   %ebx,%eax
lea    0xedb(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [11 x i8] c"wynik: %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
store i32 10, i32* %2
store i32 5, i32* %3
store i32 0, i32* %4
%5 = load i32, i32* %2
%6 = load i32, i32* %3
%7 = call i32 asm sideeffect "imull %ebx, %eax\0A", "={ax},{ax},{bx},~{dirflag},~{fpsr},~{flags}"(i32 %5, i32 %6)
store i32 %7, i32* %4
%8 = load i32, i32* %4
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %8)
ret i32 0
}

LLVM IR (-O2):
@.str = [11 x i8] c"wynik: %d\0A\00"
define i32 @main() {
%1 = tail call i32 asm sideeffect "imull %ebx, %eax\0A", "={ax},{ax},{bx},~{dirflag},~{fpsr},~{flags}"(i32 10, i32 5)
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t Sigma0(uint32_t x) {
  return (x >> 2 | x << 30) ^ (x >> 13 | x << 19) ^ (x >> 22 | x << 10);
}


x86 assembly (clang, -O0):
<Sigma0>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x2,%eax
mov    -0x4(%rbp),%ecx
shl    $0x1e,%ecx
or     %ecx,%eax
mov    -0x4(%rbp),%ecx
sar    $0xd,%ecx
mov    -0x4(%rbp),%edx
shl    $0x13,%edx
or     %edx,%ecx
xor    %ecx,%eax
mov    -0x4(%rbp),%ecx
sar    $0x16,%ecx
mov    -0x4(%rbp),%edx
shl    $0xa,%edx
or     %edx,%ecx
xor    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Sigma0>:
mov    %edi,%eax
sar    $0x2,%eax
mov    %edi,%ecx
shl    $0x1e,%ecx
or     %eax,%ecx
mov    %edi,%eax
sar    $0xd,%eax
mov    %edi,%edx
shl    $0x13,%edx
or     %eax,%edx
xor    %ecx,%edx
mov    %edi,%eax
sar    $0x16,%eax
shl    $0xa,%edi
or     %edi,%eax
xor    %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @Sigma0(i32 %0) {
%2 = ashr i32 %0, 2
%3 = shl i32 %0, 30
%4 = or i32 %2, %3
%5 = ashr i32 %0, 13
%6 = shl i32 %0, 19
%7 = or i32 %5, %6
%8 = xor i32 %4, %7
%9 = ashr i32 %0, 22
%10 = shl i32 %0, 10
%11 = or i32 %9, %10
%12 = xor i32 %8, %11
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ ___get_netmask(int);
int ___ip_switch(int /*<<< orphan*/);
int zget_netmask(int masklen) { return ___ip_switch(___get_netmask(masklen)); }


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

x86 assembly (clang, -O2):
<zget_netmask>:
push   %rax
call   1040 <___get_netmask@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <___ip_switch@plt>

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

LLVM IR (-O2):
define i32 @zget_netmask(i32 %0) {
%2 = tail call i32 @___get_netmask(i32 %0)
%3 = tail call i32 @___ip_switch(i32 %2)
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ c;

/* Variables and functions */
int tolower(int /*<<< orphan*/);
int toLower(int c) { return tolower((c)&0xff); }


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

x86 assembly (clang, -O2):
<toLower>:
movzbl %dil,%edi
jmp    1030 <tolower@plt>

LLVM IR (-O0):
define i32 @toLower(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 255
%5 = call i32 @tolower(i32 %4)
ret i32 %5
}

LLVM IR (-O2):
define i32 @toLower(i32 %0) {
%2 = and i32 %0, 255
%3 = tail call i32 @tolower(i32 %2)
ret i32 %3
}
/* Variables and functions */
int f(int *);
int main(int argc, char **argv) {
  int v = 0;
  return f(&v);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
lea    -0x14(%rbp),%rdi
call   1030 <f@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0x0,0x4(%rsp)
lea    0x4(%rsp),%rdi
call   1030 <f@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %6
%7 = call i32 @f(i32* %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
store i32 0, i32* %3
%5 = call i32 @f(i32* %3)
ret i32 %5
}