xunge/DecIR huggingface dataset:
/* Variables and functions */
scalar_t__ isupper(int);
int tolower(int c) {
  if (isupper(c)) {
    return (c - 0x20);
  } else {
    return c;
  }
}


x86 assembly (clang, -O0):
<tolower>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <isupper@plt>
cmp    $0x0,%rax
je     113b <tolower+0x2b>
mov    -0x8(%rbp),%eax
sub    $0x20,%eax
mov    %eax,-0x4(%rbp)
jmp    1141 <tolower+0x31>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tolower>:
push   %rbx
mov    %edi,%ebx
call   1030 <isupper@plt>
lea    -0x20(%rbx),%ecx
test   %rax,%rax
cmove  %ebx,%ecx
mov    %ecx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @tolower(i32 %0) {
%2 = tail call i64 @isupper(i32 %0)
%3 = icmp eq i64 %2, 0
%4 = add nsw i32 %0, -32
%5 = select i1 %3, i32 %0, i32 %4
ret i32 %5
}
unsigned int I2CSlaveIntRawStatus(unsigned int baseAdd) {
  return (((*((volatile unsigned int *)(baseAdd + (0x24))))));
}


x86 assembly (clang, -O0):
<I2CSlaveIntRawStatus>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x24,%eax
mov    %eax,%eax
mov    (%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<I2CSlaveIntRawStatus>:
add    $0x24,%edi
mov    (%rdi),%eax
ret

LLVM IR (-O0):
define i32 @I2CSlaveIntRawStatus(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add i32 %3, 36
%5 = zext i32 %4 to i64
%6 = inttoptr i64 %5 to i32*
%7 = load volatile i32, i32* %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @I2CSlaveIntRawStatus(i32 %0) {
%2 = add i32 %0, 36
%3 = zext i32 %2 to i64
%4 = inttoptr i64 %3 to i32*
%5 = load volatile i32, i32* %4
ret i32 %5
}
int calculateTriangularNumber(int n) {
  int i, triangularNumber = 0;
  for (i = 1; i <= n; ++i)
    triangularNumber += i;
  return triangularNumber;
}


x86 assembly (clang, -O0):
<calculateTriangularNumber>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x1,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jg     1138 <calculateTriangularNumber+0x38>
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1115 <calculateTriangularNumber+0x15>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<calculateTriangularNumber>:
test   %edi,%edi
jle    1118 <calculateTriangularNumber+0x18>
lea    -0x1(%rdi),%eax
lea    -0x2(%rdi),%ecx
imul   %rax,%rcx
shr    %rcx
lea    (%rcx,%rdi,2),%eax
add    $0xffffffff,%eax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @calculateTriangularNumber(i32 %0) {
%2 = icmp slt i32 %0, 1
br i1 %2, label %14, label %3
3: ; preds = %1
%4 = shl nuw i32 %0, 1
%5 = add nsw i32 %0, -1
%6 = zext i32 %5 to i33
%7 = add nsw i32 %0, -2
%8 = zext i32 %7 to i33
%9 = mul i33 %6, %8
%10 = lshr i33 %9, 1
%11 = trunc i33 %10 to i32
%12 = add i32 %4, %11
%13 = add i32 %12, -1
br label %14
14: ; preds = %3, %1
%15 = phi i32 [ 0, %1 ], [ %13, %3 ]
ret i32 %15
}
unsigned char ADCFIFOLvlGet(unsigned long ulBase, unsigned long ulChannel) {
  unsigned long ulOffset;
  ulOffset = 0x00000094 + ulChannel;
  return ((*((volatile unsigned long *)(ulBase + ulOffset))) & 0x7);
}


x86 assembly (clang, -O0):
<ADCFIFOLvlGet>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x94,%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
add    -0x18(%rbp),%rax
mov    (%rax),%rax
and    $0x7,%rax
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ADCFIFOLvlGet>:
mov    0x94(%rdi,%rsi,1),%rax
and    $0x7,%al
ret

LLVM IR (-O0):
define zeroext i8 @ADCFIFOLvlGet(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%6 = load i64, i64* %4
%7 = add i64 148, %6
store i64 %7, i64* %5
%8 = load i64, i64* %3
%9 = load i64, i64* %5
%10 = add i64 %8, %9
%11 = inttoptr i64 %10 to i64*
%12 = load volatile i64, i64* %11
%13 = and i64 %12, 7
%14 = trunc i64 %13 to i8
ret i8 %14
}

LLVM IR (-O2):
define zeroext i8 @ADCFIFOLvlGet(i64 %0, i64 %1) {
%3 = add i64 %0, 148
%4 = add i64 %3, %1
%5 = inttoptr i64 %4 to i64*
%6 = load volatile i64, i64* %5
%7 = trunc i64 %6 to i8
%8 = and i8 %7, 7
ret i8 %8
}
/* Variables and functions */
int fn_sq_ch_79_ch_98_ch_106_ch_101_ch_99_ch_116_ch_80_ch_114_ch_111_ch_112_ch_101_ch_114_ch_116_ch_121(
    char const *);
int fn_al_sq_ch_79_ch_98_ch_106_ch_101_ch_99_ch_116_ch_80_ch_114_ch_111_ch_112_ch_101_ch_114_ch_116_ch_121(
    const char *text) {
  int pos = 0;
  pos =
      fn_sq_ch_79_ch_98_ch_106_ch_101_ch_99_ch_116_ch_80_ch_114_ch_111_ch_112_ch_101_ch_114_ch_116_ch_121(
          text);
  if (pos != -1)
    return pos;
  return -1;
}


x86 assembly (clang, -O0):
<fn_al_sq_ch_79_ch_98_ch_106_ch_101_ch_99_ch_116_ch_80_ch_114_ch_111_ch_112_ch_101_ch_114_ch_116_ch_121>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <fn_sq_ch_79_ch_98_ch_106_ch_101_ch_99_ch_116_ch_80_ch_114_ch_111_ch_112_ch_101_ch_114_ch_116_ch_121@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0xffffffff,-0x14(%rbp)
je     1144 <fn_al_sq_ch_79_ch_98_ch_106_ch_101_ch_99_ch_116_ch_80_ch_114_ch_111_ch_112_ch_101_ch_114_ch_116_ch_121+0x34>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    114b <fn_al_sq_ch_79_ch_98_ch_106_ch_101_ch_99_ch_116_ch_80_ch_114_ch_111_ch_112_ch_101_ch_114_ch_116_ch_121+0x3b>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fn_al_sq_ch_79_ch_98_ch_106_ch_101_ch_99_ch_116_ch_80_ch_114_ch_111_ch_112_ch_101_ch_114_ch_116_ch_121>:
jmp    1030 <fn_sq_ch_79_ch_98_ch_106_ch_101_ch_99_ch_116_ch_80_ch_114_ch_111_ch_112_ch_101_ch_114_ch_116_ch_121@plt>

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

LLVM IR (-O2):
define i32 @fn_al_sq_ch_79_ch_98_ch_106_ch_101_ch_99_ch_116_ch_80_ch_114_ch_111_ch_112_ch_101_ch_114_ch_116_ch_121(i8* %0) {
%2 = tail call i32 @fn_sq_ch_79_ch_98_ch_106_ch_101_ch_99_ch_116_ch_80_ch_114_ch_111_ch_112_ch_101_ch_114_ch_116_ch_121(i8* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
int net_close(int sock) { close(sock); }


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

x86 assembly (clang, -O2):
<net_close>:
jmp    1030 <close@plt>

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

LLVM IR (-O2):
define i32 @net_close(i32 %0) {
%2 = tail call i32 @close(i32 %0)
ret i32 undef
}
int multiplicacion(int numero1, int numero2) { return numero1 * numero2; }


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

x86 assembly (clang, -O2):
<multiplicacion>:
mov    %edi,%eax
imul   %esi,%eax
ret

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

LLVM IR (-O2):
define i32 @multiplicacion(i32 %0, i32 %1) {
%3 = mul nsw i32 %1, %0
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ isprint(int);
void t_isprint_0x26() {
  Assert_real((isprint(38)),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isprint.c",
              195, ("isprint should be 1 for &"));
}


x86 assembly (clang, -O0):
<t_isprint_0x26>:
push   %rbp
mov    %rsp,%rbp
mov    $0x26,%edi
call   1030 <isprint@plt>
mov    %eax,%edi
lea    0xec9(%rip),%rsi
mov    $0xc3,%edx
lea    0xf65(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isprint_0x26>:
push   %rax
mov    $0x26,%edi
call   1030 <isprint@plt>
lea    0xece(%rip),%rsi
lea    0xf6f(%rip),%rcx
mov    %eax,%edi
mov    $0xc3,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isprint.c\00"
@.str.1 = [26 x i8] c"isprint should be 1 for &\00"
define void @t_isprint_0x26() {
%1 = call i32 @isprint(i32 38)
%2 = call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 195, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isprint.c\00"
@.str.1 = [26 x i8] c"isprint should be 1 for &\00"
define void @t_isprint_0x26() {
%1 = tail call i32 @isprint(i32 38)
%2 = tail call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 195, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
scalar_t__ malloc(int);
char *pa_parsenum(char *numstr) {
  char *number;
  number = (char *)malloc(10 * sizeof(char));
  number[0] = '\0';
  return number;
}


x86 assembly (clang, -O0):
<pa_parsenum>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0xa,%edi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pa_parsenum>:
push   %rax
mov    $0xa,%edi
call   1030 <malloc@plt>
movb   $0x0,(%rax)
pop    %rcx
ret

LLVM IR (-O0):
define i8* @pa_parsenum(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = call i64 @malloc(i32 10)
%5 = inttoptr i64 %4 to i8*
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = getelementptr inbounds i8, i8* %6, i64 0
store i8 0, i8* %7
%8 = load i8*, i8** %3
ret i8* %8
}

LLVM IR (-O2):
define i8* @pa_parsenum(i8* nocapture readnone %0) {
%2 = tail call i64 @malloc(i32 10)
%3 = inttoptr i64 %2 to i8*
store i8 0, i8* %3
ret i8* %3
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
int /*<<< orphan*/ mp2vstart_init(int *, int);
void mp2vseqdx_init(uint8_t *p_mp2vseq) {
  mp2vstart_init(p_mp2vseq, 0xb5);
  p_mp2vseq[4] = (2 << 4) & 0xf0;
}


x86 assembly (clang, -O0):
<mp2vseqdx_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0xb5,%esi
call   1030 <mp2vstart_init@plt>
mov    -0x8(%rbp),%rax
movl   $0x20,0x10(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mp2vseqdx_init>:
push   %rbx
mov    %rdi,%rbx
mov    $0xb5,%esi
call   1030 <mp2vstart_init@plt>
movl   $0x20,0x10(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @mp2vseqdx_init(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @mp2vstart_init(i32* %3, i32 181)
%5 = load i32*, i32** %2
%6 = getelementptr inbounds i32, i32* %5, i64 4
store i32 32, i32* %6
ret void
}

LLVM IR (-O2):
define void @mp2vseqdx_init(i32* %0) {
%2 = tail call i32 @mp2vstart_init(i32* %0, i32 181)
%3 = getelementptr inbounds i32, i32* %0, i64 4
store i32 32, i32* %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
int /*<<< orphan*/ printf(char *, char *);
void alt_tbl_free(void *ptr) {
  printf("%s\n", "alt_tbl_free");
  free(ptr);
}


x86 assembly (clang, -O0):
<alt_tbl_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xecd(%rip),%rdi
lea    0xeca(%rip),%rsi
call   1040 <printf@plt>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<alt_tbl_free>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rdi
lea    0xed2(%rip),%rsi
call   1040 <printf@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [13 x i8] c"alt_tbl_free\00"
define void @alt_tbl_free(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i32 @free(i8* %4)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [13 x i8] c"alt_tbl_free\00"
define void @alt_tbl_free(i8* nocapture %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @free(i8* %0)
ret void
}
/* Type definitions */
typedef int uint16_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void print_mod_uint16_t(uint16_t m) { printf("K:=GF(%u);\n", m); }


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

x86 assembly (clang, -O2):
<print_mod_uint16_t>:
mov    %edi,%esi
lea    0xee7(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"K:=GF(%u);\0A\00"
define void @print_mod_uint16_t(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %3)
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"K:=GF(%u);\0A\00"
define void @print_mod_uint16_t(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
int maxProfitK(int k, int *prices, int pricesSize) { return 0; }


x86 assembly (clang, -O0):
<maxProfitK>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @maxProfitK(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
ret i32 0
}

LLVM IR (-O2):
define i32 @maxProfitK(i32 %0, i32* nocapture readnone %1, i32 %2) {
ret i32 0
}
/* Type definitions */
struct timeval {
  float tv_sec;
  scalar_t__ tv_usec;
};

/* Variables and functions */
float time_diff(struct timeval time1, struct timeval time2) {
  return time2.tv_sec - time1.tv_sec +
         ((float)(time2.tv_usec - time1.tv_usec)) / 1000000;
}


x86 assembly (clang, -O0):
<time_diff>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x10(%rbp)
mov    %rdi,-0x8(%rbp)
movss  %xmm1,-0x20(%rbp)
mov    %rsi,-0x18(%rbp)
movss  -0x20(%rbp),%xmm0
subss  -0x10(%rbp),%xmm0
mov    -0x18(%rbp),%rax
sub    -0x8(%rbp),%rax
cvtsi2ss %rax,%xmm1
movss  0xecb(%rip),%xmm2
divss  %xmm2,%xmm1
addss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<time_diff>:
sub    %rdi,%rsi
cvtsi2ss %rsi,%xmm2
subss  %xmm0,%xmm1
divss  0xeec(%rip),%xmm2
addss  %xmm1,%xmm2
movaps %xmm2,%xmm0
ret

LLVM IR (-O0):
%struct.timeval = type { float, i64 }
define float @time_diff(float %0, i64 %1, float %2, i64 %3) {
%5 = alloca %struct.timeval
%6 = alloca %struct.timeval
%7 = bitcast %struct.timeval* %5 to { float, i64 }*
%8 = getelementptr inbounds { float, i64 }, { float, i64 }* %7, i32 0, i32 0
store float %0, float* %8
%9 = getelementptr inbounds { float, i64 }, { float, i64 }* %7, i32 0, i32 1
store i64 %1, i64* %9
%10 = bitcast %struct.timeval* %6 to { float, i64 }*
%11 = getelementptr inbounds { float, i64 }, { float, i64 }* %10, i32 0, i32 0
store float %2, float* %11
%12 = getelementptr inbounds { float, i64 }, { float, i64 }* %10, i32 0, i32 1
store i64 %3, i64* %12
%13 = getelementptr inbounds %struct.timeval, %struct.timeval* %6, i32 0, i32 0
%14 = load float, float* %13
%15 = getelementptr inbounds %struct.timeval, %struct.timeval* %5, i32 0, i32 0
%16 = load float, float* %15
%17 = fsub float %14, %16
%18 = getelementptr inbounds %struct.timeval, %struct.timeval* %6, i32 0, i32 1
%19 = load i64, i64* %18
%20 = getelementptr inbounds %struct.timeval, %struct.timeval* %5, i32 0, i32 1
%21 = load i64, i64* %20
%22 = sub nsw i64 %19, %21
%23 = sitofp i64 %22 to float
%24 = fdiv float %23, 1.000000e+06
%25 = fadd float %17, %24
ret float %25
}

LLVM IR (-O2):
define float @time_diff(float %0, i64 %1, float %2, i64 %3) {
%5 = fsub float %2, %0
%6 = sub nsw i64 %3, %1
%7 = sitofp i64 %6 to float
%8 = fdiv float %7, 1.000000e+06
%9 = fadd float %5, %8
ret float %9
}
void log_info(char *fmt, ...) {}


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

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

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

LLVM IR (-O2):
define void @log_info(i8* nocapture %0, ...) {
ret void
}
/* Variables and functions */
double acosh(double);
double c_acosh(double arg0) { return acosh(arg0); }


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

x86 assembly (clang, -O2):
<c_acosh>:
jmp    1030 <acosh@plt>

LLVM IR (-O0):
define double @c_acosh(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call double @acosh(double %3)
ret double %4
}

LLVM IR (-O2):
define double @c_acosh(double %0) {
%2 = tail call double @acosh(double %0)
ret double %2
}
/* Variables and functions */
int /*<<< orphan*/ C67_asm(char *, int, int /*<<< orphan*/, int /*<<< orphan*/);
void C67_LDBU_SP_A0(int r) { C67_asm("LDBU.D *+SP[A0]", r, 0, 0); }


x86 assembly (clang, -O0):
<C67_LDBU_SP_A0>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xedb(%rip),%rdi
xor    %ecx,%ecx
mov    %ecx,%edx
call   1030 <C67_asm@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<C67_LDBU_SP_A0>:
mov    %edi,%esi
lea    0xee7(%rip),%rdi
xor    %edx,%edx
xor    %ecx,%ecx
jmp    1030 <C67_asm@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"LDBU.D *+SP[A0]\00"
define void @C67_LDBU_SP_A0(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @C67_asm(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %3, i32 0, i32 0)
ret void
}

LLVM IR (-O2):
@.str = [16 x i8] c"LDBU.D *+SP[A0]\00"
define void @C67_LDBU_SP_A0(i32 %0) {
%2 = tail call i32 @C67_asm(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %0, i32 0, i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(unsigned int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void THArgCheck(unsigned condition, unsigned x, char *msg) {
  if (condition)
    return;
  fprintf(stderr, "illegal argument: %s\n", msg);
  assert(condition);
}


x86 assembly (clang, -O0):
<THArgCheck>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1141 <THArgCheck+0x21>
jmp    1162 <THArgCheck+0x42>
mov    0x2e98(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rdx
lea    0xeab(%rip),%rsi
call   1040 <fprintf@plt>
mov    -0x4(%rbp),%edi
call   1030 <assert@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<THArgCheck>:
test   %edi,%edi
je     1125 <THArgCheck+0x5>
ret
push   %rax
mov    0x2eb3(%rip),%rax
mov    (%rax),%edi
lea    0xeca(%rip),%rsi
call   1040 <fprintf@plt>
xor    %edi,%edi
pop    %rax
jmp    1030 <assert@plt>

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

LLVM IR (-O2):
@stderr = global i32 0
@.str = [22 x i8] c"illegal argument: %s\0A\00"
define void @THArgCheck(i32 %0, i32 %1, i8* %2) {
%4 = icmp eq i32 %0, 0
br i1 %4, label %5, label %9
5: ; preds = %3
%6 = load i32, i32* @stderr
%7 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* %2)
%8 = tail call i32 @assert(i32 0)
br label %9
9: ; preds = %3, %5
ret void
}
/* Variables and functions */
int /*<<< orphan*/ arm_memio_immdh_op();
int /*<<< orphan*/ arm_memio_strh(int /*<<< orphan*/);
void arm_strh_imm() { arm_memio_strh(arm_memio_immdh_op()); }


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

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

LLVM IR (-O0):
define void @arm_strh_imm() {
%1 = call i32 (...) @arm_memio_immdh_op()
%2 = call i32 @arm_memio_strh(i32 %1)
ret void
}

LLVM IR (-O2):
define void @arm_strh_imm() {
%1 = tail call i32 (...) @arm_memio_immdh_op()
%2 = tail call i32 @arm_memio_strh(i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("Hola Mundo!!");
  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>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [13 x i8] c"Hola Mundo!!\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [13 x i8] c"Hola Mundo!!\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
void callx5_again(void) {
  x5();
  asm("call "
      "x6");
}


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

x86 assembly (clang, -O2):
<callx5_again>:
push   %rax
xor    %eax,%eax
call   1040 <x5@plt>
call   1030 <x6@plt>
pop    %rax
ret

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

LLVM IR (-O2):
define void @callx5_again() {
%1 = tail call i32 (...) @x5()
tail call void asm sideeffect "call x6", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
int gcd(int a, int b) {
  int r0 = a;
  int r1 = b;
  int gcd_ab;
  while (1) {
    int q2 = r0 / r1;
    int r2 = r0 - r1 * q2;
    r0 = r1, r1 = r2;
    if (r2 == 0) {
      gcd_ab = r0;
      break;
    }
  }
  return gcd_ab;
}


x86 assembly (clang, -O0):
<gcd>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
cltd
idivl  -0x10(%rbp)
mov    %eax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
mov    -0x10(%rbp),%ecx
imul   -0x18(%rbp),%ecx
sub    %ecx,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x1c(%rbp),%eax
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x1c(%rbp)
jne    1150 <gcd+0x50>
mov    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
jmp    1155 <gcd+0x55>
jmp    1116 <gcd+0x16>
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<gcd>:
mov    %esi,%edx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %edi,%eax
mov    %edx,%edi
cltd
idiv   %edi
test   %edx,%edx
jne    1110 <gcd+0x10>
mov    %edi,%eax
ret

LLVM IR (-O0):
define i32 @gcd(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%10 = load i32, i32* %3
store i32 %10, i32* %5
%11 = load i32, i32* %4
store i32 %11, i32* %6
br label %12
12: ; preds = %2, %27
%13 = load i32, i32* %5
%14 = load i32, i32* %6
%15 = sdiv i32 %13, %14
store i32 %15, i32* %8
%16 = load i32, i32* %5
%17 = load i32, i32* %6
%18 = load i32, i32* %8
%19 = mul nsw i32 %17, %18
%20 = sub nsw i32 %16, %19
store i32 %20, i32* %9
%21 = load i32, i32* %6
store i32 %21, i32* %5
%22 = load i32, i32* %9
store i32 %22, i32* %6
%23 = load i32, i32* %9
%24 = icmp eq i32 %23, 0
br i1 %24, label %25, label %27
25: ; preds = %12
%26 = load i32, i32* %5
store i32 %26, i32* %7
br label %28
27: ; preds = %12
br label %12
28: ; preds = %25
%29 = load i32, i32* %7
ret i32 %29
}

LLVM IR (-O2):
define i32 @gcd(i32 %0, i32 %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i32 [ %1, %2 ], [ %6, %3 ]
%5 = phi i32 [ %0, %2 ], [ %4, %3 ]
%6 = srem i32 %5, %4
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %3
8: ; preds = %3
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ IntDisable(int);
int /*<<< orphan*/ IntUnregister(int);
void HibernateIntUnregister(void) {
  IntDisable(59);
  IntUnregister(59);
}


x86 assembly (clang, -O0):
<HibernateIntUnregister>:
push   %rbp
mov    %rsp,%rbp
mov    $0x3b,%edi
call   1030 <IntDisable@plt>
mov    $0x3b,%edi
call   1040 <IntUnregister@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<HibernateIntUnregister>:
push   %rax
mov    $0x3b,%edi
call   1030 <IntDisable@plt>
mov    $0x3b,%edi
pop    %rax
jmp    1040 <IntUnregister@plt>

LLVM IR (-O0):
define void @HibernateIntUnregister() {
%1 = call i32 @IntDisable(i32 59)
%2 = call i32 @IntUnregister(i32 59)
ret void
}

LLVM IR (-O2):
define void @HibernateIntUnregister() {
%1 = tail call i32 @IntDisable(i32 59)
%2 = tail call i32 @IntUnregister(i32 59)
ret void
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  unsigned long serial;
};
typedef TYPE_1__ XReparentEvent;

/* Variables and functions */
void set_XReparentEvent_serial(void *_p, unsigned long _v) {
  ((XReparentEvent *)_p)->serial = (unsigned long)_v;
}


x86 assembly (clang, -O0):
<set_XReparentEvent_serial>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_XReparentEvent_serial>:
mov    %rsi,(%rdi)
ret

LLVM IR (-O0):
%struct.TYPE_2__ = type { i64 }
define void @set_XReparentEvent_serial(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to %struct.TYPE_2__*
%8 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %7, i32 0, i32 0
store i64 %5, i64* %8
ret void
}

LLVM IR (-O2):
define void @set_XReparentEvent_serial(i8* nocapture writeonly %0, i64 %1) {
%3 = bitcast i8* %0 to i64*
store i64 %1, i64* %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EBADF;
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ __set_errno(int /*<<< orphan*/);
int __close(int fd) {
  if (fd < 0) {
    __set_errno(EBADF);
    return -1;
  }
  __set_errno(ENOSYS);
  return -1;
}


x86 assembly (clang, -O0):
<__close>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    113f <__close+0x2f>
mov    0x2eac(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1154 <__close+0x44>
mov    0x2ea2(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__close>:
push   %rax
test   %edi,%edi
jns    111e <__close+0xe>
mov    0x2ebc(%rip),%rax
jmp    1125 <__close+0x15>
mov    0x2ec3(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@EBADF = global i32 0
@ENOSYS = global i32 0
define i32 @__close(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp slt i32 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load i32, i32* @EBADF
%8 = call i32 @__set_errno(i32 %7)
store i32 -1, i32* %2
br label %12
9: ; preds = %1
%10 = load i32, i32* @ENOSYS
%11 = call i32 @__set_errno(i32 %10)
store i32 -1, i32* %2
br label %12
12: ; preds = %9, %6
%13 = load i32, i32* %2
ret i32 %13
}

LLVM IR (-O2):
@EBADF = global i32 0
@ENOSYS = global i32 0
define i32 @__close(i32 %0) {
%2 = icmp slt i32 %0, 0
%3 = load i32, i32* @EBADF
%4 = load i32, i32* @ENOSYS
%5 = select i1 %2, i32 %3, i32 %4
%6 = tail call i32 @__set_errno(i32 %5)
ret i32 -1
}
/* Type definitions */
typedef int /*<<< orphan*/ volatile uint16_t;

/* Variables and functions */
uint16_t read16(const void *addr) { return *(volatile uint16_t *)addr; }


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

x86 assembly (clang, -O2):
<read16>:
mov    (%rdi),%eax
ret

LLVM IR (-O0):
define i32 @read16(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to i32*
%5 = load volatile i32, i32* %4
ret i32 %5
}

LLVM IR (-O2):
define i32 @read16(i8* %0) {
%2 = bitcast i8* %0 to i32*
%3 = load volatile i32, i32* %2
ret i32 %3
}
/* Variables and functions */
char *sendMsg(char const *, char *);
char *readFromPoint(const char *point) {
  return sendMsg(point, "{\"type\":\"read\",\"point\":\"%s\"}");
}


x86 assembly (clang, -O0):
<readFromPoint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xed9(%rip),%rsi
call   1030 <sendMsg@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [29 x i8] c"{\22type\22:\22read\22,\22point\22:\22%s\22}\00"
define i8* @readFromPoint(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i8* @sendMsg(i8* %3, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
ret i8* %4
}

LLVM IR (-O2):
@.str = [29 x i8] c"{\22type\22:\22read\22,\22point\22:\22%s\22}\00"
define i8* @readFromPoint(i8* %0) {
%2 = tail call i8* @sendMsg(i8* %0, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(char *, char const *, scalar_t__);
scalar_t__ strlen(char const *);
char *strcpy(char *dst, const char *src) { memcpy(dst, src, strlen(src) + 1); }


x86 assembly (clang, -O0):
<strcpy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x28(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    %rax,%rdx
add    $0x1,%rdx
call   1040 <memcpy@plt>
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcpy>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1030 <strlen@plt>
lea    0x1(%rax),%rdx
mov    %r14,%rdi
mov    %rbx,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <memcpy@plt>

LLVM IR (-O0):
define i8* @strcpy(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
%6 = load i8*, i8** %4
%7 = load i8*, i8** %5
%8 = load i8*, i8** %5
%9 = call i64 @strlen(i8* %8)
%10 = add nsw i64 %9, 1
%11 = call i32 @memcpy(i8* %6, i8* %7, i64 %10)
%12 = load i8*, i8** %3
ret i8* %12
}

LLVM IR (-O2):
define noalias i8* @strcpy(i8* %0, i8* %1) {
%3 = tail call i64 @strlen(i8* dereferenceable(1) %1)
%4 = add nsw i64 %3, 1
%5 = tail call i32 @memcpy(i8* %0, i8* %1, i64 %4)
ret i8* undef
}
int do_978() { return 978; }


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

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

LLVM IR (-O0):
define i32 @do_978() {
ret i32 978
}

LLVM IR (-O2):
define i32 @do_978() {
ret i32 978
}
/* Type definitions */
typedef int uint16_t;

/* Variables and functions */
scalar_t__ is_little_endian();
uint16_t swap_if_little16(uint16_t val) {
  if (is_little_endian())
    return (val >> 8) | (val << 8);
  else
    return val;
}


x86 assembly (clang, -O0):
<swap_if_little16>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <is_little_endian@plt>
cmp    $0x0,%rax
je     1142 <swap_if_little16+0x32>
mov    -0x8(%rbp),%eax
sar    $0x8,%eax
mov    -0x8(%rbp),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    %eax,-0x4(%rbp)
jmp    1148 <swap_if_little16+0x38>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<swap_if_little16>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <is_little_endian@plt>
mov    %ebx,%edx
sar    $0x8,%edx
mov    %ebx,%ecx
shl    $0x8,%ecx
or     %edx,%ecx
test   %rax,%rax
cmove  %ebx,%ecx
mov    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @swap_if_little16(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = call i64 (...) @is_little_endian()
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %12
6: ; preds = %1
%7 = load i32, i32* %3
%8 = ashr i32 %7, 8
%9 = load i32, i32* %3
%10 = shl i32 %9, 8
%11 = or i32 %8, %10
store i32 %11, i32* %2
br label %14
12: ; preds = %1
%13 = load i32, i32* %3
store i32 %13, i32* %2
br label %14
14: ; preds = %12, %6
%15 = load i32, i32* %2
ret i32 %15
}

LLVM IR (-O2):
define i32 @swap_if_little16(i32 %0) {
%2 = tail call i64 (...) @is_little_endian()
%3 = icmp eq i64 %2, 0
%4 = ashr i32 %0, 8
%5 = shl i32 %0, 8
%6 = or i32 %4, %5
%7 = select i1 %3, i32 %0, i32 %6
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ strset(char *, char);
int main(int argc, char *argv[]) {
  char str[81];
  int i;
  for (i = 0; i < 80; i++)
    str[i] = 'A';
  str[80] = '\0';
  strset(str, '@');
  puts(str);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x74(%rbp)
cmpl   $0x50,-0x74(%rbp)
jge    1161 <main+0x41>
movslq -0x74(%rbp),%rax
movb   $0x41,-0x70(%rbp,%rax,1)
mov    -0x74(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x74(%rbp)
jmp    1140 <main+0x20>
movb   $0x0,-0x20(%rbp)
lea    -0x70(%rbp),%rdi
mov    $0x40,%esi
call   1040 <strset@plt>
lea    -0x70(%rbp),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x60,%rsp
movaps 0xed4(%rip),%xmm0
movaps %xmm0,0x40(%rsp)
movaps %xmm0,0x30(%rsp)
movaps %xmm0,0x20(%rsp)
movaps %xmm0,0x10(%rsp)
movaps %xmm0,(%rsp)
movb   $0x0,0x50(%rsp)
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x40,%esi
call   1040 <strset@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x60,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [81 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 = %15, %2
%9 = load i32, i32* %7
%10 = icmp slt i32 %9, 80
br i1 %10, label %11, label %18
11: ; preds = %8
%12 = load i32, i32* %7
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds [81 x i8], [81 x i8]* %6, i64 0, i64 %13
store i8 65, i8* %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
%19 = getelementptr inbounds [81 x i8], [81 x i8]* %6, i64 0, i64 80
store i8 0, i8* %19
%20 = getelementptr inbounds [81 x i8], [81 x i8]* %6, i64 0, i64 0
%21 = call i32 @strset(i8* %20, i8 signext 64)
%22 = getelementptr inbounds [81 x i8], [81 x i8]* %6, i64 0, i64 0
%23 = call i32 @puts(i8* %22)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [81 x i8]
%4 = getelementptr inbounds [81 x i8], [81 x i8]* %3, i64 0, i64 0
%5 = getelementptr inbounds [81 x i8], [81 x i8]* %3, i64 0, i64 0
%6 = getelementptr inbounds [81 x i8], [81 x i8]* %3, i64 0, i64 80
store i8 0, i8* %6
%7 = call i32 @strset(i8* %5, i8 signext 64)
%8 = call i32 @puts(i8* %5)
ret i32 0
}
void sse4_test(void) {
  char buf0[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15};
  char buf1[] = {16, 17, 18, 19, 20, 21, 22, 23,
                 24, 25, 26, 27, 28, 29, 30, 31};
  char buf2[] = {32, 33, 34, 35, 36, 37, 38, 39,
                 40, 41, 42, 43, 44, 45, 46, 47};
  asm("movupd %0, %%xmm0" : "=m"(buf0));
  asm("movupd %0, %%xmm1" : "=m"(buf1));
  asm("movupd %0, %%xmm2" : "=m"(buf2));
  asm("blendpd $1, %xmm1, %xmm0");
  asm("blendps $2, %xmm2, %xmm0");
  asm("blendvpd %xmm0, %xmm1, %xmm2");
  asm("blendvps %xmm0, %xmm2, %xmm1");
}


x86 assembly (clang, -O0):
<sse4_test>:
push   %rbp
mov    %rsp,%rbp
mov    0xef5(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0xef2(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    0xeef(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xeec(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xee9(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xee6(%rip),%rax
mov    %rax,-0x28(%rbp)
movupd -0x10(%rbp),%xmm0
movupd -0x20(%rbp),%xmm1
movupd -0x30(%rbp),%xmm2
blendpd $0x1,%xmm1,%xmm0
blendps $0x2,%xmm2,%xmm0
blendvpd %xmm0,%xmm1,%xmm2
blendvps %xmm0,%xmm2,%xmm1
pop    %rbp
ret

x86 assembly (clang, -O2):
<sse4_test>:
movaps 0xef9(%rip),%xmm0
movaps %xmm0,-0x18(%rsp)
movaps 0xefd(%rip),%xmm0
movaps %xmm0,-0x28(%rsp)
movaps 0xf01(%rip),%xmm0
movaps %xmm0,-0x38(%rsp)
movupd -0x18(%rsp),%xmm0
movupd -0x28(%rsp),%xmm1
movupd -0x38(%rsp),%xmm2
blendpd $0x1,%xmm1,%xmm0
blendps $0x2,%xmm2,%xmm0
blendvpd %xmm0,%xmm1,%xmm2
blendvps %xmm0,%xmm2,%xmm1
ret

LLVM IR (-O0):
@__const.sse4_test.buf0 = [16 x i8] c"\00\01\02\03\04\05\06\07\08\09\0A\0B\0C\0D\0E\0F"
@__const.sse4_test.buf1 = [16 x i8] c"\10\11\12\13\14\15\16\17\18\19\1A\1B\1C\1D\1E\1F"
@__const.sse4_test.buf2 = [16 x i8] c" !\22#$%&'()*+,-./"
define void @sse4_test() {
%1 = alloca [16 x i8]
%2 = alloca [16 x i8]
%3 = alloca [16 x i8]
%4 = bitcast [16 x i8]* %1 to i8*
%5 = bitcast [16 x i8]* %2 to i8*
%6 = bitcast [16 x i8]* %3 to i8*
ret void
}

LLVM IR (-O2):
@__const.sse4_test.buf0 = [16 x i8] c"\00\01\02\03\04\05\06\07\08\09\0A\0B\0C\0D\0E\0F"
@__const.sse4_test.buf1 = [16 x i8] c"\10\11\12\13\14\15\16\17\18\19\1A\1B\1C\1D\1E\1F"
@__const.sse4_test.buf2 = [16 x i8] c" !\22#$%&'()*+,-./"
define void @sse4_test() {
%1 = alloca [16 x i8]
%2 = alloca [16 x i8]
%3 = alloca [16 x i8]
%4 = getelementptr inbounds [16 x i8], [16 x i8]* %1, i64 0, i64 0
%5 = getelementptr inbounds [16 x i8], [16 x i8]* %2, i64 0, i64 0
%6 = getelementptr inbounds [16 x i8], [16 x i8]* %3, i64 0, i64 0
ret void
}
/* Type definitions */
typedef int in_addr_t;

/* Variables and functions */
int htonl(int);
bool ipv4_is_multicast(in_addr_t addr) {
  return (addr & htonl(0xf0000000UL)) == htonl(0xe0000000UL);
}


x86 assembly (clang, -O0):
<ipv4_is_multicast>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    $0xf0000000,%edi
call   1030 <htonl@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
and    %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    $0xe0000000,%edi
call   1030 <htonl@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%eax
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ipv4_is_multicast>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
mov    $0xf0000000,%edi
call   1030 <htonl@plt>
mov    %eax,%ebp
and    %ebx,%ebp
mov    $0xe0000000,%edi
call   1030 <htonl@plt>
xor    %ecx,%ecx
cmp    %eax,%ebp
sete   %cl
mov    %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @ipv4_is_multicast(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @htonl(i32 -268435456)
%5 = and i32 %3, %4
%6 = call i32 @htonl(i32 -536870912)
%7 = icmp eq i32 %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @ipv4_is_multicast(i32 %0) {
%2 = tail call i32 @htonl(i32 -268435456)
%3 = and i32 %2, %0
%4 = tail call i32 @htonl(i32 -536870912)
%5 = icmp eq i32 %3, %4
%6 = zext i1 %5 to i32
ret i32 %6
}
void rop3_80_0_1(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  stk2 = ~*D;
  stk1 = T & stk2;
  *D = (stk1 & S) | (stk1 & (~T)) | (T & (~S) & *D);
}


x86 assembly (clang, -O0):
<rop3_80_0_1>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
xor    $0xffffffff,%eax
mov    %al,-0xc(%rbp)
movzbl -0xa(%rbp),%eax
movzbl -0xc(%rbp),%ecx
and    %ecx,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
movzbl -0x9(%rbp),%ecx
and    %ecx,%eax
movzbl -0xb(%rbp),%ecx
movzbl -0xa(%rbp),%edx
xor    $0xffffffff,%edx
and    %edx,%ecx
or     %ecx,%eax
movzbl -0xa(%rbp),%ecx
movzbl -0x9(%rbp),%edx
xor    $0xffffffff,%edx
and    %edx,%ecx
mov    -0x8(%rbp),%rdx
movzbl (%rdx),%edx
and    %edx,%ecx
or     %ecx,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rop3_80_0_1>:
mov    %edx,%eax
and    %sil,%al
not    %sil
and    %dl,%sil
xor    %al,%sil
and    (%rdi),%sil
xor    %al,%sil
mov    %sil,(%rdi)
ret

LLVM IR (-O0):
define void @rop3_80_0_1(i8* %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
store i8* %0, i8** %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%9 = load i8*, i8** %4
%10 = load i8, i8* %9
%11 = zext i8 %10 to i32
%12 = xor i32 %11, -1
%13 = trunc i32 %12 to i8
store i8 %13, i8* %8
%14 = load i8, i8* %6
%15 = zext i8 %14 to i32
%16 = load i8, i8* %8
%17 = zext i8 %16 to i32
%18 = and i32 %15, %17
%19 = trunc i32 %18 to i8
store i8 %19, i8* %7
%20 = load i8, i8* %7
%21 = zext i8 %20 to i32
%22 = load i8, i8* %5
%23 = zext i8 %22 to i32
%24 = and i32 %21, %23
%25 = load i8, i8* %7
%26 = zext i8 %25 to i32
%27 = load i8, i8* %6
%28 = zext i8 %27 to i32
%29 = xor i32 %28, -1
%30 = and i32 %26, %29
%31 = or i32 %24, %30
%32 = load i8, i8* %6
%33 = zext i8 %32 to i32
%34 = load i8, i8* %5
%35 = zext i8 %34 to i32
%36 = xor i32 %35, -1
%37 = and i32 %33, %36
%38 = load i8*, i8** %4
%39 = load i8, i8* %38
%40 = zext i8 %39 to i32
%41 = and i32 %37, %40
%42 = or i32 %31, %41
%43 = trunc i32 %42 to i8
%44 = load i8*, i8** %4
store i8 %43, i8* %44
ret void
}

LLVM IR (-O2):
define void @rop3_80_0_1(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = load i8, i8* %0
%5 = xor i8 %4, -1
%6 = and i8 %2, %1
%7 = and i8 %6, %5
%8 = xor i8 %1, -1
%9 = and i8 %8, %2
%10 = and i8 %9, %4
%11 = or i8 %7, %10
store i8 %11, i8* %0
ret void
}
/* Variables and functions */
double gauss();
void gaussa(double *a, int n) {
  int i;
  for (i = 0; i < n; i++)
    a[i] = gauss();
}


x86 assembly (clang, -O0):
<gaussa>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1154 <gaussa+0x44>
mov    $0x0,%al
call   1030 <gauss@plt>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <gaussa+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gaussa>:
push   %r15
push   %r14
push   %rbx
test   %esi,%esi
jle    1146 <gaussa+0x36>
mov    %rdi,%r14
mov    %esi,%r15d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <gauss@plt>
movsd  %xmm0,(%r14,%rbx,8)
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <gaussa+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @gaussa(double* %0, i32 %1) {
%3 = alloca double*
%4 = alloca i32
%5 = alloca i32
store double* %0, double** %3
store i32 %1, i32* %4
store i32 0, i32* %5
br label %6
6: ; preds = %16, %2
%7 = load i32, i32* %5
%8 = load i32, i32* %4
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %19
10: ; preds = %6
%11 = call double (...) @gauss()
%12 = load double*, double** %3
%13 = load i32, i32* %5
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds double, double* %12, i64 %14
store double %11, double* %15
br label %16
16: ; preds = %10
%17 = load i32, i32* %5
%18 = add nsw i32 %17, 1
store i32 %18, i32* %5
br label %6
19: ; preds = %6
ret void
}

LLVM IR (-O2):
define void @gaussa(double* nocapture writeonly %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %12
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %10, %6 ]
%8 = tail call double (...) @gauss()
%9 = getelementptr inbounds double, double* %0, i64 %7
store double %8, double* %9
%10 = add nuw nsw i64 %7, 1
%11 = icmp eq i64 %10, %5
br i1 %11, label %12, label %6
12: ; preds = %6, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ U_WMRNOTIMPLEMENTED_swap(char *, int);
void U_WMRB3_swap(char *record, int torev) {
  U_WMRNOTIMPLEMENTED_swap(record, torev);
}


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

x86 assembly (clang, -O2):
<U_WMRB3_swap>:
jmp    1030 <U_WMRNOTIMPLEMENTED_swap@plt>

LLVM IR (-O0):
define void @U_WMRB3_swap(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 @U_WMRNOTIMPLEMENTED_swap(i8* %5, i32 %6)
ret void
}

LLVM IR (-O2):
define void @U_WMRB3_swap(i8* %0, i32 %1) {
%3 = tail call i32 @U_WMRNOTIMPLEMENTED_swap(i8* %0, i32 %1)
ret void
}