xunge/DecIR huggingface dataset:
int matsu_b(char cc) {
  printf("%s -- start\n", __func__);
  printf("%s -- exit\n", __func__);
  return 0;
}


x86 assembly (clang, -O0):
<matsu_b>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
lea    0xedb(%rip),%rdi
lea    0xee1(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xedb(%rip),%rdi
lea    0xecc(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<matsu_b>:
push   %rbx
lea    0xee8(%rip),%rdi
lea    0xeee(%rip),%rbx
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xee5(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [13 x i8] c"%s -- start\0A\00"
@__func__.matsu_b = [8 x i8] c"matsu_b\00"
@.str.1 = [12 x i8] c"%s -- exit\0A\00"
define i32 @matsu_b(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @__func__.matsu_b, i64 0, i64 0))
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @__func__.matsu_b, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [13 x i8] c"%s -- start\0A\00"
@__func__.matsu_b = [8 x i8] c"matsu_b\00"
@.str.1 = [12 x i8] c"%s -- exit\0A\00"
define i32 @matsu_b(i8 signext %0) {
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @__func__.matsu_b, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @__func__.matsu_b, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
typedef char *int16_t;

/* Variables and functions */
int16_t ENDSWAP_16(int16_t x) {
  int16_t y;
  __asm__("rorw $8, %w0" : "=r"(y) : "0"(x) : "cc");
  return y;
}


x86 assembly (clang, -O0):
<ENDSWAP_16>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
ror    $0x8,%ax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ENDSWAP_16>:
mov    %rdi,%rax
ror    $0x8,%ax
ret

LLVM IR (-O0):
define i8* @ENDSWAP_16(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i8* asm "rorw $$8, ${0:w}", "=r,0,~{cc},~{dirflag},~{fpsr},~{flags}"(i8* %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
ret i8* %6
}

LLVM IR (-O2):
define i8* @ENDSWAP_16(i8* readnone %0) {
%2 = tail call i8* asm "rorw $$8, ${0:w}", "=r,0,~{cc},~{dirflag},~{fpsr},~{flags}"(i8* %0)
ret i8* %2
}
/* Variables and functions */
scalar_t__ listen(int, int);
int /*<<< orphan*/ sock_valid_socket(int);
int sock_listen(int serversock, int backlog) {
  if (!sock_valid_socket(serversock))
    return 0;
  if (backlog <= 0)
    backlog = 10;
  return (listen(serversock, backlog) == 0);
}


x86 assembly (clang, -O0):
<sock_listen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <sock_valid_socket@plt>
cmp    $0x0,%eax
jne    114b <sock_listen+0x2b>
movl   $0x0,-0x4(%rbp)
jmp    1176 <sock_listen+0x56>
cmpl   $0x0,-0xc(%rbp)
jg     115c <sock_listen+0x3c>
movl   $0xa,-0xc(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1040 <listen@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sock_listen>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %edi,%ebx
call   1030 <sock_valid_socket@plt>
test   %eax,%eax
je     114e <sock_listen+0x2e>
test   %ebp,%ebp
mov    $0xa,%esi
cmovg  %ebp,%esi
mov    %ebx,%edi
call   1040 <listen@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
sete   %al
jmp    1150 <sock_listen+0x30>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @sock_listen(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = load i32, i32* %4
%7 = call i32 @sock_valid_socket(i32 %6)
%8 = icmp ne i32 %7, 0
br i1 %8, label %10, label %9
9: ; preds = %2
store i32 0, i32* %3
br label %20
10: ; preds = %2
%11 = load i32, i32* %5
%12 = icmp sle i32 %11, 0
br i1 %12, label %13, label %14
13: ; preds = %10
store i32 10, i32* %5
br label %14
14: ; preds = %13, %10
%15 = load i32, i32* %4
%16 = load i32, i32* %5
%17 = call i64 @listen(i32 %15, i32 %16)
%18 = icmp eq i64 %17, 0
%19 = zext i1 %18 to i32
store i32 %19, i32* %3
br label %20
20: ; preds = %14, %9
%21 = load i32, i32* %3
ret i32 %21
}

LLVM IR (-O2):
define i32 @sock_listen(i32 %0, i32 %1) {
%3 = tail call i32 @sock_valid_socket(i32 %0)
%4 = icmp eq i32 %3, 0
br i1 %4, label %11, label %5
5: ; preds = %2
%6 = icmp slt i32 %1, 1
%7 = select i1 %6, i32 10, i32 %1
%8 = tail call i64 @listen(i32 %0, i32 %7)
%9 = icmp eq i64 %8, 0
%10 = zext i1 %9 to i32
br label %11
11: ; preds = %2, %5
%12 = phi i32 [ %10, %5 ], [ 0, %2 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ display_write_char(char);
void display_write_string(char *str) {
  while (*str != '\0') {
    display_write_char(*str);
    str++;
  }
}


x86 assembly (clang, -O0):
<display_write_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1149 <display_write_string+0x39>
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <display_write_char@plt>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    111c <display_write_string+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<display_write_string>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1133 <display_write_string+0x23>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movsbl %al,%edi
call   1030 <display_write_char@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <display_write_string+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @display_write_string(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %9, %4 ], [ %2, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = tail call i32 @display_write_char(i8 signext %5)
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
ret void
}
void dcic2_iomux_config() {}


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

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

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

LLVM IR (-O2):
define void @dcic2_iomux_config() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ SerialP__SerialFlush__default__flush();
void SerialP__SerialFlush__flush(void) {
  SerialP__SerialFlush__default__flush();
}


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

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

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

LLVM IR (-O2):
define void @SerialP__SerialFlush__flush() {
%1 = tail call i32 (...) @SerialP__SerialFlush__default__flush()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ panic(char *, char *, int);
void int_18(void) { panic("Machine Check", "#MC", 1); }


x86 assembly (clang, -O0):
<int_18>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
lea    0xeec(%rip),%rsi
mov    $0x1,%edx
call   1030 <panic@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<int_18>:
lea    0xee9(%rip),%rdi
lea    0xef0(%rip),%rsi
mov    $0x1,%edx
jmp    1030 <panic@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"Machine Check\00"
@.str.1 = [4 x i8] c"#MC\00"
define void @int_18() {
%1 = call i32 @panic(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 1)
ret void
}

LLVM IR (-O2):
@.str = [14 x i8] c"Machine Check\00"
@.str.1 = [4 x i8] c"#MC\00"
define void @int_18() {
%1 = tail call i32 @panic(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 1)
ret void
}
int Get_Base(code)
char code;
{
  switch (code) {
  case 'h':
    return (16);
  case 'd':
    return (10);
  case 'o':
    return (8);
  case 'b':
    return (2);
  case 'a':
    return (-1);
  default:
    return (1);
  }
}


x86 assembly (clang, -O0):
<Get_Base>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
add    $0xffffff9f,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0xe,%eax
ja     1170 <Get_Base+0x70>
mov    -0x10(%rbp),%rax
lea    0xed5(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movl   $0x10,-0x4(%rbp)
jmp    1177 <Get_Base+0x77>
movl   $0xa,-0x4(%rbp)
jmp    1177 <Get_Base+0x77>
movl   $0x8,-0x4(%rbp)
jmp    1177 <Get_Base+0x77>
movl   $0x2,-0x4(%rbp)
jmp    1177 <Get_Base+0x77>
movl   $0xffffffff,-0x4(%rbp)
jmp    1177 <Get_Base+0x77>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Get_Base>:
movsbl %dil,%ecx
add    $0xffffff9f,%ecx
cmp    $0xe,%ecx
ja     112d <Get_Base+0x2d>
mov    $0x10,%eax
lea    0xee8(%rip),%rdx
movslq (%rdx,%rcx,4),%rcx
add    %rdx,%rcx
jmp    *%rcx
mov    $0xffffffff,%eax
ret
mov    $0x2,%eax
ret
mov    $0x1,%eax
ret
mov    $0xa,%eax
ret
mov    $0x8,%eax
ret

LLVM IR (-O0):
define i32 @Get_Base(i32 %0) {
%2 = alloca i32
%3 = alloca i8
%4 = trunc i32 %0 to i8
store i8 %4, i8* %3
%5 = load i8, i8* %3
%6 = sext i8 %5 to i32
switch i32 %6, label %12 [
i32 104, label %7
i32 100, label %8
i32 111, label %9
i32 98, label %10
i32 97, label %11
]
7: ; preds = %1
store i32 16, i32* %2
br label %13
8: ; preds = %1
store i32 10, i32* %2
br label %13
9: ; preds = %1
store i32 8, i32* %2
br label %13
10: ; preds = %1
store i32 2, i32* %2
br label %13
11: ; preds = %1
store i32 -1, i32* %2
br label %13
12: ; preds = %1
store i32 1, i32* %2
br label %13
13: ; preds = %12, %11, %10, %9, %8, %7
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
define i32 @Get_Base(i32 %0) {
%2 = shl i32 %0, 24
%3 = ashr exact i32 %2, 24
switch i32 %3, label %8 [
i32 104, label %9
i32 100, label %4
i32 111, label %5
i32 98, label %6
i32 97, label %7
]
4: ; preds = %1
br label %9
5: ; preds = %1
br label %9
6: ; preds = %1
br label %9
7: ; preds = %1
br label %9
8: ; preds = %1
br label %9
9: ; preds = %1, %8, %7, %6, %5, %4
%10 = phi i32 [ 1, %8 ], [ -1, %7 ], [ 2, %6 ], [ 8, %5 ], [ 10, %4 ], [ 16, %1 ]
ret i32 %10
}
/* Variables and functions */
char *strdup(char const *);
char *sstrdup(const char *s, const char *dflt) {
  char *c;
  if (!s)
    return 0;
  c = strdup(s);
  return (char *)(c ? c : dflt);
}


x86 assembly (clang, -O0):
<sstrdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1138 <sstrdup+0x28>
movq   $0x0,-0x8(%rbp)
jmp    116d <sstrdup+0x5d>
mov    -0x10(%rbp),%rdi
call   1030 <strdup@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     115d <sstrdup+0x4d>
mov    -0x20(%rbp),%rax
mov    %rax,-0x28(%rbp)
jmp    1165 <sstrdup+0x55>
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sstrdup>:
push   %rbx
test   %rdi,%rdi
je     1127 <sstrdup+0x17>
mov    %rsi,%rbx
call   1030 <strdup@plt>
test   %rax,%rax
cmovne %rax,%rbx
jmp    1129 <sstrdup+0x19>
xor    %ebx,%ebx
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @sstrdup(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
%7 = load i8*, i8** %4
%8 = icmp ne i8* %7, null
br i1 %8, label %10, label %9
9: ; preds = %2
store i8* null, i8** %3
br label %21
10: ; preds = %2
%11 = load i8*, i8** %4
%12 = call i8* @strdup(i8* %11)
store i8* %12, i8** %6
%13 = load i8*, i8** %6
%14 = icmp ne i8* %13, null
br i1 %14, label %15, label %17
15: ; preds = %10
%16 = load i8*, i8** %6
br label %19
17: ; preds = %10
%18 = load i8*, i8** %5
br label %19
19: ; preds = %17, %15
%20 = phi i8* [ %16, %15 ], [ %18, %17 ]
store i8* %20, i8** %3
br label %21
21: ; preds = %19, %9
%22 = load i8*, i8** %3
ret i8* %22
}

LLVM IR (-O2):
define i8* @sstrdup(i8* %0, i8* readnone %1) {
%3 = icmp eq i8* %0, null
br i1 %3, label %8, label %4
4: ; preds = %2
%5 = tail call i8* @strdup(i8* %0)
%6 = icmp eq i8* %5, null
%7 = select i1 %6, i8* %1, i8* %5
br label %8
8: ; preds = %2, %4
%9 = phi i8* [ %7, %4 ], [ null, %2 ]
ret i8* %9
}
/* Type definitions */
typedef int uint8_t;
typedef int const uint16_t;

/* Variables and functions */
uint16_t smpte_fec_get_snbase_low(const uint8_t *p_fec) {
  return (p_fec[0] << 8) | p_fec[1];
}


x86 assembly (clang, -O0):
<smpte_fec_get_snbase_low>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
shl    $0x8,%eax
mov    -0x8(%rbp),%rcx
or     0x4(%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<smpte_fec_get_snbase_low>:
mov    (%rdi),%eax
shl    $0x8,%eax
or     0x4(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @smpte_fec_get_snbase_low(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 0
%5 = load i32, i32* %4
%6 = shl i32 %5, 8
%7 = load i32*, i32** %2
%8 = getelementptr inbounds i32, i32* %7, i64 1
%9 = load i32, i32* %8
%10 = or i32 %6, %9
ret i32 %10
}

LLVM IR (-O2):
define i32 @smpte_fec_get_snbase_low(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = shl i32 %2, 8
%4 = getelementptr inbounds i32, i32* %0, i64 1
%5 = load i32, i32* %4
%6 = or i32 %3, %5
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ gmvwrite_surfvars_header();
void fgmvwrite_surfvars_header_() { gmvwrite_surfvars_header(); }


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

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

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

LLVM IR (-O2):
define void @fgmvwrite_surfvars_header_() {
%1 = tail call i32 (...) @gmvwrite_surfvars_header()
ret void
}
memshift(p) unsigned *p;
{
  unsigned x;
  for (; 1;) {
    x = *p++ >> 16;
    if (x)
      return x;
  }
}


x86 assembly (clang, -O0):
<memshift>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    $0x1,%al
test   $0x1,%al
jne    1117 <memshift+0x17>
jmp    1148 <memshift+0x48>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x4,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%eax
shr    $0x10,%eax
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
je     1143 <memshift+0x43>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1148 <memshift+0x48>
jmp    1108 <memshift+0x8>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<memshift>:
mov    (%rdi),%eax
add    $0x4,%rdi
cmp    $0x10000,%eax
jb     1100 <memshift>
shr    $0x10,%eax
ret

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

LLVM IR (-O2):
define i32 @memshift(i32* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i32* [ %0, %1 ], [ %4, %2 ]
%4 = getelementptr inbounds i32, i32* %3, i64 1
%5 = load i32, i32* %3
%6 = icmp ult i32 %5, 65536
br i1 %6, label %2, label %7
7: ; preds = %2
%8 = lshr i32 %5, 16
ret i32 %8
}
/* Variables and functions */
int strcmp(char *, char *);
int alphabetically(const void *_a, const void *_b) {
  return strcmp(*(char **)_a, *(char **)_b);
}


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

x86 assembly (clang, -O2):
<alphabetically>:
mov    (%rdi),%rdi
mov    (%rsi),%rsi
jmp    1030 <strcmp@plt>

LLVM IR (-O0):
define i32 @alphabetically(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 = bitcast i8* %5 to i8**
%7 = load i8*, i8** %6
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i8**
%10 = load i8*, i8** %9
%11 = call i32 @strcmp(i8* %7, i8* %10)
ret i32 %11
}

LLVM IR (-O2):
define i32 @alphabetically(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i8**
%4 = load i8*, i8** %3
%5 = bitcast i8* %1 to i8**
%6 = load i8*, i8** %5
%7 = tail call i32 @strcmp(i8* dereferenceable(1) %4, i8* dereferenceable(1) %6)
ret i32 %7
}
int fn1(int a[]) { return sizeof a; }


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

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

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

LLVM IR (-O2):
define i32 @fn1(i32* nocapture readnone %0) {
ret i32 8
}
/* Variables and functions */
int /*<<< orphan*/ strlen(char const *);
int /*<<< orphan*/ write(int, char const *, int /*<<< orphan*/);
void whine(const char *message) { write(2, message, strlen(message)); }


x86 assembly (clang, -O0):
<whine>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x10(%rbp),%rsi
mov    %eax,%edx
mov    $0x2,%edi
call   1030 <write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<whine>:
push   %rbx
mov    %rdi,%rbx
call   1040 <strlen@plt>
mov    $0x2,%edi
mov    %rbx,%rsi
mov    %eax,%edx
pop    %rbx
jmp    1030 <write@plt>

LLVM IR (-O0):
define void @whine(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @strlen(i8* %4)
%6 = call i32 @write(i32 2, i8* %3, i32 %5)
ret void
}

LLVM IR (-O2):
define void @whine(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = tail call i32 @write(i32 2, i8* %0, i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int divi(int a, int b) {
  printf("I am doing %d / %d\n", a, b);
  return a * b;
}


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

x86 assembly (clang, -O2):
<divi>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
lea    0xee2(%rip),%rdi
mov    %ebp,%esi
mov    %ebx,%edx
call   1030 <printf@plt>
imul   %ebp,%ebx
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [20 x i8] c"I am doing %d / %d\0A\00"
define i32 @divi(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %5, i32 %6)
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = mul nsw i32 %8, %9
ret i32 %10
}

LLVM IR (-O2):
@.str = [20 x i8] c"I am doing %d / %d\0A\00"
define i32 @divi(i32 %0, i32 %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1)
%4 = mul nsw i32 %1, %0
ret i32 %4
}
int trivial_add(int a, int b) { return a + b; }


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

x86 assembly (clang, -O2):
<trivial_add>:
lea    (%rdi,%rsi,1),%eax
ret

LLVM IR (-O0):
define i32 @trivial_add(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 = add nsw i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @trivial_add(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
ret i32 %3
}
/* Variables and functions */
int unlockpt(int);
int my_unlockpt(int fd) { return unlockpt(fd); }


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

x86 assembly (clang, -O2):
<my_unlockpt>:
jmp    1030 <unlockpt@plt>

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

LLVM IR (-O2):
define i32 @my_unlockpt(i32 %0) {
%2 = tail call i32 @unlockpt(i32 %0)
ret i32 %2
}
int sumTest() { return 2 + 2; }


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

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

LLVM IR (-O0):
define i32 @sumTest() {
ret i32 4
}

LLVM IR (-O2):
define i32 @sumTest() {
ret i32 4
}
void test_multiple_carets(void) {}


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

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

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

LLVM IR (-O2):
define void @test_multiple_carets() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_usage(void) { printf("Usage: mkdir [-v] [-m MODE] DIR ...\n"); }


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

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

LLVM IR (-O0):
@.str = [37 x i8] c"Usage: mkdir [-v] [-m MODE] DIR ...\0A\00"
define void @print_usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [36 x i8] c"Usage: mkdir [-v] [-m MODE] DIR ...\00"
define void @print_usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @str, i64 0, i64 0))
ret void
}
void USB0_Handler(void) {
  while (1) {
  }
}


x86 assembly (clang, -O0):
<USB0_Handler>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <USB0_Handler+0x9>
jmp    1109 <USB0_Handler+0x9>

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

LLVM IR (-O0):
define void @USB0_Handler() {
br label %1
1: ; preds = %0, %1
br label %1
}

LLVM IR (-O2):
define void @USB0_Handler() {
br label %1
1: ; preds = %0, %1
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ O_RDONLY;
int /*<<< orphan*/ close(int);
int open(char *, int /*<<< orphan*/);
int is_blocking(char *lock_filename) {
  int fd = open(lock_filename, O_RDONLY);
  if (fd == -1)
    return 0;
  else {
    close(fd);
    return 1;
  }
}


x86 assembly (clang, -O0):
<is_blocking>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    0x2eb1(%rip),%rax
mov    (%rax),%esi
call   1040 <open@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0xffffffff,-0x14(%rbp)
jne    1157 <is_blocking+0x37>
movl   $0x0,-0x4(%rbp)
jmp    1166 <is_blocking+0x46>
mov    -0x14(%rbp),%edi
call   1030 <close@plt>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_blocking>:
push   %rax
mov    0x2ec0(%rip),%rax
mov    (%rax),%esi
call   1040 <open@plt>
cmp    $0xffffffff,%eax
je     1142 <is_blocking+0x22>
mov    %eax,%edi
call   1030 <close@plt>
mov    $0x1,%eax
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@O_RDONLY = global i32 0
define i32 @is_blocking(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = load i32, i32* @O_RDONLY
%7 = call i32 @open(i8* %5, i32 %6)
store i32 %7, i32* %4
%8 = load i32, i32* %4
%9 = icmp eq i32 %8, -1
br i1 %9, label %10, label %11
10: ; preds = %1
store i32 0, i32* %2
br label %14
11: ; preds = %1
%12 = load i32, i32* %4
%13 = call i32 @close(i32 %12)
store i32 1, i32* %2
br label %14
14: ; preds = %11, %10
%15 = load i32, i32* %2
ret i32 %15
}

LLVM IR (-O2):
@O_RDONLY = global i32 0
define i32 @is_blocking(i8* nocapture %0) {
%2 = load i32, i32* @O_RDONLY
%3 = tail call i32 @open(i8* %0, i32 %2)
%4 = icmp eq i32 %3, -1
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = tail call i32 @close(i32 %3)
br label %7
7: ; preds = %1, %5
%8 = phi i32 [ 1, %5 ], [ 0, %1 ]
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isodigit(int);
void t_isodigit_0xe6() {
  Assert_real((isodigit(230) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isodigit.c",
              1155, ("isodigit should be 0 for 0xe6"));
}


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

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

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

LLVM IR (-O2):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isodigit.c\00"
@.str.1 = [30 x i8] c"isodigit should be 0 for 0xe6\00"
define void @t_isodigit_0xe6() {
%1 = tail call i64 @isodigit(i32 230)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 1155, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}
long double expl(long double x) { return __builtin_expl(x); }


x86 assembly (clang, -O0):
<expl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
call   1030 <expl@plt>
fld    %st(0)
fstp   %st(0)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<expl>:
fldt   0x8(%rsp)
flds   0xef6(%rip)
fxch   %st(1)
fucomi %st(1),%st
fstp   %st(1)
ja     1125 <expl+0x25>
flds   0xeec(%rip)
fucomip %st(1),%st
fstp   %st(0)
fldz
ja     1125 <expl+0x25>
fstp   %st(0)
fldz
ret
fstp   %st(0)
nopw   0x0(%rax,%rax,1)
jmp    1130 <expl+0x30>

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

LLVM IR (-O2):
define x86_fp80 @expl(x86_fp80 %0) {
%2 = fcmp olt x86_fp80 %0, 0xKC00CB21C000000000000
%3 = fcmp ogt x86_fp80 %0, 0xK400CB170000000000000
%4 = or i1 %3, %2
br i1 %4, label %5, label %6
5: ; preds = %1, %5
br label %5
6: ; preds = %1
ret x86_fp80 undef
}
__attribute__((vector_size(16))) int
foo(__attribute__((vector_size(16))) int a,
    __attribute__((vector_size(16))) int b) {
  return a + b;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
movdqa %xmm0,-0x10(%rbp)
movdqa %xmm1,-0x20(%rbp)
movdqa -0x10(%rbp),%xmm0
paddd  -0x20(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
paddd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define <4 x i32> @foo(<4 x i32> %0, <4 x i32> %1) {
%3 = alloca <4 x i32>
%4 = alloca <4 x i32>
store <4 x i32> %0, <4 x i32>* %3
store <4 x i32> %1, <4 x i32>* %4
%5 = load <4 x i32>, <4 x i32>* %3
%6 = load <4 x i32>, <4 x i32>* %4
%7 = add <4 x i32> %5, %6
ret <4 x i32> %7
}

LLVM IR (-O2):
define <4 x i32> @foo(<4 x i32> %0, <4 x i32> %1) {
%3 = add <4 x i32> %1, %0
ret <4 x i32> %3
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
int ft_close(int fd) {
  close(fd);
  return (0);
}


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

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

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

LLVM IR (-O2):
define i32 @ft_close(i32 %0) {
%2 = tail call i32 @close(i32 %0)
ret i32 0
}
/* Variables and functions */
char *strdup(char *);
char *cdio_get_default_device_solaris(void) {
  return strdup("/vol/dev/aliases/cdrom0");
}


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

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

LLVM IR (-O0):
@.str = [24 x i8] c"/vol/dev/aliases/cdrom0\00"
define i8* @cdio_get_default_device_solaris() {
%1 = call i8* @strdup(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}

LLVM IR (-O2):
@.str = [24 x i8] c"/vol/dev/aliases/cdrom0\00"
define noalias i8* @cdio_get_default_device_solaris() {
%1 = tail call dereferenceable_or_null(24) i8* @strdup(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}
int main() {
  int a = 4;
  int *p = (int *)malloc(sizeof(int));
  printf("%d\n", a);
  printf("%d\n", p);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x4,-0x4(%rbp)
mov    $0x4,%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x4(%rbp),%esi
lea    0xeb9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%rsi
lea    0xea7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    $0x4,%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
lea    0xec8(%rip),%r14
mov    %r14,%rdi
mov    $0x4,%esi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call dereferenceable_or_null(4) i8* @malloc(i64 4)
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 4)
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ send(int, char *, int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ sprintf(char *, char *, char *);
int /*<<< orphan*/ strlen(char *);
void send_pong(int sock, char argument[]) {
  char pong_packet[512];
  sprintf(pong_packet, "PONG :%s\r\n", argument);
  send(sock, pong_packet, strlen(pong_packet), 0);
}


x86 assembly (clang, -O0):
<send_pong>:
push   %rbp
mov    %rsp,%rbp
sub    $0x220,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x210(%rbp),%rdi
mov    -0x10(%rbp),%rdx
lea    0xeac(%rip),%rsi
call   1050 <sprintf@plt>
mov    -0x4(%rbp),%eax
mov    %eax,-0x21c(%rbp)
lea    -0x210(%rbp),%rax
mov    %rax,-0x218(%rbp)
lea    -0x210(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x21c(%rbp),%edi
mov    -0x218(%rbp),%rsi
mov    %eax,%edx
xor    %ecx,%ecx
call   1040 <send@plt>
add    $0x220,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<send_pong>:
push   %rbp
push   %rbx
sub    $0x208,%rsp
mov    %rsi,%rdx
mov    %edi,%ebp
lea    0xebb(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1050 <sprintf@plt>
mov    %rbx,%rdi
call   1030 <strlen@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %eax,%edx
xor    %ecx,%ecx
call   1040 <send@plt>
add    $0x208,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [11 x i8] c"PONG :%s\0D\0A\00"
define void @send_pong(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca [512 x i8]
store i32 %0, i32* %3
store i8* %1, i8** %4
%6 = getelementptr inbounds [512 x i8], [512 x i8]* %5, i64 0, i64 0
%7 = load i8*, i8** %4
%8 = call i32 @sprintf(i8* %6, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %7)
%9 = load i32, i32* %3
%10 = getelementptr inbounds [512 x i8], [512 x i8]* %5, i64 0, i64 0
%11 = getelementptr inbounds [512 x i8], [512 x i8]* %5, i64 0, i64 0
%12 = call i32 @strlen(i8* %11)
%13 = call i32 @send(i32 %9, i8* %10, i32 %12, i32 0)
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"PONG :%s\0D\0A\00"
define void @send_pong(i32 %0, i8* %1) {
%3 = alloca [512 x i8]
%4 = getelementptr inbounds [512 x i8], [512 x i8]* %3, i64 0, i64 0
%5 = call i32 @sprintf(i8* %4, i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %1)
%6 = call i32 @strlen(i8* %4)
%7 = call i32 @send(i32 %0, i8* %4, i32 %6, i32 0)
ret void
}
/* Variables and functions */
char *read_long(char const *, char const *, int, long *);
const char *read_integer(const char *s, const char *delimiters, int max_chars,
                         int *result) {
  long l = 0;
  const char *ret = read_long(s, delimiters, max_chars, &l);
  if (ret != 0)
    *result = (int)l;
  return ret;
}


x86 assembly (clang, -O0):
<read_integer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
movq   $0x0,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
lea    -0x28(%rbp),%rcx
call   1030 <read_long@plt>
mov    %rax,-0x30(%rbp)
cmpq   $0x0,-0x30(%rbp)
je     115e <read_integer+0x4e>
mov    -0x28(%rbp),%rax
mov    %eax,%ecx
mov    -0x20(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x30(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_integer>:
push   %rbx
sub    $0x10,%rsp
mov    %rcx,%rbx
movq   $0x0,0x8(%rsp)
lea    0x8(%rsp),%rcx
call   1030 <read_long@plt>
test   %rax,%rax
je     1136 <read_integer+0x26>
mov    0x8(%rsp),%ecx
mov    %ecx,(%rbx)
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @read_integer(i8* %0, i8* %1, i32 %2, i32* nocapture writeonly %3) {
%5 = alloca i64
%6 = bitcast i64* %5 to i8*
store i64 0, i64* %5
%7 = call i8* @read_long(i8* %0, i8* %1, i32 %2, i64* %5)
%8 = icmp eq i8* %7, null
br i1 %8, label %12, label %9
9: ; preds = %4
%10 = load i64, i64* %5
%11 = trunc i64 %10 to i32
store i32 %11, i32* %3
br label %12
12: ; preds = %9, %4
ret i8* %7
}
char match(char s) {
  if (s == ')') {
    return '(';
  }
  if (s == ']') {
    return '[';
  }
  if (s == '}') {
    return '{';
  }
}


x86 assembly (clang, -O0):
<match>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x2(%rbp)
movsbl -0x2(%rbp),%eax
cmp    $0x29,%eax
jne    1120 <match+0x20>
movb   $0x28,-0x1(%rbp)
jmp    1147 <match+0x47>
movsbl -0x2(%rbp),%eax
cmp    $0x5d,%eax
jne    1136 <match+0x36>
movb   $0x5b,-0x1(%rbp)
jmp    1147 <match+0x47>
movsbl -0x2(%rbp),%eax
cmp    $0x7d,%eax
jne    1147 <match+0x47>
movb   $0x7b,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<match>:
cmp    $0x5d,%dil
mov    $0x5b,%eax
mov    $0x28,%ecx
cmove  %eax,%ecx
cmp    $0x7d,%dil
mov    $0x7b,%eax
cmovne %ecx,%eax
ret

LLVM IR (-O0):
define signext i8 @match(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 eq i32 %5, 41
br i1 %6, label %7, label %8
7: ; preds = %1
store i8 40, i8* %2
br label %18
8: ; preds = %1
%9 = load i8, i8* %3
%10 = sext i8 %9 to i32
%11 = icmp eq i32 %10, 93
br i1 %11, label %12, label %13
12: ; preds = %8
store i8 91, i8* %2
br label %18
13: ; preds = %8
%14 = load i8, i8* %3
%15 = sext i8 %14 to i32
%16 = icmp eq i32 %15, 125
br i1 %16, label %17, label %18
17: ; preds = %13
store i8 123, i8* %2
br label %18
18: ; preds = %7, %12, %17, %13
%19 = load i8, i8* %2
ret i8 %19
}

LLVM IR (-O2):
define signext i8 @match(i8 signext %0) {
%2 = icmp eq i8 %0, 93
%3 = select i1 %2, i8 91, i8 40
%4 = icmp eq i8 %0, 125
%5 = select i1 %4, i8 123, i8 %3
ret i8 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ RSA;

/* Variables and functions */
int /*<<< orphan*/ ASN1_ITEM_rptr(int /*<<< orphan*/);
int /*<<< orphan*/ *ASN1_item_dup(int /*<<< orphan*/, int /*<<< orphan*/ *);
int /*<<< orphan*/ RSAPrivateKey;
RSA *RSAPrivateKey_dup(RSA *rsa) {
  return ASN1_item_dup(ASN1_ITEM_rptr(RSAPrivateKey), rsa);
}


x86 assembly (clang, -O0):
<RSAPrivateKey_dup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
call   1030 <ASN1_ITEM_rptr@plt>
mov    %eax,%edi
mov    -0x8(%rbp),%rsi
call   1040 <ASN1_item_dup@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<RSAPrivateKey_dup>:
push   %rbx
mov    %rdi,%rbx
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
call   1030 <ASN1_ITEM_rptr@plt>
mov    %eax,%edi
mov    %rbx,%rsi
pop    %rbx
jmp    1040 <ASN1_item_dup@plt>

LLVM IR (-O0):
@RSAPrivateKey = global i32 0
define i32* @RSAPrivateKey_dup(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32, i32* @RSAPrivateKey
%4 = call i32 @ASN1_ITEM_rptr(i32 %3)
%5 = load i32*, i32** %2
%6 = call i32* @ASN1_item_dup(i32 %4, i32* %5)
ret i32* %6
}

LLVM IR (-O2):
@RSAPrivateKey = global i32 0
define i32* @RSAPrivateKey_dup(i32* %0) {
%2 = load i32, i32* @RSAPrivateKey
%3 = tail call i32 @ASN1_ITEM_rptr(i32 %2)
%4 = tail call i32* @ASN1_item_dup(i32 %3, i32* %0)
ret i32* %4
}
/* Variables and functions */
int /*<<< orphan*/ generate();
int /*<<< orphan*/ initialize();
int /*<<< orphan*/ srand(int /*<<< orphan*/);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
int main() {
  initialize();
  srand(time(NULL));
  for (;;)
    generate();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <initialize@plt>
xor    %eax,%eax
mov    %eax,%edi
call   1050 <time@plt>
mov    %eax,%edi
call   1040 <srand@plt>
mov    $0x0,%al
call   1060 <generate@plt>
jmp    1166 <main+0x26>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <initialize@plt>
xor    %edi,%edi
call   1050 <time@plt>
mov    %eax,%edi
call   1040 <srand@plt>
cs nopw 0x0(%rax,%rax,1)
xor    %eax,%eax
call   1060 <generate@plt>
jmp    1160 <main+0x20>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @initialize()
%3 = call i32 @time(i32* null)
%4 = call i32 @srand(i32 %3)
br label %5
5: ; preds = %5, %0
%6 = call i32 (...) @generate()
br label %5
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @initialize()
%2 = tail call i32 @time(i32* null)
%3 = tail call i32 @srand(i32 %2)
br label %4
4: ; preds = %4, %0
%5 = tail call i32 (...) @generate()
br label %4
}
double division(double zahl1, double zahl2) { return (zahl1 / zahl2); }


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

x86 assembly (clang, -O2):
<division>:
divsd  %xmm1,%xmm0
ret

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

LLVM IR (-O2):
define double @division(double %0, double %1) {
%3 = fdiv double %0, %1
ret double %3
}
int SDL_imageFilterMultMMX(unsigned char *Src1, unsigned char *Src2,
                           unsigned char *Dest, int length) {
  return (0);
}


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

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

LLVM IR (-O0):
define i32 @SDL_imageFilterMultMMX(i8* %0, i8* %1, i8* %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i32
store i8* %0, i8** %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store i32 %3, i32* %8
ret i32 0
}

LLVM IR (-O2):
define i32 @SDL_imageFilterMultMMX(i8* nocapture readnone %0, i8* nocapture readnone %1, i8* nocapture readnone %2, i32 %3) {
ret i32 0
}
int console_text_explode(unsigned char *buffer, struct palette *pal) {
  return 0;
}


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

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

LLVM IR (-O0):
%struct.palette = type opaque
define i32 @console_text_explode(i8* %0, %struct.palette* %1) {
%3 = alloca i8*
%4 = alloca %struct.palette*
store i8* %0, i8** %3
store %struct.palette* %1, %struct.palette** %4
ret i32 0
}

LLVM IR (-O2):
%struct.palette = type opaque
define i32 @console_text_explode(i8* nocapture readnone %0, %struct.palette* nocapture readnone %1) {
ret i32 0
}
/* Variables and functions */
scalar_t__ my_islower(int);
int my_toupper(int c) {
  if (my_islower(c))
    return c & 0x5f;
  return c;
}


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

x86 assembly (clang, -O2):
<my_toupper>:
push   %rbx
mov    %edi,%ebx
call   1030 <my_islower@plt>
mov    %ebx,%ecx
and    $0x5f,%ecx
test   %rax,%rax
cmove  %ebx,%ecx
mov    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @my_toupper(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = call i64 @my_islower(i32 %4)
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %1
%8 = load i32, i32* %3
%9 = and i32 %8, 95
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 @my_toupper(i32 %0) {
%2 = tail call i64 @my_islower(i32 %0)
%3 = icmp eq i64 %2, 0
%4 = and i32 %0, 95
%5 = select i1 %3, i32 %0, i32 %4
ret i32 %5
}
void _M2_segment_finish(__attribute__((unused)) int argc,
                        __attribute__((unused)) char *argv[]) {}


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

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

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

LLVM IR (-O2):
define void @_M2_segment_finish(i32 %0, i8** nocapture %1) {
ret void
}
int((access_transport_dump))(struct ss7 *ss7, int messagetype,
                             unsigned char *parm, int len) {
  return len;
}


x86 assembly (clang, -O0):
<access_transport_dump>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<access_transport_dump>:
mov    %ecx,%eax
ret

LLVM IR (-O0):
%struct.ss7 = type opaque
define i32 @access_transport_dump(%struct.ss7* %0, i32 %1, i8* %2, i32 %3) {
%5 = alloca %struct.ss7*
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i32
store %struct.ss7* %0, %struct.ss7** %5
store i32 %1, i32* %6
store i8* %2, i8** %7
store i32 %3, i32* %8
%9 = load i32, i32* %8
ret i32 %9
}

LLVM IR (-O2):
%struct.ss7 = type opaque
define i32 @access_transport_dump(%struct.ss7* nocapture readnone %0, i32 %1, i8* nocapture readnone %2, i32 returned %3) {
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
int main(void) {
  puts("[SUCCESS]");
  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 <puts@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [10 x i8] c"[SUCCESS]\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
ret i32 0
}