xunge/DecIR huggingface dataset:
/* Type definitions */
struct esp_rest {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ esp_rest_request(struct esp_rest *, char const *, char *,
                                    char const *, int /*<<< orphan*/);
int /*<<< orphan*/ strlen(char const *);
void esp_rest_post(struct esp_rest *er, const char *path, const char *data) {
  esp_rest_request(er, path, "POST", data, strlen(data));
}


x86 assembly (clang, -O0):
<esp_rest_post>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x30(%rbp),%rdi
mov    -0x28(%rbp),%rsi
mov    -0x20(%rbp),%rcx
mov    %eax,%r8d
lea    0xe95(%rip),%rdx
call   1030 <esp_rest_request@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<esp_rest_post>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%rbx
mov    %rsi,%r14
mov    %rdi,%r15
mov    %rdx,%rdi
call   1040 <strlen@plt>
lea    0xec3(%rip),%rdx
mov    %r15,%rdi
mov    %r14,%rsi
mov    %rbx,%rcx
mov    %eax,%r8d
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <esp_rest_request@plt>

LLVM IR (-O0):
%struct.esp_rest = type { i32 }
@.str = [5 x i8] c"POST\00"
define void @esp_rest_post(%struct.esp_rest* %0, i8* %1, i8* %2) {
%4 = alloca %struct.esp_rest*
%5 = alloca i8*
%6 = alloca i8*
store %struct.esp_rest* %0, %struct.esp_rest** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load %struct.esp_rest*, %struct.esp_rest** %4
%8 = load i8*, i8** %5
%9 = load i8*, i8** %6
%10 = load i8*, i8** %6
%11 = call i32 @strlen(i8* %10)
%12 = call i32 @esp_rest_request(%struct.esp_rest* %7, i8* %8, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %9, i32 %11)
ret void
}

LLVM IR (-O2):
%struct.esp_rest = type { i32 }
@.str = [5 x i8] c"POST\00"
define void @esp_rest_post(%struct.esp_rest* %0, i8* %1, i8* %2) {
%4 = tail call i32 @strlen(i8* %2)
%5 = tail call i32 @esp_rest_request(%struct.esp_rest* %0, i8* %1, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %2, i32 %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ clrscr();
main() {
  int i, j, k;
  int *a;
  int *fun1();
  int(*b)[4];
  int(*fun2())[4];
  int(*c)[3][4];
  int(*fun3())[3][4];
  int *p;
  int(*d)[2][3][4];
  int(*fun4())[2][3][4];
  clrscr();
  a = fun1();
  b = fun2();
  c = fun3();
  d = fun4();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    $0x0,%al
call   1050 <clrscr@plt>
mov    $0x0,%al
call   1060 <fun1@plt>
mov    %rax,-0x18(%rbp)
mov    $0x0,%al
call   1030 <fun2@plt>
mov    %rax,-0x20(%rbp)
mov    $0x0,%al
call   1070 <fun3@plt>
mov    %rax,-0x28(%rbp)
mov    $0x0,%al
call   1040 <fun4@plt>
mov    %rax,-0x38(%rbp)
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1050 <clrscr@plt>
xor    %eax,%eax
call   1060 <fun1@plt>
xor    %eax,%eax
call   1030 <fun2@plt>
xor    %eax,%eax
call   1070 <fun3@plt>
xor    %eax,%eax
call   1040 <fun4@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32*
%5 = alloca [4 x i32]*
%6 = alloca [3 x [4 x i32]]*
%7 = alloca i32*
%8 = alloca [2 x [3 x [4 x i32]]]*
%9 = call i32 (...) @clrscr()
%10 = call i32* (...) @fun1()
store i32* %10, i32** %4
%11 = call [4 x i32]* (...) @fun2()
store [4 x i32]* %11, [4 x i32]** %5
%12 = call [3 x [4 x i32]]* (...) @fun3()
store [3 x [4 x i32]]* %12, [3 x [4 x i32]]** %6
%13 = call [2 x [3 x [4 x i32]]]* (...) @fun4()
store [2 x [3 x [4 x i32]]]* %13, [2 x [3 x [4 x i32]]]** %8
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @clrscr()
%2 = tail call i32* (...) @fun1()
%3 = tail call [4 x i32]* (...) @fun2()
%4 = tail call [3 x [4 x i32]]* (...) @fun3()
%5 = tail call [2 x [3 x [4 x i32]]]* (...) @fun4()
ret i32 0
}
int ft_islower(int c) { return (c >= 'a' && c <= 'z'); }


x86 assembly (clang, -O0):
<ft_islower>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x61,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jl     1120 <ft_islower+0x20>
cmpl   $0x7a,-0x4(%rbp)
setle  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_islower>:
add    $0xffffff9f,%edi
xor    %eax,%eax
cmp    $0x1a,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @ft_islower(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 97
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 122
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ false, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @ft_islower(i32 %0) {
%2 = add i32 %0, -97
%3 = icmp ult i32 %2, 26
%4 = zext i1 %3 to i32
ret i32 %4
}
int lib_version(void) { return 1; }


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

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

LLVM IR (-O0):
define i32 @lib_version() {
ret i32 1
}

LLVM IR (-O2):
define i32 @lib_version() {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ USART_PutChar(unsigned char);
int /*<<< orphan*/ usbSendBytes(unsigned char *, int);
void PutChar(unsigned char c) {
  USART_PutChar(c);
  usbSendBytes(&c, 1);
}


x86 assembly (clang, -O0):
<PutChar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%edi
call   1040 <USART_PutChar@plt>
lea    -0x1(%rbp),%rdi
mov    $0x1,%esi
call   1030 <usbSendBytes@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PutChar>:
push   %rax
mov    %dil,0x7(%rsp)
call   1040 <USART_PutChar@plt>
lea    0x7(%rsp),%rdi
mov    $0x1,%esi
call   1030 <usbSendBytes@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @PutChar(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = call i32 @USART_PutChar(i8 zeroext %3)
%5 = call i32 @usbSendBytes(i8* %2, i32 1)
ret void
}

LLVM IR (-O2):
define void @PutChar(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = tail call i32 @USART_PutChar(i8 zeroext %0)
%4 = call i32 @usbSendBytes(i8* %2, i32 1)
ret void
}
int test_imm_7Fint8_reg(signed char val) {
  return ((val) & (0x7F << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_7Fint8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edx
and    $0x7f,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_7Fint8_reg>:
test   $0x7f,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_7Fint8_reg(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = and i32 %4, 127
%6 = icmp ne i32 %5, 0
%7 = zext i1 %6 to i64
%8 = select i1 %6, i32 -20, i32 -40
ret i32 %8
}

LLVM IR (-O2):
define i32 @test_imm_7Fint8_reg(i8 signext %0) {
%2 = and i8 %0, 127
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
double sin(double);
double sinC(double arg) {
  if (1.57079632679489661923 - (1.e-6) <= arg &&
      arg <= 1.57079632679489661923 + (1.e-6))
    return 1.;
  else
    return sin(arg);
}


x86 assembly (clang, -O0):
<sinC>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  0xed6(%rip),%xmm1
ucomisd %xmm1,%xmm0
jb     1159 <sinC+0x49>
movsd  0xecc(%rip),%xmm0
ucomisd -0x10(%rbp),%xmm0
jb     1159 <sinC+0x49>
movsd  0xec1(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1168 <sinC+0x58>
movsd  -0x10(%rbp),%xmm0
call   1030 <sin@plt>
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sinC>:
ucomisd 0xee8(%rip),%xmm0
jb     1131 <sinC+0x21>
movsd  0xee6(%rip),%xmm1
ucomisd %xmm0,%xmm1
jb     1131 <sinC+0x21>
movsd  0xee0(%rip),%xmm0
ret
jmp    1030 <sin@plt>

LLVM IR (-O0):
define double @sinC(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %3
%4 = load double, double* %3
%5 = fcmp ole double 0x3FF921FA47D4B30D, %4
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load double, double* %3
%8 = fcmp ole double %7, 0x3FF921FC60B3A723
br i1 %8, label %9, label %10
9: ; preds = %6
store double 1.000000e+00, double* %2
br label %13
10: ; preds = %6, %1
%11 = load double, double* %3
%12 = call double @sin(double %11)
store double %12, double* %2
br label %13
13: ; preds = %10, %9
%14 = load double, double* %2
ret double %14
}

LLVM IR (-O2):
define double @sinC(double %0) {
%2 = fcmp oge double %0, 0x3FF921FA47D4B30D
%3 = fcmp ole double %0, 0x3FF921FC60B3A723
%4 = and i1 %2, %3
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = tail call double @sin(double %0)
br label %7
7: ; preds = %1, %5
%8 = phi double [ %6, %5 ], [ 1.000000e+00, %1 ]
ret double %8
}
/* Variables and functions */
int /*<<< orphan*/ glutWireRhombicDodecahedron();
void drawWireRhombicDodecahedron(void) { glutWireRhombicDodecahedron(); }


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

x86 assembly (clang, -O2):
<drawWireRhombicDodecahedron>:
xor    %eax,%eax
jmp    1030 <glutWireRhombicDodecahedron@plt>

LLVM IR (-O0):
define void @drawWireRhombicDodecahedron() {
%1 = call i32 (...) @glutWireRhombicDodecahedron()
ret void
}

LLVM IR (-O2):
define void @drawWireRhombicDodecahedron() {
%1 = tail call i32 (...) @glutWireRhombicDodecahedron()
ret void
}
/* Type definitions */
typedef void *off_t;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ SEEK_END;
int /*<<< orphan*/ SEEK_SET;
int /*<<< orphan*/ fseeko(int /*<<< orphan*/ *, void *, int /*<<< orphan*/);
void *ftello(int /*<<< orphan*/ *);
long long fsize(FILE *f) {
  long long filesize;
  off_t cur_offset = ftello(f);
  fseeko(f, 0, SEEK_END);
  filesize = ftello(f);
  fseeko(f, cur_offset, SEEK_SET);
  return filesize;
}


x86 assembly (clang, -O0):
<fsize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <ftello@plt>
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2ea4(%rip),%rax
mov    (%rax),%edx
xor    %eax,%eax
mov    %eax,%esi
call   1040 <fseeko@plt>
mov    -0x8(%rbp),%rdi
call   1030 <ftello@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    0x2e6d(%rip),%rax
mov    (%rax),%edx
call   1040 <fseeko@plt>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fsize>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%rbx
call   1030 <ftello@plt>
mov    %rax,%r14
mov    0x2eb1(%rip),%rax
mov    (%rax),%edx
mov    %rbx,%rdi
xor    %esi,%esi
call   1040 <fseeko@plt>
mov    %rbx,%rdi
call   1030 <ftello@plt>
mov    %rax,%r15
mov    0x2e83(%rip),%rax
mov    (%rax),%edx
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <fseeko@plt>
mov    %r15,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@SEEK_END = global i32 0
@SEEK_SET = global i32 0
define i64 @fsize(i32* %0) {
%2 = alloca i32*
%3 = alloca i64
%4 = alloca i8*
store i32* %0, i32** %2
%5 = load i32*, i32** %2
%6 = call i8* @ftello(i32* %5)
store i8* %6, i8** %4
%7 = load i32*, i32** %2
%8 = load i32, i32* @SEEK_END
%9 = call i32 @fseeko(i32* %7, i8* null, i32 %8)
%10 = load i32*, i32** %2
%11 = call i8* @ftello(i32* %10)
%12 = ptrtoint i8* %11 to i64
store i64 %12, i64* %3
%13 = load i32*, i32** %2
%14 = load i8*, i8** %4
%15 = load i32, i32* @SEEK_SET
%16 = call i32 @fseeko(i32* %13, i8* %14, i32 %15)
%17 = load i64, i64* %3
ret i64 %17
}

LLVM IR (-O2):
@SEEK_END = global i32 0
@SEEK_SET = global i32 0
define i64 @fsize(i32* nocapture %0) {
%2 = tail call i8* @ftello(i32* %0)
%3 = load i32, i32* @SEEK_END
%4 = tail call i32 @fseeko(i32* %0, i8* null, i32 %3)
%5 = tail call i8* @ftello(i32* %0)
%6 = ptrtoint i8* %5 to i64
%7 = load i32, i32* @SEEK_SET
%8 = tail call i32 @fseeko(i32* %0, i8* %2, i32 %7)
ret i64 %6
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
FILE *fileOpenOrDie(char *file, char *mode) {
  FILE *f;
  f = fopen(file, "r+");
  if (!f) {
    fprintf(stderr, "Error opening %s: %m\n", file);
    exit(1);
  }
  return f;
}


x86 assembly (clang, -O0):
<fileOpenOrDie>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xeb5(%rip),%rsi
call   1040 <fopen@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1182 <fileOpenOrDie+0x52>
mov    0x2e7a(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xe90(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fileOpenOrDie>:
push   %rbx
mov    %rdi,%rbx
lea    0xec5(%rip),%rsi
call   1040 <fopen@plt>
test   %rax,%rax
je     1147 <fileOpenOrDie+0x17>
pop    %rbx
ret
mov    0x2e92(%rip),%rax
mov    (%rax),%edi
lea    0xeac(%rip),%rsi
mov    %rbx,%rdx
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"r+\00"
@stderr = global i32 0
@.str.1 = [22 x i8] c"Error opening %s: %m\0A\00"
define i32* @fileOpenOrDie(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32*
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
%7 = call i32* @fopen(i8* %6, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
store i32* %7, i32** %5
%8 = load i32*, i32** %5
%9 = icmp ne i32* %8, null
br i1 %9, label %15, label %10
10: ; preds = %2
%11 = load i32, i32* @stderr
%12 = load i8*, i8** %3
%13 = call i32 @fprintf(i32 %11, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i8* %12)
%14 = call i32 @exit(i32 1)
unreachable
15: ; preds = %2
%16 = load i32*, i32** %5
ret i32* %16
}

LLVM IR (-O2):
@.str = [3 x i8] c"r+\00"
@stderr = global i32 0
@.str.1 = [22 x i8] c"Error opening %s: %m\0A\00"
define noalias i32* @fileOpenOrDie(i8* %0, i8* nocapture readnone %1) {
%3 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%4 = icmp eq i32* %3, null
br i1 %4, label %5, label %9
5: ; preds = %2
%6 = load i32, i32* @stderr
%7 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i8* %0)
%8 = tail call i32 @exit(i32 1)
unreachable
9: ; preds = %2
ret i32* %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void show_version() {
  printf("ide-smart 1.4 - FREE Software with NO WARRANTY\n");
  printf("(C) 2001 Ragnar Hojland Espinosa <ragnar@ragnar-hojland.com>\n");
}


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

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

LLVM IR (-O0):
@.str = [48 x i8] c"ide-smart 1.4 - FREE Software with NO WARRANTY\0A\00"
@.str.1 = [62 x i8] c"(C) 2001 Ragnar Hojland Espinosa <ragnar@ragnar-hojland.com>\0A\00"
define void @show_version() {
%1 = call i32 @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [47 x i8] c"ide-smart 1.4 - FREE Software with NO WARRANTY\00"
@str.2 = [61 x i8] c"(C) 2001 Ragnar Hojland Espinosa <ragnar@ragnar-hojland.com>\00"
define void @show_version() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([47 x i8], [47 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([61 x i8], [61 x i8]* @str.2, i64 0, i64 0))
ret void
}
void dbg_remove_files(struct ci13xxx *ci) {}


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

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

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

LLVM IR (-O2):
%struct.ci13xxx = type opaque
define void @dbg_remove_files(%struct.ci13xxx* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fill_outgoing_packet_header(unsigned char *, int, int);
int fill_data_packet_header(unsigned char *buf, int body_len) {
  fill_outgoing_packet_header(buf, 0x44, body_len);
  return 6 + body_len;
}


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

x86 assembly (clang, -O2):
<fill_data_packet_header>:
push   %rbx
mov    %esi,%ebx
mov    $0x44,%esi
mov    %ebx,%edx
call   1030 <fill_outgoing_packet_header@plt>
add    $0x6,%ebx
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @fill_data_packet_header(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = load i32, i32* %4
%7 = call i32 @fill_outgoing_packet_header(i8* %5, i32 68, i32 %6)
%8 = load i32, i32* %4
%9 = add nsw i32 6, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @fill_data_packet_header(i8* %0, i32 %1) {
%3 = tail call i32 @fill_outgoing_packet_header(i8* %0, i32 68, i32 %1)
%4 = add nsw i32 %1, 6
ret i32 %4
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t OnesCount(uint32_t value) {
  value -= (value >> 1) & 0x55555555;
  value = ((value >> 2) & 0x33333333) + (value & 0x33333333);
  value = ((value >> 4) + value) & 0x0f0f0f0f;
  value += value >> 8;
  value += value >> 16;
  return value & 0x0000003f;
}


x86 assembly (clang, -O0):
<OnesCount>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
sar    $0x1,%ecx
and    $0x55555555,%ecx
mov    -0x4(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x2,%eax
and    $0x33333333,%eax
mov    -0x4(%rbp),%ecx
and    $0x33333333,%ecx
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x4,%eax
add    -0x4(%rbp),%eax
and    $0xf0f0f0f,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x8,%eax
add    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x10,%eax
add    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x3f,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<OnesCount>:
mov    %edi,%eax
shr    %eax
and    $0x55555555,%eax
sub    %eax,%edi
mov    %edi,%eax
shr    $0x2,%eax
and    $0x33333333,%eax
and    $0x33333333,%edi
add    %eax,%edi
mov    %edi,%eax
shr    $0x4,%eax
add    %edi,%eax
and    $0xf0f0f0f,%eax
mov    %eax,%ecx
shr    $0x8,%ecx
add    %eax,%ecx
mov    %ecx,%eax
shr    $0x10,%eax
add    %ecx,%eax
movzbl %al,%eax
ret

LLVM IR (-O0):
define i32 @OnesCount(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = ashr i32 %3, 1
%5 = and i32 %4, 1431655765
%6 = load i32, i32* %2
%7 = sub nsw i32 %6, %5
store i32 %7, i32* %2
%8 = load i32, i32* %2
%9 = ashr i32 %8, 2
%10 = and i32 %9, 858993459
%11 = load i32, i32* %2
%12 = and i32 %11, 858993459
%13 = add nsw i32 %10, %12
store i32 %13, i32* %2
%14 = load i32, i32* %2
%15 = ashr i32 %14, 4
%16 = load i32, i32* %2
%17 = add nsw i32 %15, %16
%18 = and i32 %17, 252645135
store i32 %18, i32* %2
%19 = load i32, i32* %2
%20 = ashr i32 %19, 8
%21 = load i32, i32* %2
%22 = add nsw i32 %21, %20
store i32 %22, i32* %2
%23 = load i32, i32* %2
%24 = ashr i32 %23, 16
%25 = load i32, i32* %2
%26 = add nsw i32 %25, %24
store i32 %26, i32* %2
%27 = load i32, i32* %2
%28 = and i32 %27, 63
ret i32 %28
}

LLVM IR (-O2):
define i32 @OnesCount(i32 %0) {
%2 = lshr i32 %0, 1
%3 = and i32 %2, 1431655765
%4 = sub nsw i32 %0, %3
%5 = lshr i32 %4, 2
%6 = and i32 %5, 858993459
%7 = and i32 %4, 858993459
%8 = add nuw nsw i32 %6, %7
%9 = lshr i32 %8, 4
%10 = add nuw nsw i32 %9, %8
%11 = and i32 %10, 252645135
%12 = lshr i32 %11, 8
%13 = add nuw nsw i32 %12, %11
%14 = lshr i32 %13, 16
%15 = add nuw nsw i32 %14, %13
%16 = and i32 %15, 63
ret i32 %16
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ *fgets(char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ stdin;
int main(int argc, char *argv[]) {
  char buffer[10];
  int i = 0;
  while (fgets(buffer, 10, stdin) != NULL) {
    i++;
    if (i > 1000000) {
      exit(0);
    }
  }
  return 0;
}


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,-0x20(%rbp)
lea    -0x1a(%rbp),%rdi
mov    0x2ea0(%rip),%rax
mov    (%rax),%edx
mov    $0xa,%esi
call   1030 <fgets@plt>
cmp    $0x0,%rax
je     1180 <main+0x60>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
cmpl   $0xf4240,-0x20(%rbp)
jle    117b <main+0x5b>
xor    %edi,%edi
call   1040 <exit@plt>
jmp    113d <main+0x1d>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    $0xf4241,%ebp
mov    0x2eb4(%rip),%r14
lea    0x6(%rsp),%rbx
nopl   0x0(%rax)
mov    (%r14),%edx
mov    %rbx,%rdi
mov    $0xa,%esi
call   1030 <fgets@plt>
test   %rax,%rax
je     1161 <main+0x41>
add    $0xffffffff,%ebp
jne    1140 <main+0x20>
xor    %edi,%edi
call   1040 <exit@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@stdin = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [10 x i8]
%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 = %20, %2
%9 = getelementptr inbounds [10 x i8], [10 x i8]* %6, i64 0, i64 0
%10 = load i32, i32* @stdin
%11 = call i32* @fgets(i8* %9, i32 10, i32 %10)
%12 = icmp ne i32* %11, null
br i1 %12, label %13, label %21
13: ; preds = %8
%14 = load i32, i32* %7
%15 = add nsw i32 %14, 1
store i32 %15, i32* %7
%16 = load i32, i32* %7
%17 = icmp sgt i32 %16, 1000000
br i1 %17, label %18, label %20
18: ; preds = %13
%19 = call i32 @exit(i32 0)
unreachable
20: ; preds = %13
br label %8
21: ; preds = %8
ret i32 0
}

LLVM IR (-O2):
@stdin = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [10 x i8]
%4 = getelementptr inbounds [10 x i8], [10 x i8]* %3, i64 0, i64 0
br label %5
5: ; preds = %10, %2
%6 = phi i32 [ 0, %2 ], [ %11, %10 ]
%7 = load i32, i32* @stdin
%8 = call i32* @fgets(i8* %4, i32 10, i32 %7)
%9 = icmp eq i32* %8, null
br i1 %9, label %15, label %10
10: ; preds = %5
%11 = add nuw nsw i32 %6, 1
%12 = icmp eq i32 %11, 1000001
br i1 %12, label %13, label %5
13: ; preds = %10
%14 = call i32 @exit(i32 0)
unreachable
15: ; preds = %5
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ enter_menu();
int /*<<< orphan*/ lose_sound();
int /*<<< orphan*/ print_lose();
void snake_lose() {
  print_lose();
  lose_sound();
  enter_menu();
}


x86 assembly (clang, -O0):
<snake_lose>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1050 <print_lose@plt>
mov    $0x0,%al
call   1040 <lose_sound@plt>
mov    $0x0,%al
call   1030 <enter_menu@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<snake_lose>:
push   %rax
xor    %eax,%eax
call   1050 <print_lose@plt>
xor    %eax,%eax
call   1040 <lose_sound@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <enter_menu@plt>

LLVM IR (-O0):
define void @snake_lose() {
%1 = call i32 (...) @print_lose()
%2 = call i32 (...) @lose_sound()
%3 = call i32 (...) @enter_menu()
ret void
}

LLVM IR (-O2):
define void @snake_lose() {
%1 = tail call i32 (...) @print_lose()
%2 = tail call i32 (...) @lose_sound()
%3 = tail call i32 (...) @enter_menu()
ret void
}
char a_minus(char c) {
  if (c >= 'A' && c <= 'Z')
    return c + 'a' - 'A';
  return c;
}


x86 assembly (clang, -O0):
<a_minus>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x2(%rbp)
movsbl -0x2(%rbp),%eax
cmp    $0x41,%eax
jl     1136 <a_minus+0x36>
movsbl -0x2(%rbp),%eax
cmp    $0x5a,%eax
jg     1136 <a_minus+0x36>
movsbl -0x2(%rbp),%eax
add    $0x61,%eax
sub    $0x41,%eax
mov    %al,-0x1(%rbp)
jmp    113c <a_minus+0x3c>
mov    -0x2(%rbp),%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<a_minus>:
lea    -0x41(%rdi),%eax
lea    0x20(%rdi),%ecx
cmp    $0x1a,%al
movzbl %cl,%eax
cmovae %edi,%eax
ret

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

LLVM IR (-O2):
define signext i8 @a_minus(i8 signext %0) {
%2 = add i8 %0, -65
%3 = icmp ult i8 %2, 26
%4 = add i8 %0, 32
%5 = select i1 %3, i8 %4, i8 %0
ret i8 %5
}
/* Variables and functions */
int /*<<< orphan*/ dot_product(double *, double *, size_t);
double sqrt(int /*<<< orphan*/);
double norm(double vec[], size_t len) {
  return sqrt(dot_product(vec, vec, len));
}


x86 assembly (clang, -O0):
<norm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
call   1030 <dot_product@plt>
mov    %eax,%edi
call   1040 <sqrt@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<norm>:
push   %rax
mov    %rsi,%rdx
mov    %rdi,%rsi
call   1030 <dot_product@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <sqrt@plt>

LLVM IR (-O0):
define double @norm(double* %0, i64 %1) {
%3 = alloca double*
%4 = alloca i64
store double* %0, double** %3
store i64 %1, i64* %4
%5 = load double*, double** %3
%6 = load double*, double** %3
%7 = load i64, i64* %4
%8 = call i32 @dot_product(double* %5, double* %6, i64 %7)
%9 = call double @sqrt(i32 %8)
ret double %9
}

LLVM IR (-O2):
define double @norm(double* %0, i64 %1) {
%3 = tail call i32 @dot_product(double* %0, double* %0, i64 %1)
%4 = tail call double @sqrt(i32 %3)
ret double %4
}
char rotateL_fun_char(char x, int i) {
  if ((i %= 8) == 0)
    return x;
  return (x << i) | ((0x7f >> (7 - i)) & (x >> (8 - i)));
}


x86 assembly (clang, -O0):
<rotateL_fun_char>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x2(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
mov    %edx,-0x8(%rbp)
cmp    $0x0,%edx
jne    112f <rotateL_fun_char+0x2f>
mov    -0x2(%rbp),%al
mov    %al,-0x1(%rbp)
jmp    1162 <rotateL_fun_char+0x62>
movsbl -0x2(%rbp),%eax
mov    -0x8(%rbp),%ecx
shl    %cl,%eax
mov    $0x7,%ecx
sub    -0x8(%rbp),%ecx
mov    $0x7f,%edx
sar    %cl,%edx
mov    %edx,-0xc(%rbp)
movsbl -0x2(%rbp),%edx
mov    $0x8,%ecx
sub    -0x8(%rbp),%ecx
sar    %cl,%edx
mov    -0xc(%rbp),%ecx
and    %edx,%ecx
or     %ecx,%eax
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rotateL_fun_char>:
mov    %edi,%eax
lea    0x7(%rsi),%ecx
test   %esi,%esi
cmovns %esi,%ecx
and    $0xfffffff8,%ecx
sub    %ecx,%esi
je     1131 <rotateL_fun_char+0x31>
movsbl %al,%eax
mov    %eax,%edx
mov    %esi,%ecx
shl    %cl,%edx
mov    $0x7,%cl
sub    %sil,%cl
mov    $0x7f,%edi
shr    %cl,%edi
mov    $0x8,%cl
sub    %sil,%cl
sar    %cl,%eax
and    %edi,%eax
or     %edx,%eax
ret

LLVM IR (-O0):
define signext i8 @rotateL_fun_char(i8 signext %0, i32 %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
store i8 %0, i8* %4
store i32 %1, i32* %5
%6 = load i32, i32* %5
%7 = srem i32 %6, 8
store i32 %7, i32* %5
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = load i8, i8* %4
store i8 %10, i8* %3
br label %27
11: ; preds = %2
%12 = load i8, i8* %4
%13 = sext i8 %12 to i32
%14 = load i32, i32* %5
%15 = shl i32 %13, %14
%16 = load i32, i32* %5
%17 = sub nsw i32 7, %16
%18 = ashr i32 127, %17
%19 = load i8, i8* %4
%20 = sext i8 %19 to i32
%21 = load i32, i32* %5
%22 = sub nsw i32 8, %21
%23 = ashr i32 %20, %22
%24 = and i32 %18, %23
%25 = or i32 %15, %24
%26 = trunc i32 %25 to i8
store i8 %26, i8* %3
br label %27
27: ; preds = %11, %9
%28 = load i8, i8* %3
ret i8 %28
}

LLVM IR (-O2):
define signext i8 @rotateL_fun_char(i8 signext %0, i32 %1) {
%3 = srem i32 %1, 8
%4 = icmp eq i32 %3, 0
br i1 %4, label %15, label %5
5: ; preds = %2
%6 = sext i8 %0 to i32
%7 = shl nsw i32 %6, %3
%8 = sub nsw i32 7, %3
%9 = lshr i32 127, %8
%10 = sub nsw i32 8, %3
%11 = ashr i32 %6, %10
%12 = and i32 %9, %11
%13 = or i32 %12, %7
%14 = trunc i32 %13 to i8
br label %15
15: ; preds = %2, %5
%16 = phi i8 [ %14, %5 ], [ %0, %2 ]
ret i8 %16
}
/* Variables and functions */
int tolower(int);
int _tolower(int c) { return tolower(c); }


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

x86 assembly (clang, -O2):
<_tolower>:
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 = call i32 @tolower(i32 %3)
ret i32 %4
}

LLVM IR (-O2):
define i32 @_tolower(i32 %0) {
%2 = tail call i32 @tolower(i32 %0)
ret i32 %2
}
unsigned long long w_rev_qword(unsigned long long q) {
  unsigned long long rev_q = 0;
  unsigned long long mask = 0x00000000000000FF;
  unsigned char temp_b;
  temp_b = q & mask;
  rev_q += temp_b;
  int i, step;
  for (i = 0, step = 8; i < 7; i++, step += 8) {
    rev_q <<= 8;
    mask <<= 8;
    temp_b = (unsigned char)((q & mask) >> step);
    rev_q += temp_b;
  }
}


x86 assembly (clang, -O0):
<w_rev_qword>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
movq   $0xff,-0x20(%rbp)
mov    -0x10(%rbp),%rax
and    -0x20(%rbp),%rax
mov    %al,-0x21(%rbp)
movzbl -0x21(%rbp),%eax
add    -0x18(%rbp),%rax
mov    %rax,-0x18(%rbp)
movl   $0x0,-0x28(%rbp)
movl   $0x8,-0x2c(%rbp)
cmpl   $0x7,-0x28(%rbp)
jge    1193 <w_rev_qword+0x93>
mov    -0x18(%rbp),%rax
shl    $0x8,%rax
mov    %rax,-0x18(%rbp)
mov    -0x20(%rbp),%rax
shl    $0x8,%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
and    -0x20(%rbp),%rax
mov    -0x2c(%rbp),%ecx
shr    %cl,%rax
mov    %al,-0x21(%rbp)
movzbl -0x21(%rbp),%eax
add    -0x18(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
mov    -0x2c(%rbp),%eax
add    $0x8,%eax
mov    %eax,-0x2c(%rbp)
jmp    113d <w_rev_qword+0x3d>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

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

LLVM IR (-O0):
define i64 @w_rev_qword(i64 %0) {
%2 = alloca i64
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
%6 = alloca i8
%7 = alloca i32
%8 = alloca i32
store i64 %0, i64* %3
store i64 0, i64* %4
store i64 255, i64* %5
%9 = load i64, i64* %3
%10 = load i64, i64* %5
%11 = and i64 %9, %10
%12 = trunc i64 %11 to i8
store i8 %12, i8* %6
%13 = load i8, i8* %6
%14 = zext i8 %13 to i64
%15 = load i64, i64* %4
%16 = add i64 %15, %14
store i64 %16, i64* %4
store i32 0, i32* %7
store i32 8, i32* %8
br label %17
17: ; preds = %36, %1
%18 = load i32, i32* %7
%19 = icmp slt i32 %18, 7
br i1 %19, label %20, label %41
20: ; preds = %17
%21 = load i64, i64* %4
%22 = shl i64 %21, 8
store i64 %22, i64* %4
%23 = load i64, i64* %5
%24 = shl i64 %23, 8
store i64 %24, i64* %5
%25 = load i64, i64* %3
%26 = load i64, i64* %5
%27 = and i64 %25, %26
%28 = load i32, i32* %8
%29 = zext i32 %28 to i64
%30 = lshr i64 %27, %29
%31 = trunc i64 %30 to i8
store i8 %31, i8* %6
%32 = load i8, i8* %6
%33 = zext i8 %32 to i64
%34 = load i64, i64* %4
%35 = add i64 %34, %33
store i64 %35, i64* %4
br label %36
36: ; preds = %20
%37 = load i32, i32* %7
%38 = add nsw i32 %37, 1
store i32 %38, i32* %7
%39 = load i32, i32* %8
%40 = add nsw i32 %39, 8
store i32 %40, i32* %8
br label %17
41: ; preds = %17
%42 = load i64, i64* %2
ret i64 %42
}

LLVM IR (-O2):
define i64 @w_rev_qword(i64 %0) {
ret i64 undef
}
/* Variables and functions */
scalar_t__ match(char *, char *);
int /*<<< orphan*/ puts(char *);
void test(char *first, char *second) {
  match(first, second) ? puts("Yes") : puts("No");
}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <match@plt>
cmp    $0x0,%rax
je     1158 <test+0x38>
lea    0xeb2(%rip),%rdi
call   1030 <puts@plt>
jmp    1164 <test+0x44>
lea    0xea5(%rip),%rdi
call   1030 <puts@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test>:
push   %rax
call   1040 <match@plt>
test   %rax,%rax
lea    0xed4(%rip),%rax
lea    0xec9(%rip),%rdi
cmove  %rax,%rdi
pop    %rax
jmp    1030 <puts@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"Yes\00"
@.str.1 = [3 x i8] c"No\00"
define void @test(i8* %0, i8* %1) {
%3 = tail call i64 @match(i8* %0, i8* %1)
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0)
%6 = tail call i32 @puts(i8* dereferenceable(1) %5)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ultoa(long, char *, int);
void ltoa(long value, char *string, int radix) {
  if (value < 0 && radix == 10) {
    *string++ = '-';
    ultoa(-value, string, radix);
  } else {
    ultoa(value, string, radix);
  }
}


x86 assembly (clang, -O0):
<ltoa>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
cmpq   $0x0,-0x8(%rbp)
jge    1163 <ltoa+0x53>
cmpl   $0xa,-0x14(%rbp)
jne    1163 <ltoa+0x53>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movb   $0x2d,(%rax)
xor    %eax,%eax
mov    %eax,%edi
sub    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <ultoa@plt>
jmp    1173 <ltoa+0x63>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <ultoa@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ltoa>:
test   %rdi,%rdi
jns    1129 <ltoa+0x19>
cmp    $0xa,%edx
jne    1129 <ltoa+0x19>
movb   $0x2d,(%rsi)
add    $0x1,%rsi
neg    %rdi
mov    $0xa,%edx
jmp    1030 <ultoa@plt>

LLVM IR (-O0):
define void @ltoa(i64 %0, i8* %1, i32 %2) {
%4 = alloca i64
%5 = alloca i8*
%6 = alloca i32
store i64 %0, i64* %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i64, i64* %4
%8 = icmp slt i64 %7, 0
br i1 %8, label %9, label %20
9: ; preds = %3
%10 = load i32, i32* %6
%11 = icmp eq i32 %10, 10
br i1 %11, label %12, label %20
12: ; preds = %9
%13 = load i8*, i8** %5
%14 = getelementptr inbounds i8, i8* %13, i32 1
store i8* %14, i8** %5
store i8 45, i8* %13
%15 = load i64, i64* %4
%16 = sub nsw i64 0, %15
%17 = load i8*, i8** %5
%18 = load i32, i32* %6
%19 = call i32 @ultoa(i64 %16, i8* %17, i32 %18)
br label %25
20: ; preds = %9, %3
%21 = load i64, i64* %4
%22 = load i8*, i8** %5
%23 = load i32, i32* %6
%24 = call i32 @ultoa(i64 %21, i8* %22, i32 %23)
br label %25
25: ; preds = %20, %12
ret void
}

LLVM IR (-O2):
define void @ltoa(i64 %0, i8* %1, i32 %2) {
%4 = icmp slt i64 %0, 0
%5 = icmp eq i32 %2, 10
%6 = and i1 %4, %5
br i1 %6, label %7, label %11
7: ; preds = %3
%8 = getelementptr inbounds i8, i8* %1, i64 1
store i8 45, i8* %1
%9 = sub nsw i64 0, %0
%10 = tail call i32 @ultoa(i64 %9, i8* %8, i32 10)
br label %13
11: ; preds = %3
%12 = tail call i32 @ultoa(i64 %0, i8* %1, i32 %2)
br label %13
13: ; preds = %11, %7
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, double);
int /*<<< orphan*/ scanf(char *, double *, double *);
int main(void) {
  double lados, comprimento;
  scanf("%lf %lf", &lados, &comprimento);
  printf("%.0f\n", lados * comprimento);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x10(%rbp),%rsi
lea    -0x18(%rbp),%rdx
call   1040 <scanf@plt>
movsd  -0x10(%rbp),%xmm0
mulsd  -0x18(%rbp),%xmm0
lea    0xeb4(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
lea    0xed5(%rip),%rdi
lea    0x10(%rsp),%rsi
lea    0x8(%rsp),%rdx
call   1040 <scanf@plt>
movsd  0x10(%rsp),%xmm0
mulsd  0x8(%rsp),%xmm0
lea    0xebb(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

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

LLVM IR (-O2):
@.str = [8 x i8] c"%lf %lf\00"
@.str.1 = [6 x i8] c"%.0f\0A\00"
define i32 @main() {
%1 = alloca double
%2 = alloca double
%3 = bitcast double* %1 to i8*
%4 = bitcast double* %2 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), double* %1, double* %2)
%6 = load double, double* %1
%7 = load double, double* %2
%8 = fmul double %6, %7
%9 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), double %8)
ret i32 0
}
void init_add_rel_pixel_span_funcs_c(void) {}


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

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

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

LLVM IR (-O2):
define void @init_add_rel_pixel_span_funcs_c() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_commands() {
  printf("Valid commands are:\n");
  printf("quit\n");
  printf("list\n");
  printf("show <email_address>\n");
  printf("paths <email_address>\n");
}


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

x86 assembly (clang, -O2):
<print_commands>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xef0(%rip),%rdi
call   1030 <puts@plt>
lea    0xee9(%rip),%rdi
call   1030 <puts@plt>
lea    0xee2(%rip),%rdi
call   1030 <puts@plt>
lea    0xeeb(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [21 x i8] c"Valid commands are:\0A\00"
@.str.1 = [6 x i8] c"quit\0A\00"
@.str.2 = [6 x i8] c"list\0A\00"
@.str.3 = [22 x i8] c"show <email_address>\0A\00"
@.str.4 = [23 x i8] c"paths <email_address>\0A\00"
define void @print_commands() {
%1 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.3, i64 0, i64 0))
%5 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.4, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [20 x i8] c"Valid commands are:\00"
@str.5 = [5 x i8] c"quit\00"
@str.6 = [5 x i8] c"list\00"
@str.7 = [21 x i8] c"show <email_address>\00"
@str.8 = [22 x i8] c"paths <email_address>\00"
define void @print_commands() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str.5, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str.6, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str.7, i64 0, i64 0))
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str.8, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ log_dummy_message();
int main() { log_dummy_message(); }


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @log_dummy_message()
ret i32 0
}
void unwind_init(void) {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ ASSERT(int);
uint32_t ADCPhaseDelayGet(uint32_t ui32Base) {
  ASSERT((ui32Base == 0x40038000) || (ui32Base == 0x40039000));
  return ((*((volatile uint32_t *)(ui32Base + 0x00000024))));
}


x86 assembly (clang, -O0):
<ADCPhaseDelayGet>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x1,%al
cmpl   $0x40038000,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     113a <ADCPhaseDelayGet+0x2a>
cmpl   $0x40039000,-0x4(%rbp)
sete   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <ASSERT@plt>
mov    -0x4(%rbp),%eax
add    $0x24,%eax
cltq
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ADCPhaseDelayGet>:
push   %rbx
mov    %edi,%ebx
mov    %edi,%eax
and    $0xffffefff,%eax
xor    %edi,%edi
cmp    $0x40038000,%eax
sete   %dil
call   1030 <ASSERT@plt>
movslq %ebx,%rax
mov    0x24(%rax),%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @ADCPhaseDelayGet(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 1073971200
br i1 %4, label %8, label %5
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp eq i32 %6, 1073975296
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ true, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i32
%11 = call i32 @ASSERT(i32 %10)
%12 = load i32, i32* %2
%13 = add nsw i32 %12, 36
%14 = sext i32 %13 to i64
%15 = inttoptr i64 %14 to i32*
%16 = load volatile i32, i32* %15
ret i32 %16
}

LLVM IR (-O2):
define i32 @ADCPhaseDelayGet(i32 %0) {
%2 = and i32 %0, -4097
%3 = icmp eq i32 %2, 1073971200
%4 = zext i1 %3 to i32
%5 = tail call i32 @ASSERT(i32 %4)
%6 = add nsw i32 %0, 36
%7 = sext i32 %6 to i64
%8 = inttoptr i64 %7 to i32*
%9 = load volatile i32, i32* %8
ret i32 %9
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_mutex_t;

/* Variables and functions */
int /*<<< orphan*/ pthread_mutex_lock(int /*<<< orphan*/ *);
int /*<<< orphan*/ pthread_mutex_unlock(int /*<<< orphan*/ *);
int testAndSet(int *var, int value, pthread_mutex_t *lock) {
  pthread_mutex_lock(lock);
  int oldValue = *var;
  *var = value;
  pthread_mutex_unlock(lock);
  return oldValue;
}


x86 assembly (clang, -O0):
<testAndSet>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <pthread_mutex_lock@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x1c(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x18(%rbp),%rdi
call   1030 <pthread_mutex_unlock@plt>
mov    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<testAndSet>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rdx,%rbx
mov    %esi,%r14d
mov    %rdi,%rbp
mov    %rdx,%rdi
call   1040 <pthread_mutex_lock@plt>
mov    0x0(%rbp),%r15d
mov    %r14d,0x0(%rbp)
mov    %rbx,%rdi
call   1030 <pthread_mutex_unlock@plt>
mov    %r15d,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @testAndSet(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** %6
%9 = call i32 @pthread_mutex_lock(i32* %8)
%10 = load i32*, i32** %4
%11 = load i32, i32* %10
store i32 %11, i32* %7
%12 = load i32, i32* %5
%13 = load i32*, i32** %4
store i32 %12, i32* %13
%14 = load i32*, i32** %6
%15 = call i32 @pthread_mutex_unlock(i32* %14)
%16 = load i32, i32* %7
ret i32 %16
}

LLVM IR (-O2):
define i32 @testAndSet(i32* nocapture %0, i32 %1, i32* %2) {
%4 = tail call i32 @pthread_mutex_lock(i32* %2)
%5 = load i32, i32* %0
store i32 %1, i32* %0
%6 = tail call i32 @pthread_mutex_unlock(i32* %2)
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ off_t;

/* Variables and functions */
int /*<<< orphan*/ __SYSCALL_LL_E(int /*<<< orphan*/);
int __syscall(int, int, int /*<<< orphan*/, int /*<<< orphan*/,
              int /*<<< orphan*/);
int posix_fallocate(int fd, off_t base, off_t len) {
  return -__syscall(352, fd, 0, __SYSCALL_LL_E(base), __SYSCALL_LL_E(len));
}


x86 assembly (clang, -O0):
<posix_fallocate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%edi
call   1040 <__SYSCALL_LL_E@plt>
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%edi
call   1040 <__SYSCALL_LL_E@plt>
mov    -0x14(%rbp),%esi
mov    -0x10(%rbp),%ecx
mov    %eax,%r8d
mov    $0x160,%edi
xor    %edx,%edx
call   1030 <__syscall@plt>
mov    %eax,%ecx
xor    %eax,%eax
sub    %ecx,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<posix_fallocate>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%ebx
mov    %edi,%r14d
mov    %esi,%edi
call   1040 <__SYSCALL_LL_E@plt>
mov    %eax,%ebp
mov    %ebx,%edi
call   1040 <__SYSCALL_LL_E@plt>
mov    $0x160,%edi
mov    %r14d,%esi
xor    %edx,%edx
mov    %ebp,%ecx
mov    %eax,%r8d
call   1030 <__syscall@plt>
neg    %eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @posix_fallocate(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load i32, i32* %5
%9 = call i32 @__SYSCALL_LL_E(i32 %8)
%10 = load i32, i32* %6
%11 = call i32 @__SYSCALL_LL_E(i32 %10)
%12 = call i32 @__syscall(i32 352, i32 %7, i32 0, i32 %9, i32 %11)
%13 = sub nsw i32 0, %12
ret i32 %13
}

LLVM IR (-O2):
define i32 @posix_fallocate(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @__SYSCALL_LL_E(i32 %1)
%5 = tail call i32 @__SYSCALL_LL_E(i32 %2)
%6 = tail call i32 @__syscall(i32 352, i32 %0, i32 0, i32 %4, i32 %5)
%7 = sub nsw i32 0, %6
ret i32 %7
}