xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int getc(int /*<<< orphan*/ *);
scalar_t__ isprint(int);
int getstrlength(FILE *fp) {
  int n;
  int c;
  n = 0;
  while (isprint(c = getc(fp)) || (c & 0xff) > 0)
    n++;
  return (n);
}


x86 assembly (clang, -O0):
<getstrlength>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <getc@plt>
mov    %eax,%edi
mov    %edi,-0x10(%rbp)
call   1030 <isprint@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x11(%rbp)
jne    1169 <getstrlength+0x49>
mov    -0x10(%rbp),%eax
and    $0xff,%eax
cmp    $0x0,%eax
setg   %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    1179 <getstrlength+0x59>
jmp    1187 <getstrlength+0x67>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1133 <getstrlength+0x13>
mov    -0xc(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getstrlength>:
push   %rbp
push   %r14
push   %rbx
mov    %rdi,%r14
mov    $0xffffffff,%ebx
nopl   0x0(%rax)
mov    %r14,%rdi
call   1040 <getc@plt>
mov    %eax,%ebp
mov    %eax,%edi
call   1030 <isprint@plt>
add    $0x1,%ebx
test   %rax,%rax
jne    1130 <getstrlength+0x10>
movzbl %bpl,%eax
test   %eax,%eax
jne    1130 <getstrlength+0x10>
mov    %ebx,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @getstrlength(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
%4 = alloca i32
store i32* %0, i32** %2
store i32 0, i32* %3
br label %5
5: ; preds = %16, %1
%6 = load i32*, i32** %2
%7 = call i32 @getc(i32* %6)
store i32 %7, i32* %4
%8 = call i64 @isprint(i32 %7)
%9 = icmp ne i64 %8, 0
br i1 %9, label %14, label %10
10: ; preds = %5
%11 = load i32, i32* %4
%12 = and i32 %11, 255
%13 = icmp sgt i32 %12, 0
br label %14
14: ; preds = %10, %5
%15 = phi i1 [ true, %5 ], [ %13, %10 ]
br i1 %15, label %16, label %19
16: ; preds = %14
%17 = load i32, i32* %3
%18 = add nsw i32 %17, 1
store i32 %18, i32* %3
br label %5
19: ; preds = %14
%20 = load i32, i32* %3
ret i32 %20
}

LLVM IR (-O2):
define i32 @getstrlength(i32* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i32 [ 0, %1 ], [ %10, %2 ]
%4 = tail call i32 @getc(i32* %0)
%5 = tail call i64 @isprint(i32 %4)
%6 = icmp ne i64 %5, 0
%7 = and i32 %4, 255
%8 = icmp ne i32 %7, 0
%9 = or i1 %6, %8
%10 = add nuw nsw i32 %3, 1
br i1 %9, label %2, label %11
11: ; preds = %2
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ endwin();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
void halt() {
  endwin();
  exit(0);
}


x86 assembly (clang, -O0):
<halt>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <endwin@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<halt>:
push   %rax
xor    %eax,%eax
call   1030 <endwin@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define void @halt() {
%1 = call i32 (...) @endwin()
%2 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define void @halt() {
%1 = tail call i32 (...) @endwin()
%2 = tail call i32 @exit(i32 0)
unreachable
}
int test_imm_9Cint8_reg(signed char val) {
  return ((val) & (0x9C << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_9Cint8_reg(i8 signext %0) {
%2 = and i8 %0, -100
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ SIGKILL;
int /*<<< orphan*/ atoi(char *);
int /*<<< orphan*/ kill(int /*<<< orphan*/, int /*<<< orphan*/);
int main(int argc, char *argv[], char *envp[]) {
  kill(atoi(argv[1]), SIGKILL);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1040 <atoi@plt>
mov    %eax,%edi
mov    0x2e90(%rip),%rax
mov    (%rax),%esi
call   1030 <kill@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x8(%rsi),%rdi
call   1040 <atoi@plt>
mov    0x2eaf(%rip),%rcx
mov    (%rcx),%esi
mov    %eax,%edi
call   1030 <kill@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@SIGKILL = global i32 0
define i32 @main(i32 %0, i8** %1, i8** %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8**
%7 = alloca i8**
store i32 0, i32* %4
store i32 %0, i32* %5
store i8** %1, i8*** %6
store i8** %2, i8*** %7
%8 = load i8**, i8*** %6
%9 = getelementptr inbounds i8*, i8** %8, i64 1
%10 = load i8*, i8** %9
%11 = call i32 @atoi(i8* %10)
%12 = load i32, i32* @SIGKILL
%13 = call i32 @kill(i32 %11, i32 %12)
ret i32 0
}

LLVM IR (-O2):
@SIGKILL = global i32 0
define i32 @main(i32 %0, i8** nocapture %1, i8** nocapture readnone %2) {
%4 = getelementptr inbounds i8*, i8** %1, i64 1
%5 = load i8*, i8** %4
%6 = tail call i32 @atoi(i8* %5)
%7 = load i32, i32* @SIGKILL
%8 = tail call i32 @kill(i32 %6, i32 %7)
ret i32 0
}
int lowestTriangle(int base, int area) {
  return ((2 * area) / base) + ((2 * area) % base != 0 ? 1 : 0);
}


x86 assembly (clang, -O0):
<lowestTriangle>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
shl    $0x1,%eax
cltd
idivl  -0x4(%rbp)
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
shl    $0x1,%eax
cltd
idivl  -0x4(%rbp)
mov    -0xc(%rbp),%eax
mov    %edx,%esi
xor    %ecx,%ecx
mov    $0x1,%edx
cmp    $0x0,%esi
cmovne %edx,%ecx
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<lowestTriangle>:
lea    (%rsi,%rsi,1),%eax
cltd
idiv   %edi
cmp    $0x1,%edx
sbb    $0xffffffff,%eax
ret

LLVM IR (-O0):
define i32 @lowestTriangle(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = mul nsw i32 2, %5
%7 = load i32, i32* %3
%8 = sdiv i32 %6, %7
%9 = load i32, i32* %4
%10 = mul nsw i32 2, %9
%11 = load i32, i32* %3
%12 = srem i32 %10, %11
%13 = icmp ne i32 %12, 0
%14 = zext i1 %13 to i64
%15 = select i1 %13, i32 1, i32 0
%16 = add nsw i32 %8, %15
ret i32 %16
}

LLVM IR (-O2):
define i32 @lowestTriangle(i32 %0, i32 %1) {
%3 = shl nsw i32 %1, 1
%4 = sdiv i32 %3, %0
%5 = srem i32 %3, %0
%6 = icmp ne i32 %5, 0
%7 = zext i1 %6 to i32
%8 = add nsw i32 %4, %7
ret i32 %8
}
/* Type definitions */
typedef int /*<<< orphan*/ data;

/* Variables and functions */
int EXIT_SUCCESS;
int findMajorityElement(int *, int);
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  int data[] = {3, 3, 4, 2, 4, 4, 2, 4};
  int majority = findMajorityElement(data, sizeof(data) / sizeof(data[0]));
  printf("Majority element = %d", majority);
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xec7(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0xec4(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xec1(%rip),%rax
mov    %rax,-0x18(%rbp)
lea    -0x30(%rbp),%rdi
mov    $0x8,%esi
call   1030 <findMajorityElement@plt>
mov    %eax,-0x34(%rbp)
mov    -0x34(%rbp),%esi
lea    0xeaa(%rip),%rdi
call   1040 <printf@plt>
mov    0x2e5e(%rip),%rax
mov    (%rax),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
movaps 0xee5(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xec9(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
mov    $0x8,%esi
call   1030 <findMajorityElement@plt>
lea    0xed1(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
mov    0x2e83(%rip),%rax
mov    (%rax),%eax
add    $0x28,%rsp
ret

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

LLVM IR (-O2):
@__const.main.data = [8 x i32] [i32 3, i32 3, i32 4, i32 2, i32 4, i32 4, i32 2, i32 4]
@.str = [22 x i8] c"Majority element = %d\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca [8 x i32]
%2 = bitcast [8 x i32]* %1 to i8*
%3 = getelementptr inbounds [8 x i32], [8 x i32]* %1, i64 0, i64 0
%4 = call i32 @findMajorityElement(i32* %3, i32 8)
%5 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = load i32, i32* @EXIT_SUCCESS
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ default_isr();
__attribute__((weak)) void USB_Handler() { default_isr(); }


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

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

LLVM IR (-O0):
define weak void @USB_Handler() {
%1 = call i32 (...) @default_isr()
ret void
}

LLVM IR (-O2):
define weak void @USB_Handler() {
%1 = tail call i32 (...) @default_isr()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void usage(void) {
  printf("*argv[0] -g <GPIO_ADDRESS> -i|-o <VALUE>\n");
  printf("    -g <GPIO_ADDR>   GPIO physical address\n");
  printf("    -i               Input from GPIO\n");
  printf("    -o <VALUE>       Output to GPIO\n");
  return;
}


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

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

LLVM IR (-O0):
@.str = [42 x i8] c"*argv[0] -g <GPIO_ADDRESS> -i|-o <VALUE>\0A\00"
@.str.1 = [44 x i8] c" -g <GPIO_ADDR> GPIO physical address\0A\00"
@.str.2 = [38 x i8] c" -i Input from GPIO\0A\00"
@.str.3 = [37 x i8] c" -o <VALUE> Output to GPIO\0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [41 x i8] c"*argv[0] -g <GPIO_ADDRESS> -i|-o <VALUE>\00"
@str.4 = [43 x i8] c" -g <GPIO_ADDR> GPIO physical address\00"
@str.5 = [37 x i8] c" -i Input from GPIO\00"
@str.6 = [36 x i8] c" -o <VALUE> Output to GPIO\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @str.4, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @str.5, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @str.6, i64 0, i64 0))
ret void
}
/* Type definitions */
struct ieee80211_hw {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ rtl_set_bbreg(struct ieee80211_hw *, int, int, int);
void rtl8723_phy_path_a_standby(struct ieee80211_hw *hw) {
  rtl_set_bbreg(hw, 0xe28, 0xffffffff, 0x0);
  rtl_set_bbreg(hw, 0x840, 0xffffffff, 0x00010000);
  rtl_set_bbreg(hw, 0xe28, 0xffffffff, 0x80800000);
}


x86 assembly (clang, -O0):
<rtl8723_phy_path_a_standby>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0xe28,%esi
mov    $0xffffffff,%edx
xor    %ecx,%ecx
call   1030 <rtl_set_bbreg@plt>
mov    -0x8(%rbp),%rdi
mov    $0x840,%esi
mov    $0xffffffff,%edx
mov    $0x10000,%ecx
call   1030 <rtl_set_bbreg@plt>
mov    -0x8(%rbp),%rdi
mov    $0xe28,%esi
mov    $0xffffffff,%edx
mov    $0x80800000,%ecx
call   1030 <rtl_set_bbreg@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rtl8723_phy_path_a_standby>:
push   %rbx
mov    %rdi,%rbx
mov    $0xe28,%esi
mov    $0xffffffff,%edx
xor    %ecx,%ecx
call   1030 <rtl_set_bbreg@plt>
mov    %rbx,%rdi
mov    $0x840,%esi
mov    $0xffffffff,%edx
mov    $0x10000,%ecx
call   1030 <rtl_set_bbreg@plt>
mov    %rbx,%rdi
mov    $0xe28,%esi
mov    $0xffffffff,%edx
mov    $0x80800000,%ecx
pop    %rbx
jmp    1030 <rtl_set_bbreg@plt>

LLVM IR (-O0):
%struct.ieee80211_hw = type { i32 }
define void @rtl8723_phy_path_a_standby(%struct.ieee80211_hw* %0) {
%2 = alloca %struct.ieee80211_hw*
store %struct.ieee80211_hw* %0, %struct.ieee80211_hw** %2
%3 = load %struct.ieee80211_hw*, %struct.ieee80211_hw** %2
%4 = call i32 @rtl_set_bbreg(%struct.ieee80211_hw* %3, i32 3624, i32 -1, i32 0)
%5 = load %struct.ieee80211_hw*, %struct.ieee80211_hw** %2
%6 = call i32 @rtl_set_bbreg(%struct.ieee80211_hw* %5, i32 2112, i32 -1, i32 65536)
%7 = load %struct.ieee80211_hw*, %struct.ieee80211_hw** %2
%8 = call i32 @rtl_set_bbreg(%struct.ieee80211_hw* %7, i32 3624, i32 -1, i32 -2139095040)
ret void
}

LLVM IR (-O2):
%struct.ieee80211_hw = type { i32 }
define void @rtl8723_phy_path_a_standby(%struct.ieee80211_hw* %0) {
%2 = tail call i32 @rtl_set_bbreg(%struct.ieee80211_hw* %0, i32 3624, i32 -1, i32 0)
%3 = tail call i32 @rtl_set_bbreg(%struct.ieee80211_hw* %0, i32 2112, i32 -1, i32 65536)
%4 = tail call i32 @rtl_set_bbreg(%struct.ieee80211_hw* %0, i32 3624, i32 -1, i32 -2139095040)
ret void
}
/* Variables and functions */
char const *gettext_ngettext(char const *, int /*<<< orphan*/ *, int);
__attribute__((format_arg(1))) const char *_(const char *msgid) {
  return gettext_ngettext(msgid, NULL, 1);
}


x86 assembly (clang, -O0):
<_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
mov    $0x1,%edx
call   1030 <gettext_ngettext@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_>:
xor    %esi,%esi
mov    $0x1,%edx
jmp    1030 <gettext_ngettext@plt>

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

LLVM IR (-O2):
define i8* @_(i8* %0) {
%2 = tail call i8* @gettext_ngettext(i8* %0, i32* null, i32 1)
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int);
int /*<<< orphan*/ stdout;
void _move_south_n(int n) { fprintf(stdout, "\x1B[%dB", n); }


x86 assembly (clang, -O0):
<_move_south_n>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2ebe(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%edx
lea    0xed2(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_move_south_n>:
mov    %edi,%edx
mov    0x2ec7(%rip),%rax
mov    (%rax),%edi
lea    0xede(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stdout = global i32 0
@.str = [6 x i8] c"\1B[%dB\00"
define void @_move_south_n(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @stdout
%4 = load i32, i32* %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %4)
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [6 x i8] c"\1B[%dB\00"
define void @_move_south_n(i32 %0) {
%2 = load i32, i32* @stdout
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
int fun3(void) { return 0; }


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

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

LLVM IR (-O0):
define i32 @fun3() {
ret i32 0
}

LLVM IR (-O2):
define i32 @fun3() {
ret i32 0
}
int main() {
  uart_puts("Program started\n");
  asm(".long 0xe12fff7f");
  uart_puts("Xrogram finished\n");
  while (1)
    ;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
mov    $0x0,%al
call   1030 <uart_puts@plt>
jg     112e <main+0x1e>
(bad)
loope  117a <_fini+0x36>
lea    0xed9(%rip),%edi
mov    $0x0,%al
call   1030 <uart_puts@plt>
jmp    113f <main+0x2f>

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
xor    %eax,%eax
call   1030 <uart_puts@plt>
jg     1120 <main+0x10>
(bad)
loope  116c <_fini+0x28>
lea    0xee7(%rip),%edi
xor    %eax,%eax
call   1030 <uart_puts@plt>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
jmp    1140 <main+0x30>

LLVM IR (-O0):
@.str = [17 x i8] c"Program started\0A\00"
@.str.1 = [18 x i8] c"Xrogram finished\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (i8*, ...) bitcast (i32 (...)* @uart_puts to i32 (i8*, ...)*)(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (i8*, ...) bitcast (i32 (...)* @uart_puts to i32 (i8*, ...)*)(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0))
br label %4
4: ; preds = %0, %4
br label %4
}

LLVM IR (-O2):
@.str = [17 x i8] c"Program started\0A\00"
@.str.1 = [18 x i8] c"Xrogram finished\0A\00"
define i32 @main() {
%1 = tail call i32 (i8*, ...) bitcast (i32 (...)* @uart_puts to i32 (i8*, ...)*)(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
tail call void asm sideeffect ".long 0xe12fff7f", "~{dirflag},~{fpsr},~{flags}"()
%2 = tail call i32 (i8*, ...) bitcast (i32 (...)* @uart_puts to i32 (i8*, ...)*)(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0))
br label %3
3: ; preds = %0, %3
br label %3
}
/* Type definitions */
struct v4l2_jpegcompression {
  int dummy;
};
typedef int /*<<< orphan*/ j;

/* Variables and functions */
int main(void) {
  struct v4l2_jpegcompression j;
  (void)j;
  return sizeof(j);
}


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

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

LLVM IR (-O0):
%struct.v4l2_jpegcompression = type { i32 }
define i32 @main() {
%1 = alloca i32
%2 = alloca %struct.v4l2_jpegcompression
store i32 0, i32* %1
ret i32 4
}

LLVM IR (-O2):
define i32 @main() {
ret i32 4
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ islower(int);
void t_islower_0x03() {
  Assert_real((islower(3) == 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_islower.c",
              20, ("islower should be 0 for 0x03"));
}


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

x86 assembly (clang, -O2):
<t_islower_0x03>:
push   %rax
mov    $0x3,%edi
call   1030 <islower@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x14,%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_islower.c\00"
@.str.1 = [29 x i8] c"islower should be 0 for 0x03\00"
define void @t_islower_0x03() {
%1 = call i64 @islower(i32 3)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 20, i8* getelementptr inbounds ([29 x i8], [29 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_islower.c\00"
@.str.1 = [29 x i8] c"islower should be 0 for 0x03\00"
define void @t_islower_0x03() {
%1 = tail call i64 @islower(i32 3)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 20, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __free_cf(void *);
void CGAffineTransformRelease(void *item) { __free_cf(item); }


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

x86 assembly (clang, -O2):
<CGAffineTransformRelease>:
jmp    1030 <__free_cf@plt>

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

LLVM IR (-O2):
define void @CGAffineTransformRelease(i8* %0) {
%2 = tail call i32 @__free_cf(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EnvPrintRouter(void *, char const *, char *);
int /*<<< orphan*/ gensprintf(char *, char *, long long);
void PrintLongInteger(void *theEnv, const char *logicalName, long long number) {
  char printBuffer[32];
  gensprintf(printBuffer, "%lld", number);
  EnvPrintRouter(theEnv, logicalName, printBuffer);
}


x86 assembly (clang, -O0):
<PrintLongInteger>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
lea    -0x40(%rbp),%rdi
mov    -0x18(%rbp),%rdx
lea    0xebd(%rip),%rsi
call   1040 <gensprintf@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
lea    -0x40(%rbp),%rdx
call   1030 <EnvPrintRouter@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PrintLongInteger>:
push   %r15
push   %r14
push   %rbx
sub    $0x20,%rsp
mov    %rsi,%r14
mov    %rdi,%rbx
lea    0xeca(%rip),%rsi
mov    %rsp,%r15
mov    %r15,%rdi
call   1040 <gensprintf@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
call   1030 <EnvPrintRouter@plt>
add    $0x20,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [5 x i8] c"%lld\00"
define void @PrintLongInteger(i8* %0, i8* %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
%7 = alloca [32 x i8]
store i8* %0, i8** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%8 = getelementptr inbounds [32 x i8], [32 x i8]* %7, i64 0, i64 0
%9 = load i64, i64* %6
%10 = call i32 @gensprintf(i8* %8, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64 %9)
%11 = load i8*, i8** %4
%12 = load i8*, i8** %5
%13 = getelementptr inbounds [32 x i8], [32 x i8]* %7, i64 0, i64 0
%14 = call i32 @EnvPrintRouter(i8* %11, i8* %12, i8* %13)
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"%lld\00"
define void @PrintLongInteger(i8* %0, i8* %1, i64 %2) {
%4 = alloca [32 x i8]
%5 = getelementptr inbounds [32 x i8], [32 x i8]* %4, i64 0, i64 0
%6 = call i32 @gensprintf(i8* %5, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64 %2)
%7 = call i32 @EnvPrintRouter(i8* %0, i8* %1, i8* %5)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ deccount(int);
int /*<<< orphan*/ free(void *);
void xfree(void *p) {
  if (p) {
    deccount(7);
  }
  free(p);
}


x86 assembly (clang, -O0):
<xfree>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1141 <xfree+0x21>
mov    $0x7,%edi
call   1040 <deccount@plt>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xfree>:
push   %rbx
mov    %rdi,%rbx
test   %rdi,%rdi
je     1133 <xfree+0x13>
mov    $0x7,%edi
call   1040 <deccount@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @xfree(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp ne i8* %3, null
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = call i32 @deccount(i32 7)
br label %7
7: ; preds = %5, %1
%8 = load i8*, i8** %2
%9 = call i32 @free(i8* %8)
ret void
}

LLVM IR (-O2):
define void @xfree(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @deccount(i32 7)
br label %5
5: ; preds = %3, %1
%6 = tail call i32 @free(i8* %0)
ret void
}
int ft_strcmp(const char *s1, const char *s2) {
  while (*s1 == *s2 && *s1) {
    s1++;
    s2++;
  }
  return ((unsigned char)*s1 - (unsigned char)*s2);
}


x86 assembly (clang, -O0):
<ft_strcmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
mov    -0x10(%rbp),%rax
movsbl (%rax),%edx
xor    %eax,%eax
cmp    %edx,%ecx
mov    %al,-0x11(%rbp)
jne    1137 <ft_strcmp+0x37>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
setne  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    1147 <ft_strcmp+0x47>
jmp    1164 <ft_strcmp+0x64>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    110c <ft_strcmp+0xc>
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
mov    -0x10(%rbp),%rcx
movzbl (%rcx),%ecx
sub    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_strcmp>:
mov    (%rdi),%al
mov    (%rsi),%cl
test   %al,%al
je     1134 <ft_strcmp+0x34>
cmp    %cl,%al
jne    1134 <ft_strcmp+0x34>
mov    $0x1,%edx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movzbl (%rdi,%rdx,1),%eax
movzbl (%rsi,%rdx,1),%ecx
test   %al,%al
je     1134 <ft_strcmp+0x34>
add    $0x1,%rdx
cmp    %cl,%al
je     1120 <ft_strcmp+0x20>
movzbl %al,%eax
movzbl %cl,%ecx
sub    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @ft_strcmp(i8* nocapture %0, i8* nocapture %1) {
%3 = load i8, i8* %0
%4 = load i8, i8* %1
%5 = icmp ne i8 %3, %4
%6 = icmp eq i8 %3, 0
%7 = or i1 %6, %5
br i1 %7, label %18, label %8
8: ; preds = %2, %8
%9 = phi i8* [ %12, %8 ], [ %1, %2 ]
%10 = phi i8* [ %11, %8 ], [ %0, %2 ]
%11 = getelementptr inbounds i8, i8* %10, i64 1
%12 = getelementptr inbounds i8, i8* %9, i64 1
%13 = load i8, i8* %11
%14 = load i8, i8* %12
%15 = icmp ne i8 %13, %14
%16 = icmp eq i8 %13, 0
%17 = or i1 %16, %15
br i1 %17, label %18, label %8
18: ; preds = %8, %2
%19 = phi i8 [ %3, %2 ], [ %13, %8 ]
%20 = phi i8 [ %4, %2 ], [ %14, %8 ]
%21 = zext i8 %19 to i32
%22 = zext i8 %20 to i32
%23 = sub nsw i32 %21, %22
ret i32 %23
}
/* Variables and functions */
unsigned int num_attacks(unsigned base, unsigned max, unsigned hp, bool swarm) {
  if (!swarm)
    return base;
  return base * hp / max;
}


x86 assembly (clang, -O0):
<num_attacks>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jne    1125 <num_attacks+0x25>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1134 <num_attacks+0x34>
mov    -0x8(%rbp),%eax
imul   -0x10(%rbp),%eax
xor    %edx,%edx
divl   -0xc(%rbp)
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<num_attacks>:
mov    %edi,%eax
test   %ecx,%ecx
je     110f <num_attacks+0xf>
imul   %eax,%edx
mov    %edx,%eax
xor    %edx,%edx
div    %esi
ret

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

LLVM IR (-O2):
define i32 @num_attacks(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = icmp eq i32 %3, 0
br i1 %5, label %9, label %6
6: ; preds = %4
%7 = mul i32 %2, %0
%8 = udiv i32 %7, %1
br label %9
9: ; preds = %4, %6
%10 = phi i32 [ %8, %6 ], [ %0, %4 ]
ret i32 %10
}
/* Type definitions */
struct pollfd {
  int dummy;
};
typedef int /*<<< orphan*/ nfds_t;

/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ __set_errno(int /*<<< orphan*/);
int __poll(struct pollfd *fds, nfds_t nfds, int timeout) {
  __set_errno(ENOSYS);
  return -1;
}


x86 assembly (clang, -O0):
<__poll>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    0x2ebf(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
mov    $0xffffffff,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__poll>:
push   %rax
mov    0x2ed0(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.pollfd = type { i32 }
@ENOSYS = global i32 0
define i32 @__poll(%struct.pollfd* %0, i32 %1, i32 %2) {
%4 = alloca %struct.pollfd*
%5 = alloca i32
%6 = alloca i32
store %struct.pollfd* %0, %struct.pollfd** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* @ENOSYS
%8 = call i32 @__set_errno(i32 %7)
ret i32 -1
}

LLVM IR (-O2):
%struct.pollfd = type { i32 }
@ENOSYS = global i32 0
define i32 @__poll(%struct.pollfd* nocapture readnone %0, i32 %1, i32 %2) {
%4 = load i32, i32* @ENOSYS
%5 = tail call i32 @__set_errno(i32 %4)
ret i32 -1
}
/* Type definitions */
struct iovec {
  int dummy;
};

/* Variables and functions */
int EINVAL;
__attribute__((visibility("default"))) int
sd_bus_message_append_array_iovec(void *m, char type, const struct iovec *iov,
                                  unsigned n) {
  return -EINVAL;
}


x86 assembly (clang, -O0):
<sd_bus_message_append_array_iovec>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
xor    %eax,%eax
mov    0x2ec2(%rip),%rcx
sub    (%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sd_bus_message_append_array_iovec>:
mov    0x2ed9(%rip),%rcx
xor    %eax,%eax
sub    (%rcx),%eax
ret

LLVM IR (-O0):
%struct.iovec = type { i32 }
@EINVAL = global i32 0
define i32 @sd_bus_message_append_array_iovec(i8* %0, i8 signext %1, %struct.iovec* %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i8
%7 = alloca %struct.iovec*
%8 = alloca i32
store i8* %0, i8** %5
store i8 %1, i8* %6
store %struct.iovec* %2, %struct.iovec** %7
store i32 %3, i32* %8
%9 = load i32, i32* @EINVAL
%10 = sub nsw i32 0, %9
ret i32 %10
}

LLVM IR (-O2):
%struct.iovec = type { i32 }
@EINVAL = global i32 0
define i32 @sd_bus_message_append_array_iovec(i8* nocapture readnone %0, i8 signext %1, %struct.iovec* nocapture readnone %2, i32 %3) {
%5 = load i32, i32* @EINVAL
%6 = sub nsw i32 0, %5
ret i32 %6
}
/* Variables and functions */
int strcmp(char const *, char const *);
int strcmp_opt(const char *s1, const char *s2) {
  if (!s1) {
    if (!s2)
      return 0;
    else
      return -1;
  } else if (!s2) {
    return 1;
  } else {
    return strcmp(s1, s2);
  }
}


x86 assembly (clang, -O0):
<strcmp_opt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    114e <strcmp_opt+0x3e>
cmpq   $0x0,-0x18(%rbp)
jne    1142 <strcmp_opt+0x32>
movl   $0x0,-0x4(%rbp)
jmp    1175 <strcmp_opt+0x65>
movl   $0xffffffff,-0x4(%rbp)
jmp    1175 <strcmp_opt+0x65>
cmpq   $0x0,-0x18(%rbp)
jne    1165 <strcmp_opt+0x55>
movl   $0x1,-0x4(%rbp)
jmp    1175 <strcmp_opt+0x65>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <strcmp@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcmp_opt>:
test   %rdi,%rdi
je     111f <strcmp_opt+0xf>
test   %rsi,%rsi
je     1125 <strcmp_opt+0x15>
jmp    1030 <strcmp@plt>
neg    %rsi
sbb    %eax,%eax
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @strcmp_opt(i8* %0, i8* %1) {
%3 = icmp eq i8* %0, null
br i1 %3, label %4, label %7
4: ; preds = %2
%5 = icmp ne i8* %1, null
%6 = sext i1 %5 to i32
br label %11
7: ; preds = %2
%8 = icmp eq i8* %1, null
br i1 %8, label %11, label %9
9: ; preds = %7
%10 = tail call i32 @strcmp(i8* %0, i8* %1)
br label %11
11: ; preds = %7, %4, %9
%12 = phi i32 [ %10, %9 ], [ %6, %4 ], [ 1, %7 ]
ret i32 %12
}
char *langDbgDevPcm() { return "PCM"; }


x86 assembly (clang, -O0):
<langDbgDevPcm>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<langDbgDevPcm>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [4 x i8] c"PCM\00"
define i8* @langDbgDevPcm() {
ret i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [4 x i8] c"PCM\00"
define i8* @langDbgDevPcm() {
ret i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
double e_harm(long);
double o_harm(long);
double a_harm(long n) { return n % 2 ? o_harm(n) : e_harm(n); }


x86 assembly (clang, -O0):
<a_harm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    $0x2,%ecx
cqto
idiv   %rcx
cmp    $0x0,%rdx
je     1157 <a_harm+0x37>
mov    -0x8(%rbp),%rdi
call   1040 <o_harm@plt>
movsd  %xmm0,-0x10(%rbp)
jmp    1165 <a_harm+0x45>
mov    -0x8(%rbp),%rdi
call   1030 <e_harm@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<a_harm>:
test   $0x1,%dil
jne    112b <a_harm+0xb>
jmp    1030 <e_harm@plt>
jmp    1040 <o_harm@plt>

LLVM IR (-O0):
define double @a_harm(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = srem i64 %3, 2
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load i64, i64* %2
%8 = call double @o_harm(i64 %7)
br label %12
9: ; preds = %1
%10 = load i64, i64* %2
%11 = call double @e_harm(i64 %10)
br label %12
12: ; preds = %9, %6
%13 = phi double [ %8, %6 ], [ %11, %9 ]
ret double %13
}

LLVM IR (-O2):
define double @a_harm(i64 %0) {
%2 = and i64 %0, 1
%3 = icmp eq i64 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call double @o_harm(i64 %0)
br label %8
6: ; preds = %1
%7 = tail call double @e_harm(i64 %0)
br label %8
8: ; preds = %6, %4
%9 = phi double [ %5, %4 ], [ %7, %6 ]
ret double %9
}
int jac_chain_nm9_init(int *n_in, int *n_out, int *n_int, int *n_real) {
  if (n_in)
    *n_in = 2;
  if (n_out)
    *n_out = 2;
  if (n_int)
    *n_int = 0;
  if (n_real)
    *n_real = 0;
  return 0;
}


x86 assembly (clang, -O0):
<jac_chain_nm9_init>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1129 <jac_chain_nm9_init+0x29>
mov    -0x8(%rbp),%rax
movl   $0x2,(%rax)
cmpq   $0x0,-0x10(%rbp)
je     113e <jac_chain_nm9_init+0x3e>
mov    -0x10(%rbp),%rax
movl   $0x2,(%rax)
cmpq   $0x0,-0x18(%rbp)
je     1153 <jac_chain_nm9_init+0x53>
mov    -0x18(%rbp),%rax
movl   $0x0,(%rax)
cmpq   $0x0,-0x20(%rbp)
je     1168 <jac_chain_nm9_init+0x68>
mov    -0x20(%rbp),%rax
movl   $0x0,(%rax)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<jac_chain_nm9_init>:
test   %rdi,%rdi
je     110b <jac_chain_nm9_init+0xb>
movl   $0x2,(%rdi)
test   %rsi,%rsi
je     1116 <jac_chain_nm9_init+0x16>
movl   $0x2,(%rsi)
test   %rdx,%rdx
je     1121 <jac_chain_nm9_init+0x21>
movl   $0x0,(%rdx)
test   %rcx,%rcx
je     112c <jac_chain_nm9_init+0x2c>
movl   $0x0,(%rcx)
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @jac_chain_nm9_init(i32* writeonly %0, i32* writeonly %1, i32* writeonly %2, i32* writeonly %3) {
%5 = icmp eq i32* %0, null
br i1 %5, label %7, label %6
6: ; preds = %4
store i32 2, i32* %0
br label %7
7: ; preds = %6, %4
%8 = icmp eq i32* %1, null
br i1 %8, label %10, label %9
9: ; preds = %7
store i32 2, i32* %1
br label %10
10: ; preds = %9, %7
%11 = icmp eq i32* %2, null
br i1 %11, label %13, label %12
12: ; preds = %10
store i32 0, i32* %2
br label %13
13: ; preds = %12, %10
%14 = icmp eq i32* %3, null
br i1 %14, label %16, label %15
15: ; preds = %13
store i32 0, i32* %3
br label %16
16: ; preds = %15, %13
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ actionMenuSolo(int);
int /*<<< orphan*/ afficherMenuSolo();
int choixMenu(int, int);
int /*<<< orphan*/ system(char *);
void menuSolo(void) {
  int choix;
  system("clear");
  afficherMenuSolo();
  choix = choixMenu(1, 4);
  actionMenuSolo(choix);
}


x86 assembly (clang, -O0):
<menuSolo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xeb1(%rip),%rdi
call   1050 <system@plt>
mov    $0x0,%al
call   1040 <afficherMenuSolo@plt>
mov    $0x1,%edi
mov    $0x4,%esi
call   1030 <choixMenu@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1060 <actionMenuSolo@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<menuSolo>:
push   %rax
lea    0xeb8(%rip),%rdi
call   1050 <system@plt>
xor    %eax,%eax
call   1040 <afficherMenuSolo@plt>
mov    $0x1,%edi
mov    $0x4,%esi
call   1030 <choixMenu@plt>
mov    %eax,%edi
pop    %rax
jmp    1060 <actionMenuSolo@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"clear\00"
define void @menuSolo() {
%1 = alloca i32
%2 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (...) @afficherMenuSolo()
%4 = call i32 @choixMenu(i32 1, i32 4)
store i32 %4, i32* %1
%5 = load i32, i32* %1
%6 = call i32 @actionMenuSolo(i32 %5)
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"clear\00"
define void @menuSolo() {
%1 = tail call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (...) @afficherMenuSolo()
%3 = tail call i32 @choixMenu(i32 1, i32 4)
%4 = tail call i32 @actionMenuSolo(i32 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, float *);
int main() {
  float num;
  printf("Digite um número real: \n");
  scanf("%f", &num);
  printf("Número = %.2f", num);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xed6(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xec0(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xeda(%rip),%rdi
call   1030 <puts@plt>
lea    0xebc(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
movss  0x4(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xea4(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [26 x i8] c"Digite um n\C3\BAmero real: \0A\00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [15 x i8] c"N\C3\BAmero = %.2f\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
store i32 0, i32* %1
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %2)
%5 = load float, float* %2
%6 = fpext float %5 to double
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0), double %6)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [15 x i8] c"N\C3\BAmero = %.2f\00"
@str = [25 x i8] c"Digite um n\C3\BAmero real: \00"
define i32 @main() {
%1 = alloca float
%2 = bitcast float* %1 to i8*
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %1)
%5 = load float, float* %1
%6 = fpext float %5 to double
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0), double %6)
ret i32 0
}
void EC_GROUP_set_curve_name(void) {}


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

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

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

LLVM IR (-O2):
define void @EC_GROUP_set_curve_name() {
ret void
}
int filaObjetivo(int j) {
  if (j == 1) {
    return 9;
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<filaObjetivo>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
jne    111d <filaObjetivo+0x1d>
movl   $0x9,-0x4(%rbp)
jmp    1124 <filaObjetivo+0x24>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<filaObjetivo>:
xor    %eax,%eax
cmp    $0x1,%edi
sete   %al
lea    (%rax,%rax,8),%eax
ret

LLVM IR (-O0):
define i32 @filaObjetivo(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp eq i32 %4, 1
br i1 %5, label %6, label %7
6: ; preds = %1
store i32 9, i32* %2
br label %8
7: ; preds = %1
store i32 0, i32* %2
br label %8
8: ; preds = %7, %6
%9 = load i32, i32* %2
ret i32 %9
}

LLVM IR (-O2):
define i32 @filaObjetivo(i32 %0) {
%2 = icmp eq i32 %0, 1
%3 = select i1 %2, i32 9, i32 0
ret i32 %3
}
void rop3_154_1_1(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  unsigned char stk3;
  stk3 = ~S;
  stk2 = T & stk3;
  stk1 = *D ^ stk2;
  *D = (stk1 & (~S) & (~T)) | (*D & S) | (*D & T);
}


x86 assembly (clang, -O0):
<rop3_154_1_1>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
movzbl -0x9(%rbp),%eax
xor    $0xffffffff,%eax
mov    %al,-0xd(%rbp)
movzbl -0xa(%rbp),%eax
movzbl -0xd(%rbp),%ecx
and    %ecx,%eax
mov    %al,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
movzbl -0xc(%rbp),%ecx
xor    %ecx,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
movzbl -0x9(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
movzbl -0xa(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
movzbl -0x9(%rbp),%edx
and    %edx,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
movzbl -0xa(%rbp),%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_154_1_1>:
ret

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

LLVM IR (-O2):
define void @rop3_154_1_1(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
ret void
}